166 lines
9.9 KiB
TypeScript
166 lines
9.9 KiB
TypeScript
/* Metro module 6932; source: modules/guild_templates/GuildTemplateActionCreators.tsx; dependencies: [661, 694, 507, 683, 6933, 2] */
|
|
import AnalyticsUtils from '../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import CreateResolvedGuildTemplate from './createResolvedGuildTemplate.tsx'; /* Metro dependency 6933 */
|
|
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 _fun55111(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:6, offset: 0x01376260, size: 231 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
object = {};
|
|
object.resolveGuildTemplate = resolveGuildTemplate;
|
|
object.loadTemplatesForGuild = loadTemplatesForGuild;
|
|
object.createGuildTemplate = createGuildTemplate;
|
|
object.syncGuildTemplate = syncGuildTemplate;
|
|
object.updateGuildTemplate = updateGuildTemplate;
|
|
object.deleteGuildTemplate = deleteGuildTemplate;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_templates/GuildTemplateActionCreators.tsx');
|
|
exports.default = object;
|
|
function resolveGuildTemplate(a0) { // fn#55112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:177, offset: 0x01376347, size: 268 bytes, params: 2, frame: 19
|
|
const env0_0 = a0;
|
|
const defaultImport = Dispatcher;
|
|
if (defaultImport.isDispatching()) {
|
|
return global.Promise.resolve().then(_fun55113);
|
|
}
|
|
const binding = env0_5;
|
|
let get = binding.get;
|
|
const value2 = Reflect.apply(get, binding, [a0]);
|
|
if (value2 != null) {
|
|
return value2;
|
|
}
|
|
defaultImport.dispatch({type: 'GUILD_TEMPLATE_RESOLVE', code: a0});
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
get = HTTP.get;
|
|
object = {'url': null, 'oldFormErrors': true, 'rejectWithError': true};
|
|
object.url = Endpoints.UNRESOLVED_GUILD_TEMPLATE(a0);
|
|
const value5 = Reflect.apply(get, HTTP, [object]).then(_fun55114, _fun55115).finally(_fun55116);
|
|
env0_5.set(a0, value5);
|
|
return value5;
|
|
function _fun55113() { // fn#55113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:268, offset: 0x01376453, size: 23 bytes, params: 1, frame: 11
|
|
return resolveGuildTemplate(env0_0);
|
|
}
|
|
|
|
function _fun55114({body}) { // fn#55114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:493, offset: 0x0137646a, size: 179 bytes, params: 2, frame: 19
|
|
let value = environment.__proto__;
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const GUILD_TEMPLATE_RESOLVED = AnalyticEvents.GUILD_TEMPLATE_RESOLVED;
|
|
const binding = env0_0;
|
|
Reflect.apply(track, defaultImport, [GUILD_TEMPLATE_RESOLVED, {resolved: true, guild_template_code: binding,
|
|
guild_template_name: body.name, guild_template_description: body.description,
|
|
guild_template_guild_id: body.source_guild_id}]);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'GUILD_TEMPLATE_RESOLVE_SUCCESS', guildTemplate: body, code: binding});
|
|
return {guildTemplate: (CreateResolvedGuildTemplate)(body),
|
|
code: binding};
|
|
}
|
|
|
|
function _fun55115() { // fn#55115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:822, offset: 0x0137651d, size: 120 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__;
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const GUILD_TEMPLATE_RESOLVED = AnalyticEvents.GUILD_TEMPLATE_RESOLVED;
|
|
const binding = env0_0;
|
|
Reflect.apply(track, defaultImport, [GUILD_TEMPLATE_RESOLVED, {resolved: false, guild_template_code: binding}]);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'GUILD_TEMPLATE_RESOLVE_FAILURE', code: binding});
|
|
return {guildTemplate: null, code: binding};
|
|
}
|
|
|
|
function _fun55116() { // fn#55116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:1009, offset: 0x01029aec, size: 28 bytes, params: 1, frame: 11
|
|
env1_5.delete(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function loadTemplatesForGuild(a0) { // fn#55117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:1072, offset: 0x01376595, size: 93 bytes, params: 2, frame: 14
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const get = HTTP.get;
|
|
const object = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
|
|
object.url = Endpoints.GUILD_TEMPLATES(a0);
|
|
return Reflect.apply(get, HTTP, [object]).then(_fun55118);
|
|
function _fun55118(a0) { // fn#55118, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:1162, offset: 0x013765f2, size: 62 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'GUILD_TEMPLATE_LOAD_FOR_GUILD_SUCCESS',
|
|
guildTemplates: a0.body});
|
|
return a0;
|
|
}
|
|
|
|
}
|
|
|
|
function createGuildTemplate(a0, a1, a2) { // fn#55119, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:1278, offset: 0x01376630, size: 117 bytes, params: 4, frame: 14
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const post = HTTP.post;
|
|
const object = {};
|
|
object.url = Endpoints.GUILD_TEMPLATES(a0);
|
|
object.body = {name: a1, description: a2};
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = false;
|
|
return Reflect.apply(post, HTTP, [object]).then(_fun55120);
|
|
function _fun55120(a0) { // fn#55120, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:1403, offset: 0x013766a5, size: 76 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'GUILD_TEMPLATE_CREATE_SUCCESS',
|
|
guildTemplate: a0.body, code: a0.body.code});
|
|
}
|
|
|
|
}
|
|
|
|
function syncGuildTemplate(a0, a1) { // fn#55121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:1523, offset: 0x013766f1, size: 102 bytes, params: 3, frame: 17
|
|
const env0_0 = a1;
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const put = HTTP.put;
|
|
const object = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
|
|
object.url = Endpoints.GUILD_TEMPLATE(a0, a1);
|
|
return Reflect.apply(put, HTTP, [object]).then(_fun55122);
|
|
function _fun55122({body}) { // fn#55122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:1618, offset: 0x01376757, size: 73 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'GUILD_TEMPLATE_SYNC_SUCCESS',
|
|
guildTemplate: body, code: require});
|
|
}
|
|
|
|
}
|
|
|
|
function updateGuildTemplate(a0, a1, a2, a3) { // fn#55123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:1728, offset: 0x013767a0, size: 125 bytes, params: 5, frame: 17
|
|
const env0_0 = a1;
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const patch = HTTP.patch;
|
|
const object = {};
|
|
object.url = Endpoints.GUILD_TEMPLATE(a0, a1);
|
|
object.body = {name: a2, description: a3};
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = false;
|
|
return Reflect.apply(patch, HTTP, [object]).then(_fun55124);
|
|
function _fun55124({body}) { // fn#55124, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:1857, offset: 0x01376757, size: 73 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'GUILD_TEMPLATE_SYNC_SUCCESS',
|
|
guildTemplate: body, code: require});
|
|
}
|
|
|
|
}
|
|
|
|
function deleteGuildTemplate(a0, a1) { // fn#55125, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:1967, offset: 0x0137681d, size: 106 bytes, params: 3, frame: 17
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const del = HTTP.del;
|
|
const object = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
|
|
object.url = Endpoints.GUILD_TEMPLATE(a0, a1);
|
|
return Reflect.apply(del, HTTP, [object]).then(_fun55126);
|
|
function _fun55126() { // fn#55126, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7110:2062, offset: 0x01376887, size: 68 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'GUILD_TEMPLATE_DELETE_SUCCESS',
|
|
guildId: env0_0, code: require});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun55111, 6932, [661, 694, 507, 683, 6933,
|
|
2]) /* metro module 6932, dependencies: [661, 694, 507, 683, 6933, 2] */;
|