decord/source/modules/application_commands/ApplicationCommandIndexActionCreators.tsx

212 lines
7.8 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 8158
// Function ID: 8159
2026-07-20 16:05:17 +00:00
// Name: _fetchApplicationCommandIndex
2026-09-02 09:53:35 +00:00
// Dependencies: [5, 673, 706, 527, 684, 695, 1470, 2]
2026-07-20 16:05:17 +00:00
// Exports: fetchApplicationCommandIndex, requestApplicationCommandIndex
2026-09-02 09:53:35 +00:00
// Module 8158 (_fetchApplicationCommandIndex)
import dispatcherDefault from "dispatcher" /* 706 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "asyncGeneratorStep" /* 5 */;
2026-09-02 09:53:35 +00:00
import ME from "ME" /* 673 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
function _fetchApplicationCommandIndex() {
let self = this;
let tmp = callback((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
c3 = 0;
c2 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, arg1) {
if (c2 === 2) {
c2 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
2026-07-20 16:05:17 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else {
try {
c2 = 2;
if (0 === c3) {
if (arg0 === 1) {
c2 = 3;
throw arg1;
} else if (arg0 === 2) {
c2 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
function retry() {
const self = this;
const apply = _retry.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}
function _retry() {
const self = this;
const tmp = v1((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c2 = 0;
c3 = 0;
2026-09-02 09:53:35 +00:00
return (/* F124751 */ function*() { ... })();
2026-07-29 08:29:29 +00:00
});
2026-08-24 06:08:38 +00:00
closure_7 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}
function end(error) {
const diff = performance.now() - c3;
2026-09-02 09:53:35 +00:00
let obj = lib2(695);
2026-07-29 08:29:29 +00:00
obj = { duration_ms: diff, error: error.error, aborted: lib2.signal.aborted, include_applications: true, retries: Math.max(constants - 1, 0), kind: null, command_type: null, url: dependencyMap, target_type: lib.type, target_id: null, failure_statuses: null };
const type = lib.type;
if ("channel" === type) {
let channelId = tmp3.channelId;
} else if ("guild" === type) {
channelId = tmp3.guildId;
} else {
channelId = null;
if ("user" !== type) {
if ("application" === type) {
channelId = tmp3.applicationId;
} else {
2026-09-02 09:53:35 +00:00
lib(1470).assertNever(tmp3);
const obj3 = lib(1470);
2026-07-29 08:29:29 +00:00
}
}
}
obj[9] = channelId;
obj[10] = closure_5;
obj.track(constants.APPLICATION_COMMAND_PERFORMANCE, obj);
}
const _performance = performance;
c3 = performance.now();
2026-08-24 06:08:38 +00:00
c4 = 0;
closure_5 = [];
2026-07-29 08:29:29 +00:00
type = type.type;
if ("channel" === type) {
2026-08-24 06:08:38 +00:00
c2 = closure_1_5.APPLICATION_COMMAND_INDEX_CHANNEL(tmp16.channelId);
2026-07-29 08:29:29 +00:00
} else {
if ("guild" === type) {
2026-08-24 06:08:38 +00:00
c2 = closure_1_5.APPLICATION_COMMAND_INDEX_GUILD(tmp16.guildId);
2026-07-29 08:29:29 +00:00
} else if ("user" !== type) {
if ("application" === type) {
2026-08-24 06:08:38 +00:00
c2 = closure_1_5.APPLICATION_COMMAND_INDEX_APPLICATION(tmp16.applicationId);
2026-07-29 08:29:29 +00:00
}
}
2026-08-24 06:08:38 +00:00
c2 = closure_1_5.APPLICATION_COMMAND_INDEX_USER;
2026-07-29 08:29:29 +00:00
}
function fetch() {
2026-09-02 09:53:35 +00:00
const HTTP = lib(527).HTTP;
2026-07-29 08:29:29 +00:00
const value = HTTP.get({
url: dependencyMap,
retries: 3 - c4 - 1,
signal: lib2.signal,
onRequestCreated() {
2026-08-24 06:08:38 +00:00
closure_4 = tmp + 1;
2026-07-29 08:29:29 +00:00
return +closure_4;
},
rejectWithError: false
});
return value.then((status) => {
if (202 === status.status) {
arr = arr.push(202);
let dispatchResult = callback(5000);
} else {
callback2({ error: false });
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[2]);
2026-07-29 08:29:29 +00:00
obj = { type: "APPLICATION_COMMAND_INDEX_FETCH_SUCCESS", target: null, index: null };
obj[1] = closure_0;
obj[2] = status.body;
dispatchResult = obj.dispatch(obj);
}
return dispatchResult;
}, (status) => {
if (signal.signal.aborted) {
arr = arr.push(1001);
callback2({ error: true });
} else if (429 === status.status) {
arr = arr.push(429);
2026-08-24 06:08:38 +00:00
let dispatchResult = callback(status.body.retry_after * closure_1_1(closure_1_2[4]).Millis.SECOND);
2026-07-29 08:29:29 +00:00
} else {
let num2 = status.status;
if (num2 == null) {
num2 = 1000;
}
arr.push(num2);
callback2({ error: true });
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[2]);
2026-07-29 08:29:29 +00:00
obj = { type: "APPLICATION_COMMAND_INDEX_FETCH_FAILURE", target: null };
obj[1] = closure_0;
dispatchResult = obj.dispatch(obj);
}
return dispatchResult;
});
}
const response = fetch();
c3 = 1;
c2 = 1;
}
} else if (arg0 === 1) {
c2 = 3;
throw arg1;
} else if (arg0 === 2) {
c2 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c2 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} catch (tmp10) {
c2 = tmp;
throw tmp10;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
})();
});
2026-08-24 06:08:38 +00:00
closure_6 = tmp;
2026-07-29 08:29:29 +00:00
let apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
applyArgumentsResult = apply(self, arguments);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ AnalyticEvents: c4, Endpoints: c5 } = ME);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/application_commands/ApplicationCommandIndexActionCreators.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const fetchApplicationCommandIndex = function fetchApplicationCommandIndex(closure_0, abortController) {
const self = this;
const apply = _fetchApplicationCommandIndex.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
export const requestApplicationCommandIndex = function requestApplicationCommandIndex(target) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj = { type: "APPLICATION_COMMAND_INDEX_FETCH_REQUEST", target };
obj.dispatch(obj);
};