scorecard-ai 1.0.0-alpha.6 → 1.0.0-alpha.7
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 +33 -0
- package/README.md +15 -5
- package/client.d.mts +9 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -2
- package/client.d.ts.map +1 -1
- package/client.js +20 -0
- package/client.js.map +1 -1
- package/client.mjs +20 -0
- package/client.mjs.map +1 -1
- package/internal/headers.js +1 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/to-file.d.mts +0 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts +0 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.js +3 -2
- package/internal/to-file.js.map +1 -1
- package/internal/to-file.mjs +3 -2
- package/internal/to-file.mjs.map +1 -1
- package/internal/uploads.d.mts +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js +14 -4
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +12 -3
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/uuid.d.mts +1 -1
- package/internal/utils/uuid.d.mts.map +1 -1
- package/internal/utils/uuid.d.ts +1 -1
- package/internal/utils/uuid.d.ts.map +1 -1
- package/internal/utils/uuid.js +1 -2
- package/internal/utils/uuid.js.map +1 -1
- package/internal/utils/uuid.mjs +1 -2
- package/internal/utils/uuid.mjs.map +1 -1
- package/package.json +1 -5
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/projects.d.mts +39 -4
- package/resources/projects.d.mts.map +1 -1
- package/resources/projects.d.ts +39 -4
- package/resources/projects.d.ts.map +1 -1
- package/resources/projects.js +23 -4
- package/resources/projects.js.map +1 -1
- package/resources/projects.mjs +23 -4
- package/resources/projects.mjs.map +1 -1
- package/resources/records.d.mts +10 -0
- package/resources/records.d.mts.map +1 -1
- package/resources/records.d.ts +10 -0
- package/resources/records.d.ts.map +1 -1
- package/resources/records.js +10 -0
- package/resources/records.js.map +1 -1
- package/resources/records.mjs +10 -0
- package/resources/records.mjs.map +1 -1
- package/resources/runs.d.mts +16 -0
- package/resources/runs.d.mts.map +1 -1
- package/resources/runs.d.ts +16 -0
- package/resources/runs.d.ts.map +1 -1
- package/resources/runs.js +16 -0
- package/resources/runs.js.map +1 -1
- package/resources/runs.mjs +16 -0
- package/resources/runs.mjs.map +1 -1
- package/resources/scores.d.mts +83 -0
- package/resources/scores.d.mts.map +1 -0
- package/resources/scores.d.ts +83 -0
- package/resources/scores.d.ts.map +1 -0
- package/resources/scores.js +35 -0
- package/resources/scores.js.map +1 -0
- package/resources/scores.mjs +31 -0
- package/resources/scores.mjs.map +1 -0
- package/resources/system-configs.d.mts +33 -0
- package/resources/system-configs.d.mts.map +1 -1
- package/resources/system-configs.d.ts +33 -0
- package/resources/system-configs.d.ts.map +1 -1
- package/resources/system-configs.js +33 -0
- package/resources/system-configs.js.map +1 -1
- package/resources/system-configs.mjs +33 -0
- package/resources/system-configs.mjs.map +1 -1
- package/resources/systems.d.mts +73 -0
- package/resources/systems.d.mts.map +1 -1
- package/resources/systems.d.ts +73 -0
- package/resources/systems.d.ts.map +1 -1
- package/resources/systems.js +73 -0
- package/resources/systems.js.map +1 -1
- package/resources/systems.mjs +73 -0
- package/resources/systems.mjs.map +1 -1
- package/resources/testcases.d.mts +62 -0
- package/resources/testcases.d.mts.map +1 -1
- package/resources/testcases.d.ts +62 -0
- package/resources/testcases.d.ts.map +1 -1
- package/resources/testcases.js +62 -0
- package/resources/testcases.js.map +1 -1
- package/resources/testcases.mjs +62 -0
- package/resources/testcases.mjs.map +1 -1
- package/resources/testsets.d.mts +48 -0
- package/resources/testsets.d.mts.map +1 -1
- package/resources/testsets.d.ts +48 -0
- package/resources/testsets.d.ts.map +1 -1
- package/resources/testsets.js +48 -0
- package/resources/testsets.js.map +1 -1
- package/resources/testsets.mjs +48 -0
- package/resources/testsets.mjs.map +1 -1
- package/src/client.ts +29 -4
- package/src/internal/headers.ts +1 -1
- package/src/internal/to-file.ts +4 -2
- package/src/internal/uploads.ts +16 -4
- package/src/internal/utils/uuid.ts +1 -3
- package/src/resources/index.ts +4 -2
- package/src/resources/projects.ts +48 -9
- package/src/resources/records.ts +10 -0
- package/src/resources/runs.ts +16 -0
- package/src/resources/scores.ts +98 -0
- package/src/resources/system-configs.ts +33 -0
- package/src/resources/systems.ts +73 -0
- package/src/resources/testcases.ts +62 -0
- package/src/resources/testsets.ts +48 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/internal/shims/crypto.d.mts +0 -13
- package/internal/shims/crypto.d.mts.map +0 -1
- package/internal/shims/crypto.d.ts +0 -13
- package/internal/shims/crypto.d.ts.map +0 -1
- package/internal/shims/crypto.js +0 -13
- package/internal/shims/crypto.js.map +0 -1
- package/internal/shims/crypto.mjs +0 -9
- package/internal/shims/crypto.mjs.map +0 -1
- package/internal/shims/file.d.mts +0 -22
- package/internal/shims/file.d.mts.map +0 -1
- package/internal/shims/file.d.ts +0 -22
- package/internal/shims/file.d.ts.map +0 -1
- package/internal/shims/file.js +0 -16
- package/internal/shims/file.js.map +0 -1
- package/internal/shims/file.mjs +0 -12
- package/internal/shims/file.mjs.map +0 -1
- package/internal/shims/getBuiltinModule.d.mts +0 -11
- package/internal/shims/getBuiltinModule.d.mts.map +0 -1
- package/internal/shims/getBuiltinModule.d.ts +0 -11
- package/internal/shims/getBuiltinModule.d.ts.map +0 -1
- package/internal/shims/getBuiltinModule.js +0 -71
- package/internal/shims/getBuiltinModule.js.map +0 -1
- package/internal/shims/getBuiltinModule.mjs +0 -67
- package/internal/shims/getBuiltinModule.mjs.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.mts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.mts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.ts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.ts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.js +0 -5
- package/internal/shims/nullGetBuiltinModule.js.map +0 -1
- package/internal/shims/nullGetBuiltinModule.mjs +0 -2
- package/internal/shims/nullGetBuiltinModule.mjs.map +0 -1
- package/src/internal/shims/crypto.ts +0 -18
- package/src/internal/shims/file.ts +0 -32
- package/src/internal/shims/getBuiltinModule.ts +0 -66
- package/src/internal/shims/nullGetBuiltinModule.ts +0 -1
|
@@ -9,6 +9,37 @@ import { path } from '../internal/utils/path';
|
|
|
9
9
|
export class Testcases extends APIResource {
|
|
10
10
|
/**
|
|
11
11
|
* Create multiple Testcases in the specified Testset.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const testcase = await client.testcases.create('246', {
|
|
16
|
+
* items: [
|
|
17
|
+
* {
|
|
18
|
+
* jsonData: {
|
|
19
|
+
* question: 'What is the capital of France?',
|
|
20
|
+
* idealAnswer: 'Paris',
|
|
21
|
+
* provenance: 'hand_curated',
|
|
22
|
+
* },
|
|
23
|
+
* },
|
|
24
|
+
* {
|
|
25
|
+
* jsonData: {
|
|
26
|
+
* question:
|
|
27
|
+
* 'What is the largest planet in our solar system?',
|
|
28
|
+
* idealAnswer: 'Jupiter',
|
|
29
|
+
* provenance: 'synthetic',
|
|
30
|
+
* },
|
|
31
|
+
* },
|
|
32
|
+
* {
|
|
33
|
+
* jsonData: {
|
|
34
|
+
* question:
|
|
35
|
+
* 'How many planets are in our solar system?',
|
|
36
|
+
* idealAnswer: 8,
|
|
37
|
+
* provenance: 'user_feedback',
|
|
38
|
+
* },
|
|
39
|
+
* },
|
|
40
|
+
* ],
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
12
43
|
*/
|
|
13
44
|
create(
|
|
14
45
|
testsetID: string,
|
|
@@ -20,6 +51,17 @@ export class Testcases extends APIResource {
|
|
|
20
51
|
|
|
21
52
|
/**
|
|
22
53
|
* Replace the data of an existing Testcase while keeping its ID.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const testcase = await client.testcases.update('248', {
|
|
58
|
+
* jsonData: {
|
|
59
|
+
* question: 'What is the capital of France?',
|
|
60
|
+
* idealAnswer: 'Paris is the capital of France',
|
|
61
|
+
* provenance: 'hand_curated',
|
|
62
|
+
* },
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
23
65
|
*/
|
|
24
66
|
update(testcaseID: string, body: TestcaseUpdateParams, options?: RequestOptions): APIPromise<Testcase> {
|
|
25
67
|
return this._client.put(path`/testcases/${testcaseID}`, { body, ...options });
|
|
@@ -27,6 +69,14 @@ export class Testcases extends APIResource {
|
|
|
27
69
|
|
|
28
70
|
/**
|
|
29
71
|
* Retrieve a paginated list of Testcases belonging to a Testset.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* // Automatically fetches more pages as needed.
|
|
76
|
+
* for await (const testcase of client.testcases.list('246')) {
|
|
77
|
+
* // ...
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
30
80
|
*/
|
|
31
81
|
list(
|
|
32
82
|
testsetID: string,
|
|
@@ -41,6 +91,13 @@ export class Testcases extends APIResource {
|
|
|
41
91
|
|
|
42
92
|
/**
|
|
43
93
|
* Delete multiple Testcases by their IDs.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* const testcase = await client.testcases.delete({
|
|
98
|
+
* ids: ['123', '124', '125'],
|
|
99
|
+
* });
|
|
100
|
+
* ```
|
|
44
101
|
*/
|
|
45
102
|
delete(body: TestcaseDeleteParams, options?: RequestOptions): APIPromise<TestcaseDeleteResponse> {
|
|
46
103
|
return this._client.post('/testcases/bulk-delete', { body, ...options });
|
|
@@ -48,6 +105,11 @@ export class Testcases extends APIResource {
|
|
|
48
105
|
|
|
49
106
|
/**
|
|
50
107
|
* Retrieve a specific Testcase by ID.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* const testcase = await client.testcases.get('248');
|
|
112
|
+
* ```
|
|
51
113
|
*/
|
|
52
114
|
get(testcaseID: string, options?: RequestOptions): APIPromise<Testcase> {
|
|
53
115
|
return this._client.get(path`/testcases/${testcaseID}`, options);
|
|
@@ -10,6 +10,28 @@ export class Testsets extends APIResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* Create a new Testset for a Project. The Testset will be created in the Project
|
|
12
12
|
* specified in the path.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const testset = await client.testsets.create('314', {
|
|
17
|
+
* description: 'Testset for long context Q&A chatbot.',
|
|
18
|
+
* fieldMapping: {
|
|
19
|
+
* inputs: ['question'],
|
|
20
|
+
* labels: ['idealAnswer'],
|
|
21
|
+
* metadata: [],
|
|
22
|
+
* },
|
|
23
|
+
* jsonSchema: {
|
|
24
|
+
* type: 'object',
|
|
25
|
+
* properties: {
|
|
26
|
+
* question: { type: 'string' },
|
|
27
|
+
* idealAnswer: { type: 'string' },
|
|
28
|
+
* provenance: { type: 'string' },
|
|
29
|
+
* geo: { type: 'string' },
|
|
30
|
+
* },
|
|
31
|
+
* },
|
|
32
|
+
* name: 'Long Context Q&A',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
13
35
|
*/
|
|
14
36
|
create(projectID: string, body: TestsetCreateParams, options?: RequestOptions): APIPromise<Testset> {
|
|
15
37
|
return this._client.post(path`/projects/${projectID}/testsets`, { body, ...options });
|
|
@@ -28,6 +50,14 @@ export class Testsets extends APIResource {
|
|
|
28
50
|
* updated schema
|
|
29
51
|
* - For complete control, provide both schema and fieldMapping when updating the
|
|
30
52
|
* schema
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const testset = await client.testsets.update('246', {
|
|
57
|
+
* description: 'Updated description for the Q&A Testset.',
|
|
58
|
+
* name: 'Updated Q&A Testset',
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
31
61
|
*/
|
|
32
62
|
update(
|
|
33
63
|
testsetID: string,
|
|
@@ -39,6 +69,14 @@ export class Testsets extends APIResource {
|
|
|
39
69
|
|
|
40
70
|
/**
|
|
41
71
|
* Retrieve a paginated list of Testsets belonging to a Project.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* // Automatically fetches more pages as needed.
|
|
76
|
+
* for await (const testset of client.testsets.list('314')) {
|
|
77
|
+
* // ...
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
42
80
|
*/
|
|
43
81
|
list(
|
|
44
82
|
projectID: string,
|
|
@@ -53,6 +91,11 @@ export class Testsets extends APIResource {
|
|
|
53
91
|
|
|
54
92
|
/**
|
|
55
93
|
* Delete Testset
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* const testset = await client.testsets.delete('246');
|
|
98
|
+
* ```
|
|
56
99
|
*/
|
|
57
100
|
delete(testsetID: string, options?: RequestOptions): APIPromise<TestsetDeleteResponse> {
|
|
58
101
|
return this._client.delete(path`/testsets/${testsetID}`, options);
|
|
@@ -60,6 +103,11 @@ export class Testsets extends APIResource {
|
|
|
60
103
|
|
|
61
104
|
/**
|
|
62
105
|
* Get Testset by ID
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* const testset = await client.testsets.get('246');
|
|
110
|
+
* ```
|
|
63
111
|
*/
|
|
64
112
|
get(testsetID: string, options?: RequestOptions): APIPromise<Testset> {
|
|
65
113
|
return this._client.get(path`/testsets/${testsetID}`, options);
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.0.0-alpha.
|
|
1
|
+
export const VERSION = '1.0.0-alpha.7'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.0-alpha.
|
|
1
|
+
export declare const VERSION = "1.0.0-alpha.7";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.0-alpha.
|
|
1
|
+
export declare const VERSION = "1.0.0-alpha.7";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '1.0.0-alpha.
|
|
4
|
+
exports.VERSION = '1.0.0-alpha.7'; // x-release-please-version
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.0.0-alpha.
|
|
1
|
+
export const VERSION = '1.0.0-alpha.7'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type Crypto = {
|
|
2
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
3
|
-
getRandomValues<T extends ArrayBufferView | null>(array: T): T;
|
|
4
|
-
/**
|
|
5
|
-
* Available only in secure contexts.
|
|
6
|
-
*
|
|
7
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
|
|
8
|
-
*/
|
|
9
|
-
randomUUID?: () => string;
|
|
10
|
-
};
|
|
11
|
-
export declare let getCrypto: () => Crypto | undefined;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=crypto.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.mts","sourceRoot":"","sources":["../../src/internal/shims/crypto.ts"],"names":[],"mappings":"AAEA,KAAK,MAAM,GAAG;IACZ,yFAAyF;IACzF,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IAC/D;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AACF,eAAO,IAAI,SAAS,EAAE,MAAM,MAAM,GAAG,SAKpC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type Crypto = {
|
|
2
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
3
|
-
getRandomValues<T extends ArrayBufferView | null>(array: T): T;
|
|
4
|
-
/**
|
|
5
|
-
* Available only in secure contexts.
|
|
6
|
-
*
|
|
7
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
|
|
8
|
-
*/
|
|
9
|
-
randomUUID?: () => string;
|
|
10
|
-
};
|
|
11
|
-
export declare let getCrypto: () => Crypto | undefined;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/internal/shims/crypto.ts"],"names":[],"mappings":"AAEA,KAAK,MAAM,GAAG;IACZ,yFAAyF;IACzF,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IAC/D;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AACF,eAAO,IAAI,SAAS,EAAE,MAAM,MAAM,GAAG,SAKpC,CAAC"}
|
package/internal/shims/crypto.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCrypto = void 0;
|
|
4
|
-
const getBuiltinModule_1 = require("./getBuiltinModule.js");
|
|
5
|
-
let getCrypto = function lazyGetCrypto() {
|
|
6
|
-
if (exports.getCrypto !== lazyGetCrypto)
|
|
7
|
-
return (0, exports.getCrypto)();
|
|
8
|
-
const crypto = globalThis.crypto || (0, getBuiltinModule_1.getBuiltinModule)?.('node:crypto')?.webcrypto;
|
|
9
|
-
exports.getCrypto = () => crypto;
|
|
10
|
-
return crypto;
|
|
11
|
-
};
|
|
12
|
-
exports.getCrypto = getCrypto;
|
|
13
|
-
//# sourceMappingURL=crypto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/internal/shims/crypto.ts"],"names":[],"mappings":";;;AAAA,4DAAsD;AAY/C,IAAI,SAAS,GAA6B,SAAS,aAAa;IACrE,IAAI,iBAAS,KAAK,aAAa;QAAE,OAAO,IAAA,iBAAS,GAAE,CAAC;IACpD,MAAM,MAAM,GAAY,UAAkB,CAAC,MAAM,IAAK,IAAA,mCAAgB,CAAA,EAAE,CAAC,aAAa,CAAS,EAAE,SAAS,CAAC;IAC3G,iBAAS,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC;IACzB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AALS,QAAA,SAAS,aAKlB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { getBuiltinModule } from "./getBuiltinModule.mjs";
|
|
2
|
-
export let getCrypto = function lazyGetCrypto() {
|
|
3
|
-
if (getCrypto !== lazyGetCrypto)
|
|
4
|
-
return getCrypto();
|
|
5
|
-
const crypto = globalThis.crypto || getBuiltinModule?.('node:crypto')?.webcrypto;
|
|
6
|
-
getCrypto = () => crypto;
|
|
7
|
-
return crypto;
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=crypto.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.mjs","sourceRoot":"","sources":["../../src/internal/shims/crypto.ts"],"names":[],"mappings":"OAAO,EAAE,gBAAgB,EAAE;AAY3B,MAAM,CAAC,IAAI,SAAS,GAA6B,SAAS,aAAa;IACrE,IAAI,SAAS,KAAK,aAAa;QAAE,OAAO,SAAS,EAAE,CAAC;IACpD,MAAM,MAAM,GAAY,UAAkB,CAAC,MAAM,IAAK,gBAAgB,EAAE,CAAC,aAAa,CAAS,EAAE,SAAS,CAAC;IAC3G,SAAS,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC;IACzB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare let getFile: () => FileConstructor;
|
|
2
|
-
type FileConstructor = typeof globalThis extends {
|
|
3
|
-
File: infer fileConstructor;
|
|
4
|
-
} ? fileConstructor : typeof FallbackFile;
|
|
5
|
-
export type File = InstanceType<FileConstructor>;
|
|
6
|
-
type FallbackBlobSource = ConstructorParameters<typeof Blob>[0] extends infer T ? T : never;
|
|
7
|
-
/**
|
|
8
|
-
* A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
|
|
9
|
-
*/
|
|
10
|
-
declare class FallbackFile extends Blob {
|
|
11
|
-
constructor(sources: FallbackBlobSource, fileName: string, options?: any);
|
|
12
|
-
/**
|
|
13
|
-
* The name of the `File`.
|
|
14
|
-
*/
|
|
15
|
-
readonly name: string;
|
|
16
|
-
/**
|
|
17
|
-
* The last modified date of the `File`.
|
|
18
|
-
*/
|
|
19
|
-
readonly lastModified: number;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=file.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.mts","sourceRoot":"","sources":["../../src/internal/shims/file.ts"],"names":[],"mappings":"AAEA,eAAO,IAAI,OAAO,QAA2B,eAO5C,CAAC;AAEF,KAAK,eAAe,GAClB,OAAO,UAAU,SAAS;IAAE,IAAI,EAAE,MAAM,eAAe,CAAA;CAAE,GAAG,eAAe,GAAG,OAAO,YAAY,CAAC;AACpG,MAAM,MAAM,IAAI,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;AAIjD,KAAK,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC5F;;GAEG;AACH,OAAO,OAAO,YAAa,SAAQ,IAAI;gBACzB,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;IACxE;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B"}
|
package/internal/shims/file.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare let getFile: () => FileConstructor;
|
|
2
|
-
type FileConstructor = typeof globalThis extends {
|
|
3
|
-
File: infer fileConstructor;
|
|
4
|
-
} ? fileConstructor : typeof FallbackFile;
|
|
5
|
-
export type File = InstanceType<FileConstructor>;
|
|
6
|
-
type FallbackBlobSource = ConstructorParameters<typeof Blob>[0] extends infer T ? T : never;
|
|
7
|
-
/**
|
|
8
|
-
* A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
|
|
9
|
-
*/
|
|
10
|
-
declare class FallbackFile extends Blob {
|
|
11
|
-
constructor(sources: FallbackBlobSource, fileName: string, options?: any);
|
|
12
|
-
/**
|
|
13
|
-
* The name of the `File`.
|
|
14
|
-
*/
|
|
15
|
-
readonly name: string;
|
|
16
|
-
/**
|
|
17
|
-
* The last modified date of the `File`.
|
|
18
|
-
*/
|
|
19
|
-
readonly lastModified: number;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/internal/shims/file.ts"],"names":[],"mappings":"AAEA,eAAO,IAAI,OAAO,QAA2B,eAO5C,CAAC;AAEF,KAAK,eAAe,GAClB,OAAO,UAAU,SAAS;IAAE,IAAI,EAAE,MAAM,eAAe,CAAA;CAAE,GAAG,eAAe,GAAG,OAAO,YAAY,CAAC;AACpG,MAAM,MAAM,IAAI,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;AAIjD,KAAK,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC5F;;GAEG;AACH,OAAO,OAAO,YAAa,SAAQ,IAAI;gBACzB,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;IACxE;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B"}
|
package/internal/shims/file.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFile = void 0;
|
|
4
|
-
const getBuiltinModule_1 = require("./getBuiltinModule.js");
|
|
5
|
-
let getFile = function lazyGetFile() {
|
|
6
|
-
if (exports.getFile !== lazyGetFile)
|
|
7
|
-
return (0, exports.getFile)();
|
|
8
|
-
// We can drop getBuiltinModule once we no longer support Node < 20.0.0
|
|
9
|
-
const File = globalThis.File ?? (0, getBuiltinModule_1.getBuiltinModule)?.('node:buffer')?.File;
|
|
10
|
-
if (!File)
|
|
11
|
-
throw new Error('`File` is not defined as a global, which is required for file uploads.');
|
|
12
|
-
exports.getFile = () => File;
|
|
13
|
-
return File;
|
|
14
|
-
};
|
|
15
|
-
exports.getFile = getFile;
|
|
16
|
-
//# sourceMappingURL=file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/internal/shims/file.ts"],"names":[],"mappings":";;;AAAA,4DAAsD;AAE/C,IAAI,OAAO,GAAG,SAAS,WAAW;IACvC,IAAI,eAAO,KAAK,WAAW;QAAE,OAAO,IAAA,eAAO,GAAE,CAAC;IAC9C,uEAAuE;IACvE,MAAM,IAAI,GAAI,UAAkB,CAAC,IAAI,IAAK,IAAA,mCAAgB,CAAA,EAAE,CAAC,aAAa,CAAS,EAAE,IAAI,CAAC;IAC1F,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IACrG,eAAO,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;IACrB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAPS,QAAA,OAAO,WAOhB"}
|
package/internal/shims/file.mjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { getBuiltinModule } from "./getBuiltinModule.mjs";
|
|
2
|
-
export let getFile = function lazyGetFile() {
|
|
3
|
-
if (getFile !== lazyGetFile)
|
|
4
|
-
return getFile();
|
|
5
|
-
// We can drop getBuiltinModule once we no longer support Node < 20.0.0
|
|
6
|
-
const File = globalThis.File ?? getBuiltinModule?.('node:buffer')?.File;
|
|
7
|
-
if (!File)
|
|
8
|
-
throw new Error('`File` is not defined as a global, which is required for file uploads.');
|
|
9
|
-
getFile = () => File;
|
|
10
|
-
return File;
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=file.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.mjs","sourceRoot":"","sources":["../../src/internal/shims/file.ts"],"names":[],"mappings":"OAAO,EAAE,gBAAgB,EAAE;AAE3B,MAAM,CAAC,IAAI,OAAO,GAAG,SAAS,WAAW;IACvC,IAAI,OAAO,KAAK,WAAW;QAAE,OAAO,OAAO,EAAE,CAAC;IAC9C,uEAAuE;IACvE,MAAM,IAAI,GAAI,UAAkB,CAAC,IAAI,IAAK,gBAAgB,EAAE,CAAC,aAAa,CAAS,EAAE,IAAI,CAAC;IAC1F,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IACrG,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;IACrB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Load a Node built-in module. ID may or may not be prefixed by `node:` and
|
|
3
|
-
* will be normalized. If we used static imports then our bundle size would be bloated by
|
|
4
|
-
* injected polyfills, and if we used dynamic require then in addition to bundlers logging warnings,
|
|
5
|
-
* our code would not work when bundled to ESM and run in Node 18.
|
|
6
|
-
* @param {string} id ID of the built-in to be loaded.
|
|
7
|
-
* @returns {object|undefined} exports of the built-in. Undefined if the built-in
|
|
8
|
-
* does not exist.
|
|
9
|
-
*/
|
|
10
|
-
export declare let getBuiltinModule: null | ((id: string) => object | undefined);
|
|
11
|
-
//# sourceMappingURL=getBuiltinModule.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltinModule.d.mts","sourceRoot":"","sources":["../../src/internal/shims/getBuiltinModule.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,IAAI,gBAAgB,EAAE,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAwDtE,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Load a Node built-in module. ID may or may not be prefixed by `node:` and
|
|
3
|
-
* will be normalized. If we used static imports then our bundle size would be bloated by
|
|
4
|
-
* injected polyfills, and if we used dynamic require then in addition to bundlers logging warnings,
|
|
5
|
-
* our code would not work when bundled to ESM and run in Node 18.
|
|
6
|
-
* @param {string} id ID of the built-in to be loaded.
|
|
7
|
-
* @returns {object|undefined} exports of the built-in. Undefined if the built-in
|
|
8
|
-
* does not exist.
|
|
9
|
-
*/
|
|
10
|
-
export declare let getBuiltinModule: null | ((id: string) => object | undefined);
|
|
11
|
-
//# sourceMappingURL=getBuiltinModule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltinModule.d.ts","sourceRoot":"","sources":["../../src/internal/shims/getBuiltinModule.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,IAAI,gBAAgB,EAAE,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAwDtE,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBuiltinModule = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Load a Node built-in module. ID may or may not be prefixed by `node:` and
|
|
6
|
-
* will be normalized. If we used static imports then our bundle size would be bloated by
|
|
7
|
-
* injected polyfills, and if we used dynamic require then in addition to bundlers logging warnings,
|
|
8
|
-
* our code would not work when bundled to ESM and run in Node 18.
|
|
9
|
-
* @param {string} id ID of the built-in to be loaded.
|
|
10
|
-
* @returns {object|undefined} exports of the built-in. Undefined if the built-in
|
|
11
|
-
* does not exist.
|
|
12
|
-
*/
|
|
13
|
-
let getBuiltinModule = function getBuiltinModuleLazy(id) {
|
|
14
|
-
try {
|
|
15
|
-
if (exports.getBuiltinModule !== getBuiltinModuleLazy)
|
|
16
|
-
return exports.getBuiltinModule(id);
|
|
17
|
-
if (process.getBuiltinModule) {
|
|
18
|
-
exports.getBuiltinModule = process.getBuiltinModule;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
/* Fallback implementation for Node 18 */
|
|
22
|
-
function createFallbackGetBuiltinModule(BuiltinModule) {
|
|
23
|
-
return function getBuiltinModule(id) {
|
|
24
|
-
id = BuiltinModule.normalizeRequirableId(String(id));
|
|
25
|
-
if (!BuiltinModule.canBeRequiredByUsers(id)) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const mod = BuiltinModule.map.get(id);
|
|
29
|
-
mod.compileForPublicLoader();
|
|
30
|
-
return mod.exports;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const magicKey = Math.random() + '';
|
|
34
|
-
let module;
|
|
35
|
-
let ObjectPrototype = Blob;
|
|
36
|
-
for (let next; (next = Reflect.getPrototypeOf(ObjectPrototype)); ObjectPrototype = next)
|
|
37
|
-
;
|
|
38
|
-
try {
|
|
39
|
-
const kClone = Object.getOwnPropertySymbols(Blob.prototype).find((e) => e.description?.includes('clone'));
|
|
40
|
-
Object.defineProperty(ObjectPrototype, magicKey, {
|
|
41
|
-
get() {
|
|
42
|
-
module = this;
|
|
43
|
-
throw null;
|
|
44
|
-
},
|
|
45
|
-
configurable: true,
|
|
46
|
-
});
|
|
47
|
-
structuredClone(new (class extends Blob {
|
|
48
|
-
[kClone]() {
|
|
49
|
-
return {
|
|
50
|
-
deserializeInfo: 'internal/bootstrap/realm:' + magicKey,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
})([]));
|
|
54
|
-
}
|
|
55
|
-
catch { }
|
|
56
|
-
delete ObjectPrototype[magicKey];
|
|
57
|
-
if (module) {
|
|
58
|
-
exports.getBuiltinModule = createFallbackGetBuiltinModule(module.BuiltinModule);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
exports.getBuiltinModule = () => undefined;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return exports.getBuiltinModule(id);
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
return undefined;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
exports.getBuiltinModule = getBuiltinModule;
|
|
71
|
-
//# sourceMappingURL=getBuiltinModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltinModule.js","sourceRoot":"","sources":["../../src/internal/shims/getBuiltinModule.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACI,IAAI,gBAAgB,GAAgD,SAAS,oBAAoB,CACtG,EAAU;IAEV,IAAI,CAAC;QACH,IAAI,wBAAgB,KAAK,oBAAoB;YAAE,OAAO,wBAAiB,CAAC,EAAE,CAAC,CAAC;QAC5E,IAAK,OAAe,CAAC,gBAAgB,EAAE,CAAC;YACtC,wBAAgB,GAAI,OAAe,CAAC,gBAAgB,CAAC;QACvD,CAAC;aAAM,CAAC;YACN,yCAAyC;YACzC,SAAS,8BAA8B,CAAC,aAAkB;gBACxD,OAAO,SAAS,gBAAgB,CAAC,EAAU;oBACzC,EAAE,GAAG,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;oBACrD,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,CAAC;wBAC5C,OAAO;oBACT,CAAC;oBACD,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;oBACtC,GAAG,CAAC,sBAAsB,EAAE,CAAC;oBAC7B,OAAO,GAAG,CAAC,OAAO,CAAC;gBACrB,CAAC,CAAC;YACJ,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;YACpC,IAAI,MAA0C,CAAC;YAC/C,IAAI,eAAe,GAAO,IAAI,CAAC;YAC/B,KAAK,IAAI,IAAI,EAAE,CAAC,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,EAAE,eAAe,GAAG,IAAI;gBAAC,CAAC;YACzF,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAC9D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,CACvC,CAAC;gBACH,MAAM,CAAC,cAAc,CAAC,eAAe,EAAE,QAAQ,EAAE;oBAC/C,GAAG;wBACD,MAAM,GAAG,IAAI,CAAC;wBACd,MAAM,IAAI,CAAC;oBACb,CAAC;oBACD,YAAY,EAAE,IAAI;iBACnB,CAAC,CAAC;gBACH,eAAe,CACb,IAAI,CAAC,KAAM,SAAQ,IAAI;oBACrB,CAAC,MAAM,CAAC;wBACN,OAAO;4BACL,eAAe,EAAE,2BAA2B,GAAG,QAAQ;yBACxD,CAAC;oBACJ,CAAC;iBACF,CAAC,CAAC,EAAE,CAAC,CACP,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;YACV,OAAQ,eAAuB,CAAC,QAAQ,CAAC,CAAC;YAC1C,IAAI,MAAM,EAAE,CAAC;gBACX,wBAAgB,GAAG,8BAA8B,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAC1E,CAAC;iBAAM,CAAC;gBACN,wBAAgB,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC;YACrC,CAAC;QACH,CAAC;QACD,OAAO,wBAAiB,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAC;AAxDS,QAAA,gBAAgB,oBAwDzB"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Load a Node built-in module. ID may or may not be prefixed by `node:` and
|
|
3
|
-
* will be normalized. If we used static imports then our bundle size would be bloated by
|
|
4
|
-
* injected polyfills, and if we used dynamic require then in addition to bundlers logging warnings,
|
|
5
|
-
* our code would not work when bundled to ESM and run in Node 18.
|
|
6
|
-
* @param {string} id ID of the built-in to be loaded.
|
|
7
|
-
* @returns {object|undefined} exports of the built-in. Undefined if the built-in
|
|
8
|
-
* does not exist.
|
|
9
|
-
*/
|
|
10
|
-
export let getBuiltinModule = function getBuiltinModuleLazy(id) {
|
|
11
|
-
try {
|
|
12
|
-
if (getBuiltinModule !== getBuiltinModuleLazy)
|
|
13
|
-
return getBuiltinModule(id);
|
|
14
|
-
if (process.getBuiltinModule) {
|
|
15
|
-
getBuiltinModule = process.getBuiltinModule;
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
/* Fallback implementation for Node 18 */
|
|
19
|
-
function createFallbackGetBuiltinModule(BuiltinModule) {
|
|
20
|
-
return function getBuiltinModule(id) {
|
|
21
|
-
id = BuiltinModule.normalizeRequirableId(String(id));
|
|
22
|
-
if (!BuiltinModule.canBeRequiredByUsers(id)) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const mod = BuiltinModule.map.get(id);
|
|
26
|
-
mod.compileForPublicLoader();
|
|
27
|
-
return mod.exports;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
const magicKey = Math.random() + '';
|
|
31
|
-
let module;
|
|
32
|
-
let ObjectPrototype = Blob;
|
|
33
|
-
for (let next; (next = Reflect.getPrototypeOf(ObjectPrototype)); ObjectPrototype = next)
|
|
34
|
-
;
|
|
35
|
-
try {
|
|
36
|
-
const kClone = Object.getOwnPropertySymbols(Blob.prototype).find((e) => e.description?.includes('clone'));
|
|
37
|
-
Object.defineProperty(ObjectPrototype, magicKey, {
|
|
38
|
-
get() {
|
|
39
|
-
module = this;
|
|
40
|
-
throw null;
|
|
41
|
-
},
|
|
42
|
-
configurable: true,
|
|
43
|
-
});
|
|
44
|
-
structuredClone(new (class extends Blob {
|
|
45
|
-
[kClone]() {
|
|
46
|
-
return {
|
|
47
|
-
deserializeInfo: 'internal/bootstrap/realm:' + magicKey,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
})([]));
|
|
51
|
-
}
|
|
52
|
-
catch { }
|
|
53
|
-
delete ObjectPrototype[magicKey];
|
|
54
|
-
if (module) {
|
|
55
|
-
getBuiltinModule = createFallbackGetBuiltinModule(module.BuiltinModule);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
getBuiltinModule = () => undefined;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return getBuiltinModule(id);
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=getBuiltinModule.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltinModule.mjs","sourceRoot":"","sources":["../../src/internal/shims/getBuiltinModule.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAI,gBAAgB,GAAgD,SAAS,oBAAoB,CACtG,EAAU;IAEV,IAAI,CAAC;QACH,IAAI,gBAAgB,KAAK,oBAAoB;YAAE,OAAO,gBAAiB,CAAC,EAAE,CAAC,CAAC;QAC5E,IAAK,OAAe,CAAC,gBAAgB,EAAE,CAAC;YACtC,gBAAgB,GAAI,OAAe,CAAC,gBAAgB,CAAC;QACvD,CAAC;aAAM,CAAC;YACN,yCAAyC;YACzC,SAAS,8BAA8B,CAAC,aAAkB;gBACxD,OAAO,SAAS,gBAAgB,CAAC,EAAU;oBACzC,EAAE,GAAG,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;oBACrD,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,CAAC;wBAC5C,OAAO;oBACT,CAAC;oBACD,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;oBACtC,GAAG,CAAC,sBAAsB,EAAE,CAAC;oBAC7B,OAAO,GAAG,CAAC,OAAO,CAAC;gBACrB,CAAC,CAAC;YACJ,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;YACpC,IAAI,MAA0C,CAAC;YAC/C,IAAI,eAAe,GAAO,IAAI,CAAC;YAC/B,KAAK,IAAI,IAAI,EAAE,CAAC,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,EAAE,eAAe,GAAG,IAAI;gBAAC,CAAC;YACzF,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAC9D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,CACvC,CAAC;gBACH,MAAM,CAAC,cAAc,CAAC,eAAe,EAAE,QAAQ,EAAE;oBAC/C,GAAG;wBACD,MAAM,GAAG,IAAI,CAAC;wBACd,MAAM,IAAI,CAAC;oBACb,CAAC;oBACD,YAAY,EAAE,IAAI;iBACnB,CAAC,CAAC;gBACH,eAAe,CACb,IAAI,CAAC,KAAM,SAAQ,IAAI;oBACrB,CAAC,MAAM,CAAC;wBACN,OAAO;4BACL,eAAe,EAAE,2BAA2B,GAAG,QAAQ;yBACxD,CAAC;oBACJ,CAAC;iBACF,CAAC,CAAC,EAAE,CAAC,CACP,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;YACV,OAAQ,eAAuB,CAAC,QAAQ,CAAC,CAAC;YAC1C,IAAI,MAAM,EAAE,CAAC;gBACX,gBAAgB,GAAG,8BAA8B,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAC1E,CAAC;iBAAM,CAAC;gBACN,gBAAgB,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC;YACrC,CAAC;QACH,CAAC;QACD,OAAO,gBAAiB,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullGetBuiltinModule.d.mts","sourceRoot":"","sources":["../../src/internal/shims/nullGetBuiltinModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,MAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullGetBuiltinModule.d.ts","sourceRoot":"","sources":["../../src/internal/shims/nullGetBuiltinModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,MAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullGetBuiltinModule.js","sourceRoot":"","sources":["../../src/internal/shims/nullGetBuiltinModule.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullGetBuiltinModule.mjs","sourceRoot":"","sources":["../../src/internal/shims/nullGetBuiltinModule.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getBuiltinModule } from './getBuiltinModule';
|
|
2
|
-
|
|
3
|
-
type Crypto = {
|
|
4
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
|
|
5
|
-
getRandomValues<T extends ArrayBufferView | null>(array: T): T;
|
|
6
|
-
/**
|
|
7
|
-
* Available only in secure contexts.
|
|
8
|
-
*
|
|
9
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
|
|
10
|
-
*/
|
|
11
|
-
randomUUID?: () => string;
|
|
12
|
-
};
|
|
13
|
-
export let getCrypto: () => Crypto | undefined = function lazyGetCrypto() {
|
|
14
|
-
if (getCrypto !== lazyGetCrypto) return getCrypto();
|
|
15
|
-
const crypto: Crypto = (globalThis as any).crypto || (getBuiltinModule?.('node:crypto') as any)?.webcrypto;
|
|
16
|
-
getCrypto = () => crypto;
|
|
17
|
-
return crypto;
|
|
18
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { getBuiltinModule } from './getBuiltinModule';
|
|
2
|
-
|
|
3
|
-
export let getFile = function lazyGetFile(): FileConstructor {
|
|
4
|
-
if (getFile !== lazyGetFile) return getFile();
|
|
5
|
-
// We can drop getBuiltinModule once we no longer support Node < 20.0.0
|
|
6
|
-
const File = (globalThis as any).File ?? (getBuiltinModule?.('node:buffer') as any)?.File;
|
|
7
|
-
if (!File) throw new Error('`File` is not defined as a global, which is required for file uploads.');
|
|
8
|
-
getFile = () => File;
|
|
9
|
-
return File;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
type FileConstructor =
|
|
13
|
-
typeof globalThis extends { File: infer fileConstructor } ? fileConstructor : typeof FallbackFile;
|
|
14
|
-
export type File = InstanceType<FileConstructor>;
|
|
15
|
-
|
|
16
|
-
// The infer is to make TS show it as a nice union type,
|
|
17
|
-
// instead of literally `ConstructorParameters<typeof Blob>[0]`
|
|
18
|
-
type FallbackBlobSource = ConstructorParameters<typeof Blob>[0] extends infer T ? T : never;
|
|
19
|
-
/**
|
|
20
|
-
* A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
|
|
21
|
-
*/
|
|
22
|
-
declare class FallbackFile extends Blob {
|
|
23
|
-
constructor(sources: FallbackBlobSource, fileName: string, options?: any);
|
|
24
|
-
/**
|
|
25
|
-
* The name of the `File`.
|
|
26
|
-
*/
|
|
27
|
-
readonly name: string;
|
|
28
|
-
/**
|
|
29
|
-
* The last modified date of the `File`.
|
|
30
|
-
*/
|
|
31
|
-
readonly lastModified: number;
|
|
32
|
-
}
|