openai-mcp-test 0.0.1
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/LICENSE +201 -0
- package/README.md +487 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/bin/cli +46 -0
- package/bin/migration-config.json +1043 -0
- package/client.d.mts +293 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +293 -0
- package/client.d.ts.map +1 -0
- package/client.js +557 -0
- package/client.js.map +1 -0
- package/client.mjs +553 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +50 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +50 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +118 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +102 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +89 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +89 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +156 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +148 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/streaming.d.mts +33 -0
- package/core/streaming.d.mts.map +1 -0
- package/core/streaming.d.ts +33 -0
- package/core/streaming.d.ts.map +1 -0
- package/core/streaming.js +277 -0
- package/core/streaming.js.map +1 -0
- package/core/streaming.mjs +272 -0
- package/core/streaming.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +7 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -0
- package/index.js +32 -0
- package/index.js.map +1 -0
- package/index.mjs +8 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/decoders/line.d.mts +17 -0
- package/internal/decoders/line.d.mts.map +1 -0
- package/internal/decoders/line.d.ts +17 -0
- package/internal/decoders/line.d.ts.map +1 -0
- package/internal/decoders/line.js +113 -0
- package/internal/decoders/line.js.map +1 -0
- package/internal/decoders/line.mjs +108 -0
- package/internal/decoders/line.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +50 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +47 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts +77 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +77 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +161 -0
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/audio/audio.d.mts +28 -0
- package/resources/audio/audio.d.mts.map +1 -0
- package/resources/audio/audio.d.ts +28 -0
- package/resources/audio/audio.d.ts.map +1 -0
- package/resources/audio/audio.js +25 -0
- package/resources/audio/audio.js.map +1 -0
- package/resources/audio/audio.mjs +20 -0
- package/resources/audio/audio.mjs.map +1 -0
- package/resources/audio/index.d.mts +5 -0
- package/resources/audio/index.d.mts.map +1 -0
- package/resources/audio/index.d.ts +5 -0
- package/resources/audio/index.d.ts.map +1 -0
- package/resources/audio/index.js +13 -0
- package/resources/audio/index.js.map +1 -0
- package/resources/audio/index.mjs +6 -0
- package/resources/audio/index.mjs.map +1 -0
- package/resources/audio/speech.d.mts +67 -0
- package/resources/audio/speech.d.mts.map +1 -0
- package/resources/audio/speech.d.ts +67 -0
- package/resources/audio/speech.d.ts.map +1 -0
- package/resources/audio/speech.js +35 -0
- package/resources/audio/speech.js.map +1 -0
- package/resources/audio/speech.mjs +31 -0
- package/resources/audio/speech.mjs.map +1 -0
- package/resources/audio/transcriptions.d.mts +656 -0
- package/resources/audio/transcriptions.d.mts.map +1 -0
- package/resources/audio/transcriptions.d.ts +656 -0
- package/resources/audio/transcriptions.d.ts.map +1 -0
- package/resources/audio/transcriptions.js +13 -0
- package/resources/audio/transcriptions.js.map +1 -0
- package/resources/audio/transcriptions.mjs +9 -0
- package/resources/audio/transcriptions.mjs.map +1 -0
- package/resources/audio/translations.d.mts +78 -0
- package/resources/audio/translations.d.mts.map +1 -0
- package/resources/audio/translations.d.ts +78 -0
- package/resources/audio/translations.d.ts.map +1 -0
- package/resources/audio/translations.js +24 -0
- package/resources/audio/translations.js.map +1 -0
- package/resources/audio/translations.mjs +20 -0
- package/resources/audio/translations.mjs.map +1 -0
- package/resources/audio.d.mts +2 -0
- package/resources/audio.d.mts.map +1 -0
- package/resources/audio.d.ts +2 -0
- package/resources/audio.d.ts.map +1 -0
- package/resources/audio.js +6 -0
- package/resources/audio.js.map +1 -0
- package/resources/audio.mjs +3 -0
- package/resources/audio.mjs.map +1 -0
- package/resources/batches.d.mts +280 -0
- package/resources/batches.d.mts.map +1 -0
- package/resources/batches.d.ts +280 -0
- package/resources/batches.d.ts.map +1 -0
- package/resources/batches.js +37 -0
- package/resources/batches.js.map +1 -0
- package/resources/batches.mjs +33 -0
- package/resources/batches.mjs.map +1 -0
- package/resources/beta/assistants.d.mts +1221 -0
- package/resources/beta/assistants.d.mts.map +1 -0
- package/resources/beta/assistants.d.ts +1221 -0
- package/resources/beta/assistants.d.ts.map +1 -0
- package/resources/beta/assistants.js +70 -0
- package/resources/beta/assistants.js.map +1 -0
- package/resources/beta/assistants.mjs +66 -0
- package/resources/beta/assistants.mjs.map +1 -0
- package/resources/beta/beta.d.mts +18 -0
- package/resources/beta/beta.d.mts.map +1 -0
- package/resources/beta/beta.d.ts +18 -0
- package/resources/beta/beta.d.ts.map +1 -0
- package/resources/beta/beta.js +25 -0
- package/resources/beta/beta.js.map +1 -0
- package/resources/beta/beta.mjs +20 -0
- package/resources/beta/beta.mjs.map +1 -0
- package/resources/beta/chatkit/chatkit.d.mts +51 -0
- package/resources/beta/chatkit/chatkit.d.mts.map +1 -0
- package/resources/beta/chatkit/chatkit.d.ts +51 -0
- package/resources/beta/chatkit/chatkit.d.ts.map +1 -0
- package/resources/beta/chatkit/chatkit.js +21 -0
- package/resources/beta/chatkit/chatkit.js.map +1 -0
- package/resources/beta/chatkit/chatkit.mjs +16 -0
- package/resources/beta/chatkit/chatkit.mjs.map +1 -0
- package/resources/beta/chatkit/index.d.mts +4 -0
- package/resources/beta/chatkit/index.d.mts.map +1 -0
- package/resources/beta/chatkit/index.d.ts +4 -0
- package/resources/beta/chatkit/index.d.ts.map +1 -0
- package/resources/beta/chatkit/index.js +11 -0
- package/resources/beta/chatkit/index.js.map +1 -0
- package/resources/beta/chatkit/index.mjs +5 -0
- package/resources/beta/chatkit/index.mjs.map +1 -0
- package/resources/beta/chatkit/sessions.d.mts +59 -0
- package/resources/beta/chatkit/sessions.d.mts.map +1 -0
- package/resources/beta/chatkit/sessions.d.ts +59 -0
- package/resources/beta/chatkit/sessions.d.ts.map +1 -0
- package/resources/beta/chatkit/sessions.js +47 -0
- package/resources/beta/chatkit/sessions.js.map +1 -0
- package/resources/beta/chatkit/sessions.mjs +43 -0
- package/resources/beta/chatkit/sessions.mjs.map +1 -0
- package/resources/beta/chatkit/threads.d.mts +811 -0
- package/resources/beta/chatkit/threads.d.mts.map +1 -0
- package/resources/beta/chatkit/threads.d.ts +811 -0
- package/resources/beta/chatkit/threads.d.ts.map +1 -0
- package/resources/beta/chatkit/threads.js +77 -0
- package/resources/beta/chatkit/threads.js.map +1 -0
- package/resources/beta/chatkit/threads.mjs +73 -0
- package/resources/beta/chatkit/threads.mjs.map +1 -0
- package/resources/beta/chatkit.d.mts +2 -0
- package/resources/beta/chatkit.d.mts.map +1 -0
- package/resources/beta/chatkit.d.ts +2 -0
- package/resources/beta/chatkit.d.ts.map +1 -0
- package/resources/beta/chatkit.js +6 -0
- package/resources/beta/chatkit.js.map +1 -0
- package/resources/beta/chatkit.mjs +3 -0
- package/resources/beta/chatkit.mjs.map +1 -0
- package/resources/beta/index.d.mts +5 -0
- package/resources/beta/index.d.mts.map +1 -0
- package/resources/beta/index.d.ts +5 -0
- package/resources/beta/index.d.ts.map +1 -0
- package/resources/beta/index.js +13 -0
- package/resources/beta/index.js.map +1 -0
- package/resources/beta/index.mjs +6 -0
- package/resources/beta/index.mjs.map +1 -0
- package/resources/beta/threads/index.d.mts +4 -0
- package/resources/beta/threads/index.d.mts.map +1 -0
- package/resources/beta/threads/index.d.ts +4 -0
- package/resources/beta/threads/index.d.ts.map +1 -0
- package/resources/beta/threads/index.js +11 -0
- package/resources/beta/threads/index.js.map +1 -0
- package/resources/beta/threads/index.mjs +5 -0
- package/resources/beta/threads/index.mjs.map +1 -0
- package/resources/beta/threads/messages.d.mts +594 -0
- package/resources/beta/threads/messages.d.mts.map +1 -0
- package/resources/beta/threads/messages.d.ts +594 -0
- package/resources/beta/threads/messages.d.ts.map +1 -0
- package/resources/beta/threads/messages.js +76 -0
- package/resources/beta/threads/messages.js.map +1 -0
- package/resources/beta/threads/messages.mjs +72 -0
- package/resources/beta/threads/messages.mjs.map +1 -0
- package/resources/beta/threads/runs/index.d.mts +3 -0
- package/resources/beta/threads/runs/index.d.mts.map +1 -0
- package/resources/beta/threads/runs/index.d.ts +3 -0
- package/resources/beta/threads/runs/index.d.ts.map +1 -0
- package/resources/beta/threads/runs/index.js +9 -0
- package/resources/beta/threads/runs/index.js.map +1 -0
- package/resources/beta/threads/runs/index.mjs +4 -0
- package/resources/beta/threads/runs/index.mjs.map +1 -0
- package/resources/beta/threads/runs/runs.d.mts +694 -0
- package/resources/beta/threads/runs/runs.d.mts.map +1 -0
- package/resources/beta/threads/runs/runs.d.ts +694 -0
- package/resources/beta/threads/runs/runs.d.ts.map +1 -0
- package/resources/beta/threads/runs/runs.js +91 -0
- package/resources/beta/threads/runs/runs.js.map +1 -0
- package/resources/beta/threads/runs/runs.mjs +86 -0
- package/resources/beta/threads/runs/runs.mjs.map +1 -0
- package/resources/beta/threads/runs/steps.d.mts +615 -0
- package/resources/beta/threads/runs/steps.d.mts.map +1 -0
- package/resources/beta/threads/runs/steps.d.ts +615 -0
- package/resources/beta/threads/runs/steps.d.ts.map +1 -0
- package/resources/beta/threads/runs/steps.js +41 -0
- package/resources/beta/threads/runs/steps.js.map +1 -0
- package/resources/beta/threads/runs/steps.mjs +37 -0
- package/resources/beta/threads/runs/steps.mjs.map +1 -0
- package/resources/beta/threads/runs.d.mts +2 -0
- package/resources/beta/threads/runs.d.mts.map +1 -0
- package/resources/beta/threads/runs.d.ts +2 -0
- package/resources/beta/threads/runs.d.ts.map +1 -0
- package/resources/beta/threads/runs.js +6 -0
- package/resources/beta/threads/runs.js.map +1 -0
- package/resources/beta/threads/runs.mjs +3 -0
- package/resources/beta/threads/runs.mjs.map +1 -0
- package/resources/beta/threads/threads.d.mts +757 -0
- package/resources/beta/threads/threads.d.mts.map +1 -0
- package/resources/beta/threads/threads.d.ts +757 -0
- package/resources/beta/threads/threads.d.ts.map +1 -0
- package/resources/beta/threads/threads.js +80 -0
- package/resources/beta/threads/threads.js.map +1 -0
- package/resources/beta/threads/threads.mjs +75 -0
- package/resources/beta/threads/threads.mjs.map +1 -0
- package/resources/beta/threads.d.mts +2 -0
- package/resources/beta/threads.d.mts.map +1 -0
- package/resources/beta/threads.d.ts +2 -0
- package/resources/beta/threads.d.ts.map +1 -0
- package/resources/beta/threads.js +6 -0
- package/resources/beta/threads.js.map +1 -0
- package/resources/beta/threads.mjs +3 -0
- package/resources/beta/threads.mjs.map +1 -0
- package/resources/beta.d.mts +2 -0
- package/resources/beta.d.mts.map +1 -0
- package/resources/beta.d.ts +2 -0
- package/resources/beta.d.ts.map +1 -0
- package/resources/beta.js +6 -0
- package/resources/beta.js.map +1 -0
- package/resources/beta.mjs +3 -0
- package/resources/beta.mjs.map +1 -0
- package/resources/chat/chat.d.mts +13 -0
- package/resources/chat/chat.d.mts.map +1 -0
- package/resources/chat/chat.d.ts +13 -0
- package/resources/chat/chat.d.ts.map +1 -0
- package/resources/chat/chat.js +17 -0
- package/resources/chat/chat.js.map +1 -0
- package/resources/chat/chat.mjs +12 -0
- package/resources/chat/chat.mjs.map +1 -0
- package/resources/chat/completions/completions.d.mts +1598 -0
- package/resources/chat/completions/completions.d.mts.map +1 -0
- package/resources/chat/completions/completions.d.ts +1598 -0
- package/resources/chat/completions/completions.d.ts.map +1 -0
- package/resources/chat/completions/completions.js +79 -0
- package/resources/chat/completions/completions.js.map +1 -0
- package/resources/chat/completions/completions.mjs +74 -0
- package/resources/chat/completions/completions.mjs.map +1 -0
- package/resources/chat/completions/index.d.mts +3 -0
- package/resources/chat/completions/index.d.mts.map +1 -0
- package/resources/chat/completions/index.d.ts +3 -0
- package/resources/chat/completions/index.d.ts.map +1 -0
- package/resources/chat/completions/index.js +9 -0
- package/resources/chat/completions/index.js.map +1 -0
- package/resources/chat/completions/index.mjs +4 -0
- package/resources/chat/completions/index.mjs.map +1 -0
- package/resources/chat/completions/messages.d.mts +34 -0
- package/resources/chat/completions/messages.d.mts.map +1 -0
- package/resources/chat/completions/messages.d.ts +34 -0
- package/resources/chat/completions/messages.d.ts.map +1 -0
- package/resources/chat/completions/messages.js +28 -0
- package/resources/chat/completions/messages.js.map +1 -0
- package/resources/chat/completions/messages.mjs +24 -0
- package/resources/chat/completions/messages.mjs.map +1 -0
- package/resources/chat/completions.d.mts +2 -0
- package/resources/chat/completions.d.mts.map +1 -0
- package/resources/chat/completions.d.ts +2 -0
- package/resources/chat/completions.d.ts.map +1 -0
- package/resources/chat/completions.js +6 -0
- package/resources/chat/completions.js.map +1 -0
- package/resources/chat/completions.mjs +3 -0
- package/resources/chat/completions.mjs.map +1 -0
- package/resources/chat/index.d.mts +3 -0
- package/resources/chat/index.d.mts.map +1 -0
- package/resources/chat/index.d.ts +3 -0
- package/resources/chat/index.d.ts.map +1 -0
- package/resources/chat/index.js +9 -0
- package/resources/chat/index.js.map +1 -0
- package/resources/chat/index.mjs +4 -0
- package/resources/chat/index.mjs.map +1 -0
- package/resources/chat.d.mts +2 -0
- package/resources/chat.d.mts.map +1 -0
- package/resources/chat.d.ts +2 -0
- package/resources/chat.d.ts.map +1 -0
- package/resources/chat.js +6 -0
- package/resources/chat.js.map +1 -0
- package/resources/chat.mjs +3 -0
- package/resources/chat.mjs.map +1 -0
- package/resources/completions.d.mts +332 -0
- package/resources/completions.d.mts.map +1 -0
- package/resources/completions.d.ts +332 -0
- package/resources/completions.d.ts.map +1 -0
- package/resources/completions.js +12 -0
- package/resources/completions.js.map +1 -0
- package/resources/completions.mjs +8 -0
- package/resources/completions.mjs.map +1 -0
- package/resources/containers/containers.d.mts +292 -0
- package/resources/containers/containers.d.mts.map +1 -0
- package/resources/containers/containers.d.ts +292 -0
- package/resources/containers/containers.d.ts.map +1 -0
- package/resources/containers/containers.js +47 -0
- package/resources/containers/containers.js.map +1 -0
- package/resources/containers/containers.mjs +42 -0
- package/resources/containers/containers.mjs.map +1 -0
- package/resources/containers/files/content.d.mts +16 -0
- package/resources/containers/files/content.d.mts.map +1 -0
- package/resources/containers/files/content.d.ts +16 -0
- package/resources/containers/files/content.d.ts.map +1 -0
- package/resources/containers/files/content.js +22 -0
- package/resources/containers/files/content.js.map +1 -0
- package/resources/containers/files/content.mjs +18 -0
- package/resources/containers/files/content.mjs.map +1 -0
- package/resources/containers/files/files.d.mts +148 -0
- package/resources/containers/files/files.d.mts.map +1 -0
- package/resources/containers/files/files.d.ts +148 -0
- package/resources/containers/files/files.d.ts.map +1 -0
- package/resources/containers/files/files.js +56 -0
- package/resources/containers/files/files.js.map +1 -0
- package/resources/containers/files/files.mjs +51 -0
- package/resources/containers/files/files.mjs.map +1 -0
- package/resources/containers/files/index.d.mts +3 -0
- package/resources/containers/files/index.d.mts.map +1 -0
- package/resources/containers/files/index.d.ts +3 -0
- package/resources/containers/files/index.d.ts.map +1 -0
- package/resources/containers/files/index.js +9 -0
- package/resources/containers/files/index.js.map +1 -0
- package/resources/containers/files/index.mjs +4 -0
- package/resources/containers/files/index.mjs.map +1 -0
- package/resources/containers/files.d.mts +2 -0
- package/resources/containers/files.d.mts.map +1 -0
- package/resources/containers/files.d.ts +2 -0
- package/resources/containers/files.d.ts.map +1 -0
- package/resources/containers/files.js +6 -0
- package/resources/containers/files.js.map +1 -0
- package/resources/containers/files.mjs +3 -0
- package/resources/containers/files.mjs.map +1 -0
- package/resources/containers/index.d.mts +3 -0
- package/resources/containers/index.d.mts.map +1 -0
- package/resources/containers/index.d.ts +3 -0
- package/resources/containers/index.d.ts.map +1 -0
- package/resources/containers/index.js +9 -0
- package/resources/containers/index.js.map +1 -0
- package/resources/containers/index.mjs +4 -0
- package/resources/containers/index.mjs.map +1 -0
- package/resources/containers.d.mts +2 -0
- package/resources/containers.d.mts.map +1 -0
- package/resources/containers.d.ts +2 -0
- package/resources/containers.d.ts.map +1 -0
- package/resources/containers.js +6 -0
- package/resources/containers.js.map +1 -0
- package/resources/containers.mjs +3 -0
- package/resources/containers.mjs.map +1 -0
- package/resources/conversations/conversations.d.mts +176 -0
- package/resources/conversations/conversations.d.mts.map +1 -0
- package/resources/conversations/conversations.d.ts +176 -0
- package/resources/conversations/conversations.d.ts.map +1 -0
- package/resources/conversations/conversations.js +42 -0
- package/resources/conversations/conversations.js.map +1 -0
- package/resources/conversations/conversations.mjs +37 -0
- package/resources/conversations/conversations.mjs.map +1 -0
- package/resources/conversations/index.d.mts +3 -0
- package/resources/conversations/index.d.mts.map +1 -0
- package/resources/conversations/index.d.ts +3 -0
- package/resources/conversations/index.d.ts.map +1 -0
- package/resources/conversations/index.js +9 -0
- package/resources/conversations/index.js.map +1 -0
- package/resources/conversations/index.mjs +4 -0
- package/resources/conversations/index.mjs.map +1 -0
- package/resources/conversations/items.d.mts +367 -0
- package/resources/conversations/items.d.mts.map +1 -0
- package/resources/conversations/items.d.ts +367 -0
- package/resources/conversations/items.d.ts.map +1 -0
- package/resources/conversations/items.js +42 -0
- package/resources/conversations/items.js.map +1 -0
- package/resources/conversations/items.mjs +38 -0
- package/resources/conversations/items.mjs.map +1 -0
- package/resources/conversations.d.mts +2 -0
- package/resources/conversations.d.mts.map +1 -0
- package/resources/conversations.d.ts +2 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +6 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +3 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/embeddings.d.mts +113 -0
- package/resources/embeddings.d.mts.map +1 -0
- package/resources/embeddings.d.ts +113 -0
- package/resources/embeddings.d.ts.map +1 -0
- package/resources/embeddings.js +24 -0
- package/resources/embeddings.js.map +1 -0
- package/resources/embeddings.mjs +20 -0
- package/resources/embeddings.mjs.map +1 -0
- package/resources/evals/evals.d.mts +736 -0
- package/resources/evals/evals.d.mts.map +1 -0
- package/resources/evals/evals.d.ts +736 -0
- package/resources/evals/evals.d.ts.map +1 -0
- package/resources/evals/evals.js +54 -0
- package/resources/evals/evals.js.map +1 -0
- package/resources/evals/evals.mjs +49 -0
- package/resources/evals/evals.mjs.map +1 -0
- package/resources/evals/index.d.mts +3 -0
- package/resources/evals/index.d.mts.map +1 -0
- package/resources/evals/index.d.ts +3 -0
- package/resources/evals/index.d.ts.map +1 -0
- package/resources/evals/index.js +9 -0
- package/resources/evals/index.js.map +1 -0
- package/resources/evals/index.mjs +4 -0
- package/resources/evals/index.mjs.map +1 -0
- package/resources/evals/runs/index.d.mts +3 -0
- package/resources/evals/runs/index.d.mts.map +1 -0
- package/resources/evals/runs/index.d.ts +3 -0
- package/resources/evals/runs/index.d.ts.map +1 -0
- package/resources/evals/runs/index.js +9 -0
- package/resources/evals/runs/index.js.map +1 -0
- package/resources/evals/runs/index.mjs +4 -0
- package/resources/evals/runs/index.mjs.map +1 -0
- package/resources/evals/runs/output-items.d.mts +382 -0
- package/resources/evals/runs/output-items.d.mts.map +1 -0
- package/resources/evals/runs/output-items.d.ts +382 -0
- package/resources/evals/runs/output-items.d.ts.map +1 -0
- package/resources/evals/runs/output-items.js +25 -0
- package/resources/evals/runs/output-items.js.map +1 -0
- package/resources/evals/runs/output-items.mjs +21 -0
- package/resources/evals/runs/output-items.mjs.map +1 -0
- package/resources/evals/runs/runs.d.mts +2385 -0
- package/resources/evals/runs/runs.d.mts.map +1 -0
- package/resources/evals/runs/runs.d.ts +2385 -0
- package/resources/evals/runs/runs.d.ts.map +1 -0
- package/resources/evals/runs/runs.js +57 -0
- package/resources/evals/runs/runs.js.map +1 -0
- package/resources/evals/runs/runs.mjs +52 -0
- package/resources/evals/runs/runs.mjs.map +1 -0
- package/resources/evals/runs.d.mts +2 -0
- package/resources/evals/runs.d.mts.map +1 -0
- package/resources/evals/runs.d.ts +2 -0
- package/resources/evals/runs.d.ts.map +1 -0
- package/resources/evals/runs.js +6 -0
- package/resources/evals/runs.js.map +1 -0
- package/resources/evals/runs.mjs +3 -0
- package/resources/evals/runs.mjs.map +1 -0
- package/resources/evals.d.mts +2 -0
- package/resources/evals.d.mts.map +1 -0
- package/resources/evals.d.ts +2 -0
- package/resources/evals.d.ts.map +1 -0
- package/resources/evals.js +6 -0
- package/resources/evals.js.map +1 -0
- package/resources/evals.mjs +3 -0
- package/resources/evals.mjs.map +1 -0
- package/resources/files.d.mts +164 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +164 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +66 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +62 -0
- package/resources/files.mjs.map +1 -0
- package/resources/fine-tuning/alpha/alpha.d.mts +10 -0
- package/resources/fine-tuning/alpha/alpha.d.mts.map +1 -0
- package/resources/fine-tuning/alpha/alpha.d.ts +10 -0
- package/resources/fine-tuning/alpha/alpha.d.ts.map +1 -0
- package/resources/fine-tuning/alpha/alpha.js +17 -0
- package/resources/fine-tuning/alpha/alpha.js.map +1 -0
- package/resources/fine-tuning/alpha/alpha.mjs +12 -0
- package/resources/fine-tuning/alpha/alpha.mjs.map +1 -0
- package/resources/fine-tuning/alpha/graders.d.mts +119 -0
- package/resources/fine-tuning/alpha/graders.d.mts.map +1 -0
- package/resources/fine-tuning/alpha/graders.d.ts +119 -0
- package/resources/fine-tuning/alpha/graders.d.ts.map +1 -0
- package/resources/fine-tuning/alpha/graders.js +49 -0
- package/resources/fine-tuning/alpha/graders.js.map +1 -0
- package/resources/fine-tuning/alpha/graders.mjs +45 -0
- package/resources/fine-tuning/alpha/graders.mjs.map +1 -0
- package/resources/fine-tuning/alpha/index.d.mts +3 -0
- package/resources/fine-tuning/alpha/index.d.mts.map +1 -0
- package/resources/fine-tuning/alpha/index.d.ts +3 -0
- package/resources/fine-tuning/alpha/index.d.ts.map +1 -0
- package/resources/fine-tuning/alpha/index.js +9 -0
- package/resources/fine-tuning/alpha/index.js.map +1 -0
- package/resources/fine-tuning/alpha/index.mjs +4 -0
- package/resources/fine-tuning/alpha/index.mjs.map +1 -0
- package/resources/fine-tuning/alpha.d.mts +2 -0
- package/resources/fine-tuning/alpha.d.mts.map +1 -0
- package/resources/fine-tuning/alpha.d.ts +2 -0
- package/resources/fine-tuning/alpha.d.ts.map +1 -0
- package/resources/fine-tuning/alpha.js +6 -0
- package/resources/fine-tuning/alpha.js.map +1 -0
- package/resources/fine-tuning/alpha.mjs +3 -0
- package/resources/fine-tuning/alpha.mjs.map +1 -0
- package/resources/fine-tuning/checkpoints/checkpoints.d.mts +10 -0
- package/resources/fine-tuning/checkpoints/checkpoints.d.mts.map +1 -0
- package/resources/fine-tuning/checkpoints/checkpoints.d.ts +10 -0
- package/resources/fine-tuning/checkpoints/checkpoints.d.ts.map +1 -0
- package/resources/fine-tuning/checkpoints/checkpoints.js +17 -0
- package/resources/fine-tuning/checkpoints/checkpoints.js.map +1 -0
- package/resources/fine-tuning/checkpoints/checkpoints.mjs +12 -0
- package/resources/fine-tuning/checkpoints/checkpoints.mjs.map +1 -0
- package/resources/fine-tuning/checkpoints/index.d.mts +3 -0
- package/resources/fine-tuning/checkpoints/index.d.mts.map +1 -0
- package/resources/fine-tuning/checkpoints/index.d.ts +3 -0
- package/resources/fine-tuning/checkpoints/index.d.ts.map +1 -0
- package/resources/fine-tuning/checkpoints/index.js +9 -0
- package/resources/fine-tuning/checkpoints/index.js.map +1 -0
- package/resources/fine-tuning/checkpoints/index.mjs +4 -0
- package/resources/fine-tuning/checkpoints/index.mjs.map +1 -0
- package/resources/fine-tuning/checkpoints/permissions.d.mts +160 -0
- package/resources/fine-tuning/checkpoints/permissions.d.mts.map +1 -0
- package/resources/fine-tuning/checkpoints/permissions.d.ts +160 -0
- package/resources/fine-tuning/checkpoints/permissions.d.ts.map +1 -0
- package/resources/fine-tuning/checkpoints/permissions.js +73 -0
- package/resources/fine-tuning/checkpoints/permissions.js.map +1 -0
- package/resources/fine-tuning/checkpoints/permissions.mjs +69 -0
- package/resources/fine-tuning/checkpoints/permissions.mjs.map +1 -0
- package/resources/fine-tuning/checkpoints.d.mts +2 -0
- package/resources/fine-tuning/checkpoints.d.mts.map +1 -0
- package/resources/fine-tuning/checkpoints.d.ts +2 -0
- package/resources/fine-tuning/checkpoints.d.ts.map +1 -0
- package/resources/fine-tuning/checkpoints.js +6 -0
- package/resources/fine-tuning/checkpoints.js.map +1 -0
- package/resources/fine-tuning/checkpoints.mjs +3 -0
- package/resources/fine-tuning/checkpoints.mjs.map +1 -0
- package/resources/fine-tuning/fine-tuning.d.mts +22 -0
- package/resources/fine-tuning/fine-tuning.d.mts.map +1 -0
- package/resources/fine-tuning/fine-tuning.d.ts +22 -0
- package/resources/fine-tuning/fine-tuning.d.ts.map +1 -0
- package/resources/fine-tuning/fine-tuning.js +29 -0
- package/resources/fine-tuning/fine-tuning.js.map +1 -0
- package/resources/fine-tuning/fine-tuning.mjs +24 -0
- package/resources/fine-tuning/fine-tuning.mjs.map +1 -0
- package/resources/fine-tuning/index.d.mts +6 -0
- package/resources/fine-tuning/index.d.mts.map +1 -0
- package/resources/fine-tuning/index.d.ts +6 -0
- package/resources/fine-tuning/index.d.ts.map +1 -0
- package/resources/fine-tuning/index.js +15 -0
- package/resources/fine-tuning/index.js.map +1 -0
- package/resources/fine-tuning/index.mjs +7 -0
- package/resources/fine-tuning/index.mjs.map +1 -0
- package/resources/fine-tuning/jobs/checkpoints.d.mts +74 -0
- package/resources/fine-tuning/jobs/checkpoints.d.mts.map +1 -0
- package/resources/fine-tuning/jobs/checkpoints.d.ts +74 -0
- package/resources/fine-tuning/jobs/checkpoints.d.ts.map +1 -0
- package/resources/fine-tuning/jobs/checkpoints.js +27 -0
- package/resources/fine-tuning/jobs/checkpoints.js.map +1 -0
- package/resources/fine-tuning/jobs/checkpoints.mjs +23 -0
- package/resources/fine-tuning/jobs/checkpoints.mjs.map +1 -0
- package/resources/fine-tuning/jobs/index.d.mts +3 -0
- package/resources/fine-tuning/jobs/index.d.mts.map +1 -0
- package/resources/fine-tuning/jobs/index.d.ts +3 -0
- package/resources/fine-tuning/jobs/index.d.ts.map +1 -0
- package/resources/fine-tuning/jobs/index.js +9 -0
- package/resources/fine-tuning/jobs/index.js.map +1 -0
- package/resources/fine-tuning/jobs/index.mjs +4 -0
- package/resources/fine-tuning/jobs/index.mjs.map +1 -0
- package/resources/fine-tuning/jobs/jobs.d.mts +528 -0
- package/resources/fine-tuning/jobs/jobs.d.mts.map +1 -0
- package/resources/fine-tuning/jobs/jobs.d.ts +528 -0
- package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -0
- package/resources/fine-tuning/jobs/jobs.js +123 -0
- package/resources/fine-tuning/jobs/jobs.js.map +1 -0
- package/resources/fine-tuning/jobs/jobs.mjs +118 -0
- package/resources/fine-tuning/jobs/jobs.mjs.map +1 -0
- package/resources/fine-tuning/jobs.d.mts +2 -0
- package/resources/fine-tuning/jobs.d.mts.map +1 -0
- package/resources/fine-tuning/jobs.d.ts +2 -0
- package/resources/fine-tuning/jobs.d.ts.map +1 -0
- package/resources/fine-tuning/jobs.js +6 -0
- package/resources/fine-tuning/jobs.js.map +1 -0
- package/resources/fine-tuning/jobs.mjs +3 -0
- package/resources/fine-tuning/jobs.mjs.map +1 -0
- package/resources/fine-tuning/methods.d.mts +120 -0
- package/resources/fine-tuning/methods.d.mts.map +1 -0
- package/resources/fine-tuning/methods.d.ts +120 -0
- package/resources/fine-tuning/methods.d.ts.map +1 -0
- package/resources/fine-tuning/methods.js +9 -0
- package/resources/fine-tuning/methods.js.map +1 -0
- package/resources/fine-tuning/methods.mjs +5 -0
- package/resources/fine-tuning/methods.mjs.map +1 -0
- package/resources/fine-tuning.d.mts +2 -0
- package/resources/fine-tuning.d.mts.map +1 -0
- package/resources/fine-tuning.d.ts +2 -0
- package/resources/fine-tuning.d.ts.map +1 -0
- package/resources/fine-tuning.js +6 -0
- package/resources/fine-tuning.js.map +1 -0
- package/resources/fine-tuning.mjs +3 -0
- package/resources/fine-tuning.mjs.map +1 -0
- package/resources/graders/grader-models.d.mts +354 -0
- package/resources/graders/grader-models.d.mts.map +1 -0
- package/resources/graders/grader-models.d.ts +354 -0
- package/resources/graders/grader-models.d.ts.map +1 -0
- package/resources/graders/grader-models.js +9 -0
- package/resources/graders/grader-models.js.map +1 -0
- package/resources/graders/grader-models.mjs +5 -0
- package/resources/graders/grader-models.mjs.map +1 -0
- package/resources/graders/graders.d.mts +10 -0
- package/resources/graders/graders.d.mts.map +1 -0
- package/resources/graders/graders.d.ts +10 -0
- package/resources/graders/graders.d.ts.map +1 -0
- package/resources/graders/graders.js +17 -0
- package/resources/graders/graders.js.map +1 -0
- package/resources/graders/graders.mjs +12 -0
- package/resources/graders/graders.mjs.map +1 -0
- package/resources/graders/index.d.mts +3 -0
- package/resources/graders/index.d.mts.map +1 -0
- package/resources/graders/index.d.ts +3 -0
- package/resources/graders/index.d.ts.map +1 -0
- package/resources/graders/index.js +9 -0
- package/resources/graders/index.js.map +1 -0
- package/resources/graders/index.mjs +4 -0
- package/resources/graders/index.mjs.map +1 -0
- package/resources/graders.d.mts +2 -0
- package/resources/graders.d.mts.map +1 -0
- package/resources/graders.d.ts +2 -0
- package/resources/graders.d.ts.map +1 -0
- package/resources/graders.js +6 -0
- package/resources/graders.js.map +1 -0
- package/resources/graders.mjs +3 -0
- package/resources/graders.mjs.map +1 -0
- package/resources/images.d.mts +676 -0
- package/resources/images.d.mts.map +1 -0
- package/resources/images.d.ts +676 -0
- package/resources/images.d.ts.map +1 -0
- package/resources/images.js +29 -0
- package/resources/images.js.map +1 -0
- package/resources/images.mjs +25 -0
- package/resources/images.mjs.map +1 -0
- package/resources/index.d.mts +24 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +24 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +50 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +25 -0
- package/resources/index.mjs.map +1 -0
- package/resources/models.d.mts +52 -0
- package/resources/models.d.mts.map +1 -0
- package/resources/models.d.ts +52 -0
- package/resources/models.d.ts.map +1 -0
- package/resources/models.js +32 -0
- package/resources/models.js.map +1 -0
- package/resources/models.mjs +28 -0
- package/resources/models.mjs.map +1 -0
- package/resources/moderations.d.mts +295 -0
- package/resources/moderations.d.mts.map +1 -0
- package/resources/moderations.d.ts +295 -0
- package/resources/moderations.d.ts.map +1 -0
- package/resources/moderations.js +16 -0
- package/resources/moderations.js.map +1 -0
- package/resources/moderations.mjs +12 -0
- package/resources/moderations.mjs.map +1 -0
- package/resources/realtime/calls.d.mts +158 -0
- package/resources/realtime/calls.d.mts.map +1 -0
- package/resources/realtime/calls.d.ts +158 -0
- package/resources/realtime/calls.d.ts.map +1 -0
- package/resources/realtime/calls.js +75 -0
- package/resources/realtime/calls.js.map +1 -0
- package/resources/realtime/calls.mjs +71 -0
- package/resources/realtime/calls.mjs.map +1 -0
- package/resources/realtime/client-secrets.d.mts +638 -0
- package/resources/realtime/client-secrets.d.mts.map +1 -0
- package/resources/realtime/client-secrets.d.ts +638 -0
- package/resources/realtime/client-secrets.d.ts.map +1 -0
- package/resources/realtime/client-secrets.js +35 -0
- package/resources/realtime/client-secrets.js.map +1 -0
- package/resources/realtime/client-secrets.mjs +31 -0
- package/resources/realtime/client-secrets.mjs.map +1 -0
- package/resources/realtime/index.d.mts +4 -0
- package/resources/realtime/index.d.mts.map +1 -0
- package/resources/realtime/index.d.ts +4 -0
- package/resources/realtime/index.d.ts.map +1 -0
- package/resources/realtime/index.js +11 -0
- package/resources/realtime/index.js.map +1 -0
- package/resources/realtime/index.mjs +5 -0
- package/resources/realtime/index.mjs.map +1 -0
- package/resources/realtime/realtime.d.mts +3941 -0
- package/resources/realtime/realtime.d.mts.map +1 -0
- package/resources/realtime/realtime.d.ts +3941 -0
- package/resources/realtime/realtime.d.ts.map +1 -0
- package/resources/realtime/realtime.js +21 -0
- package/resources/realtime/realtime.js.map +1 -0
- package/resources/realtime/realtime.mjs +16 -0
- package/resources/realtime/realtime.mjs.map +1 -0
- package/resources/realtime.d.mts +2 -0
- package/resources/realtime.d.mts.map +1 -0
- package/resources/realtime.d.ts +2 -0
- package/resources/realtime.d.ts.map +1 -0
- package/resources/realtime.js +6 -0
- package/resources/realtime.js.map +1 -0
- package/resources/realtime.mjs +3 -0
- package/resources/realtime.mjs.map +1 -0
- package/resources/responses/index.d.mts +4 -0
- package/resources/responses/index.d.mts.map +1 -0
- package/resources/responses/index.d.ts +4 -0
- package/resources/responses/index.d.ts.map +1 -0
- package/resources/responses/index.js +11 -0
- package/resources/responses/index.js.map +1 -0
- package/resources/responses/index.mjs +5 -0
- package/resources/responses/index.mjs.map +1 -0
- package/resources/responses/input-items.d.mts +65 -0
- package/resources/responses/input-items.d.mts.map +1 -0
- package/resources/responses/input-items.d.ts +65 -0
- package/resources/responses/input-items.d.ts.map +1 -0
- package/resources/responses/input-items.js +27 -0
- package/resources/responses/input-items.js.map +1 -0
- package/resources/responses/input-items.mjs +23 -0
- package/resources/responses/input-items.mjs.map +1 -0
- package/resources/responses/input-tokens.d.mts +129 -0
- package/resources/responses/input-tokens.d.mts.map +1 -0
- package/resources/responses/input-tokens.d.ts +129 -0
- package/resources/responses/input-tokens.d.ts.map +1 -0
- package/resources/responses/input-tokens.js +23 -0
- package/resources/responses/input-tokens.js.map +1 -0
- package/resources/responses/input-tokens.mjs +19 -0
- package/resources/responses/input-tokens.mjs.map +1 -0
- package/resources/responses/responses.d.mts +5561 -0
- package/resources/responses/responses.d.mts.map +1 -0
- package/resources/responses/responses.d.ts +5561 -0
- package/resources/responses/responses.d.ts.map +1 -0
- package/resources/responses/responses.js +82 -0
- package/resources/responses/responses.js.map +1 -0
- package/resources/responses/responses.mjs +77 -0
- package/resources/responses/responses.mjs.map +1 -0
- package/resources/responses.d.mts +2 -0
- package/resources/responses.d.mts.map +1 -0
- package/resources/responses.d.ts +2 -0
- package/resources/responses.d.ts.map +1 -0
- package/resources/responses.js +6 -0
- package/resources/responses.js.map +1 -0
- package/resources/responses.mjs +3 -0
- package/resources/responses.mjs.map +1 -0
- package/resources/shared.d.mts +287 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +287 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/skills/content.d.mts +10 -0
- package/resources/skills/content.d.mts.map +1 -0
- package/resources/skills/content.d.ts +10 -0
- package/resources/skills/content.d.ts.map +1 -0
- package/resources/skills/content.js +21 -0
- package/resources/skills/content.js.map +1 -0
- package/resources/skills/content.mjs +17 -0
- package/resources/skills/content.mjs.map +1 -0
- package/resources/skills/index.d.mts +4 -0
- package/resources/skills/index.d.mts.map +1 -0
- package/resources/skills/index.d.ts +4 -0
- package/resources/skills/index.d.ts.map +1 -0
- package/resources/skills/index.js +11 -0
- package/resources/skills/index.js.map +1 -0
- package/resources/skills/index.mjs +5 -0
- package/resources/skills/index.mjs.map +1 -0
- package/resources/skills/skills.d.mts +116 -0
- package/resources/skills/skills.d.mts.map +1 -0
- package/resources/skills/skills.d.ts +116 -0
- package/resources/skills/skills.d.ts.map +1 -0
- package/resources/skills/skills.js +54 -0
- package/resources/skills/skills.js.map +1 -0
- package/resources/skills/skills.mjs +49 -0
- package/resources/skills/skills.mjs.map +1 -0
- package/resources/skills/versions/content.d.mts +19 -0
- package/resources/skills/versions/content.d.mts.map +1 -0
- package/resources/skills/versions/content.d.ts +19 -0
- package/resources/skills/versions/content.d.ts.map +1 -0
- package/resources/skills/versions/content.js +22 -0
- package/resources/skills/versions/content.js.map +1 -0
- package/resources/skills/versions/content.mjs +18 -0
- package/resources/skills/versions/content.mjs.map +1 -0
- package/resources/skills/versions/index.d.mts +3 -0
- package/resources/skills/versions/index.d.mts.map +1 -0
- package/resources/skills/versions/index.d.ts +3 -0
- package/resources/skills/versions/index.d.ts.map +1 -0
- package/resources/skills/versions/index.js +9 -0
- package/resources/skills/versions/index.js.map +1 -0
- package/resources/skills/versions/index.mjs +4 -0
- package/resources/skills/versions/index.mjs.map +1 -0
- package/resources/skills/versions/versions.d.mts +121 -0
- package/resources/skills/versions/versions.d.mts.map +1 -0
- package/resources/skills/versions/versions.d.ts +121 -0
- package/resources/skills/versions/versions.d.ts.map +1 -0
- package/resources/skills/versions/versions.js +49 -0
- package/resources/skills/versions/versions.js.map +1 -0
- package/resources/skills/versions/versions.mjs +44 -0
- package/resources/skills/versions/versions.mjs.map +1 -0
- package/resources/skills/versions.d.mts +2 -0
- package/resources/skills/versions.d.mts.map +1 -0
- package/resources/skills/versions.d.ts +2 -0
- package/resources/skills/versions.d.ts.map +1 -0
- package/resources/skills/versions.js +6 -0
- package/resources/skills/versions.js.map +1 -0
- package/resources/skills/versions.mjs +3 -0
- package/resources/skills/versions.mjs.map +1 -0
- package/resources/skills.d.mts +2 -0
- package/resources/skills.d.mts.map +1 -0
- package/resources/skills.d.ts +2 -0
- package/resources/skills.d.ts.map +1 -0
- package/resources/skills.js +6 -0
- package/resources/skills.js.map +1 -0
- package/resources/skills.mjs +3 -0
- package/resources/skills.mjs.map +1 -0
- package/resources/uploads/index.d.mts +3 -0
- package/resources/uploads/index.d.mts.map +1 -0
- package/resources/uploads/index.d.ts +3 -0
- package/resources/uploads/index.d.ts.map +1 -0
- package/resources/uploads/index.js +9 -0
- package/resources/uploads/index.js.map +1 -0
- package/resources/uploads/index.mjs +4 -0
- package/resources/uploads/index.mjs.map +1 -0
- package/resources/uploads/parts.d.mts +51 -0
- package/resources/uploads/parts.d.mts.map +1 -0
- package/resources/uploads/parts.d.ts +51 -0
- package/resources/uploads/parts.d.ts.map +1 -0
- package/resources/uploads/parts.js +27 -0
- package/resources/uploads/parts.js.map +1 -0
- package/resources/uploads/parts.mjs +23 -0
- package/resources/uploads/parts.mjs.map +1 -0
- package/resources/uploads/uploads.d.mts +163 -0
- package/resources/uploads/uploads.d.mts.map +1 -0
- package/resources/uploads/uploads.d.ts +163 -0
- package/resources/uploads/uploads.d.ts.map +1 -0
- package/resources/uploads/uploads.js +72 -0
- package/resources/uploads/uploads.js.map +1 -0
- package/resources/uploads/uploads.mjs +67 -0
- package/resources/uploads/uploads.mjs.map +1 -0
- package/resources/uploads.d.mts +2 -0
- package/resources/uploads.d.mts.map +1 -0
- package/resources/uploads.d.ts +2 -0
- package/resources/uploads.d.ts.map +1 -0
- package/resources/uploads.js +6 -0
- package/resources/uploads.js.map +1 -0
- package/resources/uploads.mjs +3 -0
- package/resources/uploads.mjs.map +1 -0
- package/resources/vector-stores/file-batches.d.mts +179 -0
- package/resources/vector-stores/file-batches.d.mts.map +1 -0
- package/resources/vector-stores/file-batches.d.ts +179 -0
- package/resources/vector-stores/file-batches.d.ts.map +1 -0
- package/resources/vector-stores/file-batches.js +50 -0
- package/resources/vector-stores/file-batches.js.map +1 -0
- package/resources/vector-stores/file-batches.mjs +46 -0
- package/resources/vector-stores/file-batches.mjs.map +1 -0
- package/resources/vector-stores/files.d.mts +202 -0
- package/resources/vector-stores/files.d.mts.map +1 -0
- package/resources/vector-stores/files.d.ts +202 -0
- package/resources/vector-stores/files.d.ts.map +1 -0
- package/resources/vector-stores/files.js +75 -0
- package/resources/vector-stores/files.js.map +1 -0
- package/resources/vector-stores/files.mjs +71 -0
- package/resources/vector-stores/files.mjs.map +1 -0
- package/resources/vector-stores/index.d.mts +4 -0
- package/resources/vector-stores/index.d.mts.map +1 -0
- package/resources/vector-stores/index.d.ts +4 -0
- package/resources/vector-stores/index.d.ts.map +1 -0
- package/resources/vector-stores/index.js +11 -0
- package/resources/vector-stores/index.js.map +1 -0
- package/resources/vector-stores/index.mjs +5 -0
- package/resources/vector-stores/index.mjs.map +1 -0
- package/resources/vector-stores/vector-stores.d.mts +378 -0
- package/resources/vector-stores/vector-stores.d.mts.map +1 -0
- package/resources/vector-stores/vector-stores.d.ts +378 -0
- package/resources/vector-stores/vector-stores.d.ts.map +1 -0
- package/resources/vector-stores/vector-stores.js +84 -0
- package/resources/vector-stores/vector-stores.js.map +1 -0
- package/resources/vector-stores/vector-stores.mjs +79 -0
- package/resources/vector-stores/vector-stores.mjs.map +1 -0
- package/resources/vector-stores.d.mts +2 -0
- package/resources/vector-stores.d.mts.map +1 -0
- package/resources/vector-stores.d.ts +2 -0
- package/resources/vector-stores.d.ts.map +1 -0
- package/resources/vector-stores.js +6 -0
- package/resources/vector-stores.js.map +1 -0
- package/resources/vector-stores.mjs +3 -0
- package/resources/vector-stores.mjs.map +1 -0
- package/resources/videos.d.mts +171 -0
- package/resources/videos.d.mts.map +1 -0
- package/resources/videos.d.ts +171 -0
- package/resources/videos.d.ts.map +1 -0
- package/resources/videos.js +56 -0
- package/resources/videos.js.map +1 -0
- package/resources/videos.mjs +52 -0
- package/resources/videos.mjs.map +1 -0
- package/resources/webhooks/index.d.mts +2 -0
- package/resources/webhooks/index.d.mts.map +1 -0
- package/resources/webhooks/index.d.ts +2 -0
- package/resources/webhooks/index.d.ts.map +1 -0
- package/resources/webhooks/index.js +7 -0
- package/resources/webhooks/index.js.map +1 -0
- package/resources/webhooks/index.mjs +3 -0
- package/resources/webhooks/index.mjs.map +1 -0
- package/resources/webhooks/webhooks.d.mts +571 -0
- package/resources/webhooks/webhooks.d.mts.map +1 -0
- package/resources/webhooks/webhooks.d.ts +571 -0
- package/resources/webhooks/webhooks.d.ts.map +1 -0
- package/resources/webhooks/webhooks.js +12 -0
- package/resources/webhooks/webhooks.js.map +1 -0
- package/resources/webhooks/webhooks.mjs +8 -0
- package/resources/webhooks/webhooks.mjs.map +1 -0
- package/resources/webhooks.d.mts +2 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +2 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +6 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +3 -0
- package/resources/webhooks.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +1292 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +142 -0
- package/src/core/pagination.ts +264 -0
- package/src/core/resource.ts +11 -0
- package/src/core/streaming.ts +332 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +23 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/decoders/line.ts +135 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +70 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/request-options.ts +93 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +2 -0
- package/src/resource.ts +2 -0
- package/src/resources/audio/audio.ts +91 -0
- package/src/resources/audio/index.ts +29 -0
- package/src/resources/audio/speech.ts +97 -0
- package/src/resources/audio/transcriptions.ts +805 -0
- package/src/resources/audio/translations.ts +103 -0
- package/src/resources/audio.ts +3 -0
- package/src/resources/batches.ts +367 -0
- package/src/resources/beta/assistants.ts +1538 -0
- package/src/resources/beta/beta.ts +87 -0
- package/src/resources/beta/chatkit/chatkit.ts +112 -0
- package/src/resources/beta/chatkit/index.ts +30 -0
- package/src/resources/beta/chatkit/sessions.ts +81 -0
- package/src/resources/beta/chatkit/threads.ts +1037 -0
- package/src/resources/beta/chatkit.ts +3 -0
- package/src/resources/beta/index.ts +36 -0
- package/src/resources/beta/threads/index.ts +70 -0
- package/src/resources/beta/threads/messages.ts +792 -0
- package/src/resources/beta/threads/runs/index.ts +43 -0
- package/src/resources/beta/threads/runs/runs.ts +947 -0
- package/src/resources/beta/threads/runs/steps.ts +756 -0
- package/src/resources/beta/threads/runs.ts +3 -0
- package/src/resources/beta/threads/threads.ts +1028 -0
- package/src/resources/beta/threads.ts +3 -0
- package/src/resources/beta.ts +3 -0
- package/src/resources/chat/chat.ts +110 -0
- package/src/resources/chat/completions/completions.ts +1932 -0
- package/src/resources/chat/completions/index.ts +49 -0
- package/src/resources/chat/completions/messages.ts +50 -0
- package/src/resources/chat/completions.ts +3 -0
- package/src/resources/chat/index.ts +49 -0
- package/src/resources/chat.ts +3 -0
- package/src/resources/completions.ts +397 -0
- package/src/resources/containers/containers.ts +395 -0
- package/src/resources/containers/files/content.ts +29 -0
- package/src/resources/containers/files/files.ts +228 -0
- package/src/resources/containers/files/index.ts +14 -0
- package/src/resources/containers/files.ts +3 -0
- package/src/resources/containers/index.ts +22 -0
- package/src/resources/containers.ts +3 -0
- package/src/resources/conversations/api.md +37 -0
- package/src/resources/conversations/conversations.ts +277 -0
- package/src/resources/conversations/index.ts +13 -0
- package/src/resources/conversations/items.ts +502 -0
- package/src/resources/conversations.ts +3 -0
- package/src/resources/embeddings.ts +138 -0
- package/src/resources/evals/evals.ts +930 -0
- package/src/resources/evals/index.ts +33 -0
- package/src/resources/evals/runs/index.ts +27 -0
- package/src/resources/evals/runs/output-items.ts +477 -0
- package/src/resources/evals/runs/runs.ts +2869 -0
- package/src/resources/evals/runs.ts +3 -0
- package/src/resources/evals.ts +3 -0
- package/src/resources/files.ts +229 -0
- package/src/resources/fine-tuning/alpha/alpha.ts +27 -0
- package/src/resources/fine-tuning/alpha/graders.ts +171 -0
- package/src/resources/fine-tuning/alpha/index.ts +10 -0
- package/src/resources/fine-tuning/alpha.ts +3 -0
- package/src/resources/fine-tuning/checkpoints/checkpoints.ts +33 -0
- package/src/resources/fine-tuning/checkpoints/index.ts +13 -0
- package/src/resources/fine-tuning/checkpoints/permissions.ts +227 -0
- package/src/resources/fine-tuning/checkpoints.ts +3 -0
- package/src/resources/fine-tuning/fine-tuning.ts +73 -0
- package/src/resources/fine-tuning/index.ts +27 -0
- package/src/resources/fine-tuning/jobs/checkpoints.ts +107 -0
- package/src/resources/fine-tuning/jobs/index.ts +21 -0
- package/src/resources/fine-tuning/jobs/jobs.ts +654 -0
- package/src/resources/fine-tuning/jobs.ts +3 -0
- package/src/resources/fine-tuning/methods.ts +152 -0
- package/src/resources/fine-tuning.ts +3 -0
- package/src/resources/graders/grader-models.ts +450 -0
- package/src/resources/graders/graders.ts +33 -0
- package/src/resources/graders/index.ts +13 -0
- package/src/resources/graders.ts +3 -0
- package/src/resources/images.ts +848 -0
- package/src/resources/index.ts +145 -0
- package/src/resources/models.ts +73 -0
- package/src/resources/moderations.ts +367 -0
- package/src/resources/realtime/api.md +128 -0
- package/src/resources/realtime/calls.ts +226 -0
- package/src/resources/realtime/client-secrets.ts +761 -0
- package/src/resources/realtime/index.ts +13 -0
- package/src/resources/realtime/realtime.ts +4844 -0
- package/src/resources/realtime.ts +3 -0
- package/src/resources/responses/api.md +167 -0
- package/src/resources/responses/index.ts +5 -0
- package/src/resources/responses/input-items.ts +87 -0
- package/src/resources/responses/input-tokens.ts +164 -0
- package/src/resources/responses/responses.ts +7000 -0
- package/src/resources/responses.ts +3 -0
- package/src/resources/shared.ts +423 -0
- package/src/resources/skills/content.ts +20 -0
- package/src/resources/skills/index.ts +24 -0
- package/src/resources/skills/skills.ts +191 -0
- package/src/resources/skills/versions/content.ts +32 -0
- package/src/resources/skills/versions/index.ts +14 -0
- package/src/resources/skills/versions/versions.ts +196 -0
- package/src/resources/skills/versions.ts +3 -0
- package/src/resources/skills.ts +3 -0
- package/src/resources/uploads/index.ts +4 -0
- package/src/resources/uploads/parts.ts +66 -0
- package/src/resources/uploads/uploads.ts +201 -0
- package/src/resources/uploads.ts +3 -0
- package/src/resources/vector-stores/file-batches.ts +255 -0
- package/src/resources/vector-stores/files.ts +306 -0
- package/src/resources/vector-stores/index.ts +43 -0
- package/src/resources/vector-stores/vector-stores.ts +562 -0
- package/src/resources/vector-stores.ts +3 -0
- package/src/resources/videos.ts +257 -0
- package/src/resources/webhooks/api.md +24 -0
- package/src/resources/webhooks/index.ts +3 -0
- package/src/resources/webhooks/webhooks.ts +702 -0
- package/src/resources/webhooks.ts +3 -0
- package/src/resources.ts +1 -0
- package/src/streaming.ts +2 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/streaming.d.mts +2 -0
- package/streaming.d.mts.map +1 -0
- package/streaming.d.ts +2 -0
- package/streaming.d.ts.map +1 -0
- package/streaming.js +6 -0
- package/streaming.js.map +1 -0
- package/streaming.mjs +2 -0
- package/streaming.mjs.map +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
export const FallbackEncoder = ({ headers, body }) => {
|
|
3
|
+
return {
|
|
4
|
+
bodyHeaders: {
|
|
5
|
+
'content-type': 'application/json',
|
|
6
|
+
},
|
|
7
|
+
body: JSON.stringify(body),
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=request-options.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-options.mjs","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAqFtF,MAAM,CAAC,MAAM,eAAe,GAAmB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;IACnE,OAAO;QACL,WAAW,EAAE;YACX,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shims for types that we can't always rely on being available globally.
|
|
3
|
+
*
|
|
4
|
+
* Note: these only exist at the type-level, there is no corresponding runtime
|
|
5
|
+
* version for any of these symbols.
|
|
6
|
+
*/
|
|
7
|
+
type NeverToAny<T> = T extends never ? any : T;
|
|
8
|
+
/** @ts-ignore */
|
|
9
|
+
type _DOMReadableStream<R = any> = globalThis.ReadableStream<R>;
|
|
10
|
+
/** @ts-ignore */
|
|
11
|
+
type _NodeReadableStream<R = any> = import('stream/web').ReadableStream<R>;
|
|
12
|
+
type _ConditionalNodeReadableStream<R = any> = typeof globalThis extends {
|
|
13
|
+
ReadableStream: any;
|
|
14
|
+
} ? never : _NodeReadableStream<R>;
|
|
15
|
+
type _ReadableStream<R = any> = NeverToAny<([0] extends [1 & _DOMReadableStream<R>] ? never : _DOMReadableStream<R>) | ([0] extends [1 & _ConditionalNodeReadableStream<R>] ? never : _ConditionalNodeReadableStream<R>)>;
|
|
16
|
+
export type { _ReadableStream as ReadableStream };
|
|
17
|
+
//# sourceMappingURL=shim-types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shim-types.d.mts","sourceRoot":"","sources":["../src/internal/shim-types.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;AAE/C,iBAAiB;AACjB,KAAK,kBAAkB,CAAC,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;AAEhE,iBAAiB;AACjB,KAAK,mBAAmB,CAAC,CAAC,GAAG,GAAG,IAAI,OAAO,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;AAE3E,KAAK,8BAA8B,CAAC,CAAC,GAAG,GAAG,IACzC,OAAO,UAAU,SAAS;IAAE,cAAc,EAAE,GAAG,CAAA;CAAE,GAAG,KAAK,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAErF,KAAK,eAAe,CAAC,CAAC,GAAG,GAAG,IAAI,UAAU,CACtC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,GACzE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,8BAA8B,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,8BAA8B,CAAC,CAAC,CAAC,CAAC,CACpG,CAAC;AAEF,YAAY,EAAE,eAAe,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shims for types that we can't always rely on being available globally.
|
|
3
|
+
*
|
|
4
|
+
* Note: these only exist at the type-level, there is no corresponding runtime
|
|
5
|
+
* version for any of these symbols.
|
|
6
|
+
*/
|
|
7
|
+
type NeverToAny<T> = T extends never ? any : T;
|
|
8
|
+
/** @ts-ignore */
|
|
9
|
+
type _DOMReadableStream<R = any> = globalThis.ReadableStream<R>;
|
|
10
|
+
/** @ts-ignore */
|
|
11
|
+
type _NodeReadableStream<R = any> = import('stream/web').ReadableStream<R>;
|
|
12
|
+
type _ConditionalNodeReadableStream<R = any> = typeof globalThis extends {
|
|
13
|
+
ReadableStream: any;
|
|
14
|
+
} ? never : _NodeReadableStream<R>;
|
|
15
|
+
type _ReadableStream<R = any> = NeverToAny<([0] extends [1 & _DOMReadableStream<R>] ? never : _DOMReadableStream<R>) | ([0] extends [1 & _ConditionalNodeReadableStream<R>] ? never : _ConditionalNodeReadableStream<R>)>;
|
|
16
|
+
export type { _ReadableStream as ReadableStream };
|
|
17
|
+
//# sourceMappingURL=shim-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shim-types.d.ts","sourceRoot":"","sources":["../src/internal/shim-types.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;AAE/C,iBAAiB;AACjB,KAAK,kBAAkB,CAAC,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;AAEhE,iBAAiB;AACjB,KAAK,mBAAmB,CAAC,CAAC,GAAG,GAAG,IAAI,OAAO,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;AAE3E,KAAK,8BAA8B,CAAC,CAAC,GAAG,GAAG,IACzC,OAAO,UAAU,SAAS;IAAE,cAAc,EAAE,GAAG,CAAA;CAAE,GAAG,KAAK,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAErF,KAAK,eAAe,CAAC,CAAC,GAAG,GAAG,IAAI,UAAU,CACtC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,GACzE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,8BAA8B,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,8BAA8B,CAAC,CAAC,CAAC,CAAC,CACpG,CAAC;AAEF,YAAY,EAAE,eAAe,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shim-types.js","sourceRoot":"","sources":["../src/internal/shim-types.ts"],"names":[],"mappings":";AAAA,sFAAsF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shim-types.mjs","sourceRoot":"","sources":["../src/internal/shim-types.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Fetch } from "./builtin-types.mjs";
|
|
2
|
+
import type { ReadableStream } from "./shim-types.mjs";
|
|
3
|
+
export declare function getDefaultFetch(): Fetch;
|
|
4
|
+
type ReadableStreamArgs = ConstructorParameters<typeof ReadableStream>;
|
|
5
|
+
export declare function makeReadableStream(...args: ReadableStreamArgs): ReadableStream;
|
|
6
|
+
export declare function ReadableStreamFrom<T>(iterable: Iterable<T> | AsyncIterable<T>): ReadableStream<T>;
|
|
7
|
+
/**
|
|
8
|
+
* Most browsers don't yet have async iterable support for ReadableStream,
|
|
9
|
+
* and Node has a very different way of reading bytes from its "ReadableStream".
|
|
10
|
+
*
|
|
11
|
+
* This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490
|
|
12
|
+
*/
|
|
13
|
+
export declare function ReadableStreamToAsyncIterable<T>(stream: any): AsyncIterableIterator<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Cancels a ReadableStream we don't need to consume.
|
|
16
|
+
* See https://undici.nodejs.org/#/?id=garbage-collection
|
|
17
|
+
*/
|
|
18
|
+
export declare function CancelReadableStream(stream: any): Promise<void>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=shims.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shims.d.mts","sourceRoot":"","sources":["../src/internal/shims.ts"],"names":[],"mappings":"OASO,KAAK,EAAE,KAAK,EAAE;OACd,KAAK,EAAE,cAAc,EAAE;AAE9B,wBAAgB,eAAe,IAAI,KAAK,CAQvC;AAED,KAAK,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,cAAc,CAAC,CAAC;AAEvE,wBAAgB,kBAAkB,CAAC,GAAG,IAAI,EAAE,kBAAkB,GAAG,cAAc,CAW9E;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAkBjG;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAyBtF;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAYrE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Fetch } from "./builtin-types.js";
|
|
2
|
+
import type { ReadableStream } from "./shim-types.js";
|
|
3
|
+
export declare function getDefaultFetch(): Fetch;
|
|
4
|
+
type ReadableStreamArgs = ConstructorParameters<typeof ReadableStream>;
|
|
5
|
+
export declare function makeReadableStream(...args: ReadableStreamArgs): ReadableStream;
|
|
6
|
+
export declare function ReadableStreamFrom<T>(iterable: Iterable<T> | AsyncIterable<T>): ReadableStream<T>;
|
|
7
|
+
/**
|
|
8
|
+
* Most browsers don't yet have async iterable support for ReadableStream,
|
|
9
|
+
* and Node has a very different way of reading bytes from its "ReadableStream".
|
|
10
|
+
*
|
|
11
|
+
* This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490
|
|
12
|
+
*/
|
|
13
|
+
export declare function ReadableStreamToAsyncIterable<T>(stream: any): AsyncIterableIterator<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Cancels a ReadableStream we don't need to consume.
|
|
16
|
+
* See https://undici.nodejs.org/#/?id=garbage-collection
|
|
17
|
+
*/
|
|
18
|
+
export declare function CancelReadableStream(stream: any): Promise<void>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=shims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shims.d.ts","sourceRoot":"","sources":["../src/internal/shims.ts"],"names":[],"mappings":"OASO,KAAK,EAAE,KAAK,EAAE;OACd,KAAK,EAAE,cAAc,EAAE;AAE9B,wBAAgB,eAAe,IAAI,KAAK,CAQvC;AAED,KAAK,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,cAAc,CAAC,CAAC;AAEvE,wBAAgB,kBAAkB,CAAC,GAAG,IAAI,EAAE,kBAAkB,GAAG,cAAc,CAW9E;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAkBjG;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAyBtF;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAYrE"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getDefaultFetch = getDefaultFetch;
|
|
5
|
+
exports.makeReadableStream = makeReadableStream;
|
|
6
|
+
exports.ReadableStreamFrom = ReadableStreamFrom;
|
|
7
|
+
exports.ReadableStreamToAsyncIterable = ReadableStreamToAsyncIterable;
|
|
8
|
+
exports.CancelReadableStream = CancelReadableStream;
|
|
9
|
+
function getDefaultFetch() {
|
|
10
|
+
if (typeof fetch !== 'undefined') {
|
|
11
|
+
return fetch;
|
|
12
|
+
}
|
|
13
|
+
throw new Error('`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`');
|
|
14
|
+
}
|
|
15
|
+
function makeReadableStream(...args) {
|
|
16
|
+
const ReadableStream = globalThis.ReadableStream;
|
|
17
|
+
if (typeof ReadableStream === 'undefined') {
|
|
18
|
+
// Note: All of the platforms / runtimes we officially support already define
|
|
19
|
+
// `ReadableStream` as a global, so this should only ever be hit on unsupported runtimes.
|
|
20
|
+
throw new Error('`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`');
|
|
21
|
+
}
|
|
22
|
+
return new ReadableStream(...args);
|
|
23
|
+
}
|
|
24
|
+
function ReadableStreamFrom(iterable) {
|
|
25
|
+
let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
|
|
26
|
+
return makeReadableStream({
|
|
27
|
+
start() { },
|
|
28
|
+
async pull(controller) {
|
|
29
|
+
const { done, value } = await iter.next();
|
|
30
|
+
if (done) {
|
|
31
|
+
controller.close();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
controller.enqueue(value);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
async cancel() {
|
|
38
|
+
await iter.return?.();
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Most browsers don't yet have async iterable support for ReadableStream,
|
|
44
|
+
* and Node has a very different way of reading bytes from its "ReadableStream".
|
|
45
|
+
*
|
|
46
|
+
* This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490
|
|
47
|
+
*/
|
|
48
|
+
function ReadableStreamToAsyncIterable(stream) {
|
|
49
|
+
if (stream[Symbol.asyncIterator])
|
|
50
|
+
return stream;
|
|
51
|
+
const reader = stream.getReader();
|
|
52
|
+
return {
|
|
53
|
+
async next() {
|
|
54
|
+
try {
|
|
55
|
+
const result = await reader.read();
|
|
56
|
+
if (result?.done)
|
|
57
|
+
reader.releaseLock(); // release lock when stream becomes closed
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
reader.releaseLock(); // release lock when stream becomes errored
|
|
62
|
+
throw e;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
async return() {
|
|
66
|
+
const cancelPromise = reader.cancel();
|
|
67
|
+
reader.releaseLock();
|
|
68
|
+
await cancelPromise;
|
|
69
|
+
return { done: true, value: undefined };
|
|
70
|
+
},
|
|
71
|
+
[Symbol.asyncIterator]() {
|
|
72
|
+
return this;
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Cancels a ReadableStream we don't need to consume.
|
|
78
|
+
* See https://undici.nodejs.org/#/?id=garbage-collection
|
|
79
|
+
*/
|
|
80
|
+
async function CancelReadableStream(stream) {
|
|
81
|
+
if (stream === null || typeof stream !== 'object')
|
|
82
|
+
return;
|
|
83
|
+
if (stream[Symbol.asyncIterator]) {
|
|
84
|
+
await stream[Symbol.asyncIterator]().return?.();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const reader = stream.getReader();
|
|
88
|
+
const cancelPromise = reader.cancel();
|
|
89
|
+
reader.releaseLock();
|
|
90
|
+
await cancelPromise;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=shims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shims.js","sourceRoot":"","sources":["../src/internal/shims.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAYtF,0CAQC;AAID,gDAWC;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MAAM,aAAa,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
export function getDefaultFetch() {
|
|
3
|
+
if (typeof fetch !== 'undefined') {
|
|
4
|
+
return fetch;
|
|
5
|
+
}
|
|
6
|
+
throw new Error('`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`');
|
|
7
|
+
}
|
|
8
|
+
export function makeReadableStream(...args) {
|
|
9
|
+
const ReadableStream = globalThis.ReadableStream;
|
|
10
|
+
if (typeof ReadableStream === 'undefined') {
|
|
11
|
+
// Note: All of the platforms / runtimes we officially support already define
|
|
12
|
+
// `ReadableStream` as a global, so this should only ever be hit on unsupported runtimes.
|
|
13
|
+
throw new Error('`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`');
|
|
14
|
+
}
|
|
15
|
+
return new ReadableStream(...args);
|
|
16
|
+
}
|
|
17
|
+
export function ReadableStreamFrom(iterable) {
|
|
18
|
+
let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
|
|
19
|
+
return makeReadableStream({
|
|
20
|
+
start() { },
|
|
21
|
+
async pull(controller) {
|
|
22
|
+
const { done, value } = await iter.next();
|
|
23
|
+
if (done) {
|
|
24
|
+
controller.close();
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
controller.enqueue(value);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
async cancel() {
|
|
31
|
+
await iter.return?.();
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Most browsers don't yet have async iterable support for ReadableStream,
|
|
37
|
+
* and Node has a very different way of reading bytes from its "ReadableStream".
|
|
38
|
+
*
|
|
39
|
+
* This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490
|
|
40
|
+
*/
|
|
41
|
+
export function ReadableStreamToAsyncIterable(stream) {
|
|
42
|
+
if (stream[Symbol.asyncIterator])
|
|
43
|
+
return stream;
|
|
44
|
+
const reader = stream.getReader();
|
|
45
|
+
return {
|
|
46
|
+
async next() {
|
|
47
|
+
try {
|
|
48
|
+
const result = await reader.read();
|
|
49
|
+
if (result?.done)
|
|
50
|
+
reader.releaseLock(); // release lock when stream becomes closed
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
reader.releaseLock(); // release lock when stream becomes errored
|
|
55
|
+
throw e;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
async return() {
|
|
59
|
+
const cancelPromise = reader.cancel();
|
|
60
|
+
reader.releaseLock();
|
|
61
|
+
await cancelPromise;
|
|
62
|
+
return { done: true, value: undefined };
|
|
63
|
+
},
|
|
64
|
+
[Symbol.asyncIterator]() {
|
|
65
|
+
return this;
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Cancels a ReadableStream we don't need to consume.
|
|
71
|
+
* See https://undici.nodejs.org/#/?id=garbage-collection
|
|
72
|
+
*/
|
|
73
|
+
export async function CancelReadableStream(stream) {
|
|
74
|
+
if (stream === null || typeof stream !== 'object')
|
|
75
|
+
return;
|
|
76
|
+
if (stream[Symbol.asyncIterator]) {
|
|
77
|
+
await stream[Symbol.asyncIterator]().return?.();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const reader = stream.getReader();
|
|
81
|
+
const cancelPromise = reader.cancel();
|
|
82
|
+
reader.releaseLock();
|
|
83
|
+
await cancelPromise;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=shims.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shims.mjs","sourceRoot":"","sources":["../src/internal/shims.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAYt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AC;AACtB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { FilePropertyBag } from "./builtin-types.mjs";
|
|
2
|
+
type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | DataView;
|
|
3
|
+
/**
|
|
4
|
+
* Intended to match DOM Blob, node-fetch Blob, node:buffer Blob, etc.
|
|
5
|
+
* Don't add arrayBuffer here, node-fetch doesn't have it
|
|
6
|
+
*/
|
|
7
|
+
interface BlobLike {
|
|
8
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
9
|
+
readonly size: number;
|
|
10
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
11
|
+
readonly type: string;
|
|
12
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
13
|
+
text(): Promise<string>;
|
|
14
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
15
|
+
slice(start?: number, end?: number): BlobLike;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Intended to match DOM File, node:buffer File, undici File, etc.
|
|
19
|
+
*/
|
|
20
|
+
interface FileLike extends BlobLike {
|
|
21
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
22
|
+
readonly lastModified: number;
|
|
23
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
24
|
+
readonly name?: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Intended to match DOM Response, node-fetch Response, undici Response, etc.
|
|
28
|
+
*/
|
|
29
|
+
export interface ResponseLike {
|
|
30
|
+
url: string;
|
|
31
|
+
blob(): Promise<BlobLike>;
|
|
32
|
+
}
|
|
33
|
+
export type ToFileInput = FileLike | ResponseLike | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
|
|
34
|
+
/**
|
|
35
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
36
|
+
* @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
|
|
37
|
+
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
38
|
+
* @param {Object=} options additional properties
|
|
39
|
+
* @param {string=} options.type the MIME type of the content
|
|
40
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
41
|
+
* @returns a {@link File} with the given properties
|
|
42
|
+
*/
|
|
43
|
+
export declare function toFile(value: ToFileInput | PromiseLike<ToFileInput>, name?: string | null | undefined, options?: FilePropertyBag | undefined): Promise<File>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=to-file.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-file.d.mts","sourceRoot":"","sources":["../src/internal/to-file.ts"],"names":[],"mappings":"OACO,KAAK,EAAE,eAAe,EAAE;AAG/B,KAAK,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjF;;;GAGG;AACH,UAAU,QAAQ;IAChB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,6EAA6E;IAC7E,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC/C;AAcD;;GAEG;AACH,UAAU,QAAS,SAAQ,QAAQ;IACjC,oFAAoF;IACpF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAYD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAQD,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,YAAY,GACZ,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAC7B,aAAa,CAAC,YAAY,CAAC,CAAC;AAEhC;;;;;;;;GAQG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,EAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,GACpC,OAAO,CAAC,IAAI,CAAC,CAiCf"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { FilePropertyBag } from "./builtin-types.js";
|
|
2
|
+
type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | DataView;
|
|
3
|
+
/**
|
|
4
|
+
* Intended to match DOM Blob, node-fetch Blob, node:buffer Blob, etc.
|
|
5
|
+
* Don't add arrayBuffer here, node-fetch doesn't have it
|
|
6
|
+
*/
|
|
7
|
+
interface BlobLike {
|
|
8
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
9
|
+
readonly size: number;
|
|
10
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
11
|
+
readonly type: string;
|
|
12
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
13
|
+
text(): Promise<string>;
|
|
14
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
15
|
+
slice(start?: number, end?: number): BlobLike;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Intended to match DOM File, node:buffer File, undici File, etc.
|
|
19
|
+
*/
|
|
20
|
+
interface FileLike extends BlobLike {
|
|
21
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
22
|
+
readonly lastModified: number;
|
|
23
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
24
|
+
readonly name?: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Intended to match DOM Response, node-fetch Response, undici Response, etc.
|
|
28
|
+
*/
|
|
29
|
+
export interface ResponseLike {
|
|
30
|
+
url: string;
|
|
31
|
+
blob(): Promise<BlobLike>;
|
|
32
|
+
}
|
|
33
|
+
export type ToFileInput = FileLike | ResponseLike | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
|
|
34
|
+
/**
|
|
35
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
36
|
+
* @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
|
|
37
|
+
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
38
|
+
* @param {Object=} options additional properties
|
|
39
|
+
* @param {string=} options.type the MIME type of the content
|
|
40
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
41
|
+
* @returns a {@link File} with the given properties
|
|
42
|
+
*/
|
|
43
|
+
export declare function toFile(value: ToFileInput | PromiseLike<ToFileInput>, name?: string | null | undefined, options?: FilePropertyBag | undefined): Promise<File>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=to-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-file.d.ts","sourceRoot":"","sources":["../src/internal/to-file.ts"],"names":[],"mappings":"OACO,KAAK,EAAE,eAAe,EAAE;AAG/B,KAAK,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjF;;;GAGG;AACH,UAAU,QAAQ;IAChB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,6EAA6E;IAC7E,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC/C;AAcD;;GAEG;AACH,UAAU,QAAS,SAAQ,QAAQ;IACjC,oFAAoF;IACpF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAYD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAQD,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,YAAY,GACZ,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAC7B,aAAa,CAAC,YAAY,CAAC,CAAC;AAEhC;;;;;;;;GAQG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,EAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,GACpC,OAAO,CAAC,IAAI,CAAC,CAiCf"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toFile = toFile;
|
|
4
|
+
const uploads_1 = require("./uploads.js");
|
|
5
|
+
const uploads_2 = require("./uploads.js");
|
|
6
|
+
/**
|
|
7
|
+
* This check adds the arrayBuffer() method type because it is available and used at runtime
|
|
8
|
+
*/
|
|
9
|
+
const isBlobLike = (value) => value != null &&
|
|
10
|
+
typeof value === 'object' &&
|
|
11
|
+
typeof value.size === 'number' &&
|
|
12
|
+
typeof value.type === 'string' &&
|
|
13
|
+
typeof value.text === 'function' &&
|
|
14
|
+
typeof value.slice === 'function' &&
|
|
15
|
+
typeof value.arrayBuffer === 'function';
|
|
16
|
+
/**
|
|
17
|
+
* This check adds the arrayBuffer() method type because it is available and used at runtime
|
|
18
|
+
*/
|
|
19
|
+
const isFileLike = (value) => value != null &&
|
|
20
|
+
typeof value === 'object' &&
|
|
21
|
+
typeof value.name === 'string' &&
|
|
22
|
+
typeof value.lastModified === 'number' &&
|
|
23
|
+
isBlobLike(value);
|
|
24
|
+
const isResponseLike = (value) => value != null &&
|
|
25
|
+
typeof value === 'object' &&
|
|
26
|
+
typeof value.url === 'string' &&
|
|
27
|
+
typeof value.blob === 'function';
|
|
28
|
+
/**
|
|
29
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
30
|
+
* @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
|
|
31
|
+
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
32
|
+
* @param {Object=} options additional properties
|
|
33
|
+
* @param {string=} options.type the MIME type of the content
|
|
34
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
35
|
+
* @returns a {@link File} with the given properties
|
|
36
|
+
*/
|
|
37
|
+
async function toFile(value, name, options) {
|
|
38
|
+
(0, uploads_2.checkFileSupport)();
|
|
39
|
+
// If it's a promise, resolve it.
|
|
40
|
+
value = await value;
|
|
41
|
+
// If we've been given a `File` we don't need to do anything
|
|
42
|
+
if (isFileLike(value)) {
|
|
43
|
+
if (value instanceof File) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
return (0, uploads_1.makeFile)([await value.arrayBuffer()], value.name);
|
|
47
|
+
}
|
|
48
|
+
if (isResponseLike(value)) {
|
|
49
|
+
const blob = await value.blob();
|
|
50
|
+
name || (name = new URL(value.url).pathname.split(/[\\/]/).pop());
|
|
51
|
+
return (0, uploads_1.makeFile)(await getBytes(blob), name, options);
|
|
52
|
+
}
|
|
53
|
+
const parts = await getBytes(value);
|
|
54
|
+
name || (name = (0, uploads_1.getName)(value));
|
|
55
|
+
if (!options?.type) {
|
|
56
|
+
const type = parts.find((part) => typeof part === 'object' && 'type' in part && part.type);
|
|
57
|
+
if (typeof type === 'string') {
|
|
58
|
+
options = { ...options, type };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return (0, uploads_1.makeFile)(parts, name, options);
|
|
62
|
+
}
|
|
63
|
+
async function getBytes(value) {
|
|
64
|
+
let parts = [];
|
|
65
|
+
if (typeof value === 'string' ||
|
|
66
|
+
ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.
|
|
67
|
+
value instanceof ArrayBuffer) {
|
|
68
|
+
parts.push(value);
|
|
69
|
+
}
|
|
70
|
+
else if (isBlobLike(value)) {
|
|
71
|
+
parts.push(value instanceof Blob ? value : await value.arrayBuffer());
|
|
72
|
+
}
|
|
73
|
+
else if ((0, uploads_1.isAsyncIterable)(value) // includes Readable, ReadableStream, etc.
|
|
74
|
+
) {
|
|
75
|
+
for await (const chunk of value) {
|
|
76
|
+
parts.push(...(await getBytes(chunk))); // TODO, consider validating?
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const constructor = value?.constructor?.name;
|
|
81
|
+
throw new Error(`Unexpected data type: ${typeof value}${constructor ? `; constructor: ${constructor}` : ''}${propsForError(value)}`);
|
|
82
|
+
}
|
|
83
|
+
return parts;
|
|
84
|
+
}
|
|
85
|
+
function propsForError(value) {
|
|
86
|
+
if (typeof value !== 'object' || value === null)
|
|
87
|
+
return '';
|
|
88
|
+
const props = Object.getOwnPropertyNames(value);
|
|
89
|
+
return `; props: [${props.map((p) => `"${p}"`).join(', ')}]`;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=to-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-file.js","sourceRoot":"","sources":["../src/internal/to-file.ts"],"names":[],"m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() method type because it is available and used at runtime
|
|
5
|
+
*/
|
|
6
|
+
const isBlobLike = (value) => value != null &&
|
|
7
|
+
typeof value === 'object' &&
|
|
8
|
+
typeof value.size === 'number' &&
|
|
9
|
+
typeof value.type === 'string' &&
|
|
10
|
+
typeof value.text === 'function' &&
|
|
11
|
+
typeof value.slice === 'function' &&
|
|
12
|
+
typeof value.arrayBuffer === 'function';
|
|
13
|
+
/**
|
|
14
|
+
* This check adds the arrayBuffer() method type because it is available and used at runtime
|
|
15
|
+
*/
|
|
16
|
+
const isFileLike = (value) => value != null &&
|
|
17
|
+
typeof value === 'object' &&
|
|
18
|
+
typeof value.name === 'string' &&
|
|
19
|
+
typeof value.lastModified === 'number' &&
|
|
20
|
+
isBlobLike(value);
|
|
21
|
+
const isResponseLike = (value) => value != null &&
|
|
22
|
+
typeof value === 'object' &&
|
|
23
|
+
typeof value.url === 'string' &&
|
|
24
|
+
typeof value.blob === 'function';
|
|
25
|
+
/**
|
|
26
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
27
|
+
* @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
|
|
28
|
+
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
29
|
+
* @param {Object=} options additional properties
|
|
30
|
+
* @param {string=} options.type the MIME type of the content
|
|
31
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
32
|
+
* @returns a {@link File} with the given properties
|
|
33
|
+
*/
|
|
34
|
+
export async function toFile(value, name, options) {
|
|
35
|
+
checkFileSupport();
|
|
36
|
+
// If it's a promise, resolve it.
|
|
37
|
+
value = await value;
|
|
38
|
+
// If we've been given a `File` we don't need to do anything
|
|
39
|
+
if (isFileLike(value)) {
|
|
40
|
+
if (value instanceof File) {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
return makeFile([await value.arrayBuffer()], value.name);
|
|
44
|
+
}
|
|
45
|
+
if (isResponseLike(value)) {
|
|
46
|
+
const blob = await value.blob();
|
|
47
|
+
name || (name = new URL(value.url).pathname.split(/[\\/]/).pop());
|
|
48
|
+
return makeFile(await getBytes(blob), name, options);
|
|
49
|
+
}
|
|
50
|
+
const parts = await getBytes(value);
|
|
51
|
+
name || (name = getName(value));
|
|
52
|
+
if (!options?.type) {
|
|
53
|
+
const type = parts.find((part) => typeof part === 'object' && 'type' in part && part.type);
|
|
54
|
+
if (typeof type === 'string') {
|
|
55
|
+
options = { ...options, type };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return makeFile(parts, name, options);
|
|
59
|
+
}
|
|
60
|
+
async function getBytes(value) {
|
|
61
|
+
let parts = [];
|
|
62
|
+
if (typeof value === 'string' ||
|
|
63
|
+
ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.
|
|
64
|
+
value instanceof ArrayBuffer) {
|
|
65
|
+
parts.push(value);
|
|
66
|
+
}
|
|
67
|
+
else if (isBlobLike(value)) {
|
|
68
|
+
parts.push(value instanceof Blob ? value : await value.arrayBuffer());
|
|
69
|
+
}
|
|
70
|
+
else if (isAsyncIterable(value) // includes Readable, ReadableStream, etc.
|
|
71
|
+
) {
|
|
72
|
+
for await (const chunk of value) {
|
|
73
|
+
parts.push(...(await getBytes(chunk))); // TODO, consider validating?
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
const constructor = value?.constructor?.name;
|
|
78
|
+
throw new Error(`Unexpected data type: ${typeof value}${constructor ? `; constructor: ${constructor}` : ''}${propsForError(value)}`);
|
|
79
|
+
}
|
|
80
|
+
return parts;
|
|
81
|
+
}
|
|
82
|
+
function propsForError(value) {
|
|
83
|
+
if (typeof value !== 'object' || value === null)
|
|
84
|
+
return '';
|
|
85
|
+
const props = Object.getOwnPropertyNames(value);
|
|
86
|
+
return `; props: [${props.map((p) => `"${p}"`).join(', ')}]`;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=to-file.mjs.map
|
|
@@ -0,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