254 lines
13 KiB
TypeScript
254 lines
13 KiB
TypeScript
/* Metro module 5084; source: modules/webauthn/WebAuthnActionCreators.tsx; dependencies: [5, 661, 507, 694, 5046, 648, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as HTTPUtilsModule from '../../external/discord_common/js/packages/http-utils/HTTPUtils.tsx'; /* Metro dependency 507 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun44121(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:6, offset: 0x01168c5c, size: 286 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/webauthn/WebAuthnActionCreators.tsx');
|
|
exports.fetchWebAuthnConditionalChallenge = function() {
|
|
return _fetchWebAuthnConditionalChallenge.apply(this, arguments);
|
|
};
|
|
exports.fetchWebAuthnPasswordlessChallenge = function() {
|
|
return _fetchWebAuthnPasswordlessChallenge.apply(this, arguments);
|
|
};
|
|
exports.fetchWebAuthnCredentials = fetchWebAuthnCredentials;
|
|
exports.deleteWebAuthnCredential = function() {
|
|
return _deleteWebAuthnCredential.apply(this, arguments);
|
|
};
|
|
exports.editWebAuthnCredential = function() {
|
|
return _editWebAuthnCredential.apply(this, arguments);
|
|
};
|
|
exports.startRegisterWebAuthnCredential = function() {
|
|
return _startRegisterWebAuthnCredential.apply(this, arguments);
|
|
};
|
|
exports.finishRegisterWebAuthnCredential = function() {
|
|
return _finishRegisterWebAuthnCredential.apply(this, arguments);
|
|
};
|
|
exports.triggerWebAuthnRegister = triggerWebAuthnRegister;
|
|
exports.clearWebAuthnRegisterTrigger = clearWebAuthnRegisterTrigger;
|
|
function _fetchWebAuthnConditionalChallenge() { // fn#44122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:126, offset: 0x01168d7a, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun44124).apply(this, arguments);
|
|
function* _fun44124() { // fn#44124, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:217, offset: 0x01168db3, size: 137 bytes, params: 1, frame: 14
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const HTTP = env2_0(env2_2[2]).HTTP;
|
|
const post = HTTP.post;
|
|
const WEBAUTHN_CONDITIONAL_UI_CHALLENGE = env2_4.WEBAUTHN_CONDITIONAL_UI_CHALLENGE;
|
|
yield Reflect.apply(post, HTTP, [{url: WEBAUTHN_CONDITIONAL_UI_CHALLENGE, headers: {authorization: ''},
|
|
rejectWithError: true}]);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
const body = value.body;
|
|
return {challenge: body.challenge, ticket: body.ticket};
|
|
}
|
|
|
|
}
|
|
|
|
function _fetchWebAuthnPasswordlessChallenge() { // fn#44125, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:427, offset: 0x01168e3c, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun44127).apply(this, arguments);
|
|
function* _fun44127() { // fn#44127, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:520, offset: 0x01168e75, size: 118 bytes, params: 1, frame: 13
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const HTTP = env2_0(env2_2[2]).HTTP;
|
|
const post = HTTP.post;
|
|
const WEBAUTHN_PASSWORDLESS_CHALLENGE = env2_4.WEBAUTHN_PASSWORDLESS_CHALLENGE;
|
|
yield Reflect.apply(post, HTTP, [{url: WEBAUTHN_PASSWORDLESS_CHALLENGE, rejectWithError: true}]);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
const body = value.body;
|
|
return {challenge: body.challenge, ticket: body.ticket};
|
|
}
|
|
|
|
}
|
|
|
|
function _deleteWebAuthnCredential() { // fn#44128, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:701, offset: 0x01168eeb, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun44130).apply(this, arguments);
|
|
function* _fun44130(a0) { // fn#44130, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:774, offset: 0x01168f24, size: 123 bytes, params: 2, frame: 16
|
|
var environment;
|
|
if (true) {
|
|
var env0_0 = a0;
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_0;
|
|
var HTTP = binding(env2_2[2]).HTTP;
|
|
var del = HTTP.del;
|
|
binding = env2_4;
|
|
var MFA_WEBAUTHN_CREDENTIAL = binding.MFA_WEBAUTHN_CREDENTIAL;
|
|
value = Reflect.apply(del, HTTP, [{url: Reflect.apply(MFA_WEBAUTHN_CREDENTIAL, binding, [a0.id]),
|
|
rejectWithError: true}]);
|
|
yield value.then(_fun44131);
|
|
}
|
|
function _fun44131() { // fn#44131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:881, offset: 0x01168f9f, size: 59 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
env3_1(env3_2[3]).dispatch({type: 'AUTHENTICATOR_DELETE', credential: env0_0});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _editWebAuthnCredential() { // fn#44132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:976, offset: 0x01168fda, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun44134).apply(this, arguments);
|
|
function* _fun44134(a0, a1) { // fn#44134, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:1045, offset: 0x01169013, size: 252 bytes, params: 3, frame: 18
|
|
var r5;
|
|
var r8;
|
|
var last_used;
|
|
var Date;
|
|
var date;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_0;
|
|
var HTTP = binding(env2_2[2]).HTTP;
|
|
var patch = HTTP.patch;
|
|
var object = {};
|
|
object.url = env2_4.MFA_WEBAUTHN_CREDENTIAL(a0);
|
|
object.body = {name: a1};
|
|
object.rejectWithError = false;
|
|
yield Reflect.apply(patch, HTTP, [object]);
|
|
var value3 = undefined;
|
|
if (false) {
|
|
return value3;
|
|
}
|
|
var body = value3.body;
|
|
var value5 = null;
|
|
if (value5 != body) {
|
|
body = value3.body;
|
|
last_used = body.last_used;
|
|
if (value5 == last_used) {
|
|
r5 = value5;
|
|
r8 = binding;
|
|
} else {
|
|
Date = global.Date;
|
|
last_used = body.last_used;
|
|
date = new Date();
|
|
r8 = Date;
|
|
}
|
|
object = {};
|
|
copyDataProperties(object, body, r8);
|
|
object['last_used'] = r5;
|
|
binding = env2_1;
|
|
value = binding(env2_2[3]);
|
|
value.dispatch({type: 'AUTHENTICATOR_UPDATE', credential: object});
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _startRegisterWebAuthnCredential() { // fn#44135, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:1346, offset: 0x0116910f, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun44137).apply(this, arguments);
|
|
function* _fun44137() { // fn#44137, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:1433, offset: 0x01169148, size: 124 bytes, params: 1, frame: 13
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const HTTP = env2_0(env2_2[2]).HTTP;
|
|
const post = HTTP.post;
|
|
const MFA_WEBAUTHN_CREDENTIALS = env2_4.MFA_WEBAUTHN_CREDENTIALS;
|
|
yield Reflect.apply(post, HTTP, [{url: MFA_WEBAUTHN_CREDENTIALS, body: {}, rejectWithError: false}]);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
const body = value.body;
|
|
return {ticket: body.ticket, challenge: body.challenge};
|
|
}
|
|
|
|
}
|
|
|
|
function _finishRegisterWebAuthnCredential() { // fn#44138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:1615, offset: 0x011691c4, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun44140).apply(this, arguments);
|
|
function* _fun44140(a0, a1, a2) { // fn#44140, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:1704, offset: 0x011691fd, size: 255 bytes, params: 4, frame: 18
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_1;
|
|
var binding2 = env2_2;
|
|
var value3 = binding(binding2[4]);
|
|
var post = value3.post;
|
|
var object = {};
|
|
var MFA_WEBAUTHN_CREDENTIALS = env2_4.MFA_WEBAUTHN_CREDENTIALS;
|
|
object.url = MFA_WEBAUTHN_CREDENTIALS;
|
|
object.body = {name: a0, ticket: a1, credential: a2};
|
|
var NetworkActionNames = env2_0(binding2[5]).NetworkActionNames;
|
|
var WEBAUTHN_REGISTER = NetworkActionNames.WEBAUTHN_REGISTER;
|
|
object.trackedActionData = {event: WEBAUTHN_REGISTER};
|
|
object.rejectWithError = true;
|
|
yield Reflect.apply(post, value3, [object]);
|
|
var value4 = undefined;
|
|
if (false) {
|
|
return value4;
|
|
}
|
|
binding = env2_1;
|
|
var binding3 = env2_2;
|
|
value = binding(binding3[3]);
|
|
value.dispatch({type: 'AUTHENTICATOR_CREATE', credential: value4.body});
|
|
value = binding(binding3[3]);
|
|
value.dispatch({type: 'MFA_ENABLE_SUCCESS', codes: value4.body.backup_codes});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function fetchWebAuthnCredentials() { // fn#44143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:2469, offset: 0x011692fc, size: 81 bytes, params: 1, frame: 13
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const get = HTTP.get;
|
|
const MFA_WEBAUTHN_CREDENTIALS = Endpoints.MFA_WEBAUTHN_CREDENTIALS;
|
|
Reflect.apply(get, HTTP, [{url: MFA_WEBAUTHN_CREDENTIALS, rejectWithError: true}]).then(_fun44144);
|
|
function _fun44144(a0) { // fn#44144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:2581, offset: 0x0116934d, size: 90 bytes, params: 2, frame: 13
|
|
var environment;
|
|
var value;
|
|
var value2;
|
|
var defaultImport;
|
|
if (a0.body != null) {
|
|
value = a0.body.map(function(a0) {
|
|
var r4;
|
|
var r2;
|
|
var Date;
|
|
var last_used;
|
|
var value = null;
|
|
if (value == a0.last_used) {
|
|
r2 = value;
|
|
} else {
|
|
Date = global.Date;
|
|
last_used = a0.last_used;
|
|
r2 = new Date();
|
|
r4 = Date;
|
|
}
|
|
var object = {};
|
|
copyDataProperties(object, a0, r4);
|
|
object['last_used'] = r2;
|
|
return object;
|
|
});
|
|
value2 = environment.__proto__;
|
|
defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
defaultImport.dispatch({type: 'MFA_WEBAUTHN_CREDENTIALS_LOADED', credentials: value});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function triggerWebAuthnRegister() { // fn#44150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:3322, offset: 0x011693f2, size: 49 bytes, params: 1, frame: 13
|
|
(Dispatcher).dispatch({type: 'WEBAUTHN_TRIGGER_REGISTER'});
|
|
}
|
|
|
|
function clearWebAuthnRegisterTrigger() { // fn#44151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5262:3442, offset: 0x01169423, size: 49 bytes, params: 1, frame: 13
|
|
(Dispatcher).dispatch({type: 'WEBAUTHN_CLEAR_REGISTER_TRIGGER'});
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun44121, 5084, [5, 661, 507, 694, 5046, 648,
|
|
2]) /* metro module 5084, dependencies: [5, 661, 507, 694, 5046, 648, 2] */;
|