decord/source/modules/phone/PhoneActionCreators.tsx

138 lines
5 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8666
// Function ID: 8667
2026-07-20 16:05:17 +00:00
// Name: ChangePhoneReason
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 1218, 8664, 676, 709, 530, 5232, 503, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 8666 (ChangePhoneReason)
import sendRequest from "sendRequest" /* 530 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "fetchFingerprint" /* 1218 */;
import { PHONE_VERIFICATION_MODAL_KEY as closure_5 } from "PHONE_VERIFICATION_MODAL_KEY" /* 8664 */;
import { Endpoints } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
const result = require("set").fileFinishedImporting("modules/phone/PhoneActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default {
setCountryCode(countryCode) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj = { type: "PHONE_SET_COUNTRY_CODE", countryCode };
obj.dispatch(obj);
},
removePhone(password, reason) {
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: Endpoints.PHONE, body: obj, oldFormErrors: true, rejectWithError: null };
obj = { password, change_phone_reason: reason };
2026-08-24 06:08:38 +00:00
obj[3] = sendRequest.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return HTTP.del(obj);
},
resendCode(phone) {
2026-07-23 10:11:24 +00:00
fingerprint = fingerprint.getFingerprint();
2026-07-20 16:05:17 +00:00
let tmp2 = null != fingerprint;
if (tmp2) {
tmp2 = "" !== fingerprint;
}
2026-07-29 08:29:29 +00:00
let obj = {};
2026-07-20 16:05:17 +00:00
if (tmp2) {
2026-07-23 10:11:24 +00:00
obj["X-Fingerprint"] = fingerprint;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: Endpoints.RESEND_PHONE, headers: obj, body: obj, rejectWithError: null };
obj = { phone };
2026-08-24 06:08:38 +00:00
obj[3] = sendRequest.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return HTTP.post(obj);
},
2026-08-24 06:08:38 +00:00
beginAddPhone(combined, closure_1_2) {
const HTTP = sendRequest.HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: Endpoints.PHONE, body: obj, rejectWithError: null };
2026-08-24 06:08:38 +00:00
obj = { phone: combined, change_phone_reason: closure_1_2 };
obj[2] = sendRequest.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return HTTP.post(obj);
},
2026-07-29 08:29:29 +00:00
addPhone(closure_0, closure_02, reason) {
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: Endpoints.PHONE, body: obj, oldFormErrors: true, rejectWithError: null };
obj = { phone_token: closure_0, password: closure_02, change_phone_reason: reason };
2026-08-24 06:08:38 +00:00
obj[3] = sendRequest.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return HTTP.post(obj);
},
2026-07-29 08:29:29 +00:00
addPhoneWithoutPassword(closure_0) {
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: Endpoints.PHONE_VERIFY_NO_PASSWORD, body: obj, rejectWithError: null };
obj = { code: closure_0 };
2026-08-24 06:08:38 +00:00
obj[2] = sendRequest.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return HTTP.post(obj);
},
2026-08-24 06:08:38 +00:00
beginReverifyPhone(combined, closure_1_2) {
const HTTP = sendRequest.HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: Endpoints.PHONE_REVERIFY, body: obj, rejectWithError: null };
2026-08-24 06:08:38 +00:00
obj = { phone: combined, change_phone_reason: closure_1_2 };
obj[2] = sendRequest.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return HTTP.post(obj);
},
2026-07-29 08:29:29 +00:00
reverifyPhone(closure_0, password, USER_ACTION_REQUIRED) {
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: Endpoints.PHONE_REVERIFY, body: obj, oldFormErrors: true, rejectWithError: null };
obj = { phone_token: closure_0, password, change_phone_reason: USER_ACTION_REQUIRED };
2026-08-24 06:08:38 +00:00
obj[3] = sendRequest.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return HTTP.post(obj);
},
validatePhoneForSupport(token) {
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: Endpoints.VERIFY_PHONE_FOR_TICKET, body: obj, oldFormErrors: true, rejectWithError: null };
obj = { token };
2026-08-24 06:08:38 +00:00
obj[3] = sendRequest.rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
return HTTP.post(obj);
},
verifyPhone(arg0, arg1) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
2026-07-29 08:29:29 +00:00
let flag = arg2;
2026-07-20 16:05:17 +00:00
if (arg2 === undefined) {
flag = true;
}
2026-07-29 08:29:29 +00:00
let flag2 = arg3;
if (arg3 === undefined) {
2026-07-20 16:05:17 +00:00
flag2 = false;
}
2026-07-29 08:29:29 +00:00
return flag2(function*() {
2026-08-24 06:08:38 +00:00
closure_1 = tmp2;
2026-08-04 21:03:28 +00:00
let body = tmp5;
2026-08-24 06:08:38 +00:00
const fingerprint = closure_1_4.getFingerprint();
2026-08-04 21:03:28 +00:00
let tmp15 = null != fingerprint;
if (tmp15) {
tmp15 = "" !== fingerprint;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
obj1 = {};
2026-08-04 21:03:28 +00:00
if (tmp15) {
obj1["X-Fingerprint"] = fingerprint;
}
if (c3) {
obj1.authorization = "";
}
2026-08-24 06:08:38 +00:00
const obj5 = closure_1_1(5232);
2026-08-04 21:03:28 +00:00
const obj2 = { url: null, headers: null, body: null, oldFormErrors: true, trackedActionData: null, rejectWithError: null };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_6.VERIFY_PHONE;
2026-08-04 21:03:28 +00:00
obj2[1] = obj1;
const obj3 = { phone: null, code: null };
2026-08-24 06:08:38 +00:00
obj3[0] = closure_1_0;
obj3[1] = closure_1_1;
2026-08-04 21:03:28 +00:00
obj2[2] = obj3;
const obj4 = { event: null };
2026-08-24 06:08:38 +00:00
obj4[0] = closure_1_0(503).NetworkActionNames.USER_VERIFY_PHONE;
2026-08-04 21:03:28 +00:00
obj2[4] = obj4;
2026-08-24 06:08:38 +00:00
obj2[5] = closure_1_0(530).rejectWithMigratedError();
2026-08-04 21:03:28 +00:00
body = yield obj5.post(obj2);
if (dependencyMap) {
2026-08-24 06:08:38 +00:00
const obj = closure_1_1(709);
2026-08-04 21:03:28 +00:00
const obj7 = { type: "MODAL_POP", key: null };
2026-08-24 06:08:38 +00:00
obj7[1] = closure_1_5;
2026-08-04 21:03:28 +00:00
obj.dispatch(obj7);
}
return body.body;
2026-07-29 08:29:29 +00:00
})();
2026-07-20 16:05:17 +00:00
}
};
export const ChangePhoneReason = { USER_ACTION_REQUIRED: "user_action_required", USER_SETTINGS_UPDATE: "user_settings_update", GUILD_PHONE_REQUIRED: "guild_phone_required", MFA_PHONE_UPDATE: "mfa_phone_update", CONTACT_SYNC: "contact_sync" };