openlayer 0.17.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +112 -60
- 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 +53 -0
- package/bin/migration-config.json +6 -0
- package/client.d.mts +186 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +186 -0
- package/client.d.ts.map +1 -0
- package/client.js +463 -0
- package/client.js.map +1 -0
- package/client.mjs +459 -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 +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.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/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 +1 -46
- package/error.d.ts.map +1 -1
- package/error.js +3 -110
- package/error.js.map +1 -1
- package/error.mjs +1 -96
- package/error.mjs.map +1 -1
- package/index.d.mts +6 -124
- package/index.d.mts.map +1 -0
- package/index.d.ts +5 -123
- package/index.d.ts.map +1 -1
- package/index.js +12 -140
- package/index.js.map +1 -1
- package/index.mjs +5 -103
- package/index.mjs.map +1 -1
- 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/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 +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -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 +1 -0
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/formats.js +4 -2
- package/internal/qs/formats.js.map +1 -1
- package/internal/qs/formats.mjs +2 -1
- package/internal/qs/formats.mjs.map +1 -1
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.js +15 -17
- package/internal/qs/stringify.js.map +1 -1
- package/internal/qs/stringify.mjs +17 -19
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.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 +1 -0
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.js +14 -13
- package/internal/qs/utils.js.map +1 -1
- package/internal/qs/utils.mjs +12 -12
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -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 +85 -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/lib/core/cli.d.mts +24 -0
- package/lib/core/cli.d.mts.map +1 -0
- package/lib/core/cli.js +3 -35
- package/lib/core/cli.js.map +1 -1
- package/lib/core/openai-monitor.d.mts +57 -0
- package/lib/core/openai-monitor.d.mts.map +1 -0
- package/lib/core/openai-monitor.d.ts.map +1 -1
- package/lib/core/openai-monitor.js +2 -4
- package/lib/core/openai-monitor.js.map +1 -1
- package/lib/integrations/bedrockAgentTracer.d.mts +3 -0
- package/lib/integrations/bedrockAgentTracer.d.mts.map +1 -0
- package/lib/integrations/bedrockAgentTracer.d.ts.map +1 -1
- package/lib/integrations/bedrockAgentTracer.js +2 -4
- package/lib/integrations/bedrockAgentTracer.js.map +1 -1
- package/lib/integrations/index.d.mts +5 -0
- package/lib/integrations/index.d.mts.map +1 -0
- package/lib/integrations/index.d.ts.map +1 -1
- package/lib/integrations/index.js +5 -18
- package/lib/integrations/index.js.map +1 -1
- package/lib/integrations/langchainCallback.d.mts +89 -0
- package/lib/integrations/langchainCallback.d.mts.map +1 -0
- package/lib/integrations/langchainCallback.d.ts.map +1 -1
- package/lib/integrations/openAiTracer.d.mts +3 -0
- package/lib/integrations/openAiTracer.d.mts.map +1 -0
- package/lib/integrations/openAiTracer.d.ts.map +1 -1
- package/lib/integrations/openAiTracer.js +2 -4
- package/lib/integrations/openAiTracer.js.map +1 -1
- package/lib/integrations/tracedTool.d.mts +66 -0
- package/lib/integrations/tracedTool.d.mts.map +1 -0
- package/lib/integrations/tracedTool.d.ts.map +1 -1
- package/lib/integrations/tracedTool.js +0 -1
- package/lib/integrations/tracedTool.js.map +1 -1
- package/lib/integrations/tracedTool.mjs +0 -1
- package/lib/integrations/tracedTool.mjs.map +1 -1
- package/lib/tracing/steps.d.mts +174 -0
- package/lib/tracing/steps.d.mts.map +1 -0
- package/lib/tracing/tracer.d.mts +94 -0
- package/lib/tracing/tracer.d.mts.map +1 -0
- package/lib/tracing/tracer.d.ts.map +1 -1
- package/lib/tracing/tracer.js +2 -4
- package/lib/tracing/tracer.js.map +1 -1
- package/lib/tracing/traces.d.mts +9 -0
- package/lib/tracing/traces.d.mts.map +1 -0
- package/lib/tracing/traces.d.ts.map +1 -1
- package/package.json +114 -65
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +1 -5
- package/resource.d.ts.map +1 -1
- package/resource.js +3 -8
- package/resource.js.map +1 -1
- package/resource.mjs +1 -6
- package/resource.mjs.map +1 -1
- package/resources/commits/commits.d.mts +139 -0
- package/resources/commits/commits.d.mts.map +1 -0
- package/resources/commits/commits.d.ts +4 -3
- package/resources/commits/commits.d.ts.map +1 -1
- package/resources/commits/commits.js +6 -37
- package/resources/commits/commits.js.map +1 -1
- package/resources/commits/commits.mjs +4 -3
- package/resources/commits/commits.mjs.map +1 -1
- package/resources/commits/index.d.mts +3 -0
- package/resources/commits/index.d.mts.map +1 -0
- package/resources/commits/index.d.ts.map +1 -1
- package/resources/commits/test-results.d.mts +214 -0
- package/resources/commits/test-results.d.mts.map +1 -0
- package/resources/commits/test-results.d.ts +4 -4
- package/resources/commits/test-results.d.ts.map +1 -1
- package/resources/commits/test-results.js +7 -7
- package/resources/commits/test-results.js.map +1 -1
- package/resources/commits/test-results.mjs +7 -7
- package/resources/commits/test-results.mjs.map +1 -1
- package/resources/commits.d.mts +2 -0
- package/resources/commits.d.mts.map +1 -0
- package/resources/commits.d.ts.map +1 -1
- package/resources/commits.js +2 -15
- package/resources/commits.js.map +1 -1
- package/resources/index.d.mts +5 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/inference-pipelines/data.d.mts +257 -0
- package/resources/inference-pipelines/data.d.mts.map +1 -0
- package/resources/inference-pipelines/data.d.ts +4 -3
- package/resources/inference-pipelines/data.d.ts.map +1 -1
- package/resources/inference-pipelines/data.js +7 -3
- package/resources/inference-pipelines/data.js.map +1 -1
- package/resources/inference-pipelines/data.mjs +7 -3
- package/resources/inference-pipelines/data.mjs.map +1 -1
- package/resources/inference-pipelines/index.d.mts +5 -0
- package/resources/inference-pipelines/index.d.mts.map +1 -0
- package/resources/inference-pipelines/index.d.ts.map +1 -1
- package/resources/inference-pipelines/inference-pipelines.d.mts +507 -0
- package/resources/inference-pipelines/inference-pipelines.d.mts.map +1 -0
- package/resources/inference-pipelines/inference-pipelines.d.ts +6 -7
- package/resources/inference-pipelines/inference-pipelines.d.ts.map +1 -1
- package/resources/inference-pipelines/inference-pipelines.js +36 -51
- package/resources/inference-pipelines/inference-pipelines.js.map +1 -1
- package/resources/inference-pipelines/inference-pipelines.mjs +32 -15
- package/resources/inference-pipelines/inference-pipelines.mjs.map +1 -1
- package/resources/inference-pipelines/rows.d.mts +65 -0
- package/resources/inference-pipelines/rows.d.mts.map +1 -0
- package/resources/inference-pipelines/rows.d.ts +4 -3
- package/resources/inference-pipelines/rows.d.ts.map +1 -1
- package/resources/inference-pipelines/rows.js +4 -3
- package/resources/inference-pipelines/rows.js.map +1 -1
- package/resources/inference-pipelines/rows.mjs +4 -3
- package/resources/inference-pipelines/rows.mjs.map +1 -1
- package/resources/inference-pipelines/test-results.d.mts +218 -0
- package/resources/inference-pipelines/test-results.d.mts.map +1 -0
- package/resources/inference-pipelines/test-results.d.ts +4 -4
- package/resources/inference-pipelines/test-results.d.ts.map +1 -1
- package/resources/inference-pipelines/test-results.js +15 -7
- package/resources/inference-pipelines/test-results.js.map +1 -1
- package/resources/inference-pipelines/test-results.mjs +15 -7
- package/resources/inference-pipelines/test-results.mjs.map +1 -1
- package/resources/inference-pipelines.d.mts +2 -0
- package/resources/inference-pipelines.d.mts.map +1 -0
- package/resources/inference-pipelines.d.ts.map +1 -1
- package/resources/inference-pipelines.js +2 -15
- package/resources/inference-pipelines.js.map +1 -1
- package/resources/projects/commits.d.mts +323 -0
- package/resources/projects/commits.d.mts.map +1 -0
- package/resources/projects/commits.d.ts +5 -5
- package/resources/projects/commits.d.ts.map +1 -1
- package/resources/projects/commits.js +16 -9
- package/resources/projects/commits.js.map +1 -1
- package/resources/projects/commits.mjs +16 -9
- package/resources/projects/commits.mjs.map +1 -1
- package/resources/projects/index.d.mts +5 -0
- package/resources/projects/index.d.mts.map +1 -0
- package/resources/projects/index.d.ts.map +1 -1
- package/resources/projects/inference-pipelines.d.mts +533 -0
- package/resources/projects/inference-pipelines.d.mts.map +1 -0
- package/resources/projects/inference-pipelines.d.ts +5 -5
- package/resources/projects/inference-pipelines.d.ts.map +1 -1
- package/resources/projects/inference-pipelines.js +17 -9
- package/resources/projects/inference-pipelines.js.map +1 -1
- package/resources/projects/inference-pipelines.mjs +17 -9
- package/resources/projects/inference-pipelines.mjs.map +1 -1
- package/resources/projects/projects.d.mts +249 -0
- package/resources/projects/projects.d.mts.map +1 -0
- package/resources/projects/projects.d.ts +5 -5
- package/resources/projects/projects.d.ts.map +1 -1
- package/resources/projects/projects.js +13 -41
- package/resources/projects/projects.js.map +1 -1
- package/resources/projects/projects.mjs +9 -5
- package/resources/projects/projects.mjs.map +1 -1
- package/resources/projects/tests.d.mts +501 -0
- package/resources/projects/tests.d.mts.map +1 -0
- package/resources/projects/tests.d.ts +6 -6
- package/resources/projects/tests.d.ts.map +1 -1
- package/resources/projects/tests.js +18 -11
- package/resources/projects/tests.js.map +1 -1
- package/resources/projects/tests.mjs +18 -11
- package/resources/projects/tests.mjs.map +1 -1
- package/resources/projects.d.mts +2 -0
- package/resources/projects.d.mts.map +1 -0
- package/resources/projects.d.ts.map +1 -1
- package/resources/projects.js +2 -15
- package/resources/projects.js.map +1 -1
- package/resources/storage/index.d.mts +3 -0
- package/resources/storage/index.d.mts.map +1 -0
- package/resources/storage/index.d.ts.map +1 -1
- package/resources/storage/presigned-url.d.mts +33 -0
- package/resources/storage/presigned-url.d.mts.map +1 -0
- package/resources/storage/presigned-url.d.ts +4 -3
- package/resources/storage/presigned-url.d.ts.map +1 -1
- package/resources/storage/presigned-url.js +1 -1
- package/resources/storage/presigned-url.js.map +1 -1
- package/resources/storage/presigned-url.mjs +1 -1
- package/resources/storage/presigned-url.mjs.map +1 -1
- package/resources/storage/storage.d.mts +10 -0
- package/resources/storage/storage.d.mts.map +1 -0
- package/resources/storage/storage.d.ts +1 -1
- package/resources/storage/storage.d.ts.map +1 -1
- package/resources/storage/storage.js +3 -35
- package/resources/storage/storage.js.map +1 -1
- package/resources/storage/storage.mjs +1 -1
- package/resources/storage.d.mts +2 -0
- package/resources/storage.d.mts.map +1 -0
- package/resources/storage.d.ts.map +1 -1
- package/resources/storage.js +2 -15
- package/resources/storage.js.map +1 -1
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts.map +1 -1
- package/resources.js +2 -15
- package/resources.js.map +1 -1
- package/src/api-promise.ts +2 -0
- package/src/client.ts +756 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -130
- package/src/index.ts +5 -233
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -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 +50 -0
- package/src/internal/qs/formats.ts +2 -1
- package/src/internal/qs/stringify.ts +17 -20
- package/src/internal/qs/utils.ts +14 -14
- package/src/internal/request-options.ts +91 -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/integrations/tracedTool.ts +0 -1
- package/src/resource.ts +2 -11
- package/src/resources/commits/commits.ts +6 -4
- package/src/resources/commits/test-results.ts +9 -17
- package/src/resources/inference-pipelines/data.ts +11 -6
- package/src/resources/inference-pipelines/inference-pipelines.ts +18 -40
- package/src/resources/inference-pipelines/rows.ts +8 -6
- package/src/resources/inference-pipelines/test-results.ts +9 -17
- package/src/resources/projects/commits.ts +13 -21
- package/src/resources/projects/inference-pipelines.ts +13 -21
- package/src/resources/projects/projects.ts +7 -12
- package/src/resources/projects/tests.ts +17 -25
- package/src/resources/storage/presigned-url.ts +4 -6
- package/src/resources/storage/storage.ts +1 -1
- package/src/tsconfig.json +2 -2
- package/src/uploads.ts +2 -256
- package/src/version.ts +1 -1
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +1 -74
- package/uploads.d.ts.map +1 -1
- package/uploads.js +3 -167
- package/uploads.js.map +1 -1
- package/uploads.mjs +1 -156
- package/uploads.mjs.map +1 -1
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/_shims/MultipartBody.d.ts +0 -9
- package/_shims/MultipartBody.d.ts.map +0 -1
- package/_shims/MultipartBody.js +0 -16
- package/_shims/MultipartBody.js.map +0 -1
- package/_shims/MultipartBody.mjs +0 -12
- package/_shims/MultipartBody.mjs.map +0 -1
- package/_shims/README.md +0 -46
- package/_shims/auto/runtime-bun.d.ts +0 -5
- package/_shims/auto/runtime-bun.d.ts.map +0 -1
- package/_shims/auto/runtime-bun.js +0 -21
- package/_shims/auto/runtime-bun.js.map +0 -1
- package/_shims/auto/runtime-bun.mjs +0 -2
- package/_shims/auto/runtime-bun.mjs.map +0 -1
- package/_shims/auto/runtime-node.d.ts +0 -5
- package/_shims/auto/runtime-node.d.ts.map +0 -1
- package/_shims/auto/runtime-node.js +0 -21
- package/_shims/auto/runtime-node.js.map +0 -1
- package/_shims/auto/runtime-node.mjs +0 -2
- package/_shims/auto/runtime-node.mjs.map +0 -1
- package/_shims/auto/runtime.d.ts +0 -5
- package/_shims/auto/runtime.d.ts.map +0 -1
- package/_shims/auto/runtime.js +0 -21
- package/_shims/auto/runtime.js.map +0 -1
- package/_shims/auto/runtime.mjs +0 -2
- package/_shims/auto/runtime.mjs.map +0 -1
- package/_shims/auto/types-node.d.ts +0 -5
- package/_shims/auto/types-node.d.ts.map +0 -1
- package/_shims/auto/types-node.js +0 -21
- package/_shims/auto/types-node.js.map +0 -1
- package/_shims/auto/types-node.mjs +0 -2
- package/_shims/auto/types-node.mjs.map +0 -1
- package/_shims/auto/types.d.ts +0 -101
- package/_shims/auto/types.js +0 -3
- package/_shims/auto/types.mjs +0 -3
- package/_shims/bun-runtime.d.ts +0 -6
- package/_shims/bun-runtime.d.ts.map +0 -1
- package/_shims/bun-runtime.js +0 -13
- package/_shims/bun-runtime.js.map +0 -1
- package/_shims/bun-runtime.mjs +0 -10
- package/_shims/bun-runtime.mjs.map +0 -1
- package/_shims/index.d.ts +0 -83
- package/_shims/index.js +0 -17
- package/_shims/index.mjs +0 -11
- package/_shims/manual-types.d.ts +0 -12
- package/_shims/manual-types.js +0 -3
- package/_shims/manual-types.mjs +0 -3
- package/_shims/node-runtime.d.ts +0 -3
- package/_shims/node-runtime.d.ts.map +0 -1
- package/_shims/node-runtime.js +0 -98
- package/_shims/node-runtime.js.map +0 -1
- package/_shims/node-runtime.mjs +0 -56
- package/_shims/node-runtime.mjs.map +0 -1
- package/_shims/node-types.d.ts +0 -42
- package/_shims/node-types.js +0 -3
- package/_shims/node-types.mjs +0 -3
- package/_shims/registry.d.ts +0 -37
- package/_shims/registry.d.ts.map +0 -1
- package/_shims/registry.js +0 -41
- package/_shims/registry.js.map +0 -1
- package/_shims/registry.mjs +0 -37
- package/_shims/registry.mjs.map +0 -1
- package/_shims/web-runtime.d.ts +0 -5
- package/_shims/web-runtime.d.ts.map +0 -1
- package/_shims/web-runtime.js +0 -77
- package/_shims/web-runtime.js.map +0 -1
- package/_shims/web-runtime.mjs +0 -71
- package/_shims/web-runtime.mjs.map +0 -1
- package/_shims/web-types.d.ts +0 -83
- package/_shims/web-types.js +0 -3
- package/_shims/web-types.mjs +0 -3
- package/core.d.ts +0 -253
- package/core.d.ts.map +0 -1
- package/core.js +0 -924
- package/core.js.map +0 -1
- package/core.mjs +0 -892
- package/core.mjs.map +0 -1
- package/shims/node.d.ts +0 -26
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js +0 -6
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -4
- package/shims/node.mjs.map +0 -1
- package/shims/web.d.ts +0 -26
- package/shims/web.d.ts.map +0 -1
- package/shims/web.js +0 -6
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -4
- package/shims/web.mjs.map +0 -1
- package/src/_shims/MultipartBody.ts +0 -9
- package/src/_shims/README.md +0 -46
- package/src/_shims/auto/runtime-bun.ts +0 -4
- package/src/_shims/auto/runtime-node.ts +0 -4
- package/src/_shims/auto/runtime.ts +0 -4
- package/src/_shims/auto/types-node.ts +0 -4
- package/src/_shims/auto/types.d.ts +0 -101
- package/src/_shims/auto/types.js +0 -3
- package/src/_shims/auto/types.mjs +0 -3
- package/src/_shims/bun-runtime.ts +0 -14
- package/src/_shims/index.d.ts +0 -83
- package/src/_shims/index.js +0 -17
- package/src/_shims/index.mjs +0 -11
- package/src/_shims/manual-types.d.ts +0 -12
- package/src/_shims/manual-types.js +0 -3
- package/src/_shims/manual-types.mjs +0 -3
- package/src/_shims/node-runtime.ts +0 -81
- package/src/_shims/node-types.d.ts +0 -42
- package/src/_shims/node-types.js +0 -3
- package/src/_shims/node-types.mjs +0 -3
- package/src/_shims/registry.ts +0 -67
- package/src/_shims/web-runtime.ts +0 -103
- package/src/_shims/web-types.d.ts +0 -83
- package/src/_shims/web-types.js +0 -3
- package/src/_shims/web-types.mjs +0 -3
- package/src/core.ts +0 -1236
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
5
7
|
|
|
6
8
|
export class Rows extends APIResource {
|
|
7
9
|
/**
|
|
@@ -16,12 +18,12 @@ export class Rows extends APIResource {
|
|
|
16
18
|
* ```
|
|
17
19
|
*/
|
|
18
20
|
update(
|
|
19
|
-
|
|
21
|
+
inferencePipelineID: string,
|
|
20
22
|
params: RowUpdateParams,
|
|
21
|
-
options?:
|
|
22
|
-
):
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): APIPromise<RowUpdateResponse> {
|
|
23
25
|
const { inferenceId, ...body } = params;
|
|
24
|
-
return this._client.put(`/inference-pipelines/${
|
|
26
|
+
return this._client.put(path`/inference-pipelines/${inferencePipelineID}/rows`, {
|
|
25
27
|
query: { inferenceId },
|
|
26
28
|
body,
|
|
27
29
|
...options,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
6
7
|
|
|
7
8
|
export class TestResults extends APIResource {
|
|
8
9
|
/**
|
|
@@ -17,20 +18,11 @@ export class TestResults extends APIResource {
|
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
20
|
list(
|
|
20
|
-
|
|
21
|
-
query
|
|
22
|
-
options?:
|
|
23
|
-
):
|
|
24
|
-
|
|
25
|
-
list(
|
|
26
|
-
inferencePipelineId: string,
|
|
27
|
-
query: TestResultListParams | Core.RequestOptions = {},
|
|
28
|
-
options?: Core.RequestOptions,
|
|
29
|
-
): Core.APIPromise<TestResultListResponse> {
|
|
30
|
-
if (isRequestOptions(query)) {
|
|
31
|
-
return this.list(inferencePipelineId, {}, query);
|
|
32
|
-
}
|
|
33
|
-
return this._client.get(`/inference-pipelines/${inferencePipelineId}/results`, { query, ...options });
|
|
21
|
+
inferencePipelineID: string,
|
|
22
|
+
query: TestResultListParams | null | undefined = {},
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): APIPromise<TestResultListResponse> {
|
|
25
|
+
return this._client.get(path`/inference-pipelines/${inferencePipelineID}/results`, { query, ...options });
|
|
34
26
|
}
|
|
35
27
|
}
|
|
36
28
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
6
7
|
|
|
7
8
|
export class Commits extends APIResource {
|
|
8
9
|
/**
|
|
@@ -20,11 +21,11 @@ export class Commits extends APIResource {
|
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
23
|
create(
|
|
23
|
-
|
|
24
|
+
projectID: string,
|
|
24
25
|
body: CommitCreateParams,
|
|
25
|
-
options?:
|
|
26
|
-
):
|
|
27
|
-
return this._client.post(`/projects/${
|
|
26
|
+
options?: RequestOptions,
|
|
27
|
+
): APIPromise<CommitCreateResponse> {
|
|
28
|
+
return this._client.post(path`/projects/${projectID}/versions`, { body, ...options });
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
/**
|
|
@@ -38,20 +39,11 @@ export class Commits extends APIResource {
|
|
|
38
39
|
* ```
|
|
39
40
|
*/
|
|
40
41
|
list(
|
|
41
|
-
|
|
42
|
-
query
|
|
43
|
-
options?:
|
|
44
|
-
):
|
|
45
|
-
|
|
46
|
-
list(
|
|
47
|
-
projectId: string,
|
|
48
|
-
query: CommitListParams | Core.RequestOptions = {},
|
|
49
|
-
options?: Core.RequestOptions,
|
|
50
|
-
): Core.APIPromise<CommitListResponse> {
|
|
51
|
-
if (isRequestOptions(query)) {
|
|
52
|
-
return this.list(projectId, {}, query);
|
|
53
|
-
}
|
|
54
|
-
return this._client.get(`/projects/${projectId}/versions`, { query, ...options });
|
|
42
|
+
projectID: string,
|
|
43
|
+
query: CommitListParams | null | undefined = {},
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): APIPromise<CommitListResponse> {
|
|
46
|
+
return this._client.get(path`/projects/${projectID}/versions`, { query, ...options });
|
|
55
47
|
}
|
|
56
48
|
}
|
|
57
49
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
6
7
|
|
|
7
8
|
export class InferencePipelines extends APIResource {
|
|
8
9
|
/**
|
|
@@ -21,11 +22,11 @@ export class InferencePipelines extends APIResource {
|
|
|
21
22
|
* ```
|
|
22
23
|
*/
|
|
23
24
|
create(
|
|
24
|
-
|
|
25
|
+
projectID: string,
|
|
25
26
|
body: InferencePipelineCreateParams,
|
|
26
|
-
options?:
|
|
27
|
-
):
|
|
28
|
-
return this._client.post(`/projects/${
|
|
27
|
+
options?: RequestOptions,
|
|
28
|
+
): APIPromise<InferencePipelineCreateResponse> {
|
|
29
|
+
return this._client.post(path`/projects/${projectID}/inference-pipelines`, { body, ...options });
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
/**
|
|
@@ -40,20 +41,11 @@ export class InferencePipelines extends APIResource {
|
|
|
40
41
|
* ```
|
|
41
42
|
*/
|
|
42
43
|
list(
|
|
43
|
-
|
|
44
|
-
query
|
|
45
|
-
options?:
|
|
46
|
-
):
|
|
47
|
-
|
|
48
|
-
list(
|
|
49
|
-
projectId: string,
|
|
50
|
-
query: InferencePipelineListParams | Core.RequestOptions = {},
|
|
51
|
-
options?: Core.RequestOptions,
|
|
52
|
-
): Core.APIPromise<InferencePipelineListResponse> {
|
|
53
|
-
if (isRequestOptions(query)) {
|
|
54
|
-
return this.list(projectId, {}, query);
|
|
55
|
-
}
|
|
56
|
-
return this._client.get(`/projects/${projectId}/inference-pipelines`, { query, ...options });
|
|
44
|
+
projectID: string,
|
|
45
|
+
query: InferencePipelineListParams | null | undefined = {},
|
|
46
|
+
options?: RequestOptions,
|
|
47
|
+
): APIPromise<InferencePipelineListResponse> {
|
|
48
|
+
return this._client.get(path`/projects/${projectID}/inference-pipelines`, { query, ...options });
|
|
57
49
|
}
|
|
58
50
|
}
|
|
59
51
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import { isRequestOptions } from '../../core';
|
|
5
|
-
import * as Core from '../../core';
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
6
4
|
import * as CommitsAPI from './commits';
|
|
7
5
|
import {
|
|
8
6
|
CommitCreateParams,
|
|
@@ -29,6 +27,8 @@ import {
|
|
|
29
27
|
TestUpdateResponse,
|
|
30
28
|
Tests,
|
|
31
29
|
} from './tests';
|
|
30
|
+
import { APIPromise } from '../../core/api-promise';
|
|
31
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
32
32
|
|
|
33
33
|
export class Projects extends APIResource {
|
|
34
34
|
commits: CommitsAPI.Commits = new CommitsAPI.Commits(this._client);
|
|
@@ -48,7 +48,7 @@ export class Projects extends APIResource {
|
|
|
48
48
|
* });
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
create(body: ProjectCreateParams, options?:
|
|
51
|
+
create(body: ProjectCreateParams, options?: RequestOptions): APIPromise<ProjectCreateResponse> {
|
|
52
52
|
return this._client.post('/projects', { body, ...options });
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -60,15 +60,10 @@ export class Projects extends APIResource {
|
|
|
60
60
|
* const projects = await client.projects.list();
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
|
-
list(query?: ProjectListParams, options?: Core.RequestOptions): Core.APIPromise<ProjectListResponse>;
|
|
64
|
-
list(options?: Core.RequestOptions): Core.APIPromise<ProjectListResponse>;
|
|
65
63
|
list(
|
|
66
|
-
query: ProjectListParams |
|
|
67
|
-
options?:
|
|
68
|
-
):
|
|
69
|
-
if (isRequestOptions(query)) {
|
|
70
|
-
return this.list({}, query);
|
|
71
|
-
}
|
|
64
|
+
query: ProjectListParams | null | undefined = {},
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): APIPromise<ProjectListResponse> {
|
|
72
67
|
return this._client.get('/projects', { query, ...options });
|
|
73
68
|
}
|
|
74
69
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
6
7
|
|
|
7
8
|
export class Tests extends APIResource {
|
|
8
9
|
/**
|
|
@@ -24,11 +25,11 @@ export class Tests extends APIResource {
|
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
27
|
create(
|
|
27
|
-
|
|
28
|
+
projectID: string,
|
|
28
29
|
body: TestCreateParams,
|
|
29
|
-
options?:
|
|
30
|
-
):
|
|
31
|
-
return this._client.post(`/projects/${
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): APIPromise<TestCreateResponse> {
|
|
32
|
+
return this._client.post(path`/projects/${projectID}/tests`, { body, ...options });
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
/**
|
|
@@ -47,11 +48,11 @@ export class Tests extends APIResource {
|
|
|
47
48
|
* ```
|
|
48
49
|
*/
|
|
49
50
|
update(
|
|
50
|
-
|
|
51
|
+
projectID: string,
|
|
51
52
|
body: TestUpdateParams,
|
|
52
|
-
options?:
|
|
53
|
-
):
|
|
54
|
-
return this._client.put(`/projects/${
|
|
53
|
+
options?: RequestOptions,
|
|
54
|
+
): APIPromise<TestUpdateResponse> {
|
|
55
|
+
return this._client.put(path`/projects/${projectID}/tests`, { body, ...options });
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
/**
|
|
@@ -65,20 +66,11 @@ export class Tests extends APIResource {
|
|
|
65
66
|
* ```
|
|
66
67
|
*/
|
|
67
68
|
list(
|
|
68
|
-
|
|
69
|
-
query
|
|
70
|
-
options?:
|
|
71
|
-
):
|
|
72
|
-
|
|
73
|
-
list(
|
|
74
|
-
projectId: string,
|
|
75
|
-
query: TestListParams | Core.RequestOptions = {},
|
|
76
|
-
options?: Core.RequestOptions,
|
|
77
|
-
): Core.APIPromise<TestListResponse> {
|
|
78
|
-
if (isRequestOptions(query)) {
|
|
79
|
-
return this.list(projectId, {}, query);
|
|
80
|
-
}
|
|
81
|
-
return this._client.get(`/projects/${projectId}/tests`, { query, ...options });
|
|
69
|
+
projectID: string,
|
|
70
|
+
query: TestListParams | null | undefined = {},
|
|
71
|
+
options?: RequestOptions,
|
|
72
|
+
): APIPromise<TestListResponse> {
|
|
73
|
+
return this._client.get(path`/projects/${projectID}/tests`, { query, ...options });
|
|
82
74
|
}
|
|
83
75
|
}
|
|
84
76
|
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
5
6
|
|
|
6
7
|
export class PresignedURL extends APIResource {
|
|
7
8
|
/**
|
|
8
9
|
* Retrieve a presigned url to post storage artifacts.
|
|
9
10
|
*/
|
|
10
|
-
create(
|
|
11
|
-
params: PresignedURLCreateParams,
|
|
12
|
-
options?: Core.RequestOptions,
|
|
13
|
-
): Core.APIPromise<PresignedURLCreateResponse> {
|
|
11
|
+
create(params: PresignedURLCreateParams, options?: RequestOptions): APIPromise<PresignedURLCreateResponse> {
|
|
14
12
|
const { objectName } = params;
|
|
15
13
|
return this._client.post('/storage/presigned-url', { query: { objectName }, ...options });
|
|
16
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as PresignedURLAPI from './presigned-url';
|
|
5
5
|
import { PresignedURL, PresignedURLCreateParams, PresignedURLCreateResponse } from './presigned-url';
|
|
6
6
|
|
package/src/tsconfig.json
CHANGED
package/src/uploads.ts
CHANGED
|
@@ -1,256 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
FormData,
|
|
4
|
-
File,
|
|
5
|
-
type Blob,
|
|
6
|
-
type FilePropertyBag,
|
|
7
|
-
getMultipartRequestOptions,
|
|
8
|
-
type FsReadStream,
|
|
9
|
-
isFsReadStream,
|
|
10
|
-
} from './_shims/index';
|
|
11
|
-
import { MultipartBody } from './_shims/MultipartBody';
|
|
12
|
-
export { fileFromPath } from './_shims/index';
|
|
13
|
-
|
|
14
|
-
type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | Uint8Array | DataView;
|
|
15
|
-
export type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob | Uint8Array | DataView;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Typically, this is a native "File" class.
|
|
19
|
-
*
|
|
20
|
-
* We provide the {@link toFile} utility to convert a variety of objects
|
|
21
|
-
* into the File class.
|
|
22
|
-
*
|
|
23
|
-
* For convenience, you can also pass a fetch Response, or in Node,
|
|
24
|
-
* the result of fs.createReadStream().
|
|
25
|
-
*/
|
|
26
|
-
export type Uploadable = FileLike | ResponseLike | FsReadStream;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Intended to match web.Blob, node.Blob, node-fetch.Blob, etc.
|
|
30
|
-
*/
|
|
31
|
-
export interface BlobLike {
|
|
32
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
33
|
-
readonly size: number;
|
|
34
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
35
|
-
readonly type: string;
|
|
36
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
37
|
-
text(): Promise<string>;
|
|
38
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
39
|
-
slice(start?: number, end?: number): BlobLike;
|
|
40
|
-
// unfortunately @types/node-fetch@^2.6.4 doesn't type the arrayBuffer method
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Intended to match web.File, node.File, node-fetch.File, etc.
|
|
45
|
-
*/
|
|
46
|
-
export interface FileLike extends BlobLike {
|
|
47
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
48
|
-
readonly lastModified: number;
|
|
49
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
50
|
-
readonly name: string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Intended to match web.Response, node.Response, node-fetch.Response, etc.
|
|
55
|
-
*/
|
|
56
|
-
export interface ResponseLike {
|
|
57
|
-
url: string;
|
|
58
|
-
blob(): Promise<BlobLike>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export const isResponseLike = (value: any): value is ResponseLike =>
|
|
62
|
-
value != null &&
|
|
63
|
-
typeof value === 'object' &&
|
|
64
|
-
typeof value.url === 'string' &&
|
|
65
|
-
typeof value.blob === 'function';
|
|
66
|
-
|
|
67
|
-
export const isFileLike = (value: any): value is FileLike =>
|
|
68
|
-
value != null &&
|
|
69
|
-
typeof value === 'object' &&
|
|
70
|
-
typeof value.name === 'string' &&
|
|
71
|
-
typeof value.lastModified === 'number' &&
|
|
72
|
-
isBlobLike(value);
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* The BlobLike type omits arrayBuffer() because @types/node-fetch@^2.6.4 lacks it; but this check
|
|
76
|
-
* adds the arrayBuffer() method type because it is available and used at runtime
|
|
77
|
-
*/
|
|
78
|
-
export const isBlobLike = (value: any): value is BlobLike & { arrayBuffer(): Promise<ArrayBuffer> } =>
|
|
79
|
-
value != null &&
|
|
80
|
-
typeof value === 'object' &&
|
|
81
|
-
typeof value.size === 'number' &&
|
|
82
|
-
typeof value.type === 'string' &&
|
|
83
|
-
typeof value.text === 'function' &&
|
|
84
|
-
typeof value.slice === 'function' &&
|
|
85
|
-
typeof value.arrayBuffer === 'function';
|
|
86
|
-
|
|
87
|
-
export const isUploadable = (value: any): value is Uploadable => {
|
|
88
|
-
return isFileLike(value) || isResponseLike(value) || isFsReadStream(value);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export type ToFileInput = Uploadable | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
95
|
-
* @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobLikePart}, or {@link AsyncIterable} of {@link BlobLikePart}s
|
|
96
|
-
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
97
|
-
* @param {Object=} options additional properties
|
|
98
|
-
* @param {string=} options.type the MIME type of the content
|
|
99
|
-
* @param {number=} options.lastModified the last modified timestamp
|
|
100
|
-
* @returns a {@link File} with the given properties
|
|
101
|
-
*/
|
|
102
|
-
export async function toFile(
|
|
103
|
-
value: ToFileInput | PromiseLike<ToFileInput>,
|
|
104
|
-
name?: string | null | undefined,
|
|
105
|
-
options?: FilePropertyBag | undefined,
|
|
106
|
-
): Promise<FileLike> {
|
|
107
|
-
// If it's a promise, resolve it.
|
|
108
|
-
value = await value;
|
|
109
|
-
|
|
110
|
-
// If we've been given a `File` we don't need to do anything
|
|
111
|
-
if (isFileLike(value)) {
|
|
112
|
-
return value;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (isResponseLike(value)) {
|
|
116
|
-
const blob = await value.blob();
|
|
117
|
-
name ||= new URL(value.url).pathname.split(/[\\/]/).pop() ?? 'unknown_file';
|
|
118
|
-
|
|
119
|
-
// we need to convert the `Blob` into an array buffer because the `Blob` class
|
|
120
|
-
// that `node-fetch` defines is incompatible with the web standard which results
|
|
121
|
-
// in `new File` interpreting it as a string instead of binary data.
|
|
122
|
-
const data = isBlobLike(blob) ? [(await blob.arrayBuffer()) as any] : [blob];
|
|
123
|
-
|
|
124
|
-
return new File(data, name, options);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const bits = await getBytes(value);
|
|
128
|
-
|
|
129
|
-
name ||= getName(value) ?? 'unknown_file';
|
|
130
|
-
|
|
131
|
-
if (!options?.type) {
|
|
132
|
-
const type = (bits[0] as any)?.type;
|
|
133
|
-
if (typeof type === 'string') {
|
|
134
|
-
options = { ...options, type };
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return new File(bits, name, options);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
async function getBytes(value: ToFileInput): Promise<Array<BlobPart>> {
|
|
142
|
-
let parts: Array<BlobPart> = [];
|
|
143
|
-
if (
|
|
144
|
-
typeof value === 'string' ||
|
|
145
|
-
ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.
|
|
146
|
-
value instanceof ArrayBuffer
|
|
147
|
-
) {
|
|
148
|
-
parts.push(value);
|
|
149
|
-
} else if (isBlobLike(value)) {
|
|
150
|
-
parts.push(await value.arrayBuffer());
|
|
151
|
-
} else if (
|
|
152
|
-
isAsyncIterableIterator(value) // includes Readable, ReadableStream, etc.
|
|
153
|
-
) {
|
|
154
|
-
for await (const chunk of value) {
|
|
155
|
-
parts.push(chunk as BlobPart); // TODO, consider validating?
|
|
156
|
-
}
|
|
157
|
-
} else {
|
|
158
|
-
throw new Error(
|
|
159
|
-
`Unexpected data type: ${typeof value}; constructor: ${
|
|
160
|
-
value?.constructor?.name
|
|
161
|
-
}; props: ${propsForError(value)}`,
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return parts;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function propsForError(value: any): string {
|
|
169
|
-
const props = Object.getOwnPropertyNames(value);
|
|
170
|
-
return `[${props.map((p) => `"${p}"`).join(', ')}]`;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function getName(value: any): string | undefined {
|
|
174
|
-
return (
|
|
175
|
-
getStringFromMaybeBuffer(value.name) ||
|
|
176
|
-
getStringFromMaybeBuffer(value.filename) ||
|
|
177
|
-
// For fs.ReadStream
|
|
178
|
-
getStringFromMaybeBuffer(value.path)?.split(/[\\/]/).pop()
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const getStringFromMaybeBuffer = (x: string | Buffer | unknown): string | undefined => {
|
|
183
|
-
if (typeof x === 'string') return x;
|
|
184
|
-
if (typeof Buffer !== 'undefined' && x instanceof Buffer) return String(x);
|
|
185
|
-
return undefined;
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
const isAsyncIterableIterator = (value: any): value is AsyncIterableIterator<unknown> =>
|
|
189
|
-
value != null && typeof value === 'object' && typeof value[Symbol.asyncIterator] === 'function';
|
|
190
|
-
|
|
191
|
-
export const isMultipartBody = (body: any): body is MultipartBody =>
|
|
192
|
-
body && typeof body === 'object' && body.body && body[Symbol.toStringTag] === 'MultipartBody';
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.
|
|
196
|
-
* Otherwise returns the request as is.
|
|
197
|
-
*/
|
|
198
|
-
export const maybeMultipartFormRequestOptions = async <T = Record<string, unknown>>(
|
|
199
|
-
opts: RequestOptions<T>,
|
|
200
|
-
): Promise<RequestOptions<T | MultipartBody>> => {
|
|
201
|
-
if (!hasUploadableValue(opts.body)) return opts;
|
|
202
|
-
|
|
203
|
-
const form = await createForm(opts.body);
|
|
204
|
-
return getMultipartRequestOptions(form, opts);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
export const multipartFormRequestOptions = async <T = Record<string, unknown>>(
|
|
208
|
-
opts: RequestOptions<T>,
|
|
209
|
-
): Promise<RequestOptions<T | MultipartBody>> => {
|
|
210
|
-
const form = await createForm(opts.body);
|
|
211
|
-
return getMultipartRequestOptions(form, opts);
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
export const createForm = async <T = Record<string, unknown>>(body: T | undefined): Promise<FormData> => {
|
|
215
|
-
const form = new FormData();
|
|
216
|
-
await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue(form, key, value)));
|
|
217
|
-
return form;
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
const hasUploadableValue = (value: unknown): boolean => {
|
|
221
|
-
if (isUploadable(value)) return true;
|
|
222
|
-
if (Array.isArray(value)) return value.some(hasUploadableValue);
|
|
223
|
-
if (value && typeof value === 'object') {
|
|
224
|
-
for (const k in value) {
|
|
225
|
-
if (hasUploadableValue((value as any)[k])) return true;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return false;
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
const addFormValue = async (form: FormData, key: string, value: unknown): Promise<void> => {
|
|
232
|
-
if (value === undefined) return;
|
|
233
|
-
if (value == null) {
|
|
234
|
-
throw new TypeError(
|
|
235
|
-
`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`,
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// TODO: make nested formats configurable
|
|
240
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
241
|
-
form.append(key, String(value));
|
|
242
|
-
} else if (isUploadable(value)) {
|
|
243
|
-
const file = await toFile(value);
|
|
244
|
-
form.append(key, file as File);
|
|
245
|
-
} else if (Array.isArray(value)) {
|
|
246
|
-
await Promise.all(value.map((entry) => addFormValue(form, key + '[]', entry)));
|
|
247
|
-
} else if (typeof value === 'object') {
|
|
248
|
-
await Promise.all(
|
|
249
|
-
Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop)),
|
|
250
|
-
);
|
|
251
|
-
} else {
|
|
252
|
-
throw new TypeError(
|
|
253
|
-
`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`,
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
};
|
|
1
|
+
/** @deprecated Import from ./core/uploads instead */
|
|
2
|
+
export * from './core/uploads';
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.18.0'; // x-release-please-version
|
package/uploads.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
|