@anthropic-ai/sdk 0.34.0-alpha.0 → 0.36.2
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 +92 -0
- package/README.md +19 -17
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/{internal/utils.js → _shims/auto/runtime-bun.js} +5 -8
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +248 -0
- package/core.d.ts.map +1 -0
- package/core.js +929 -0
- package/core.js.map +1 -0
- package/core.mjs +897 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +2 -2
- package/error.d.ts.map +1 -1
- package/error.js +3 -3
- package/error.js.map +1 -1
- package/error.mjs +2 -2
- package/error.mjs.map +1 -1
- package/index.d.mts +150 -5
- package/index.d.ts +150 -5
- package/index.d.ts.map +1 -1
- package/index.js +159 -18
- package/index.js.map +1 -1
- package/index.mjs +133 -5
- package/index.mjs.map +1 -1
- package/internal/decoders/jsonl.d.ts +1 -0
- package/internal/decoders/jsonl.d.ts.map +1 -1
- package/internal/decoders/jsonl.js +2 -2
- package/internal/decoders/jsonl.js.map +1 -1
- package/internal/decoders/jsonl.mjs +2 -2
- package/internal/decoders/jsonl.mjs.map +1 -1
- package/internal/decoders/line.d.ts +0 -1
- package/internal/decoders/line.d.ts.map +1 -1
- package/internal/stream-utils.d.ts +8 -0
- package/internal/stream-utils.d.ts.map +1 -0
- package/internal/stream-utils.js +39 -0
- package/internal/stream-utils.js.map +1 -0
- package/internal/stream-utils.mjs +35 -0
- package/internal/stream-utils.mjs.map +1 -0
- package/lib/{MessageStream.d.mts → BetaMessageStream.d.ts} +39 -22
- package/lib/BetaMessageStream.d.ts.map +1 -0
- package/lib/BetaMessageStream.js +492 -0
- package/lib/BetaMessageStream.js.map +1 -0
- package/lib/BetaMessageStream.mjs +488 -0
- package/lib/BetaMessageStream.mjs.map +1 -0
- package/lib/MessageStream.d.ts +25 -8
- package/lib/MessageStream.d.ts.map +1 -1
- package/lib/MessageStream.js +42 -9
- package/lib/MessageStream.js.map +1 -1
- package/lib/MessageStream.mjs +42 -9
- package/lib/MessageStream.mjs.map +1 -1
- package/package.json +64 -120
- package/pagination.d.ts +4 -41
- package/pagination.d.ts.map +1 -1
- package/pagination.js +21 -95
- package/pagination.js.map +1 -1
- package/pagination.mjs +19 -91
- package/pagination.mjs.map +1 -1
- package/resource.d.ts +3 -3
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/beta/beta.d.ts +3 -3
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +1 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +2 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +4 -3
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/messages/batches.d.ts +20 -14
- package/resources/beta/messages/batches.d.ts.map +1 -1
- package/resources/beta/messages/batches.js +36 -47
- package/resources/beta/messages/batches.js.map +1 -1
- package/resources/beta/messages/batches.mjs +34 -46
- package/resources/beta/messages/batches.mjs.map +1 -1
- package/resources/beta/messages/index.d.ts +2 -2
- package/resources/beta/messages/index.d.ts.map +1 -1
- package/resources/beta/messages/index.js +2 -1
- package/resources/beta/messages/index.js.map +1 -1
- package/resources/beta/messages/index.mjs +1 -1
- package/resources/beta/messages/index.mjs.map +1 -1
- package/resources/beta/messages/messages.d.ts +95 -10
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js +21 -0
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs +22 -1
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/models.d.ts +8 -7
- package/resources/beta/models.d.ts.map +1 -1
- package/resources/beta/models.js +12 -10
- package/resources/beta/models.js.map +1 -1
- package/resources/beta/models.mjs +10 -9
- package/resources/beta/models.mjs.map +1 -1
- package/resources/completions.d.ts +5 -5
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/batches.d.ts +16 -14
- package/resources/messages/batches.d.ts.map +1 -1
- package/resources/messages/batches.js +30 -18
- package/resources/messages/batches.js.map +1 -1
- package/resources/messages/batches.mjs +28 -17
- package/resources/messages/batches.mjs.map +1 -1
- package/resources/messages/index.d.ts +2 -2
- package/resources/messages/index.d.ts.map +1 -1
- package/resources/messages/index.js +2 -1
- package/resources/messages/index.js.map +1 -1
- package/resources/messages/index.mjs +1 -1
- package/resources/messages/index.mjs.map +1 -1
- package/resources/messages/messages.d.ts +90 -11
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +4 -0
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +5 -1
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/models.d.ts +8 -7
- package/resources/models.d.ts.map +1 -1
- package/resources/models.js +12 -10
- package/resources/models.js.map +1 -1
- package/resources/models.mjs +10 -9
- package/resources/models.mjs.map +1 -1
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1242 -0
- package/src/error.ts +3 -3
- package/src/index.ts +432 -12
- package/src/internal/decoders/jsonl.ts +5 -4
- package/src/internal/decoders/line.ts +1 -1
- package/src/internal/stream-utils.ts +32 -0
- package/src/lib/BetaMessageStream.ts +599 -0
- package/src/lib/MessageStream.ts +58 -20
- package/src/pagination.ts +18 -122
- package/src/resource.ts +3 -3
- package/src/resources/beta/beta.ts +33 -6
- package/src/resources/beta/index.ts +16 -3
- package/src/resources/beta/messages/batches.ts +94 -42
- package/src/resources/beta/messages/index.ts +17 -3
- package/src/resources/beta/messages/messages.ts +202 -18
- package/src/resources/beta/models.ts +22 -12
- package/src/resources/completions.ts +13 -10
- package/src/resources/index.ts +18 -5
- package/src/resources/messages/batches.ts +46 -28
- package/src/resources/messages/index.ts +16 -3
- package/src/resources/messages/messages.ts +174 -22
- package/src/resources/models.ts +19 -12
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/streaming.ts +15 -42
- package/src/tsconfig.json +1 -1
- package/src/uploads.ts +54 -57
- package/src/version.ts +1 -1
- package/streaming.d.ts +1 -8
- package/streaming.d.ts.map +1 -1
- package/streaming.js +8 -41
- package/streaming.js.map +1 -1
- package/streaming.mjs +7 -39
- package/streaming.mjs.map +1 -1
- package/uploads.d.ts +19 -23
- package/uploads.d.ts.map +1 -1
- package/uploads.js +27 -33
- package/uploads.js.map +1 -1
- package/uploads.mjs +21 -29
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/_vendor/partial-json-parser/parser.d.mts +0 -3
- package/_vendor/partial-json-parser/parser.d.mts.map +0 -1
- package/api-promise.d.mts +0 -48
- package/api-promise.d.mts.map +0 -1
- package/api-promise.d.ts +0 -48
- package/api-promise.d.ts.map +0 -1
- package/api-promise.js +0 -71
- package/api-promise.js.map +0 -1
- package/api-promise.mjs +0 -67
- package/api-promise.mjs.map +0 -1
- package/client.d.mts +0 -212
- package/client.d.mts.map +0 -1
- package/client.d.ts +0 -212
- package/client.d.ts.map +0 -1
- package/client.js +0 -505
- package/client.js.map +0 -1
- package/client.mjs +0 -477
- package/client.mjs.map +0 -1
- package/error.d.mts +0 -48
- package/error.d.mts.map +0 -1
- package/index.d.mts.map +0 -1
- package/internal/builtin-types.d.mts +0 -65
- package/internal/builtin-types.d.mts.map +0 -1
- package/internal/builtin-types.d.ts +0 -65
- package/internal/builtin-types.d.ts.map +0 -1
- package/internal/builtin-types.js +0 -4
- package/internal/builtin-types.js.map +0 -1
- package/internal/builtin-types.mjs +0 -3
- package/internal/builtin-types.mjs.map +0 -1
- package/internal/decoders/jsonl.d.mts +0 -11
- package/internal/decoders/jsonl.d.mts.map +0 -1
- package/internal/decoders/line.d.mts +0 -21
- package/internal/decoders/line.d.mts.map +0 -1
- package/internal/detect-platform.d.mts +0 -15
- package/internal/detect-platform.d.mts.map +0 -1
- package/internal/detect-platform.d.ts +0 -15
- package/internal/detect-platform.d.ts.map +0 -1
- package/internal/detect-platform.js +0 -162
- package/internal/detect-platform.js.map +0 -1
- package/internal/detect-platform.mjs +0 -157
- package/internal/detect-platform.mjs.map +0 -1
- package/internal/errors.d.mts +0 -3
- package/internal/errors.d.mts.map +0 -1
- package/internal/errors.d.ts +0 -3
- package/internal/errors.d.ts.map +0 -1
- package/internal/errors.js +0 -22
- package/internal/errors.js.map +0 -1
- package/internal/errors.mjs +0 -17
- package/internal/errors.mjs.map +0 -1
- package/internal/headers.d.mts +0 -21
- package/internal/headers.d.mts.map +0 -1
- package/internal/headers.d.ts +0 -21
- package/internal/headers.d.ts.map +0 -1
- package/internal/headers.js +0 -77
- package/internal/headers.js.map +0 -1
- package/internal/headers.mjs +0 -72
- package/internal/headers.mjs.map +0 -1
- package/internal/parse.d.mts +0 -14
- package/internal/parse.d.mts.map +0 -1
- package/internal/parse.d.ts +0 -14
- package/internal/parse.d.ts.map +0 -1
- package/internal/parse.js +0 -48
- package/internal/parse.js.map +0 -1
- package/internal/parse.mjs +0 -43
- package/internal/parse.mjs.map +0 -1
- package/internal/polyfill/crypto.node.d.ts +0 -10
- package/internal/polyfill/crypto.node.js +0 -11
- package/internal/polyfill/crypto.node.mjs +0 -2
- package/internal/polyfill/file.node.d.ts +0 -9
- package/internal/polyfill/file.node.js +0 -17
- package/internal/polyfill/file.node.mjs +0 -9
- package/internal/request-options.d.mts +0 -37
- package/internal/request-options.d.mts.map +0 -1
- package/internal/request-options.d.ts +0 -37
- package/internal/request-options.d.ts.map +0 -1
- package/internal/request-options.js +0 -40
- package/internal/request-options.js.map +0 -1
- package/internal/request-options.mjs +0 -35
- package/internal/request-options.mjs.map +0 -1
- package/internal/shim-types.d.mts +0 -28
- package/internal/shim-types.d.ts +0 -28
- package/internal/shims.d.mts +0 -65
- package/internal/shims.d.mts.map +0 -1
- package/internal/shims.d.ts +0 -65
- package/internal/shims.d.ts.map +0 -1
- package/internal/shims.js +0 -66
- package/internal/shims.js.map +0 -1
- package/internal/shims.mjs +0 -58
- package/internal/shims.mjs.map +0 -1
- package/internal/types.d.mts +0 -6
- package/internal/types.d.mts.map +0 -1
- package/internal/types.d.ts +0 -6
- package/internal/types.d.ts.map +0 -1
- package/internal/types.js +0 -4
- package/internal/types.js.map +0 -1
- package/internal/types.mjs +0 -3
- package/internal/types.mjs.map +0 -1
- package/internal/utils/base64.d.mts +0 -3
- package/internal/utils/base64.d.mts.map +0 -1
- package/internal/utils/base64.d.ts +0 -3
- package/internal/utils/base64.d.ts.map +0 -1
- package/internal/utils/base64.js +0 -33
- package/internal/utils/base64.js.map +0 -1
- package/internal/utils/base64.mjs +0 -28
- package/internal/utils/base64.mjs.map +0 -1
- package/internal/utils/env.d.mts +0 -9
- package/internal/utils/env.d.mts.map +0 -1
- package/internal/utils/env.d.ts +0 -9
- package/internal/utils/env.d.ts.map +0 -1
- package/internal/utils/env.js +0 -22
- package/internal/utils/env.js.map +0 -1
- package/internal/utils/env.mjs +0 -18
- package/internal/utils/env.mjs.map +0 -1
- package/internal/utils/log.d.mts +0 -2
- package/internal/utils/log.d.mts.map +0 -1
- package/internal/utils/log.d.ts +0 -2
- package/internal/utils/log.d.ts.map +0 -1
- package/internal/utils/log.js +0 -12
- package/internal/utils/log.js.map +0 -1
- package/internal/utils/log.mjs +0 -8
- package/internal/utils/log.mjs.map +0 -1
- package/internal/utils/sleep.d.mts +0 -2
- package/internal/utils/sleep.d.mts.map +0 -1
- package/internal/utils/sleep.d.ts +0 -2
- package/internal/utils/sleep.d.ts.map +0 -1
- package/internal/utils/sleep.js +0 -7
- package/internal/utils/sleep.js.map +0 -1
- package/internal/utils/sleep.mjs +0 -3
- package/internal/utils/sleep.mjs.map +0 -1
- package/internal/utils/uuid.d.mts +0 -5
- package/internal/utils/uuid.d.mts.map +0 -1
- package/internal/utils/uuid.d.ts +0 -5
- package/internal/utils/uuid.d.ts.map +0 -1
- package/internal/utils/uuid.js +0 -15
- package/internal/utils/uuid.js.map +0 -1
- package/internal/utils/uuid.mjs +0 -11
- package/internal/utils/uuid.mjs.map +0 -1
- package/internal/utils/values.d.mts +0 -15
- package/internal/utils/values.d.mts.map +0 -1
- package/internal/utils/values.d.ts +0 -15
- package/internal/utils/values.d.ts.map +0 -1
- package/internal/utils/values.js +0 -100
- package/internal/utils/values.js.map +0 -1
- package/internal/utils/values.mjs +0 -84
- package/internal/utils/values.mjs.map +0 -1
- package/internal/utils.d.mts +0 -7
- package/internal/utils.d.mts.map +0 -1
- package/internal/utils.d.ts +0 -7
- package/internal/utils.d.ts.map +0 -1
- package/internal/utils.js.map +0 -1
- package/internal/utils.mjs +0 -8
- package/internal/utils.mjs.map +0 -1
- package/lib/MessageStream.d.mts.map +0 -1
- package/pagination.d.mts +0 -63
- package/pagination.d.mts.map +0 -1
- package/resource.d.mts +0 -6
- package/resource.d.mts.map +0 -1
- package/resources/beta/beta.d.mts +0 -57
- package/resources/beta/beta.d.mts.map +0 -1
- package/resources/beta/index.d.mts +0 -4
- package/resources/beta/index.d.mts.map +0 -1
- package/resources/beta/messages/batches.d.mts +0 -261
- package/resources/beta/messages/batches.d.mts.map +0 -1
- package/resources/beta/messages/index.d.mts +0 -3
- package/resources/beta/messages/index.d.mts.map +0 -1
- package/resources/beta/messages/messages.d.mts +0 -879
- package/resources/beta/messages/messages.d.mts.map +0 -1
- package/resources/beta/models.d.mts +0 -48
- package/resources/beta/models.d.mts.map +0 -1
- package/resources/completions.d.mts +0 -166
- package/resources/completions.d.mts.map +0 -1
- package/resources/index.d.mts +0 -6
- package/resources/index.d.mts.map +0 -1
- package/resources/messages/batches.d.mts +0 -229
- package/resources/messages/batches.d.mts.map +0 -1
- package/resources/messages/index.d.mts +0 -3
- package/resources/messages/index.d.mts.map +0 -1
- package/resources/messages/messages.d.mts +0 -859
- package/resources/messages/messages.d.mts.map +0 -1
- package/resources/models.d.mts +0 -48
- package/resources/models.d.mts.map +0 -1
- package/resources/shared.d.mts +0 -42
- package/resources/shared.d.mts.map +0 -1
- package/resources/top-level.d.mts +0 -2
- package/resources/top-level.d.mts.map +0 -1
- package/src/api-promise.ts +0 -93
- package/src/client.ts +0 -863
- package/src/internal/builtin-types.ts +0 -79
- package/src/internal/detect-platform.ts +0 -192
- package/src/internal/errors.ts +0 -18
- package/src/internal/headers.ts +0 -96
- package/src/internal/parse.ts +0 -70
- package/src/internal/polyfill/crypto.node.d.ts +0 -10
- package/src/internal/polyfill/crypto.node.js +0 -11
- package/src/internal/polyfill/crypto.node.mjs +0 -2
- package/src/internal/polyfill/file.node.d.ts +0 -9
- package/src/internal/polyfill/file.node.js +0 -17
- package/src/internal/polyfill/file.node.mjs +0 -9
- package/src/internal/request-options.ts +0 -71
- package/src/internal/shim-types.d.ts +0 -28
- package/src/internal/shims.ts +0 -124
- package/src/internal/types.ts +0 -6
- package/src/internal/utils/base64.ts +0 -40
- package/src/internal/utils/env.ts +0 -20
- package/src/internal/utils/log.ts +0 -9
- package/src/internal/utils/sleep.ts +0 -3
- package/src/internal/utils/uuid.ts +0 -13
- package/src/internal/utils/values.ts +0 -94
- package/src/internal/utils.ts +0 -8
- package/streaming.d.mts +0 -41
- package/streaming.d.mts.map +0 -1
- package/uploads.d.mts +0 -79
- package/uploads.d.mts.map +0 -1
- package/version.d.mts +0 -2
- package/version.d.mts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,97 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.36.2 (2025-01-23)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [sdk-v0.36.1...sdk-v0.36.2](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.36.1...sdk-v0.36.2)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **bedrock:** update streaming util import ([255c059](https://github.com/anthropics/anthropic-sdk-typescript/commit/255c0599e333e6fae582255e3b0631538b168c69))
|
|
10
|
+
|
|
11
|
+
## 0.36.1 (2025-01-23)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [sdk-v0.36.0...sdk-v0.36.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.36.0...sdk-v0.36.1)
|
|
14
|
+
|
|
15
|
+
### Chores
|
|
16
|
+
|
|
17
|
+
* **tests:** fix types ([9efe3ee](https://github.com/anthropics/anthropic-sdk-typescript/commit/9efe3eebf64bd762a34caf362a1cd1a0f0858f92))
|
|
18
|
+
|
|
19
|
+
## 0.36.0 (2025-01-23)
|
|
20
|
+
|
|
21
|
+
Full Changelog: [sdk-v0.35.0...sdk-v0.36.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.35.0...sdk-v0.36.0)
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* **api:** add citations ([#668](https://github.com/anthropics/anthropic-sdk-typescript/issues/668)) ([1fef177](https://github.com/anthropics/anthropic-sdk-typescript/commit/1fef17749adbbeb243480b96c04941be29c0746c))
|
|
26
|
+
* **client:** support results endpoint ([#666](https://github.com/anthropics/anthropic-sdk-typescript/issues/666)) ([db5fffe](https://github.com/anthropics/anthropic-sdk-typescript/commit/db5fffeb38a99a3e9283ebf001fbf767d756162e))
|
|
27
|
+
* **stream:** expose `response` property as well ([b0235c7](https://github.com/anthropics/anthropic-sdk-typescript/commit/b0235c7b3ac174b3c8e670e381b4aa038e61c826))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Chores
|
|
31
|
+
|
|
32
|
+
* **bedrock:** bump dependency on @anthropic-ai/sdk ([8745ca2](https://github.com/anthropics/anthropic-sdk-typescript/commit/8745ca2160f5af4d89e5732a44e560c5e2787aa8))
|
|
33
|
+
* **internal:** fix import ([628b55e](https://github.com/anthropics/anthropic-sdk-typescript/commit/628b55ef5ff8f0245287ecaea688480a0174e2e9))
|
|
34
|
+
* **internal:** minor restructuring ([#664](https://github.com/anthropics/anthropic-sdk-typescript/issues/664)) ([57aefa7](https://github.com/anthropics/anthropic-sdk-typescript/commit/57aefa73230d54da24d787a89adc277481986d02))
|
|
35
|
+
* **vertex:** bump dependency on @anthropic-ai/sdk ([a1c7fcd](https://github.com/anthropics/anthropic-sdk-typescript/commit/a1c7fcdce081f860cbb1148c3862e3303ddb8a62))
|
|
36
|
+
|
|
37
|
+
## 0.35.0 (2025-01-21)
|
|
38
|
+
|
|
39
|
+
Full Changelog: [sdk-v0.34.0...sdk-v0.35.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.34.0...sdk-v0.35.0)
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* add beta message streaming helpers ([#655](https://github.com/anthropics/anthropic-sdk-typescript/issues/655)) ([d7b5af1](https://github.com/anthropics/anthropic-sdk-typescript/commit/d7b5af1629dbcefdb7bfdca271ab497567830227))
|
|
44
|
+
* **stream:** add `.withResponse()` ([#654](https://github.com/anthropics/anthropic-sdk-typescript/issues/654)) ([b54477f](https://github.com/anthropics/anthropic-sdk-typescript/commit/b54477f20c92db4c2c5ed89af5d46c36b035bf1e))
|
|
45
|
+
* **streaming:** add `.request_id` getter ([4572478](https://github.com/anthropics/anthropic-sdk-typescript/commit/4572478266a67e12e32ffef69817cbc495943b1d))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Bug Fixes
|
|
49
|
+
|
|
50
|
+
* **docs:** correct results return type ([#657](https://github.com/anthropics/anthropic-sdk-typescript/issues/657)) ([4e6d031](https://github.com/anthropics/anthropic-sdk-typescript/commit/4e6d031a41625ebf9c4311638e0c149179fcae0c))
|
|
51
|
+
* **examples:** add token counting example ([2498e2e](https://github.com/anthropics/anthropic-sdk-typescript/commit/2498e2eaf49d66a664ed1fdcd7bbd331979cf5b2))
|
|
52
|
+
* send correct Accept header for certain endpoints ([#651](https://github.com/anthropics/anthropic-sdk-typescript/issues/651)) ([17ffaeb](https://github.com/anthropics/anthropic-sdk-typescript/commit/17ffaeba5af48d13b08483973b82cfe1ae79347f))
|
|
53
|
+
* **vertex:** add beta.messages.countTokens method ([51d3f23](https://github.com/anthropics/anthropic-sdk-typescript/commit/51d3f23a7cc1bea798cc8e4041e08114ebc3a4eb))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Chores
|
|
57
|
+
|
|
58
|
+
* deprecate more models ([661f5f9](https://github.com/anthropics/anthropic-sdk-typescript/commit/661f5f9d9b24f3661df246dcf101dd9812b3e19e))
|
|
59
|
+
* **internal:** add test ([#660](https://github.com/anthropics/anthropic-sdk-typescript/issues/660)) ([3ec7d1a](https://github.com/anthropics/anthropic-sdk-typescript/commit/3ec7d1a9eea30255b24cdb16c1a26705bdfea0ac))
|
|
60
|
+
* **internal:** temporary revert commit ([#643](https://github.com/anthropics/anthropic-sdk-typescript/issues/643)) ([43dd43c](https://github.com/anthropics/anthropic-sdk-typescript/commit/43dd43c4c8ab69d5a60e59473af7dff5f7799048))
|
|
61
|
+
* **internal:** update examples ([#649](https://github.com/anthropics/anthropic-sdk-typescript/issues/649)) ([036a239](https://github.com/anthropics/anthropic-sdk-typescript/commit/036a239800fec7e6cbc439f125101d5475eae5b3))
|
|
62
|
+
* **types:** add `| undefined` to client options properties ([#656](https://github.com/anthropics/anthropic-sdk-typescript/issues/656)) ([d642298](https://github.com/anthropics/anthropic-sdk-typescript/commit/d642298334529ff95b9d7ac497d548a6b04dbcfb))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Documentation
|
|
66
|
+
|
|
67
|
+
* **readme:** fix misplaced period ([#650](https://github.com/anthropics/anthropic-sdk-typescript/issues/650)) ([8754744](https://github.com/anthropics/anthropic-sdk-typescript/commit/87547448c8b4bf69a61756af1f12927f33b68680))
|
|
68
|
+
* **readme:** fix Request IDs example ([#659](https://github.com/anthropics/anthropic-sdk-typescript/issues/659)) ([6d3162d](https://github.com/anthropics/anthropic-sdk-typescript/commit/6d3162da1ddb964b75e575376f278468ba1ed9f5))
|
|
69
|
+
|
|
70
|
+
## 0.34.0 (2024-12-20)
|
|
71
|
+
|
|
72
|
+
Full Changelog: [sdk-v0.33.1...sdk-v0.34.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.33.1...sdk-v0.34.0)
|
|
73
|
+
|
|
74
|
+
### Features
|
|
75
|
+
|
|
76
|
+
* **api:** add message batch delete endpoint ([#640](https://github.com/anthropics/anthropic-sdk-typescript/issues/640)) ([54f7e1f](https://github.com/anthropics/anthropic-sdk-typescript/commit/54f7e1ffb9a2956ee27a4a715b84717aa681eb7c))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Bug Fixes
|
|
80
|
+
|
|
81
|
+
* **client:** normalize method ([#639](https://github.com/anthropics/anthropic-sdk-typescript/issues/639)) ([384bb04](https://github.com/anthropics/anthropic-sdk-typescript/commit/384bb042dd854ed753c6bd8e25f522d0e042bfbf))
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### Chores
|
|
85
|
+
|
|
86
|
+
* bump testing data uri ([#637](https://github.com/anthropics/anthropic-sdk-typescript/issues/637)) ([3f23530](https://github.com/anthropics/anthropic-sdk-typescript/commit/3f23530fb55d9fec7278967ea02600e44e9f58e2))
|
|
87
|
+
* **internal:** temporary revert commit ([#643](https://github.com/anthropics/anthropic-sdk-typescript/issues/643)) ([8057b1e](https://github.com/anthropics/anthropic-sdk-typescript/commit/8057b1eb67ccccee042a45f2efe53cccced15682))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Documentation
|
|
91
|
+
|
|
92
|
+
* minor formatting changes ([#641](https://github.com/anthropics/anthropic-sdk-typescript/issues/641)) ([8b362ee](https://github.com/anthropics/anthropic-sdk-typescript/commit/8b362ee72954b31b4de920b35aed97255efa5e2e))
|
|
93
|
+
* **readme:** add alpha callout ([#646](https://github.com/anthropics/anthropic-sdk-typescript/issues/646)) ([640304c](https://github.com/anthropics/anthropic-sdk-typescript/commit/640304c7c7e8bc67cbf799a646169736d89ad4c8))
|
|
94
|
+
|
|
3
95
|
## 0.33.1 (2024-12-17)
|
|
4
96
|
|
|
5
97
|
Full Changelog: [sdk-v0.33.0...sdk-v0.33.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.33.0...sdk-v0.33.1)
|
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
> [!IMPORTANT]
|
|
2
|
+
> We're actively working on a new alpha version that migrates from `node-fetch` to builtin fetch.
|
|
3
|
+
>
|
|
4
|
+
> Please try it out and let us know if you run into any issues!
|
|
5
|
+
> https://github.com/anthropics/anthropic-sdk-typescript/issues/645
|
|
6
|
+
|
|
1
7
|
# Anthropic TypeScript API Library
|
|
2
8
|
|
|
3
9
|
[](https://npmjs.org/package/@anthropic-ai/sdk) 
|
|
@@ -235,7 +241,7 @@ All object responses in the SDK provide a `_request_id` property which is added
|
|
|
235
241
|
|
|
236
242
|
```ts
|
|
237
243
|
const message = await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-5-sonnet-latest' });
|
|
238
|
-
console.log(
|
|
244
|
+
console.log(message._request_id) // req_018EeWyXxfu5pfWkrYcMdjWG
|
|
239
245
|
```
|
|
240
246
|
|
|
241
247
|
|
|
@@ -414,23 +420,21 @@ validate or strip extra properties from the response from the API.
|
|
|
414
420
|
|
|
415
421
|
### Customizing the fetch client
|
|
416
422
|
|
|
417
|
-
By default, this library expects a global `fetch` function
|
|
423
|
+
By default, this library uses `node-fetch` in Node, and expects a global `fetch` function in other environments.
|
|
418
424
|
|
|
419
|
-
If you
|
|
425
|
+
If you would prefer to use a global, web-standards-compliant `fetch` function even in a Node environment,
|
|
426
|
+
(for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
|
|
427
|
+
add the following import before your first import `from "Anthropic"`:
|
|
420
428
|
|
|
421
429
|
```ts
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
430
|
+
// Tell TypeScript and the package to use the global web fetch instead of node-fetch.
|
|
431
|
+
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
|
|
432
|
+
import '@anthropic-ai/sdk/shims/web';
|
|
433
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
425
434
|
```
|
|
426
435
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
```ts
|
|
430
|
-
import fetch from 'my-fetch';
|
|
431
|
-
|
|
432
|
-
const client = new Anthropic({ fetch });
|
|
433
|
-
```
|
|
436
|
+
To do the inverse, add `import "@anthropic-ai/sdk/shims/node"` (which does import polyfills).
|
|
437
|
+
This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/anthropics/anthropic-sdk-typescript/tree/main/src/_shims#readme)).
|
|
434
438
|
|
|
435
439
|
### Logging and middleware
|
|
436
440
|
|
|
@@ -483,14 +487,12 @@ await client.messages.create(
|
|
|
483
487
|
);
|
|
484
488
|
```
|
|
485
489
|
|
|
486
|
-
## Frequently Asked Questions
|
|
487
|
-
|
|
488
490
|
## Semantic versioning
|
|
489
491
|
|
|
490
492
|
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
|
491
493
|
|
|
492
494
|
1. Changes that only affect static types, without breaking runtime behavior.
|
|
493
|
-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_
|
|
495
|
+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
|
|
494
496
|
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
495
497
|
|
|
496
498
|
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
@@ -499,7 +501,7 @@ We are keen for your feedback; please open an [issue](https://www.github.com/ant
|
|
|
499
501
|
|
|
500
502
|
## Requirements
|
|
501
503
|
|
|
502
|
-
TypeScript >= 4.
|
|
504
|
+
TypeScript >= 4.5 is supported.
|
|
503
505
|
|
|
504
506
|
The following runtimes are supported:
|
|
505
507
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipartBody.d.ts","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,aAAa;IACL,IAAI,EAAE,GAAG;gBAAT,IAAI,EAAE,GAAG;IAC5B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultipartBody = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
6
|
+
*/
|
|
7
|
+
class MultipartBody {
|
|
8
|
+
constructor(body) {
|
|
9
|
+
this.body = body;
|
|
10
|
+
}
|
|
11
|
+
get [Symbol.toStringTag]() {
|
|
12
|
+
return 'MultipartBody';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.MultipartBody = MultipartBody;
|
|
16
|
+
//# sourceMappingURL=MultipartBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipartBody.js","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AALD,sCAKC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
export class MultipartBody {
|
|
5
|
+
constructor(body) {
|
|
6
|
+
this.body = body;
|
|
7
|
+
}
|
|
8
|
+
get [Symbol.toStringTag]() {
|
|
9
|
+
return 'MultipartBody';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=MultipartBody.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipartBody.mjs","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
|
package/_shims/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# 👋 Wondering what everything in here does?
|
|
2
|
+
|
|
3
|
+
`@anthropic-ai/sdk` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various
|
|
4
|
+
edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM).
|
|
5
|
+
|
|
6
|
+
To do this, `@anthropic-ai/sdk` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node.
|
|
7
|
+
|
|
8
|
+
It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to
|
|
9
|
+
automatically select the correct shims for each environment. However, conditional exports are a fairly new
|
|
10
|
+
feature and not supported everywhere. For instance, the TypeScript `"moduleResolution": "node"`
|
|
11
|
+
|
|
12
|
+
setting doesn't consult the `exports` map, compared to `"moduleResolution": "nodeNext"`, which does.
|
|
13
|
+
Unfortunately that's still the default setting, and it can result in errors like
|
|
14
|
+
getting the wrong raw `Response` type from `.asResponse()`, for example.
|
|
15
|
+
|
|
16
|
+
The user can work around these issues by manually importing one of:
|
|
17
|
+
|
|
18
|
+
- `import '@anthropic-ai/sdk/shims/node'`
|
|
19
|
+
- `import '@anthropic-ai/sdk/shims/web'`
|
|
20
|
+
|
|
21
|
+
All of the code here in `_shims` handles selecting the automatic default shims or manual overrides.
|
|
22
|
+
|
|
23
|
+
### How it works - Runtime
|
|
24
|
+
|
|
25
|
+
Runtime shims get installed by calling `setShims` exported by `@anthropic-ai/sdk/_shims/registry`.
|
|
26
|
+
|
|
27
|
+
Manually importing `@anthropic-ai/sdk/shims/node` or `@anthropic-ai/sdk/shims/web`, calls `setShims` with the respective runtime shims.
|
|
28
|
+
|
|
29
|
+
All client code imports shims from `@anthropic-ai/sdk/_shims/index`, which:
|
|
30
|
+
|
|
31
|
+
- checks if shims have been set manually
|
|
32
|
+
- if not, calls `setShims` with the shims from `@anthropic-ai/sdk/_shims/auto/runtime`
|
|
33
|
+
- re-exports the installed shims from `@anthropic-ai/sdk/_shims/registry`.
|
|
34
|
+
|
|
35
|
+
`@anthropic-ai/sdk/_shims/auto/runtime` exports web runtime shims.
|
|
36
|
+
If the `node` export condition is set, the export map replaces it with `@anthropic-ai/sdk/_shims/auto/runtime-node`.
|
|
37
|
+
|
|
38
|
+
### How it works - Type time
|
|
39
|
+
|
|
40
|
+
All client code imports shim types from `@anthropic-ai/sdk/_shims/index`, which selects the manual types from `@anthropic-ai/sdk/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `@anthropic-ai/sdk/_shims/auto/types`.
|
|
41
|
+
|
|
42
|
+
`@anthropic-ai/sdk/_shims/manual-types` exports an empty namespace.
|
|
43
|
+
Manually importing `@anthropic-ai/sdk/shims/node` or `@anthropic-ai/sdk/shims/web` merges declarations into this empty namespace, so they get picked up by `@anthropic-ai/sdk/_shims/index`.
|
|
44
|
+
|
|
45
|
+
`@anthropic-ai/sdk/_shims/auto/types` exports web type definitions.
|
|
46
|
+
If the `node` export condition is set, the export map replaces it with `@anthropic-ai/sdk/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bun.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
3
|
if (k2 === undefined) k2 = k;
|
|
5
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -15,10 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
15
|
};
|
|
17
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__exportStar(require("
|
|
22
|
-
|
|
23
|
-
__exportStar(require("./utils/sleep.js"), exports);
|
|
24
|
-
//# sourceMappingURL=utils.js.map
|
|
17
|
+
/**
|
|
18
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("../bun-runtime.js"), exports);
|
|
21
|
+
//# sourceMappingURL=runtime-bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bun.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bun.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("../node-runtime.js"), exports);
|
|
21
|
+
//# sourceMappingURL=runtime-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-node.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qDAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("../web-runtime.js"), exports);
|
|
21
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("../node-types.js"), exports);
|
|
21
|
+
//# sourceMappingURL=types-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-node.js","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,mDAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
export type Agent = any;
|
|
5
|
+
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
declare const _fetch: unknown extends typeof fetch ? never : typeof fetch;
|
|
8
|
+
export { _fetch as fetch };
|
|
9
|
+
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
type _Request = unknown extends Request ? never : Request;
|
|
12
|
+
export { _Request as Request };
|
|
13
|
+
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
type _RequestInfo = unknown extends RequestInfo ? never : RequestInfo;
|
|
16
|
+
export { type _RequestInfo as RequestInfo };
|
|
17
|
+
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
type _RequestInit = unknown extends RequestInit ? never : RequestInit;
|
|
20
|
+
export { type _RequestInit as RequestInit };
|
|
21
|
+
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
type _Response = unknown extends Response ? never : Response;
|
|
24
|
+
export { _Response as Response };
|
|
25
|
+
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
type _ResponseInit = unknown extends ResponseInit ? never : ResponseInit;
|
|
28
|
+
export { type _ResponseInit as ResponseInit };
|
|
29
|
+
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
type _ResponseType = unknown extends ResponseType ? never : ResponseType;
|
|
32
|
+
export { type _ResponseType as ResponseType };
|
|
33
|
+
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
type _BodyInit = unknown extends BodyInit ? never : BodyInit;
|
|
36
|
+
export { type _BodyInit as BodyInit };
|
|
37
|
+
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
type _Headers = unknown extends Headers ? never : Headers;
|
|
40
|
+
export { _Headers as Headers };
|
|
41
|
+
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
type _HeadersInit = unknown extends HeadersInit ? never : HeadersInit;
|
|
44
|
+
export { type _HeadersInit as HeadersInit };
|
|
45
|
+
|
|
46
|
+
type EndingType = 'native' | 'transparent';
|
|
47
|
+
|
|
48
|
+
export interface BlobPropertyBag {
|
|
49
|
+
endings?: EndingType;
|
|
50
|
+
type?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface FilePropertyBag extends BlobPropertyBag {
|
|
54
|
+
lastModified?: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
58
|
+
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
type _FormData = unknown extends FormData ? never : FormData;
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
declare const _FormData: unknown extends typeof FormData ? never : typeof FormData;
|
|
63
|
+
export { _FormData as FormData };
|
|
64
|
+
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
type _File = unknown extends File ? never : File;
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
declare const _File: unknown extends typeof File ? never : typeof File;
|
|
69
|
+
export { _File as File };
|
|
70
|
+
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
type _Blob = unknown extends Blob ? never : Blob;
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
declare const _Blob: unknown extends typeof Blob ? never : typeof Blob;
|
|
75
|
+
export { _Blob as Blob };
|
|
76
|
+
|
|
77
|
+
export declare class Readable {
|
|
78
|
+
readable: boolean;
|
|
79
|
+
readonly readableEnded: boolean;
|
|
80
|
+
readonly readableFlowing: boolean | null;
|
|
81
|
+
readonly readableHighWaterMark: number;
|
|
82
|
+
readonly readableLength: number;
|
|
83
|
+
readonly readableObjectMode: boolean;
|
|
84
|
+
destroyed: boolean;
|
|
85
|
+
read(size?: number): any;
|
|
86
|
+
pause(): this;
|
|
87
|
+
resume(): this;
|
|
88
|
+
isPaused(): boolean;
|
|
89
|
+
destroy(error?: Error): this;
|
|
90
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<any>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export declare class FsReadStream extends Readable {
|
|
94
|
+
path: {}; // node type is string | Buffer
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
type _ReadableStream<R = any> = unknown extends ReadableStream<R> ? never : ReadableStream<R>;
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
declare const _ReadableStream: unknown extends typeof ReadableStream ? never : typeof ReadableStream;
|
|
101
|
+
export { _ReadableStream as ReadableStream };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bun-runtime.d.ts","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAIxC,wBAAgB,UAAU,IAAI,KAAK,CAMlC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntime = void 0;
|
|
4
|
+
const web_runtime_1 = require("./web-runtime.js");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
function getRuntime() {
|
|
7
|
+
const runtime = (0, web_runtime_1.getRuntime)();
|
|
8
|
+
function isFsReadStream(value) {
|
|
9
|
+
return value instanceof node_fs_1.ReadStream;
|
|
10
|
+
}
|
|
11
|
+
return { ...runtime, isFsReadStream };
|
|
12
|
+
}
|
|
13
|
+
exports.getRuntime = getRuntime;
|
|
14
|
+
//# sourceMappingURL=bun-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bun-runtime.js","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":";;;AAIA,kDAA4D;AAC5D,qCAAqD;AAErD,SAAgB,UAAU;IACxB,MAAM,OAAO,GAAG,IAAA,wBAAa,GAAE,CAAC;IAChC,SAAS,cAAc,CAAC,KAAU;QAChC,OAAO,KAAK,YAAY,oBAAY,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAC;AACxC,CAAC;AAND,gCAMC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getRuntime as getWebRuntime } from "./web-runtime.mjs";
|
|
2
|
+
import { ReadStream as FsReadStream } from 'node:fs';
|
|
3
|
+
export function getRuntime() {
|
|
4
|
+
const runtime = getWebRuntime();
|
|
5
|
+
function isFsReadStream(value) {
|
|
6
|
+
return value instanceof FsReadStream;
|
|
7
|
+
}
|
|
8
|
+
return { ...runtime, isFsReadStream };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=bun-runtime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bun-runtime.mjs","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":"OAIO,EAAE,UAAU,IAAI,aAAa,EAAE;OAC/B,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,SAAS;AAEpD,MAAM,UAAU,UAAU;IACxB,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;IAChC,SAAS,cAAc,CAAC,KAAU;QAChC,OAAO,KAAK,YAAY,YAAY,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAC;AACxC,CAAC"}
|