@ai-sdk/provider-utils 3.0.0-canary.1 → 3.0.0-canary.10
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/CHANGELOG.md +91 -0
- package/dist/index.d.mts +33 -10
- package/dist/index.d.ts +33 -10
- package/dist/index.js +91 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +88 -4
- package/dist/index.mjs.map +1 -1
- package/{test/dist → dist/test}/index.d.mts +4 -1
- package/{test/dist → dist/test}/index.d.ts +4 -1
- package/{test/dist → dist/test}/index.js +63 -39
- package/dist/test/index.js.map +1 -0
- package/{test/dist → dist/test}/index.mjs +62 -39
- package/dist/test/index.mjs.map +1 -0
- package/package.json +13 -13
- package/test/dist/index.js.map +0 -1
- package/test/dist/index.mjs.map +0 -1
- /package/{test/dist → dist/test}/chunk-D6YTI3O5.mjs +0 -0
- /package/{test/dist → dist/test}/chunk-D6YTI3O5.mjs.map +0 -0
- /package/{test/dist → dist/test}/graphql-6JDEV3ML.mjs +0 -0
- /package/{test/dist → dist/test}/graphql-6JDEV3ML.mjs.map +0 -0
@@ -64,6 +64,7 @@ __export(test_exports, {
|
|
64
64
|
convertReadableStreamToArray: () => convertReadableStreamToArray,
|
65
65
|
convertResponseStreamToArray: () => convertResponseStreamToArray,
|
66
66
|
createTestServer: () => createTestServer,
|
67
|
+
isNodeVersion: () => isNodeVersion,
|
67
68
|
mockId: () => mockId
|
68
69
|
});
|
69
70
|
module.exports = __toCommonJS(test_exports);
|
@@ -123,6 +124,12 @@ async function convertResponseStreamToArray(response) {
|
|
123
124
|
);
|
124
125
|
}
|
125
126
|
|
127
|
+
// src/test/is-node-version.ts
|
128
|
+
function isNodeVersion(version) {
|
129
|
+
const nodeMajorVersion = parseInt(process.version.slice(1).split(".")[0], 10);
|
130
|
+
return nodeMajorVersion === version;
|
131
|
+
}
|
132
|
+
|
126
133
|
// src/test/mock-id.ts
|
127
134
|
function mockId({
|
128
135
|
prefix = "id"
|
@@ -215,7 +222,7 @@ invariant.as = (ErrorConstructor, predicate, message3, ...positionals) => {
|
|
215
222
|
}
|
216
223
|
};
|
217
224
|
|
218
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
225
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/devUtils.mjs
|
219
226
|
var LIBRARY_PREFIX = "[MSW]";
|
220
227
|
function formatMessage(message3, ...positionals) {
|
221
228
|
const interpolatedMessage = format(message3, ...positionals);
|
@@ -239,7 +246,7 @@ var InternalError = class extends Error {
|
|
239
246
|
}
|
240
247
|
};
|
241
248
|
|
242
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
249
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/checkGlobals.mjs
|
243
250
|
function checkGlobals() {
|
244
251
|
invariant(
|
245
252
|
typeof URL !== "undefined",
|
@@ -414,7 +421,7 @@ var _Emitter = class {
|
|
414
421
|
var Emitter = _Emitter;
|
415
422
|
Emitter.defaultMaxListeners = 10;
|
416
423
|
|
417
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
424
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/pipeEvents.mjs
|
418
425
|
function pipeEvents(source, destination) {
|
419
426
|
const rawEmit = source.emit;
|
420
427
|
if (rawEmit._isPiped) {
|
@@ -428,14 +435,14 @@ function pipeEvents(source, destination) {
|
|
428
435
|
source.emit = sourceEmit;
|
429
436
|
}
|
430
437
|
|
431
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
438
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/toReadonlyArray.mjs
|
432
439
|
function toReadonlyArray(source) {
|
433
440
|
const clone = [...source];
|
434
441
|
Object.freeze(clone);
|
435
442
|
return clone;
|
436
443
|
}
|
437
444
|
|
438
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
445
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/Disposable.mjs
|
439
446
|
var Disposable = class {
|
440
447
|
constructor() {
|
441
448
|
__publicField(this, "subscriptions", []);
|
@@ -448,7 +455,7 @@ var Disposable = class {
|
|
448
455
|
}
|
449
456
|
};
|
450
457
|
|
451
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
458
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/SetupApi.mjs
|
452
459
|
var InMemoryHandlersController = class {
|
453
460
|
constructor(initialHandlers) {
|
454
461
|
__publicField(this, "handlers");
|
@@ -528,7 +535,7 @@ var SetupApi = class extends Disposable {
|
|
528
535
|
}
|
529
536
|
};
|
530
537
|
|
531
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
538
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/getCallFrame.mjs
|
532
539
|
var SOURCE_FRAME = /[\/\\]msw[\/\\]src[\/\\](.+)/;
|
533
540
|
var BUILD_FRAME = /(node_modules)?[\/\\]lib[\/\\](core|browser|node|native|iife)[\/\\]|^[^\/\\]*$/;
|
534
541
|
function getCallFrame(error3) {
|
@@ -547,7 +554,7 @@ function getCallFrame(error3) {
|
|
547
554
|
return declarationPath;
|
548
555
|
}
|
549
556
|
|
550
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
557
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/isIterable.mjs
|
551
558
|
function isIterable(fn) {
|
552
559
|
if (!fn) {
|
553
560
|
return false;
|
@@ -555,7 +562,7 @@ function isIterable(fn) {
|
|
555
562
|
return Reflect.has(fn, Symbol.iterator) || Reflect.has(fn, Symbol.asyncIterator);
|
556
563
|
}
|
557
564
|
|
558
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
565
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/handlers/RequestHandler.mjs
|
559
566
|
var _RequestHandler = class _RequestHandler {
|
560
567
|
constructor(args) {
|
561
568
|
__publicField(this, "__kind");
|
@@ -707,12 +714,12 @@ var _RequestHandler = class _RequestHandler {
|
|
707
714
|
__publicField(_RequestHandler, "cache", /* @__PURE__ */ new WeakMap());
|
708
715
|
var RequestHandler = _RequestHandler;
|
709
716
|
|
710
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
717
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/isStringEqual.mjs
|
711
718
|
function isStringEqual(actual, expected) {
|
712
719
|
return actual.toLowerCase() === expected.toLowerCase();
|
713
720
|
}
|
714
721
|
|
715
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
722
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/logging/getStatusCodeColor.mjs
|
716
723
|
function getStatusCodeColor(status) {
|
717
724
|
if (status < 300) {
|
718
725
|
return "#69AB32";
|
@@ -723,7 +730,7 @@ function getStatusCodeColor(status) {
|
|
723
730
|
return "#E95F5D";
|
724
731
|
}
|
725
732
|
|
726
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
733
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/logging/getTimestamp.mjs
|
727
734
|
function getTimestamp(options) {
|
728
735
|
const now = /* @__PURE__ */ new Date();
|
729
736
|
const timestamp = `${now.getHours().toString().padStart(2, "0")}:${now.getMinutes().toString().padStart(2, "0")}:${now.getSeconds().toString().padStart(2, "0")}`;
|
@@ -733,7 +740,7 @@ function getTimestamp(options) {
|
|
733
740
|
return timestamp;
|
734
741
|
}
|
735
742
|
|
736
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
743
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/logging/serializeRequest.mjs
|
737
744
|
async function serializeRequest(request) {
|
738
745
|
const requestClone = request.clone();
|
739
746
|
const requestText = await requestClone.text();
|
@@ -912,7 +919,7 @@ var require_statuses = __commonJS({
|
|
912
919
|
var import_statuses = __toESM2(require_statuses(), 1);
|
913
920
|
var source_default = import_statuses.default;
|
914
921
|
|
915
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
922
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/logging/serializeResponse.mjs
|
916
923
|
var { message } = source_default;
|
917
924
|
async function serializeResponse(response) {
|
918
925
|
const responseClone = response.clone();
|
@@ -1822,7 +1829,7 @@ function getCleanUrl(url, isAbsolute = true) {
|
|
1822
1829
|
return [isAbsolute && url.origin, url.pathname].filter(Boolean).join("");
|
1823
1830
|
}
|
1824
1831
|
|
1825
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
1832
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/url/cleanUrl.mjs
|
1826
1833
|
var REDUNDANT_CHARACTERS_EXP = /[\?|#].*$/g;
|
1827
1834
|
function getSearchParams(path) {
|
1828
1835
|
return new URL(`/${path}`, "http://localhost").searchParams;
|
@@ -1834,12 +1841,12 @@ function cleanUrl(path) {
|
|
1834
1841
|
return path.replace(REDUNDANT_CHARACTERS_EXP, "");
|
1835
1842
|
}
|
1836
1843
|
|
1837
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
1844
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/url/isAbsoluteUrl.mjs
|
1838
1845
|
function isAbsoluteUrl(url) {
|
1839
1846
|
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
1840
1847
|
}
|
1841
1848
|
|
1842
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
1849
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/url/getAbsoluteUrl.mjs
|
1843
1850
|
function getAbsoluteUrl(path, baseUrl) {
|
1844
1851
|
if (isAbsoluteUrl(path)) {
|
1845
1852
|
return path;
|
@@ -1854,7 +1861,7 @@ function getAbsoluteUrl(path, baseUrl) {
|
|
1854
1861
|
) : path;
|
1855
1862
|
}
|
1856
1863
|
|
1857
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
1864
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/matching/normalizePath.mjs
|
1858
1865
|
function normalizePath(path, baseUrl) {
|
1859
1866
|
if (path instanceof RegExp) {
|
1860
1867
|
return path;
|
@@ -1863,7 +1870,7 @@ function normalizePath(path, baseUrl) {
|
|
1863
1870
|
return cleanUrl(maybeAbsoluteUrl);
|
1864
1871
|
}
|
1865
1872
|
|
1866
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
1873
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/matching/matchRequestUrl.mjs
|
1867
1874
|
function coercePath(path) {
|
1868
1875
|
return path.replace(
|
1869
1876
|
/([:a-zA-Z_-]*)(\*{1,2})+/g,
|
@@ -1888,7 +1895,7 @@ function matchRequestUrl(url, path, baseUrl) {
|
|
1888
1895
|
};
|
1889
1896
|
}
|
1890
1897
|
|
1891
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
1898
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/request/toPublicUrl.mjs
|
1892
1899
|
function toPublicUrl(url) {
|
1893
1900
|
if (typeof location === "undefined") {
|
1894
1901
|
return url.toString();
|
@@ -13938,7 +13945,7 @@ var require_cookie2 = __commonJS3({
|
|
13938
13945
|
var import_tough_cookie = __toESM4(require_cookie2(), 1);
|
13939
13946
|
var source_default3 = import_tough_cookie.default;
|
13940
13947
|
|
13941
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
13948
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/cookieStore.mjs
|
13942
13949
|
var { Cookie, CookieJar, Store, MemoryCookieStore, domainMatch, pathMatch } = source_default3;
|
13943
13950
|
var WebStorageCookieStore = class extends Store {
|
13944
13951
|
constructor() {
|
@@ -14090,7 +14097,7 @@ var WebStorageCookieStore = class extends Store {
|
|
14090
14097
|
var store = isNodeProcess() ? new MemoryCookieStore() : new WebStorageCookieStore();
|
14091
14098
|
var cookieStore = new CookieJar(store);
|
14092
14099
|
|
14093
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
14100
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/request/getRequestCookies.mjs
|
14094
14101
|
function parseCookies(input) {
|
14095
14102
|
const parsedCookies = source_default2.parse(input);
|
14096
14103
|
const cookies = {};
|
@@ -14145,7 +14152,7 @@ function getAllRequestCookies(request) {
|
|
14145
14152
|
};
|
14146
14153
|
}
|
14147
14154
|
|
14148
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
14155
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/handlers/HttpHandler.mjs
|
14149
14156
|
var HttpMethods = /* @__PURE__ */ ((HttpMethods2) => {
|
14150
14157
|
HttpMethods2["HEAD"] = "HEAD";
|
14151
14158
|
HttpMethods2["GET"] = "GET";
|
@@ -14235,7 +14242,7 @@ var HttpHandler = class extends RequestHandler {
|
|
14235
14242
|
}
|
14236
14243
|
};
|
14237
14244
|
|
14238
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
14245
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/http.mjs
|
14239
14246
|
function createHttpHandler(method) {
|
14240
14247
|
return (path, resolver, options = {}) => {
|
14241
14248
|
return new HttpHandler(method, path, resolver, options);
|
@@ -14666,7 +14673,7 @@ var Headers2 = class _Headers {
|
|
14666
14673
|
}
|
14667
14674
|
};
|
14668
14675
|
|
14669
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
14676
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/handlers/WebSocketHandler.mjs
|
14670
14677
|
var kEmitter = Symbol("kEmitter");
|
14671
14678
|
var kDispatchEvent = Symbol("kDispatchEvent");
|
14672
14679
|
var kSender = Symbol("kSender");
|
@@ -14840,7 +14847,7 @@ var until = async (promise) => {
|
|
14840
14847
|
}
|
14841
14848
|
};
|
14842
14849
|
|
14843
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
14850
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/executeHandlers.mjs
|
14844
14851
|
var executeHandlers = async ({
|
14845
14852
|
request,
|
14846
14853
|
requestId,
|
@@ -14868,7 +14875,7 @@ var executeHandlers = async ({
|
|
14868
14875
|
return null;
|
14869
14876
|
};
|
14870
14877
|
|
14871
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
14878
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/request/onUnhandledRequest.mjs
|
14872
14879
|
async function onUnhandledRequest(request, strategy = "warn") {
|
14873
14880
|
const url = new URL(request.url);
|
14874
14881
|
const publicUrl = toPublicUrl(url) + url.search;
|
@@ -14920,7 +14927,7 @@ Read more: https://mswjs.io/docs/getting-started/mocks`;
|
|
14920
14927
|
applyStrategy(strategy);
|
14921
14928
|
}
|
14922
14929
|
|
14923
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
14930
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/HttpResponse/decorators.mjs
|
14924
14931
|
var { message: message2 } = source_default;
|
14925
14932
|
var kSetCookie = Symbol("kSetCookie");
|
14926
14933
|
function normalizeResponseInit(init = {}) {
|
@@ -14961,7 +14968,7 @@ function decorateResponse(response, init) {
|
|
14961
14968
|
return response;
|
14962
14969
|
}
|
14963
14970
|
|
14964
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
14971
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/request/storeResponseCookies.mjs
|
14965
14972
|
function storeResponseCookies(request, response) {
|
14966
14973
|
const responseCookies = Reflect.get(response, kSetCookie);
|
14967
14974
|
if (responseCookies) {
|
@@ -14969,7 +14976,7 @@ function storeResponseCookies(request, response) {
|
|
14969
14976
|
}
|
14970
14977
|
}
|
14971
14978
|
|
14972
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
14979
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/handleRequest.mjs
|
14973
14980
|
async function handleRequest(request, requestId, handlers, options, emitter, handleRequestOptions) {
|
14974
14981
|
var _a4, _b2, _c2, _d, _e, _f;
|
14975
14982
|
emitter.emit("request:start", { request, requestId });
|
@@ -15020,7 +15027,7 @@ async function handleRequest(request, requestId, handlers, options, emitter, han
|
|
15020
15027
|
return response;
|
15021
15028
|
}
|
15022
15029
|
|
15023
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
15030
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/HttpResponse.mjs
|
15024
15031
|
var HttpResponse = class _HttpResponse extends Response {
|
15025
15032
|
constructor(body, init) {
|
15026
15033
|
const responseInit = normalizeResponseInit(init);
|
@@ -15127,10 +15134,10 @@ var HttpResponse = class _HttpResponse extends Response {
|
|
15127
15134
|
}
|
15128
15135
|
};
|
15129
15136
|
|
15130
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
15137
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/index.mjs
|
15131
15138
|
checkGlobals();
|
15132
15139
|
|
15133
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
15140
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/node/index.mjs
|
15134
15141
|
var import_node_async_hooks = require("async_hooks");
|
15135
15142
|
|
15136
15143
|
// ../../node_modules/.pnpm/@mswjs+interceptors@0.37.5/node_modules/@mswjs/interceptors/lib/node/chunk-5KMS5CTP.mjs
|
@@ -17408,12 +17415,12 @@ var _FetchInterceptor = class extends Interceptor {
|
|
17408
17415
|
var FetchInterceptor = _FetchInterceptor;
|
17409
17416
|
FetchInterceptor.symbol = Symbol("fetch");
|
17410
17417
|
|
17411
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
17418
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/isObject.mjs
|
17412
17419
|
function isObject2(value) {
|
17413
17420
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
17414
17421
|
}
|
17415
17422
|
|
17416
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
17423
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/mergeRight.mjs
|
17417
17424
|
function mergeRight(left, right) {
|
17418
17425
|
return Object.entries(right).reduce(
|
17419
17426
|
(result, [key, rightValue]) => {
|
@@ -18278,17 +18285,17 @@ var _WebSocketInterceptor = class extends Interceptor2 {
|
|
18278
18285
|
var WebSocketInterceptor = _WebSocketInterceptor;
|
18279
18286
|
WebSocketInterceptor.symbol = Symbol("websocket");
|
18280
18287
|
|
18281
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
18288
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/ws/webSocketInterceptor.mjs
|
18282
18289
|
var webSocketInterceptor = new WebSocketInterceptor();
|
18283
18290
|
|
18284
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
18291
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/utils/internal/isHandlerKind.mjs
|
18285
18292
|
function isHandlerKind(kind) {
|
18286
18293
|
return (input) => {
|
18287
18294
|
return input != null && typeof input === "object" && "__kind" in input && input.__kind === kind;
|
18288
18295
|
};
|
18289
18296
|
}
|
18290
18297
|
|
18291
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
18298
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/core/ws/handleWebSocketEvent.mjs
|
18292
18299
|
function handleWebSocketEvent(options) {
|
18293
18300
|
webSocketInterceptor.on("connection", async (connection) => {
|
18294
18301
|
const handlers = options.getHandlers();
|
@@ -18336,7 +18343,7 @@ function handleWebSocketEvent(options) {
|
|
18336
18343
|
});
|
18337
18344
|
}
|
18338
18345
|
|
18339
|
-
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.
|
18346
|
+
// ../../node_modules/.pnpm/msw@2.7.0_@types+node@20.17.24_typescript@5.8.3/node_modules/msw/lib/node/index.mjs
|
18340
18347
|
var DEFAULT_LISTEN_OPTIONS = {
|
18341
18348
|
onUnhandledRequest: "warn"
|
18342
18349
|
};
|
@@ -18498,9 +18505,25 @@ var TestServerCall = class {
|
|
18498
18505
|
constructor(request) {
|
18499
18506
|
this.request = request;
|
18500
18507
|
}
|
18508
|
+
// TODO: rename to requestBodyJson
|
18501
18509
|
get requestBody() {
|
18502
18510
|
return this.request.text().then(JSON.parse);
|
18503
18511
|
}
|
18512
|
+
get requestBodyMultipart() {
|
18513
|
+
var _a4;
|
18514
|
+
return ((_a4 = this.request.headers.get("content-type")) == null ? void 0 : _a4.startsWith(
|
18515
|
+
"multipart/form-data"
|
18516
|
+
)) ? (
|
18517
|
+
// For multipart/form-data, return the form data entries as an object
|
18518
|
+
this.request.formData().then((formData) => {
|
18519
|
+
const entries = {};
|
18520
|
+
formData.forEach((value, key) => {
|
18521
|
+
entries[key] = value;
|
18522
|
+
});
|
18523
|
+
return entries;
|
18524
|
+
})
|
18525
|
+
) : null;
|
18526
|
+
}
|
18504
18527
|
get requestCredentials() {
|
18505
18528
|
return this.request.credentials;
|
18506
18529
|
}
|
@@ -18644,6 +18667,7 @@ var TestResponseController = class {
|
|
18644
18667
|
convertReadableStreamToArray,
|
18645
18668
|
convertResponseStreamToArray,
|
18646
18669
|
createTestServer,
|
18670
|
+
isNodeVersion,
|
18647
18671
|
mockId
|
18648
18672
|
});
|
18649
18673
|
/*! Bundled license information:
|