Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
74 lines
2.8 KiB
JavaScript
74 lines
2.8 KiB
JavaScript
// Module ID: 12953
|
|
// Function ID: 12954
|
|
// Dependencies: [12944, 12945, 12927, 12947, 12932]
|
|
// Exports: getClient, getCurrentScope, getGlobalScope, getIsolationScope, getTraceContextFromScope, withIsolationScope, withScope
|
|
|
|
// Module 12953
|
|
import _mod12927 from "module_12927" /* 12927 */;
|
|
import _mod12932 from "module_12932" /* 12932 */;
|
|
import _mod12944 from "module_12944" /* 12944 */;
|
|
import _mod12945 from "module_12945" /* 12945 */;
|
|
import ScopeClass from "ScopeClass" /* 12947 */;
|
|
|
|
require = arg1;
|
|
const dependencyMap = arg6;
|
|
|
|
export const getClient = function getClient() {
|
|
const mainCarrier = _mod12944.getMainCarrier();
|
|
const asyncContextStrategy = _mod12945.getAsyncContextStrategy(mainCarrier);
|
|
const currentScope = asyncContextStrategy.getCurrentScope();
|
|
return currentScope.getClient();
|
|
};
|
|
export const getCurrentScope = function getCurrentScope() {
|
|
const mainCarrier = _mod12944.getMainCarrier();
|
|
const asyncContextStrategy = _mod12945.getAsyncContextStrategy(mainCarrier);
|
|
return asyncContextStrategy.getCurrentScope();
|
|
};
|
|
export const getGlobalScope = function getGlobalScope() {
|
|
return _mod12927.getGlobalSingleton("globalScope", () => {
|
|
const scope = new ScopeClass.Scope();
|
|
return scope;
|
|
});
|
|
};
|
|
export const getIsolationScope = function getIsolationScope() {
|
|
const mainCarrier = _mod12944.getMainCarrier();
|
|
const asyncContextStrategy = _mod12945.getAsyncContextStrategy(mainCarrier);
|
|
return asyncContextStrategy.getIsolationScope();
|
|
};
|
|
export const getTraceContextFromScope = function getTraceContextFromScope(getPropagationContext) {
|
|
const propagationContext = getPropagationContext.getPropagationContext();
|
|
({ traceId, spanId, parentSpanId } = propagationContext);
|
|
return _mod12932.dropUndefinedKeys({ trace_id, span_id, parent_span_id });
|
|
};
|
|
export const withIsolationScope = function withIsolationScope() {
|
|
const items = [...arguments];
|
|
const mainCarrier = _mod12944.getMainCarrier();
|
|
const asyncContextStrategy = _mod12945.getAsyncContextStrategy(mainCarrier);
|
|
if (2 === items.length) {
|
|
[tmp2, tmp3] = items;
|
|
if (tmp2) {
|
|
let result = asyncContextStrategy.withSetIsolationScope(tmp2, tmp3);
|
|
} else {
|
|
result = asyncContextStrategy.withIsolationScope(tmp3);
|
|
}
|
|
return result;
|
|
} else {
|
|
return asyncContextStrategy.withIsolationScope(items[0]);
|
|
}
|
|
};
|
|
export const withScope = function withScope() {
|
|
const items = [...arguments];
|
|
const mainCarrier = _mod12944.getMainCarrier();
|
|
const asyncContextStrategy = _mod12945.getAsyncContextStrategy(mainCarrier);
|
|
if (2 === items.length) {
|
|
[tmp2, tmp3] = items;
|
|
if (tmp2) {
|
|
let withSetScopeResult = asyncContextStrategy.withSetScope(tmp2, tmp3);
|
|
} else {
|
|
withSetScopeResult = asyncContextStrategy.withScope(tmp3);
|
|
}
|
|
return withSetScopeResult;
|
|
} else {
|
|
return asyncContextStrategy.withScope(items[0]);
|
|
}
|
|
};
|