rsbuild-plugin-cloudflare 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/additional-modules-CyA1Cd2t.mjs +44062 -0
- package/dist/constants-BSTDVDmV.mjs +8 -0
- package/dist/index.d.mts +0 -6
- package/dist/index.mjs +1592 -80697
- package/dist/miniflare-options-BxJnuymv.mjs +73 -0
- package/dist/miniflare-options-CXTX1Ld-.mjs +14256 -0
- package/dist/{open-NPEHYJ5T-CLdHWlOO.mjs → open-BPppUKSJ-BoP51JHy.mjs} +97 -118
- package/dist/{package-gWrKQHzY.mjs → package-C7Up3cPo.mjs} +4 -6
- package/dist/request-handler-n9oFuRPf.mjs +254 -0
- package/dist/rolldown-runtime-BMUeFane-BXI4m9DX.mjs +29 -0
- package/dist/rolldown-runtime-DegdyBIC.mjs +25 -0
- package/dist/shared-BgcTKVNO.mjs +5 -0
- package/dist/websockets-BRFceXs5.mjs +88 -0
- package/dist/workers/asset-worker/index.js +131 -266
- package/dist/workers/asset-worker/index.js.map +1 -1
- package/dist/workers/router-worker/index.js +94 -202
- package/dist/workers/router-worker/index.js.map +1 -1
- package/dist/workers/runner-worker/index.js +26 -30
- package/dist/workers/runner-worker/index.js.map +1 -1
- package/dist/workers/runner-worker/module-runner-legacy.js +61 -18
- package/dist/workers/runner-worker/module-runner-legacy.js.map +1 -1
- package/dist/workers/runner-worker/module-runner.js +104 -54
- package/dist/workers/runner-worker/module-runner.js.map +1 -1
- package/dist/workers/vite-proxy-worker/index.js +1 -2
- package/dist/workers/vite-proxy-worker/index.js.map +1 -1
- package/package.json +9 -9
- package/dist/chunk-53YJWLG7-_ps118Xl.mjs +0 -43
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WorkerEntrypoint } from "cloudflare:workers";
|
|
2
|
-
|
|
3
2
|
//#region ../workers-shared/utils/performance.ts
|
|
4
3
|
var PerformanceTimer = class {
|
|
5
4
|
performanceTimer;
|
|
@@ -11,7 +10,6 @@ var PerformanceTimer = class {
|
|
|
11
10
|
return Date.now();
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
|
-
|
|
15
13
|
//#endregion
|
|
16
14
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/is.js
|
|
17
15
|
const objectToString = Object.prototype.toString;
|
|
@@ -151,7 +149,6 @@ function isInstanceOf(wat, base) {
|
|
|
151
149
|
function isVueViewModel(wat) {
|
|
152
150
|
return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue));
|
|
153
151
|
}
|
|
154
|
-
|
|
155
152
|
//#endregion
|
|
156
153
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/string.js
|
|
157
154
|
/**
|
|
@@ -165,11 +162,9 @@ function truncate(str, max = 0) {
|
|
|
165
162
|
if (typeof str !== "string" || max === 0) return str;
|
|
166
163
|
return str.length <= max ? str : `${str.slice(0, max)}...`;
|
|
167
164
|
}
|
|
168
|
-
|
|
169
165
|
//#endregion
|
|
170
166
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/version.js
|
|
171
167
|
const SDK_VERSION = "8.9.2";
|
|
172
|
-
|
|
173
168
|
//#endregion
|
|
174
169
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/worldwide.js
|
|
175
170
|
/** Get's the global object for the current JavaScript runtime */
|
|
@@ -188,10 +183,9 @@ const GLOBAL_OBJ = globalThis;
|
|
|
188
183
|
function getGlobalSingleton(name, creator, obj) {
|
|
189
184
|
const gbl = obj || GLOBAL_OBJ;
|
|
190
185
|
const __SENTRY__ = gbl.__SENTRY__ = gbl.__SENTRY__ || {};
|
|
191
|
-
const versionedCarrier = __SENTRY__[SDK_VERSION] = __SENTRY__[
|
|
186
|
+
const versionedCarrier = __SENTRY__[SDK_VERSION] = __SENTRY__["8.9.2"] || {};
|
|
192
187
|
return versionedCarrier[name] || (versionedCarrier[name] = creator());
|
|
193
188
|
}
|
|
194
|
-
|
|
195
189
|
//#endregion
|
|
196
190
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/browser.js
|
|
197
191
|
const WINDOW = GLOBAL_OBJ;
|
|
@@ -274,7 +268,6 @@ function _htmlElementAsString(el, keyAttrs) {
|
|
|
274
268
|
}
|
|
275
269
|
return out.join("");
|
|
276
270
|
}
|
|
277
|
-
|
|
278
271
|
//#endregion
|
|
279
272
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/debug-build.js
|
|
280
273
|
/**
|
|
@@ -283,7 +276,6 @@ function _htmlElementAsString(el, keyAttrs) {
|
|
|
283
276
|
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
284
277
|
*/
|
|
285
278
|
const DEBUG_BUILD$1 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
|
|
286
|
-
|
|
287
279
|
//#endregion
|
|
288
280
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/logger.js
|
|
289
281
|
/** Prefix for logging strings */
|
|
@@ -308,25 +300,25 @@ const originalConsoleMethods = {};
|
|
|
308
300
|
*/
|
|
309
301
|
function consoleSandbox(callback) {
|
|
310
302
|
if (!("console" in GLOBAL_OBJ)) return callback();
|
|
311
|
-
const console
|
|
303
|
+
const console = GLOBAL_OBJ.console;
|
|
312
304
|
const wrappedFuncs = {};
|
|
313
305
|
const wrappedLevels = Object.keys(originalConsoleMethods);
|
|
314
306
|
wrappedLevels.forEach((level) => {
|
|
315
307
|
const originalConsoleMethod = originalConsoleMethods[level];
|
|
316
|
-
wrappedFuncs[level] = console
|
|
317
|
-
console
|
|
308
|
+
wrappedFuncs[level] = console[level];
|
|
309
|
+
console[level] = originalConsoleMethod;
|
|
318
310
|
});
|
|
319
311
|
try {
|
|
320
312
|
return callback();
|
|
321
313
|
} finally {
|
|
322
314
|
wrappedLevels.forEach((level) => {
|
|
323
|
-
console
|
|
315
|
+
console[level] = wrappedFuncs[level];
|
|
324
316
|
});
|
|
325
317
|
}
|
|
326
318
|
}
|
|
327
319
|
function makeLogger() {
|
|
328
320
|
let enabled = false;
|
|
329
|
-
const logger
|
|
321
|
+
const logger = {
|
|
330
322
|
enable: () => {
|
|
331
323
|
enabled = true;
|
|
332
324
|
},
|
|
@@ -336,19 +328,18 @@ function makeLogger() {
|
|
|
336
328
|
isEnabled: () => enabled
|
|
337
329
|
};
|
|
338
330
|
if (DEBUG_BUILD$1) CONSOLE_LEVELS.forEach((name) => {
|
|
339
|
-
logger
|
|
331
|
+
logger[name] = (...args) => {
|
|
340
332
|
if (enabled) consoleSandbox(() => {
|
|
341
333
|
GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);
|
|
342
334
|
});
|
|
343
335
|
};
|
|
344
336
|
});
|
|
345
337
|
else CONSOLE_LEVELS.forEach((name) => {
|
|
346
|
-
logger
|
|
338
|
+
logger[name] = () => void 0;
|
|
347
339
|
});
|
|
348
|
-
return logger
|
|
340
|
+
return logger;
|
|
349
341
|
}
|
|
350
342
|
const logger = makeLogger();
|
|
351
|
-
|
|
352
343
|
//#endregion
|
|
353
344
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/dsn.js
|
|
354
345
|
/** Regular expression used to parse a Dsn. */
|
|
@@ -454,7 +445,6 @@ function makeDsn(from) {
|
|
|
454
445
|
if (!components || !validateDsn(components)) return;
|
|
455
446
|
return components;
|
|
456
447
|
}
|
|
457
|
-
|
|
458
448
|
//#endregion
|
|
459
449
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/error.js
|
|
460
450
|
/** An error emitted by Sentry SDKs and related utilities. */
|
|
@@ -468,7 +458,6 @@ var SentryError = class extends Error {
|
|
|
468
458
|
this.logLevel = logLevel;
|
|
469
459
|
}
|
|
470
460
|
};
|
|
471
|
-
|
|
472
461
|
//#endregion
|
|
473
462
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/object.js
|
|
474
463
|
/**
|
|
@@ -597,11 +586,9 @@ function isPojo(input) {
|
|
|
597
586
|
return true;
|
|
598
587
|
}
|
|
599
588
|
}
|
|
600
|
-
|
|
601
589
|
//#endregion
|
|
602
590
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/stacktrace.js
|
|
603
591
|
const STACKTRACE_FRAME_LIMIT = 50;
|
|
604
|
-
const UNKNOWN_FUNCTION = "?";
|
|
605
592
|
const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
|
|
606
593
|
const STRIP_FRAME_REGEXP = /captureMessage|captureException/;
|
|
607
594
|
/**
|
|
@@ -661,7 +648,7 @@ function stripSentryFramesAndReverse(stack) {
|
|
|
661
648
|
return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame) => ({
|
|
662
649
|
...frame,
|
|
663
650
|
filename: frame.filename || localStack[localStack.length - 1].filename,
|
|
664
|
-
function: frame.function ||
|
|
651
|
+
function: frame.function || "?"
|
|
665
652
|
}));
|
|
666
653
|
}
|
|
667
654
|
const defaultFunctionName = "<anonymous>";
|
|
@@ -676,15 +663,14 @@ function getFunctionName(fn) {
|
|
|
676
663
|
return defaultFunctionName;
|
|
677
664
|
}
|
|
678
665
|
}
|
|
679
|
-
|
|
680
666
|
//#endregion
|
|
681
667
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/instrument/handlers.js
|
|
682
668
|
const handlers = {};
|
|
683
669
|
const instrumented = {};
|
|
684
670
|
/** Add a handler function. */
|
|
685
|
-
function addHandler(type, handler
|
|
671
|
+
function addHandler(type, handler) {
|
|
686
672
|
handlers[type] = handlers[type] || [];
|
|
687
|
-
handlers[type].push(handler
|
|
673
|
+
handlers[type].push(handler);
|
|
688
674
|
}
|
|
689
675
|
/** Maybe run an instrumentation function, unless it was already called. */
|
|
690
676
|
function maybeInstrument(type, instrumentFn) {
|
|
@@ -697,13 +683,12 @@ function maybeInstrument(type, instrumentFn) {
|
|
|
697
683
|
function triggerHandlers(type, data) {
|
|
698
684
|
const typeHandlers = type && handlers[type];
|
|
699
685
|
if (!typeHandlers) return;
|
|
700
|
-
for (const handler
|
|
701
|
-
handler
|
|
686
|
+
for (const handler of typeHandlers) try {
|
|
687
|
+
handler(data);
|
|
702
688
|
} catch (e) {
|
|
703
|
-
DEBUG_BUILD$1 && logger.error(`Error while triggering instrumentation handler.\nType: ${type}\nName: ${getFunctionName(handler
|
|
689
|
+
DEBUG_BUILD$1 && logger.error(`Error while triggering instrumentation handler.\nType: ${type}\nName: ${getFunctionName(handler)}\nError:`, e);
|
|
704
690
|
}
|
|
705
691
|
}
|
|
706
|
-
|
|
707
692
|
//#endregion
|
|
708
693
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/time.js
|
|
709
694
|
const ONE_SECOND_IN_MS = 1e3;
|
|
@@ -744,38 +729,22 @@ function createUnixTimestampInSecondsFunc() {
|
|
|
744
729
|
* See https://github.com/getsentry/sentry-javascript/issues/2590.
|
|
745
730
|
*/
|
|
746
731
|
const timestampInSeconds = createUnixTimestampInSecondsFunc();
|
|
747
|
-
|
|
748
|
-
* Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.
|
|
749
|
-
*/
|
|
750
|
-
let _browserPerformanceTimeOriginMode;
|
|
751
|
-
/**
|
|
752
|
-
* The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the
|
|
753
|
-
* performance API is available.
|
|
754
|
-
*/
|
|
755
|
-
const browserPerformanceTimeOrigin = (() => {
|
|
732
|
+
(() => {
|
|
756
733
|
const { performance } = GLOBAL_OBJ;
|
|
757
|
-
if (!performance || !performance.now)
|
|
758
|
-
|
|
759
|
-
return;
|
|
760
|
-
}
|
|
761
|
-
const threshold = 3600 * 1e3;
|
|
734
|
+
if (!performance || !performance.now) return;
|
|
735
|
+
const threshold = 36e5;
|
|
762
736
|
const performanceNow = performance.now();
|
|
763
737
|
const dateNow = Date.now();
|
|
764
738
|
const timeOriginDelta = performance.timeOrigin ? Math.abs(performance.timeOrigin + performanceNow - dateNow) : threshold;
|
|
765
739
|
const timeOriginIsReliable = timeOriginDelta < threshold;
|
|
766
740
|
const navigationStart = performance.timing && performance.timing.navigationStart;
|
|
767
741
|
const navigationStartDelta = typeof navigationStart === "number" ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;
|
|
768
|
-
if (timeOriginIsReliable || navigationStartDelta < threshold)
|
|
769
|
-
|
|
770
|
-
return
|
|
771
|
-
}
|
|
772
|
-
_browserPerformanceTimeOriginMode = "navigationStart";
|
|
773
|
-
return navigationStart;
|
|
774
|
-
}
|
|
775
|
-
_browserPerformanceTimeOriginMode = "dateNow";
|
|
742
|
+
if (timeOriginIsReliable || navigationStartDelta < threshold) {
|
|
743
|
+
if (timeOriginDelta <= navigationStartDelta) return performance.timeOrigin;
|
|
744
|
+
else return navigationStart;
|
|
745
|
+
}
|
|
776
746
|
return dateNow;
|
|
777
747
|
})();
|
|
778
|
-
|
|
779
748
|
//#endregion
|
|
780
749
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/instrument/globalError.js
|
|
781
750
|
let _oldOnErrorHandler = null;
|
|
@@ -785,9 +754,9 @@ let _oldOnErrorHandler = null;
|
|
|
785
754
|
* Use at your own risk, this might break without changelog notice, only used internally.
|
|
786
755
|
* @hidden
|
|
787
756
|
*/
|
|
788
|
-
function addGlobalErrorInstrumentationHandler(handler
|
|
757
|
+
function addGlobalErrorInstrumentationHandler(handler) {
|
|
789
758
|
const type = "error";
|
|
790
|
-
addHandler(type, handler
|
|
759
|
+
addHandler(type, handler);
|
|
791
760
|
maybeInstrument(type, instrumentError);
|
|
792
761
|
}
|
|
793
762
|
function instrumentError() {
|
|
@@ -805,7 +774,6 @@ function instrumentError() {
|
|
|
805
774
|
};
|
|
806
775
|
GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;
|
|
807
776
|
}
|
|
808
|
-
|
|
809
777
|
//#endregion
|
|
810
778
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/instrument/globalUnhandledRejection.js
|
|
811
779
|
let _oldOnUnhandledRejectionHandler = null;
|
|
@@ -815,9 +783,9 @@ let _oldOnUnhandledRejectionHandler = null;
|
|
|
815
783
|
* Use at your own risk, this might break without changelog notice, only used internally.
|
|
816
784
|
* @hidden
|
|
817
785
|
*/
|
|
818
|
-
function addGlobalUnhandledRejectionInstrumentationHandler(handler
|
|
786
|
+
function addGlobalUnhandledRejectionInstrumentationHandler(handler) {
|
|
819
787
|
const type = "unhandledrejection";
|
|
820
|
-
addHandler(type, handler
|
|
788
|
+
addHandler(type, handler);
|
|
821
789
|
maybeInstrument(type, instrumentUnhandledRejection);
|
|
822
790
|
}
|
|
823
791
|
function instrumentUnhandledRejection() {
|
|
@@ -829,7 +797,6 @@ function instrumentUnhandledRejection() {
|
|
|
829
797
|
};
|
|
830
798
|
GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
|
|
831
799
|
}
|
|
832
|
-
|
|
833
800
|
//#endregion
|
|
834
801
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/memo.js
|
|
835
802
|
/**
|
|
@@ -857,7 +824,6 @@ function memoBuilder() {
|
|
|
857
824
|
}
|
|
858
825
|
return [memoize, unmemoize];
|
|
859
826
|
}
|
|
860
|
-
|
|
861
827
|
//#endregion
|
|
862
828
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/misc.js
|
|
863
829
|
/**
|
|
@@ -867,13 +833,13 @@ function memoBuilder() {
|
|
|
867
833
|
*/
|
|
868
834
|
function uuid4() {
|
|
869
835
|
const gbl = GLOBAL_OBJ;
|
|
870
|
-
const crypto
|
|
836
|
+
const crypto = gbl.crypto || gbl.msCrypto;
|
|
871
837
|
let getRandomByte = () => Math.random() * 16;
|
|
872
838
|
try {
|
|
873
|
-
if (crypto
|
|
874
|
-
if (crypto
|
|
875
|
-
const typedArray = new Uint8Array(1);
|
|
876
|
-
crypto
|
|
839
|
+
if (crypto && crypto.randomUUID) return crypto.randomUUID().replace(/-/g, "");
|
|
840
|
+
if (crypto && crypto.getRandomValues) getRandomByte = () => {
|
|
841
|
+
const typedArray = /* @__PURE__ */ new Uint8Array(1);
|
|
842
|
+
crypto.getRandomValues(typedArray);
|
|
877
843
|
return typedArray[0];
|
|
878
844
|
};
|
|
879
845
|
} catch (_) {}
|
|
@@ -961,7 +927,6 @@ function checkOrSetAlreadyCaught(exception) {
|
|
|
961
927
|
function arrayify(maybeArray) {
|
|
962
928
|
return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
|
|
963
929
|
}
|
|
964
|
-
|
|
965
930
|
//#endregion
|
|
966
931
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/normalize.js
|
|
967
932
|
/**
|
|
@@ -991,7 +956,7 @@ function normalize(input, depth = 100, maxProperties = Infinity) {
|
|
|
991
956
|
}
|
|
992
957
|
}
|
|
993
958
|
/** JSDoc */
|
|
994
|
-
function normalizeToSize(object, depth = 3, maxSize =
|
|
959
|
+
function normalizeToSize(object, depth = 3, maxSize = 102400) {
|
|
995
960
|
const normalized = normalize(object, depth);
|
|
996
961
|
if (jsonSize(normalized) > maxSize) return normalizeToSize(object, depth - 1, maxSize);
|
|
997
962
|
return normalized;
|
|
@@ -1079,7 +1044,6 @@ function utf8Length(value) {
|
|
|
1079
1044
|
function jsonSize(value) {
|
|
1080
1045
|
return utf8Length(JSON.stringify(value));
|
|
1081
1046
|
}
|
|
1082
|
-
|
|
1083
1047
|
//#endregion
|
|
1084
1048
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/path.js
|
|
1085
1049
|
/** JSDoc */
|
|
@@ -1151,21 +1115,20 @@ function basename(path, ext) {
|
|
|
1151
1115
|
if (ext && f.slice(ext.length * -1) === ext) f = f.slice(0, f.length - ext.length);
|
|
1152
1116
|
return f;
|
|
1153
1117
|
}
|
|
1154
|
-
|
|
1155
1118
|
//#endregion
|
|
1156
1119
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/syncpromise.js
|
|
1157
1120
|
/** SyncPromise internal states */
|
|
1158
1121
|
var States;
|
|
1159
|
-
(function(States
|
|
1122
|
+
(function(States) {
|
|
1160
1123
|
/** Pending */
|
|
1161
1124
|
const PENDING = 0;
|
|
1162
|
-
States
|
|
1125
|
+
States[States["PENDING"] = PENDING] = "PENDING";
|
|
1163
1126
|
/** Resolved / OK */
|
|
1164
1127
|
const RESOLVED = 1;
|
|
1165
|
-
States
|
|
1128
|
+
States[States["RESOLVED"] = RESOLVED] = "RESOLVED";
|
|
1166
1129
|
/** Rejected / Error */
|
|
1167
1130
|
const REJECTED = 2;
|
|
1168
|
-
States
|
|
1131
|
+
States[States["REJECTED"] = REJECTED] = "REJECTED";
|
|
1169
1132
|
})(States || (States = {}));
|
|
1170
1133
|
/**
|
|
1171
1134
|
* Creates a resolved sync promise.
|
|
@@ -1174,8 +1137,8 @@ var States;
|
|
|
1174
1137
|
* @returns the resolved sync promise
|
|
1175
1138
|
*/
|
|
1176
1139
|
function resolvedSyncPromise(value) {
|
|
1177
|
-
return new SyncPromise((resolve
|
|
1178
|
-
resolve
|
|
1140
|
+
return new SyncPromise((resolve) => {
|
|
1141
|
+
resolve(value);
|
|
1179
1142
|
});
|
|
1180
1143
|
}
|
|
1181
1144
|
/**
|
|
@@ -1209,13 +1172,13 @@ var SyncPromise = class SyncPromise {
|
|
|
1209
1172
|
}
|
|
1210
1173
|
/** JSDoc */
|
|
1211
1174
|
then(onfulfilled, onrejected) {
|
|
1212
|
-
return new SyncPromise((resolve
|
|
1175
|
+
return new SyncPromise((resolve, reject) => {
|
|
1213
1176
|
this._handlers.push([
|
|
1214
1177
|
false,
|
|
1215
1178
|
(result) => {
|
|
1216
|
-
if (!onfulfilled) resolve
|
|
1179
|
+
if (!onfulfilled) resolve(result);
|
|
1217
1180
|
else try {
|
|
1218
|
-
resolve
|
|
1181
|
+
resolve(onfulfilled(result));
|
|
1219
1182
|
} catch (e) {
|
|
1220
1183
|
reject(e);
|
|
1221
1184
|
}
|
|
@@ -1223,7 +1186,7 @@ var SyncPromise = class SyncPromise {
|
|
|
1223
1186
|
(reason) => {
|
|
1224
1187
|
if (!onrejected) reject(reason);
|
|
1225
1188
|
else try {
|
|
1226
|
-
resolve
|
|
1189
|
+
resolve(onrejected(reason));
|
|
1227
1190
|
} catch (e) {
|
|
1228
1191
|
reject(e);
|
|
1229
1192
|
}
|
|
@@ -1238,7 +1201,7 @@ var SyncPromise = class SyncPromise {
|
|
|
1238
1201
|
}
|
|
1239
1202
|
/** JSDoc */
|
|
1240
1203
|
finally(onfinally) {
|
|
1241
|
-
return new SyncPromise((resolve
|
|
1204
|
+
return new SyncPromise((resolve, reject) => {
|
|
1242
1205
|
let val;
|
|
1243
1206
|
let isRejected;
|
|
1244
1207
|
return this.then((value) => {
|
|
@@ -1254,7 +1217,7 @@ var SyncPromise = class SyncPromise {
|
|
|
1254
1217
|
reject(val);
|
|
1255
1218
|
return;
|
|
1256
1219
|
}
|
|
1257
|
-
resolve
|
|
1220
|
+
resolve(val);
|
|
1258
1221
|
});
|
|
1259
1222
|
});
|
|
1260
1223
|
}
|
|
@@ -1289,16 +1252,15 @@ var SyncPromise = class SyncPromise {
|
|
|
1289
1252
|
if (this._state === States.PENDING) return;
|
|
1290
1253
|
const cachedHandlers = this._handlers.slice();
|
|
1291
1254
|
this._handlers = [];
|
|
1292
|
-
cachedHandlers.forEach((handler
|
|
1293
|
-
if (handler
|
|
1294
|
-
if (this._state === States.RESOLVED) handler
|
|
1295
|
-
if (this._state === States.REJECTED) handler
|
|
1296
|
-
handler
|
|
1255
|
+
cachedHandlers.forEach((handler) => {
|
|
1256
|
+
if (handler[0]) return;
|
|
1257
|
+
if (this._state === States.RESOLVED) handler[1](this._value);
|
|
1258
|
+
if (this._state === States.REJECTED) handler[2](this._value);
|
|
1259
|
+
handler[0] = true;
|
|
1297
1260
|
});
|
|
1298
1261
|
};
|
|
1299
1262
|
}
|
|
1300
1263
|
};
|
|
1301
|
-
|
|
1302
1264
|
//#endregion
|
|
1303
1265
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/promisebuffer.js
|
|
1304
1266
|
/**
|
|
@@ -1346,17 +1308,17 @@ function makePromiseBuffer(limit) {
|
|
|
1346
1308
|
* `false` otherwise
|
|
1347
1309
|
*/
|
|
1348
1310
|
function drain(timeout) {
|
|
1349
|
-
return new SyncPromise((resolve
|
|
1311
|
+
return new SyncPromise((resolve, reject) => {
|
|
1350
1312
|
let counter = buffer.length;
|
|
1351
|
-
if (!counter) return resolve
|
|
1313
|
+
if (!counter) return resolve(true);
|
|
1352
1314
|
const capturedSetTimeout = setTimeout(() => {
|
|
1353
|
-
if (timeout && timeout > 0) resolve
|
|
1315
|
+
if (timeout && timeout > 0) resolve(false);
|
|
1354
1316
|
}, timeout);
|
|
1355
1317
|
buffer.forEach((item) => {
|
|
1356
1318
|
resolvedSyncPromise(item).then(() => {
|
|
1357
1319
|
if (!--counter) {
|
|
1358
1320
|
clearTimeout(capturedSetTimeout);
|
|
1359
|
-
resolve
|
|
1321
|
+
resolve(true);
|
|
1360
1322
|
}
|
|
1361
1323
|
}, reject);
|
|
1362
1324
|
});
|
|
@@ -1368,7 +1330,6 @@ function makePromiseBuffer(limit) {
|
|
|
1368
1330
|
drain
|
|
1369
1331
|
};
|
|
1370
1332
|
}
|
|
1371
|
-
|
|
1372
1333
|
//#endregion
|
|
1373
1334
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/node-stack-trace.js
|
|
1374
1335
|
/**
|
|
@@ -1378,7 +1339,7 @@ function filenameIsInApp(filename, isNative = false) {
|
|
|
1378
1339
|
return !(isNative || filename && !filename.startsWith("/") && !filename.match(/^[A-Z]:/) && !filename.startsWith(".") && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)) && filename !== void 0 && !filename.includes("node_modules/");
|
|
1379
1340
|
}
|
|
1380
1341
|
/** Node Stack line parser */
|
|
1381
|
-
function node(getModule
|
|
1342
|
+
function node(getModule) {
|
|
1382
1343
|
const FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
1383
1344
|
const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
1384
1345
|
return (line) => {
|
|
@@ -1413,7 +1374,7 @@ function node(getModule$1) {
|
|
|
1413
1374
|
functionName = void 0;
|
|
1414
1375
|
}
|
|
1415
1376
|
if (functionName === void 0) {
|
|
1416
|
-
methodName = methodName ||
|
|
1377
|
+
methodName = methodName || "?";
|
|
1417
1378
|
functionName = typeName ? `${typeName}.${methodName}` : methodName;
|
|
1418
1379
|
}
|
|
1419
1380
|
let filename = lineMatch[2] && lineMatch[2].startsWith("file://") ? lineMatch[2].slice(7) : lineMatch[2];
|
|
@@ -1422,7 +1383,7 @@ function node(getModule$1) {
|
|
|
1422
1383
|
if (!filename && lineMatch[5] && !isNative) filename = lineMatch[5];
|
|
1423
1384
|
return {
|
|
1424
1385
|
filename,
|
|
1425
|
-
module: getModule
|
|
1386
|
+
module: getModule ? getModule(filename) : void 0,
|
|
1426
1387
|
function: functionName,
|
|
1427
1388
|
lineno: parseInt(lineMatch[3], 10) || void 0,
|
|
1428
1389
|
colno: parseInt(lineMatch[4], 10) || void 0,
|
|
@@ -1438,10 +1399,9 @@ function node(getModule$1) {
|
|
|
1438
1399
|
* This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.
|
|
1439
1400
|
* This allows it to be used without referencing or importing any node specific code which causes bundlers to complain
|
|
1440
1401
|
*/
|
|
1441
|
-
function nodeStackLineParser(getModule
|
|
1442
|
-
return [90, node(getModule
|
|
1402
|
+
function nodeStackLineParser(getModule) {
|
|
1403
|
+
return [90, node(getModule)];
|
|
1443
1404
|
}
|
|
1444
|
-
|
|
1445
1405
|
//#endregion
|
|
1446
1406
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/envelope.js
|
|
1447
1407
|
/**
|
|
@@ -1576,10 +1536,9 @@ function createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn) {
|
|
|
1576
1536
|
...dynamicSamplingContext && { trace: dropUndefinedKeys({ ...dynamicSamplingContext }) }
|
|
1577
1537
|
};
|
|
1578
1538
|
}
|
|
1579
|
-
|
|
1580
1539
|
//#endregion
|
|
1581
1540
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/ratelimit.js
|
|
1582
|
-
const DEFAULT_RETRY_AFTER =
|
|
1541
|
+
const DEFAULT_RETRY_AFTER = 6e4;
|
|
1583
1542
|
/**
|
|
1584
1543
|
* Extracts Retry-After value from the request header or returns default value
|
|
1585
1544
|
* @param header string representation of 'Retry-After' header
|
|
@@ -1643,10 +1602,9 @@ function updateRateLimits(limits, { statusCode, headers }, now = Date.now()) {
|
|
|
1643
1602
|
} else updatedRateLimits[category] = now + delay;
|
|
1644
1603
|
}
|
|
1645
1604
|
else if (retryAfterHeader) updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);
|
|
1646
|
-
else if (statusCode === 429) updatedRateLimits.all = now +
|
|
1605
|
+
else if (statusCode === 429) updatedRateLimits.all = now + 6e4;
|
|
1647
1606
|
return updatedRateLimits;
|
|
1648
1607
|
}
|
|
1649
|
-
|
|
1650
1608
|
//#endregion
|
|
1651
1609
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/eventbuilder.js
|
|
1652
1610
|
/**
|
|
@@ -1700,9 +1658,9 @@ function getException(client, mechanism, exception, hint) {
|
|
|
1700
1658
|
const errorFromProp = getErrorPropertyFromObject(exception);
|
|
1701
1659
|
if (errorFromProp) return [errorFromProp, extras];
|
|
1702
1660
|
const message = getMessageForObject(exception);
|
|
1703
|
-
const ex
|
|
1704
|
-
ex
|
|
1705
|
-
return [ex
|
|
1661
|
+
const ex = hint && hint.syntheticException || new Error(message);
|
|
1662
|
+
ex.message = message;
|
|
1663
|
+
return [ex, extras];
|
|
1706
1664
|
}
|
|
1707
1665
|
const ex = hint && hint.syntheticException || new Error(exception);
|
|
1708
1666
|
ex.message = `${exception}`;
|
|
@@ -1754,7 +1712,6 @@ function eventFromMessage$1(stackParser, message, level = "info", hint, attachSt
|
|
|
1754
1712
|
event.message = message;
|
|
1755
1713
|
return event;
|
|
1756
1714
|
}
|
|
1757
|
-
|
|
1758
1715
|
//#endregion
|
|
1759
1716
|
//#region ../../node_modules/.pnpm/@sentry+utils@8.9.2/node_modules/@sentry/utils/esm/propagationContext.js
|
|
1760
1717
|
/**
|
|
@@ -1766,7 +1723,6 @@ function generatePropagationContext() {
|
|
|
1766
1723
|
spanId: uuid4().substring(16)
|
|
1767
1724
|
};
|
|
1768
1725
|
}
|
|
1769
|
-
|
|
1770
1726
|
//#endregion
|
|
1771
1727
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/debug-build.js
|
|
1772
1728
|
/**
|
|
@@ -1775,7 +1731,6 @@ function generatePropagationContext() {
|
|
|
1775
1731
|
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
1776
1732
|
*/
|
|
1777
1733
|
const DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
|
|
1778
|
-
|
|
1779
1734
|
//#endregion
|
|
1780
1735
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/carrier.js
|
|
1781
1736
|
/**
|
|
@@ -1796,10 +1751,9 @@ function getMainCarrier() {
|
|
|
1796
1751
|
/** Will either get the existing sentry carrier, or create a new one. */
|
|
1797
1752
|
function getSentryCarrier(carrier) {
|
|
1798
1753
|
const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {};
|
|
1799
|
-
__SENTRY__.version = __SENTRY__.version ||
|
|
1800
|
-
return __SENTRY__[SDK_VERSION] = __SENTRY__[
|
|
1754
|
+
__SENTRY__.version = __SENTRY__.version || "8.9.2";
|
|
1755
|
+
return __SENTRY__[SDK_VERSION] = __SENTRY__["8.9.2"] || {};
|
|
1801
1756
|
}
|
|
1802
|
-
|
|
1803
1757
|
//#endregion
|
|
1804
1758
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/session.js
|
|
1805
1759
|
/**
|
|
@@ -1838,7 +1792,6 @@ function updateSession(session, context = {}) {
|
|
|
1838
1792
|
if (typeof context.errors === "number") session.errors = context.errors;
|
|
1839
1793
|
if (context.status) session.status = context.status;
|
|
1840
1794
|
}
|
|
1841
|
-
|
|
1842
1795
|
//#endregion
|
|
1843
1796
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/utils/spanOnScope.js
|
|
1844
1797
|
const SCOPE_SPAN_FIELD = "_sentrySpan";
|
|
@@ -1857,7 +1810,6 @@ function _setSpanForScope(scope, span) {
|
|
|
1857
1810
|
function _getSpanForScope(scope) {
|
|
1858
1811
|
return scope[SCOPE_SPAN_FIELD];
|
|
1859
1812
|
}
|
|
1860
|
-
|
|
1861
1813
|
//#endregion
|
|
1862
1814
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/scope.js
|
|
1863
1815
|
/**
|
|
@@ -1867,7 +1819,7 @@ const DEFAULT_MAX_BREADCRUMBS = 100;
|
|
|
1867
1819
|
/**
|
|
1868
1820
|
* Holds additional event information.
|
|
1869
1821
|
*/
|
|
1870
|
-
|
|
1822
|
+
const Scope = class ScopeClass {
|
|
1871
1823
|
/** Flag if notifying is happening. */
|
|
1872
1824
|
/** Callback for client to receive scope changes. */
|
|
1873
1825
|
/** Callback list that will be called during event processing. */
|
|
@@ -2289,11 +2241,6 @@ var ScopeClass = class ScopeClass {
|
|
|
2289
2241
|
}
|
|
2290
2242
|
}
|
|
2291
2243
|
};
|
|
2292
|
-
/**
|
|
2293
|
-
* Holds additional event information.
|
|
2294
|
-
*/
|
|
2295
|
-
const Scope = ScopeClass;
|
|
2296
|
-
|
|
2297
2244
|
//#endregion
|
|
2298
2245
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/defaultScopes.js
|
|
2299
2246
|
/** Get the default current scope. */
|
|
@@ -2304,7 +2251,6 @@ function getDefaultCurrentScope() {
|
|
|
2304
2251
|
function getDefaultIsolationScope() {
|
|
2305
2252
|
return getGlobalSingleton("defaultIsolationScope", () => new Scope());
|
|
2306
2253
|
}
|
|
2307
|
-
|
|
2308
2254
|
//#endregion
|
|
2309
2255
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/asyncContext/stackStrategy.js
|
|
2310
2256
|
/**
|
|
@@ -2430,7 +2376,6 @@ function getStackAsyncContextStrategy() {
|
|
|
2430
2376
|
getIsolationScope: () => getAsyncContextStack().getIsolationScope()
|
|
2431
2377
|
};
|
|
2432
2378
|
}
|
|
2433
|
-
|
|
2434
2379
|
//#endregion
|
|
2435
2380
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/asyncContext/index.js
|
|
2436
2381
|
/**
|
|
@@ -2442,7 +2387,6 @@ function getAsyncContextStrategy(carrier) {
|
|
|
2442
2387
|
if (sentry.acs) return sentry.acs;
|
|
2443
2388
|
return getStackAsyncContextStrategy();
|
|
2444
2389
|
}
|
|
2445
|
-
|
|
2446
2390
|
//#endregion
|
|
2447
2391
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/currentScopes.js
|
|
2448
2392
|
/**
|
|
@@ -2471,7 +2415,6 @@ function getGlobalScope() {
|
|
|
2471
2415
|
function getClient() {
|
|
2472
2416
|
return getCurrentScope().getClient();
|
|
2473
2417
|
}
|
|
2474
|
-
|
|
2475
2418
|
//#endregion
|
|
2476
2419
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/metrics/metric-summary.js
|
|
2477
2420
|
/**
|
|
@@ -2492,7 +2435,6 @@ function getMetricSummaryJsonForSpan(span) {
|
|
|
2492
2435
|
}
|
|
2493
2436
|
return output;
|
|
2494
2437
|
}
|
|
2495
|
-
|
|
2496
2438
|
//#endregion
|
|
2497
2439
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/semanticAttributes.js
|
|
2498
2440
|
/**
|
|
@@ -2513,16 +2455,6 @@ const SEMANTIC_ATTRIBUTE_SENTRY_OP = "sentry.op";
|
|
|
2513
2455
|
* Use this attribute to represent the origin of a span.
|
|
2514
2456
|
*/
|
|
2515
2457
|
const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = "sentry.origin";
|
|
2516
|
-
|
|
2517
|
-
//#endregion
|
|
2518
|
-
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/tracing/spanstatus.js
|
|
2519
|
-
const SPAN_STATUS_UNSET = 0;
|
|
2520
|
-
const SPAN_STATUS_OK = 1;
|
|
2521
|
-
const SPAN_STATUS_ERROR = 2;
|
|
2522
|
-
|
|
2523
|
-
//#endregion
|
|
2524
|
-
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/utils/spanUtils.js
|
|
2525
|
-
const TRACE_FLAG_SAMPLED = 1;
|
|
2526
2458
|
/**
|
|
2527
2459
|
* Convert a span to a trace context, which can be sent as the `trace` context in a non-transaction event.
|
|
2528
2460
|
*/
|
|
@@ -2601,12 +2533,12 @@ function spanIsSentrySpan(span) {
|
|
|
2601
2533
|
*/
|
|
2602
2534
|
function spanIsSampled(span) {
|
|
2603
2535
|
const { traceFlags } = span.spanContext();
|
|
2604
|
-
return traceFlags ===
|
|
2536
|
+
return traceFlags === 1;
|
|
2605
2537
|
}
|
|
2606
2538
|
/** Get the status message to use for a JSON representation of a span. */
|
|
2607
2539
|
function getStatusMessage(status) {
|
|
2608
|
-
if (!status || status.code ===
|
|
2609
|
-
if (status.code ===
|
|
2540
|
+
if (!status || status.code === 0) return;
|
|
2541
|
+
if (status.code === 1) return "ok";
|
|
2610
2542
|
return status.message || "unknown_error";
|
|
2611
2543
|
}
|
|
2612
2544
|
const ROOT_SPAN_FIELD = "_sentryRootSpan";
|
|
@@ -2624,7 +2556,6 @@ function getActiveSpan() {
|
|
|
2624
2556
|
if (acs.getActiveSpan) return acs.getActiveSpan();
|
|
2625
2557
|
return _getSpanForScope(getCurrentScope());
|
|
2626
2558
|
}
|
|
2627
|
-
|
|
2628
2559
|
//#endregion
|
|
2629
2560
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/tracing/errors.js
|
|
2630
2561
|
let errorsInstrumented = false;
|
|
@@ -2647,17 +2578,15 @@ function errorCallback() {
|
|
|
2647
2578
|
const message = "internal_error";
|
|
2648
2579
|
DEBUG_BUILD && logger.log(`[Tracing] Root span: ${message} -> Global error occured`);
|
|
2649
2580
|
rootSpan.setStatus({
|
|
2650
|
-
code:
|
|
2581
|
+
code: 2,
|
|
2651
2582
|
message
|
|
2652
2583
|
});
|
|
2653
2584
|
}
|
|
2654
2585
|
}
|
|
2655
2586
|
errorCallback.tag = "sentry_tracingErrorCallback";
|
|
2656
|
-
|
|
2657
2587
|
//#endregion
|
|
2658
2588
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/constants.js
|
|
2659
2589
|
const DEFAULT_ENVIRONMENT = "production";
|
|
2660
|
-
|
|
2661
2590
|
//#endregion
|
|
2662
2591
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js
|
|
2663
2592
|
/**
|
|
@@ -2674,7 +2603,7 @@ function getDynamicSamplingContextFromClient(trace_id, client) {
|
|
|
2674
2603
|
const options = client.getOptions();
|
|
2675
2604
|
const { publicKey: public_key } = client.getDsn() || {};
|
|
2676
2605
|
const dsc = dropUndefinedKeys({
|
|
2677
|
-
environment: options.environment ||
|
|
2606
|
+
environment: options.environment || "production",
|
|
2678
2607
|
release: options.release,
|
|
2679
2608
|
public_key,
|
|
2680
2609
|
trace_id
|
|
@@ -2707,7 +2636,6 @@ function getDynamicSamplingContextFromSpan(span) {
|
|
|
2707
2636
|
client.emit("createDsc", dsc);
|
|
2708
2637
|
return dsc;
|
|
2709
2638
|
}
|
|
2710
|
-
|
|
2711
2639
|
//#endregion
|
|
2712
2640
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/utils/parseSampleRate.js
|
|
2713
2641
|
/**
|
|
@@ -2726,7 +2654,6 @@ function parseSampleRate(sampleRate) {
|
|
|
2726
2654
|
}
|
|
2727
2655
|
return rate;
|
|
2728
2656
|
}
|
|
2729
|
-
|
|
2730
2657
|
//#endregion
|
|
2731
2658
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/envelope.js
|
|
2732
2659
|
/**
|
|
@@ -2762,25 +2689,23 @@ function createEventEnvelope(event, dsn, metadata, tunnel) {
|
|
|
2762
2689
|
delete event.sdkProcessingMetadata;
|
|
2763
2690
|
return createEnvelope(envelopeHeaders, [[{ type: eventType }, event]]);
|
|
2764
2691
|
}
|
|
2765
|
-
|
|
2766
2692
|
//#endregion
|
|
2767
2693
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/eventProcessors.js
|
|
2768
2694
|
/**
|
|
2769
2695
|
* Process an array of event processors, returning the processed event (or `null` if the event was dropped).
|
|
2770
2696
|
*/
|
|
2771
2697
|
function notifyEventProcessors(processors, event, hint, index = 0) {
|
|
2772
|
-
return new SyncPromise((resolve
|
|
2698
|
+
return new SyncPromise((resolve, reject) => {
|
|
2773
2699
|
const processor = processors[index];
|
|
2774
|
-
if (event === null || typeof processor !== "function") resolve
|
|
2700
|
+
if (event === null || typeof processor !== "function") resolve(event);
|
|
2775
2701
|
else {
|
|
2776
2702
|
const result = processor({ ...event }, hint);
|
|
2777
2703
|
DEBUG_BUILD && processor.id && result === null && logger.log(`Event processor "${processor.id}" dropped event`);
|
|
2778
|
-
if (isThenable(result)) result.then((final) => notifyEventProcessors(processors, final, hint, index + 1).then(resolve
|
|
2779
|
-
else notifyEventProcessors(processors, result, hint, index + 1).then(resolve
|
|
2704
|
+
if (isThenable(result)) result.then((final) => notifyEventProcessors(processors, final, hint, index + 1).then(resolve)).then(null, reject);
|
|
2705
|
+
else notifyEventProcessors(processors, result, hint, index + 1).then(resolve).then(null, reject);
|
|
2780
2706
|
}
|
|
2781
2707
|
});
|
|
2782
2708
|
}
|
|
2783
|
-
|
|
2784
2709
|
//#endregion
|
|
2785
2710
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js
|
|
2786
2711
|
/**
|
|
@@ -2880,7 +2805,6 @@ function applyFingerprintToEvent(event, fingerprint) {
|
|
|
2880
2805
|
if (fingerprint) event.fingerprint = event.fingerprint.concat(fingerprint);
|
|
2881
2806
|
if (event.fingerprint && !event.fingerprint.length) delete event.fingerprint;
|
|
2882
2807
|
}
|
|
2883
|
-
|
|
2884
2808
|
//#endregion
|
|
2885
2809
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/utils/prepareEvent.js
|
|
2886
2810
|
/**
|
|
@@ -3063,7 +2987,6 @@ function getFinalScope(scope, captureContext) {
|
|
|
3063
2987
|
finalScope.update(captureContext);
|
|
3064
2988
|
return finalScope;
|
|
3065
2989
|
}
|
|
3066
|
-
|
|
3067
2990
|
//#endregion
|
|
3068
2991
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/sessionflusher.js
|
|
3069
2992
|
/**
|
|
@@ -3138,7 +3061,6 @@ var SessionFlusher = class {
|
|
|
3138
3061
|
}
|
|
3139
3062
|
}
|
|
3140
3063
|
};
|
|
3141
|
-
|
|
3142
3064
|
//#endregion
|
|
3143
3065
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/api.js
|
|
3144
3066
|
const SENTRY_API_VERSION = "7";
|
|
@@ -3168,7 +3090,6 @@ function _encodedAuth(dsn, sdkInfo) {
|
|
|
3168
3090
|
function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) {
|
|
3169
3091
|
return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;
|
|
3170
3092
|
}
|
|
3171
|
-
|
|
3172
3093
|
//#endregion
|
|
3173
3094
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/integration.js
|
|
3174
3095
|
const installedIntegrations = [];
|
|
@@ -3261,7 +3182,6 @@ function findIndex(arr, callback) {
|
|
|
3261
3182
|
function defineIntegration(fn) {
|
|
3262
3183
|
return fn;
|
|
3263
3184
|
}
|
|
3264
|
-
|
|
3265
3185
|
//#endregion
|
|
3266
3186
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/baseclient.js
|
|
3267
3187
|
const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";
|
|
@@ -3549,18 +3469,18 @@ var BaseClient = class {
|
|
|
3549
3469
|
* `false` otherwise
|
|
3550
3470
|
*/
|
|
3551
3471
|
_isClientDoneProcessing(timeout) {
|
|
3552
|
-
return new SyncPromise((resolve
|
|
3472
|
+
return new SyncPromise((resolve) => {
|
|
3553
3473
|
let ticked = 0;
|
|
3554
3474
|
const tick = 1;
|
|
3555
3475
|
const interval = setInterval(() => {
|
|
3556
3476
|
if (this._numProcessing == 0) {
|
|
3557
3477
|
clearInterval(interval);
|
|
3558
|
-
resolve
|
|
3478
|
+
resolve(true);
|
|
3559
3479
|
} else {
|
|
3560
3480
|
ticked += tick;
|
|
3561
3481
|
if (timeout && ticked >= timeout) {
|
|
3562
3482
|
clearInterval(interval);
|
|
3563
|
-
resolve
|
|
3483
|
+
resolve(false);
|
|
3564
3484
|
}
|
|
3565
3485
|
}
|
|
3566
3486
|
}, tick);
|
|
@@ -3648,11 +3568,11 @@ var BaseClient = class {
|
|
|
3648
3568
|
const options = this.getOptions();
|
|
3649
3569
|
const { sampleRate } = options;
|
|
3650
3570
|
const isTransaction = isTransactionEvent(event);
|
|
3651
|
-
const isError
|
|
3571
|
+
const isError = isErrorEvent(event);
|
|
3652
3572
|
const eventType = event.type || "error";
|
|
3653
3573
|
const beforeSendLabel = `before send for type \`${eventType}\``;
|
|
3654
3574
|
const parsedSampleRate = typeof sampleRate === "undefined" ? void 0 : parseSampleRate(sampleRate);
|
|
3655
|
-
if (isError
|
|
3575
|
+
if (isError && typeof parsedSampleRate === "number" && Math.random() > parsedSampleRate) {
|
|
3656
3576
|
this.recordDroppedEvent("sample_rate", "error", event);
|
|
3657
3577
|
return rejectedSyncPromise(new SentryError(`Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`, "log"));
|
|
3658
3578
|
}
|
|
@@ -3759,7 +3679,6 @@ function isErrorEvent(event) {
|
|
|
3759
3679
|
function isTransactionEvent(event) {
|
|
3760
3680
|
return event.type === "transaction";
|
|
3761
3681
|
}
|
|
3762
|
-
|
|
3763
3682
|
//#endregion
|
|
3764
3683
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/checkin.js
|
|
3765
3684
|
/**
|
|
@@ -3778,7 +3697,6 @@ function createCheckInEnvelope(checkIn, dynamicSamplingContext, metadata, tunnel
|
|
|
3778
3697
|
function createCheckInEnvelopeItem(checkIn) {
|
|
3779
3698
|
return [{ type: "check_in" }, checkIn];
|
|
3780
3699
|
}
|
|
3781
|
-
|
|
3782
3700
|
//#endregion
|
|
3783
3701
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/server-runtime-client.js
|
|
3784
3702
|
/**
|
|
@@ -3919,17 +3837,13 @@ var ServerRuntimeClient = class extends BaseClient {
|
|
|
3919
3837
|
return [getDynamicSamplingContextFromClient(traceId, this), traceContext];
|
|
3920
3838
|
}
|
|
3921
3839
|
};
|
|
3922
|
-
|
|
3923
|
-
//#endregion
|
|
3924
|
-
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/transports/base.js
|
|
3925
|
-
const DEFAULT_TRANSPORT_BUFFER_SIZE = 64;
|
|
3926
3840
|
/**
|
|
3927
3841
|
* Creates an instance of a Sentry `Transport`
|
|
3928
3842
|
*
|
|
3929
3843
|
* @param options
|
|
3930
3844
|
* @param makeRequest
|
|
3931
3845
|
*/
|
|
3932
|
-
function createTransport(options, makeRequest, buffer = makePromiseBuffer(options.bufferSize ||
|
|
3846
|
+
function createTransport(options, makeRequest, buffer = makePromiseBuffer(options.bufferSize || 64)) {
|
|
3933
3847
|
let rateLimits = {};
|
|
3934
3848
|
const flush = (timeout) => buffer.drain(timeout);
|
|
3935
3849
|
function send(envelope) {
|
|
@@ -3974,7 +3888,6 @@ function getEventForEnvelopeItem(item, type) {
|
|
|
3974
3888
|
if (type !== "event" && type !== "transaction") return;
|
|
3975
3889
|
return Array.isArray(item) ? item[1] : void 0;
|
|
3976
3890
|
}
|
|
3977
|
-
|
|
3978
3891
|
//#endregion
|
|
3979
3892
|
//#region ../../node_modules/.pnpm/@sentry+core@8.9.2/node_modules/@sentry/core/esm/integrations/rewriteframes.js
|
|
3980
3893
|
const INTEGRATION_NAME = "RewriteFrames";
|
|
@@ -4043,7 +3956,6 @@ function generateIteratee({ isBrowser, root, prefix }) {
|
|
|
4043
3956
|
return frame;
|
|
4044
3957
|
};
|
|
4045
3958
|
}
|
|
4046
|
-
|
|
4047
3959
|
//#endregion
|
|
4048
3960
|
//#region ../../node_modules/.pnpm/toucan-js@4.0.0_patch_hash=60bdb1dcdbde0a135bb56d6fa1a1027caba891b149e2cfcb48d6a5b3524e0a91/node_modules/toucan-js/dist/index.esm.js
|
|
4049
3961
|
function isObject(value) {
|
|
@@ -4188,8 +4100,10 @@ const requestDataIntegration = defineIntegration((userOptions = {}) => {
|
|
|
4188
4100
|
event.request = toEventRequest(sdkProcessingMetadata.request, options);
|
|
4189
4101
|
event.user = toEventUser(event.user ?? {}, sdkProcessingMetadata.request, options);
|
|
4190
4102
|
}
|
|
4191
|
-
if ("requestData" in sdkProcessingMetadata)
|
|
4192
|
-
|
|
4103
|
+
if ("requestData" in sdkProcessingMetadata) {
|
|
4104
|
+
if (event.request) event.request.data = sdkProcessingMetadata.requestData;
|
|
4105
|
+
else event.request = { data: sdkProcessingMetadata.requestData };
|
|
4106
|
+
}
|
|
4193
4107
|
return event;
|
|
4194
4108
|
}
|
|
4195
4109
|
};
|
|
@@ -4414,8 +4328,8 @@ var ToucanClient = class extends ServerRuntimeClient {
|
|
|
4414
4328
|
* This wraps node stack parser and adjusts root paths to match with source maps.
|
|
4415
4329
|
*
|
|
4416
4330
|
*/
|
|
4417
|
-
function workersStackLineParser(getModule
|
|
4418
|
-
const [arg1, arg2] = nodeStackLineParser(getModule
|
|
4331
|
+
function workersStackLineParser(getModule) {
|
|
4332
|
+
const [arg1, arg2] = nodeStackLineParser(getModule);
|
|
4419
4333
|
const fn = (line) => {
|
|
4420
4334
|
const result = arg2(line);
|
|
4421
4335
|
if (result) {
|
|
@@ -4573,7 +4487,6 @@ var Toucan = class Toucan extends Scope {
|
|
|
4573
4487
|
return callback(this.clone());
|
|
4574
4488
|
}
|
|
4575
4489
|
};
|
|
4576
|
-
|
|
4577
4490
|
//#endregion
|
|
4578
4491
|
//#region ../workers-shared/utils/sentry.ts
|
|
4579
4492
|
function setupSentry(request, context, dsn, clientId, clientSecret, coloMetadata, versionMetadata, accountId, scriptId) {
|
|
@@ -4617,7 +4530,6 @@ function setupSentry(request, context, dsn, clientId, clientSecret, coloMetadata
|
|
|
4617
4530
|
sentry.setUser({ id: accountId?.toString() });
|
|
4618
4531
|
return sentry;
|
|
4619
4532
|
}
|
|
4620
|
-
|
|
4621
4533
|
//#endregion
|
|
4622
4534
|
//#region ../workers-shared/utils/tracing.ts
|
|
4623
4535
|
function mockJaegerBindingSpan() {
|
|
@@ -4648,15 +4560,9 @@ function mockJaegerBinding() {
|
|
|
4648
4560
|
cfTraceIdHeader: "test-trace:test-span:0"
|
|
4649
4561
|
};
|
|
4650
4562
|
}
|
|
4651
|
-
|
|
4652
4563
|
//#endregion
|
|
4653
4564
|
//#region ../workers-shared/asset-worker/src/analytics.ts
|
|
4654
4565
|
const VERSION$1 = 1;
|
|
4655
|
-
let EntrypointType = /* @__PURE__ */ function(EntrypointType$1) {
|
|
4656
|
-
EntrypointType$1[EntrypointType$1["Outer"] = 0] = "Outer";
|
|
4657
|
-
EntrypointType$1[EntrypointType$1["Inner"] = 1] = "Inner";
|
|
4658
|
-
return EntrypointType$1;
|
|
4659
|
-
}({});
|
|
4660
4566
|
function getRequestKind(request) {
|
|
4661
4567
|
const dest = request.headers.get("Sec-Fetch-Dest");
|
|
4662
4568
|
if (dest) return dest === "document" || dest === "iframe" ? "navigation" : "subresource";
|
|
@@ -4718,30 +4624,6 @@ var Analytics = class {
|
|
|
4718
4624
|
});
|
|
4719
4625
|
}
|
|
4720
4626
|
};
|
|
4721
|
-
|
|
4722
|
-
//#endregion
|
|
4723
|
-
//#region ../workers-shared/utils/constants.ts
|
|
4724
|
-
/** Reserved header at the start of the whole manifest, NOT in each entry (currently unused)
|
|
4725
|
-
* manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ]
|
|
4726
|
-
*/
|
|
4727
|
-
const HEADER_SIZE = 20;
|
|
4728
|
-
/** manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */
|
|
4729
|
-
const PATH_HASH_SIZE = 16;
|
|
4730
|
-
/** manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */
|
|
4731
|
-
const CONTENT_HASH_SIZE = 16;
|
|
4732
|
-
/** manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */
|
|
4733
|
-
const TAIL_SIZE = 8;
|
|
4734
|
-
/** offset of PATH_HASH from start of each entry
|
|
4735
|
-
* manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */
|
|
4736
|
-
const PATH_HASH_OFFSET = 0;
|
|
4737
|
-
/** offset of CONTENT_HASH from start of each entry
|
|
4738
|
-
* manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */
|
|
4739
|
-
const CONTENT_HASH_OFFSET = PATH_HASH_SIZE;
|
|
4740
|
-
/** manifest = [HEADER, [ entry = PATH_HASH, CONTENT_HASH, TAIL], [entry], ... , [entry] ] */
|
|
4741
|
-
const ENTRY_SIZE = PATH_HASH_SIZE + CONTENT_HASH_SIZE + TAIL_SIZE;
|
|
4742
|
-
/** Maximum size per asset that can be deployed with a Worker */
|
|
4743
|
-
const MAX_ASSET_SIZE = 25 * 1024 * 1024;
|
|
4744
|
-
|
|
4745
4627
|
//#endregion
|
|
4746
4628
|
//#region ../workers-shared/asset-worker/src/assets-manifest.ts
|
|
4747
4629
|
var AssetsManifest = class {
|
|
@@ -4758,7 +4640,7 @@ var AssetsManifest = class {
|
|
|
4758
4640
|
const hashPath = async (path) => {
|
|
4759
4641
|
const data = new TextEncoder().encode(path);
|
|
4760
4642
|
const hashBuffer = await crypto.subtle.digest("SHA-256", data.buffer);
|
|
4761
|
-
return new Uint8Array(hashBuffer, 0,
|
|
4643
|
+
return new Uint8Array(hashBuffer, 0, 16);
|
|
4762
4644
|
};
|
|
4763
4645
|
/**
|
|
4764
4646
|
* Search for an entry with the given hash path.
|
|
@@ -4768,8 +4650,8 @@ const hashPath = async (path) => {
|
|
|
4768
4650
|
* @returns The content hash when the entry is found and `false` otherwise
|
|
4769
4651
|
*/
|
|
4770
4652
|
const binarySearch = (manifest, pathHash) => {
|
|
4771
|
-
if (pathHash.byteLength !==
|
|
4772
|
-
const numberOfEntries = (manifest.byteLength -
|
|
4653
|
+
if (pathHash.byteLength !== 16) throw new TypeError(`Search value should have a length of 16`);
|
|
4654
|
+
const numberOfEntries = (manifest.byteLength - 20) / 40;
|
|
4773
4655
|
if (numberOfEntries === 0) return false;
|
|
4774
4656
|
let lowIndex = 0;
|
|
4775
4657
|
let highIndex = numberOfEntries - 1;
|
|
@@ -4784,7 +4666,7 @@ const binarySearch = (manifest, pathHash) => {
|
|
|
4784
4666
|
lowIndex = middleIndex + 1;
|
|
4785
4667
|
continue;
|
|
4786
4668
|
}
|
|
4787
|
-
return new Uint8Array(manifest.buffer,
|
|
4669
|
+
return new Uint8Array(manifest.buffer, 20 + middleIndex * 40 + 16, 16);
|
|
4788
4670
|
}
|
|
4789
4671
|
return false;
|
|
4790
4672
|
};
|
|
@@ -4796,8 +4678,8 @@ const binarySearch = (manifest, pathHash) => {
|
|
|
4796
4678
|
* @param entryIndex the index in the manifest of the entry to compare
|
|
4797
4679
|
*/
|
|
4798
4680
|
function comparePathHashWithEntry(searchValue, manifest, entryIndex) {
|
|
4799
|
-
let pathHashOffset =
|
|
4800
|
-
for (let offset = 0; offset <
|
|
4681
|
+
let pathHashOffset = 20 + entryIndex * 40 + 0;
|
|
4682
|
+
for (let offset = 0; offset < 16; offset++, pathHashOffset++) {
|
|
4801
4683
|
const s = searchValue[offset];
|
|
4802
4684
|
const e = manifest[pathHashOffset];
|
|
4803
4685
|
if (s === void 0 || e === void 0) throw new TypeError(`Unexpected undefined value at offset ${offset} during path hash comparison`);
|
|
@@ -4815,7 +4697,6 @@ function comparePathHashWithEntry(searchValue, manifest, entryIndex) {
|
|
|
4815
4697
|
const Uint8ToHexString = (array) => {
|
|
4816
4698
|
return [...array].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
4817
4699
|
};
|
|
4818
|
-
|
|
4819
4700
|
//#endregion
|
|
4820
4701
|
//#region ../workers-shared/utils/base-path.ts
|
|
4821
4702
|
const CONTROL_CHARACTER = /[\u0000-\u001f\u007f]/;
|
|
@@ -4875,7 +4756,6 @@ function normalizeBasePath(value) {
|
|
|
4875
4756
|
value: normalizedSegments.length === 0 ? "/" : `/${normalizedSegments.join("/")}/`
|
|
4876
4757
|
};
|
|
4877
4758
|
}
|
|
4878
|
-
|
|
4879
4759
|
//#endregion
|
|
4880
4760
|
//#region ../workers-shared/asset-worker/src/compatibility-flags.ts
|
|
4881
4761
|
const SEC_FETCH_MODE_NAVIGATE_HEADER_PREFERS_ASSET_SERVING = {
|
|
@@ -4896,7 +4776,6 @@ const resolveCompatibilityOptions = (configuration) => {
|
|
|
4896
4776
|
const flagIsEnabled = (configuration, compatibilityFlag) => {
|
|
4897
4777
|
return !!configuration.compatibility_flags.find((flag) => flag === compatibilityFlag.enable);
|
|
4898
4778
|
};
|
|
4899
|
-
|
|
4900
4779
|
//#endregion
|
|
4901
4780
|
//#region ../workers-shared/asset-worker/src/configuration.ts
|
|
4902
4781
|
const normalizeConfiguration = (configuration) => {
|
|
@@ -4924,7 +4803,6 @@ const normalizeConfiguration = (configuration) => {
|
|
|
4924
4803
|
debug: configuration?.debug ?? false
|
|
4925
4804
|
};
|
|
4926
4805
|
};
|
|
4927
|
-
|
|
4928
4806
|
//#endregion
|
|
4929
4807
|
//#region ../workers-shared/asset-worker/src/experiment-analytics.ts
|
|
4930
4808
|
const VERSION = 1;
|
|
@@ -4954,7 +4832,6 @@ var ExperimentAnalytics = class {
|
|
|
4954
4832
|
});
|
|
4955
4833
|
}
|
|
4956
4834
|
};
|
|
4957
|
-
|
|
4958
4835
|
//#endregion
|
|
4959
4836
|
//#region ../workers-shared/utils/responses.ts
|
|
4960
4837
|
var OkResponse = class OkResponse extends Response {
|
|
@@ -5080,7 +4957,6 @@ var PermanentRedirectResponse = class PermanentRedirectResponse extends Response
|
|
|
5080
4957
|
});
|
|
5081
4958
|
}
|
|
5082
4959
|
};
|
|
5083
|
-
|
|
5084
4960
|
//#endregion
|
|
5085
4961
|
//#region ../workers-shared/asset-worker/src/utils/base-path.ts
|
|
5086
4962
|
/**
|
|
@@ -5136,11 +5012,9 @@ function addBasePath(assetRelativePath, base) {
|
|
|
5136
5012
|
if (assetRelativePath === "/") return base;
|
|
5137
5013
|
return base.slice(0, -1) + assetRelativePath;
|
|
5138
5014
|
}
|
|
5139
|
-
|
|
5140
5015
|
//#endregion
|
|
5141
5016
|
//#region ../workers-shared/asset-worker/src/constants.ts
|
|
5142
5017
|
const CACHE_CONTROL_BROWSER = "public, max-age=0, must-revalidate";
|
|
5143
|
-
|
|
5144
5018
|
//#endregion
|
|
5145
5019
|
//#region ../workers-shared/asset-worker/src/utils/rules-engine.ts
|
|
5146
5020
|
const ESCAPE_REGEX_CHARACTERS = /[-/\\^$*+?.()|[\]{}]/g;
|
|
@@ -5185,11 +5059,13 @@ const generateRulesMatcher = (rules, replacerFn = (match) => match) => {
|
|
|
5185
5059
|
const staticRedirectsMatcher = (configuration, host, pathname) => {
|
|
5186
5060
|
const withHostMatch = configuration.redirects.staticRules[`https://${host}${pathname}`];
|
|
5187
5061
|
const withoutHostMatch = configuration.redirects.staticRules[pathname];
|
|
5188
|
-
if (withHostMatch && withoutHostMatch)
|
|
5189
|
-
|
|
5062
|
+
if (withHostMatch && withoutHostMatch) {
|
|
5063
|
+
if (withHostMatch.lineNumber < withoutHostMatch.lineNumber) return withHostMatch;
|
|
5064
|
+
else return withoutHostMatch;
|
|
5065
|
+
}
|
|
5190
5066
|
return withHostMatch || withoutHostMatch;
|
|
5191
5067
|
};
|
|
5192
|
-
const generateRedirectsMatcher = (configuration) => generateRulesMatcher(configuration.redirects.version ===
|
|
5068
|
+
const generateRedirectsMatcher = (configuration) => generateRulesMatcher(configuration.redirects.version === 1 ? configuration.redirects.rules : {}, ({ status, to }, replacements) => ({
|
|
5193
5069
|
status,
|
|
5194
5070
|
to: normalizeRedirectTarget(to, replacements)
|
|
5195
5071
|
}));
|
|
@@ -5210,7 +5086,6 @@ function normalizeRedirectTarget(value, replacements) {
|
|
|
5210
5086
|
const suffix = suffixStart === -1 ? "" : target.slice(suffixStart);
|
|
5211
5087
|
return pathname.replace(/[/\\]+/g, "/") + suffix;
|
|
5212
5088
|
}
|
|
5213
|
-
|
|
5214
5089
|
//#endregion
|
|
5215
5090
|
//#region ../workers-shared/asset-worker/src/utils/headers.ts
|
|
5216
5091
|
/**
|
|
@@ -5232,7 +5107,7 @@ function isCacheable(request) {
|
|
|
5232
5107
|
}
|
|
5233
5108
|
function attachCustomHeaders(request, response, configuration, env) {
|
|
5234
5109
|
return (env.JAEGER ?? mockJaegerBinding()).enterSpan("add_headers", (span) => {
|
|
5235
|
-
const matches = generateRulesMatcher(configuration.headers?.version ===
|
|
5110
|
+
const matches = generateRulesMatcher(configuration.headers?.version === 2 ? configuration.headers.rules : {}, ({ set = {}, unset = [] }, replacements) => {
|
|
5236
5111
|
const replacedSet = {};
|
|
5237
5112
|
Object.entries(set).forEach(([key, value]) => {
|
|
5238
5113
|
replacedSet[key] = replacer(value, replacements);
|
|
@@ -5262,11 +5137,8 @@ function attachCustomHeaders(request, response, configuration, env) {
|
|
|
5262
5137
|
return response;
|
|
5263
5138
|
});
|
|
5264
5139
|
}
|
|
5265
|
-
|
|
5266
5140
|
//#endregion
|
|
5267
5141
|
//#region ../workers-shared/asset-worker/src/handler.ts
|
|
5268
|
-
const REDIRECTS_VERSION = 1;
|
|
5269
|
-
const HEADERS_VERSION = 2;
|
|
5270
5142
|
const getResponseOrAssetIntent = async (request, env, configuration, exists, originalDecodedPathname, analytics) => {
|
|
5271
5143
|
const url = new URL(request.url);
|
|
5272
5144
|
const { search } = url;
|
|
@@ -5293,7 +5165,8 @@ const getResponseOrAssetIntent = async (request, env, configuration, exists, ori
|
|
|
5293
5165
|
return new MethodNotAllowedResponse();
|
|
5294
5166
|
});
|
|
5295
5167
|
}
|
|
5296
|
-
const
|
|
5168
|
+
const decodedDestination = intent.redirect !== null ? addBasePath(intent.redirect, base) : effectiveDecodedPathname;
|
|
5169
|
+
const encodedDestination = encodePath(decodedDestination);
|
|
5297
5170
|
/**
|
|
5298
5171
|
* The canonical path we serve an asset at is the decoded and re-encoded version.
|
|
5299
5172
|
* Thus we need to redirect if that is different from the decoded version.
|
|
@@ -5679,7 +5552,6 @@ const notFound = async (pathname, request, configuration, exists) => {
|
|
|
5679
5552
|
}
|
|
5680
5553
|
return null;
|
|
5681
5554
|
}
|
|
5682
|
-
case "none":
|
|
5683
5555
|
default: return null;
|
|
5684
5556
|
}
|
|
5685
5557
|
};
|
|
@@ -5745,41 +5617,41 @@ const handleRedirects = (env, request, configuration, host, pathname, search) =>
|
|
|
5745
5617
|
return (env.JAEGER ?? mockJaegerBinding()).enterSpan("handle_redirects", (span) => {
|
|
5746
5618
|
const redirectMatch = staticRedirectsMatcher(configuration, host, pathname) || generateRedirectsMatcher(configuration)({ request })[0];
|
|
5747
5619
|
let proxied = false;
|
|
5748
|
-
if (redirectMatch)
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5620
|
+
if (redirectMatch) {
|
|
5621
|
+
if (redirectMatch.status === 200) {
|
|
5622
|
+
pathname = new URL(redirectMatch.to, request.url).pathname;
|
|
5623
|
+
proxied = true;
|
|
5624
|
+
span.setTags({
|
|
5625
|
+
matched: true,
|
|
5626
|
+
proxied: true,
|
|
5627
|
+
new_path: pathname,
|
|
5628
|
+
status: redirectMatch.status
|
|
5629
|
+
});
|
|
5630
|
+
} else {
|
|
5631
|
+
const { status, to } = redirectMatch;
|
|
5632
|
+
const destination = new URL(to, request.url);
|
|
5633
|
+
const location = destination.origin === new URL(request.url).origin ? `${destination.pathname}${destination.search || search}${destination.hash}` : `${destination.href.slice(0, destination.href.length - (destination.search.length + destination.hash.length))}${destination.search ? destination.search : search}${destination.hash}`;
|
|
5634
|
+
span.setTags({
|
|
5635
|
+
matched: true,
|
|
5636
|
+
destination: location,
|
|
5637
|
+
status
|
|
5638
|
+
});
|
|
5639
|
+
switch (status) {
|
|
5640
|
+
case MovedPermanentlyResponse.status: return new MovedPermanentlyResponse(location);
|
|
5641
|
+
case SeeOtherResponse.status: return new SeeOtherResponse(location);
|
|
5642
|
+
case TemporaryRedirectResponse.status: return new TemporaryRedirectResponse(location);
|
|
5643
|
+
case PermanentRedirectResponse.status: return new PermanentRedirectResponse(location);
|
|
5644
|
+
case FoundResponse.status:
|
|
5645
|
+
default: return new FoundResponse(location);
|
|
5646
|
+
}
|
|
5773
5647
|
}
|
|
5774
|
-
}
|
|
5775
|
-
else span.setTags({ matched: false });
|
|
5648
|
+
} else span.setTags({ matched: false });
|
|
5776
5649
|
return {
|
|
5777
5650
|
proxied,
|
|
5778
5651
|
pathname
|
|
5779
5652
|
};
|
|
5780
5653
|
});
|
|
5781
5654
|
};
|
|
5782
|
-
|
|
5783
5655
|
//#endregion
|
|
5784
5656
|
//#region ../workers-shared/asset-worker/src/utils/final-operations.ts
|
|
5785
5657
|
function handleError(sentry, analytics, err) {
|
|
@@ -5802,7 +5674,6 @@ function submitMetrics(analytics, performance, startTimeMs) {
|
|
|
5802
5674
|
console.error("Error submitting metrics", e);
|
|
5803
5675
|
}
|
|
5804
5676
|
}
|
|
5805
|
-
|
|
5806
5677
|
//#endregion
|
|
5807
5678
|
//#region ../workers-shared/asset-worker/src/utils/kv.ts
|
|
5808
5679
|
async function getAssetWithMetadataFromKV(assetsKVNamespace, assetKey, sentry, retries = 3) {
|
|
@@ -5830,7 +5701,6 @@ async function getAssetWithMetadataFromKV(assetsKVNamespace, assetKey, sentry, r
|
|
|
5830
5701
|
await new Promise((resolvePromise) => setTimeout(resolvePromise, Math.pow(2, attempts++) * 1e3));
|
|
5831
5702
|
}
|
|
5832
5703
|
}
|
|
5833
|
-
|
|
5834
5704
|
//#endregion
|
|
5835
5705
|
//#region ../workers-shared/asset-worker/src/worker.ts
|
|
5836
5706
|
async function unstableExistsImpl(env, pathname, _request) {
|
|
@@ -5920,7 +5790,7 @@ async function runFetchRequest(request, env, ctx, exists, getByETag, cohort) {
|
|
|
5920
5790
|
notFoundHandling: config.not_found_handling,
|
|
5921
5791
|
compatibilityFlags: config.compatibility_flags,
|
|
5922
5792
|
userAgent,
|
|
5923
|
-
entrypoint:
|
|
5793
|
+
entrypoint: 1,
|
|
5924
5794
|
cohort: cohort ?? "unknown",
|
|
5925
5795
|
requestKind: getRequestKind(request)
|
|
5926
5796
|
});
|
|
@@ -5965,14 +5835,9 @@ var AssetWorkerInner = class extends WorkerEntrypoint {
|
|
|
5965
5835
|
return unstableExistsImpl(this.env, pathname, request);
|
|
5966
5836
|
}
|
|
5967
5837
|
};
|
|
5968
|
-
|
|
5969
5838
|
//#endregion
|
|
5970
5839
|
//#region src/shared.ts
|
|
5971
5840
|
const UNKNOWN_HOST = "http://localhost";
|
|
5972
|
-
const virtualPrefix = "virtual:cloudflare/";
|
|
5973
|
-
const VIRTUAL_WORKER_ENTRY = `${virtualPrefix}worker-entry`;
|
|
5974
|
-
const VIRTUAL_EXPORT_TYPES = `${virtualPrefix}export-types`;
|
|
5975
|
-
|
|
5976
5841
|
//#endregion
|
|
5977
5842
|
//#region src/workers/asset-worker/index.ts
|
|
5978
5843
|
var CustomAssetWorker = class extends AssetWorkerInner {
|
|
@@ -6001,7 +5866,7 @@ var CustomAssetWorker = class extends AssetWorkerInner {
|
|
|
6001
5866
|
return (await this.env.__VITE_HTML_EXISTS__.fetch(url)).json();
|
|
6002
5867
|
}
|
|
6003
5868
|
};
|
|
6004
|
-
|
|
6005
5869
|
//#endregion
|
|
6006
5870
|
export { CustomAssetWorker as default };
|
|
5871
|
+
|
|
6007
5872
|
//# sourceMappingURL=index.js.map
|