lark-billing 0.1.4 → 0.1.5
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 +11 -0
- package/LICENSE +201 -0
- package/README.md +328 -110
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +204 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +204 -0
- package/client.d.ts.map +1 -0
- package/client.js +485 -0
- package/client.js.map +1 -0
- package/client.mjs +481 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +86 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +80 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +136 -64
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/checkout.d.mts +61 -0
- package/resources/checkout.d.mts.map +1 -0
- package/resources/checkout.d.ts +61 -0
- package/resources/checkout.d.ts.map +1 -0
- package/resources/checkout.js +15 -0
- package/resources/checkout.js.map +1 -0
- package/resources/checkout.mjs +11 -0
- package/resources/checkout.mjs.map +1 -0
- package/resources/customer-access.d.mts +44 -0
- package/resources/customer-access.d.mts.map +1 -0
- package/resources/customer-access.d.ts +44 -0
- package/resources/customer-access.d.ts.map +1 -0
- package/resources/customer-access.js +16 -0
- package/resources/customer-access.js.map +1 -0
- package/resources/customer-access.mjs +12 -0
- package/resources/customer-access.mjs.map +1 -0
- package/resources/customer-portal.d.mts +33 -0
- package/resources/customer-portal.d.mts.map +1 -0
- package/resources/customer-portal.d.ts +33 -0
- package/resources/customer-portal.d.ts.map +1 -0
- package/resources/customer-portal.js +15 -0
- package/resources/customer-portal.js.map +1 -0
- package/resources/customer-portal.mjs +11 -0
- package/resources/customer-portal.mjs.map +1 -0
- package/resources/index.d.mts +10 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +10 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +23 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +11 -0
- package/resources/index.mjs.map +1 -0
- package/resources/invoices.d.mts +66 -0
- package/resources/invoices.d.mts.map +1 -0
- package/resources/invoices.d.ts +66 -0
- package/resources/invoices.d.ts.map +1 -0
- package/resources/invoices.js +15 -0
- package/resources/invoices.js.map +1 -0
- package/resources/invoices.mjs +11 -0
- package/resources/invoices.mjs.map +1 -0
- package/resources/pricing-metrics.d.mts +229 -0
- package/resources/pricing-metrics.d.mts.map +1 -0
- package/resources/pricing-metrics.d.ts +229 -0
- package/resources/pricing-metrics.d.ts.map +1 -0
- package/resources/pricing-metrics.js +73 -0
- package/resources/pricing-metrics.js.map +1 -0
- package/resources/pricing-metrics.mjs +69 -0
- package/resources/pricing-metrics.mjs.map +1 -0
- package/resources/rate-cards.d.mts +219 -0
- package/resources/rate-cards.d.mts.map +1 -0
- package/resources/rate-cards.d.ts +219 -0
- package/resources/rate-cards.d.ts.map +1 -0
- package/resources/rate-cards.js +48 -0
- package/resources/rate-cards.js.map +1 -0
- package/resources/rate-cards.mjs +44 -0
- package/resources/rate-cards.mjs.map +1 -0
- package/resources/subjects.d.mts +171 -0
- package/resources/subjects.d.mts.map +1 -0
- package/resources/subjects.d.ts +171 -0
- package/resources/subjects.d.ts.map +1 -0
- package/resources/subjects.js +74 -0
- package/resources/subjects.js.map +1 -0
- package/resources/subjects.mjs +70 -0
- package/resources/subjects.mjs.map +1 -0
- package/resources/subscriptions.d.mts +199 -0
- package/resources/subscriptions.d.mts.map +1 -0
- package/resources/subscriptions.d.ts +199 -0
- package/resources/subscriptions.d.ts.map +1 -0
- package/resources/subscriptions.js +80 -0
- package/resources/subscriptions.js.map +1 -0
- package/resources/subscriptions.mjs +76 -0
- package/resources/subscriptions.mjs.map +1 -0
- package/resources/usage-events.d.mts +56 -0
- package/resources/usage-events.d.mts.map +1 -0
- package/resources/usage-events.d.ts +56 -0
- package/resources/usage-events.d.ts.map +1 -0
- package/resources/usage-events.js +29 -0
- package/resources/usage-events.js.map +1 -0
- package/resources/usage-events.mjs +25 -0
- package/resources/usage-events.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +873 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -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/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +127 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/checkout.ts +81 -0
- package/src/resources/customer-access.ts +63 -0
- package/src/resources/customer-portal.ts +48 -0
- package/src/resources/index.ts +59 -0
- package/src/resources/invoices.ts +87 -0
- package/src/resources/pricing-metrics.ts +307 -0
- package/src/resources/rate-cards.ts +292 -0
- package/src/resources/subjects.ts +220 -0
- package/src/resources/subscriptions.ts +267 -0
- package/src/resources/usage-events.ts +68 -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 +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
- package/dist/cjs/Client.d.ts +0 -58
- package/dist/cjs/Client.js +0 -99
- package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +0 -9
- package/dist/cjs/api/errors/UnprocessableEntityError.js +0 -52
- package/dist/cjs/api/errors/index.d.ts +0 -1
- package/dist/cjs/api/errors/index.js +0 -17
- package/dist/cjs/api/index.d.ts +0 -3
- package/dist/cjs/api/index.js +0 -19
- package/dist/cjs/api/resources/checkout/client/Client.d.ts +0 -53
- package/dist/cjs/api/resources/checkout/client/Client.js +0 -135
- package/dist/cjs/api/resources/checkout/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/checkout/client/index.js +0 -17
- package/dist/cjs/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.ts +0 -23
- package/dist/cjs/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.js +0 -5
- package/dist/cjs/api/resources/checkout/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/checkout/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/checkout/index.d.ts +0 -1
- package/dist/cjs/api/resources/checkout/index.js +0 -17
- package/dist/cjs/api/resources/customerAccess/client/Client.d.ts +0 -46
- package/dist/cjs/api/resources/customerAccess/client/Client.js +0 -122
- package/dist/cjs/api/resources/customerAccess/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/customerAccess/client/index.js +0 -2
- package/dist/cjs/api/resources/customerAccess/index.d.ts +0 -1
- package/dist/cjs/api/resources/customerAccess/index.js +0 -17
- package/dist/cjs/api/resources/customerPortal/client/Client.d.ts +0 -49
- package/dist/cjs/api/resources/customerPortal/client/Client.js +0 -131
- package/dist/cjs/api/resources/customerPortal/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/customerPortal/client/index.js +0 -17
- package/dist/cjs/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.ts +0 -16
- package/dist/cjs/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.js +0 -5
- package/dist/cjs/api/resources/customerPortal/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/customerPortal/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/customerPortal/index.d.ts +0 -1
- package/dist/cjs/api/resources/customerPortal/index.js +0 -17
- package/dist/cjs/api/resources/index.d.ts +0 -19
- package/dist/cjs/api/resources/index.js +0 -58
- package/dist/cjs/api/resources/invoices/client/Client.d.ts +0 -50
- package/dist/cjs/api/resources/invoices/client/Client.js +0 -135
- package/dist/cjs/api/resources/invoices/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/invoices/client/index.js +0 -17
- package/dist/cjs/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.d.ts +0 -17
- package/dist/cjs/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.js +0 -5
- package/dist/cjs/api/resources/invoices/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/invoices/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/invoices/index.d.ts +0 -1
- package/dist/cjs/api/resources/invoices/index.js +0 -17
- package/dist/cjs/api/resources/pricingMetrics/client/Client.d.ts +0 -96
- package/dist/cjs/api/resources/pricingMetrics/client/Client.js +0 -321
- package/dist/cjs/api/resources/pricingMetrics/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/pricingMetrics/client/index.js +0 -17
- package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricRequest.d.ts +0 -26
- package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricRequest.js +0 -5
- package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.d.ts +0 -20
- package/dist/cjs/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.js +0 -5
- package/dist/cjs/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.d.ts +0 -12
- package/dist/cjs/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.js +0 -5
- package/dist/cjs/api/resources/pricingMetrics/client/requests/index.d.ts +0 -3
- package/dist/cjs/api/resources/pricingMetrics/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/pricingMetrics/index.d.ts +0 -2
- package/dist/cjs/api/resources/pricingMetrics/index.js +0 -18
- package/dist/cjs/api/resources/pricingMetrics/types/PricingMetricAggregation.d.ts +0 -25
- package/dist/cjs/api/resources/pricingMetrics/types/PricingMetricAggregation.js +0 -5
- package/dist/cjs/api/resources/pricingMetrics/types/index.d.ts +0 -1
- package/dist/cjs/api/resources/pricingMetrics/types/index.js +0 -17
- package/dist/cjs/api/resources/rateCards/client/Client.d.ts +0 -99
- package/dist/cjs/api/resources/rateCards/client/Client.js +0 -275
- package/dist/cjs/api/resources/rateCards/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/rateCards/client/index.js +0 -17
- package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardRequest.d.ts +0 -60
- package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardRequest.js +0 -13
- package/dist/cjs/api/resources/rateCards/client/requests/ListRateCardsRateCardsGetRequest.d.ts +0 -12
- package/dist/cjs/api/resources/rateCards/client/requests/ListRateCardsRateCardsGetRequest.js +0 -5
- package/dist/cjs/api/resources/rateCards/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/rateCards/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/rateCards/index.d.ts +0 -2
- package/dist/cjs/api/resources/rateCards/index.js +0 -18
- package/dist/cjs/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.d.ts +0 -10
- package/dist/cjs/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.js +0 -5
- package/dist/cjs/api/resources/rateCards/types/index.d.ts +0 -1
- package/dist/cjs/api/resources/rateCards/types/index.js +0 -17
- package/dist/cjs/api/resources/subjects/client/Client.d.ts +0 -101
- package/dist/cjs/api/resources/subjects/client/Client.js +0 -375
- package/dist/cjs/api/resources/subjects/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/subjects/client/index.js +0 -17
- package/dist/cjs/api/resources/subjects/client/requests/CreateSubjectRequest.d.ts +0 -24
- package/dist/cjs/api/resources/subjects/client/requests/CreateSubjectRequest.js +0 -5
- package/dist/cjs/api/resources/subjects/client/requests/ListSubjectsSubjectsGetRequest.d.ts +0 -14
- package/dist/cjs/api/resources/subjects/client/requests/ListSubjectsSubjectsGetRequest.js +0 -5
- package/dist/cjs/api/resources/subjects/client/requests/UpdateSubjectRequest.d.ts +0 -15
- package/dist/cjs/api/resources/subjects/client/requests/UpdateSubjectRequest.js +0 -5
- package/dist/cjs/api/resources/subjects/client/requests/index.d.ts +0 -3
- package/dist/cjs/api/resources/subjects/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/subjects/index.d.ts +0 -1
- package/dist/cjs/api/resources/subjects/index.js +0 -17
- package/dist/cjs/api/resources/subscriptions/client/Client.d.ts +0 -105
- package/dist/cjs/api/resources/subscriptions/client/Client.js +0 -388
- package/dist/cjs/api/resources/subscriptions/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/subscriptions/client/index.js +0 -17
- package/dist/cjs/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.d.ts +0 -13
- package/dist/cjs/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.js +0 -5
- package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.ts +0 -32
- package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.js +0 -13
- package/dist/cjs/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.ts +0 -18
- package/dist/cjs/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.js +0 -5
- package/dist/cjs/api/resources/subscriptions/client/requests/ListSubscriptionsSubscriptionsGetRequest.d.ts +0 -18
- package/dist/cjs/api/resources/subscriptions/client/requests/ListSubscriptionsSubscriptionsGetRequest.js +0 -5
- package/dist/cjs/api/resources/subscriptions/client/requests/index.d.ts +0 -4
- package/dist/cjs/api/resources/subscriptions/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/subscriptions/index.d.ts +0 -1
- package/dist/cjs/api/resources/subscriptions/index.js +0 -17
- package/dist/cjs/api/resources/usageEvents/client/Client.d.ts +0 -56
- package/dist/cjs/api/resources/usageEvents/client/Client.js +0 -135
- package/dist/cjs/api/resources/usageEvents/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/usageEvents/client/index.js +0 -17
- package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.ts +0 -34
- package/dist/cjs/api/resources/usageEvents/client/requests/CreateUsageEventRequest.js +0 -5
- package/dist/cjs/api/resources/usageEvents/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/usageEvents/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/usageEvents/index.d.ts +0 -1
- package/dist/cjs/api/resources/usageEvents/index.js +0 -17
- package/dist/cjs/api/types/ActiveSubscription.d.ts +0 -7
- package/dist/cjs/api/types/ActiveSubscription.js +0 -5
- package/dist/cjs/api/types/Aggregation.d.ts +0 -22
- package/dist/cjs/api/types/Aggregation.js +0 -5
- package/dist/cjs/api/types/Amount.d.ts +0 -9
- package/dist/cjs/api/types/Amount.js +0 -5
- package/dist/cjs/api/types/BillingStateResponse.d.ts +0 -14
- package/dist/cjs/api/types/BillingStateResponse.js +0 -5
- package/dist/cjs/api/types/ChangeSubscriptionRateCardResponse.d.ts +0 -7
- package/dist/cjs/api/types/ChangeSubscriptionRateCardResponse.js +0 -5
- package/dist/cjs/api/types/CheckoutAction.d.ts +0 -7
- package/dist/cjs/api/types/CheckoutAction.js +0 -5
- package/dist/cjs/api/types/CheckoutCallback.d.ts +0 -9
- package/dist/cjs/api/types/CheckoutCallback.js +0 -5
- package/dist/cjs/api/types/CountAggregationPricingMetricInterface.d.ts +0 -8
- package/dist/cjs/api/types/CountAggregationPricingMetricInterface.js +0 -5
- package/dist/cjs/api/types/CountAggregationPricingMetricResource.d.ts +0 -5
- package/dist/cjs/api/types/CountAggregationPricingMetricResource.js +0 -5
- package/dist/cjs/api/types/CreateCustomerPortalSessionResponse.d.ts +0 -11
- package/dist/cjs/api/types/CreateCustomerPortalSessionResponse.js +0 -5
- package/dist/cjs/api/types/CreateFixedRateRequest.d.ts +0 -11
- package/dist/cjs/api/types/CreateFixedRateRequest.js +0 -5
- package/dist/cjs/api/types/CreateSimpleUsageBasedRateRequest.d.ts +0 -15
- package/dist/cjs/api/types/CreateSimpleUsageBasedRateRequest.js +0 -5
- package/dist/cjs/api/types/CreateSubjectResponse.d.ts +0 -17
- package/dist/cjs/api/types/CreateSubjectResponse.js +0 -5
- package/dist/cjs/api/types/CreateSubscriptionCheckoutSessionResponse.d.ts +0 -12
- package/dist/cjs/api/types/CreateSubscriptionCheckoutSessionResponse.js +0 -5
- package/dist/cjs/api/types/CustomAggregationPricingMetricInterface.d.ts +0 -10
- package/dist/cjs/api/types/CustomAggregationPricingMetricInterface.js +0 -5
- package/dist/cjs/api/types/FixedRateInterface.d.ts +0 -10
- package/dist/cjs/api/types/FixedRateInterface.js +0 -5
- package/dist/cjs/api/types/FlatPrice.d.ts +0 -10
- package/dist/cjs/api/types/FlatPrice.js +0 -5
- package/dist/cjs/api/types/HttpValidationError.d.ts +0 -7
- package/dist/cjs/api/types/HttpValidationError.js +0 -5
- package/dist/cjs/api/types/InvoiceLineItemResource.d.ts +0 -10
- package/dist/cjs/api/types/InvoiceLineItemResource.js +0 -5
- package/dist/cjs/api/types/InvoiceResource.d.ts +0 -33
- package/dist/cjs/api/types/InvoiceResource.js +0 -16
- package/dist/cjs/api/types/LastAggregationPricingMetricInterface.d.ts +0 -10
- package/dist/cjs/api/types/LastAggregationPricingMetricInterface.js +0 -5
- package/dist/cjs/api/types/LastAggregationPricingMetricResource.d.ts +0 -7
- package/dist/cjs/api/types/LastAggregationPricingMetricResource.js +0 -5
- package/dist/cjs/api/types/ListInvoicesResponse.d.ts +0 -8
- package/dist/cjs/api/types/ListInvoicesResponse.js +0 -5
- package/dist/cjs/api/types/ListPricingMetricsResponse.d.ts +0 -8
- package/dist/cjs/api/types/ListPricingMetricsResponse.js +0 -5
- package/dist/cjs/api/types/ListRateCardsResponse.d.ts +0 -8
- package/dist/cjs/api/types/ListRateCardsResponse.js +0 -5
- package/dist/cjs/api/types/ListSubjectsResponse.d.ts +0 -8
- package/dist/cjs/api/types/ListSubjectsResponse.js +0 -5
- package/dist/cjs/api/types/ListSubscriptionsResponse.d.ts +0 -8
- package/dist/cjs/api/types/ListSubscriptionsResponse.js +0 -5
- package/dist/cjs/api/types/MaxAggregationPricingMetricInterface.d.ts +0 -10
- package/dist/cjs/api/types/MaxAggregationPricingMetricInterface.js +0 -5
- package/dist/cjs/api/types/MaxAggregationPricingMetricResource.d.ts +0 -7
- package/dist/cjs/api/types/MaxAggregationPricingMetricResource.js +0 -5
- package/dist/cjs/api/types/PackagePrice.d.ts +0 -19
- package/dist/cjs/api/types/PackagePrice.js +0 -13
- package/dist/cjs/api/types/Period.d.ts +0 -9
- package/dist/cjs/api/types/Period.js +0 -5
- package/dist/cjs/api/types/PeriodResource.d.ts +0 -9
- package/dist/cjs/api/types/PeriodResource.js +0 -5
- package/dist/cjs/api/types/Price.d.ts +0 -13
- package/dist/cjs/api/types/Price.js +0 -5
- package/dist/cjs/api/types/PricingMetricResource.d.ts +0 -16
- package/dist/cjs/api/types/PricingMetricResource.js +0 -5
- package/dist/cjs/api/types/PricingMetricSummaryResource.d.ts +0 -16
- package/dist/cjs/api/types/PricingMetricSummaryResource.js +0 -5
- package/dist/cjs/api/types/RateCardResource.d.ts +0 -29
- package/dist/cjs/api/types/RateCardResource.js +0 -13
- package/dist/cjs/api/types/RateCardResourceUsageBasedRatesItem.d.ts +0 -10
- package/dist/cjs/api/types/RateCardResourceUsageBasedRatesItem.js +0 -5
- package/dist/cjs/api/types/RequiresActionResponse.d.ts +0 -7
- package/dist/cjs/api/types/RequiresActionResponse.js +0 -5
- package/dist/cjs/api/types/Result.d.ts +0 -13
- package/dist/cjs/api/types/Result.js +0 -5
- package/dist/cjs/api/types/SimpleUsageBasedRateInterface.d.ts +0 -12
- package/dist/cjs/api/types/SimpleUsageBasedRateInterface.js +0 -5
- package/dist/cjs/api/types/SubjectResource.d.ts +0 -17
- package/dist/cjs/api/types/SubjectResource.js +0 -5
- package/dist/cjs/api/types/SubscriptionResource.d.ts +0 -34
- package/dist/cjs/api/types/SubscriptionResource.js +0 -14
- package/dist/cjs/api/types/SuccessResponse.d.ts +0 -7
- package/dist/cjs/api/types/SuccessResponse.js +0 -5
- package/dist/cjs/api/types/SumAggregationPricingMetricInterface.d.ts +0 -10
- package/dist/cjs/api/types/SumAggregationPricingMetricInterface.js +0 -5
- package/dist/cjs/api/types/SumAggregationPricingMetricResource.d.ts +0 -7
- package/dist/cjs/api/types/SumAggregationPricingMetricResource.js +0 -5
- package/dist/cjs/api/types/UsageDataForRate.d.ts +0 -9
- package/dist/cjs/api/types/UsageDataForRate.js +0 -5
- package/dist/cjs/api/types/ValidationError.d.ts +0 -14
- package/dist/cjs/api/types/ValidationError.js +0 -5
- package/dist/cjs/api/types/index.d.ts +0 -47
- package/dist/cjs/api/types/index.js +0 -63
- package/dist/cjs/core/fetcher/APIResponse.d.ts +0 -20
- package/dist/cjs/core/fetcher/APIResponse.js +0 -2
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +0 -20
- package/dist/cjs/core/fetcher/BinaryResponse.js +0 -17
- package/dist/cjs/core/fetcher/Fetcher.d.ts +0 -40
- package/dist/cjs/core/fetcher/Fetcher.js +0 -120
- package/dist/cjs/core/fetcher/Headers.d.ts +0 -2
- package/dist/cjs/core/fetcher/Headers.js +0 -84
- package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +0 -58
- package/dist/cjs/core/fetcher/HttpResponsePromise.js +0 -103
- package/dist/cjs/core/fetcher/RawResponse.d.ts +0 -29
- package/dist/cjs/core/fetcher/RawResponse.js +0 -44
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/cjs/core/fetcher/Supplier.d.ts +0 -4
- package/dist/cjs/core/fetcher/Supplier.js +0 -22
- package/dist/cjs/core/fetcher/createRequestUrl.d.ts +0 -1
- package/dist/cjs/core/fetcher/createRequestUrl.js +0 -8
- package/dist/cjs/core/fetcher/getErrorResponseBody.d.ts +0 -1
- package/dist/cjs/core/fetcher/getErrorResponseBody.js +0 -44
- package/dist/cjs/core/fetcher/getFetchFn.d.ts +0 -1
- package/dist/cjs/core/fetcher/getFetchFn.js +0 -17
- package/dist/cjs/core/fetcher/getHeader.d.ts +0 -1
- package/dist/cjs/core/fetcher/getHeader.js +0 -11
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +0 -7
- package/dist/cjs/core/fetcher/getRequestBody.js +0 -23
- package/dist/cjs/core/fetcher/getResponseBody.d.ts +0 -1
- package/dist/cjs/core/fetcher/getResponseBody.js +0 -55
- package/dist/cjs/core/fetcher/index.d.ts +0 -9
- package/dist/cjs/core/fetcher/index.js +0 -15
- package/dist/cjs/core/fetcher/makeRequest.d.ts +0 -1
- package/dist/cjs/core/fetcher/makeRequest.js +0 -42
- package/dist/cjs/core/fetcher/requestWithRetries.d.ts +0 -1
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -76
- package/dist/cjs/core/fetcher/signals.d.ts +0 -11
- package/dist/cjs/core/fetcher/signals.js +0 -36
- package/dist/cjs/core/headers.d.ts +0 -3
- package/dist/cjs/core/headers.js +0 -29
- package/dist/cjs/core/index.d.ts +0 -3
- package/dist/cjs/core/index.js +0 -42
- package/dist/cjs/core/json.d.ts +0 -15
- package/dist/cjs/core/json.js +0 -24
- package/dist/cjs/core/runtime/index.d.ts +0 -1
- package/dist/cjs/core/runtime/index.js +0 -5
- package/dist/cjs/core/runtime/runtime.d.ts +0 -9
- package/dist/cjs/core/runtime/runtime.js +0 -102
- package/dist/cjs/core/url/index.d.ts +0 -2
- package/dist/cjs/core/url/index.js +0 -7
- package/dist/cjs/core/url/join.d.ts +0 -1
- package/dist/cjs/core/url/join.js +0 -69
- package/dist/cjs/core/url/qs.d.ts +0 -6
- package/dist/cjs/core/url/qs.js +0 -64
- package/dist/cjs/environments.d.ts +0 -7
- package/dist/cjs/environments.js +0 -9
- package/dist/cjs/errors/LarkError.d.ts +0 -15
- package/dist/cjs/errors/LarkError.js +0 -30
- package/dist/cjs/errors/LarkTimeoutError.d.ts +0 -6
- package/dist/cjs/errors/LarkTimeoutError.js +0 -13
- package/dist/cjs/errors/index.d.ts +0 -2
- package/dist/cjs/errors/index.js +0 -7
- package/dist/cjs/index.d.ts +0 -4
- package/dist/cjs/index.js +0 -44
- package/dist/cjs/version.d.ts +0 -1
- package/dist/cjs/version.js +0 -4
- package/dist/esm/Client.d.mts +0 -58
- package/dist/esm/Client.mjs +0 -62
- package/dist/esm/api/errors/UnprocessableEntityError.d.mts +0 -9
- package/dist/esm/api/errors/UnprocessableEntityError.mjs +0 -15
- package/dist/esm/api/errors/index.d.mts +0 -1
- package/dist/esm/api/errors/index.mjs +0 -1
- package/dist/esm/api/index.d.mts +0 -3
- package/dist/esm/api/index.mjs +0 -3
- package/dist/esm/api/resources/checkout/client/Client.d.mts +0 -53
- package/dist/esm/api/resources/checkout/client/Client.mjs +0 -98
- package/dist/esm/api/resources/checkout/client/index.d.mts +0 -2
- package/dist/esm/api/resources/checkout/client/index.mjs +0 -1
- package/dist/esm/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.mts +0 -23
- package/dist/esm/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.mjs +0 -4
- package/dist/esm/api/resources/checkout/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/checkout/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/checkout/index.d.mts +0 -1
- package/dist/esm/api/resources/checkout/index.mjs +0 -1
- package/dist/esm/api/resources/customerAccess/client/Client.d.mts +0 -46
- package/dist/esm/api/resources/customerAccess/client/Client.mjs +0 -85
- package/dist/esm/api/resources/customerAccess/client/index.d.mts +0 -1
- package/dist/esm/api/resources/customerAccess/client/index.mjs +0 -1
- package/dist/esm/api/resources/customerAccess/index.d.mts +0 -1
- package/dist/esm/api/resources/customerAccess/index.mjs +0 -1
- package/dist/esm/api/resources/customerPortal/client/Client.d.mts +0 -49
- package/dist/esm/api/resources/customerPortal/client/Client.mjs +0 -94
- package/dist/esm/api/resources/customerPortal/client/index.d.mts +0 -2
- package/dist/esm/api/resources/customerPortal/client/index.mjs +0 -1
- package/dist/esm/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.d.mts +0 -16
- package/dist/esm/api/resources/customerPortal/client/requests/CreateCustomerPortalSessionRequest.mjs +0 -4
- package/dist/esm/api/resources/customerPortal/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/customerPortal/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/customerPortal/index.d.mts +0 -1
- package/dist/esm/api/resources/customerPortal/index.mjs +0 -1
- package/dist/esm/api/resources/index.d.mts +0 -19
- package/dist/esm/api/resources/index.mjs +0 -19
- package/dist/esm/api/resources/invoices/client/Client.d.mts +0 -50
- package/dist/esm/api/resources/invoices/client/Client.mjs +0 -98
- package/dist/esm/api/resources/invoices/client/index.d.mts +0 -2
- package/dist/esm/api/resources/invoices/client/index.mjs +0 -1
- package/dist/esm/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.d.mts +0 -17
- package/dist/esm/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.mjs +0 -4
- package/dist/esm/api/resources/invoices/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/invoices/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/invoices/index.d.mts +0 -1
- package/dist/esm/api/resources/invoices/index.mjs +0 -1
- package/dist/esm/api/resources/pricingMetrics/client/Client.d.mts +0 -96
- package/dist/esm/api/resources/pricingMetrics/client/Client.mjs +0 -284
- package/dist/esm/api/resources/pricingMetrics/client/index.d.mts +0 -2
- package/dist/esm/api/resources/pricingMetrics/client/index.mjs +0 -1
- package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricRequest.d.mts +0 -26
- package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricRequest.mjs +0 -4
- package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.d.mts +0 -20
- package/dist/esm/api/resources/pricingMetrics/client/requests/CreatePricingMetricSummaryRequest.mjs +0 -4
- package/dist/esm/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.d.mts +0 -12
- package/dist/esm/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.mjs +0 -4
- package/dist/esm/api/resources/pricingMetrics/client/requests/index.d.mts +0 -3
- package/dist/esm/api/resources/pricingMetrics/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/pricingMetrics/index.d.mts +0 -2
- package/dist/esm/api/resources/pricingMetrics/index.mjs +0 -2
- package/dist/esm/api/resources/pricingMetrics/types/PricingMetricAggregation.d.mts +0 -25
- package/dist/esm/api/resources/pricingMetrics/types/PricingMetricAggregation.mjs +0 -4
- package/dist/esm/api/resources/pricingMetrics/types/index.d.mts +0 -1
- package/dist/esm/api/resources/pricingMetrics/types/index.mjs +0 -1
- package/dist/esm/api/resources/rateCards/client/Client.d.mts +0 -99
- package/dist/esm/api/resources/rateCards/client/Client.mjs +0 -238
- package/dist/esm/api/resources/rateCards/client/index.d.mts +0 -2
- package/dist/esm/api/resources/rateCards/client/index.mjs +0 -1
- package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardRequest.d.mts +0 -60
- package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardRequest.mjs +0 -10
- package/dist/esm/api/resources/rateCards/client/requests/ListRateCardsRateCardsGetRequest.d.mts +0 -12
- package/dist/esm/api/resources/rateCards/client/requests/ListRateCardsRateCardsGetRequest.mjs +0 -4
- package/dist/esm/api/resources/rateCards/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/rateCards/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/rateCards/index.d.mts +0 -2
- package/dist/esm/api/resources/rateCards/index.mjs +0 -2
- package/dist/esm/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.d.mts +0 -10
- package/dist/esm/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.mjs +0 -4
- package/dist/esm/api/resources/rateCards/types/index.d.mts +0 -1
- package/dist/esm/api/resources/rateCards/types/index.mjs +0 -1
- package/dist/esm/api/resources/subjects/client/Client.d.mts +0 -101
- package/dist/esm/api/resources/subjects/client/Client.mjs +0 -338
- package/dist/esm/api/resources/subjects/client/index.d.mts +0 -2
- package/dist/esm/api/resources/subjects/client/index.mjs +0 -1
- package/dist/esm/api/resources/subjects/client/requests/CreateSubjectRequest.d.mts +0 -24
- package/dist/esm/api/resources/subjects/client/requests/CreateSubjectRequest.mjs +0 -4
- package/dist/esm/api/resources/subjects/client/requests/ListSubjectsSubjectsGetRequest.d.mts +0 -14
- package/dist/esm/api/resources/subjects/client/requests/ListSubjectsSubjectsGetRequest.mjs +0 -4
- package/dist/esm/api/resources/subjects/client/requests/UpdateSubjectRequest.d.mts +0 -15
- package/dist/esm/api/resources/subjects/client/requests/UpdateSubjectRequest.mjs +0 -4
- package/dist/esm/api/resources/subjects/client/requests/index.d.mts +0 -3
- package/dist/esm/api/resources/subjects/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/subjects/index.d.mts +0 -1
- package/dist/esm/api/resources/subjects/index.mjs +0 -1
- package/dist/esm/api/resources/subscriptions/client/Client.d.mts +0 -105
- package/dist/esm/api/resources/subscriptions/client/Client.mjs +0 -351
- package/dist/esm/api/resources/subscriptions/client/index.d.mts +0 -2
- package/dist/esm/api/resources/subscriptions/client/index.mjs +0 -1
- package/dist/esm/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.d.mts +0 -13
- package/dist/esm/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.mjs +0 -4
- package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.mts +0 -32
- package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.mjs +0 -10
- package/dist/esm/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.mts +0 -18
- package/dist/esm/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.mjs +0 -4
- package/dist/esm/api/resources/subscriptions/client/requests/ListSubscriptionsSubscriptionsGetRequest.d.mts +0 -18
- package/dist/esm/api/resources/subscriptions/client/requests/ListSubscriptionsSubscriptionsGetRequest.mjs +0 -4
- package/dist/esm/api/resources/subscriptions/client/requests/index.d.mts +0 -4
- package/dist/esm/api/resources/subscriptions/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/subscriptions/index.d.mts +0 -1
- package/dist/esm/api/resources/subscriptions/index.mjs +0 -1
- package/dist/esm/api/resources/usageEvents/client/Client.d.mts +0 -56
- package/dist/esm/api/resources/usageEvents/client/Client.mjs +0 -98
- package/dist/esm/api/resources/usageEvents/client/index.d.mts +0 -2
- package/dist/esm/api/resources/usageEvents/client/index.mjs +0 -1
- package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventRequest.d.mts +0 -34
- package/dist/esm/api/resources/usageEvents/client/requests/CreateUsageEventRequest.mjs +0 -4
- package/dist/esm/api/resources/usageEvents/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/usageEvents/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/usageEvents/index.d.mts +0 -1
- package/dist/esm/api/resources/usageEvents/index.mjs +0 -1
- package/dist/esm/api/types/ActiveSubscription.d.mts +0 -7
- package/dist/esm/api/types/ActiveSubscription.mjs +0 -4
- package/dist/esm/api/types/Aggregation.d.mts +0 -22
- package/dist/esm/api/types/Aggregation.mjs +0 -4
- package/dist/esm/api/types/Amount.d.mts +0 -9
- package/dist/esm/api/types/Amount.mjs +0 -4
- package/dist/esm/api/types/BillingStateResponse.d.mts +0 -14
- package/dist/esm/api/types/BillingStateResponse.mjs +0 -4
- package/dist/esm/api/types/ChangeSubscriptionRateCardResponse.d.mts +0 -7
- package/dist/esm/api/types/ChangeSubscriptionRateCardResponse.mjs +0 -4
- package/dist/esm/api/types/CheckoutAction.d.mts +0 -7
- package/dist/esm/api/types/CheckoutAction.mjs +0 -4
- package/dist/esm/api/types/CheckoutCallback.d.mts +0 -9
- package/dist/esm/api/types/CheckoutCallback.mjs +0 -4
- package/dist/esm/api/types/CountAggregationPricingMetricInterface.d.mts +0 -8
- package/dist/esm/api/types/CountAggregationPricingMetricInterface.mjs +0 -4
- package/dist/esm/api/types/CountAggregationPricingMetricResource.d.mts +0 -5
- package/dist/esm/api/types/CountAggregationPricingMetricResource.mjs +0 -4
- package/dist/esm/api/types/CreateCustomerPortalSessionResponse.d.mts +0 -11
- package/dist/esm/api/types/CreateCustomerPortalSessionResponse.mjs +0 -4
- package/dist/esm/api/types/CreateFixedRateRequest.d.mts +0 -11
- package/dist/esm/api/types/CreateFixedRateRequest.mjs +0 -4
- package/dist/esm/api/types/CreateSimpleUsageBasedRateRequest.d.mts +0 -15
- package/dist/esm/api/types/CreateSimpleUsageBasedRateRequest.mjs +0 -4
- package/dist/esm/api/types/CreateSubjectResponse.d.mts +0 -17
- package/dist/esm/api/types/CreateSubjectResponse.mjs +0 -4
- package/dist/esm/api/types/CreateSubscriptionCheckoutSessionResponse.d.mts +0 -12
- package/dist/esm/api/types/CreateSubscriptionCheckoutSessionResponse.mjs +0 -4
- package/dist/esm/api/types/CustomAggregationPricingMetricInterface.d.mts +0 -10
- package/dist/esm/api/types/CustomAggregationPricingMetricInterface.mjs +0 -4
- package/dist/esm/api/types/FixedRateInterface.d.mts +0 -10
- package/dist/esm/api/types/FixedRateInterface.mjs +0 -4
- package/dist/esm/api/types/FlatPrice.d.mts +0 -10
- package/dist/esm/api/types/FlatPrice.mjs +0 -4
- package/dist/esm/api/types/HttpValidationError.d.mts +0 -7
- package/dist/esm/api/types/HttpValidationError.mjs +0 -4
- package/dist/esm/api/types/InvoiceLineItemResource.d.mts +0 -10
- package/dist/esm/api/types/InvoiceLineItemResource.mjs +0 -4
- package/dist/esm/api/types/InvoiceResource.d.mts +0 -33
- package/dist/esm/api/types/InvoiceResource.mjs +0 -13
- package/dist/esm/api/types/LastAggregationPricingMetricInterface.d.mts +0 -10
- package/dist/esm/api/types/LastAggregationPricingMetricInterface.mjs +0 -4
- package/dist/esm/api/types/LastAggregationPricingMetricResource.d.mts +0 -7
- package/dist/esm/api/types/LastAggregationPricingMetricResource.mjs +0 -4
- package/dist/esm/api/types/ListInvoicesResponse.d.mts +0 -8
- package/dist/esm/api/types/ListInvoicesResponse.mjs +0 -4
- package/dist/esm/api/types/ListPricingMetricsResponse.d.mts +0 -8
- package/dist/esm/api/types/ListPricingMetricsResponse.mjs +0 -4
- package/dist/esm/api/types/ListRateCardsResponse.d.mts +0 -8
- package/dist/esm/api/types/ListRateCardsResponse.mjs +0 -4
- package/dist/esm/api/types/ListSubjectsResponse.d.mts +0 -8
- package/dist/esm/api/types/ListSubjectsResponse.mjs +0 -4
- package/dist/esm/api/types/ListSubscriptionsResponse.d.mts +0 -8
- package/dist/esm/api/types/ListSubscriptionsResponse.mjs +0 -4
- package/dist/esm/api/types/MaxAggregationPricingMetricInterface.d.mts +0 -10
- package/dist/esm/api/types/MaxAggregationPricingMetricInterface.mjs +0 -4
- package/dist/esm/api/types/MaxAggregationPricingMetricResource.d.mts +0 -7
- package/dist/esm/api/types/MaxAggregationPricingMetricResource.mjs +0 -4
- package/dist/esm/api/types/PackagePrice.d.mts +0 -19
- package/dist/esm/api/types/PackagePrice.mjs +0 -10
- package/dist/esm/api/types/Period.d.mts +0 -9
- package/dist/esm/api/types/Period.mjs +0 -4
- package/dist/esm/api/types/PeriodResource.d.mts +0 -9
- package/dist/esm/api/types/PeriodResource.mjs +0 -4
- package/dist/esm/api/types/Price.d.mts +0 -13
- package/dist/esm/api/types/Price.mjs +0 -4
- package/dist/esm/api/types/PricingMetricResource.d.mts +0 -16
- package/dist/esm/api/types/PricingMetricResource.mjs +0 -4
- package/dist/esm/api/types/PricingMetricSummaryResource.d.mts +0 -16
- package/dist/esm/api/types/PricingMetricSummaryResource.mjs +0 -4
- package/dist/esm/api/types/RateCardResource.d.mts +0 -29
- package/dist/esm/api/types/RateCardResource.mjs +0 -10
- package/dist/esm/api/types/RateCardResourceUsageBasedRatesItem.d.mts +0 -10
- package/dist/esm/api/types/RateCardResourceUsageBasedRatesItem.mjs +0 -4
- package/dist/esm/api/types/RequiresActionResponse.d.mts +0 -7
- package/dist/esm/api/types/RequiresActionResponse.mjs +0 -4
- package/dist/esm/api/types/Result.d.mts +0 -13
- package/dist/esm/api/types/Result.mjs +0 -4
- package/dist/esm/api/types/SimpleUsageBasedRateInterface.d.mts +0 -12
- package/dist/esm/api/types/SimpleUsageBasedRateInterface.mjs +0 -4
- package/dist/esm/api/types/SubjectResource.d.mts +0 -17
- package/dist/esm/api/types/SubjectResource.mjs +0 -4
- package/dist/esm/api/types/SubscriptionResource.d.mts +0 -34
- package/dist/esm/api/types/SubscriptionResource.mjs +0 -11
- package/dist/esm/api/types/SuccessResponse.d.mts +0 -7
- package/dist/esm/api/types/SuccessResponse.mjs +0 -4
- package/dist/esm/api/types/SumAggregationPricingMetricInterface.d.mts +0 -10
- package/dist/esm/api/types/SumAggregationPricingMetricInterface.mjs +0 -4
- package/dist/esm/api/types/SumAggregationPricingMetricResource.d.mts +0 -7
- package/dist/esm/api/types/SumAggregationPricingMetricResource.mjs +0 -4
- package/dist/esm/api/types/UsageDataForRate.d.mts +0 -9
- package/dist/esm/api/types/UsageDataForRate.mjs +0 -4
- package/dist/esm/api/types/ValidationError.d.mts +0 -14
- package/dist/esm/api/types/ValidationError.mjs +0 -4
- package/dist/esm/api/types/index.d.mts +0 -47
- package/dist/esm/api/types/index.mjs +0 -47
- package/dist/esm/core/fetcher/APIResponse.d.mts +0 -20
- package/dist/esm/core/fetcher/APIResponse.mjs +0 -1
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +0 -20
- package/dist/esm/core/fetcher/BinaryResponse.mjs +0 -14
- package/dist/esm/core/fetcher/Fetcher.d.mts +0 -40
- package/dist/esm/core/fetcher/Fetcher.mjs +0 -116
- package/dist/esm/core/fetcher/Headers.d.mts +0 -2
- package/dist/esm/core/fetcher/Headers.mjs +0 -82
- package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +0 -58
- package/dist/esm/core/fetcher/HttpResponsePromise.mjs +0 -99
- package/dist/esm/core/fetcher/RawResponse.d.mts +0 -29
- package/dist/esm/core/fetcher/RawResponse.mjs +0 -40
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
- package/dist/esm/core/fetcher/Supplier.d.mts +0 -4
- package/dist/esm/core/fetcher/Supplier.mjs +0 -19
- package/dist/esm/core/fetcher/createRequestUrl.d.mts +0 -1
- package/dist/esm/core/fetcher/createRequestUrl.mjs +0 -5
- package/dist/esm/core/fetcher/getErrorResponseBody.d.mts +0 -1
- package/dist/esm/core/fetcher/getErrorResponseBody.mjs +0 -41
- package/dist/esm/core/fetcher/getFetchFn.d.mts +0 -1
- package/dist/esm/core/fetcher/getFetchFn.mjs +0 -14
- package/dist/esm/core/fetcher/getHeader.d.mts +0 -1
- package/dist/esm/core/fetcher/getHeader.mjs +0 -8
- package/dist/esm/core/fetcher/getRequestBody.d.mts +0 -7
- package/dist/esm/core/fetcher/getRequestBody.mjs +0 -20
- package/dist/esm/core/fetcher/getResponseBody.d.mts +0 -1
- package/dist/esm/core/fetcher/getResponseBody.mjs +0 -52
- package/dist/esm/core/fetcher/index.d.mts +0 -9
- package/dist/esm/core/fetcher/index.mjs +0 -5
- package/dist/esm/core/fetcher/makeRequest.d.mts +0 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +0 -38
- package/dist/esm/core/fetcher/requestWithRetries.d.mts +0 -1
- package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -73
- package/dist/esm/core/fetcher/signals.d.mts +0 -11
- package/dist/esm/core/fetcher/signals.mjs +0 -32
- package/dist/esm/core/headers.d.mts +0 -3
- package/dist/esm/core/headers.mjs +0 -25
- package/dist/esm/core/index.d.mts +0 -3
- package/dist/esm/core/index.mjs +0 -3
- package/dist/esm/core/json.d.mts +0 -15
- package/dist/esm/core/json.mjs +0 -19
- package/dist/esm/core/runtime/index.d.mts +0 -1
- package/dist/esm/core/runtime/index.mjs +0 -1
- package/dist/esm/core/runtime/runtime.d.mts +0 -9
- package/dist/esm/core/runtime/runtime.mjs +0 -99
- package/dist/esm/core/url/index.d.mts +0 -2
- package/dist/esm/core/url/index.mjs +0 -2
- package/dist/esm/core/url/join.d.mts +0 -1
- package/dist/esm/core/url/join.mjs +0 -66
- package/dist/esm/core/url/qs.d.mts +0 -6
- package/dist/esm/core/url/qs.mjs +0 -61
- package/dist/esm/environments.d.mts +0 -7
- package/dist/esm/environments.mjs +0 -6
- package/dist/esm/errors/LarkError.d.mts +0 -15
- package/dist/esm/errors/LarkError.mjs +0 -26
- package/dist/esm/errors/LarkTimeoutError.d.mts +0 -6
- package/dist/esm/errors/LarkTimeoutError.mjs +0 -9
- package/dist/esm/errors/index.d.mts +0 -2
- package/dist/esm/errors/index.mjs +0 -2
- package/dist/esm/index.d.mts +0 -4
- package/dist/esm/index.mjs +0 -4
- package/dist/esm/version.d.mts +0 -1
- package/dist/esm/version.mjs +0 -1
- package/reference.md +0 -1205
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shims for types that we can't always rely on being available globally.
|
|
3
|
+
*
|
|
4
|
+
* Note: these only exist at the type-level, there is no corresponding runtime
|
|
5
|
+
* version for any of these symbols.
|
|
6
|
+
*/
|
|
7
|
+
type NeverToAny<T> = T extends never ? any : T;
|
|
8
|
+
/** @ts-ignore */
|
|
9
|
+
type _DOMReadableStream<R = any> = globalThis.ReadableStream<R>;
|
|
10
|
+
/** @ts-ignore */
|
|
11
|
+
type _NodeReadableStream<R = any> = import('stream/web').ReadableStream<R>;
|
|
12
|
+
type _ConditionalNodeReadableStream<R = any> = typeof globalThis extends {
|
|
13
|
+
ReadableStream: any;
|
|
14
|
+
} ? never : _NodeReadableStream<R>;
|
|
15
|
+
type _ReadableStream<R = any> = NeverToAny<([0] extends [1 & _DOMReadableStream<R>] ? never : _DOMReadableStream<R>) | ([0] extends [1 & _ConditionalNodeReadableStream<R>] ? never : _ConditionalNodeReadableStream<R>)>;
|
|
16
|
+
export type { _ReadableStream as ReadableStream };
|
|
17
|
+
//# sourceMappingURL=shim-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shim-types.d.ts","sourceRoot":"","sources":["../src/internal/shim-types.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;AAE/C,iBAAiB;AACjB,KAAK,kBAAkB,CAAC,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;AAEhE,iBAAiB;AACjB,KAAK,mBAAmB,CAAC,CAAC,GAAG,GAAG,IAAI,OAAO,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;AAE3E,KAAK,8BAA8B,CAAC,CAAC,GAAG,GAAG,IACzC,OAAO,UAAU,SAAS;IAAE,cAAc,EAAE,GAAG,CAAA;CAAE,GAAG,KAAK,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAErF,KAAK,eAAe,CAAC,CAAC,GAAG,GAAG,IAAI,UAAU,CACtC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,GACzE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,8BAA8B,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,8BAA8B,CAAC,CAAC,CAAC,CAAC,CACpG,CAAC;AAEF,YAAY,EAAE,eAAe,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shim-types.js","sourceRoot":"","sources":["../src/internal/shim-types.ts"],"names":[],"mappings":";AAAA,sFAAsF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shim-types.mjs","sourceRoot":"","sources":["../src/internal/shim-types.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Fetch } from "./builtin-types.mjs";
|
|
2
|
+
import type { ReadableStream } from "./shim-types.mjs";
|
|
3
|
+
export declare function getDefaultFetch(): Fetch;
|
|
4
|
+
type ReadableStreamArgs = ConstructorParameters<typeof ReadableStream>;
|
|
5
|
+
export declare function makeReadableStream(...args: ReadableStreamArgs): ReadableStream;
|
|
6
|
+
export declare function ReadableStreamFrom<T>(iterable: Iterable<T> | AsyncIterable<T>): ReadableStream<T>;
|
|
7
|
+
/**
|
|
8
|
+
* Most browsers don't yet have async iterable support for ReadableStream,
|
|
9
|
+
* and Node has a very different way of reading bytes from its "ReadableStream".
|
|
10
|
+
*
|
|
11
|
+
* This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490
|
|
12
|
+
*/
|
|
13
|
+
export declare function ReadableStreamToAsyncIterable<T>(stream: any): AsyncIterableIterator<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Cancels a ReadableStream we don't need to consume.
|
|
16
|
+
* See https://undici.nodejs.org/#/?id=garbage-collection
|
|
17
|
+
*/
|
|
18
|
+
export declare function CancelReadableStream(stream: any): Promise<void>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=shims.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shims.d.mts","sourceRoot":"","sources":["../src/internal/shims.ts"],"names":[],"mappings":"OASO,KAAK,EAAE,KAAK,EAAE;OACd,KAAK,EAAE,cAAc,EAAE;AAE9B,wBAAgB,eAAe,IAAI,KAAK,CAQvC;AAED,KAAK,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,cAAc,CAAC,CAAC;AAEvE,wBAAgB,kBAAkB,CAAC,GAAG,IAAI,EAAE,kBAAkB,GAAG,cAAc,CAW9E;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAkBjG;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAyBtF;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAYrE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Fetch } from "./builtin-types.js";
|
|
2
|
+
import type { ReadableStream } from "./shim-types.js";
|
|
3
|
+
export declare function getDefaultFetch(): Fetch;
|
|
4
|
+
type ReadableStreamArgs = ConstructorParameters<typeof ReadableStream>;
|
|
5
|
+
export declare function makeReadableStream(...args: ReadableStreamArgs): ReadableStream;
|
|
6
|
+
export declare function ReadableStreamFrom<T>(iterable: Iterable<T> | AsyncIterable<T>): ReadableStream<T>;
|
|
7
|
+
/**
|
|
8
|
+
* Most browsers don't yet have async iterable support for ReadableStream,
|
|
9
|
+
* and Node has a very different way of reading bytes from its "ReadableStream".
|
|
10
|
+
*
|
|
11
|
+
* This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490
|
|
12
|
+
*/
|
|
13
|
+
export declare function ReadableStreamToAsyncIterable<T>(stream: any): AsyncIterableIterator<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Cancels a ReadableStream we don't need to consume.
|
|
16
|
+
* See https://undici.nodejs.org/#/?id=garbage-collection
|
|
17
|
+
*/
|
|
18
|
+
export declare function CancelReadableStream(stream: any): Promise<void>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=shims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shims.d.ts","sourceRoot":"","sources":["../src/internal/shims.ts"],"names":[],"mappings":"OASO,KAAK,EAAE,KAAK,EAAE;OACd,KAAK,EAAE,cAAc,EAAE;AAE9B,wBAAgB,eAAe,IAAI,KAAK,CAQvC;AAED,KAAK,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,cAAc,CAAC,CAAC;AAEvE,wBAAgB,kBAAkB,CAAC,GAAG,IAAI,EAAE,kBAAkB,GAAG,cAAc,CAW9E;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAkBjG;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAyBtF;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAYrE"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getDefaultFetch = getDefaultFetch;
|
|
5
|
+
exports.makeReadableStream = makeReadableStream;
|
|
6
|
+
exports.ReadableStreamFrom = ReadableStreamFrom;
|
|
7
|
+
exports.ReadableStreamToAsyncIterable = ReadableStreamToAsyncIterable;
|
|
8
|
+
exports.CancelReadableStream = CancelReadableStream;
|
|
9
|
+
function getDefaultFetch() {
|
|
10
|
+
if (typeof fetch !== 'undefined') {
|
|
11
|
+
return fetch;
|
|
12
|
+
}
|
|
13
|
+
throw new Error('`fetch` is not defined as a global; Either pass `fetch` to the client, `new Lark({ fetch })` or polyfill the global, `globalThis.fetch = fetch`');
|
|
14
|
+
}
|
|
15
|
+
function makeReadableStream(...args) {
|
|
16
|
+
const ReadableStream = globalThis.ReadableStream;
|
|
17
|
+
if (typeof ReadableStream === 'undefined') {
|
|
18
|
+
// Note: All of the platforms / runtimes we officially support already define
|
|
19
|
+
// `ReadableStream` as a global, so this should only ever be hit on unsupported runtimes.
|
|
20
|
+
throw new Error('`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`');
|
|
21
|
+
}
|
|
22
|
+
return new ReadableStream(...args);
|
|
23
|
+
}
|
|
24
|
+
function ReadableStreamFrom(iterable) {
|
|
25
|
+
let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
|
|
26
|
+
return makeReadableStream({
|
|
27
|
+
start() { },
|
|
28
|
+
async pull(controller) {
|
|
29
|
+
const { done, value } = await iter.next();
|
|
30
|
+
if (done) {
|
|
31
|
+
controller.close();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
controller.enqueue(value);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
async cancel() {
|
|
38
|
+
await iter.return?.();
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Most browsers don't yet have async iterable support for ReadableStream,
|
|
44
|
+
* and Node has a very different way of reading bytes from its "ReadableStream".
|
|
45
|
+
*
|
|
46
|
+
* This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490
|
|
47
|
+
*/
|
|
48
|
+
function ReadableStreamToAsyncIterable(stream) {
|
|
49
|
+
if (stream[Symbol.asyncIterator])
|
|
50
|
+
return stream;
|
|
51
|
+
const reader = stream.getReader();
|
|
52
|
+
return {
|
|
53
|
+
async next() {
|
|
54
|
+
try {
|
|
55
|
+
const result = await reader.read();
|
|
56
|
+
if (result?.done)
|
|
57
|
+
reader.releaseLock(); // release lock when stream becomes closed
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
reader.releaseLock(); // release lock when stream becomes errored
|
|
62
|
+
throw e;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
async return() {
|
|
66
|
+
const cancelPromise = reader.cancel();
|
|
67
|
+
reader.releaseLock();
|
|
68
|
+
await cancelPromise;
|
|
69
|
+
return { done: true, value: undefined };
|
|
70
|
+
},
|
|
71
|
+
[Symbol.asyncIterator]() {
|
|
72
|
+
return this;
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Cancels a ReadableStream we don't need to consume.
|
|
78
|
+
* See https://undici.nodejs.org/#/?id=garbage-collection
|
|
79
|
+
*/
|
|
80
|
+
async function CancelReadableStream(stream) {
|
|
81
|
+
if (stream === null || typeof stream !== 'object')
|
|
82
|
+
return;
|
|
83
|
+
if (stream[Symbol.asyncIterator]) {
|
|
84
|
+
await stream[Symbol.asyncIterator]().return?.();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const reader = stream.getReader();
|
|
88
|
+
const cancelPromise = reader.cancel();
|
|
89
|
+
reader.releaseLock();
|
|
90
|
+
await cancelPromise;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=shims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shims.js","sourceRoot":"","sources":["../src/internal/shims.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAYtF,0CAQC;AAID,gDAWC;AAED,gDAkBC;AAQD,sEAyBC;AAMD,oDAYC;AA9FD,SAAgB,eAAe;IAC7B,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,KAAY,CAAC;IACtB,CAAC;IAED,MAAM,IAAI,KAAK,CACb,iJAAiJ,CAClJ,CAAC;AACJ,CAAC;AAID,SAAgB,kBAAkB,CAAC,GAAG,IAAwB;IAC5D,MAAM,cAAc,GAAI,UAAkB,CAAC,cAAc,CAAC;IAC1D,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE,CAAC;QAC1C,6EAA6E;QAC7E,yFAAyF;QACzF,MAAM,IAAI,KAAK,CACb,yHAAyH,CAC1H,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,SAAgB,kBAAkB,CAAI,QAAwC;IAC5E,IAAI,IAAI,GACN,MAAM,CAAC,aAAa,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IAEpG,OAAO,kBA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,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,oBAAoB,CAAC,MAAW;IACpD,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO;IAE1D,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;QAChD,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;IAClC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,CAAC,WAAW,EAAE,CAAC;IACrB,MAAM,aAAa,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
export function getDefaultFetch() {
|
|
3
|
+
if (typeof fetch !== 'undefined') {
|
|
4
|
+
return fetch;
|
|
5
|
+
}
|
|
6
|
+
throw new Error('`fetch` is not defined as a global; Either pass `fetch` to the client, `new Lark({ fetch })` or polyfill the global, `globalThis.fetch = fetch`');
|
|
7
|
+
}
|
|
8
|
+
export function makeReadableStream(...args) {
|
|
9
|
+
const ReadableStream = globalThis.ReadableStream;
|
|
10
|
+
if (typeof ReadableStream === 'undefined') {
|
|
11
|
+
// Note: All of the platforms / runtimes we officially support already define
|
|
12
|
+
// `ReadableStream` as a global, so this should only ever be hit on unsupported runtimes.
|
|
13
|
+
throw new Error('`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`');
|
|
14
|
+
}
|
|
15
|
+
return new ReadableStream(...args);
|
|
16
|
+
}
|
|
17
|
+
export function ReadableStreamFrom(iterable) {
|
|
18
|
+
let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
|
|
19
|
+
return makeReadableStream({
|
|
20
|
+
start() { },
|
|
21
|
+
async pull(controller) {
|
|
22
|
+
const { done, value } = await iter.next();
|
|
23
|
+
if (done) {
|
|
24
|
+
controller.close();
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
controller.enqueue(value);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
async cancel() {
|
|
31
|
+
await iter.return?.();
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Most browsers don't yet have async iterable support for ReadableStream,
|
|
37
|
+
* and Node has a very different way of reading bytes from its "ReadableStream".
|
|
38
|
+
*
|
|
39
|
+
* This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490
|
|
40
|
+
*/
|
|
41
|
+
export function ReadableStreamToAsyncIterable(stream) {
|
|
42
|
+
if (stream[Symbol.asyncIterator])
|
|
43
|
+
return stream;
|
|
44
|
+
const reader = stream.getReader();
|
|
45
|
+
return {
|
|
46
|
+
async next() {
|
|
47
|
+
try {
|
|
48
|
+
const result = await reader.read();
|
|
49
|
+
if (result?.done)
|
|
50
|
+
reader.releaseLock(); // release lock when stream becomes closed
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
reader.releaseLock(); // release lock when stream becomes errored
|
|
55
|
+
throw e;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
async return() {
|
|
59
|
+
const cancelPromise = reader.cancel();
|
|
60
|
+
reader.releaseLock();
|
|
61
|
+
await cancelPromise;
|
|
62
|
+
return { done: true, value: undefined };
|
|
63
|
+
},
|
|
64
|
+
[Symbol.asyncIterator]() {
|
|
65
|
+
return this;
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Cancels a ReadableStream we don't need to consume.
|
|
71
|
+
* See https://undici.nodejs.org/#/?id=garbage-collection
|
|
72
|
+
*/
|
|
73
|
+
export async function CancelReadableStream(stream) {
|
|
74
|
+
if (stream === null || typeof stream !== 'object')
|
|
75
|
+
return;
|
|
76
|
+
if (stream[Symbol.asyncIterator]) {
|
|
77
|
+
await stream[Symbol.asyncIterator]().return?.();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const reader = stream.getReader();
|
|
81
|
+
const cancelPromise = reader.cancel();
|
|
82
|
+
reader.releaseLock();
|
|
83
|
+
await cancelPromise;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=shims.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shims.mjs","sourceRoot":"","sources":["../src/internal/shims.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAYtF,MAAM,UAAU,eAAe;IAC7B,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,KAAY,CAAC;IACtB,CAAC;IAED,MAAM,IAAI,KAAK,CACb,iJAAiJ,CAClJ,CAAC;AACJ,CAAC;AAID,MAAM,UAAU,kBAAkB,CAAC,GAAG,IAAwB;IAC5D,MAAM,cAAc,GAAI,UAAkB,CAAC,cAAc,CAAC;IAC1D,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE,CAAC;QAC1C,6EAA6E;QAC7E,yFAAyF;QACzF,MAAM,IAAI,KAAK,CACb,yHAAyH,CAC1H,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAI,QAAwC;IAC5E,IAAI,IAAI,GACN,MAAM,CAAC,aAAa,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IAEpG,OAAO,kBAAkB,CAAC;QACxB,KAAK,KAAI,CAAC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CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,MAAW;IACpD,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO;IAE1D,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;QAChD,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;IAClC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,CAAC,WAAW,EAAE,CAAC;IACrB,MAAM,aAAa,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { FilePropertyBag } from "./builtin-types.mjs";
|
|
2
|
+
type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | DataView;
|
|
3
|
+
/**
|
|
4
|
+
* Intended to match DOM Blob, node-fetch Blob, node:buffer Blob, etc.
|
|
5
|
+
* Don't add arrayBuffer here, node-fetch doesn't have it
|
|
6
|
+
*/
|
|
7
|
+
interface BlobLike {
|
|
8
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
9
|
+
readonly size: number;
|
|
10
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
11
|
+
readonly type: string;
|
|
12
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
13
|
+
text(): Promise<string>;
|
|
14
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
15
|
+
slice(start?: number, end?: number): BlobLike;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Intended to match DOM File, node:buffer File, undici File, etc.
|
|
19
|
+
*/
|
|
20
|
+
interface FileLike extends BlobLike {
|
|
21
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
22
|
+
readonly lastModified: number;
|
|
23
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
24
|
+
readonly name?: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Intended to match DOM Response, node-fetch Response, undici Response, etc.
|
|
28
|
+
*/
|
|
29
|
+
export interface ResponseLike {
|
|
30
|
+
url: string;
|
|
31
|
+
blob(): Promise<BlobLike>;
|
|
32
|
+
}
|
|
33
|
+
export type ToFileInput = FileLike | ResponseLike | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
|
|
34
|
+
/**
|
|
35
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
36
|
+
* @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
|
|
37
|
+
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
38
|
+
* @param {Object=} options additional properties
|
|
39
|
+
* @param {string=} options.type the MIME type of the content
|
|
40
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
41
|
+
* @returns a {@link File} with the given properties
|
|
42
|
+
*/
|
|
43
|
+
export declare function toFile(value: ToFileInput | PromiseLike<ToFileInput>, name?: string | null | undefined, options?: FilePropertyBag | undefined): Promise<File>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=to-file.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-file.d.mts","sourceRoot":"","sources":["../src/internal/to-file.ts"],"names":[],"mappings":"OACO,KAAK,EAAE,eAAe,EAAE;AAG/B,KAAK,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjF;;;GAGG;AACH,UAAU,QAAQ;IAChB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,6EAA6E;IAC7E,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC/C;AAcD;;GAEG;AACH,UAAU,QAAS,SAAQ,QAAQ;IACjC,oFAAoF;IACpF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAYD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAQD,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,YAAY,GACZ,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAC7B,aAAa,CAAC,YAAY,CAAC,CAAC;AAEhC;;;;;;;;GAQG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,EAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,GACpC,OAAO,CAAC,IAAI,CAAC,CAiCf"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { FilePropertyBag } from "./builtin-types.js";
|
|
2
|
+
type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | DataView;
|
|
3
|
+
/**
|
|
4
|
+
* Intended to match DOM Blob, node-fetch Blob, node:buffer Blob, etc.
|
|
5
|
+
* Don't add arrayBuffer here, node-fetch doesn't have it
|
|
6
|
+
*/
|
|
7
|
+
interface BlobLike {
|
|
8
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
9
|
+
readonly size: number;
|
|
10
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
11
|
+
readonly type: string;
|
|
12
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
13
|
+
text(): Promise<string>;
|
|
14
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
15
|
+
slice(start?: number, end?: number): BlobLike;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Intended to match DOM File, node:buffer File, undici File, etc.
|
|
19
|
+
*/
|
|
20
|
+
interface FileLike extends BlobLike {
|
|
21
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
22
|
+
readonly lastModified: number;
|
|
23
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
24
|
+
readonly name?: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Intended to match DOM Response, node-fetch Response, undici Response, etc.
|
|
28
|
+
*/
|
|
29
|
+
export interface ResponseLike {
|
|
30
|
+
url: string;
|
|
31
|
+
blob(): Promise<BlobLike>;
|
|
32
|
+
}
|
|
33
|
+
export type ToFileInput = FileLike | ResponseLike | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
|
|
34
|
+
/**
|
|
35
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
36
|
+
* @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
|
|
37
|
+
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
38
|
+
* @param {Object=} options additional properties
|
|
39
|
+
* @param {string=} options.type the MIME type of the content
|
|
40
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
41
|
+
* @returns a {@link File} with the given properties
|
|
42
|
+
*/
|
|
43
|
+
export declare function toFile(value: ToFileInput | PromiseLike<ToFileInput>, name?: string | null | undefined, options?: FilePropertyBag | undefined): Promise<File>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=to-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-file.d.ts","sourceRoot":"","sources":["../src/internal/to-file.ts"],"names":[],"mappings":"OACO,KAAK,EAAE,eAAe,EAAE;AAG/B,KAAK,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjF;;;GAGG;AACH,UAAU,QAAQ;IAChB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,6EAA6E;IAC7E,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC/C;AAcD;;GAEG;AACH,UAAU,QAAS,SAAQ,QAAQ;IACjC,oFAAoF;IACpF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAYD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAQD,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,YAAY,GACZ,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAC7B,aAAa,CAAC,YAAY,CAAC,CAAC;AAEhC;;;;;;;;GAQG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,EAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,GACpC,OAAO,CAAC,IAAI,CAAC,CAiCf"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toFile = toFile;
|
|
4
|
+
const uploads_1 = require("./uploads.js");
|
|
5
|
+
const uploads_2 = require("./uploads.js");
|
|
6
|
+
/**
|
|
7
|
+
* This check adds the arrayBuffer() method type because it is available and used at runtime
|
|
8
|
+
*/
|
|
9
|
+
const isBlobLike = (value) => value != null &&
|
|
10
|
+
typeof value === 'object' &&
|
|
11
|
+
typeof value.size === 'number' &&
|
|
12
|
+
typeof value.type === 'string' &&
|
|
13
|
+
typeof value.text === 'function' &&
|
|
14
|
+
typeof value.slice === 'function' &&
|
|
15
|
+
typeof value.arrayBuffer === 'function';
|
|
16
|
+
/**
|
|
17
|
+
* This check adds the arrayBuffer() method type because it is available and used at runtime
|
|
18
|
+
*/
|
|
19
|
+
const isFileLike = (value) => value != null &&
|
|
20
|
+
typeof value === 'object' &&
|
|
21
|
+
typeof value.name === 'string' &&
|
|
22
|
+
typeof value.lastModified === 'number' &&
|
|
23
|
+
isBlobLike(value);
|
|
24
|
+
const isResponseLike = (value) => value != null &&
|
|
25
|
+
typeof value === 'object' &&
|
|
26
|
+
typeof value.url === 'string' &&
|
|
27
|
+
typeof value.blob === 'function';
|
|
28
|
+
/**
|
|
29
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
30
|
+
* @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
|
|
31
|
+
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
32
|
+
* @param {Object=} options additional properties
|
|
33
|
+
* @param {string=} options.type the MIME type of the content
|
|
34
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
35
|
+
* @returns a {@link File} with the given properties
|
|
36
|
+
*/
|
|
37
|
+
async function toFile(value, name, options) {
|
|
38
|
+
(0, uploads_2.checkFileSupport)();
|
|
39
|
+
// If it's a promise, resolve it.
|
|
40
|
+
value = await value;
|
|
41
|
+
// If we've been given a `File` we don't need to do anything
|
|
42
|
+
if (isFileLike(value)) {
|
|
43
|
+
if (value instanceof File) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
return (0, uploads_1.makeFile)([await value.arrayBuffer()], value.name);
|
|
47
|
+
}
|
|
48
|
+
if (isResponseLike(value)) {
|
|
49
|
+
const blob = await value.blob();
|
|
50
|
+
name || (name = new URL(value.url).pathname.split(/[\\/]/).pop());
|
|
51
|
+
return (0, uploads_1.makeFile)(await getBytes(blob), name, options);
|
|
52
|
+
}
|
|
53
|
+
const parts = await getBytes(value);
|
|
54
|
+
name || (name = (0, uploads_1.getName)(value));
|
|
55
|
+
if (!options?.type) {
|
|
56
|
+
const type = parts.find((part) => typeof part === 'object' && 'type' in part && part.type);
|
|
57
|
+
if (typeof type === 'string') {
|
|
58
|
+
options = { ...options, type };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return (0, uploads_1.makeFile)(parts, name, options);
|
|
62
|
+
}
|
|
63
|
+
async function getBytes(value) {
|
|
64
|
+
let parts = [];
|
|
65
|
+
if (typeof value === 'string' ||
|
|
66
|
+
ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.
|
|
67
|
+
value instanceof ArrayBuffer) {
|
|
68
|
+
parts.push(value);
|
|
69
|
+
}
|
|
70
|
+
else if (isBlobLike(value)) {
|
|
71
|
+
parts.push(value instanceof Blob ? value : await value.arrayBuffer());
|
|
72
|
+
}
|
|
73
|
+
else if ((0, uploads_1.isAsyncIterable)(value) // includes Readable, ReadableStream, etc.
|
|
74
|
+
) {
|
|
75
|
+
for await (const chunk of value) {
|
|
76
|
+
parts.push(...(await getBytes(chunk))); // TODO, consider validating?
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const constructor = value?.constructor?.name;
|
|
81
|
+
throw new Error(`Unexpected data type: ${typeof value}${constructor ? `; constructor: ${constructor}` : ''}${propsForError(value)}`);
|
|
82
|
+
}
|
|
83
|
+
return parts;
|
|
84
|
+
}
|
|
85
|
+
function propsForError(value) {
|
|
86
|
+
if (typeof value !== 'object' || value === null)
|
|
87
|
+
return '';
|
|
88
|
+
const props = Object.getOwnPropertyNames(value);
|
|
89
|
+
return `; props: [${props.map((p) => `"${p}"`).join(', ')}]`;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=to-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-file.js","sourceRoot":"","sources":["../src/internal/to-file.ts"],"names":[],"mappings":";;AAkFA,wBAqCC;AAvHD,0CAAyE;AAEzE,0CAA6C;AAmB7C;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,KAAU,EAA+D,EAAE,CAC7F,KAAK,IAAI,IAAI;IACb,OAAO,KAAK,KAAK,QAAQ;IACzB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;IAChC,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU;IACjC,OAAO,KAAK,CAAC,WAAW,KAAK,UAAU,CAAC;AAY1C;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,KAAU,EAA+D,EAAE,CAC7F,KAAK,IAAI,IAAI;IACb,OAAO,KAAK,KAAK,QAAQ;IACzB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ;IACtC,UAAU,CAAC,KAAK,CAAC,CAAC;AAUpB,MAAM,cAAc,GAAG,CAAC,KAAU,EAAyB,EAAE,CAC3D,KAAK,IAAI,IAAI;IACb,OAAO,KAAK,KAAK,QAAQ;IACzB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,aAAa,CAAC,KAAc;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAC3D,MAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,aAAa,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { getName, makeFile, isAsyncIterable } from "./uploads.mjs";
|
|
2
|
+
import { checkFileSupport } from "./uploads.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* This check adds the arrayBuffer() method type because it is available and used at runtime
|
|
5
|
+
*/
|
|
6
|
+
const isBlobLike = (value) => value != null &&
|
|
7
|
+
typeof value === 'object' &&
|
|
8
|
+
typeof value.size === 'number' &&
|
|
9
|
+
typeof value.type === 'string' &&
|
|
10
|
+
typeof value.text === 'function' &&
|
|
11
|
+
typeof value.slice === 'function' &&
|
|
12
|
+
typeof value.arrayBuffer === 'function';
|
|
13
|
+
/**
|
|
14
|
+
* This check adds the arrayBuffer() method type because it is available and used at runtime
|
|
15
|
+
*/
|
|
16
|
+
const isFileLike = (value) => value != null &&
|
|
17
|
+
typeof value === 'object' &&
|
|
18
|
+
typeof value.name === 'string' &&
|
|
19
|
+
typeof value.lastModified === 'number' &&
|
|
20
|
+
isBlobLike(value);
|
|
21
|
+
const isResponseLike = (value) => value != null &&
|
|
22
|
+
typeof value === 'object' &&
|
|
23
|
+
typeof value.url === 'string' &&
|
|
24
|
+
typeof value.blob === 'function';
|
|
25
|
+
/**
|
|
26
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
27
|
+
* @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
|
|
28
|
+
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
29
|
+
* @param {Object=} options additional properties
|
|
30
|
+
* @param {string=} options.type the MIME type of the content
|
|
31
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
32
|
+
* @returns a {@link File} with the given properties
|
|
33
|
+
*/
|
|
34
|
+
export async function toFile(value, name, options) {
|
|
35
|
+
checkFileSupport();
|
|
36
|
+
// If it's a promise, resolve it.
|
|
37
|
+
value = await value;
|
|
38
|
+
// If we've been given a `File` we don't need to do anything
|
|
39
|
+
if (isFileLike(value)) {
|
|
40
|
+
if (value instanceof File) {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
return makeFile([await value.arrayBuffer()], value.name);
|
|
44
|
+
}
|
|
45
|
+
if (isResponseLike(value)) {
|
|
46
|
+
const blob = await value.blob();
|
|
47
|
+
name || (name = new URL(value.url).pathname.split(/[\\/]/).pop());
|
|
48
|
+
return makeFile(await getBytes(blob), name, options);
|
|
49
|
+
}
|
|
50
|
+
const parts = await getBytes(value);
|
|
51
|
+
name || (name = getName(value));
|
|
52
|
+
if (!options?.type) {
|
|
53
|
+
const type = parts.find((part) => typeof part === 'object' && 'type' in part && part.type);
|
|
54
|
+
if (typeof type === 'string') {
|
|
55
|
+
options = { ...options, type };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return makeFile(parts, name, options);
|
|
59
|
+
}
|
|
60
|
+
async function getBytes(value) {
|
|
61
|
+
let parts = [];
|
|
62
|
+
if (typeof value === 'string' ||
|
|
63
|
+
ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.
|
|
64
|
+
value instanceof ArrayBuffer) {
|
|
65
|
+
parts.push(value);
|
|
66
|
+
}
|
|
67
|
+
else if (isBlobLike(value)) {
|
|
68
|
+
parts.push(value instanceof Blob ? value : await value.arrayBuffer());
|
|
69
|
+
}
|
|
70
|
+
else if (isAsyncIterable(value) // includes Readable, ReadableStream, etc.
|
|
71
|
+
) {
|
|
72
|
+
for await (const chunk of value) {
|
|
73
|
+
parts.push(...(await getBytes(chunk))); // TODO, consider validating?
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
const constructor = value?.constructor?.name;
|
|
78
|
+
throw new Error(`Unexpected data type: ${typeof value}${constructor ? `; constructor: ${constructor}` : ''}${propsForError(value)}`);
|
|
79
|
+
}
|
|
80
|
+
return parts;
|
|
81
|
+
}
|
|
82
|
+
function propsForError(value) {
|
|
83
|
+
if (typeof value !== 'object' || value === null)
|
|
84
|
+
return '';
|
|
85
|
+
const props = Object.getOwnPropertyNames(value);
|
|
86
|
+
return `; props: [${props.map((p) => `"${p}"`).join(', ')}]`;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=to-file.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-file.mjs","sourceRoot":"","sources":["../src/internal/to-file.ts"],"names":[],"mappings":"OAAO,EAAY,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE;OAEhD,EAAE,gBAAgB,EAAE;AAmB3B;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,KAAU,EAA+D,EAAE,CAC7F,KAAK,IAAI,IAAI;IACb,OAAO,KAAK,KAAK,QAAQ;IACzB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;IAChC,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU;IACjC,OAAO,KAAK,CAAC,WAAW,KAAK,UAAU,CAAC;AAY1C;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,KAAU,EAA+D,EAAE,CAC7F,KAAK,IAAI,IAAI;IACb,OAAO,KAAK,KAAK,QAAQ;IACzB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC9B,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ;IACtC,UAAU,CAAC,KAAK,CAAC,C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