decord/source/867__isNativeReflectConstruct.js

243 lines
8 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 867
2026-07-24 07:16:23 +00:00
// Function ID: 9661
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-23 10:11:24 +00:00
// Dependencies: [57, 6, 7, 15, 17, 102, 18, 795, 868, 869, 849, 807, 800, 801, 857, 870, 852, 825]
2026-07-20 16:05:17 +00:00
// Module 867 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
import _classCallCheck from "_inherits";
import _defineProperties from "registerSpanErrorInstrumentation";
import "createCheckInEnvelope";
import _getPrototypeOf from "getCurrentScope";
import _get from "_get";
import _inherits from "_inherits";
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
function _superPropGet(arg0, arg1, arg2, arg3) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg2;
2026-07-20 16:05:17 +00:00
let prototype = arg0;
if (1) {
prototype = arg0.prototype;
}
2026-07-23 10:11:24 +00:00
const tmpResult = _get(_getPrototypeOf(prototype), arg1, arg2);
2026-07-20 16:05:17 +00:00
const dependencyMap = tmpResult;
let fn = tmpResult;
if (2) {
fn = tmpResult;
if ("function" === typeof tmpResult) {
2026-07-23 10:11:24 +00:00
fn = (arg0) => tmpResult.apply(closure_0, arg0);
2026-07-20 16:05:17 +00:00
}
}
return fn;
}
function setCurrentRequestSessionErroredOrCrashed(mechanism) {
2026-07-23 10:11:24 +00:00
const isolationScope = require(825) /* getCurrentScope */.getIsolationScope();
2026-07-20 16:05:17 +00:00
const requestSession = isolationScope.getScopeData().sdkProcessingMetadata.requestSession;
if (requestSession) {
let handled;
if (null != mechanism) {
mechanism = mechanism.mechanism;
if (null != mechanism) {
handled = mechanism.handled;
}
}
if (null == handled || handled) {
if ("crashed" !== requestSession.status) {
requestSession.status = "errored";
}
}
if (!(null == handled || handled)) {
requestSession.status = "crashed";
}
}
}
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2026-07-23 10:11:24 +00:00
export const ServerRuntimeClient = ((Client) => {
2026-07-20 16:05:17 +00:00
class ServerRuntimeClient {
constructor(arg0) {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_3(this, ServerRuntimeClient);
obj = ServerRuntimeClient(outer1_1[7]);
2026-07-20 16:05:17 +00:00
result = obj.registerSpanErrorInstrumentation();
2026-07-23 10:11:24 +00:00
obj2 = ServerRuntimeClient(outer1_1[8]);
2026-07-20 16:05:17 +00:00
result1 = obj2.addUserAgentToTransportHeaders(Client);
items = [];
items[0] = Client;
2026-07-23 10:11:24 +00:00
obj3 = outer1_6(ServerRuntimeClient);
tmp4 = outer1_5;
if (outer1_9()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_6;
constructResult = Reflect.construct(obj3, items, outer1_6(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
constructResult = obj3.apply(self, items);
}
tmp4Result = tmp4(self, constructResult);
result2 = tmp4Result._setUpMetricsProcessing();
return tmp4Result;
}
}
2026-07-23 10:11:24 +00:00
_inherits(ServerRuntimeClient, Client);
2026-07-20 16:05:17 +00:00
let obj = {
key: "eventFromException",
value: function eventFromException(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const result = ServerRuntimeClient(outer1_1[9]).eventFromUnknownInput(this, this._options.stackParser, arg0, arg1);
2026-07-20 16:05:17 +00:00
result.level = "error";
2026-07-23 10:11:24 +00:00
const obj = ServerRuntimeClient(outer1_1[9]);
return ServerRuntimeClient(outer1_1[10]).resolvedSyncPromise(result);
2026-07-20 16:05:17 +00:00
}
};
2026-07-23 10:11:24 +00:00
let items = [obj, , , , , , ];
2026-07-20 16:05:17 +00:00
obj = {
key: "eventFromMessage",
value: function eventFromMessage(arg0) {
const self = this;
let str = "info";
if (arguments.length > 1) {
str = "info";
if (undefined !== arguments[1]) {
str = arguments[1];
}
}
let tmp;
if (arguments.length > 2) {
tmp = arguments[2];
}
2026-07-23 10:11:24 +00:00
const obj = ServerRuntimeClient(outer1_1[10]);
return obj.resolvedSyncPromise(ServerRuntimeClient(outer1_1[9]).eventFromMessage(self._options.stackParser, arg0, str, tmp, self._options.attachStacktrace));
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "captureException",
value: function captureException(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
outer1_11(arg1);
2026-07-20 16:05:17 +00:00
const items = [arg0, arg1, arg2];
2026-07-23 10:11:24 +00:00
return outer1_10(ServerRuntimeClient, "captureException", this, 3)(items);
2026-07-20 16:05:17 +00:00
}
};
items[2] = obj;
items[3] = {
key: "captureEvent",
value: function captureEvent(type) {
let tmp = !type.type;
if (tmp) {
const exception = type.exception;
let values;
if (null != exception) {
values = exception.values;
}
tmp = values;
}
if (tmp) {
tmp = type.exception.values.length > 0;
}
if (tmp) {
2026-07-23 10:11:24 +00:00
outer1_11(arg1);
2026-07-20 16:05:17 +00:00
}
const items = [type, arg1, arg2];
2026-07-23 10:11:24 +00:00
return outer1_10(ServerRuntimeClient, "captureEvent", this, 3)(items);
2026-07-20 16:05:17 +00:00
}
};
items[4] = {
key: "captureCheckIn",
value: function captureCheckIn(checkInId) {
const self = this;
if ("checkInId" in checkInId) {
if (checkInId.checkInId) {
checkInId = checkInId.checkInId;
}
if (self._isEnabled()) {
const options = self.getOptions();
const tunnel = options.tunnel;
let obj = { check_in_id: checkInId };
({ monitorSlug: obj2.monitor_slug, status: obj2.status } = checkInId);
({ release: obj2.release, environment: obj2.environment } = options);
if ("duration" in checkInId) {
obj.duration = checkInId.duration;
}
if (arg1) {
obj = {};
({ schedule: obj3.schedule, checkinMargin: obj3.checkin_margin, maxRuntime: obj3.max_runtime, timezone: obj3.timezone, failureIssueThreshold: obj3.failure_issue_threshold, recoveryThreshold: obj3.recovery_threshold } = arg1);
obj.monitor_config = obj;
}
2026-07-23 10:11:24 +00:00
const tmp11 = outer1_2(ServerRuntimeClient(outer1_1[14])._getTraceInfoFromScope(self, arg2), 2);
2026-07-20 16:05:17 +00:00
const first = tmp11[0];
if (tmp11[1]) {
const obj1 = { trace: tmp13 };
obj.contexts = obj1;
}
2026-07-23 10:11:24 +00:00
const obj6 = ServerRuntimeClient(outer1_1[15]);
2026-07-20 16:05:17 +00:00
const sdkMetadata = self.getSdkMetadata();
const checkInEnvelope = obj6.createCheckInEnvelope(obj, first, sdkMetadata, tunnel, self.getDsn());
2026-07-23 10:11:24 +00:00
if (ServerRuntimeClient(outer1_1[12]).DEBUG_BUILD) {
const debug2 = ServerRuntimeClient(outer1_1[13]).debug;
2026-07-20 16:05:17 +00:00
debug2.log("Sending checkin:", checkInId.monitorSlug, checkInId.status);
}
self.sendEnvelope(checkInEnvelope);
return checkInId;
} else {
2026-07-23 10:11:24 +00:00
if (ServerRuntimeClient(outer1_1[12]).DEBUG_BUILD) {
const debug = ServerRuntimeClient(outer1_1[13]).debug;
2026-07-20 16:05:17 +00:00
debug.warn("SDK not enabled, will not capture check-in.");
}
return checkInId;
}
}
2026-07-23 10:11:24 +00:00
obj = ServerRuntimeClient(outer1_1[11]);
2026-07-20 16:05:17 +00:00
checkInId = obj.uuid4();
}
};
items[5] = {
key: "_prepareEvent",
value: function _prepareEvent(platform) {
const self = this;
if (this._options.platform) {
platform.platform = platform.platform || self._options.platform;
}
if (self._options.runtime) {
const obj = {};
const contexts = platform.contexts;
let runtime;
if (null != contexts) {
runtime = contexts.runtime;
}
if (!runtime) {
runtime = self._options.runtime;
}
obj.runtime = runtime;
platform.contexts = Object.assign({}, platform.contexts, obj);
}
if (self._options.serverName) {
platform.server_name = platform.server_name || self._options.serverName;
}
const items = [platform, arg1, arg2, arg3];
2026-07-23 10:11:24 +00:00
return outer1_10(ServerRuntimeClient, "_prepareEvent", self, 3)(items);
2026-07-20 16:05:17 +00:00
}
};
items[6] = {
key: "_setUpMetricsProcessing",
value: function _setUpMetricsProcessing() {
2026-07-23 10:11:24 +00:00
const self = this;
2026-07-20 16:05:17 +00:00
this.on("processMetric", (attributes) => {
if (self._options.serverName) {
const _Object = Object;
2026-07-23 10:11:24 +00:00
const obj = { "server.address": self._options.serverName };
2026-07-20 16:05:17 +00:00
attributes.attributes = Object.assign(obj, attributes.attributes);
}
});
}
};
2026-07-23 10:11:24 +00:00
return _defineProperties(ServerRuntimeClient, items);
})(require("_makeInternalError").Client);