148 lines
8.5 KiB
TypeScript
148 lines
8.5 KiB
TypeScript
/* Metro module 6932; source: modules/guild_templates/GuildTemplateActionCreators.tsx; dependencies: [661, 694, 507, 683, 6933, 2] */
|
|
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
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_3 = constantsModule.Endpoints;
|
|
const env0_4 = constantsModule.AnalyticEvents;
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
object2 = {};
|
|
object2.resolveGuildTemplate = resolveGuildTemplate;
|
|
object2.loadTemplatesForGuild = loadTemplatesForGuild;
|
|
object2.createGuildTemplate = createGuildTemplate;
|
|
object2.syncGuildTemplate = syncGuildTemplate;
|
|
object2.updateGuildTemplate = updateGuildTemplate;
|
|
object2.deleteGuildTemplate = deleteGuildTemplate;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_templates/GuildTemplateActionCreators.tsx');
|
|
exports.default = object2;
|
|
}
|
|
|
|
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
|
|
var object2;
|
|
const env0_0 = a0;
|
|
const defaultImport = importDefault(694) /* metro dependency 694: 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 = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
get = HTTP.get;
|
|
object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': true};
|
|
object2.url = Endpoints.UNRESOLVED_GUILD_TEMPLATE(a0);
|
|
const value5 = Reflect.apply(get, HTTP, [object2]).then(_fun55114, _fun55115).finally(_fun55116);
|
|
env0_5.set(a0, value5);
|
|
return value5;
|
|
}
|
|
|
|
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 = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const get = HTTP.get;
|
|
const object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
|
|
object2.url = Endpoints.GUILD_TEMPLATES(a0);
|
|
return Reflect.apply(get, HTTP, [object2]).then(_fun55118);
|
|
}
|
|
|
|
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 = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const post = HTTP.post;
|
|
const object2 = {};
|
|
object2.url = Endpoints.GUILD_TEMPLATES(a0);
|
|
object2.body = {name: a1, description: a2};
|
|
object2.oldFormErrors = true;
|
|
object2.rejectWithError = false;
|
|
return Reflect.apply(post, HTTP, [object2]).then(_fun55120);
|
|
}
|
|
|
|
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 = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const put = HTTP.put;
|
|
const object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
|
|
object2.url = Endpoints.GUILD_TEMPLATE(a0, a1);
|
|
return Reflect.apply(put, HTTP, [object2]).then(_fun55122);
|
|
}
|
|
|
|
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 = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const patch = HTTP.patch;
|
|
const object2 = {};
|
|
object2.url = Endpoints.GUILD_TEMPLATE(a0, a1);
|
|
object2.body = {name: a2, description: a3};
|
|
object2.oldFormErrors = true;
|
|
object2.rejectWithError = false;
|
|
return Reflect.apply(patch, HTTP, [object2]).then(_fun55124);
|
|
}
|
|
|
|
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 = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const del = HTTP.del;
|
|
const object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
|
|
object2.url = Endpoints.GUILD_TEMPLATE(a0, a1);
|
|
return Reflect.apply(del, HTTP, [object2]).then(_fun55126);
|
|
}
|
|
|
|
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 = importDefault(683) /* metro dependency 683: 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: (importDefault(6933) /* metro dependency 6933: 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 = importDefault(683) /* metro dependency 683: 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 _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__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'GUILD_TEMPLATE_LOAD_FOR_GUILD_SUCCESS',
|
|
guildTemplates: a0.body});
|
|
return a0;
|
|
}
|
|
|
|
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__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'GUILD_TEMPLATE_CREATE_SUCCESS',
|
|
guildTemplate: a0.body, code: a0.body.code});
|
|
}
|
|
|
|
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__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'GUILD_TEMPLATE_SYNC_SUCCESS',
|
|
guildTemplate: body, code: require});
|
|
}
|
|
|
|
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__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'GUILD_TEMPLATE_DELETE_SUCCESS',
|
|
guildId: env0_0, code: require});
|
|
}
|
|
|