@knocklabs/node 0.6.19 → 1.0.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 +24 -7
- package/LICENSE +201 -21
- package/README.md +338 -129
- 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 +19 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +220 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +220 -0
- package/client.d.ts.map +1 -0
- package/client.js +502 -0
- package/client.js.map +1 -0
- package/client.mjs +475 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +47 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +47 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +84 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +80 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +47 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +47 -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 +112 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +112 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +183 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +174 -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 +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +19 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +7 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -0
- package/index.js +32 -0
- package/index.js.map +1 -0
- package/index.mjs +8 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +75 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +75 -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 +21 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +21 -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 +13 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +13 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +36 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +6 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +6 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +11 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +8 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +280 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +276 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/{dist/src/common/interfaces.js → internal/qs/types.js} +1 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +14 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +14 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +229 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts +33 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +33 -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/crypto.d.mts +13 -0
- package/internal/shims/crypto.d.mts.map +1 -0
- package/internal/shims/crypto.d.ts +13 -0
- package/internal/shims/crypto.d.ts.map +1 -0
- package/internal/shims/crypto.js +13 -0
- package/internal/shims/crypto.js.map +1 -0
- package/internal/shims/crypto.mjs +9 -0
- package/internal/shims/crypto.mjs.map +1 -0
- package/internal/shims/file.d.mts +23 -0
- package/internal/shims/file.d.mts.map +1 -0
- package/internal/shims/file.d.ts +23 -0
- package/internal/shims/file.d.ts.map +1 -0
- package/internal/shims/file.js +16 -0
- package/internal/shims/file.js.map +1 -0
- package/internal/shims/file.mjs +12 -0
- package/internal/shims/file.mjs.map +1 -0
- package/internal/shims/getBuiltinModule.d.mts +11 -0
- package/internal/shims/getBuiltinModule.d.mts.map +1 -0
- package/internal/shims/getBuiltinModule.d.ts +11 -0
- package/internal/shims/getBuiltinModule.d.ts.map +1 -0
- package/internal/shims/getBuiltinModule.js +71 -0
- package/internal/shims/getBuiltinModule.js.map +1 -0
- package/internal/shims/getBuiltinModule.mjs +67 -0
- package/internal/shims/getBuiltinModule.mjs.map +1 -0
- package/internal/shims/nullGetBuiltinModule.d.mts +2 -0
- package/internal/shims/nullGetBuiltinModule.d.mts.map +1 -0
- package/internal/shims/nullGetBuiltinModule.d.ts +2 -0
- package/internal/shims/nullGetBuiltinModule.d.ts.map +1 -0
- package/internal/shims/nullGetBuiltinModule.js +5 -0
- package/internal/shims/nullGetBuiltinModule.js.map +1 -0
- package/internal/shims/nullGetBuiltinModule.mjs +2 -0
- package/internal/shims/nullGetBuiltinModule.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +93 -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 +46 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +46 -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 +87 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/types.d.mts +68 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +68 -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 +44 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +44 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +131 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +122 -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 +32 -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 +38 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +38 -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 +20 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +16 -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 +24 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/lib/index.d.mts +6 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/{dist/src → lib}/index.js +6 -10
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +6 -0
- package/lib/index.mjs.map +1 -0
- package/lib/tokenSigner.d.mts +46 -0
- package/lib/tokenSigner.d.mts.map +1 -0
- package/lib/tokenSigner.d.ts +46 -0
- package/lib/tokenSigner.d.ts.map +1 -0
- package/lib/tokenSigner.js +154 -0
- package/lib/tokenSigner.js.map +1 -0
- package/lib/tokenSigner.mjs +125 -0
- package/lib/tokenSigner.mjs.map +1 -0
- package/lib/userTokens.d.mts +32 -0
- package/lib/userTokens.d.mts.map +1 -0
- package/{dist/src/common → lib}/userTokens.d.ts +7 -3
- package/lib/userTokens.d.ts.map +1 -0
- package/{dist/src/common → lib}/userTokens.js +5 -1
- package/lib/userTokens.js.map +1 -0
- package/lib/userTokens.mjs +12 -0
- package/lib/userTokens.mjs.map +1 -0
- package/package.json +157 -39
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +19 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +19 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/audiences.d.mts +123 -0
- package/resources/audiences.d.mts.map +1 -0
- package/resources/audiences.d.ts +123 -0
- package/resources/audiences.d.ts.map +1 -0
- package/resources/audiences.js +28 -0
- package/resources/audiences.js.map +1 -0
- package/resources/audiences.mjs +24 -0
- package/resources/audiences.mjs.map +1 -0
- package/resources/bulk-operations.d.mts +90 -0
- package/resources/bulk-operations.d.mts.map +1 -0
- package/resources/bulk-operations.d.ts +90 -0
- package/resources/bulk-operations.d.ts.map +1 -0
- package/resources/bulk-operations.js +16 -0
- package/resources/bulk-operations.js.map +1 -0
- package/resources/bulk-operations.mjs +12 -0
- package/resources/bulk-operations.mjs.map +1 -0
- package/resources/channels/bulk.d.mts +61 -0
- package/resources/channels/bulk.d.mts.map +1 -0
- package/resources/channels/bulk.d.ts +61 -0
- package/resources/channels/bulk.d.ts.map +1 -0
- package/resources/channels/bulk.js +19 -0
- package/resources/channels/bulk.js.map +1 -0
- package/resources/channels/bulk.mjs +15 -0
- package/resources/channels/bulk.mjs.map +1 -0
- package/resources/channels/channels.d.mts +10 -0
- package/resources/channels/channels.d.mts.map +1 -0
- package/resources/channels/channels.d.ts +10 -0
- package/resources/channels/channels.d.ts.map +1 -0
- package/resources/channels/channels.js +39 -0
- package/resources/channels/channels.js.map +1 -0
- package/resources/channels/channels.mjs +12 -0
- package/resources/channels/channels.mjs.map +1 -0
- package/resources/channels/index.d.mts +3 -0
- package/resources/channels/index.d.mts.map +1 -0
- package/resources/channels/index.d.ts +3 -0
- package/resources/channels/index.d.ts.map +1 -0
- package/resources/channels/index.js +9 -0
- package/resources/channels/index.js.map +1 -0
- package/resources/channels/index.mjs +4 -0
- package/resources/channels/index.mjs.map +1 -0
- package/resources/channels.d.mts +2 -0
- package/resources/channels.d.mts.map +1 -0
- package/resources/channels.d.ts +2 -0
- package/resources/channels.d.ts.map +1 -0
- package/resources/channels.js +19 -0
- package/resources/channels.js.map +1 -0
- package/resources/channels.mjs +3 -0
- package/resources/channels.mjs.map +1 -0
- package/resources/index.d.mts +14 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +14 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +31 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +15 -0
- package/resources/index.mjs.map +1 -0
- package/resources/integrations/census.d.mts +41 -0
- package/resources/integrations/census.d.mts.map +1 -0
- package/resources/integrations/census.d.ts +41 -0
- package/resources/integrations/census.d.ts.map +1 -0
- package/resources/integrations/census.js +15 -0
- package/resources/integrations/census.js.map +1 -0
- package/resources/integrations/census.mjs +11 -0
- package/resources/integrations/census.mjs.map +1 -0
- package/resources/integrations/hightouch.d.mts +41 -0
- package/resources/integrations/hightouch.d.mts.map +1 -0
- package/resources/integrations/hightouch.d.ts +41 -0
- package/resources/integrations/hightouch.d.ts.map +1 -0
- package/resources/integrations/hightouch.js +15 -0
- package/resources/integrations/hightouch.js.map +1 -0
- package/resources/integrations/hightouch.mjs +11 -0
- package/resources/integrations/hightouch.mjs.map +1 -0
- package/resources/integrations/index.d.mts +4 -0
- package/resources/integrations/index.d.mts.map +1 -0
- package/resources/integrations/index.d.ts +4 -0
- package/resources/integrations/index.d.ts.map +1 -0
- package/resources/integrations/index.js +11 -0
- package/resources/integrations/index.js.map +1 -0
- package/resources/integrations/index.mjs +5 -0
- package/resources/integrations/index.mjs.map +1 -0
- package/resources/integrations/integrations.d.mts +14 -0
- package/resources/integrations/integrations.d.mts.map +1 -0
- package/resources/integrations/integrations.d.ts +14 -0
- package/resources/integrations/integrations.d.ts.map +1 -0
- package/resources/integrations/integrations.js +43 -0
- package/resources/integrations/integrations.js.map +1 -0
- package/resources/integrations/integrations.mjs +16 -0
- package/resources/integrations/integrations.mjs.map +1 -0
- package/resources/integrations.d.mts +2 -0
- package/resources/integrations.d.mts.map +1 -0
- package/resources/integrations.d.ts +2 -0
- package/resources/integrations.d.ts.map +1 -0
- package/resources/integrations.js +19 -0
- package/resources/integrations.js.map +1 -0
- package/resources/integrations.mjs +3 -0
- package/resources/integrations.mjs.map +1 -0
- package/resources/messages/activities.d.mts +22 -0
- package/resources/messages/activities.d.mts.map +1 -0
- package/resources/messages/activities.d.ts +22 -0
- package/resources/messages/activities.d.ts.map +1 -0
- package/resources/messages/activities.js +17 -0
- package/resources/messages/activities.js.map +1 -0
- package/resources/messages/activities.mjs +13 -0
- package/resources/messages/activities.mjs.map +1 -0
- package/resources/messages/batch.d.mts +379 -0
- package/resources/messages/batch.d.mts.map +1 -0
- package/resources/messages/batch.d.ts +379 -0
- package/resources/messages/batch.d.ts.map +1 -0
- package/resources/messages/batch.js +71 -0
- package/resources/messages/batch.js.map +1 -0
- package/resources/messages/batch.mjs +67 -0
- package/resources/messages/batch.mjs.map +1 -0
- package/resources/messages/index.d.mts +4 -0
- package/resources/messages/index.d.mts.map +1 -0
- package/resources/messages/index.d.ts +4 -0
- package/resources/messages/index.d.ts.map +1 -0
- package/resources/messages/index.js +11 -0
- package/resources/messages/index.js.map +1 -0
- package/resources/messages/index.mjs +5 -0
- package/resources/messages/index.mjs.map +1 -0
- package/resources/messages/messages.d.mts +677 -0
- package/resources/messages/messages.d.mts.map +1 -0
- package/resources/messages/messages.d.ts +677 -0
- package/resources/messages/messages.d.ts.map +1 -0
- package/resources/messages/messages.js +144 -0
- package/resources/messages/messages.js.map +1 -0
- package/resources/messages/messages.mjs +117 -0
- package/resources/messages/messages.mjs.map +1 -0
- package/resources/messages.d.mts +2 -0
- package/resources/messages.d.mts.map +1 -0
- package/resources/messages.d.ts +2 -0
- package/resources/messages.d.ts.map +1 -0
- package/resources/messages.js +19 -0
- package/resources/messages.js.map +1 -0
- package/resources/messages.mjs +3 -0
- package/resources/messages.mjs.map +1 -0
- package/resources/objects/bulk.d.mts +59 -0
- package/resources/objects/bulk.d.mts.map +1 -0
- package/resources/objects/bulk.d.ts +59 -0
- package/resources/objects/bulk.d.ts.map +1 -0
- package/resources/objects/bulk.js +32 -0
- package/resources/objects/bulk.js.map +1 -0
- package/resources/objects/bulk.mjs +28 -0
- package/resources/objects/bulk.mjs.map +1 -0
- package/resources/objects/index.d.mts +3 -0
- package/resources/objects/index.d.mts.map +1 -0
- package/resources/objects/index.d.ts +3 -0
- package/resources/objects/index.d.ts.map +1 -0
- package/resources/objects/index.js +9 -0
- package/resources/objects/index.js.map +1 -0
- package/resources/objects/index.mjs +4 -0
- package/resources/objects/index.mjs.map +1 -0
- package/resources/objects/objects.d.mts +389 -0
- package/resources/objects/objects.d.mts.map +1 -0
- package/resources/objects/objects.d.ts +389 -0
- package/resources/objects/objects.d.ts.map +1 -0
- package/resources/objects/objects.js +163 -0
- package/resources/objects/objects.js.map +1 -0
- package/resources/objects/objects.mjs +136 -0
- package/resources/objects/objects.mjs.map +1 -0
- package/resources/objects.d.mts +2 -0
- package/resources/objects.d.mts.map +1 -0
- package/resources/objects.d.ts +2 -0
- package/resources/objects.d.ts.map +1 -0
- package/resources/objects.js +19 -0
- package/resources/objects.js.map +1 -0
- package/resources/objects.mjs +3 -0
- package/resources/objects.mjs.map +1 -0
- package/resources/providers/index.d.mts +4 -0
- package/resources/providers/index.d.mts.map +1 -0
- package/resources/providers/index.d.ts +4 -0
- package/resources/providers/index.d.ts.map +1 -0
- package/resources/providers/index.js +11 -0
- package/resources/providers/index.js.map +1 -0
- package/resources/providers/index.mjs +5 -0
- package/resources/providers/index.mjs.map +1 -0
- package/resources/providers/ms-teams.d.mts +183 -0
- package/resources/providers/ms-teams.d.mts.map +1 -0
- package/resources/providers/ms-teams.d.ts +183 -0
- package/resources/providers/ms-teams.d.ts.map +1 -0
- package/resources/providers/ms-teams.js +42 -0
- package/resources/providers/ms-teams.js.map +1 -0
- package/resources/providers/ms-teams.mjs +38 -0
- package/resources/providers/ms-teams.mjs.map +1 -0
- package/resources/providers/providers.d.mts +14 -0
- package/resources/providers/providers.d.mts.map +1 -0
- package/resources/providers/providers.d.ts +14 -0
- package/resources/providers/providers.d.ts.map +1 -0
- package/resources/providers/providers.js +43 -0
- package/resources/providers/providers.js.map +1 -0
- package/resources/providers/providers.mjs +16 -0
- package/resources/providers/providers.mjs.map +1 -0
- package/resources/providers/slack.d.mts +127 -0
- package/resources/providers/slack.d.mts.map +1 -0
- package/resources/providers/slack.d.ts +127 -0
- package/resources/providers/slack.d.ts.map +1 -0
- package/resources/providers/slack.js +33 -0
- package/resources/providers/slack.js.map +1 -0
- package/resources/providers/slack.mjs +29 -0
- package/resources/providers/slack.mjs.map +1 -0
- package/resources/providers.d.mts +2 -0
- package/resources/providers.d.mts.map +1 -0
- package/resources/providers.d.ts +2 -0
- package/resources/providers.d.ts.map +1 -0
- package/resources/providers.js +19 -0
- package/resources/providers.js.map +1 -0
- package/resources/providers.mjs +3 -0
- package/resources/providers.mjs.map +1 -0
- package/resources/recipients/channel-data.d.mts +205 -0
- package/resources/recipients/channel-data.d.mts.map +1 -0
- package/resources/recipients/channel-data.d.ts +205 -0
- package/resources/recipients/channel-data.d.ts.map +1 -0
- package/resources/recipients/channel-data.js +9 -0
- package/resources/recipients/channel-data.js.map +1 -0
- package/resources/recipients/channel-data.mjs +5 -0
- package/resources/recipients/channel-data.mjs.map +1 -0
- package/resources/recipients/index.d.mts +5 -0
- package/resources/recipients/index.d.mts.map +1 -0
- package/resources/recipients/index.d.ts +5 -0
- package/resources/recipients/index.d.ts.map +1 -0
- package/resources/recipients/index.js +13 -0
- package/resources/recipients/index.js.map +1 -0
- package/resources/recipients/index.mjs +6 -0
- package/resources/recipients/index.mjs.map +1 -0
- package/resources/recipients/preferences.d.mts +155 -0
- package/resources/recipients/preferences.d.mts.map +1 -0
- package/resources/recipients/preferences.d.ts +155 -0
- package/resources/recipients/preferences.d.ts.map +1 -0
- package/resources/recipients/preferences.js +9 -0
- package/resources/recipients/preferences.js.map +1 -0
- package/resources/recipients/preferences.mjs +5 -0
- package/resources/recipients/preferences.mjs.map +1 -0
- package/resources/recipients/recipients.d.mts +51 -0
- package/resources/recipients/recipients.d.mts.map +1 -0
- package/resources/recipients/recipients.d.ts +51 -0
- package/resources/recipients/recipients.d.ts.map +1 -0
- package/resources/recipients/recipients.js +45 -0
- package/resources/recipients/recipients.js.map +1 -0
- package/resources/recipients/recipients.mjs +18 -0
- package/resources/recipients/recipients.mjs.map +1 -0
- package/resources/recipients/subscriptions.d.mts +40 -0
- package/resources/recipients/subscriptions.d.mts.map +1 -0
- package/resources/recipients/subscriptions.d.ts +40 -0
- package/resources/recipients/subscriptions.d.ts.map +1 -0
- package/resources/recipients/subscriptions.js +9 -0
- package/resources/recipients/subscriptions.js.map +1 -0
- package/resources/recipients/subscriptions.mjs +5 -0
- package/resources/recipients/subscriptions.mjs.map +1 -0
- package/resources/recipients.d.mts +2 -0
- package/resources/recipients.d.mts.map +1 -0
- package/resources/recipients.d.ts +2 -0
- package/resources/recipients.d.ts.map +1 -0
- package/resources/recipients.js +19 -0
- package/resources/recipients.js.map +1 -0
- package/resources/recipients.mjs +3 -0
- package/resources/recipients.mjs.map +1 -0
- package/resources/schedules/bulk.d.mts +68 -0
- package/resources/schedules/bulk.d.mts.map +1 -0
- package/resources/schedules/bulk.d.ts +68 -0
- package/resources/schedules/bulk.d.ts.map +1 -0
- package/resources/schedules/bulk.js +17 -0
- package/resources/schedules/bulk.js.map +1 -0
- package/resources/schedules/bulk.mjs +13 -0
- package/resources/schedules/bulk.mjs.map +1 -0
- package/resources/schedules/index.d.mts +3 -0
- package/resources/schedules/index.d.mts.map +1 -0
- package/resources/schedules/index.d.ts +3 -0
- package/resources/schedules/index.d.ts.map +1 -0
- package/resources/schedules/index.js +9 -0
- package/resources/schedules/index.js.map +1 -0
- package/resources/schedules/index.mjs +4 -0
- package/resources/schedules/index.mjs.map +1 -0
- package/resources/schedules/schedules.d.mts +225 -0
- package/resources/schedules/schedules.d.mts.map +1 -0
- package/resources/schedules/schedules.d.ts +225 -0
- package/resources/schedules/schedules.d.ts.map +1 -0
- package/resources/schedules/schedules.js +74 -0
- package/resources/schedules/schedules.js.map +1 -0
- package/resources/schedules/schedules.mjs +47 -0
- package/resources/schedules/schedules.mjs.map +1 -0
- package/resources/schedules.d.mts +2 -0
- package/resources/schedules.d.mts.map +1 -0
- package/resources/schedules.d.ts +2 -0
- package/resources/schedules.d.ts.map +1 -0
- package/resources/schedules.js +19 -0
- package/resources/schedules.js.map +1 -0
- package/resources/schedules.mjs +3 -0
- package/resources/schedules.mjs.map +1 -0
- package/resources/shared.d.mts +45 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +45 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +9 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +5 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/tenants/bulk.d.mts +31 -0
- package/resources/tenants/bulk.d.mts.map +1 -0
- package/resources/tenants/bulk.d.ts +31 -0
- package/resources/tenants/bulk.d.ts.map +1 -0
- package/resources/tenants/bulk.js +22 -0
- package/resources/tenants/bulk.js.map +1 -0
- package/resources/tenants/bulk.mjs +18 -0
- package/resources/tenants/bulk.mjs.map +1 -0
- package/resources/tenants/index.d.mts +3 -0
- package/resources/tenants/index.d.mts.map +1 -0
- package/resources/tenants/index.d.ts +3 -0
- package/resources/tenants/index.d.ts.map +1 -0
- package/resources/tenants/index.js +9 -0
- package/resources/tenants/index.js.map +1 -0
- package/resources/tenants/index.mjs +4 -0
- package/resources/tenants/index.mjs.map +1 -0
- package/resources/tenants/tenants.d.mts +233 -0
- package/resources/tenants/tenants.d.mts.map +1 -0
- package/resources/tenants/tenants.d.ts +233 -0
- package/resources/tenants/tenants.d.ts.map +1 -0
- package/resources/tenants/tenants.js +66 -0
- package/resources/tenants/tenants.js.map +1 -0
- package/resources/tenants/tenants.mjs +39 -0
- package/resources/tenants/tenants.mjs.map +1 -0
- package/resources/tenants.d.mts +2 -0
- package/resources/tenants.d.mts.map +1 -0
- package/resources/tenants.d.ts +2 -0
- package/resources/tenants.d.ts.map +1 -0
- package/resources/tenants.js +19 -0
- package/resources/tenants.js.map +1 -0
- package/resources/tenants.mjs +3 -0
- package/resources/tenants.mjs.map +1 -0
- package/resources/users/bulk.d.mts +51 -0
- package/resources/users/bulk.d.mts.map +1 -0
- package/resources/users/bulk.d.ts +51 -0
- package/resources/users/bulk.d.ts.map +1 -0
- package/resources/users/bulk.js +32 -0
- package/resources/users/bulk.js.map +1 -0
- package/resources/users/bulk.mjs +28 -0
- package/resources/users/bulk.mjs.map +1 -0
- package/resources/users/feeds.d.mts +229 -0
- package/resources/users/feeds.d.mts.map +1 -0
- package/resources/users/feeds.d.ts +229 -0
- package/resources/users/feeds.d.ts.map +1 -0
- package/resources/users/feeds.js +24 -0
- package/resources/users/feeds.js.map +1 -0
- package/resources/users/feeds.mjs +20 -0
- package/resources/users/feeds.mjs.map +1 -0
- package/resources/users/guides.d.mts +225 -0
- package/resources/users/guides.d.mts.map +1 -0
- package/resources/users/guides.d.ts +225 -0
- package/resources/users/guides.d.ts.map +1 -0
- package/resources/users/guides.js +46 -0
- package/resources/users/guides.js.map +1 -0
- package/resources/users/guides.mjs +42 -0
- package/resources/users/guides.mjs.map +1 -0
- package/resources/users/index.d.mts +5 -0
- package/resources/users/index.d.mts.map +1 -0
- package/resources/users/index.d.ts +5 -0
- package/resources/users/index.d.ts.map +1 -0
- package/resources/users/index.js +13 -0
- package/resources/users/index.js.map +1 -0
- package/resources/users/index.mjs +6 -0
- package/resources/users/index.mjs.map +1 -0
- package/resources/users/users.d.mts +431 -0
- package/resources/users/users.d.mts.map +1 -0
- package/resources/users/users.d.ts +431 -0
- package/resources/users/users.d.ts.map +1 -0
- package/resources/users/users.js +145 -0
- package/resources/users/users.js.map +1 -0
- package/resources/users/users.mjs +118 -0
- package/resources/users/users.mjs.map +1 -0
- package/resources/users.d.mts +2 -0
- package/resources/users.d.mts.map +1 -0
- package/resources/users.d.ts +2 -0
- package/resources/users.d.ts.map +1 -0
- package/resources/users.js +19 -0
- package/resources/users.js.map +1 -0
- package/resources/users.mjs +3 -0
- package/resources/users.mjs.map +1 -0
- package/resources/workflows.d.mts +83 -0
- package/resources/workflows.d.mts.map +1 -0
- package/resources/workflows.d.ts +83 -0
- package/resources/workflows.d.ts.map +1 -0
- package/resources/workflows.js +28 -0
- package/resources/workflows.js.map +1 -0
- package/resources/workflows.mjs +24 -0
- package/resources/workflows.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +18 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +967 -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 +323 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +23 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +9 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +388 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/request-options.ts +37 -0
- package/src/internal/shim-types.d.ts +28 -0
- package/src/internal/shims/crypto.ts +18 -0
- package/src/internal/shims/file.ts +32 -0
- package/src/internal/shims/getBuiltinModule.ts +66 -0
- package/src/internal/shims/nullGetBuiltinModule.ts +1 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +152 -0
- package/src/internal/types.ts +92 -0
- package/src/internal/uploads.ts +175 -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 +63 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +19 -0
- package/src/internal/utils/values.ts +102 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/lib/index.ts +6 -0
- package/src/lib/tokenSigner.ts +170 -0
- package/src/lib/userTokens.ts +38 -0
- package/src/pagination.ts +2 -0
- package/src/resource.ts +2 -0
- package/src/resources/audiences.ts +163 -0
- package/src/resources/bulk-operations.ts +113 -0
- package/src/resources/channels/bulk.ts +107 -0
- package/src/resources/channels/channels.ts +15 -0
- package/src/resources/channels/index.ts +4 -0
- package/src/resources/channels.ts +3 -0
- package/src/resources/index.ts +108 -0
- package/src/resources/integrations/census.ts +58 -0
- package/src/resources/integrations/hightouch.ts +58 -0
- package/src/resources/integrations/index.ts +9 -0
- package/src/resources/integrations/integrations.ts +33 -0
- package/src/resources/integrations.ts +3 -0
- package/src/resources/messages/activities.ts +38 -0
- package/src/resources/messages/batch.ts +499 -0
- package/src/resources/messages/index.ts +39 -0
- package/src/resources/messages/messages.ts +954 -0
- package/src/resources/messages.ts +3 -0
- package/src/resources/objects/bulk.ts +92 -0
- package/src/resources/objects/index.ts +23 -0
- package/src/resources/objects/objects.ts +623 -0
- package/src/resources/objects.ts +3 -0
- package/src/resources/providers/index.ts +25 -0
- package/src/resources/providers/ms-teams.ts +260 -0
- package/src/resources/providers/providers.ts +61 -0
- package/src/resources/providers/slack.ts +186 -0
- package/src/resources/providers.ts +3 -0
- package/src/resources/recipients/channel-data.ts +255 -0
- package/src/resources/recipients/index.ts +22 -0
- package/src/resources/recipients/preferences.ts +192 -0
- package/src/resources/recipients/recipients.ts +101 -0
- package/src/resources/recipients/subscriptions.ts +49 -0
- package/src/resources/recipients.ts +3 -0
- package/src/resources/schedules/bulk.ts +82 -0
- package/src/resources/schedules/index.ts +16 -0
- package/src/resources/schedules/schedules.ts +295 -0
- package/src/resources/schedules.ts +3 -0
- package/src/resources/shared.ts +72 -0
- package/src/resources/tenants/bulk.ts +42 -0
- package/src/resources/tenants/index.ts +13 -0
- package/src/resources/tenants/tenants.ts +300 -0
- package/src/resources/tenants.ts +3 -0
- package/src/resources/users/bulk.ts +73 -0
- package/src/resources/users/feeds.ts +296 -0
- package/src/resources/users/guides.ts +318 -0
- package/src/resources/users/index.ts +40 -0
- package/src/resources/users/users.ts +666 -0
- package/src/resources/users.ts +3 -0
- package/src/resources/workflows.ts +110 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +19 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
- package/dist/package.json +0 -48
- package/dist/src/common/exceptions.d.ts +0 -48
- package/dist/src/common/exceptions.js +0 -78
- package/dist/src/common/fetchClient.d.ts +0 -28
- package/dist/src/common/fetchClient.js +0 -148
- package/dist/src/common/interfaces.d.ts +0 -70
- package/dist/src/index.d.ts +0 -8
- package/dist/src/knock.d.ts +0 -57
- package/dist/src/knock.js +0 -241
- package/dist/src/resources/activities/interfaces.d.ts +0 -11
- package/dist/src/resources/activities/interfaces.js +0 -2
- package/dist/src/resources/bulk_operations/index.d.ts +0 -7
- package/dist/src/resources/bulk_operations/index.js +0 -24
- package/dist/src/resources/bulk_operations/interfaces.d.ts +0 -12
- package/dist/src/resources/bulk_operations/interfaces.js +0 -2
- package/dist/src/resources/messages/index.d.ts +0 -16
- package/dist/src/resources/messages/index.js +0 -93
- package/dist/src/resources/messages/interfaces.d.ts +0 -58
- package/dist/src/resources/messages/interfaces.js +0 -2
- package/dist/src/resources/objects/index.d.ts +0 -36
- package/dist/src/resources/objects/index.js +0 -203
- package/dist/src/resources/objects/interfaces.d.ts +0 -51
- package/dist/src/resources/objects/interfaces.js +0 -2
- package/dist/src/resources/preferences/helpers.d.ts +0 -7
- package/dist/src/resources/preferences/helpers.js +0 -11
- package/dist/src/resources/preferences/interfaces.d.ts +0 -30
- package/dist/src/resources/preferences/interfaces.js +0 -2
- package/dist/src/resources/slack/index.d.ts +0 -9
- package/dist/src/resources/slack/index.js +0 -75
- package/dist/src/resources/slack/interfaces.d.ts +0 -30
- package/dist/src/resources/slack/interfaces.js +0 -2
- package/dist/src/resources/tenants/index.d.ts +0 -11
- package/dist/src/resources/tenants/index.js +0 -42
- package/dist/src/resources/tenants/interfaces.d.ts +0 -32
- package/dist/src/resources/tenants/interfaces.js +0 -2
- package/dist/src/resources/users/index.d.ts +0 -36
- package/dist/src/resources/users/index.js +0 -232
- package/dist/src/resources/users/interfaces.d.ts +0 -34
- package/dist/src/resources/users/interfaces.js +0 -2
- package/dist/src/resources/workflows/index.d.ts +0 -13
- package/dist/src/resources/workflows/index.js +0 -72
- package/dist/src/resources/workflows/interfaces.d.ts +0 -90
- package/dist/src/resources/workflows/interfaces.js +0 -20
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/internal/types.ts"],"names":[],"mappings":";AAEA,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC/C,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;CAAE,CAAC;AAE7D,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtE,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,G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C,OAAO,8CAA8C,EAAE,WAAW,CAAC,GAAG,MAAM,CAAC,OAAO,iDAAiD,EAAE,WAAW,CAAC,GAAG,MAAM,CAAC,OAAO,oDAAoD,EAAE,WAAW,CAAC,GAAG,MAAM,CAAC,OAAO,uDAAuD,EAAE,WAAW,CAAC,CAAC;AAC/uB,wCAAwC;AACxC,KAAK,gBAAgB,GAAG,WAAW,CAAC,oBAAoB,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAG3E,KAAK,YAAY,GACb,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,iBAAiB,CAAC,GACzB,MAAM,CAAC,cAAc,CAAC,GACtB,MAAM,CAAC,oBAAoB,CAAC,GAC5B,MAAM,CAAC,WAAW,CAAC,GACnB,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE7B;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY;AAC1C,sFAAsF;AACtF,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/internal/types.ts"],"names":[],"mappings":";AAAA,sFAAsF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/internal/types.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import { type RequestOptions } from "./request-options.mjs";
|
|
4
|
+
import type { FilePropertyBag, Fetch } from "./builtin-types.mjs";
|
|
5
|
+
import type { Knock } from "../client.mjs";
|
|
6
|
+
import { type File } from "./shims/file.mjs";
|
|
7
|
+
export type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob | DataView;
|
|
8
|
+
type FsReadStream = AsyncIterable<Uint8Array> & {
|
|
9
|
+
path: string | {
|
|
10
|
+
toString(): string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
interface BunFile extends Blob {
|
|
14
|
+
readonly name?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Typically, this is a native "File" class.
|
|
18
|
+
*
|
|
19
|
+
* We provide the {@link toFile} utility to convert a variety of objects
|
|
20
|
+
* into the File class.
|
|
21
|
+
*
|
|
22
|
+
* For convenience, you can also pass a fetch Response, or in Node,
|
|
23
|
+
* the result of fs.createReadStream().
|
|
24
|
+
*/
|
|
25
|
+
export type Uploadable = File | Response | FsReadStream | BunFile;
|
|
26
|
+
/**
|
|
27
|
+
* Construct a `File` instance. This is used to ensure a helpful error is thrown
|
|
28
|
+
* for environments that don't define a global `File` yet.
|
|
29
|
+
*/
|
|
30
|
+
export declare function makeFile(fileBits: BlobPart[], fileName: string | undefined, options?: FilePropertyBag): File;
|
|
31
|
+
export declare function getName(value: any): string | undefined;
|
|
32
|
+
export declare const isAsyncIterable: (value: any) => value is AsyncIterable<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.
|
|
35
|
+
* Otherwise returns the request as is.
|
|
36
|
+
*/
|
|
37
|
+
export declare const maybeMultipartFormRequestOptions: (opts: RequestOptions, fetch: Knock | Fetch) => Promise<RequestOptions>;
|
|
38
|
+
type MultipartFormRequestOptions = Omit<RequestOptions, 'body'> & {
|
|
39
|
+
body: unknown;
|
|
40
|
+
};
|
|
41
|
+
export declare const multipartFormRequestOptions: (opts: MultipartFormRequestOptions, fetch: Knock | Fetch) => Promise<RequestOptions>;
|
|
42
|
+
export declare const createForm: <T = Record<string, unknown>>(body: T | undefined, fetch: Knock | Fetch) => Promise<FormData>;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=uploads.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.d.mts","sourceRoot":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,GAAG,KAAK,KACnB,QAAQ,QAAQ,CASlB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import { type RequestOptions } from "./request-options.js";
|
|
4
|
+
import type { FilePropertyBag, Fetch } from "./builtin-types.js";
|
|
5
|
+
import type { Knock } from "../client.js";
|
|
6
|
+
import { type File } from "./shims/file.js";
|
|
7
|
+
export type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob | DataView;
|
|
8
|
+
type FsReadStream = AsyncIterable<Uint8Array> & {
|
|
9
|
+
path: string | {
|
|
10
|
+
toString(): string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
interface BunFile extends Blob {
|
|
14
|
+
readonly name?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Typically, this is a native "File" class.
|
|
18
|
+
*
|
|
19
|
+
* We provide the {@link toFile} utility to convert a variety of objects
|
|
20
|
+
* into the File class.
|
|
21
|
+
*
|
|
22
|
+
* For convenience, you can also pass a fetch Response, or in Node,
|
|
23
|
+
* the result of fs.createReadStream().
|
|
24
|
+
*/
|
|
25
|
+
export type Uploadable = File | Response | FsReadStream | BunFile;
|
|
26
|
+
/**
|
|
27
|
+
* Construct a `File` instance. This is used to ensure a helpful error is thrown
|
|
28
|
+
* for environments that don't define a global `File` yet.
|
|
29
|
+
*/
|
|
30
|
+
export declare function makeFile(fileBits: BlobPart[], fileName: string | undefined, options?: FilePropertyBag): File;
|
|
31
|
+
export declare function getName(value: any): string | undefined;
|
|
32
|
+
export declare const isAsyncIterable: (value: any) => value is AsyncIterable<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.
|
|
35
|
+
* Otherwise returns the request as is.
|
|
36
|
+
*/
|
|
37
|
+
export declare const maybeMultipartFormRequestOptions: (opts: RequestOptions, fetch: Knock | Fetch) => Promise<RequestOptions>;
|
|
38
|
+
type MultipartFormRequestOptions = Omit<RequestOptions, 'body'> & {
|
|
39
|
+
body: unknown;
|
|
40
|
+
};
|
|
41
|
+
export declare const multipartFormRequestOptions: (opts: MultipartFormRequestOptions, fetch: Knock | Fetch) => Promise<RequestOptions>;
|
|
42
|
+
export declare const createForm: <T = Record<string, unknown>>(body: T | undefined, fetch: Knock | Fetch) => Promise<FormData>;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=uploads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["../src/internal/uploads.ts"],"names":[],"mappings":";;OAAO,EAAE,KAAK,cAAc,EAAE;OACvB,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;OAC/B,KAAK,EAAE,KAAK,EAAE;OACd,EAAE,KAAK,IAAI,EAAW;AAG7B,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,eAAe,GAAG,IAAI,GAAG,QAAQ,CAAC;AAChF,KAAK,YAAY,GAAG,aAAa,CAAC,UAAU,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,GAAG;QAAE,QAAQ,IAAI,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAG1F,UAAU,OAAQ,SAAQ,IAAI;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC;AAElE;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,QAAQ,EAAE,EACpB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,CAAC,EAAE,eAAe,GACxB,IAAI,CAGN;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CActD;AAED,eAAO,MAAM,eAAe,UAAW,GAAG,gCACuD,CAAC;AAElG;;;GAGG;AACH,eAAO,MAAM,gCAAgC,SACrC,cAAc,SACb,KAAK,GAAG,KAAK,KACnB,QAAQ,cAAc,CAIxB,CAAC;AAEF,KAAK,2BAA2B,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpF,eAAO,MAAM,2BAA2B,SAChC,2BAA2B,SAC1B,KAAK,GAAG,KAAK,KACnB,QAAQ,cAAc,CAExB,CAAC;AAkCF,eAAO,MAAM,UAAU,4DAEd,KAAK,GAAG,KAAK,KACnB,QAAQ,QAAQ,CASlB,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createForm = exports.multipartFormRequestOptions = exports.maybeMultipartFormRequestOptions = exports.isAsyncIterable = exports.getName = exports.makeFile = void 0;
|
|
4
|
+
const file_1 = require("./shims/file.js");
|
|
5
|
+
const shims_1 = require("./shims.js");
|
|
6
|
+
/**
|
|
7
|
+
* Construct a `File` instance. This is used to ensure a helpful error is thrown
|
|
8
|
+
* for environments that don't define a global `File` yet.
|
|
9
|
+
*/
|
|
10
|
+
function makeFile(fileBits, fileName, options) {
|
|
11
|
+
const File = (0, file_1.getFile)();
|
|
12
|
+
return new File(fileBits, fileName ?? 'unknown_file', options);
|
|
13
|
+
}
|
|
14
|
+
exports.makeFile = makeFile;
|
|
15
|
+
function getName(value) {
|
|
16
|
+
return (((typeof value === 'object' &&
|
|
17
|
+
value !== null &&
|
|
18
|
+
(('name' in value && value.name && String(value.name)) ||
|
|
19
|
+
('url' in value && value.url && String(value.url)) ||
|
|
20
|
+
('filename' in value && value.filename && String(value.filename)) ||
|
|
21
|
+
('path' in value && value.path && String(value.path)))) ||
|
|
22
|
+
'')
|
|
23
|
+
.split(/[\\/]/)
|
|
24
|
+
.pop() || undefined);
|
|
25
|
+
}
|
|
26
|
+
exports.getName = getName;
|
|
27
|
+
const isAsyncIterable = (value) => value != null && typeof value === 'object' && typeof value[Symbol.asyncIterator] === 'function';
|
|
28
|
+
exports.isAsyncIterable = isAsyncIterable;
|
|
29
|
+
/**
|
|
30
|
+
* Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.
|
|
31
|
+
* Otherwise returns the request as is.
|
|
32
|
+
*/
|
|
33
|
+
const maybeMultipartFormRequestOptions = async (opts, fetch) => {
|
|
34
|
+
if (!hasUploadableValue(opts.body))
|
|
35
|
+
return opts;
|
|
36
|
+
return { ...opts, body: await (0, exports.createForm)(opts.body, fetch) };
|
|
37
|
+
};
|
|
38
|
+
exports.maybeMultipartFormRequestOptions = maybeMultipartFormRequestOptions;
|
|
39
|
+
const multipartFormRequestOptions = async (opts, fetch) => {
|
|
40
|
+
return { ...opts, body: await (0, exports.createForm)(opts.body, fetch) };
|
|
41
|
+
};
|
|
42
|
+
exports.multipartFormRequestOptions = multipartFormRequestOptions;
|
|
43
|
+
const supportsFormDataMap = new WeakMap();
|
|
44
|
+
/**
|
|
45
|
+
* node-fetch doesn't support the global FormData object in recent node versions. Instead of sending
|
|
46
|
+
* properly-encoded form data, it just stringifies the object, resulting in a request body of "[object FormData]".
|
|
47
|
+
* This function detects if the fetch function provided supports the global FormData object to avoid
|
|
48
|
+
* confusing error messages later on.
|
|
49
|
+
*/
|
|
50
|
+
function supportsFormData(fetchObject) {
|
|
51
|
+
const fetch = typeof fetchObject === 'function' ? fetchObject : fetchObject.fetch;
|
|
52
|
+
const cached = supportsFormDataMap.get(fetch);
|
|
53
|
+
if (cached)
|
|
54
|
+
return cached;
|
|
55
|
+
const promise = (async () => {
|
|
56
|
+
try {
|
|
57
|
+
const FetchResponse = ('Response' in fetch ?
|
|
58
|
+
fetch.Response
|
|
59
|
+
: (await fetch('data:,')).constructor);
|
|
60
|
+
const data = new FormData();
|
|
61
|
+
if (data.toString() === (await new FetchResponse(data).text())) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// avoid false negatives
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
})();
|
|
71
|
+
supportsFormDataMap.set(fetch, promise);
|
|
72
|
+
return promise;
|
|
73
|
+
}
|
|
74
|
+
const createForm = async (body, fetch) => {
|
|
75
|
+
if (!(await supportsFormData(fetch))) {
|
|
76
|
+
throw new TypeError('The provided fetch function does not support file uploads with the current global FormData class.');
|
|
77
|
+
}
|
|
78
|
+
const form = new FormData();
|
|
79
|
+
await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue(form, key, value)));
|
|
80
|
+
return form;
|
|
81
|
+
};
|
|
82
|
+
exports.createForm = createForm;
|
|
83
|
+
// We check for Blob not File because Bun.File doesn't inherit from File,
|
|
84
|
+
// but they both inherit from Blob and have a `name` property at runtime.
|
|
85
|
+
const isNamedBlob = (value) => value instanceof (0, file_1.getFile)() || (value instanceof Blob && 'name' in value);
|
|
86
|
+
const isUploadable = (value) => typeof value === 'object' &&
|
|
87
|
+
value !== null &&
|
|
88
|
+
(value instanceof Response || (0, exports.isAsyncIterable)(value) || isNamedBlob(value));
|
|
89
|
+
const hasUploadableValue = (value) => {
|
|
90
|
+
if (isUploadable(value))
|
|
91
|
+
return true;
|
|
92
|
+
if (Array.isArray(value))
|
|
93
|
+
return value.some(hasUploadableValue);
|
|
94
|
+
if (value && typeof value === 'object') {
|
|
95
|
+
for (const k in value) {
|
|
96
|
+
if (hasUploadableValue(value[k]))
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
};
|
|
102
|
+
const addFormValue = async (form, key, value) => {
|
|
103
|
+
if (value === undefined)
|
|
104
|
+
return;
|
|
105
|
+
if (value == null) {
|
|
106
|
+
throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`);
|
|
107
|
+
}
|
|
108
|
+
// TODO: make nested formats configurable
|
|
109
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
110
|
+
form.append(key, String(value));
|
|
111
|
+
}
|
|
112
|
+
else if (value instanceof Response) {
|
|
113
|
+
form.append(key, makeFile([await value.blob()], getName(value)));
|
|
114
|
+
}
|
|
115
|
+
else if ((0, exports.isAsyncIterable)(value)) {
|
|
116
|
+
form.append(key, makeFile([await new Response((0, shims_1.ReadableStreamFrom)(value)).blob()], getName(value)));
|
|
117
|
+
}
|
|
118
|
+
else if (isNamedBlob(value)) {
|
|
119
|
+
form.append(key, value, getName(value));
|
|
120
|
+
}
|
|
121
|
+
else if (Array.isArray(value)) {
|
|
122
|
+
await Promise.all(value.map((entry) => addFormValue(form, key + '[]', entry)));
|
|
123
|
+
}
|
|
124
|
+
else if (typeof value === 'object') {
|
|
125
|
+
await Promise.all(Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop)));
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=uploads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.js","sourceRoot":"","sources":["../src/internal/uploads.ts"],"names":[],"mappings":";;;AAGA,0CAAkD;AAClD,sCAA6C;AAqB7C;;;GAGG;AACH,SAAgB,QAAQ,CACtB,QAAoB,EACpB,QAA4B,EAC5B,OAAyB;IAEzB,MAAM,IAAI,GAAG,IAAA,cAAO,GAAE,CAAC;IACvB,OAAO,IAAI,IAAI,CAAC,QAAe,EAAE,QAAQ,IAAI,cAAc,EAAE,OAAO,CAAC,CAAC;AACxE,CAAC;AAPD,4BAOC;AAED,SAAgB,OAAO,CAAC,KAAU;IAChC,OAAO,CACL,CACE,CAAC,OAAO,KAAK,KAAK,QAAQ;QACxB,KAAK,KAAK,IAAI;QACd,CAAC,CAAC,MAAM,IAAI,KAAK,IA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AAG,CACf,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC,CACzF,CAAC;KACH;SAAM;QACL,MAAM,IAAI,SAAS,CACjB,wGAAwG,KAAK,UAAU,CACxH,CAAC;KACH;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { getFile } from "./shims/file.mjs";
|
|
2
|
+
import { ReadableStreamFrom } from "./shims.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Construct a `File` instance. This is used to ensure a helpful error is thrown
|
|
5
|
+
* for environments that don't define a global `File` yet.
|
|
6
|
+
*/
|
|
7
|
+
export function makeFile(fileBits, fileName, options) {
|
|
8
|
+
const File = getFile();
|
|
9
|
+
return new File(fileBits, fileName ?? 'unknown_file', options);
|
|
10
|
+
}
|
|
11
|
+
export function getName(value) {
|
|
12
|
+
return (((typeof value === 'object' &&
|
|
13
|
+
value !== null &&
|
|
14
|
+
(('name' in value && value.name && String(value.name)) ||
|
|
15
|
+
('url' in value && value.url && String(value.url)) ||
|
|
16
|
+
('filename' in value && value.filename && String(value.filename)) ||
|
|
17
|
+
('path' in value && value.path && String(value.path)))) ||
|
|
18
|
+
'')
|
|
19
|
+
.split(/[\\/]/)
|
|
20
|
+
.pop() || undefined);
|
|
21
|
+
}
|
|
22
|
+
export const isAsyncIterable = (value) => value != null && typeof value === 'object' && typeof value[Symbol.asyncIterator] === 'function';
|
|
23
|
+
/**
|
|
24
|
+
* Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.
|
|
25
|
+
* Otherwise returns the request as is.
|
|
26
|
+
*/
|
|
27
|
+
export const maybeMultipartFormRequestOptions = async (opts, fetch) => {
|
|
28
|
+
if (!hasUploadableValue(opts.body))
|
|
29
|
+
return opts;
|
|
30
|
+
return { ...opts, body: await createForm(opts.body, fetch) };
|
|
31
|
+
};
|
|
32
|
+
export const multipartFormRequestOptions = async (opts, fetch) => {
|
|
33
|
+
return { ...opts, body: await createForm(opts.body, fetch) };
|
|
34
|
+
};
|
|
35
|
+
const supportsFormDataMap = new WeakMap();
|
|
36
|
+
/**
|
|
37
|
+
* node-fetch doesn't support the global FormData object in recent node versions. Instead of sending
|
|
38
|
+
* properly-encoded form data, it just stringifies the object, resulting in a request body of "[object FormData]".
|
|
39
|
+
* This function detects if the fetch function provided supports the global FormData object to avoid
|
|
40
|
+
* confusing error messages later on.
|
|
41
|
+
*/
|
|
42
|
+
function supportsFormData(fetchObject) {
|
|
43
|
+
const fetch = typeof fetchObject === 'function' ? fetchObject : fetchObject.fetch;
|
|
44
|
+
const cached = supportsFormDataMap.get(fetch);
|
|
45
|
+
if (cached)
|
|
46
|
+
return cached;
|
|
47
|
+
const promise = (async () => {
|
|
48
|
+
try {
|
|
49
|
+
const FetchResponse = ('Response' in fetch ?
|
|
50
|
+
fetch.Response
|
|
51
|
+
: (await fetch('data:,')).constructor);
|
|
52
|
+
const data = new FormData();
|
|
53
|
+
if (data.toString() === (await new FetchResponse(data).text())) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// avoid false negatives
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
})();
|
|
63
|
+
supportsFormDataMap.set(fetch, promise);
|
|
64
|
+
return promise;
|
|
65
|
+
}
|
|
66
|
+
export const createForm = async (body, fetch) => {
|
|
67
|
+
if (!(await supportsFormData(fetch))) {
|
|
68
|
+
throw new TypeError('The provided fetch function does not support file uploads with the current global FormData class.');
|
|
69
|
+
}
|
|
70
|
+
const form = new FormData();
|
|
71
|
+
await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue(form, key, value)));
|
|
72
|
+
return form;
|
|
73
|
+
};
|
|
74
|
+
// We check for Blob not File because Bun.File doesn't inherit from File,
|
|
75
|
+
// but they both inherit from Blob and have a `name` property at runtime.
|
|
76
|
+
const isNamedBlob = (value) => value instanceof getFile() || (value instanceof Blob && 'name' in value);
|
|
77
|
+
const isUploadable = (value) => typeof value === 'object' &&
|
|
78
|
+
value !== null &&
|
|
79
|
+
(value instanceof Response || isAsyncIterable(value) || isNamedBlob(value));
|
|
80
|
+
const hasUploadableValue = (value) => {
|
|
81
|
+
if (isUploadable(value))
|
|
82
|
+
return true;
|
|
83
|
+
if (Array.isArray(value))
|
|
84
|
+
return value.some(hasUploadableValue);
|
|
85
|
+
if (value && typeof value === 'object') {
|
|
86
|
+
for (const k in value) {
|
|
87
|
+
if (hasUploadableValue(value[k]))
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
92
|
+
};
|
|
93
|
+
const addFormValue = async (form, key, value) => {
|
|
94
|
+
if (value === undefined)
|
|
95
|
+
return;
|
|
96
|
+
if (value == null) {
|
|
97
|
+
throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`);
|
|
98
|
+
}
|
|
99
|
+
// TODO: make nested formats configurable
|
|
100
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
101
|
+
form.append(key, String(value));
|
|
102
|
+
}
|
|
103
|
+
else if (value instanceof Response) {
|
|
104
|
+
form.append(key, makeFile([await value.blob()], getName(value)));
|
|
105
|
+
}
|
|
106
|
+
else if (isAsyncIterable(value)) {
|
|
107
|
+
form.append(key, makeFile([await new Response(ReadableStreamFrom(value)).blob()], getName(value)));
|
|
108
|
+
}
|
|
109
|
+
else if (isNamedBlob(value)) {
|
|
110
|
+
form.append(key, value, getName(value));
|
|
111
|
+
}
|
|
112
|
+
else if (Array.isArray(value)) {
|
|
113
|
+
await Promise.all(value.map((entry) => addFormValue(form, key + '[]', entry)));
|
|
114
|
+
}
|
|
115
|
+
else if (typeof value === 'object') {
|
|
116
|
+
await Promise.all(Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop)));
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=uploads.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["../src/internal/uploads.ts"],"names":[],"mappings":"OAGO,EAAa,OAAO,EAAE;OACtB,EAAE,kBAAkB,EAAE;AAqB7B;;;GAGG;AACH,MAAM,UAAU,QAAQ,CACtB,QAAoB,EACpB,QAA4B,EAC5B,OAAyB;IAEzB,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,OAAO,IAAI,IAAI,CAAC,QAAe,EAAE,QAAQ,IAAI,cAAc,EAAE,OAAO,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,KAAU;IAChC,OAAO,CACL,CACE,CAAC,OAAO,KAAK,KAAK,QAAQ;QACxB,KAAK,KAAK,IAAI;QACd,CAAC,CAAC,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpD,CAAC,KAAK,IAAI,KAAK,IAAI,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAClD,CAAC,UAAU,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACjE,CAAC,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3D,EAAE,CACH;SACE,KAAK,CAAC,OAAO,CAAC;SACd,GAAG,EAAE,IAAI,SAAS,CACtB,CAAC;AACJ,CAAC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3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src/internal/utils/base64.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,SAAU,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,KAAG,MAgBvE,CAAC;AAEF,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,UAgBxC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.fromBase64 = exports.toBase64 = void 0;
|
|
5
|
+
const error_1 = require("../../core/error.js");
|
|
6
|
+
const bytes_1 = require("./bytes.js");
|
|
7
|
+
const toBase64 = (data) => {
|
|
8
|
+
if (!data)
|
|
9
|
+
return '';
|
|
10
|
+
if (typeof globalThis.Buffer !== 'undefined') {
|
|
11
|
+
return globalThis.Buffer.from(data).toString('base64');
|
|
12
|
+
}
|
|
13
|
+
if (typeof data === 'string') {
|
|
14
|
+
data = (0, bytes_1.encodeUTF8)(data);
|
|
15
|
+
}
|
|
16
|
+
if (typeof btoa !== 'undefined') {
|
|
17
|
+
return btoa(String.fromCharCode.apply(null, data));
|
|
18
|
+
}
|
|
19
|
+
throw new error_1.KnockError('Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined');
|
|
20
|
+
};
|
|
21
|
+
exports.toBase64 = toBase64;
|
|
22
|
+
const fromBase64 = (str) => {
|
|
23
|
+
if (typeof globalThis.Buffer !== 'undefined') {
|
|
24
|
+
const buf = globalThis.Buffer.from(str, 'base64');
|
|
25
|
+
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
26
|
+
}
|
|
27
|
+
if (typeof atob !== 'undefined') {
|
|
28
|
+
const bstr = atob(str);
|
|
29
|
+
const buf = new Uint8Array(bstr.length);
|
|
30
|
+
for (let i = 0; i < bstr.length; i++) {
|
|
31
|
+
buf[i] = bstr.charCodeAt(i);
|
|
32
|
+
}
|
|
33
|
+
return buf;
|
|
34
|
+
}
|
|
35
|
+
throw new error_1.KnockError('Cannot decode base64 string; Expected `Buffer` or `atob` to be defined');
|
|
36
|
+
};
|
|
37
|
+
exports.fromBase64 = fromBase64;
|
|
38
|
+
//# sourceMappingURL=base64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src/internal/utils/base64.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,+CAA8C;AAC9C,sCAAqC;AAE9B,MAAM,QAAQ,GAAG,CAAC,IAA4C,EAAU,EAAE;IAC/E,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,IAAI,OAAQ,UAAkB,CAAC,MAAM,KAAK,WAAW,EAAE;QACrD,OAAQ,UAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACjE;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,IAAI,GAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAC;KACzB;IAED,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,IAAW,CAAC,CAAC,CAAC;KAC3D;IAED,MAAM,IAAI,kBAAU,CAAC,0EAA0E,CAAC,CAAC;AACnG,CAAC,CAAC;AAhBW,QAAA,QAAQ,YAgBnB;AAEK,MAAM,UAAU,GAAG,CAAC,GAAW,EAAc,EAAE;IACpD,IAAI,OAAQ,UAAkB,CAAC,MAAM,KAAK,WAAW,EAAE;QACrD,MAAM,GAAG,GAAI,UAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC3D,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;KACnE;IAED,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;SAC7B;QACD,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,IAAI,kBAAU,CAAC,wEAAwE,CAAC,CAAC;AACjG,CAAC,CAAC;AAhBW,QAAA,UAAU,cAgBrB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { KnockError } from "../../core/error.mjs";
|
|
3
|
+
import { encodeUTF8 } from "./bytes.mjs";
|
|
4
|
+
export const toBase64 = (data) => {
|
|
5
|
+
if (!data)
|
|
6
|
+
return '';
|
|
7
|
+
if (typeof globalThis.Buffer !== 'undefined') {
|
|
8
|
+
return globalThis.Buffer.from(data).toString('base64');
|
|
9
|
+
}
|
|
10
|
+
if (typeof data === 'string') {
|
|
11
|
+
data = encodeUTF8(data);
|
|
12
|
+
}
|
|
13
|
+
if (typeof btoa !== 'undefined') {
|
|
14
|
+
return btoa(String.fromCharCode.apply(null, data));
|
|
15
|
+
}
|
|
16
|
+
throw new KnockError('Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined');
|
|
17
|
+
};
|
|
18
|
+
export const fromBase64 = (str) => {
|
|
19
|
+
if (typeof globalThis.Buffer !== 'undefined') {
|
|
20
|
+
const buf = globalThis.Buffer.from(str, 'base64');
|
|
21
|
+
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
22
|
+
}
|
|
23
|
+
if (typeof atob !== 'undefined') {
|
|
24
|
+
const bstr = atob(str);
|
|
25
|
+
const buf = new Uint8Array(bstr.length);
|
|
26
|
+
for (let i = 0; i < bstr.length; i++) {
|
|
27
|
+
buf[i] = bstr.charCodeAt(i);
|
|
28
|
+
}
|
|
29
|
+
return buf;
|
|
30
|
+
}
|
|
31
|
+
throw new KnockError('Cannot decode base64 string; Expected `Buffer` or `atob` to be defined');
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=base64.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.mjs","sourceRoot":"","sources":["../../src/internal/utils/base64.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE;AAErB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAA4C,EAAU,EAAE;IAC/E,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,IAAI,OAAQ,UAAkB,CAAC,MAAM,KAAK,WAAW,EAAE;QACrD,OAAQ,UAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACjE;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;KACzB;IAED,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,IAAW,CAAC,CAAC,CAAC;KAC3D;IAED,MAAM,IAAI,UAAU,CAAC,0EAA0E,CAAC,CAAC;AACnG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAc,EAAE;IACpD,IAAI,OAAQ,UAAkB,CAAC,MAAM,KAAK,WAAW,EAAE;QACrD,MAAM,GAAG,GAAI,UAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC3D,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;KACnE;IAED,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;SAC7B;QACD,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,IAAI,UAAU,CAAC,wEAAwE,CAAC,CAAC;AACjG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bytes.d.mts","sourceRoot":"","sources":["../../src/internal/utils/bytes.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,CAa7D;AAGD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,cAMrC;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,UAM3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../src/internal/utils/bytes.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,CAa7D;AAGD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,cAMrC;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,UAM3C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decodeUTF8 = exports.encodeUTF8 = exports.concatBytes = void 0;
|
|
4
|
+
function concatBytes(buffers) {
|
|
5
|
+
let length = 0;
|
|
6
|
+
for (const buffer of buffers) {
|
|
7
|
+
length += buffer.length;
|
|
8
|
+
}
|
|
9
|
+
const output = new Uint8Array(length);
|
|
10
|
+
let index = 0;
|
|
11
|
+
for (const buffer of buffers) {
|
|
12
|
+
output.set(buffer, index);
|
|
13
|
+
index += buffer.length;
|
|
14
|
+
}
|
|
15
|
+
return output;
|
|
16
|
+
}
|
|
17
|
+
exports.concatBytes = concatBytes;
|
|
18
|
+
let encodeUTF8_;
|
|
19
|
+
function encodeUTF8(str) {
|
|
20
|
+
let encoder;
|
|
21
|
+
return (encodeUTF8_ ??
|
|
22
|
+
((encoder = new globalThis.TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder))))(str);
|
|
23
|
+
}
|
|
24
|
+
exports.encodeUTF8 = encodeUTF8;
|
|
25
|
+
let decodeUTF8_;
|
|
26
|
+
function decodeUTF8(bytes) {
|
|
27
|
+
let decoder;
|
|
28
|
+
return (decodeUTF8_ ??
|
|
29
|
+
((decoder = new globalThis.TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder))))(bytes);
|
|
30
|
+
}
|
|
31
|
+
exports.decodeUTF8 = decodeUTF8;
|
|
32
|
+
//# sourceMappingURL=bytes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../src/internal/utils/bytes.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,OAAqB;IAC/C,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC;KACzB;IACD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC1B,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;KACxB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAbD,kCAaC;AAED,IAAI,WAAwC,CAAC;AAC7C,SAAgB,UAAU,CAAC,GAAW;IACpC,IAAI,OAAO,CAAC;IACZ,OAAO,CACL,WAAW;QACX,CAAC,CAAC,OAAO,GAAG,IAAK,UAAkB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClG,CAAC,GAAG,CAAC,CAAC;AACT,CAAC;AAND,gCAMC;AAED,IAAI,WAA0C,CAAC;AAC/C,SAAgB,UAAU,CAAC,KAAiB;IAC1C,IAAI,OAAO,CAAC;IACZ,OAAO,CACL,WAAW;QACX,CAAC,CAAC,OAAO,GAAG,IAAK,UAAkB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClG,CAAC,KAAK,CAAC,CAAC;AACX,CAAC;AAND,gCAMC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function concatBytes(buffers) {
|
|
2
|
+
let length = 0;
|
|
3
|
+
for (const buffer of buffers) {
|
|
4
|
+
length += buffer.length;
|
|
5
|
+
}
|
|
6
|
+
const output = new Uint8Array(length);
|
|
7
|
+
let index = 0;
|
|
8
|
+
for (const buffer of buffers) {
|
|
9
|
+
output.set(buffer, index);
|
|
10
|
+
index += buffer.length;
|
|
11
|
+
}
|
|
12
|
+
return output;
|
|
13
|
+
}
|
|
14
|
+
let encodeUTF8_;
|
|
15
|
+
export function encodeUTF8(str) {
|
|
16
|
+
let encoder;
|
|
17
|
+
return (encodeUTF8_ ??
|
|
18
|
+
((encoder = new globalThis.TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder))))(str);
|
|
19
|
+
}
|
|
20
|
+
let decodeUTF8_;
|
|
21
|
+
export function decodeUTF8(bytes) {
|
|
22
|
+
let decoder;
|
|
23
|
+
return (decodeUTF8_ ??
|
|
24
|
+
((decoder = new globalThis.TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder))))(bytes);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=bytes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bytes.mjs","sourceRoot":"","sources":["../../src/internal/utils/bytes.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,OAAqB;IAC/C,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC;KACzB;IACD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC1B,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;KACxB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,IAAI,WAAwC,CAAC;AAC7C,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,OAAO,CAAC;IACZ,OAAO,CACL,WAAW;QACX,CAAC,CAAC,OAAO,GAAG,IAAK,UAAkB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClG,CAAC,GAAG,CAAC,CAAC;AACT,CAAC;AAED,IAAI,WAA0C,CAAC;AAC/C,MAAM,UAAU,UAAU,CAAC,KAAiB;IAC1C,IAAI,OAAO,CAAC;IACZ,OAAO,CACL,WAAW;QACX,CAAC,CAAC,OAAO,GAAG,IAAK,UAAkB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClG,CAAC,KAAK,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read an environment variable.
|
|
3
|
+
*
|
|
4
|
+
* Trims beginning and trailing whitespace.
|
|
5
|
+
*
|
|
6
|
+
* Will return undefined if the environment variable doesn't exist or cannot be accessed.
|
|
7
|
+
*/
|
|
8
|
+
export declare const readEnv: (env: string) => string | undefined;
|
|
9
|
+
//# sourceMappingURL=env.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.mts","sourceRoot":"","sources":["../../src/internal/utils/env.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,QAAS,MAAM,KAAG,MAAM,GAAG,SAQ9C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read an environment variable.
|
|
3
|
+
*
|
|
4
|
+
* Trims beginning and trailing whitespace.
|
|
5
|
+
*
|
|
6
|
+
* Will return undefined if the environment variable doesn't exist or cannot be accessed.
|
|
7
|
+
*/
|
|
8
|
+
export declare const readEnv: (env: string) => string | undefined;
|
|
9
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/internal/utils/env.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,QAAS,MAAM,KAAG,MAAM,GAAG,SAQ9C,CAAC"}
|