decord/source/modules/rpc/server/commands/application.tsx

92 lines
3.4 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 13459
// Function ID: 103473
// Dependencies: [4168, 4034, 653, 10557, 10559, 13460, 5664, 10554, 10568, 675, 507, 6444, 2]
2026-07-20 16:05:17 +00:00
2026-07-27 11:26:19 +00:00
// Module 13459
2026-07-20 16:05:17 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
2026-07-23 10:11:24 +00:00
import ME from "ME";
2026-07-20 16:05:17 +00:00
let RPCCommands;
2026-07-23 10:11:24 +00:00
let closure_4;
let closure_5;
let closure_6;
const require = arg1;
({ ApplicationFlags: closure_4, Endpoints: closure_5, RPCCommands, RPCErrors: closure_6 } = ME);
2026-07-20 16:05:17 +00:00
let obj = {
validation(string) {
2026-07-27 11:26:19 +00:00
let obj = importDefault(10557)(string);
2026-07-20 16:05:17 +00:00
obj = {};
const requiredResult = obj.required();
obj.event_name = string.string().required();
const stringResult = string.string();
2026-07-27 11:26:19 +00:00
obj.event_properties = importDefault(10557)(string).required();
2026-07-20 16:05:17 +00:00
return requiredResult.keys(obj);
},
handler(arg0) {
let args;
let socket;
({ socket, args } = arg0);
const event_properties = args.event_properties;
2026-07-27 11:26:19 +00:00
let obj = require(10559) /* recurseReplaceContentTree */;
2026-07-20 16:05:17 +00:00
const result = obj.validatePostMessageTransport(socket.transport);
2026-07-27 11:26:19 +00:00
let obj1 = require(10559) /* recurseReplaceContentTree */;
2026-07-20 16:05:17 +00:00
obj1.validateApplication(socket.application);
const id = socket.application.id;
2026-07-27 11:26:19 +00:00
const obj3 = importDefault(13460)();
2026-07-20 16:05:17 +00:00
if (null != obj3) {
const guildId = obj3.getGuildId();
}
2026-07-23 10:11:24 +00:00
application = application.getApplication(id);
2026-07-20 16:05:17 +00:00
if (obj4.hasApplicationFlag(application, constants.EMBEDDED_FIRST_PARTY)) {
2026-07-27 11:26:19 +00:00
const activeAnalyticsSessionIDs = require(10568) /* _createForOfIteratorHelperLoose */.getActiveAnalyticsSessionIDs(id);
2026-07-20 16:05:17 +00:00
obj = { activity_application_id: id };
let type;
if (null != obj3) {
type = obj3.type;
}
obj.activity_channel_type = type;
obj.activity_guild_id = guildId;
let prop;
if (null != activeAnalyticsSessionIDs) {
prop = activeAnalyticsSessionIDs.activityUserSessionId;
}
obj.activity_user_session_id = prop;
2026-07-27 11:26:19 +00:00
const obj6 = require(10568) /* _createForOfIteratorHelperLoose */;
2026-07-20 16:05:17 +00:00
obj = {};
const merged = Object.assign(obj);
const merged1 = Object.assign(event_properties);
2026-07-23 10:11:24 +00:00
importDefault(675).track(args.event_name, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-27 11:26:19 +00:00
let tmp7 = importDefault(10554);
2026-07-20 16:05:17 +00:00
obj1 = { errorCode: constants2.INVALID_COMMAND };
const prototype = tmp7.prototype;
tmp7 = new tmp7(obj1, "This application cannot access this API");
throw tmp7;
}
2026-07-25 08:10:48 +00:00
obj4 = require(5664) /* getApplicationFlags */;
2026-07-20 16:05:17 +00:00
}
};
obj = {
2026-07-23 10:11:24 +00:00
scope: require("RPC_SCOPE_CONFIG").RPC_LOCAL_SCOPE,
2026-07-20 16:05:17 +00:00
handler(socket) {
const id = socket.socket.application.id;
if (null == id) {
2026-07-27 11:26:19 +00:00
let tmp3 = importDefault(10554);
2026-07-20 16:05:17 +00:00
let obj = { errorCode: constants2.INVALID_COMMAND };
const prototype = tmp3.prototype;
tmp3 = new tmp3(obj, "No application.");
throw tmp3;
} else {
2026-07-23 10:11:24 +00:00
const HTTP = require(507) /* _isNativeReflectConstruct */.HTTP;
obj = { url: closure_5.APPLICATION_TICKET(id), body: null, retries: 3, oldFormErrors: true, rejectWithError: false };
2026-07-25 08:10:48 +00:00
obj = { test_mode: require(6444) /* isTestModeForApplication */.isTestModeForApplication(id) };
2026-07-20 16:05:17 +00:00
obj.body = obj;
2026-07-25 08:10:48 +00:00
const obj4 = require(6444) /* isTestModeForApplication */;
2026-07-20 16:05:17 +00:00
return HTTP.post(obj).then((body) => body.body);
}
}
};
2026-07-23 10:11:24 +00:00
let result = require("ME").fileFinishedImporting("modules/rpc/server/commands/application.tsx");
2026-07-20 16:05:17 +00:00
export default { [RPCCommands.SEND_ANALYTICS_EVENT]: obj, [RPCCommands.GET_APPLICATION_TICKET]: obj };