229 lines
13 KiB
TypeScript
229 lines
13 KiB
TypeScript
/* Metro module 9347; source: modules/oauth2/actions.tsx; dependencies: [5, 1379, 1934, 661, 507, 5076, 484, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import AuthenticationActionCreators from '../../actions/AuthenticationActionCreators.tsx'; /* Metro dependency 5076 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as PathUtilsModule from '../../external/discord_common/js/shared/utils/PathUtils.tsx'; /* Metro dependency 484 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun72994(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:6, offset: 0x01d5bf0e, size: 386 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const getLocationContextServer2 = getLocationContextServer;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/oauth2/actions.tsx');
|
|
exports.getLocationContextServer = getLocationContextServer2;
|
|
exports.acceptWhitelist = function(a0) {
|
|
var HTTP = require(dependencyMap[4]).HTTP;
|
|
return HTTP.post({url: Endpoints.OAUTH2_WHITELIST_ACCEPT, query: {token: a0}, oldFormErrors: true,
|
|
rejectWithError: false});
|
|
};
|
|
exports.authorize = function() {
|
|
return _authorize.apply(this, arguments);
|
|
};
|
|
exports.fetchAuthorization = function() {
|
|
return _fetchAuthorization.apply(this, arguments);
|
|
};
|
|
exports.startSamsungAuthorization = function() {
|
|
return _startSamsungAuthorization.apply(this, arguments);
|
|
};
|
|
exports.fetchChannels = function() {
|
|
return _fetchChannels.apply(this, arguments);
|
|
};
|
|
exports.logoutWithRedirect = logoutWithRedirect;
|
|
exports.verifyUserCode = function() {
|
|
return _verifyUserCode.apply(this, arguments);
|
|
};
|
|
exports.finishUserCode = function() {
|
|
return _finishUserCode.apply(this, arguments);
|
|
};
|
|
exports.finishUserCodeTwoWayLinkError = function() {
|
|
return _finishUserCodeTwoWayLinkError.apply(this, arguments);
|
|
};
|
|
function getLocationContextServer() { // fn#72995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:167, offset: 0x01d5c090, size: 136 bytes, params: 1, frame: 17
|
|
const basicChannel = ChannelStore.getBasicChannel(SelectedChannelStore.getChannelId());
|
|
const value4 = undefined;
|
|
const guild_id = basicChannel == null ? value4 : basicChannel.guild_id;
|
|
const value5 = '10000';
|
|
return {guild_id: guild_id ?? value5, channel_id: (basicChannel == null ? value4 : basicChannel.id) ?? value5,
|
|
channel_type: (basicChannel == null ? value4 : basicChannel.type) ?? ChannelTypes.UNKNOWN};
|
|
}
|
|
|
|
function _authorize() { // fn#72996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:426, offset: 0x01d5c118, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun72998).apply(this, arguments);
|
|
async function _fun72998({authorize, clientId, scopes, responseType, redirectUri, codeChallenge, codeChallengeMethod, state, permissions, guildId, channelId, integrationType, connectedAccountProvider, nonce}) { // fn#72998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:469, offset: 0x01d5c15e, size: 364 bytes, params: 2, frame: 30
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = undefined;
|
|
await value;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const HTTP = env2_0(env2_2[4]).HTTP;
|
|
const post = HTTP.post;
|
|
const object = {};
|
|
const OAUTH2_AUTHORIZE = env2_7.OAUTH2_AUTHORIZE;
|
|
object.url = OAUTH2_AUTHORIZE;
|
|
const object2 = {client_id: clientId, response_type: responseType, redirect_uri: redirectUri,
|
|
code_challenge: codeChallenge, code_challenge_method: codeChallengeMethod};
|
|
object2.scope = scopes.join(' ');
|
|
object2.state = state;
|
|
object2.nonce = nonce;
|
|
object.query = object2;
|
|
const object3 = {guild_id: guildId};
|
|
object3.webhook_channel_id = guildId != null && channelId != null ? channelId : value;
|
|
object3.channel_id = guildId == null && channelId != null ? channelId : value;
|
|
object3.permissions = permissions;
|
|
object3.authorize = authorize;
|
|
object3.integration_type = integrationType;
|
|
object3.connected_account_provider = connectedAccountProvider;
|
|
object3.location_context = env2_8();
|
|
object.body = object3;
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = false;
|
|
await Reflect.apply(post, HTTP, [object]);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
return value.body;
|
|
}
|
|
|
|
}
|
|
|
|
function _fetchAuthorization() { // fn#72999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:1157, offset: 0x01d5c2ca, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun73001).apply(this, arguments);
|
|
async function _fun73001({clientId, scopes, responseType, redirectUri, codeChallenge, codeChallengeMethod, state, integrationType, connectedAccountProvider, nonce, signal}) { // fn#73001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:1218, offset: 0x01d5c310, size: 267 bytes, params: 2, frame: 26
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const HTTP = env2_0(env2_2[4]).HTTP;
|
|
const get = HTTP.get;
|
|
const object = {'url': null, 'query': null, 'signal': null, 'retries': 3, 'oldFormErrors': true,
|
|
'rejectWithError': false};
|
|
const OAUTH2_AUTHORIZE = env2_7.OAUTH2_AUTHORIZE;
|
|
object.url = OAUTH2_AUTHORIZE;
|
|
const object2 = {client_id: clientId, response_type: responseType, redirect_uri: redirectUri,
|
|
code_challenge: codeChallenge, code_challenge_method: codeChallengeMethod};
|
|
object2.scope = scopes.join(' ');
|
|
object2.state = state;
|
|
object2.integration_type = integrationType;
|
|
object2.connected_account_provider = connectedAccountProvider;
|
|
object2.nonce = nonce;
|
|
object.query = object2;
|
|
object.signal = signal;
|
|
await Reflect.apply(get, HTTP, [object]);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
return value.body;
|
|
}
|
|
|
|
}
|
|
|
|
function _startSamsungAuthorization() { // fn#73002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:1705, offset: 0x01d5c41b, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun73004).apply(this, arguments);
|
|
function* _fun73004(a0, a1, a2, a3, a4) { // fn#73004, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:1780, offset: 0x01d5c458, size: 162 bytes, params: 6, frame: 17
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var HTTP = env2_0(env2_2[4]).HTTP;
|
|
var get = HTTP.get;
|
|
var object = {};
|
|
var OAUTH2_AUTHORIZE_SAMSUNG = env2_7.OAUTH2_AUTHORIZE_SAMSUNG;
|
|
object.url = OAUTH2_AUTHORIZE_SAMSUNG;
|
|
var object2 = {client_id: a0, state: a4, response_type: a2, redirect_uri: a3, prompt: 'consent'};
|
|
object2.scope = a1.join(' ');
|
|
object.query = object2;
|
|
object.rejectWithError = false;
|
|
yield Reflect.apply(get, HTTP, [object]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fetchChannels() { // fn#73005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:1997, offset: 0x01d5c4fa, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun73007).apply(this, arguments);
|
|
function* _fun73007(a0) { // fn#73007, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:2048, offset: 0x01d5c537, size: 114 bytes, params: 2, frame: 14
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const HTTP = env2_0(env2_2[4]).HTTP;
|
|
const get = HTTP.get;
|
|
const OAUTH2_AUTHORIZE_WEBHOOK_CHANNELS = env2_7.OAUTH2_AUTHORIZE_WEBHOOK_CHANNELS;
|
|
yield Reflect.apply(get, HTTP, [{url: OAUTH2_AUTHORIZE_WEBHOOK_CHANNELS, query: {guild_id: a0}, oldFormErrors: true,
|
|
rejectWithError: false}]);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
return value.body;
|
|
}
|
|
|
|
}
|
|
|
|
function _verifyUserCode() { // fn#73008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:2221, offset: 0x01d5c5a9, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun73010).apply(this, arguments);
|
|
function* _fun73010(a0) { // fn#73010, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:2274, offset: 0x01d5c5e6, size: 103 bytes, params: 2, frame: 14
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var HTTP = env2_0(env2_2[4]).HTTP;
|
|
var post = HTTP.post;
|
|
var OAUTH2_DEVICE_VERIFY = env2_7.OAUTH2_DEVICE_VERIFY;
|
|
yield Reflect.apply(post, HTTP, [{url: OAUTH2_DEVICE_VERIFY, body: {user_code: a0}, rejectWithError: false}]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _finishUserCode() { // fn#73011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:2412, offset: 0x01d5c64d, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun73013).apply(this, arguments);
|
|
function* _fun73013(a0, a1) { // fn#73013, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:2465, offset: 0x01d5c68a, size: 111 bytes, params: 3, frame: 14
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var HTTP = env2_0(env2_2[4]).HTTP;
|
|
var post = HTTP.post;
|
|
var OAUTH2_DEVICE_FINISH = env2_7.OAUTH2_DEVICE_FINISH;
|
|
yield Reflect.apply(post, HTTP, [{url: OAUTH2_DEVICE_FINISH, body: {user_code: a0, result: a1},
|
|
rejectWithError: false}]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _finishUserCodeTwoWayLinkError() { // fn#73014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:2614, offset: 0x01d5c6f9, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun73016).apply(this, arguments);
|
|
function* _fun73016(a0, a1, a2) { // fn#73016, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:2697, offset: 0x01d5c736, size: 135 bytes, params: 4, frame: 14
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var HTTP = env2_0(env2_2[4]).HTTP;
|
|
var post = HTTP.post;
|
|
var OAUTH2_DEVICE_FINISH = env2_7.OAUTH2_DEVICE_FINISH;
|
|
yield Reflect.apply(post, HTTP, [{url: OAUTH2_DEVICE_FINISH, body: {user_code: a0, result: 'two_way_link_error',
|
|
error_code: a1, error_source: a2}, rejectWithError: false}]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function logoutWithRedirect({pathname, search}, a1) { // fn#73022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9533:3568, offset: 0x01d5c814, size: 91 bytes, params: 3, frame: 16
|
|
const defaultImport = AuthenticationActionCreators;
|
|
const logout = defaultImport.logout;
|
|
let value = PathUtilsModule;
|
|
value = value.getLoginPath(pathname + search, false);
|
|
Reflect.apply(logout, defaultImport, [a1, value]);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun72994, 9347, [5, 1379, 1934, 661, 507, 5076, 484,
|
|
2]) /* metro module 9347, dependencies: [5, 1379, 1934, 661, 507, 5076, 484, 2] */;
|