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

92 lines
3.4 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 13447
// Function ID: 103341
// Dependencies: [4167, 4033, 653, 10528, 10530, 13448, 7371, 10525, 10537, 675, 507, 7369, 2]
2026-07-20 16:05:17 +00:00
2026-07-24 07:16:23 +00:00
// Module 13447
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-24 07:16:23 +00:00
let obj = importDefault(10528)(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-24 07:16:23 +00:00
obj.event_properties = importDefault(10528)(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-24 07:16:23 +00:00
let obj = require(10530) /* recurseReplaceContentTree */;
2026-07-20 16:05:17 +00:00
const result = obj.validatePostMessageTransport(socket.transport);
2026-07-24 07:16:23 +00:00
let obj1 = require(10530) /* recurseReplaceContentTree */;
2026-07-20 16:05:17 +00:00
obj1.validateApplication(socket.application);
const id = socket.application.id;
2026-07-24 07:16:23 +00:00
const obj3 = importDefault(13448)();
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-24 07:16:23 +00:00
const activeAnalyticsSessionIDs = require(10537) /* _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-24 07:16:23 +00:00
const obj6 = require(10537) /* _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-24 07:16:23 +00:00
let tmp7 = importDefault(10525);
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-23 10:11:24 +00:00
obj4 = require(7371) /* 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-24 07:16:23 +00:00
let tmp3 = importDefault(10525);
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 };
obj = { test_mode: require(7369) /* isTestModeForApplication */.isTestModeForApplication(id) };
2026-07-20 16:05:17 +00:00
obj.body = obj;
2026-07-23 10:11:24 +00:00
const obj4 = require(7369) /* 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 };