@mixedbread/sdk 0.3.0 → 0.5.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 +51 -0
- package/README.md +110 -37
- 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 +52 -0
- package/bin/migration-config.json +73 -0
- package/client.d.mts +261 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +261 -0
- package/client.d.ts.map +1 -0
- package/client.js +535 -0
- package/client.js.map +1 -0
- package/client.mjs +531 -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/pagination.d.mts +66 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +66 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +110 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +104 -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/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 +7 -169
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -168
- package/index.d.ts.map +1 -1
- package/index.js +14 -157
- package/index.js.map +1 -1
- package/index.mjs +6 -130
- 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/request-options.d.mts +32 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +32 -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 +28 -0
- package/internal/shim-types.d.ts +28 -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 +67 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +67 -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 +58 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +53 -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 +16 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +16 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +109 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +92 -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/polling.d.mts +48 -0
- package/lib/polling.d.mts.map +1 -0
- package/lib/polling.d.ts.map +1 -1
- package/lib/polling.js +1 -3
- package/lib/polling.js.map +1 -1
- package/lib/polling.mjs +0 -1
- package/lib/polling.mjs.map +1 -1
- package/package.json +129 -64
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +1 -29
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -42
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -40
- package/pagination.mjs.map +1 -1
- 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/embeddings.d.mts +55 -0
- package/resources/embeddings.d.mts.map +1 -0
- package/resources/embeddings.d.ts +13 -3
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/embeddings.js +10 -1
- package/resources/embeddings.js.map +1 -1
- package/resources/embeddings.mjs +10 -1
- package/resources/embeddings.mjs.map +1 -1
- package/resources/extractions/content.d.mts +80 -0
- package/resources/extractions/content.d.mts.map +1 -0
- package/resources/extractions/content.d.ts +51 -4
- package/resources/extractions/content.d.ts.map +1 -1
- package/resources/extractions/content.js +1 -1
- package/resources/extractions/content.js.map +1 -1
- package/resources/extractions/content.mjs +1 -1
- package/resources/extractions/content.mjs.map +1 -1
- package/resources/extractions/extractions.d.mts +18 -0
- package/resources/extractions/extractions.d.mts.map +1 -0
- package/resources/extractions/extractions.d.ts +1 -1
- package/resources/extractions/extractions.d.ts.map +1 -1
- package/resources/extractions/extractions.js +5 -27
- package/resources/extractions/extractions.js.map +1 -1
- package/resources/extractions/extractions.mjs +1 -1
- package/resources/extractions/index.d.mts +5 -0
- package/resources/extractions/index.d.mts.map +1 -0
- package/resources/extractions/index.d.ts.map +1 -1
- package/resources/extractions/jobs.d.mts +85 -0
- package/resources/extractions/jobs.d.mts.map +1 -0
- package/resources/extractions/jobs.d.ts +5 -4
- package/resources/extractions/jobs.d.ts.map +1 -1
- package/resources/extractions/jobs.js +4 -3
- package/resources/extractions/jobs.js.map +1 -1
- package/resources/extractions/jobs.mjs +4 -3
- package/resources/extractions/jobs.mjs.map +1 -1
- package/resources/extractions/schema.d.mts +86 -0
- package/resources/extractions/schema.d.mts.map +1 -0
- package/resources/extractions/schema.d.ts +6 -5
- package/resources/extractions/schema.d.ts.map +1 -1
- package/resources/extractions/schema.js +1 -1
- package/resources/extractions/schema.js.map +1 -1
- package/resources/extractions/schema.mjs +1 -1
- package/resources/extractions/schema.mjs.map +1 -1
- package/resources/extractions.d.mts +2 -0
- package/resources/extractions.d.mts.map +1 -0
- package/resources/extractions.d.ts.map +1 -1
- package/resources/extractions.js +2 -15
- package/resources/extractions.js.map +1 -1
- package/resources/files.d.mts +124 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +15 -16
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +24 -46
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +23 -21
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +8 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -18
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/resources/parsing/index.d.mts +3 -0
- package/resources/parsing/index.d.mts.map +1 -0
- package/resources/parsing/index.d.ts +1 -1
- package/resources/parsing/index.d.ts.map +1 -1
- package/resources/parsing/index.js +1 -2
- package/resources/parsing/index.js.map +1 -1
- package/resources/parsing/index.mjs +1 -1
- package/resources/parsing/index.mjs.map +1 -1
- package/resources/parsing/jobs.d.mts +293 -0
- package/resources/parsing/jobs.d.mts.map +1 -0
- package/resources/parsing/jobs.d.ts +21 -18
- package/resources/parsing/jobs.d.ts.map +1 -1
- package/resources/parsing/jobs.js +20 -42
- package/resources/parsing/jobs.js.map +1 -1
- package/resources/parsing/jobs.mjs +17 -16
- package/resources/parsing/jobs.mjs.map +1 -1
- package/resources/parsing/parsing.d.mts +10 -0
- package/resources/parsing/parsing.d.mts.map +1 -0
- package/resources/parsing/parsing.d.ts +2 -2
- package/resources/parsing/parsing.d.ts.map +1 -1
- package/resources/parsing/parsing.js +3 -26
- package/resources/parsing/parsing.js.map +1 -1
- package/resources/parsing/parsing.mjs +2 -3
- package/resources/parsing/parsing.mjs.map +1 -1
- package/resources/parsing.d.mts +2 -0
- package/resources/parsing.d.mts.map +1 -0
- package/resources/parsing.d.ts.map +1 -1
- package/resources/parsing.js +2 -15
- package/resources/parsing.js.map +1 -1
- package/resources/shared.d.mts +49 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/top-level.d.mts +188 -0
- package/resources/top-level.d.mts.map +1 -0
- package/resources/top-level.d.ts +6 -2
- package/resources/top-level.d.ts.map +1 -1
- package/resources/vector-stores/files.d.mts +303 -0
- package/resources/vector-stores/files.d.mts.map +1 -0
- package/resources/vector-stores/files.d.ts +27 -16
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +25 -47
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +22 -21
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/index.d.mts +3 -0
- package/resources/vector-stores/index.d.mts.map +1 -0
- package/resources/vector-stores/index.d.ts +2 -2
- package/resources/vector-stores/index.d.ts.map +1 -1
- package/resources/vector-stores/index.js +1 -3
- package/resources/vector-stores/index.js.map +1 -1
- package/resources/vector-stores/index.mjs +2 -2
- package/resources/vector-stores/index.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.mts +440 -0
- package/resources/vector-stores/vector-stores.d.mts.map +1 -0
- package/resources/vector-stores/vector-stores.d.ts +31 -20
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +20 -43
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +18 -18
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/resources/vector-stores.d.mts +2 -0
- package/resources/vector-stores.d.mts.map +1 -0
- package/resources/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores.js +2 -15
- package/resources/vector-stores.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 +900 -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/pagination.ts +183 -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 +6 -330
- 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/request-options.ts +37 -0
- package/src/internal/shim-types.d.ts +28 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +92 -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 +65 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +102 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/polling.ts +0 -1
- package/src/pagination.ts +2 -82
- package/src/resource.ts +2 -11
- package/src/resources/embeddings.ts +14 -4
- package/src/resources/extractions/content.ts +57 -4
- package/src/resources/extractions/extractions.ts +1 -1
- package/src/resources/extractions/jobs.ts +7 -5
- package/src/resources/extractions/schema.ts +6 -5
- package/src/resources/files.ts +30 -34
- package/src/resources/index.ts +2 -2
- package/src/resources/parsing/index.ts +1 -1
- package/src/resources/parsing/jobs.ts +29 -33
- package/src/resources/parsing/parsing.ts +2 -3
- package/src/resources/top-level.ts +13 -4
- package/src/resources/vector-stores/files.ts +51 -49
- package/src/resources/vector-stores/index.ts +4 -2
- package/src/resources/vector-stores/vector-stores.ts +45 -40
- package/src/tsconfig.json +2 -2
- package/src/uploads.ts +2 -255
- 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 -168
- package/uploads.js.map +1 -1
- package/uploads.mjs +1 -157
- 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 -14
- 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 -89
- 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 -78
- 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 -252
- package/core.d.ts.map +0 -1
- package/core.js +0 -917
- package/core.js.map +0 -1
- package/core.mjs +0 -885
- package/core.mjs.map +0 -1
- package/shims/node.d.ts +0 -30
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js +0 -31
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -5
- 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 -31
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -5
- 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 -1227
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/internal/utils.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,11 @@
|
|
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
|
+
const tslib_1 = require("./tslib.js");
|
5
|
+
tslib_1.__exportStar(require("./utils/values.js"), exports);
|
6
|
+
tslib_1.__exportStar(require("./utils/base64.js"), exports);
|
7
|
+
tslib_1.__exportStar(require("./utils/env.js"), exports);
|
8
|
+
tslib_1.__exportStar(require("./utils/log.js"), exports);
|
9
|
+
tslib_1.__exportStar(require("./utils/uuid.js"), exports);
|
10
|
+
tslib_1.__exportStar(require("./utils/sleep.js"), exports);
|
11
|
+
//# sourceMappingURL=utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/internal/utils.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAA+B;AAC/B,4DAA+B;AAC/B,yDAA4B;AAC5B,yDAA4B;AAC5B,0DAA6B;AAC7B,2DAA8B"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
export * from "./utils/values.mjs";
|
3
|
+
export * from "./utils/base64.mjs";
|
4
|
+
export * from "./utils/env.mjs";
|
5
|
+
export * from "./utils/log.mjs";
|
6
|
+
export * from "./utils/uuid.mjs";
|
7
|
+
export * from "./utils/sleep.mjs";
|
8
|
+
//# sourceMappingURL=utils.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.mjs","sourceRoot":"","sources":["../src/internal/utils.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
/**
|
2
|
+
* Utilities for polling operations
|
3
|
+
*/
|
4
|
+
type ConditionFunction<T> = (result: T) => boolean;
|
5
|
+
type IntervalFunction<T> = (result: T) => number;
|
6
|
+
type ErrorHandlerFunction = (error: Error) => number | null;
|
7
|
+
type RetryCallback<T> = (result: T, attempt: number) => void;
|
8
|
+
/**
|
9
|
+
* Configuration options for the poll function.
|
10
|
+
*/
|
11
|
+
export interface PollOptions<T> {
|
12
|
+
/** Async function that performs the operation to be polled */
|
13
|
+
fn: () => Promise<T>;
|
14
|
+
/** Function that evaluates if the polling should continue */
|
15
|
+
condition: ConditionFunction<T>;
|
16
|
+
/** Maximum number of polling attempts (undefined for infinite) */
|
17
|
+
maxAttempts?: number;
|
18
|
+
/** Maximum total time to poll in seconds (undefined for infinite) */
|
19
|
+
timeoutSeconds?: number;
|
20
|
+
/** Time between polls in seconds, or function that returns interval */
|
21
|
+
intervalSeconds?: number | IntervalFunction<T>;
|
22
|
+
/** Optional callback for each retry attempt */
|
23
|
+
onRetry?: RetryCallback<T>;
|
24
|
+
/** Optional callback for handling exceptions during polling */
|
25
|
+
errorHandler?: ErrorHandlerFunction;
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* Asynchronously polls an operation until a condition is met or timeout/max attempts are reached.
|
29
|
+
*
|
30
|
+
* @param options - Configuration options for polling
|
31
|
+
* @returns The result of the operation once condition is met
|
32
|
+
* @throws Error if maxAttempts is reached
|
33
|
+
* @throws Error if timeoutSeconds is reached
|
34
|
+
*
|
35
|
+
* @example
|
36
|
+
* ```typescript
|
37
|
+
* const result = await poll({
|
38
|
+
* fn: () => fetchData(),
|
39
|
+
* condition: (result) => result.status === 'completed',
|
40
|
+
* maxAttempts: 5,
|
41
|
+
* timeoutSeconds: 60,
|
42
|
+
* intervalSeconds: 2
|
43
|
+
* });
|
44
|
+
* ```
|
45
|
+
*/
|
46
|
+
export declare function poll<T>(options: PollOptions<T>): Promise<T>;
|
47
|
+
export {};
|
48
|
+
//# sourceMappingURL=polling.d.mts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"polling.d.mts","sourceRoot":"","sources":["../src/lib/polling.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC;AACnD,KAAK,gBAAgB,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC;AACjD,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,GAAG,IAAI,CAAC;AAC5D,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAK7D;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,8DAA8D;IAC9D,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IACrB,6DAA6D;IAC7D,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChC,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,eAA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OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CA8DjE"}
|
package/lib/polling.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
* Utilities for polling operations
|
4
4
|
*/
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.poll =
|
6
|
+
exports.poll = poll;
|
7
7
|
/**
|
8
8
|
* Asynchronously polls an operation until a condition is met or timeout/max attempts are reached.
|
9
9
|
*
|
@@ -27,7 +27,6 @@ async function poll(options) {
|
|
27
27
|
const { fn, condition, maxAttempts, timeoutSeconds, intervalSeconds = 1.0, onRetry, errorHandler, } = options;
|
28
28
|
const startTime = new Date();
|
29
29
|
let attempt = 0;
|
30
|
-
// eslint-disable-next-line no-constant-condition
|
31
30
|
while (true) {
|
32
31
|
attempt += 1;
|
33
32
|
try {
|
@@ -71,5 +70,4 @@ async function poll(options) {
|
|
71
70
|
}
|
72
71
|
}
|
73
72
|
}
|
74
|
-
exports.poll = poll;
|
75
73
|
//# sourceMappingURL=polling.js.map
|
package/lib/polling.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"polling.js","sourceRoot":"","sources":["../src/lib/polling.ts"],"names":[],"mappings":";AAAA;;GAEG
|
1
|
+
{"version":3,"file":"polling.js","sourceRoot":"","sources":["../src/lib/polling.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAiDH,oBA8DC;AAjFD;;;;;;;;;;;;;;;;;;GAkBG;AACI,KAAK,UAAU,IAAI,CAAI,OAAuB;IACnD,MAAM,EACJ,EAAE,EACF,SAAS,EACT,WAAW,EACX,cAAc,EACd,eAAe,GAAG,GAAG,EACrB,OAAO,EACP,YAAY,GACb,GAAG,OAAO,CAAC;IAEZ,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,OAAO,IAAI,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC,C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,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC;oBACtE,SAAS;gBACX,CAAC;YACH,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/lib/polling.mjs
CHANGED
@@ -24,7 +24,6 @@ export async function poll(options) {
|
|
24
24
|
const { fn, condition, maxAttempts, timeoutSeconds, intervalSeconds = 1.0, onRetry, errorHandler, } = options;
|
25
25
|
const startTime = new Date();
|
26
26
|
let attempt = 0;
|
27
|
-
// eslint-disable-next-line no-constant-condition
|
28
27
|
while (true) {
|
29
28
|
attempt += 1;
|
30
29
|
try {
|
package/lib/polling.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"polling.mjs","sourceRoot":"","sources":["../src/lib/polling.ts"],"names":[],"mappings":"AAAA;;GAEG;AA8BH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAI,OAAuB;IACnD,MAAM,EACJ,EAAE,EACF,SAAS,EACT,WAAW,EACX,cAAc,EACd,eAAe,GAAG,GAAG,EACrB,OAAO,EACP,YAAY,GACb,GAAG,OAAO,CAAC;IAEZ,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,
|
1
|
+
{"version":3,"file":"polling.mjs","sourceRoot":"","sources":["../src/lib/polling.ts"],"names":[],"mappings":"AAAA;;GAEG;AA8BH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAI,OAAuB;IACnD,MAAM,EACJ,EAAE,EACF,SAAS,EACT,WAAW,EACX,cAAc,EACd,eAAe,GAAG,GAAG,EACrB,OAAO,EACP,YAAY,GACb,GAAG,OAAO,CAAC;IAEZ,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;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AAC,CAAC,CAAC;gBAClC,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;oBACvB,qBAAqB;oBACrB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC;oBACtE,SAAS;gBACX,CAAC;YACH,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mixedbread/sdk",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.5.0",
|
4
4
|
"description": "The official TypeScript library for the Mixedbread API",
|
5
5
|
"author": "Mixedbread <support@mixedbread.com>",
|
6
6
|
"types": "./index.d.ts",
|
@@ -16,68 +16,23 @@
|
|
16
16
|
"scripts": {
|
17
17
|
"test": "./scripts/test",
|
18
18
|
"build": "./scripts/build",
|
19
|
-
"format": "
|
19
|
+
"format": "./scripts/format",
|
20
20
|
"tsn": "ts-node -r tsconfig-paths/register",
|
21
21
|
"lint": "./scripts/lint",
|
22
22
|
"fix": "./scripts/format"
|
23
23
|
},
|
24
|
-
"dependencies": {
|
25
|
-
|
26
|
-
"
|
27
|
-
"abort-controller": "^3.0.0",
|
28
|
-
"agentkeepalive": "^4.2.1",
|
29
|
-
"form-data-encoder": "1.7.2",
|
30
|
-
"formdata-node": "^4.3.2",
|
31
|
-
"node-fetch": "^2.6.7"
|
24
|
+
"dependencies": {},
|
25
|
+
"resolutions": {
|
26
|
+
"synckit": "0.8.8"
|
32
27
|
},
|
33
|
-
"sideEffects": [
|
34
|
-
"./_shims/index.js",
|
35
|
-
"./_shims/index.mjs",
|
36
|
-
"./shims/node.js",
|
37
|
-
"./shims/node.mjs",
|
38
|
-
"./shims/web.js",
|
39
|
-
"./shims/web.mjs"
|
40
|
-
],
|
41
28
|
"imports": {
|
42
29
|
"@mixedbread/sdk": ".",
|
43
30
|
"@mixedbread/sdk/*": "./src/*"
|
44
31
|
},
|
32
|
+
"bin": {
|
33
|
+
"mixedbread-sdk": "bin/cli"
|
34
|
+
},
|
45
35
|
"exports": {
|
46
|
-
"./_shims/auto/*": {
|
47
|
-
"deno": {
|
48
|
-
"types": "./_shims/auto/*.d.ts",
|
49
|
-
"require": "./_shims/auto/*.js",
|
50
|
-
"default": "./_shims/auto/*.mjs"
|
51
|
-
},
|
52
|
-
"bun": {
|
53
|
-
"types": "./_shims/auto/*.d.ts",
|
54
|
-
"require": "./_shims/auto/*-bun.js",
|
55
|
-
"default": "./_shims/auto/*-bun.mjs"
|
56
|
-
},
|
57
|
-
"browser": {
|
58
|
-
"types": "./_shims/auto/*.d.ts",
|
59
|
-
"require": "./_shims/auto/*.js",
|
60
|
-
"default": "./_shims/auto/*.mjs"
|
61
|
-
},
|
62
|
-
"worker": {
|
63
|
-
"types": "./_shims/auto/*.d.ts",
|
64
|
-
"require": "./_shims/auto/*.js",
|
65
|
-
"default": "./_shims/auto/*.mjs"
|
66
|
-
},
|
67
|
-
"workerd": {
|
68
|
-
"types": "./_shims/auto/*.d.ts",
|
69
|
-
"require": "./_shims/auto/*.js",
|
70
|
-
"default": "./_shims/auto/*.mjs"
|
71
|
-
},
|
72
|
-
"node": {
|
73
|
-
"types": "./_shims/auto/*-node.d.ts",
|
74
|
-
"require": "./_shims/auto/*-node.js",
|
75
|
-
"default": "./_shims/auto/*-node.mjs"
|
76
|
-
},
|
77
|
-
"types": "./_shims/auto/*.d.ts",
|
78
|
-
"require": "./_shims/auto/*.js",
|
79
|
-
"default": "./_shims/auto/*.mjs"
|
80
|
-
},
|
81
36
|
".": {
|
82
37
|
"require": {
|
83
38
|
"types": "./index.d.ts",
|
@@ -86,18 +41,128 @@
|
|
86
41
|
"types": "./index.d.mts",
|
87
42
|
"default": "./index.mjs"
|
88
43
|
},
|
89
|
-
"
|
90
|
-
"
|
91
|
-
"
|
44
|
+
"./api-promise": {
|
45
|
+
"import": "./api-promise.mjs",
|
46
|
+
"require": "./api-promise.js"
|
47
|
+
},
|
48
|
+
"./api-promise.js": {
|
49
|
+
"default": "./api-promise.js"
|
50
|
+
},
|
51
|
+
"./api-promise.mjs": {
|
52
|
+
"default": "./api-promise.mjs"
|
53
|
+
},
|
54
|
+
"./client": {
|
55
|
+
"import": "./client.mjs",
|
56
|
+
"require": "./client.js"
|
57
|
+
},
|
58
|
+
"./client.js": {
|
59
|
+
"default": "./client.js"
|
60
|
+
},
|
61
|
+
"./client.mjs": {
|
62
|
+
"default": "./client.mjs"
|
63
|
+
},
|
64
|
+
"./core/*.mjs": {
|
65
|
+
"default": "./core/*.mjs"
|
66
|
+
},
|
67
|
+
"./core/*.js": {
|
68
|
+
"default": "./core/*.js"
|
69
|
+
},
|
70
|
+
"./core/*": {
|
71
|
+
"import": "./core/*.mjs",
|
72
|
+
"require": "./core/*.js"
|
73
|
+
},
|
74
|
+
"./error": {
|
75
|
+
"import": "./error.mjs",
|
76
|
+
"require": "./error.js"
|
77
|
+
},
|
78
|
+
"./error.js": {
|
79
|
+
"default": "./error.js"
|
80
|
+
},
|
81
|
+
"./error.mjs": {
|
82
|
+
"default": "./error.mjs"
|
83
|
+
},
|
84
|
+
"./index": {
|
85
|
+
"import": "./index.mjs",
|
86
|
+
"require": "./index.js"
|
87
|
+
},
|
88
|
+
"./index.js": {
|
89
|
+
"default": "./index.js"
|
90
|
+
},
|
91
|
+
"./index.mjs": {
|
92
|
+
"default": "./index.mjs"
|
93
|
+
},
|
94
|
+
"./lib/*.mjs": {
|
95
|
+
"default": "./lib/*.mjs"
|
96
|
+
},
|
97
|
+
"./lib/*.js": {
|
98
|
+
"default": "./lib/*.js"
|
99
|
+
},
|
100
|
+
"./lib/*": {
|
101
|
+
"import": "./lib/*.mjs",
|
102
|
+
"require": "./lib/*.js"
|
103
|
+
},
|
104
|
+
"./pagination": {
|
105
|
+
"import": "./pagination.mjs",
|
106
|
+
"require": "./pagination.js"
|
107
|
+
},
|
108
|
+
"./pagination.js": {
|
109
|
+
"default": "./pagination.js"
|
110
|
+
},
|
111
|
+
"./pagination.mjs": {
|
112
|
+
"default": "./pagination.mjs"
|
113
|
+
},
|
114
|
+
"./resource": {
|
115
|
+
"import": "./resource.mjs",
|
116
|
+
"require": "./resource.js"
|
117
|
+
},
|
118
|
+
"./resource.js": {
|
119
|
+
"default": "./resource.js"
|
120
|
+
},
|
121
|
+
"./resource.mjs": {
|
122
|
+
"default": "./resource.mjs"
|
92
123
|
},
|
93
|
-
"
|
94
|
-
"
|
95
|
-
"default": "./*.js"
|
124
|
+
"./resources/*.mjs": {
|
125
|
+
"default": "./resources/*.mjs"
|
96
126
|
},
|
97
|
-
"
|
98
|
-
"
|
99
|
-
|
100
|
-
|
127
|
+
"./resources/*.js": {
|
128
|
+
"default": "./resources/*.js"
|
129
|
+
},
|
130
|
+
"./resources/*": {
|
131
|
+
"import": "./resources/*.mjs",
|
132
|
+
"require": "./resources/*.js"
|
133
|
+
},
|
134
|
+
"./resources": {
|
135
|
+
"import": "./resources.mjs",
|
136
|
+
"require": "./resources.js"
|
137
|
+
},
|
138
|
+
"./resources.js": {
|
139
|
+
"default": "./resources.js"
|
140
|
+
},
|
141
|
+
"./resources.mjs": {
|
142
|
+
"default": "./resources.mjs"
|
143
|
+
},
|
144
|
+
"./uploads": {
|
145
|
+
"import": "./uploads.mjs",
|
146
|
+
"require": "./uploads.js"
|
147
|
+
},
|
148
|
+
"./uploads.js": {
|
149
|
+
"default": "./uploads.js"
|
150
|
+
},
|
151
|
+
"./uploads.mjs": {
|
152
|
+
"default": "./uploads.mjs"
|
153
|
+
},
|
154
|
+
"./version": {
|
155
|
+
"import": "./version.mjs",
|
156
|
+
"require": "./version.js"
|
157
|
+
},
|
158
|
+
"./version.js": {
|
159
|
+
"default": "./version.js"
|
160
|
+
},
|
161
|
+
"./version.mjs": {
|
162
|
+
"default": "./version.mjs"
|
101
163
|
}
|
164
|
+
},
|
165
|
+
"engines": {
|
166
|
+
"node": ">= 20"
|
102
167
|
}
|
103
|
-
}
|
168
|
+
}
|
package/pagination.d.mts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pagination.d.mts","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":""}
|
package/pagination.d.ts
CHANGED
@@ -1,30 +1,2 @@
|
|
1
|
-
|
2
|
-
export interface LimitOffsetResponse<Item> {
|
3
|
-
data: Array<Item>;
|
4
|
-
pagination: LimitOffsetResponse.Pagination;
|
5
|
-
}
|
6
|
-
export declare namespace LimitOffsetResponse {
|
7
|
-
interface Pagination {
|
8
|
-
total?: number;
|
9
|
-
offset?: number;
|
10
|
-
}
|
11
|
-
}
|
12
|
-
export interface LimitOffsetParams {
|
13
|
-
/**
|
14
|
-
* The number of elements to skip.
|
15
|
-
*/
|
16
|
-
offset?: number;
|
17
|
-
/**
|
18
|
-
* The maximum number of elements to fetch.
|
19
|
-
*/
|
20
|
-
limit?: number;
|
21
|
-
}
|
22
|
-
export declare class LimitOffset<Item> extends AbstractPage<Item> implements LimitOffsetResponse<Item> {
|
23
|
-
data: Array<Item>;
|
24
|
-
pagination: LimitOffsetResponse.Pagination;
|
25
|
-
constructor(client: APIClient, response: Response, body: LimitOffsetResponse<Item>, options: FinalRequestOptions);
|
26
|
-
getPaginatedItems(): Item[];
|
27
|
-
nextPageParams(): Partial<LimitOffsetParams> | null;
|
28
|
-
nextPageInfo(): PageInfo | null;
|
29
|
-
}
|
1
|
+
export * from "./core/pagination.js";
|
30
2
|
//# sourceMappingURL=pagination.d.ts.map
|
package/pagination.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":""}
|
package/pagination.js
CHANGED
@@ -1,45 +1,6 @@
|
|
1
1
|
"use strict";
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
constructor(client, response, body, options) {
|
8
|
-
super(client, response, body, options);
|
9
|
-
this.data = body.data || [];
|
10
|
-
this.pagination = body.pagination || {};
|
11
|
-
}
|
12
|
-
getPaginatedItems() {
|
13
|
-
return this.data ?? [];
|
14
|
-
}
|
15
|
-
// @deprecated Please use `nextPageInfo()` instead
|
16
|
-
nextPageParams() {
|
17
|
-
const info = this.nextPageInfo();
|
18
|
-
if (!info)
|
19
|
-
return null;
|
20
|
-
if ('params' in info)
|
21
|
-
return info.params;
|
22
|
-
const params = Object.fromEntries(info.url.searchParams);
|
23
|
-
if (!Object.keys(params).length)
|
24
|
-
return null;
|
25
|
-
return params;
|
26
|
-
}
|
27
|
-
nextPageInfo() {
|
28
|
-
const offset = this.pagination?.offset;
|
29
|
-
if (!offset) {
|
30
|
-
return null;
|
31
|
-
}
|
32
|
-
const length = this.getPaginatedItems().length;
|
33
|
-
const currentCount = offset + length;
|
34
|
-
const totalCount = this.pagination?.total;
|
35
|
-
if (!totalCount) {
|
36
|
-
return null;
|
37
|
-
}
|
38
|
-
if (currentCount < totalCount) {
|
39
|
-
return { params: { offset: currentCount } };
|
40
|
-
}
|
41
|
-
return null;
|
42
|
-
}
|
43
|
-
}
|
44
|
-
exports.LimitOffset = LimitOffset;
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
4
|
+
/** @deprecated Import from ./core/pagination instead */
|
5
|
+
tslib_1.__exportStar(require("./core/pagination.js"), exports);
|
45
6
|
//# sourceMappingURL=pagination.js.map
|
package/pagination.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,+DAAkC"}
|
package/pagination.mjs
CHANGED
@@ -1,41 +1,2 @@
|
|
1
|
-
|
2
|
-
import { AbstractPage } from "./core.mjs";
|
3
|
-
export class LimitOffset extends AbstractPage {
|
4
|
-
constructor(client, response, body, options) {
|
5
|
-
super(client, response, body, options);
|
6
|
-
this.data = body.data || [];
|
7
|
-
this.pagination = body.pagination || {};
|
8
|
-
}
|
9
|
-
getPaginatedItems() {
|
10
|
-
return this.data ?? [];
|
11
|
-
}
|
12
|
-
// @deprecated Please use `nextPageInfo()` instead
|
13
|
-
nextPageParams() {
|
14
|
-
const info = this.nextPageInfo();
|
15
|
-
if (!info)
|
16
|
-
return null;
|
17
|
-
if ('params' in info)
|
18
|
-
return info.params;
|
19
|
-
const params = Object.fromEntries(info.url.searchParams);
|
20
|
-
if (!Object.keys(params).length)
|
21
|
-
return null;
|
22
|
-
return params;
|
23
|
-
}
|
24
|
-
nextPageInfo() {
|
25
|
-
const offset = this.pagination?.offset;
|
26
|
-
if (!offset) {
|
27
|
-
return null;
|
28
|
-
}
|
29
|
-
const length = this.getPaginatedItems().length;
|
30
|
-
const currentCount = offset + length;
|
31
|
-
const totalCount = this.pagination?.total;
|
32
|
-
if (!totalCount) {
|
33
|
-
return null;
|
34
|
-
}
|
35
|
-
if (currentCount < totalCount) {
|
36
|
-
return { params: { offset: currentCount } };
|
37
|
-
}
|
38
|
-
return null;
|
39
|
-
}
|
40
|
-
}
|
1
|
+
export * from "./core/pagination.mjs";
|
41
2
|
//# sourceMappingURL=pagination.mjs.map
|
package/pagination.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pagination.mjs","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"pagination.mjs","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":""}
|
package/resource.d.mts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"resource.d.mts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":""}
|
package/resource.d.ts
CHANGED
package/resource.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":""}
|
package/resource.js
CHANGED
@@ -1,11 +1,6 @@
|
|
1
1
|
"use strict";
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
this._client = client;
|
8
|
-
}
|
9
|
-
}
|
10
|
-
exports.APIResource = APIResource;
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
4
|
+
/** @deprecated Import from ./core/resource instead */
|
5
|
+
tslib_1.__exportStar(require("./core/resource.js"), exports);
|
11
6
|
//# sourceMappingURL=resource.js.map
|
package/resource.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resource.js","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":";;;AAAA,sDAAsD;AACtD,6DAAgC"}
|
package/resource.mjs
CHANGED
package/resource.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resource.mjs","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"resource.mjs","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
2
|
+
import * as TopLevelAPI from "./top-level.mjs";
|
3
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
5
|
+
export declare class Embeddings extends APIResource {
|
6
|
+
/**
|
7
|
+
* Create embeddings for text or images using the specified model, encoding format,
|
8
|
+
* and normalization.
|
9
|
+
*
|
10
|
+
* Args: params: The parameters for creating embeddings.
|
11
|
+
*
|
12
|
+
* Returns: EmbeddingCreateResponse: The response containing the embeddings.
|
13
|
+
*
|
14
|
+
* @example
|
15
|
+
* ```ts
|
16
|
+
* const embeddingCreateResponse =
|
17
|
+
* await client.embeddings.create({
|
18
|
+
* model: 'mixedbread-ai/mxbai-embed-large-v1',
|
19
|
+
* input: 'x',
|
20
|
+
* });
|
21
|
+
* ```
|
22
|
+
*/
|
23
|
+
create(body: EmbeddingCreateParams, options?: RequestOptions): APIPromise<TopLevelAPI.EmbeddingCreateResponse>;
|
24
|
+
}
|
25
|
+
export interface EmbeddingCreateParams {
|
26
|
+
/**
|
27
|
+
* The model to use for creating embeddings.
|
28
|
+
*/
|
29
|
+
model: string;
|
30
|
+
/**
|
31
|
+
* The input to create embeddings for.
|
32
|
+
*/
|
33
|
+
input: string | Array<string>;
|
34
|
+
/**
|
35
|
+
* The number of dimensions to use for the embeddings.
|
36
|
+
*/
|
37
|
+
dimensions?: number | null;
|
38
|
+
/**
|
39
|
+
* The prompt to use for the embedding creation.
|
40
|
+
*/
|
41
|
+
prompt?: string | null;
|
42
|
+
/**
|
43
|
+
* Whether to normalize the embeddings.
|
44
|
+
*/
|
45
|
+
normalized?: boolean;
|
46
|
+
/**
|
47
|
+
* The encoding format(s) of the embeddings. Can be a single format or a list of
|
48
|
+
* formats.
|
49
|
+
*/
|
50
|
+
encoding_format?: 'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8' | Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
|
51
|
+
}
|
52
|
+
export declare namespace Embeddings {
|
53
|
+
export { type EmbeddingCreateParams as EmbeddingCreateParams };
|
54
|
+
}
|
55
|
+
//# sourceMappingURL=embeddings.d.mts.map
|