Files
discord-decomp/sources/by-id/module-07428-ServerRuntimeClient.js
T
2026-07-28 01:06:53 +03:00

308 lines
17 KiB
JavaScript

/* Metro module 7428; source: unknown; dependencies: [57, 6, 7, 15, 17, 102, 18, 7368, 7383, 7365, 7429, 7393, 7396, 7397, 7369, 7422, 7380, 7430, 7391, 7374, 7405, 7424] */
import * as ClassCallCheckModule from './module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import * as CreateClassModule from './module-00007-CreateClass.js'; /* Metro dependency 7 */
import * as PossibleConstructorReturnModule from './module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import * as Module00017Module from './module-00017.js'; /* Metro dependency 17 */
import * as InheritsModule from './module-00018-Inherits.js'; /* Metro dependency 18 */
import * as Module00057Module from './module-00057.js'; /* Metro dependency 57 */
import * as Module00102Module from './module-00102.js'; /* Metro dependency 102 */
import * as RegisterSpanErrorInstrumentationModule from './module-07365-registerSpanErrorInstrumentation.js'; /* Metro dependency 7365 */
import * as DEBUG_BUILDModule from './module-07368-DEBUG_BUILD.js'; /* Metro dependency 7368 */
import * as Module07369Module from './module-07369.js'; /* Metro dependency 7369 */
import * as Module07383Module from './module-07383.js'; /* Metro dependency 7383 */
import * as Module07393Module from './module-07393.js'; /* Metro dependency 7393 */
import * as DEBUG_BUILDModule2 from './module-07397-DEBUG_BUILD.js'; /* Metro dependency 7397 */
import * as BaseClientModule from './module-07424-BaseClient.js'; /* Metro dependency 7424 */
function _fun59936(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#59936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:6, offset: 0x016f6e99, size: 242 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
DEBUG_BUILDModule;
Module07383Module;
const BaseClient = (BaseClientModule).BaseClient;
exports.ServerRuntimeClient = _fun59942(BaseClient);
function _isNativeReflectConstruct_59937() { // fn#59937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:113, offset: 0x016f6f8b, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_59937_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _superPropGet_59940(a0, a1, a2, a3) { // fn#59940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:332, offset: 0x016f6fe9, size: 99 bytes, params: 5, frame: 18
let value = a0;
const env0_0 = a2;
value = Module00017Module(1 & 3 ? value.prototype : value);
value = Module00102Module(value, a1, a2);
return 2 & 3 ? typeof value !== 'function' ? value : _fun59941 : value;
function _fun59941(a0) { // fn#59941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:431, offset: 0x00c62408, size: 27 bytes, params: 2, frame: 13
return env0_1.apply(importDefault, a0);
}
}
function _fun59942(a0) { // fn#59942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:540, offset: 0x016f704c, size: 279 bytes, params: 2, frame: 16
const ServerRuntimeClient_599432 = ServerRuntimeClient_59943;
InheritsModule(ServerRuntimeClient_599432, a0);
return CreateClassModule(ServerRuntimeClient_599432, [{key: 'eventFromException', value: value_59944},
{key: 'eventFromMessage', value: value_59945}, {key: 'captureException', value: value_59946},
{key: 'captureEvent', value: value_59947}, {key: 'close', value: value_59948}, {key: 'initSessionFlusher',
value: value_59949}, {key: 'captureCheckIn', value: value_59950}, {key: '_captureRequestSession',
value: value_59951}, {key: '_prepareEvent', value: value_59952}, {key: '_getTraceInfoFromScope',
value: value_59953}]);
function ServerRuntimeClient_59943(a0) { // fn#59943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:565, offset: 0x016f7163, size: 145 bytes, params: 2, frame: 19
const value = environment.__proto__;
env1_3(this, ServerRuntimeClient_59943);
(RegisterSpanErrorInstrumentationModule).registerSpanErrorInstrumentation();
const items2 = [a0];
const value3 = env1_6(ServerRuntimeClient_59943);
return env1_5(this, _isNativeReflectConstruct_59937() ? global.Reflect.construct(value3, items2,
env1_6(this).constructor) : value3.apply(this, items2));
}
function value_59944(a0, a1) { // fn#59944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:925, offset: 0x016f71f4, size: 97 bytes, params: 3, frame: 20
let value = environment.__proto__;
value = Reflect.apply((require(7429) /* metro dependency 7429 */).eventFromUnknownInput, value, [this,
this._options.stackParser, a0, a1]);
value.level = 'error';
return (Module07393Module).resolvedSyncPromise(value);
}
function value_59945(a0) { // fn#59945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:1120, offset: 0x016f7255, size: 155 bytes, params: 2, frame: 21
let value = undefined;
const value2 = 'info';
const r8 = arguments.length > 1 ? value === arguments[1] ? value2 : arguments[1] : value2;
const r7 = arguments.length > 2 ? arguments[2] : value;
const resolvedSyncPromise = Module07393Module.resolvedSyncPromise;
value = require(7429) /* metro dependency 7429 */;
return Reflect.apply(resolvedSyncPromise, Module07393Module, [value.eventFromMessage(this._options.stackParser, a0, r8,
r7, this._options.attachStacktrace)]);
}
function value_59946(a0, a1, a2) { // fn#59946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:1419, offset: 0x016f72f0, size: 168 bytes, params: 4, frame: 17
var value;
if (this._options.autoSessionTracking) {
if (this._sessionFlusher) {
value = environment.__proto__;
value = require(7396) /* metro dependency 7396 */;
value = value.getIsolationScope();
value = value.getRequestSession();
if (value && value.status === 'ok') {
value.status = 'errored';
}
}
}
value = environment.__proto__;
return _superPropGet_59940(ServerRuntimeClient_59943, 'captureException', this, 3)([a0, a1, a2]);
}
function value_59947(a0, a1, a2) { // fn#59947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:1714, offset: 0x016f7398, size: 242 bytes, params: 4, frame: 18
var type;
var value;
if (this._options.autoSessionTracking) {
if (this._sessionFlusher) {
type = a0.type;
type = !type ? 'exception' : type;
if (type === 'exception') {
if (a0.exception) {
if (a0.exception.values) {
if (a0.exception.values.length > 0) {
value = environment.__proto__;
value = require(7396) /* metro dependency 7396 */;
value = value.getIsolationScope();
value = value.getRequestSession();
if (value && value.status === 'ok') {
value.status = 'errored';
}
}
}
}
}
}
}
value = environment.__proto__;
return _superPropGet_59940(ServerRuntimeClient_59943, 'captureEvent', this, 3)([a0, a1, a2]);
}
function value_59948(a0) { // fn#59948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:2095, offset: 0x016f748a, size: 78 bytes, params: 2, frame: 17
if (this._sessionFlusher) {
this._sessionFlusher.close();
}
const value = environment.__proto__;
return _superPropGet_59940(ServerRuntimeClient_59943, 'close', this, 3)([a0]);
}
function value_59949() { // fn#59949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:2260, offset: 0x016f74d8, size: 170 bytes, params: 1, frame: 18
var SessionFlusher;
var object;
const {release, environment} = this._options;
const value = environment.__proto__;
if (release) {
SessionFlusher = (require(7422) /* metro dependency 7422 */).SessionFlusher;
object = {release: release, environment: environment};
this._sessionFlusher = new SessionFlusher(this);
} else if ((require(7397) /* metro dependency 7397 */).DEBUG_BUILD) {
(require(7369) /* metro dependency 7369 */).logger.warn('Cannot initialize an instance of SessionFlusher if no release is provided!');
}
}
function value_59950(a0, a1, a2) { // fn#59950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:2576, offset: 0x016f7582, size: 540 bytes, params: 4, frame: 26
var r0;
var value;
const DEBUG_BUILD = (DEBUG_BUILDModule2).DEBUG_BUILD;
const logger = (Module07369Module).logger;
var release;
var environment;
var tunnel;
var object;
var value2;
var property;
var property2;
if ('checkInId' in a0) {
if (a0.checkInId) {
r0 = a0.checkInId;
} else {
value = environment.__proto__;
value = require(7380) /* metro dependency 7380 */;
value = value.uuid4();
r0 = value;
}
} else {
value = environment.__proto__;
value = require(7380) /* metro dependency 7380 */;
value = value.uuid4();
r0 = value;
}
if (this._isEnabled()) {
value = this.getOptions();
release = value.release;
environment = value.environment;
tunnel = value.tunnel;
object = {check_in_id: r0};
object.monitor_slug = a0.monitorSlug;
object.status = a0.status;
object.release = release;
object.environment = environment;
if ('duration' in a0) {
object.duration = a0.duration;
}
if (a1) {
object.monitor_config = {schedule: a1.schedule, checkin_margin: a1.checkinMargin,
max_runtime: a1.maxRuntime,
timezone: a1.timezone, failure_issue_threshold: a1.failureIssueThreshold,
recovery_threshold: a1.recoveryThreshold};
}
value = this._getTraceInfoFromScope(a2);
value2 = environment.__proto__;
value = env1_2(value, 2);
property = value[0];
property2 = value[1];
if (property2) {
object.contexts = {trace: property2};
}
value = require(7430) /* metro dependency 7430 */;
value = value.createCheckInEnvelope(object, property, this.getSdkMetadata(), tunnel, this.getDsn());
if (DEBUG_BUILD) {
logger.info('Sending checkin:', a0.monitorSlug, a0.status);
}
this.sendEnvelope(value);
} else {
value = environment.__proto__;
if (DEBUG_BUILD) {
logger.warn('SDK not enabled, will not capture checkin.');
}
}
return r0;
}
function value_59951() { // fn#59951, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:3512, offset: 0x016f779e, size: 112 bytes, params: 1, frame: 13
var value;
if (this._sessionFlusher) {
this._sessionFlusher.incrementSessionStatusCount();
} else {
value = environment.__proto__;
if ((require(7397) /* metro dependency 7397 */).DEBUG_BUILD) {
(require(7369) /* metro dependency 7369 */).logger.warn('Discarded request mode session because autoSessionTracking option was disabled');
}
}
}
function value_59952(a0, a1, a2, a3) { // fn#59952, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:3774, offset: 0x016f780e, size: 246 bytes, params: 5, frame: 19
var Object;
var assign;
var contexts;
let platform = this._options.platform;
if (platform) {
platform = a0.platform;
platform = !platform ? this._options.platform : platform;
a0.platform = platform;
}
let runtime = this._options.runtime;
if (runtime) {
Object = global.Object;
assign = Object.assign;
contexts = a0.contexts;
runtime = (a0.contexts || ({})).runtime;
runtime = !runtime ? this._options.runtime : runtime;
a0.contexts = Reflect.apply(assign, Object, [{}, contexts, {runtime: runtime}]);
}
if (this._options.serverName) {
a0.server_name = a0.server_name || this._options.serverName;
}
const value = environment.__proto__;
return _superPropGet_59940(ServerRuntimeClient_59943, '_prepareEvent', this, 3)([a0, a1, a2, a3]);
}
function value_59953(a0) { // fn#59953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7606:4197, offset: 0x016f7904, size: 182 bytes, params: 2, frame: 17
var r1;
var r2;
var value;
var value2;
if (a0) {
value = environment.__proto__;
value2 = (require(7391) /* metro dependency 7391 */)._getSpanForScope(a0);
r1 = value2 ? (require(7374) /* metro dependency 7374 */).spanToTraceContext(value2) : (require(7396) /* metro dependency 7396 */).getTraceContextFromScope(a0);
value = require(7405) /* metro dependency 7405 */;
if (value2) {
value = value.getDynamicSamplingContextFromSpan(value2);
r2 = value;
} else {
value = value.getDynamicSamplingContextFromScope(this, a0);
r2 = value;
}
return [r2, r1];
}
return [undefined, undefined];
}
}
}
global.__d(_fun59936, 7428, [57, 6, 7, 15, 17, 102, 18, 7368, 7383, 7365, 7429, 7393, 7396, 7397, 7369, 7422, 7380,
7430, 7391, 7374, 7405,
7424]) /* metro module 7428, dependencies: [57, 6, 7, 15, 17, 102, 18, 7368, 7383, 7365, 7429, 7393, 7396, 7397, 7369, 7422, 7380, 7430, 7391, 7374, 7405, 7424] */;