133 lines
7.4 KiB
TypeScript
133 lines
7.4 KiB
TypeScript
/* Metro module 15205; source: actions/WebhooksActionCreators.tsx; dependencies: [661, 694, 507, 22, 2] */
|
|
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 _fun116293(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:6, offset: 0x02484034, size: 191 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_4 = ['Spidey Bot', 'Captain Hook'];
|
|
object = {fetchForGuild: fetchForGuild, fetchForChannel: fetchForChannel, create: create_116300, delete: _fun116302,
|
|
update: update_116304};
|
|
(FileImportTrackerModule).fileFinishedImporting('actions/WebhooksActionCreators.tsx');
|
|
exports.default = object;
|
|
function fetchForGuild(a0) { // fn#116294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:151, offset: 0x024840f3, size: 159 bytes, params: 2, frame: 17
|
|
const env0_0 = a0;
|
|
(Dispatcher).dispatch({type: 'WEBHOOKS_FETCHING', guildId: a0});
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const get = HTTP.get;
|
|
object = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
|
|
object.url = Endpoints.GUILD_WEBHOOKS(a0);
|
|
let value = Reflect.apply(get, HTTP, [object]);
|
|
value = value.then(_fun116295);
|
|
value.catch(_fun116296);
|
|
function _fun116295({body}) { // fn#116295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:309, offset: 0x02484192, size: 73 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
return (Dispatcher).dispatch({type: 'WEBHOOKS_UPDATE',
|
|
guildId: env0_0, webhooks: body});
|
|
}
|
|
|
|
function _fun116296({body}) { // fn#116296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:394, offset: 0x024841db, size: 77 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'WEBHOOKS_UPDATE', guildId: env0_0,
|
|
error: body.message});
|
|
}
|
|
|
|
}
|
|
|
|
function fetchForChannel(a0, a1) { // fn#116297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:480, offset: 0x02484228, size: 170 bytes, params: 3, frame: 18
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
(Dispatcher).dispatch({type: 'WEBHOOKS_FETCHING', guildId: a0,
|
|
channelId: a1});
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const get = HTTP.get;
|
|
object = {'url': null, 'oldFormErrors': true, 'rejectWithError': true};
|
|
object.url = Endpoints.CHANNEL_WEBHOOKS(a1);
|
|
let value = Reflect.apply(get, HTTP, [object]);
|
|
value = value.then(_fun116298);
|
|
value.catch(_fun116299);
|
|
function _fun116298({body}) { // fn#116298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:656, offset: 0x024842d2, size: 81 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__;
|
|
return (Dispatcher).dispatch({type: 'WEBHOOKS_UPDATE',
|
|
guildId: env0_0, channelId: require, webhooks: body});
|
|
}
|
|
|
|
function _fun116299({body}) { // fn#116299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:753, offset: 0x024841db, size: 77 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'WEBHOOKS_UPDATE', guildId: env0_0,
|
|
error: body.message});
|
|
}
|
|
|
|
}
|
|
|
|
function create_116300(a0, a1, a2) { // fn#116300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:846, offset: 0x02484323, size: 184 bytes, params: 4, frame: 17
|
|
var r5;
|
|
var binding;
|
|
let value = a2;
|
|
const env0_0 = a0;
|
|
if (value != null) {
|
|
r5 = value;
|
|
} else {
|
|
binding = env0_4;
|
|
value = importDefault(22) /* metro dependency 22 */;
|
|
r5 = binding[value.random(0, binding.length - 1)];
|
|
}
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const post = HTTP.post;
|
|
const object = {};
|
|
object.url = Endpoints.CHANNEL_WEBHOOKS(a1);
|
|
object.body = {name: r5};
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = false;
|
|
return Reflect.apply(post, HTTP, [object]).then(_fun116301);
|
|
function _fun116301({body}) { // fn#116301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:1004, offset: 0x024843db, size: 71 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'WEBHOOK_CREATE', guildId: env0_0,
|
|
webhook: body});
|
|
return body;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun116302(a0, a1) { // fn#116302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:1092, offset: 0x02484422, size: 107 bytes, params: 3, frame: 15
|
|
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.WEBHOOK(a1);
|
|
return Reflect.apply(del, HTTP, [object]).then(_fun116303);
|
|
function _fun116303() { // fn#116303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:1178, offset: 0x0248448d, size: 67 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'WEBHOOK_DELETE', guildId: env0_0,
|
|
webhookId: require});
|
|
}
|
|
|
|
}
|
|
|
|
function update_116304(a0, a1, a2) { // fn#116304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:1257, offset: 0x024844d0, size: 113 bytes, params: 4, frame: 15
|
|
const env0_0 = a0;
|
|
const HTTP = (HTTPUtilsModule).HTTP;
|
|
const patch = HTTP.patch;
|
|
const object = {};
|
|
object.url = Endpoints.WEBHOOK(a1);
|
|
object.body = a2;
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = false;
|
|
return Reflect.apply(patch, HTTP, [object]).then(_fun116305);
|
|
function _fun116305({body}) { // fn#116305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15402:1354, offset: 0x02484541, size: 71 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
(Dispatcher).dispatch({type: 'WEBHOOK_UPDATE', guildId: env0_0,
|
|
webhook: body});
|
|
return body;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun116293, 15205, [661, 694, 507, 22, 2]) /* metro module 15205, dependencies: [661, 694, 507, 22, 2] */;
|