decord/source/modules/applications/ApplicationActionCreators.tsx

227 lines
7.4 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 5463
2026-07-27 11:26:19 +00:00
// Function ID: 46686
2026-07-20 16:05:17 +00:00
// Name: fetchApplication
2026-07-25 08:10:48 +00:00
// Dependencies: [5, 5464, 4154, 4168, 653, 686, 507, 566, 2]
2026-07-20 16:05:17 +00:00
// Exports: useApplicationWithLoggedOutContext
2026-07-24 07:16:23 +00:00
// Module 5463 (fetchApplication)
2026-07-23 10:11:24 +00:00
import dispatcher from "dispatcher";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import _callSuper from "_callSuper";
import importDefaultResult from "_isNativeReflectConstruct";
import ME from "ME";
import initialize from "initialize";
let closure_7;
let closure_8;
const require = arg1;
2026-07-20 16:05:17 +00:00
function fetchApplication() {
return _fetchApplication(...arguments);
}
async function _fetchApplication(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let iter = (function*(applicationId, arg1, signal) {
2026-07-20 16:05:17 +00:00
let flag = arg1;
if (flag === undefined) {
flag = false;
}
yield undefined;
2026-07-23 10:11:24 +00:00
let obj = outer2_1(outer2_2[5]);
2026-07-20 16:05:17 +00:00
obj = { type: "APPLICATION_FETCH", applicationId };
obj.dispatch(obj);
2026-07-23 10:11:24 +00:00
const HTTP = outer2_0(outer2_2[6]).HTTP;
obj = { url: outer2_7.APPLICATION_PUBLIC(applicationId), query: obj1, oldFormErrors: true, signal };
obj1 = { with_guild: flag };
obj.rejectWithError = outer2_0(outer2_2[6]).rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
const tmp3 = yield HTTP.get(obj);
2026-07-23 10:11:24 +00:00
const obj5 = outer2_0(outer2_2[6]);
const obj2 = { type: "APPLICATION_FETCH_SUCCESS", application: tmp3.body, isHydrated: true };
outer2_1(outer2_2[5]).dispatch(obj2);
2026-07-20 16:05:17 +00:00
return tmp3.body;
2026-07-23 10:11:24 +00:00
})();
iter.next();
return iter;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
({ Endpoints: closure_7, NOOP: closure_8 } = ME);
2026-07-20 16:05:17 +00:00
let obj = {
createApplication(arg0) {
2026-07-23 10:11:24 +00:00
let dispatcher;
let dependencyMap;
let importDefault;
let require;
({ name: require, guildId: importDefault, type: dependencyMap, teamId: dispatcher } = arg0);
2026-07-20 16:05:17 +00:00
return callback(async () => {
2026-07-23 10:11:24 +00:00
const HTTP = outer2_0(outer2_2[6]).HTTP;
obj = { url: outer2_7.APPLICATIONS, body: obj };
obj = { name: outer1_0, type: outer1_2, guild_id: outer1_1, team_id: outer1_3, rejectWithError: outer2_0(outer2_2[6]).rejectWithMigratedError() };
2026-07-20 16:05:17 +00:00
const body = yield HTTP.post(obj).body;
2026-07-23 10:11:24 +00:00
let tmp = null != outer1_1;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = null != outer1_2;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
obj = { type: "APPLICATION_FETCH_SUCCESS", application: body };
2026-07-23 10:11:24 +00:00
outer2_1(outer2_2[5]).dispatch(obj);
const obj4 = outer2_1(outer2_2[5]);
2026-07-20 16:05:17 +00:00
}
return body;
})();
},
getApplicationsForGuild(arg0, arg1) {
let obj = arg1;
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
if (arg1 === undefined) {
obj = {};
}
2026-07-23 10:11:24 +00:00
const includeTeam = obj.includeTeam;
2026-07-20 16:05:17 +00:00
obj = Object.create(null);
obj.includeTeam = 0;
let closure_2 = Object.assign(obj, obj);
return callback(async () => {
2026-07-23 10:11:24 +00:00
const HTTP = callback(507).HTTP;
let obj = { url: outer2_7.GUILD_APPLICATIONS(outer1_0) };
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(outer1_2);
obj["include_team"] = outer1_1;
2026-07-20 16:05:17 +00:00
obj.query = obj;
2026-07-23 10:11:24 +00:00
obj.rejectWithError = callback(507).rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
const body = yield HTTP.get(obj).body;
2026-07-23 10:11:24 +00:00
const obj3 = callback(507);
includeTeam(686).dispatch({ type: "APPLICATIONS_FETCH_SUCCESS", applications: body });
2026-07-20 16:05:17 +00:00
return body;
})();
},
transferApplication(arg0) {
2026-07-23 10:11:24 +00:00
let importDefault;
let require;
({ applicationId: require, teamId: importDefault } = arg0);
2026-07-20 16:05:17 +00:00
return callback(async () => {
2026-07-23 10:11:24 +00:00
const HTTP = outer2_0(outer2_2[6]).HTTP;
obj = { url: outer2_7.APPLICATION_OWNER_TRANSFER(outer1_0), body: obj };
obj = { team_id: outer1_1, rejectWithError: outer2_0(outer2_2[6]).rejectWithMigratedError() };
2026-07-20 16:05:17 +00:00
const body = yield HTTP.post(obj).body;
2026-07-23 10:11:24 +00:00
const obj3 = outer2_0(outer2_2[6]);
outer2_1(outer2_2[5]).dispatch({ type: "APPLICATION_FETCH_SUCCESS", application: body });
2026-07-20 16:05:17 +00:00
return body;
})();
},
fetchApplications(arg0) {
let flag = arg1;
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
if (arg1 === undefined) {
flag = true;
}
return callback(async () => {
let set;
2026-07-23 10:11:24 +00:00
let found = outer1_0;
if (!outer1_1) {
found = outer1_0.filter((applicationId) => {
let isHydratedResult = null != outer3_6.getApplication(applicationId);
2026-07-20 16:05:17 +00:00
if (isHydratedResult) {
2026-07-23 10:11:24 +00:00
isHydratedResult = outer3_6.isHydrated(applicationId);
2026-07-20 16:05:17 +00:00
}
let tmp3 = !isHydratedResult;
if (tmp3) {
2026-07-23 10:11:24 +00:00
tmp3 = !outer3_6.isFetchingApplication(applicationId);
2026-07-20 16:05:17 +00:00
}
if (tmp3) {
2026-07-23 10:11:24 +00:00
tmp3 = !outer3_6.didFetchingApplicationFail(applicationId);
2026-07-20 16:05:17 +00:00
}
if (tmp3) {
tmp3 = applicationId.length > 0;
}
return tmp3;
});
}
if (found.length > 0) {
let obj = { type: "APPLICATIONS_FETCH", applicationIds: found };
2026-07-23 10:11:24 +00:00
flag(outer2_2[5]).dispatch(obj);
const HTTP = callback(outer2_2[6]).HTTP;
obj = { url: outer2_7.APPLICATIONS_PUBLIC };
2026-07-20 16:05:17 +00:00
const _URLSearchParams = URLSearchParams;
const str3 = new URLSearchParams(found.map((arg0) => {
2026-07-23 10:11:24 +00:00
const items = ["application_ids", arg0];
2026-07-20 16:05:17 +00:00
return items;
}));
obj.query = str3.toString();
obj.oldFormErrors = true;
2026-07-23 10:11:24 +00:00
const obj3 = flag(outer2_2[5]);
obj.rejectWithError = callback(outer2_2[6]).rejectWithMigratedError();
2026-07-20 16:05:17 +00:00
const tmp25 = yield HTTP.get(obj);
const body = tmp25.body;
const _Set = Set;
set = new Set(body.map((id) => id.id));
const found1 = found.filter((arg0) => !set.has(arg0));
2026-07-23 10:11:24 +00:00
obj = flag(outer2_2[5]);
2026-07-20 16:05:17 +00:00
const obj1 = { type: "APPLICATIONS_FETCH_SUCCESS", applications: tmp25.body, unknownApplicationIds: found1, isHydrated: true };
obj.dispatch(obj1);
2026-07-23 10:11:24 +00:00
const obj6 = callback(outer2_2[6]);
2026-07-20 16:05:17 +00:00
}
})();
},
fetchApplication
};
obj = {
2026-07-23 10:11:24 +00:00
getQueryId: ME.QueryIds.APPLICATIONS,
2026-07-20 16:05:17 +00:00
get(applicationId) {
let tmp = null;
if (null != applicationId) {
tmp = null;
if (importDefaultResult.isHydrated(applicationId)) {
const application = importDefaultResult.getApplication(applicationId);
tmp = null;
if (null != application) {
tmp = application;
}
}
}
return tmp;
},
load(arg0) {
if (null != arg0) {
let nextPromise = fetchApplication(arg0, false).then(closure_8);
const promise = fetchApplication(arg0, false);
} else {
nextPromise = Promise.resolve();
}
return nextPromise;
},
getIsLoading(arg0) {
let result = null != arg0;
if (result) {
result = importDefaultResult.isFetchingApplication(arg0);
}
return result;
}
};
2026-07-23 10:11:24 +00:00
const fetchStore = initialize.createFetchStore(importDefaultResult, obj);
let result = require("_callSuper").fileFinishedImporting("modules/applications/ApplicationActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default obj;
export { fetchApplication };
export const useApplication = fetchStore;
export const useApplicationWithLoggedOutContext = function useApplicationWithLoggedOutContext(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-20 16:05:17 +00:00
let tmp;
const tmp2 = fetchStore(arg0);
const data = tmp2.data;
const error = tmp2.error;
const obj = {};
2026-07-23 10:11:24 +00:00
const items = [_isNativeReflectConstruct];
2026-07-20 16:05:17 +00:00
const items1 = [arg0, data];
2026-07-23 10:11:24 +00:00
obj.app = _require(566).useStateFromStores(items, () => {
2026-07-20 16:05:17 +00:00
if (null == data) {
2026-07-23 10:11:24 +00:00
const application = outer1_4.getApplication(closure_0);
2026-07-20 16:05:17 +00:00
if (null != application) {
2026-07-23 10:11:24 +00:00
return outer1_5.createFromServer(application);
2026-07-20 16:05:17 +00:00
}
}
return data;
}, items1);
obj.isLoading = tmp2.isLoading;
if (null != error) {
tmp = error;
}
obj.error = tmp;
return obj;
};