openai 4.8.0 → 4.9.0
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 +8 -0
- package/README.md +4 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/{src/_shims/ReadableStream-node.ts → _shims/auto/runtime-bun.d.ts} +2 -3
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +99 -0
- package/_shims/{ReadableStream.js → auto/types.js} +0 -2
- package/{src/_shims/ReadableStream.js → _shims/auto/types.mjs} +0 -2
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +79 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +87 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +54 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +35 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +39 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +35 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +70 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +63 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +82 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +170 -218
- package/core.d.ts.map +1 -1
- package/core.js +679 -737
- package/core.js.map +1 -1
- package/core.mjs +673 -688
- package/core.mjs.map +1 -1
- package/error.d.ts +32 -34
- package/error.js +95 -109
- package/error.mjs +92 -94
- package/index.d.mts +164 -175
- package/index.d.ts +164 -175
- package/index.d.ts.map +1 -1
- package/index.js +110 -161
- package/index.mjs +88 -109
- package/package.json +31 -58
- package/pagination.d.ts +31 -41
- package/pagination.js +52 -48
- package/pagination.mjs +50 -46
- package/resource.d.ts +10 -10
- package/resource.js +12 -12
- package/resource.mjs +10 -10
- package/resources/audio/audio.d.ts +12 -12
- package/resources/audio/audio.js +33 -50
- package/resources/audio/audio.mjs +11 -11
- package/resources/audio/index.d.ts +4 -4
- package/resources/audio/index.js +9 -24
- package/resources/audio/index.mjs +4 -4
- package/resources/audio/transcriptions.d.ts +44 -44
- package/resources/audio/transcriptions.js +13 -12
- package/resources/audio/transcriptions.mjs +9 -8
- package/resources/audio/translations.d.ts +38 -38
- package/resources/audio/translations.js +13 -12
- package/resources/audio/translations.mjs +9 -8
- package/resources/chat/chat.d.ts +17 -17
- package/resources/chat/chat.js +30 -47
- package/resources/chat/chat.mjs +8 -8
- package/resources/chat/completions.d.ts +330 -353
- package/resources/chat/completions.js +10 -13
- package/resources/chat/completions.mjs +7 -10
- package/resources/chat/index.d.ts +3 -17
- package/resources/chat/index.js +7 -17
- package/resources/chat/index.mjs +3 -3
- package/resources/completions.d.ts +216 -232
- package/resources/completions.js +10 -13
- package/resources/completions.mjs +7 -10
- package/resources/edits.d.ts +73 -73
- package/resources/edits.js +16 -15
- package/resources/edits.mjs +13 -12
- package/resources/embeddings.d.ts +73 -76
- package/resources/embeddings.js +12 -11
- package/resources/embeddings.mjs +9 -8
- package/resources/files.d.ts +91 -96
- package/resources/files.js +64 -65
- package/resources/files.mjs +57 -58
- package/resources/fine-tunes.d.ts +277 -290
- package/resources/fine-tunes.js +49 -50
- package/resources/fine-tunes.mjs +45 -46
- package/resources/fine-tuning/fine-tuning.d.ts +12 -12
- package/resources/fine-tuning/fine-tuning.js +32 -49
- package/resources/fine-tuning/fine-tuning.mjs +10 -10
- package/resources/fine-tuning/index.d.ts +3 -12
- package/resources/fine-tuning/index.js +9 -29
- package/resources/fine-tuning/index.mjs +3 -3
- package/resources/fine-tuning/jobs.d.ts +173 -179
- package/resources/fine-tuning/jobs.js +50 -47
- package/resources/fine-tuning/jobs.mjs +45 -42
- package/resources/images.d.ts +116 -119
- package/resources/images.js +25 -24
- package/resources/images.mjs +21 -20
- package/resources/index.d.ts +12 -37
- package/resources/index.js +29 -113
- package/resources/index.mjs +12 -12
- package/resources/models.d.ts +41 -40
- package/resources/models.js +30 -28
- package/resources/models.mjs +26 -24
- package/resources/moderations.d.ts +153 -156
- package/resources/moderations.js +12 -11
- package/resources/moderations.mjs +9 -8
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +99 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +79 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +79 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +62 -0
- package/src/_shims/web-runtime.ts +91 -0
- package/src/_shims/web-types.d.ts +82 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +34 -17
- package/src/error.ts +1 -1
- package/src/index.ts +6 -6
- package/src/pagination.ts +1 -1
- package/src/resource.ts +1 -1
- package/src/resources/audio/audio.ts +4 -4
- package/src/resources/audio/index.ts +3 -3
- package/src/resources/audio/transcriptions.ts +4 -4
- package/src/resources/audio/translations.ts +4 -4
- package/src/resources/chat/chat.ts +3 -3
- package/src/resources/chat/completions.ts +6 -6
- package/src/resources/chat/index.ts +2 -2
- package/src/resources/completions.ts +5 -5
- package/src/resources/edits.ts +4 -4
- package/src/resources/embeddings.ts +3 -3
- package/src/resources/files.ts +7 -7
- package/src/resources/fine-tunes.ts +7 -7
- package/src/resources/fine-tuning/fine-tuning.ts +3 -3
- package/src/resources/fine-tuning/index.ts +2 -2
- package/src/resources/fine-tuning/jobs.ts +6 -6
- package/src/resources/images.ts +4 -4
- package/src/resources/index.ts +11 -11
- package/src/resources/models.ts +4 -4
- package/src/resources/moderations.ts +3 -3
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/streaming.ts +1 -1
- package/src/uploads.ts +12 -16
- package/src/version.ts +1 -1
- package/streaming.d.ts +9 -8
- package/streaming.d.ts.map +1 -1
- package/streaming.js +194 -185
- package/streaming.mjs +192 -183
- package/uploads.d.ts +23 -39
- package/uploads.d.ts.map +1 -1
- package/uploads.js +115 -157
- package/uploads.js.map +1 -1
- package/uploads.mjs +111 -133
- package/uploads.mjs.map +1 -1
- package/version.d.ts +2 -2
- package/version.js +4 -4
- package/version.mjs +2 -2
- package/_shims/ReadableStream-node.d.ts +0 -6
- package/_shims/ReadableStream-node.d.ts.map +0 -1
- package/_shims/ReadableStream-node.js +0 -14
- package/_shims/ReadableStream-node.js.map +0 -1
- package/_shims/ReadableStream-node.mjs +0 -3
- package/_shims/ReadableStream-node.mjs.map +0 -1
- package/_shims/ReadableStream.d.ts +0 -38
- package/_shims/ReadableStream.mjs +0 -7
- package/_shims/agent-node.d.ts +0 -7
- package/_shims/agent-node.d.ts.map +0 -1
- package/_shims/agent-node.js +0 -28
- package/_shims/agent-node.js.map +0 -1
- package/_shims/agent-node.mjs +0 -16
- package/_shims/agent-node.mjs.map +0 -1
- package/_shims/agent.d.ts +0 -9
- package/_shims/agent.d.ts.map +0 -1
- package/_shims/agent.js +0 -14
- package/_shims/agent.js.map +0 -1
- package/_shims/agent.mjs +0 -10
- package/_shims/agent.mjs.map +0 -1
- package/_shims/fetch-node.d.ts +0 -64
- package/_shims/fetch-node.js +0 -12
- package/_shims/fetch-node.mjs +0 -14
- package/_shims/fetch.d.ts +0 -60
- package/_shims/fetch.js +0 -13
- package/_shims/fetch.mjs +0 -15
- package/_shims/fileFromPath-node.d.ts +0 -17
- package/_shims/fileFromPath-node.d.ts.map +0 -1
- package/_shims/fileFromPath-node.js +0 -17
- package/_shims/fileFromPath-node.js.map +0 -1
- package/_shims/fileFromPath-node.mjs +0 -13
- package/_shims/fileFromPath-node.mjs.map +0 -1
- package/_shims/fileFromPath.d.ts +0 -22
- package/_shims/fileFromPath.d.ts.map +0 -1
- package/_shims/fileFromPath.js +0 -16
- package/_shims/fileFromPath.js.map +0 -1
- package/_shims/fileFromPath.mjs +0 -12
- package/_shims/fileFromPath.mjs.map +0 -1
- package/_shims/form-data-node.d.ts +0 -45
- package/_shims/form-data-node.js +0 -11
- package/_shims/form-data-node.mjs +0 -9
- package/_shims/form-data.d.ts +0 -43
- package/_shims/form-data.js +0 -17
- package/_shims/form-data.mjs +0 -20
- package/_shims/getMultipartRequestOptions-node.d.ts +0 -10
- package/_shims/getMultipartRequestOptions-node.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions-node.js +0 -22
- package/_shims/getMultipartRequestOptions-node.js.map +0 -1
- package/_shims/getMultipartRequestOptions-node.mjs +0 -18
- package/_shims/getMultipartRequestOptions-node.mjs.map +0 -1
- package/_shims/getMultipartRequestOptions.d.ts +0 -10
- package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions.js +0 -12
- package/_shims/getMultipartRequestOptions.js.map +0 -1
- package/_shims/getMultipartRequestOptions.mjs +0 -8
- package/_shims/getMultipartRequestOptions.mjs.map +0 -1
- package/_shims/node-readable-node.d.ts +0 -8
- package/_shims/node-readable-node.d.ts.map +0 -1
- package/_shims/node-readable-node.js +0 -9
- package/_shims/node-readable-node.js.map +0 -1
- package/_shims/node-readable-node.mjs +0 -5
- package/_shims/node-readable-node.mjs.map +0 -1
- package/_shims/node-readable.d.ts +0 -23
- package/_shims/node-readable.d.ts.map +0 -1
- package/_shims/node-readable.js +0 -11
- package/_shims/node-readable.js.map +0 -1
- package/_shims/node-readable.mjs +0 -7
- package/_shims/node-readable.mjs.map +0 -1
- package/src/_shims/ReadableStream.d.ts +0 -38
- package/src/_shims/ReadableStream.mjs +0 -7
- package/src/_shims/agent-node.ts +0 -22
- package/src/_shims/agent.ts +0 -12
- package/src/_shims/fetch-node.d.ts +0 -64
- package/src/_shims/fetch-node.js +0 -12
- package/src/_shims/fetch-node.mjs +0 -14
- package/src/_shims/fetch.d.ts +0 -60
- package/src/_shims/fetch.js +0 -13
- package/src/_shims/fetch.mjs +0 -15
- package/src/_shims/fileFromPath-node.ts +0 -29
- package/src/_shims/fileFromPath.ts +0 -29
- package/src/_shims/form-data-node.d.ts +0 -45
- package/src/_shims/form-data-node.js +0 -11
- package/src/_shims/form-data-node.mjs +0 -9
- package/src/_shims/form-data.d.ts +0 -43
- package/src/_shims/form-data.js +0 -17
- package/src/_shims/form-data.mjs +0 -20
- package/src/_shims/getMultipartRequestOptions-node.ts +0 -25
- package/src/_shims/getMultipartRequestOptions.ts +0 -14
- package/src/_shims/node-readable-node.ts +0 -10
- package/src/_shims/node-readable.ts +0 -30
package/index.js
CHANGED
|
@@ -1,142 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
var __createBinding =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return m[k];
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
Object.defineProperty(o, k2, desc);
|
|
18
|
-
}
|
|
19
|
-
: function (o, m, k, k2) {
|
|
20
|
-
if (k2 === undefined) k2 = k;
|
|
21
|
-
o[k2] = m[k];
|
|
22
|
-
});
|
|
23
|
-
var __setModuleDefault =
|
|
24
|
-
(this && this.__setModuleDefault) ||
|
|
25
|
-
(Object.create ?
|
|
26
|
-
function (o, v) {
|
|
27
|
-
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
8
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
35
20
|
if (mod && mod.__esModule) return mod;
|
|
36
21
|
var result = {};
|
|
37
|
-
if (mod != null)
|
|
38
|
-
for (var k in mod)
|
|
39
|
-
if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
40
23
|
__setModuleDefault(result, mod);
|
|
41
24
|
return result;
|
|
42
|
-
|
|
25
|
+
};
|
|
43
26
|
var _a;
|
|
44
|
-
Object.defineProperty(exports,
|
|
45
|
-
exports.fileFromPath =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
exports.BadRequestError =
|
|
52
|
-
exports.RateLimitError =
|
|
53
|
-
exports.ConflictError =
|
|
54
|
-
exports.NotFoundError =
|
|
55
|
-
exports.APIUserAbortError =
|
|
56
|
-
exports.APIConnectionTimeoutError =
|
|
57
|
-
exports.APIConnectionError =
|
|
58
|
-
exports.APIError =
|
|
59
|
-
exports.OpenAI =
|
|
60
|
-
void 0;
|
|
61
|
-
const Core = __importStar(require('./core.js'));
|
|
62
|
-
const Pagination = __importStar(require('./pagination.js'));
|
|
63
|
-
const API = __importStar(require('./resources/index.js'));
|
|
64
|
-
const Errors = __importStar(require('./error.js'));
|
|
65
|
-
const Uploads = __importStar(require('./uploads.js'));
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.fileFromPath = exports.toFile = exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.OpenAI = void 0;
|
|
29
|
+
const Core = __importStar(require("./core.js"));
|
|
30
|
+
const Pagination = __importStar(require("./pagination.js"));
|
|
31
|
+
const API = __importStar(require("./resources/index.js"));
|
|
32
|
+
const Errors = __importStar(require("./error.js"));
|
|
33
|
+
const Uploads = __importStar(require("./uploads.js"));
|
|
66
34
|
/** API Client for interfacing with the OpenAI API. */
|
|
67
35
|
class OpenAI extends Core.APIClient {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
36
|
+
/**
|
|
37
|
+
* API Client for interfacing with the OpenAI API.
|
|
38
|
+
*
|
|
39
|
+
* @param {string} [opts.apiKey=process.env['OPENAI_API_KEY']] - The API Key to send to the API.
|
|
40
|
+
* @param {string} [opts.baseURL] - Override the default base URL for the API.
|
|
41
|
+
* @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
42
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
43
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
44
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
45
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
46
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
47
|
+
* @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers.
|
|
48
|
+
* @param {string | null} [opts.organization]
|
|
49
|
+
*/
|
|
50
|
+
constructor(_b) {
|
|
51
|
+
var _c, _d, _e;
|
|
52
|
+
var { apiKey = Core.readEnv('OPENAI_API_KEY'), organization = (_c = Core.readEnv('OPENAI_ORG_ID')) !== null && _c !== void 0 ? _c : null, ...opts } = _b === void 0 ? {} : _b;
|
|
53
|
+
if (apiKey === undefined) {
|
|
54
|
+
throw new Error("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'my apiKey' }).");
|
|
55
|
+
}
|
|
56
|
+
const options = {
|
|
57
|
+
apiKey,
|
|
58
|
+
organization,
|
|
59
|
+
...opts,
|
|
60
|
+
baseURL: (_d = opts.baseURL) !== null && _d !== void 0 ? _d : `https://api.openai.com/v1`,
|
|
61
|
+
};
|
|
62
|
+
if (!options.dangerouslyAllowBrowser && Core.isRunningInBrowser()) {
|
|
63
|
+
throw new Error("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n");
|
|
64
|
+
}
|
|
65
|
+
super({
|
|
66
|
+
baseURL: options.baseURL,
|
|
67
|
+
timeout: (_e = options.timeout) !== null && _e !== void 0 ? _e : 600000 /* 10 minutes */,
|
|
68
|
+
httpAgent: options.httpAgent,
|
|
69
|
+
maxRetries: options.maxRetries,
|
|
70
|
+
fetch: options.fetch,
|
|
71
|
+
});
|
|
72
|
+
this.completions = new API.Completions(this);
|
|
73
|
+
this.chat = new API.Chat(this);
|
|
74
|
+
this.edits = new API.Edits(this);
|
|
75
|
+
this.embeddings = new API.Embeddings(this);
|
|
76
|
+
this.files = new API.Files(this);
|
|
77
|
+
this.images = new API.Images(this);
|
|
78
|
+
this.audio = new API.Audio(this);
|
|
79
|
+
this.moderations = new API.Moderations(this);
|
|
80
|
+
this.models = new API.Models(this);
|
|
81
|
+
this.fineTuning = new API.FineTuning(this);
|
|
82
|
+
this.fineTunes = new API.FineTunes(this);
|
|
83
|
+
this._options = options;
|
|
84
|
+
this.apiKey = apiKey;
|
|
85
|
+
this.organization = organization;
|
|
86
|
+
}
|
|
87
|
+
defaultQuery() {
|
|
88
|
+
return this._options.defaultQuery;
|
|
89
|
+
}
|
|
90
|
+
defaultHeaders(opts) {
|
|
91
|
+
return {
|
|
92
|
+
...super.defaultHeaders(opts),
|
|
93
|
+
'OpenAI-Organization': this.organization,
|
|
94
|
+
...this._options.defaultHeaders,
|
|
95
|
+
};
|
|
93
96
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
organization,
|
|
97
|
-
...opts,
|
|
98
|
-
baseURL: (_d = opts.baseURL) !== null && _d !== void 0 ? _d : `https://api.openai.com/v1`,
|
|
99
|
-
};
|
|
100
|
-
if (!options.dangerouslyAllowBrowser && Core.isRunningInBrowser()) {
|
|
101
|
-
throw new Error(
|
|
102
|
-
"It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n",
|
|
103
|
-
);
|
|
97
|
+
authHeaders(opts) {
|
|
98
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
104
99
|
}
|
|
105
|
-
super({
|
|
106
|
-
baseURL: options.baseURL,
|
|
107
|
-
timeout: (_e = options.timeout) !== null && _e !== void 0 ? _e : 600000 /* 10 minutes */,
|
|
108
|
-
httpAgent: options.httpAgent,
|
|
109
|
-
maxRetries: options.maxRetries,
|
|
110
|
-
fetch: options.fetch,
|
|
111
|
-
});
|
|
112
|
-
this.completions = new API.Completions(this);
|
|
113
|
-
this.chat = new API.Chat(this);
|
|
114
|
-
this.edits = new API.Edits(this);
|
|
115
|
-
this.embeddings = new API.Embeddings(this);
|
|
116
|
-
this.files = new API.Files(this);
|
|
117
|
-
this.images = new API.Images(this);
|
|
118
|
-
this.audio = new API.Audio(this);
|
|
119
|
-
this.moderations = new API.Moderations(this);
|
|
120
|
-
this.models = new API.Models(this);
|
|
121
|
-
this.fineTuning = new API.FineTuning(this);
|
|
122
|
-
this.fineTunes = new API.FineTunes(this);
|
|
123
|
-
this._options = options;
|
|
124
|
-
this.apiKey = apiKey;
|
|
125
|
-
this.organization = organization;
|
|
126
|
-
}
|
|
127
|
-
defaultQuery() {
|
|
128
|
-
return this._options.defaultQuery;
|
|
129
|
-
}
|
|
130
|
-
defaultHeaders(opts) {
|
|
131
|
-
return {
|
|
132
|
-
...super.defaultHeaders(opts),
|
|
133
|
-
'OpenAI-Organization': this.organization,
|
|
134
|
-
...this._options.defaultHeaders,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
authHeaders(opts) {
|
|
138
|
-
return { Authorization: `Bearer ${this.apiKey}` };
|
|
139
|
-
}
|
|
140
100
|
}
|
|
141
101
|
exports.OpenAI = OpenAI;
|
|
142
102
|
_a = OpenAI;
|
|
@@ -153,41 +113,30 @@ OpenAI.AuthenticationError = Errors.AuthenticationError;
|
|
|
153
113
|
OpenAI.InternalServerError = Errors.InternalServerError;
|
|
154
114
|
OpenAI.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
155
115
|
OpenAI.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
156
|
-
|
|
157
|
-
(exports.APIConnectionError = Errors.APIConnectionError),
|
|
158
|
-
(exports.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError),
|
|
159
|
-
(exports.APIUserAbortError = Errors.APIUserAbortError),
|
|
160
|
-
(exports.NotFoundError = Errors.NotFoundError),
|
|
161
|
-
(exports.ConflictError = Errors.ConflictError),
|
|
162
|
-
(exports.RateLimitError = Errors.RateLimitError),
|
|
163
|
-
(exports.BadRequestError = Errors.BadRequestError),
|
|
164
|
-
(exports.AuthenticationError = Errors.AuthenticationError),
|
|
165
|
-
(exports.InternalServerError = Errors.InternalServerError),
|
|
166
|
-
(exports.PermissionDeniedError = Errors.PermissionDeniedError),
|
|
167
|
-
(exports.UnprocessableEntityError = Errors.UnprocessableEntityError);
|
|
116
|
+
exports.APIError = Errors.APIError, exports.APIConnectionError = Errors.APIConnectionError, exports.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError, exports.APIUserAbortError = Errors.APIUserAbortError, exports.NotFoundError = Errors.NotFoundError, exports.ConflictError = Errors.ConflictError, exports.RateLimitError = Errors.RateLimitError, exports.BadRequestError = Errors.BadRequestError, exports.AuthenticationError = Errors.AuthenticationError, exports.InternalServerError = Errors.InternalServerError, exports.PermissionDeniedError = Errors.PermissionDeniedError, exports.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
168
117
|
exports.toFile = Uploads.toFile;
|
|
169
118
|
exports.fileFromPath = Uploads.fileFromPath;
|
|
170
119
|
(function (OpenAI) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
})(
|
|
120
|
+
// Helper functions
|
|
121
|
+
OpenAI.toFile = Uploads.toFile;
|
|
122
|
+
OpenAI.fileFromPath = Uploads.fileFromPath;
|
|
123
|
+
OpenAI.Page = Pagination.Page;
|
|
124
|
+
OpenAI.CursorPage = Pagination.CursorPage;
|
|
125
|
+
OpenAI.Completions = API.Completions;
|
|
126
|
+
OpenAI.Chat = API.Chat;
|
|
127
|
+
OpenAI.Edits = API.Edits;
|
|
128
|
+
OpenAI.Embeddings = API.Embeddings;
|
|
129
|
+
OpenAI.Files = API.Files;
|
|
130
|
+
OpenAI.FileObjectsPage = API.FileObjectsPage;
|
|
131
|
+
OpenAI.Images = API.Images;
|
|
132
|
+
OpenAI.Audio = API.Audio;
|
|
133
|
+
OpenAI.Moderations = API.Moderations;
|
|
134
|
+
OpenAI.Models = API.Models;
|
|
135
|
+
OpenAI.ModelsPage = API.ModelsPage;
|
|
136
|
+
OpenAI.FineTuning = API.FineTuning;
|
|
137
|
+
OpenAI.FineTunes = API.FineTunes;
|
|
138
|
+
OpenAI.FineTunesPage = API.FineTunesPage;
|
|
139
|
+
})(OpenAI = exports.OpenAI || (exports.OpenAI = {}));
|
|
191
140
|
exports = module.exports = OpenAI;
|
|
192
141
|
exports.default = OpenAI;
|
|
193
|
-
//# sourceMappingURL=index.js.map
|
|
142
|
+
//# sourceMappingURL=index.js.map
|
package/index.mjs
CHANGED
|
@@ -1,84 +1,76 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
var _a;
|
|
3
|
-
import * as Core from
|
|
4
|
-
import * as Pagination from
|
|
5
|
-
import * as API from
|
|
6
|
-
import * as Errors from
|
|
7
|
-
import * as Uploads from
|
|
3
|
+
import * as Core from "./core.mjs";
|
|
4
|
+
import * as Pagination from "./pagination.mjs";
|
|
5
|
+
import * as API from "./resources/index.mjs";
|
|
6
|
+
import * as Errors from "./error.mjs";
|
|
7
|
+
import * as Uploads from "./uploads.mjs";
|
|
8
8
|
/** API Client for interfacing with the OpenAI API. */
|
|
9
9
|
export class OpenAI extends Core.APIClient {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
/**
|
|
11
|
+
* API Client for interfacing with the OpenAI API.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} [opts.apiKey=process.env['OPENAI_API_KEY']] - The API Key to send to the API.
|
|
14
|
+
* @param {string} [opts.baseURL] - Override the default base URL for the API.
|
|
15
|
+
* @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
16
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
17
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
18
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
19
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
20
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
21
|
+
* @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers.
|
|
22
|
+
* @param {string | null} [opts.organization]
|
|
23
|
+
*/
|
|
24
|
+
constructor(_b) {
|
|
25
|
+
var _c, _d, _e;
|
|
26
|
+
var { apiKey = Core.readEnv('OPENAI_API_KEY'), organization = (_c = Core.readEnv('OPENAI_ORG_ID')) !== null && _c !== void 0 ? _c : null, ...opts } = _b === void 0 ? {} : _b;
|
|
27
|
+
if (apiKey === undefined) {
|
|
28
|
+
throw new Error("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'my apiKey' }).");
|
|
29
|
+
}
|
|
30
|
+
const options = {
|
|
31
|
+
apiKey,
|
|
32
|
+
organization,
|
|
33
|
+
...opts,
|
|
34
|
+
baseURL: (_d = opts.baseURL) !== null && _d !== void 0 ? _d : `https://api.openai.com/v1`,
|
|
35
|
+
};
|
|
36
|
+
if (!options.dangerouslyAllowBrowser && Core.isRunningInBrowser()) {
|
|
37
|
+
throw new Error("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew OpenAI({ apiKey, dangerouslyAllowBrowser: true });\n\nhttps://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety\n");
|
|
38
|
+
}
|
|
39
|
+
super({
|
|
40
|
+
baseURL: options.baseURL,
|
|
41
|
+
timeout: (_e = options.timeout) !== null && _e !== void 0 ? _e : 600000 /* 10 minutes */,
|
|
42
|
+
httpAgent: options.httpAgent,
|
|
43
|
+
maxRetries: options.maxRetries,
|
|
44
|
+
fetch: options.fetch,
|
|
45
|
+
});
|
|
46
|
+
this.completions = new API.Completions(this);
|
|
47
|
+
this.chat = new API.Chat(this);
|
|
48
|
+
this.edits = new API.Edits(this);
|
|
49
|
+
this.embeddings = new API.Embeddings(this);
|
|
50
|
+
this.files = new API.Files(this);
|
|
51
|
+
this.images = new API.Images(this);
|
|
52
|
+
this.audio = new API.Audio(this);
|
|
53
|
+
this.moderations = new API.Moderations(this);
|
|
54
|
+
this.models = new API.Models(this);
|
|
55
|
+
this.fineTuning = new API.FineTuning(this);
|
|
56
|
+
this.fineTunes = new API.FineTunes(this);
|
|
57
|
+
this._options = options;
|
|
58
|
+
this.apiKey = apiKey;
|
|
59
|
+
this.organization = organization;
|
|
35
60
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
61
|
+
defaultQuery() {
|
|
62
|
+
return this._options.defaultQuery;
|
|
63
|
+
}
|
|
64
|
+
defaultHeaders(opts) {
|
|
65
|
+
return {
|
|
66
|
+
...super.defaultHeaders(opts),
|
|
67
|
+
'OpenAI-Organization': this.organization,
|
|
68
|
+
...this._options.defaultHeaders,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
authHeaders(opts) {
|
|
72
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
46
73
|
}
|
|
47
|
-
super({
|
|
48
|
-
baseURL: options.baseURL,
|
|
49
|
-
timeout: (_e = options.timeout) !== null && _e !== void 0 ? _e : 600000 /* 10 minutes */,
|
|
50
|
-
httpAgent: options.httpAgent,
|
|
51
|
-
maxRetries: options.maxRetries,
|
|
52
|
-
fetch: options.fetch,
|
|
53
|
-
});
|
|
54
|
-
this.completions = new API.Completions(this);
|
|
55
|
-
this.chat = new API.Chat(this);
|
|
56
|
-
this.edits = new API.Edits(this);
|
|
57
|
-
this.embeddings = new API.Embeddings(this);
|
|
58
|
-
this.files = new API.Files(this);
|
|
59
|
-
this.images = new API.Images(this);
|
|
60
|
-
this.audio = new API.Audio(this);
|
|
61
|
-
this.moderations = new API.Moderations(this);
|
|
62
|
-
this.models = new API.Models(this);
|
|
63
|
-
this.fineTuning = new API.FineTuning(this);
|
|
64
|
-
this.fineTunes = new API.FineTunes(this);
|
|
65
|
-
this._options = options;
|
|
66
|
-
this.apiKey = apiKey;
|
|
67
|
-
this.organization = organization;
|
|
68
|
-
}
|
|
69
|
-
defaultQuery() {
|
|
70
|
-
return this._options.defaultQuery;
|
|
71
|
-
}
|
|
72
|
-
defaultHeaders(opts) {
|
|
73
|
-
return {
|
|
74
|
-
...super.defaultHeaders(opts),
|
|
75
|
-
'OpenAI-Organization': this.organization,
|
|
76
|
-
...this._options.defaultHeaders,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
authHeaders(opts) {
|
|
80
|
-
return { Authorization: `Bearer ${this.apiKey}` };
|
|
81
|
-
}
|
|
82
74
|
}
|
|
83
75
|
_a = OpenAI;
|
|
84
76
|
OpenAI.OpenAI = _a;
|
|
@@ -94,42 +86,29 @@ OpenAI.AuthenticationError = Errors.AuthenticationError;
|
|
|
94
86
|
OpenAI.InternalServerError = Errors.InternalServerError;
|
|
95
87
|
OpenAI.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
96
88
|
OpenAI.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
97
|
-
export const {
|
|
98
|
-
APIError,
|
|
99
|
-
APIConnectionError,
|
|
100
|
-
APIConnectionTimeoutError,
|
|
101
|
-
APIUserAbortError,
|
|
102
|
-
NotFoundError,
|
|
103
|
-
ConflictError,
|
|
104
|
-
RateLimitError,
|
|
105
|
-
BadRequestError,
|
|
106
|
-
AuthenticationError,
|
|
107
|
-
InternalServerError,
|
|
108
|
-
PermissionDeniedError,
|
|
109
|
-
UnprocessableEntityError,
|
|
110
|
-
} = Errors;
|
|
89
|
+
export const { APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } = Errors;
|
|
111
90
|
export var toFile = Uploads.toFile;
|
|
112
91
|
export var fileFromPath = Uploads.fileFromPath;
|
|
113
92
|
(function (OpenAI) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
93
|
+
// Helper functions
|
|
94
|
+
OpenAI.toFile = Uploads.toFile;
|
|
95
|
+
OpenAI.fileFromPath = Uploads.fileFromPath;
|
|
96
|
+
OpenAI.Page = Pagination.Page;
|
|
97
|
+
OpenAI.CursorPage = Pagination.CursorPage;
|
|
98
|
+
OpenAI.Completions = API.Completions;
|
|
99
|
+
OpenAI.Chat = API.Chat;
|
|
100
|
+
OpenAI.Edits = API.Edits;
|
|
101
|
+
OpenAI.Embeddings = API.Embeddings;
|
|
102
|
+
OpenAI.Files = API.Files;
|
|
103
|
+
OpenAI.FileObjectsPage = API.FileObjectsPage;
|
|
104
|
+
OpenAI.Images = API.Images;
|
|
105
|
+
OpenAI.Audio = API.Audio;
|
|
106
|
+
OpenAI.Moderations = API.Moderations;
|
|
107
|
+
OpenAI.Models = API.Models;
|
|
108
|
+
OpenAI.ModelsPage = API.ModelsPage;
|
|
109
|
+
OpenAI.FineTuning = API.FineTuning;
|
|
110
|
+
OpenAI.FineTunes = API.FineTunes;
|
|
111
|
+
OpenAI.FineTunesPage = API.FineTunesPage;
|
|
133
112
|
})(OpenAI || (OpenAI = {}));
|
|
134
113
|
export default OpenAI;
|
|
135
|
-
//# sourceMappingURL=index.mjs.map
|
|
114
|
+
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openai",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0",
|
|
4
4
|
"description": "Client library for the OpenAI API",
|
|
5
5
|
"author": "OpenAI <support@openai.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -9,76 +9,49 @@
|
|
|
9
9
|
"repository": "github:openai/openai-node",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"private": false,
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"./_shims/index.js",
|
|
14
|
+
"./_shims/index.mjs",
|
|
15
|
+
"./shims/node.js",
|
|
16
|
+
"./shims/node.mjs",
|
|
17
|
+
"./shims/web.js",
|
|
18
|
+
"./shims/web.mjs"
|
|
19
|
+
],
|
|
12
20
|
"exports": {
|
|
13
|
-
"./_shims/
|
|
21
|
+
"./_shims/auto/*": {
|
|
14
22
|
"deno": {
|
|
15
|
-
"types": "./_shims/
|
|
16
|
-
"require": "./_shims/
|
|
17
|
-
"default": "./_shims/
|
|
23
|
+
"types": "./_shims/auto/*.d.ts",
|
|
24
|
+
"require": "./_shims/auto/*.js",
|
|
25
|
+
"default": "./_shims/auto/*.mjs"
|
|
18
26
|
},
|
|
19
27
|
"bun": {
|
|
20
|
-
"types": "./_shims/
|
|
21
|
-
"require": "./_shims/
|
|
22
|
-
"default": "./_shims/
|
|
28
|
+
"types": "./_shims/auto/*.d.ts",
|
|
29
|
+
"require": "./_shims/auto/*-bun.js",
|
|
30
|
+
"default": "./_shims/auto/*-bun.mjs"
|
|
23
31
|
},
|
|
24
32
|
"browser": {
|
|
25
|
-
"types": "./_shims/
|
|
26
|
-
"require": "./_shims/
|
|
27
|
-
"default": "./_shims/
|
|
33
|
+
"types": "./_shims/auto/*.d.ts",
|
|
34
|
+
"require": "./_shims/auto/*.js",
|
|
35
|
+
"default": "./_shims/auto/*.mjs"
|
|
28
36
|
},
|
|
29
37
|
"worker": {
|
|
30
|
-
"types": "./_shims/
|
|
31
|
-
"require": "./_shims/
|
|
32
|
-
"default": "./_shims/
|
|
38
|
+
"types": "./_shims/auto/*.d.ts",
|
|
39
|
+
"require": "./_shims/auto/*.js",
|
|
40
|
+
"default": "./_shims/auto/*.mjs"
|
|
33
41
|
},
|
|
34
42
|
"workerd": {
|
|
35
|
-
"types": "./_shims/
|
|
36
|
-
"require": "./_shims/
|
|
37
|
-
"default": "./_shims/
|
|
43
|
+
"types": "./_shims/auto/*.d.ts",
|
|
44
|
+
"require": "./_shims/auto/*.js",
|
|
45
|
+
"default": "./_shims/auto/*.mjs"
|
|
38
46
|
},
|
|
39
47
|
"node": {
|
|
40
|
-
"types": "./_shims/node
|
|
41
|
-
"require": "./_shims/node
|
|
42
|
-
"default": "./_shims/node
|
|
48
|
+
"types": "./_shims/auto/*-node.d.ts",
|
|
49
|
+
"require": "./_shims/auto/*-node.js",
|
|
50
|
+
"default": "./_shims/auto/*-node.mjs"
|
|
43
51
|
},
|
|
44
|
-
"types": "./_shims/
|
|
45
|
-
"require": "./_shims/
|
|
46
|
-
"default": "./_shims/
|
|
47
|
-
},
|
|
48
|
-
"./_shims/*": {
|
|
49
|
-
"deno": {
|
|
50
|
-
"types": "./_shims/*.d.ts",
|
|
51
|
-
"require": "./_shims/*.js",
|
|
52
|
-
"default": "./_shims/*.mjs"
|
|
53
|
-
},
|
|
54
|
-
"bun": {
|
|
55
|
-
"types": "./_shims/*.d.ts",
|
|
56
|
-
"require": "./_shims/*.js",
|
|
57
|
-
"default": "./_shims/*.mjs"
|
|
58
|
-
},
|
|
59
|
-
"browser": {
|
|
60
|
-
"types": "./_shims/*.d.ts",
|
|
61
|
-
"require": "./_shims/*.js",
|
|
62
|
-
"default": "./_shims/*.mjs"
|
|
63
|
-
},
|
|
64
|
-
"worker": {
|
|
65
|
-
"types": "./_shims/*.d.ts",
|
|
66
|
-
"require": "./_shims/*.js",
|
|
67
|
-
"default": "./_shims/*.mjs"
|
|
68
|
-
},
|
|
69
|
-
"workerd": {
|
|
70
|
-
"types": "./_shims/*.d.ts",
|
|
71
|
-
"require": "./_shims/*.js",
|
|
72
|
-
"default": "./_shims/*.mjs"
|
|
73
|
-
},
|
|
74
|
-
"node": {
|
|
75
|
-
"types": "./_shims/*-node.d.ts",
|
|
76
|
-
"require": "./_shims/*-node.js",
|
|
77
|
-
"default": "./_shims/*-node.mjs"
|
|
78
|
-
},
|
|
79
|
-
"types": "./_shims/*.d.ts",
|
|
80
|
-
"require": "./_shims/*.js",
|
|
81
|
-
"default": "./_shims/*.mjs"
|
|
52
|
+
"types": "./_shims/auto/*.d.ts",
|
|
53
|
+
"require": "./_shims/auto/*.js",
|
|
54
|
+
"default": "./_shims/auto/*.mjs"
|
|
82
55
|
},
|
|
83
56
|
".": {
|
|
84
57
|
"require": {
|