@quickshops/sdk 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/FUNCTIONS.md +88 -0
- package/README.md +486 -0
- package/RUNTIMES.md +48 -0
- package/esm/core.d.ts +10 -0
- package/esm/core.d.ts.map +1 -0
- package/esm/core.js +13 -0
- package/esm/core.js.map +1 -0
- package/esm/funcs/cart-cart-add-line.d.ts +15 -0
- package/esm/funcs/cart-cart-add-line.d.ts.map +1 -0
- package/esm/funcs/cart-cart-add-line.js +87 -0
- package/esm/funcs/cart-cart-add-line.js.map +1 -0
- package/esm/funcs/cart-cart-clear.d.ts +15 -0
- package/esm/funcs/cart-cart-clear.d.ts.map +1 -0
- package/esm/funcs/cart-cart-clear.js +86 -0
- package/esm/funcs/cart-cart-clear.js.map +1 -0
- package/esm/funcs/cart-cart-create.d.ts +15 -0
- package/esm/funcs/cart-cart-create.d.ts.map +1 -0
- package/esm/funcs/cart-cart-create.js +70 -0
- package/esm/funcs/cart-cart-create.js.map +1 -0
- package/esm/funcs/cart-cart-get.d.ts +15 -0
- package/esm/funcs/cart-cart-get.d.ts.map +1 -0
- package/esm/funcs/cart-cart-get.js +86 -0
- package/esm/funcs/cart-cart-get.js.map +1 -0
- package/esm/funcs/cart-cart-remove-line.d.ts +15 -0
- package/esm/funcs/cart-cart-remove-line.d.ts.map +1 -0
- package/esm/funcs/cart-cart-remove-line.js +90 -0
- package/esm/funcs/cart-cart-remove-line.js.map +1 -0
- package/esm/funcs/cart-cart-update-line.d.ts +15 -0
- package/esm/funcs/cart-cart-update-line.d.ts.map +1 -0
- package/esm/funcs/cart-cart-update-line.js +91 -0
- package/esm/funcs/cart-cart-update-line.js.map +1 -0
- package/esm/funcs/checkout-checkout-create-session.d.ts +15 -0
- package/esm/funcs/checkout-checkout-create-session.d.ts.map +1 -0
- package/esm/funcs/checkout-checkout-create-session.js +81 -0
- package/esm/funcs/checkout-checkout-create-session.js.map +1 -0
- package/esm/funcs/health-health-check.d.ts +15 -0
- package/esm/funcs/health-health-check.d.ts.map +1 -0
- package/esm/funcs/health-health-check.js +70 -0
- package/esm/funcs/health-health-check.js.map +1 -0
- package/esm/funcs/products-products-get-all.d.ts +15 -0
- package/esm/funcs/products-products-get-all.d.ts.map +1 -0
- package/esm/funcs/products-products-get-all.js +70 -0
- package/esm/funcs/products-products-get-all.js.map +1 -0
- package/esm/funcs/products-products-get-by-id.d.ts +15 -0
- package/esm/funcs/products-products-get-by-id.d.ts.map +1 -0
- package/esm/funcs/products-products-get-by-id.js +86 -0
- package/esm/funcs/products-products-get-by-id.js.map +1 -0
- package/esm/funcs/store-store-get.d.ts +15 -0
- package/esm/funcs/store-store-get.d.ts.map +1 -0
- package/esm/funcs/store-store-get.js +70 -0
- package/esm/funcs/store-store-get.js.map +1 -0
- package/esm/funcs/subscription-subscription-create-portal-session.d.ts +15 -0
- package/esm/funcs/subscription-subscription-create-portal-session.d.ts.map +1 -0
- package/esm/funcs/subscription-subscription-create-portal-session.js +81 -0
- package/esm/funcs/subscription-subscription-create-portal-session.js.map +1 -0
- package/esm/hooks/hooks.d.ts +25 -0
- package/esm/hooks/hooks.d.ts.map +1 -0
- package/esm/hooks/hooks.js +80 -0
- package/esm/hooks/hooks.js.map +1 -0
- package/esm/hooks/index.d.ts +3 -0
- package/esm/hooks/index.d.ts.map +1 -0
- package/esm/hooks/index.js +6 -0
- package/esm/hooks/index.js.map +1 -0
- package/esm/hooks/types.d.ts +77 -0
- package/esm/hooks/types.d.ts.map +1 -0
- package/esm/hooks/types.js +5 -0
- package/esm/hooks/types.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +8 -0
- package/esm/index.js.map +1 -0
- package/esm/lib/base64.d.ts +10 -0
- package/esm/lib/base64.d.ts.map +1 -0
- package/esm/lib/base64.js +31 -0
- package/esm/lib/base64.js.map +1 -0
- package/esm/lib/config.d.ts +30 -0
- package/esm/lib/config.d.ts.map +1 -0
- package/esm/lib/config.js +21 -0
- package/esm/lib/config.js.map +1 -0
- package/esm/lib/encodings.d.ts +54 -0
- package/esm/lib/encodings.d.ts.map +1 -0
- package/esm/lib/encodings.js +391 -0
- package/esm/lib/encodings.js.map +1 -0
- package/esm/lib/env.d.ts +15 -0
- package/esm/lib/env.d.ts.map +1 -0
- package/esm/lib/env.js +44 -0
- package/esm/lib/env.js.map +1 -0
- package/esm/lib/files.d.ts +26 -0
- package/esm/lib/files.d.ts.map +1 -0
- package/esm/lib/files.js +91 -0
- package/esm/lib/files.js.map +1 -0
- package/esm/lib/http.d.ts +67 -0
- package/esm/lib/http.d.ts.map +1 -0
- package/esm/lib/http.js +209 -0
- package/esm/lib/http.js.map +1 -0
- package/esm/lib/logger.d.ts +6 -0
- package/esm/lib/logger.d.ts.map +1 -0
- package/esm/lib/logger.js +5 -0
- package/esm/lib/logger.js.map +1 -0
- package/esm/lib/matchers.d.ts +59 -0
- package/esm/lib/matchers.d.ts.map +1 -0
- package/esm/lib/matchers.js +202 -0
- package/esm/lib/matchers.js.map +1 -0
- package/esm/lib/primitives.d.ts +27 -0
- package/esm/lib/primitives.d.ts.map +1 -0
- package/esm/lib/primitives.js +120 -0
- package/esm/lib/primitives.js.map +1 -0
- package/esm/lib/retries.d.ts +38 -0
- package/esm/lib/retries.d.ts.map +1 -0
- package/esm/lib/retries.js +150 -0
- package/esm/lib/retries.js.map +1 -0
- package/esm/lib/schemas.d.ts +21 -0
- package/esm/lib/schemas.d.ts.map +1 -0
- package/esm/lib/schemas.js +57 -0
- package/esm/lib/schemas.js.map +1 -0
- package/esm/lib/sdks.d.ts +63 -0
- package/esm/lib/sdks.d.ts.map +1 -0
- package/esm/lib/sdks.js +294 -0
- package/esm/lib/sdks.js.map +1 -0
- package/esm/lib/security.d.ts +83 -0
- package/esm/lib/security.d.ts.map +1 -0
- package/esm/lib/security.js +149 -0
- package/esm/lib/security.js.map +1 -0
- package/esm/lib/url.d.ts +5 -0
- package/esm/lib/url.d.ts.map +1 -0
- package/esm/lib/url.js +24 -0
- package/esm/lib/url.js.map +1 -0
- package/esm/models/errors/cart-add-line.d.ts +141 -0
- package/esm/models/errors/cart-add-line.d.ts.map +1 -0
- package/esm/models/errors/cart-add-line.js +205 -0
- package/esm/models/errors/cart-add-line.js.map +1 -0
- package/esm/models/errors/cart-clear.d.ts +118 -0
- package/esm/models/errors/cart-clear.d.ts.map +1 -0
- package/esm/models/errors/cart-clear.js +172 -0
- package/esm/models/errors/cart-clear.js.map +1 -0
- package/esm/models/errors/cart-create.d.ts +118 -0
- package/esm/models/errors/cart-create.d.ts.map +1 -0
- package/esm/models/errors/cart-create.js +172 -0
- package/esm/models/errors/cart-create.js.map +1 -0
- package/esm/models/errors/cart-get.d.ts +95 -0
- package/esm/models/errors/cart-get.d.ts.map +1 -0
- package/esm/models/errors/cart-get.js +139 -0
- package/esm/models/errors/cart-get.js.map +1 -0
- package/esm/models/errors/cart-remove-line.d.ts +141 -0
- package/esm/models/errors/cart-remove-line.d.ts.map +1 -0
- package/esm/models/errors/cart-remove-line.js +205 -0
- package/esm/models/errors/cart-remove-line.js.map +1 -0
- package/esm/models/errors/cart-update-line.d.ts +141 -0
- package/esm/models/errors/cart-update-line.d.ts.map +1 -0
- package/esm/models/errors/cart-update-line.js +205 -0
- package/esm/models/errors/cart-update-line.js.map +1 -0
- package/esm/models/errors/checkout-create-session.d.ts +118 -0
- package/esm/models/errors/checkout-create-session.d.ts.map +1 -0
- package/esm/models/errors/checkout-create-session.js +172 -0
- package/esm/models/errors/checkout-create-session.js.map +1 -0
- package/esm/models/errors/health-check.d.ts +72 -0
- package/esm/models/errors/health-check.d.ts.map +1 -0
- package/esm/models/errors/health-check.js +106 -0
- package/esm/models/errors/health-check.js.map +1 -0
- package/esm/models/errors/http-client-errors.d.ts +44 -0
- package/esm/models/errors/http-client-errors.d.ts.map +1 -0
- package/esm/models/errors/http-client-errors.js +56 -0
- package/esm/models/errors/http-client-errors.js.map +1 -0
- package/esm/models/errors/index.d.ts +18 -0
- package/esm/models/errors/index.d.ts.map +1 -0
- package/esm/models/errors/index.js +21 -0
- package/esm/models/errors/index.js.map +1 -0
- package/esm/models/errors/products-get-all.d.ts +72 -0
- package/esm/models/errors/products-get-all.d.ts.map +1 -0
- package/esm/models/errors/products-get-all.js +106 -0
- package/esm/models/errors/products-get-all.js.map +1 -0
- package/esm/models/errors/products-get-by-id.d.ts +95 -0
- package/esm/models/errors/products-get-by-id.d.ts.map +1 -0
- package/esm/models/errors/products-get-by-id.js +139 -0
- package/esm/models/errors/products-get-by-id.js.map +1 -0
- package/esm/models/errors/quickshops-default-error.d.ts +10 -0
- package/esm/models/errors/quickshops-default-error.d.ts.map +1 -0
- package/esm/models/errors/quickshops-default-error.js +30 -0
- package/esm/models/errors/quickshops-default-error.js.map +1 -0
- package/esm/models/errors/quickshops-error.d.ts +19 -0
- package/esm/models/errors/quickshops-error.d.ts.map +1 -0
- package/esm/models/errors/quickshops-error.js +26 -0
- package/esm/models/errors/quickshops-error.js.map +1 -0
- package/esm/models/errors/response-validation-error.d.ts +26 -0
- package/esm/models/errors/response-validation-error.d.ts.map +1 -0
- package/esm/models/errors/response-validation-error.js +37 -0
- package/esm/models/errors/response-validation-error.js.map +1 -0
- package/esm/models/errors/sdk-validation-error.d.ts +21 -0
- package/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
- package/esm/models/errors/sdk-validation-error.js +52 -0
- package/esm/models/errors/sdk-validation-error.js.map +1 -0
- package/esm/models/errors/store-get.d.ts +95 -0
- package/esm/models/errors/store-get.d.ts.map +1 -0
- package/esm/models/errors/store-get.js +139 -0
- package/esm/models/errors/store-get.js.map +1 -0
- package/esm/models/errors/subscription-create-portal-session.d.ts +118 -0
- package/esm/models/errors/subscription-create-portal-session.d.ts.map +1 -0
- package/esm/models/errors/subscription-create-portal-session.js +175 -0
- package/esm/models/errors/subscription-create-portal-session.js.map +1 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.d.ts.map +1 -0
- package/esm/models/index.js +5 -0
- package/esm/models/index.js.map +1 -0
- package/esm/models/operations/cart-add-line.d.ts +61 -0
- package/esm/models/operations/cart-add-line.d.ts.map +1 -0
- package/esm/models/operations/cart-add-line.js +57 -0
- package/esm/models/operations/cart-add-line.js.map +1 -0
- package/esm/models/operations/cart-clear.d.ts +47 -0
- package/esm/models/operations/cart-clear.d.ts.map +1 -0
- package/esm/models/operations/cart-clear.js +48 -0
- package/esm/models/operations/cart-clear.js.map +1 -0
- package/esm/models/operations/cart-create.d.ts +37 -0
- package/esm/models/operations/cart-create.d.ts.map +1 -0
- package/esm/models/operations/cart-create.js +41 -0
- package/esm/models/operations/cart-create.js.map +1 -0
- package/esm/models/operations/cart-get.d.ts +47 -0
- package/esm/models/operations/cart-get.d.ts.map +1 -0
- package/esm/models/operations/cart-get.js +50 -0
- package/esm/models/operations/cart-get.js.map +1 -0
- package/esm/models/operations/cart-remove-line.d.ts +49 -0
- package/esm/models/operations/cart-remove-line.d.ts.map +1 -0
- package/esm/models/operations/cart-remove-line.js +49 -0
- package/esm/models/operations/cart-remove-line.js.map +1 -0
- package/esm/models/operations/cart-update-line.d.ts +61 -0
- package/esm/models/operations/cart-update-line.d.ts.map +1 -0
- package/esm/models/operations/cart-update-line.js +57 -0
- package/esm/models/operations/cart-update-line.js.map +1 -0
- package/esm/models/operations/checkout-create-session.d.ts +29 -0
- package/esm/models/operations/checkout-create-session.d.ts.map +1 -0
- package/esm/models/operations/checkout-create-session.js +28 -0
- package/esm/models/operations/checkout-create-session.js.map +1 -0
- package/esm/models/operations/health-check.d.ts +13 -0
- package/esm/models/operations/health-check.d.ts.map +1 -0
- package/esm/models/operations/health-check.js +14 -0
- package/esm/models/operations/health-check.js.map +1 -0
- package/esm/models/operations/index.d.ts +13 -0
- package/esm/models/operations/index.d.ts.map +1 -0
- package/esm/models/operations/index.js +16 -0
- package/esm/models/operations/index.js.map +1 -0
- package/esm/models/operations/products-get-all.d.ts +45 -0
- package/esm/models/operations/products-get-all.d.ts.map +1 -0
- package/esm/models/operations/products-get-all.js +50 -0
- package/esm/models/operations/products-get-all.js.map +1 -0
- package/esm/models/operations/products-get-by-id.d.ts +55 -0
- package/esm/models/operations/products-get-by-id.d.ts.map +1 -0
- package/esm/models/operations/products-get-by-id.js +57 -0
- package/esm/models/operations/products-get-by-id.js.map +1 -0
- package/esm/models/operations/store-get.d.ts +31 -0
- package/esm/models/operations/store-get.d.ts.map +1 -0
- package/esm/models/operations/store-get.js +39 -0
- package/esm/models/operations/store-get.js.map +1 -0
- package/esm/models/operations/subscription-create-portal-session.d.ts +29 -0
- package/esm/models/operations/subscription-create-portal-session.d.ts.map +1 -0
- package/esm/models/operations/subscription-create-portal-session.js +28 -0
- package/esm/models/operations/subscription-create-portal-session.js.map +1 -0
- package/esm/models/security.d.ts +12 -0
- package/esm/models/security.d.ts.map +1 -0
- package/esm/models/security.js +17 -0
- package/esm/models/security.js.map +1 -0
- package/esm/sdk/cart.d.ts +29 -0
- package/esm/sdk/cart.d.ts.map +1 -0
- package/esm/sdk/cart.js +50 -0
- package/esm/sdk/cart.js.map +1 -0
- package/esm/sdk/checkout.d.ts +9 -0
- package/esm/sdk/checkout.d.ts.map +1 -0
- package/esm/sdk/checkout.js +15 -0
- package/esm/sdk/checkout.js.map +1 -0
- package/esm/sdk/health.d.ts +9 -0
- package/esm/sdk/health.d.ts.map +1 -0
- package/esm/sdk/health.js +15 -0
- package/esm/sdk/health.js.map +1 -0
- package/esm/sdk/index.d.ts +2 -0
- package/esm/sdk/index.d.ts.map +1 -0
- package/esm/sdk/index.js +5 -0
- package/esm/sdk/index.js.map +1 -0
- package/esm/sdk/products.d.ts +13 -0
- package/esm/sdk/products.d.ts.map +1 -0
- package/esm/sdk/products.js +22 -0
- package/esm/sdk/products.js.map +1 -0
- package/esm/sdk/sdk.d.ts +22 -0
- package/esm/sdk/sdk.d.ts.map +1 -0
- package/esm/sdk/sdk.js +37 -0
- package/esm/sdk/sdk.js.map +1 -0
- package/esm/sdk/store.d.ts +9 -0
- package/esm/sdk/store.d.ts.map +1 -0
- package/esm/sdk/store.js +15 -0
- package/esm/sdk/store.js.map +1 -0
- package/esm/sdk/subscription.d.ts +9 -0
- package/esm/sdk/subscription.d.ts.map +1 -0
- package/esm/sdk/subscription.js +15 -0
- package/esm/sdk/subscription.js.map +1 -0
- package/esm/types/async.d.ts +23 -0
- package/esm/types/async.d.ts.map +1 -0
- package/esm/types/async.js +28 -0
- package/esm/types/async.js.map +1 -0
- package/esm/types/blobs.d.ts +4 -0
- package/esm/types/blobs.d.ts.map +1 -0
- package/esm/types/blobs.js +25 -0
- package/esm/types/blobs.js.map +1 -0
- package/esm/types/const-date-time.d.ts +3 -0
- package/esm/types/const-date-time.d.ts.map +1 -0
- package/esm/types/const-date-time.js +10 -0
- package/esm/types/const-date-time.js.map +1 -0
- package/esm/types/default-to-zero-value.d.ts +12 -0
- package/esm/types/default-to-zero-value.d.ts.map +1 -0
- package/esm/types/default-to-zero-value.js +31 -0
- package/esm/types/default-to-zero-value.js.map +1 -0
- package/esm/types/enums.d.ts +9 -0
- package/esm/types/enums.d.ts.map +1 -0
- package/esm/types/enums.js +27 -0
- package/esm/types/enums.js.map +1 -0
- package/esm/types/fp.d.ts +31 -0
- package/esm/types/fp.d.ts.map +1 -0
- package/esm/types/fp.js +31 -0
- package/esm/types/fp.js.map +1 -0
- package/esm/types/index.d.ts +10 -0
- package/esm/types/index.d.ts.map +1 -0
- package/esm/types/index.js +10 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/operations.d.ts +27 -0
- package/esm/types/operations.d.ts.map +1 -0
- package/esm/types/operations.js +77 -0
- package/esm/types/operations.js.map +1 -0
- package/esm/types/primitives.d.ts +9 -0
- package/esm/types/primitives.d.ts.map +1 -0
- package/esm/types/primitives.js +109 -0
- package/esm/types/primitives.js.map +1 -0
- package/esm/types/rfcdate.d.ts +21 -0
- package/esm/types/rfcdate.d.ts.map +1 -0
- package/esm/types/rfcdate.js +43 -0
- package/esm/types/rfcdate.js.map +1 -0
- package/esm/types/smart-union.d.ts +7 -0
- package/esm/types/smart-union.d.ts.map +1 -0
- package/esm/types/smart-union.js +117 -0
- package/esm/types/smart-union.js.map +1 -0
- package/esm/types/streams.d.ts +2 -0
- package/esm/types/streams.d.ts.map +1 -0
- package/esm/types/streams.js +15 -0
- package/esm/types/streams.js.map +1 -0
- package/esm/types/unrecognized.d.ts +16 -0
- package/esm/types/unrecognized.d.ts.map +1 -0
- package/esm/types/unrecognized.js +31 -0
- package/esm/types/unrecognized.js.map +1 -0
- package/examples/healthHealthCheck.example.ts +27 -0
- package/examples/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/examples/node_modules/@types/node/assert.d.ts +1062 -0
- package/examples/node_modules/@types/node/async_hooks.d.ts +605 -0
- package/examples/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/examples/node_modules/@types/node/buffer.d.ts +1936 -0
- package/examples/node_modules/@types/node/child_process.d.ts +1475 -0
- package/examples/node_modules/@types/node/cluster.d.ts +577 -0
- package/examples/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/examples/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/examples/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/examples/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/examples/node_modules/@types/node/console.d.ts +452 -0
- package/examples/node_modules/@types/node/constants.d.ts +21 -0
- package/examples/node_modules/@types/node/crypto.d.ts +4590 -0
- package/examples/node_modules/@types/node/dgram.d.ts +597 -0
- package/examples/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/examples/node_modules/@types/node/dns/promises.d.ts +479 -0
- package/examples/node_modules/@types/node/dns.d.ts +871 -0
- package/examples/node_modules/@types/node/domain.d.ts +170 -0
- package/examples/node_modules/@types/node/events.d.ts +977 -0
- package/examples/node_modules/@types/node/fs/promises.d.ts +1270 -0
- package/examples/node_modules/@types/node/fs.d.ts +4375 -0
- package/examples/node_modules/@types/node/globals.d.ts +172 -0
- package/examples/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/examples/node_modules/@types/node/http.d.ts +2049 -0
- package/examples/node_modules/@types/node/http2.d.ts +2712 -0
- package/examples/node_modules/@types/node/https.d.ts +578 -0
- package/examples/node_modules/@types/node/index.d.ts +93 -0
- package/examples/node_modules/@types/node/inspector.generated.d.ts +3966 -0
- package/examples/node_modules/@types/node/module.d.ts +539 -0
- package/examples/node_modules/@types/node/net.d.ts +1031 -0
- package/examples/node_modules/@types/node/os.d.ts +506 -0
- package/examples/node_modules/@types/node/path.d.ts +200 -0
- package/examples/node_modules/@types/node/perf_hooks.d.ts +961 -0
- package/examples/node_modules/@types/node/process.d.ts +1961 -0
- package/examples/node_modules/@types/node/punycode.d.ts +117 -0
- package/examples/node_modules/@types/node/querystring.d.ts +152 -0
- package/examples/node_modules/@types/node/readline/promises.d.ts +162 -0
- package/examples/node_modules/@types/node/readline.d.ts +589 -0
- package/examples/node_modules/@types/node/repl.d.ts +430 -0
- package/examples/node_modules/@types/node/sea.d.ts +153 -0
- package/examples/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/examples/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/examples/node_modules/@types/node/stream/web.d.ts +533 -0
- package/examples/node_modules/@types/node/stream.d.ts +1698 -0
- package/examples/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/examples/node_modules/@types/node/test.d.ts +1787 -0
- package/examples/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/examples/node_modules/@types/node/timers.d.ts +286 -0
- package/examples/node_modules/@types/node/tls.d.ts +1259 -0
- package/examples/node_modules/@types/node/trace_events.d.ts +197 -0
- package/examples/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/examples/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/examples/node_modules/@types/node/ts5.6/index.d.ts +93 -0
- package/examples/node_modules/@types/node/tty.d.ts +208 -0
- package/examples/node_modules/@types/node/url.d.ts +964 -0
- package/examples/node_modules/@types/node/util.d.ts +2331 -0
- package/examples/node_modules/@types/node/v8.d.ts +809 -0
- package/examples/node_modules/@types/node/vm.d.ts +1001 -0
- package/examples/node_modules/@types/node/wasi.d.ts +181 -0
- package/examples/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/examples/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/examples/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/examples/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/examples/node_modules/@types/node/worker_threads.d.ts +715 -0
- package/examples/node_modules/@types/node/zlib.d.ts +598 -0
- package/examples/node_modules/dotenv/config.d.ts +1 -0
- package/examples/node_modules/dotenv/config.js +9 -0
- package/examples/node_modules/dotenv/lib/cli-options.js +17 -0
- package/examples/node_modules/dotenv/lib/env-options.js +28 -0
- package/examples/node_modules/dotenv/lib/main.d.ts +162 -0
- package/examples/node_modules/dotenv/lib/main.js +386 -0
- package/examples/node_modules/esbuild/install.js +300 -0
- package/examples/node_modules/esbuild/lib/main.d.ts +716 -0
- package/examples/node_modules/esbuild/lib/main.js +2532 -0
- package/examples/node_modules/fsevents/fsevents.d.ts +46 -0
- package/examples/node_modules/fsevents/fsevents.js +83 -0
- package/examples/node_modules/tsx/dist/cjs/api/index.mjs +1 -0
- package/examples/node_modules/tsx/dist/cjs/index.mjs +1 -0
- package/examples/node_modules/tsx/dist/cli.mjs +55 -0
- package/examples/node_modules/tsx/dist/client-D_mPDF5S.mjs +1 -0
- package/examples/node_modules/tsx/dist/esm/api/index.mjs +1 -0
- package/examples/node_modules/tsx/dist/esm/index.mjs +1 -0
- package/examples/node_modules/tsx/dist/get-pipe-path-_tAJyU_v.mjs +1 -0
- package/examples/node_modules/tsx/dist/index-XurvG3JN.mjs +14 -0
- package/examples/node_modules/tsx/dist/index-gbaejti9.mjs +1 -0
- package/examples/node_modules/tsx/dist/lexer-DQCqS3nf.mjs +3 -0
- package/examples/node_modules/tsx/dist/loader.mjs +1 -0
- package/examples/node_modules/tsx/dist/node-features-B9BBLzwu.mjs +1 -0
- package/examples/node_modules/tsx/dist/package-Bj47PlGH.mjs +1 -0
- package/examples/node_modules/tsx/dist/patch-repl.mjs +1 -0
- package/examples/node_modules/tsx/dist/preflight.mjs +1 -0
- package/examples/node_modules/tsx/dist/register-BnTWPeIB.mjs +10 -0
- package/examples/node_modules/tsx/dist/register-CqMfTiWi.mjs +2 -0
- package/examples/node_modules/tsx/dist/repl.mjs +3 -0
- package/examples/node_modules/tsx/dist/require-DzmC1hVr.mjs +1 -0
- package/examples/node_modules/tsx/dist/suppress-warnings.mjs +1 -0
- package/examples/node_modules/tsx/dist/temporary-directory-BDDVQOvU.mjs +1 -0
- package/examples/node_modules/tsx/dist/types-Cxp8y2TL.d.ts +5 -0
- package/examples/node_modules/undici-types/agent.d.ts +31 -0
- package/examples/node_modules/undici-types/api.d.ts +43 -0
- package/examples/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/examples/node_modules/undici-types/cache.d.ts +36 -0
- package/examples/node_modules/undici-types/client.d.ts +108 -0
- package/examples/node_modules/undici-types/connector.d.ts +34 -0
- package/examples/node_modules/undici-types/content-type.d.ts +21 -0
- package/examples/node_modules/undici-types/cookies.d.ts +28 -0
- package/examples/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/examples/node_modules/undici-types/dispatcher.d.ts +256 -0
- package/examples/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/examples/node_modules/undici-types/errors.d.ts +149 -0
- package/examples/node_modules/undici-types/eventsource.d.ts +61 -0
- package/examples/node_modules/undici-types/fetch.d.ts +209 -0
- package/examples/node_modules/undici-types/file.d.ts +39 -0
- package/examples/node_modules/undici-types/filereader.d.ts +54 -0
- package/examples/node_modules/undici-types/formdata.d.ts +108 -0
- package/examples/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/examples/node_modules/undici-types/global-origin.d.ts +7 -0
- package/examples/node_modules/undici-types/handlers.d.ts +15 -0
- package/examples/node_modules/undici-types/header.d.ts +4 -0
- package/examples/node_modules/undici-types/index.d.ts +71 -0
- package/examples/node_modules/undici-types/interceptors.d.ts +17 -0
- package/examples/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/examples/node_modules/undici-types/mock-client.d.ts +25 -0
- package/examples/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/examples/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/examples/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/examples/node_modules/undici-types/patch.d.ts +33 -0
- package/examples/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/examples/node_modules/undici-types/pool.d.ts +39 -0
- package/examples/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/examples/node_modules/undici-types/readable.d.ts +65 -0
- package/examples/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/examples/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/examples/node_modules/undici-types/util.d.ts +18 -0
- package/examples/node_modules/undici-types/webidl.d.ts +228 -0
- package/examples/node_modules/undici-types/websocket.d.ts +150 -0
- package/jsr.json +27 -0
- package/package.json +63 -0
- package/src/core.ts +13 -0
- package/src/funcs/cart-cart-add-line.ts +195 -0
- package/src/funcs/cart-cart-clear.ts +190 -0
- package/src/funcs/cart-cart-create.ts +166 -0
- package/src/funcs/cart-cart-get.ts +186 -0
- package/src/funcs/cart-cart-remove-line.ts +198 -0
- package/src/funcs/cart-cart-update-line.ts +199 -0
- package/src/funcs/checkout-checkout-create-session.ts +189 -0
- package/src/funcs/health-health-check.ts +158 -0
- package/src/funcs/products-products-get-all.ts +158 -0
- package/src/funcs/products-products-get-by-id.ts +186 -0
- package/src/funcs/store-store-get.ts +162 -0
- package/src/funcs/subscription-subscription-create-portal-session.ts +207 -0
- package/src/hooks/hooks.ts +129 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/types.ts +108 -0
- package/src/index.ts +9 -0
- package/src/lib/base64.ts +39 -0
- package/src/lib/config.ts +49 -0
- package/src/lib/encodings.ts +529 -0
- package/src/lib/env.ts +61 -0
- package/src/lib/files.ts +104 -0
- package/src/lib/http.ts +323 -0
- package/src/lib/logger.ts +9 -0
- package/src/lib/matchers.ts +353 -0
- package/src/lib/primitives.ts +166 -0
- package/src/lib/retries.ts +218 -0
- package/src/lib/schemas.ts +94 -0
- package/src/lib/sdks.ts +442 -0
- package/src/lib/security.ts +275 -0
- package/src/lib/url.ts +35 -0
- package/src/models/errors/cart-add-line.ts +337 -0
- package/src/models/errors/cart-clear.ts +282 -0
- package/src/models/errors/cart-create.ts +282 -0
- package/src/models/errors/cart-get.ts +227 -0
- package/src/models/errors/cart-remove-line.ts +337 -0
- package/src/models/errors/cart-update-line.ts +337 -0
- package/src/models/errors/checkout-create-session.ts +278 -0
- package/src/models/errors/health-check.ts +172 -0
- package/src/models/errors/http-client-errors.ts +62 -0
- package/src/models/errors/index.ts +21 -0
- package/src/models/errors/products-get-all.ts +172 -0
- package/src/models/errors/products-get-by-id.ts +227 -0
- package/src/models/errors/quickshops-default-error.ts +40 -0
- package/src/models/errors/quickshops-error.ts +35 -0
- package/src/models/errors/response-validation-error.ts +50 -0
- package/src/models/errors/sdk-validation-error.ts +54 -0
- package/src/models/errors/store-get.ts +227 -0
- package/src/models/errors/subscription-create-portal-session.ts +286 -0
- package/src/models/index.ts +5 -0
- package/src/models/operations/cart-add-line.ts +168 -0
- package/src/models/operations/cart-clear.ts +137 -0
- package/src/models/operations/cart-create.ts +112 -0
- package/src/models/operations/cart-get.ts +129 -0
- package/src/models/operations/cart-remove-line.ts +140 -0
- package/src/models/operations/cart-update-line.ts +168 -0
- package/src/models/operations/checkout-create-session.ts +83 -0
- package/src/models/operations/health-check.ts +34 -0
- package/src/models/operations/index.ts +16 -0
- package/src/models/operations/products-get-all.ts +116 -0
- package/src/models/operations/products-get-by-id.ts +141 -0
- package/src/models/operations/store-get.ts +96 -0
- package/src/models/operations/subscription-create-portal-session.ts +90 -0
- package/src/models/security.ts +34 -0
- package/src/sdk/cart.ts +97 -0
- package/src/sdk/checkout.ts +24 -0
- package/src/sdk/health.ts +22 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/products.ts +37 -0
- package/src/sdk/sdk.ts +43 -0
- package/src/sdk/store.ts +22 -0
- package/src/sdk/subscription.ts +24 -0
- package/src/types/async.ts +69 -0
- package/src/types/blobs.ts +33 -0
- package/src/types/const-date-time.ts +15 -0
- package/src/types/default-to-zero-value.ts +33 -0
- package/src/types/enums.ts +45 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +13 -0
- package/src/types/operations.ts +105 -0
- package/src/types/primitives.ts +140 -0
- package/src/types/rfcdate.ts +54 -0
- package/src/types/smart-union.ts +153 -0
- package/src/types/streams.ts +21 -0
- package/src/types/unrecognized.ts +35 -0
package/FUNCTIONS.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Standalone Functions
|
|
2
|
+
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This section is useful if you are using a bundler and targeting browsers and
|
|
5
|
+
> runtimes where the size of an application affects performance and load times.
|
|
6
|
+
|
|
7
|
+
Every method in this SDK is also available as a standalone function. This
|
|
8
|
+
alternative API is suitable when targeting the browser or serverless runtimes
|
|
9
|
+
and using a bundler to build your application since all unused functionality
|
|
10
|
+
will be tree-shaken away. This includes code for unused methods, Zod schemas,
|
|
11
|
+
encoding helpers and response handlers. The result is dramatically smaller
|
|
12
|
+
impact on the application's final bundle size which grows very slowly as you use
|
|
13
|
+
more and more functionality from this SDK.
|
|
14
|
+
|
|
15
|
+
Calling methods through the main SDK class remains a valid and generally more
|
|
16
|
+
more ergonomic option. Standalone functions represent an optimisation for a
|
|
17
|
+
specific category of applications.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { QuickshopsCore } from "@quickshops/sdk/core.js";
|
|
23
|
+
import { healthHealthCheck } from "@quickshops/sdk/funcs/health-health-check.js";
|
|
24
|
+
|
|
25
|
+
// Use `QuickshopsCore` for best tree-shaking performance.
|
|
26
|
+
// You can create one instance of it to use across an application.
|
|
27
|
+
const quickshops = new QuickshopsCore({
|
|
28
|
+
serverURL: "https://api.example.com",
|
|
29
|
+
bearerAuth: process.env["QUICKSHOPS_BEARER_AUTH"] ?? "",
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
async function run() {
|
|
33
|
+
const res = await healthHealthCheck(quickshops);
|
|
34
|
+
if (res.ok) {
|
|
35
|
+
const { value: result } = res;
|
|
36
|
+
console.log(result);
|
|
37
|
+
} else {
|
|
38
|
+
console.log("healthHealthCheck failed:", res.error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
run();
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Result types
|
|
46
|
+
|
|
47
|
+
Standalone functions differ from SDK methods in that they return a
|
|
48
|
+
`Result<Value, Error>` type to capture _known errors_ and document them using
|
|
49
|
+
the type system. By avoiding throwing errors, application code maintains clear
|
|
50
|
+
control flow and error-handling become part of the regular flow of application
|
|
51
|
+
code.
|
|
52
|
+
|
|
53
|
+
> We use the term "known errors" because standalone functions, and JavaScript
|
|
54
|
+
> code in general, can still throw unexpected errors such as `TypeError`s,
|
|
55
|
+
> `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
|
|
56
|
+
> something this SDK addresses in the future. Nevertheless, there is still a lot
|
|
57
|
+
> of benefit from capturing most errors and turning them into values.
|
|
58
|
+
|
|
59
|
+
The second reason for this style of programming is because these functions will
|
|
60
|
+
typically be used in front-end applications where exception throwing is
|
|
61
|
+
sometimes discouraged or considered unidiomatic. React and similar ecosystems
|
|
62
|
+
and libraries tend to promote this style of programming so that components
|
|
63
|
+
render useful content under all states (loading, success, error and so on).
|
|
64
|
+
|
|
65
|
+
The general pattern when calling standalone functions looks like this:
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { Core } from "<sdk-package-name>";
|
|
69
|
+
import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
|
|
70
|
+
|
|
71
|
+
const client = new Core();
|
|
72
|
+
|
|
73
|
+
async function run() {
|
|
74
|
+
const result = await fetchSomething(client, { id: "123" });
|
|
75
|
+
if (!result.ok) {
|
|
76
|
+
// You can throw the error or handle it. It's your choice now.
|
|
77
|
+
throw result.error;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
console.log(result.value);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
run();
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Notably, `result.error` above will have an explicit type compared to a try-catch
|
|
87
|
+
variation where the error in the catch block can only be of type `unknown` (or
|
|
88
|
+
`any` depending on your TypeScript settings).
|
package/README.md
ADDED
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
# quickshops
|
|
2
|
+
|
|
3
|
+
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *quickshops* API.
|
|
4
|
+
|
|
5
|
+
[](https://www.speakeasy.com/?utm_source=quickshops&utm_campaign=typescript)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<br /><br />
|
|
10
|
+
> [!IMPORTANT]
|
|
11
|
+
> This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/quickshops-hv1/quickshops-sdk). Delete this section before > publishing to a package manager.
|
|
12
|
+
|
|
13
|
+
<!-- Start Summary [summary] -->
|
|
14
|
+
## Summary
|
|
15
|
+
|
|
16
|
+
Quickshops Headless API: Headless commerce API for Quickshops starter templates and external storefronts.
|
|
17
|
+
<!-- End Summary [summary] -->
|
|
18
|
+
|
|
19
|
+
<!-- Start Table of Contents [toc] -->
|
|
20
|
+
## Table of Contents
|
|
21
|
+
<!-- $toc-max-depth=2 -->
|
|
22
|
+
* [quickshops](#quickshops)
|
|
23
|
+
* [SDK Installation](#sdk-installation)
|
|
24
|
+
* [Requirements](#requirements)
|
|
25
|
+
* [SDK Example Usage](#sdk-example-usage)
|
|
26
|
+
* [Authentication](#authentication)
|
|
27
|
+
* [Available Resources and Operations](#available-resources-and-operations)
|
|
28
|
+
* [Standalone functions](#standalone-functions)
|
|
29
|
+
* [Retries](#retries)
|
|
30
|
+
* [Error Handling](#error-handling)
|
|
31
|
+
* [Custom HTTP Client](#custom-http-client)
|
|
32
|
+
* [Debugging](#debugging)
|
|
33
|
+
* [Development](#development)
|
|
34
|
+
* [Maturity](#maturity)
|
|
35
|
+
* [Contributions](#contributions)
|
|
36
|
+
|
|
37
|
+
<!-- End Table of Contents [toc] -->
|
|
38
|
+
|
|
39
|
+
<!-- Start SDK Installation [installation] -->
|
|
40
|
+
## SDK Installation
|
|
41
|
+
|
|
42
|
+
The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
|
|
43
|
+
|
|
44
|
+
### NPM
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm add @quickshops/sdk
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### PNPM
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm add @quickshops/sdk
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Bun
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
bun add @quickshops/sdk
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Yarn
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
yarn add @quickshops/sdk
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
> [!NOTE]
|
|
69
|
+
> This package is published as an ES Module (ESM) only. For applications using
|
|
70
|
+
> CommonJS, use `await import("@quickshops/sdk")` to import and use this package.
|
|
71
|
+
<!-- End SDK Installation [installation] -->
|
|
72
|
+
|
|
73
|
+
<!-- Start Requirements [requirements] -->
|
|
74
|
+
## Requirements
|
|
75
|
+
|
|
76
|
+
For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
|
|
77
|
+
<!-- End Requirements [requirements] -->
|
|
78
|
+
|
|
79
|
+
<!-- Start SDK Example Usage [usage] -->
|
|
80
|
+
## SDK Example Usage
|
|
81
|
+
|
|
82
|
+
### Example
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { Quickshops } from "@quickshops/sdk";
|
|
86
|
+
|
|
87
|
+
const quickshops = new Quickshops({
|
|
88
|
+
serverURL: "https://api.example.com",
|
|
89
|
+
bearerAuth: process.env["QUICKSHOPS_BEARER_AUTH"] ?? "",
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
async function run() {
|
|
93
|
+
const result = await quickshops.health.healthCheck();
|
|
94
|
+
|
|
95
|
+
console.log(result);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
run();
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
<!-- End SDK Example Usage [usage] -->
|
|
102
|
+
|
|
103
|
+
<!-- Start Authentication [security] -->
|
|
104
|
+
## Authentication
|
|
105
|
+
|
|
106
|
+
### Per-Client Security Schemes
|
|
107
|
+
|
|
108
|
+
This SDK supports the following security scheme globally:
|
|
109
|
+
|
|
110
|
+
| Name | Type | Scheme | Environment Variable |
|
|
111
|
+
| ------------ | ---- | ----------- | ------------------------ |
|
|
112
|
+
| `bearerAuth` | http | HTTP Bearer | `QUICKSHOPS_BEARER_AUTH` |
|
|
113
|
+
|
|
114
|
+
To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example:
|
|
115
|
+
```typescript
|
|
116
|
+
import { Quickshops } from "@quickshops/sdk";
|
|
117
|
+
|
|
118
|
+
const quickshops = new Quickshops({
|
|
119
|
+
serverURL: "https://api.example.com",
|
|
120
|
+
bearerAuth: process.env["QUICKSHOPS_BEARER_AUTH"] ?? "",
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
async function run() {
|
|
124
|
+
const result = await quickshops.health.healthCheck();
|
|
125
|
+
|
|
126
|
+
console.log(result);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
run();
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
<!-- End Authentication [security] -->
|
|
133
|
+
|
|
134
|
+
<!-- Start Available Resources and Operations [operations] -->
|
|
135
|
+
## Available Resources and Operations
|
|
136
|
+
|
|
137
|
+
<details open>
|
|
138
|
+
<summary>Available methods</summary>
|
|
139
|
+
|
|
140
|
+
### [Cart](docs/sdks/cart/README.md)
|
|
141
|
+
|
|
142
|
+
* [cartGet](docs/sdks/cart/README.md#cartget) - Get cart
|
|
143
|
+
* [cartClear](docs/sdks/cart/README.md#cartclear) - Clear cart
|
|
144
|
+
* [cartCreate](docs/sdks/cart/README.md#cartcreate) - Create cart
|
|
145
|
+
* [cartUpdateLine](docs/sdks/cart/README.md#cartupdateline) - Update cart line quantity
|
|
146
|
+
* [cartRemoveLine](docs/sdks/cart/README.md#cartremoveline) - Remove cart line
|
|
147
|
+
* [cartAddLine](docs/sdks/cart/README.md#cartaddline) - Add cart line
|
|
148
|
+
|
|
149
|
+
### [Checkout](docs/sdks/checkout/README.md)
|
|
150
|
+
|
|
151
|
+
* [checkoutCreateSession](docs/sdks/checkout/README.md#checkoutcreatesession) - Create checkout session
|
|
152
|
+
|
|
153
|
+
### [Health](docs/sdks/health/README.md)
|
|
154
|
+
|
|
155
|
+
* [healthCheck](docs/sdks/health/README.md#healthcheck) - Health check
|
|
156
|
+
|
|
157
|
+
### [Products](docs/sdks/products/README.md)
|
|
158
|
+
|
|
159
|
+
* [productsGetAll](docs/sdks/products/README.md#productsgetall) - List products
|
|
160
|
+
* [productsGetById](docs/sdks/products/README.md#productsgetbyid) - Get product
|
|
161
|
+
|
|
162
|
+
### [Store](docs/sdks/store/README.md)
|
|
163
|
+
|
|
164
|
+
* [storeGet](docs/sdks/store/README.md#storeget) - Get store for API key
|
|
165
|
+
|
|
166
|
+
### [Subscription](docs/sdks/subscription/README.md)
|
|
167
|
+
|
|
168
|
+
* [subscriptionCreatePortalSession](docs/sdks/subscription/README.md#subscriptioncreateportalsession) - Create subscription portal session
|
|
169
|
+
|
|
170
|
+
</details>
|
|
171
|
+
<!-- End Available Resources and Operations [operations] -->
|
|
172
|
+
|
|
173
|
+
<!-- Start Standalone functions [standalone-funcs] -->
|
|
174
|
+
## Standalone functions
|
|
175
|
+
|
|
176
|
+
All the methods listed above are available as standalone functions. These
|
|
177
|
+
functions are ideal for use in applications running in the browser, serverless
|
|
178
|
+
runtimes or other environments where application bundle size is a primary
|
|
179
|
+
concern. When using a bundler to build your application, all unused
|
|
180
|
+
functionality will be either excluded from the final bundle or tree-shaken away.
|
|
181
|
+
|
|
182
|
+
To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
183
|
+
|
|
184
|
+
<details>
|
|
185
|
+
|
|
186
|
+
<summary>Available standalone functions</summary>
|
|
187
|
+
|
|
188
|
+
- [`cartCartAddLine`](docs/sdks/cart/README.md#cartaddline) - Add cart line
|
|
189
|
+
- [`cartCartClear`](docs/sdks/cart/README.md#cartclear) - Clear cart
|
|
190
|
+
- [`cartCartCreate`](docs/sdks/cart/README.md#cartcreate) - Create cart
|
|
191
|
+
- [`cartCartGet`](docs/sdks/cart/README.md#cartget) - Get cart
|
|
192
|
+
- [`cartCartRemoveLine`](docs/sdks/cart/README.md#cartremoveline) - Remove cart line
|
|
193
|
+
- [`cartCartUpdateLine`](docs/sdks/cart/README.md#cartupdateline) - Update cart line quantity
|
|
194
|
+
- [`checkoutCheckoutCreateSession`](docs/sdks/checkout/README.md#checkoutcreatesession) - Create checkout session
|
|
195
|
+
- [`healthHealthCheck`](docs/sdks/health/README.md#healthcheck) - Health check
|
|
196
|
+
- [`productsProductsGetAll`](docs/sdks/products/README.md#productsgetall) - List products
|
|
197
|
+
- [`productsProductsGetById`](docs/sdks/products/README.md#productsgetbyid) - Get product
|
|
198
|
+
- [`storeStoreGet`](docs/sdks/store/README.md#storeget) - Get store for API key
|
|
199
|
+
- [`subscriptionSubscriptionCreatePortalSession`](docs/sdks/subscription/README.md#subscriptioncreateportalsession) - Create subscription portal session
|
|
200
|
+
|
|
201
|
+
</details>
|
|
202
|
+
<!-- End Standalone functions [standalone-funcs] -->
|
|
203
|
+
|
|
204
|
+
<!-- Start Retries [retries] -->
|
|
205
|
+
## Retries
|
|
206
|
+
|
|
207
|
+
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
|
|
208
|
+
|
|
209
|
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
|
|
210
|
+
```typescript
|
|
211
|
+
import { Quickshops } from "@quickshops/sdk";
|
|
212
|
+
|
|
213
|
+
const quickshops = new Quickshops({
|
|
214
|
+
serverURL: "https://api.example.com",
|
|
215
|
+
bearerAuth: process.env["QUICKSHOPS_BEARER_AUTH"] ?? "",
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
async function run() {
|
|
219
|
+
const result = await quickshops.health.healthCheck({
|
|
220
|
+
retries: {
|
|
221
|
+
strategy: "backoff",
|
|
222
|
+
backoff: {
|
|
223
|
+
initialInterval: 1,
|
|
224
|
+
maxInterval: 50,
|
|
225
|
+
exponent: 1.1,
|
|
226
|
+
maxElapsedTime: 100,
|
|
227
|
+
},
|
|
228
|
+
retryConnectionErrors: false,
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
console.log(result);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
run();
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
|
|
240
|
+
```typescript
|
|
241
|
+
import { Quickshops } from "@quickshops/sdk";
|
|
242
|
+
|
|
243
|
+
const quickshops = new Quickshops({
|
|
244
|
+
serverURL: "https://api.example.com",
|
|
245
|
+
retryConfig: {
|
|
246
|
+
strategy: "backoff",
|
|
247
|
+
backoff: {
|
|
248
|
+
initialInterval: 1,
|
|
249
|
+
maxInterval: 50,
|
|
250
|
+
exponent: 1.1,
|
|
251
|
+
maxElapsedTime: 100,
|
|
252
|
+
},
|
|
253
|
+
retryConnectionErrors: false,
|
|
254
|
+
},
|
|
255
|
+
bearerAuth: process.env["QUICKSHOPS_BEARER_AUTH"] ?? "",
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
async function run() {
|
|
259
|
+
const result = await quickshops.health.healthCheck();
|
|
260
|
+
|
|
261
|
+
console.log(result);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
run();
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
<!-- End Retries [retries] -->
|
|
268
|
+
|
|
269
|
+
<!-- Start Error Handling [errors] -->
|
|
270
|
+
## Error Handling
|
|
271
|
+
|
|
272
|
+
[`QuickshopsError`](./src/models/errors/quickshops-error.ts) is the base class for all HTTP error responses. It has the following properties:
|
|
273
|
+
|
|
274
|
+
| Property | Type | Description |
|
|
275
|
+
| ------------------- | ---------- | --------------------------------------------------------------------------------------- |
|
|
276
|
+
| `error.message` | `string` | Error message |
|
|
277
|
+
| `error.statusCode` | `number` | HTTP response status code eg `404` |
|
|
278
|
+
| `error.headers` | `Headers` | HTTP response headers |
|
|
279
|
+
| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
|
|
280
|
+
| `error.rawResponse` | `Response` | Raw HTTP response |
|
|
281
|
+
| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
|
|
282
|
+
|
|
283
|
+
### Example
|
|
284
|
+
```typescript
|
|
285
|
+
import { Quickshops } from "@quickshops/sdk";
|
|
286
|
+
import * as errors from "@quickshops/sdk/models/errors";
|
|
287
|
+
|
|
288
|
+
const quickshops = new Quickshops({
|
|
289
|
+
serverURL: "https://api.example.com",
|
|
290
|
+
bearerAuth: process.env["QUICKSHOPS_BEARER_AUTH"] ?? "",
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
async function run() {
|
|
294
|
+
try {
|
|
295
|
+
const result = await quickshops.health.healthCheck();
|
|
296
|
+
|
|
297
|
+
console.log(result);
|
|
298
|
+
} catch (error) {
|
|
299
|
+
// The base class for HTTP error responses
|
|
300
|
+
if (error instanceof errors.QuickshopsError) {
|
|
301
|
+
console.log(error.message);
|
|
302
|
+
console.log(error.statusCode);
|
|
303
|
+
console.log(error.body);
|
|
304
|
+
console.log(error.headers);
|
|
305
|
+
|
|
306
|
+
// Depending on the method different errors may be thrown
|
|
307
|
+
if (error instanceof errors.HealthCheckUnauthorizedError) {
|
|
308
|
+
console.log(error.data$.error); // string
|
|
309
|
+
console.log(error.data$.code); // string
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
run();
|
|
316
|
+
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Error Classes
|
|
320
|
+
**Primary error:**
|
|
321
|
+
* [`QuickshopsError`](./src/models/errors/quickshops-error.ts): The base class for HTTP error responses.
|
|
322
|
+
|
|
323
|
+
<details><summary>Less common errors (62)</summary>
|
|
324
|
+
|
|
325
|
+
<br />
|
|
326
|
+
|
|
327
|
+
**Network errors:**
|
|
328
|
+
* [`ConnectionError`](./src/models/errors/http-client-errors.ts): HTTP client was unable to make a request to a server.
|
|
329
|
+
* [`RequestTimeoutError`](./src/models/errors/http-client-errors.ts): HTTP request timed out due to an AbortSignal signal.
|
|
330
|
+
* [`RequestAbortedError`](./src/models/errors/http-client-errors.ts): HTTP request was aborted by the client.
|
|
331
|
+
* [`InvalidRequestError`](./src/models/errors/http-client-errors.ts): Any input used to create a request is invalid.
|
|
332
|
+
* [`UnexpectedClientError`](./src/models/errors/http-client-errors.ts): Unrecognised or unexpected error.
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
**Inherit from [`QuickshopsError`](./src/models/errors/quickshops-error.ts)**:
|
|
336
|
+
* [`CartClearBadRequestError`](./src/models/errors/cart-clear-bad-request-error.ts): Response for status 400. Status code `400`. Applicable to 1 of 12 methods.*
|
|
337
|
+
* [`CartCreateBadRequestError`](./src/models/errors/cart-create-bad-request-error.ts): Response for status 400. Status code `400`. Applicable to 1 of 12 methods.*
|
|
338
|
+
* [`CartUpdateLineBadRequestError`](./src/models/errors/cart-update-line-bad-request-error.ts): Response for status 400. Status code `400`. Applicable to 1 of 12 methods.*
|
|
339
|
+
* [`CartRemoveLineBadRequestError`](./src/models/errors/cart-remove-line-bad-request-error.ts): Response for status 400. Status code `400`. Applicable to 1 of 12 methods.*
|
|
340
|
+
* [`CartAddLineBadRequestError`](./src/models/errors/cart-add-line-bad-request-error.ts): Response for status 400. Status code `400`. Applicable to 1 of 12 methods.*
|
|
341
|
+
* [`CheckoutCreateSessionBadRequestError`](./src/models/errors/checkout-create-session-bad-request-error.ts): Response for status 400. Status code `400`. Applicable to 1 of 12 methods.*
|
|
342
|
+
* [`SubscriptionCreatePortalSessionBadRequestError`](./src/models/errors/subscription-create-portal-session-bad-request-error.ts): Response for status 400. Status code `400`. Applicable to 1 of 12 methods.*
|
|
343
|
+
* [`HealthCheckUnauthorizedError`](./src/models/errors/health-check-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
344
|
+
* [`StoreGetUnauthorizedError`](./src/models/errors/store-get-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
345
|
+
* [`ProductsGetAllUnauthorizedError`](./src/models/errors/products-get-all-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
346
|
+
* [`ProductsGetByIdUnauthorizedError`](./src/models/errors/products-get-by-id-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
347
|
+
* [`CartGetUnauthorizedError`](./src/models/errors/cart-get-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
348
|
+
* [`CartClearUnauthorizedError`](./src/models/errors/cart-clear-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
349
|
+
* [`CartCreateUnauthorizedError`](./src/models/errors/cart-create-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
350
|
+
* [`CartUpdateLineUnauthorizedError`](./src/models/errors/cart-update-line-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
351
|
+
* [`CartRemoveLineUnauthorizedError`](./src/models/errors/cart-remove-line-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
352
|
+
* [`CartAddLineUnauthorizedError`](./src/models/errors/cart-add-line-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
353
|
+
* [`CheckoutCreateSessionUnauthorizedError`](./src/models/errors/checkout-create-session-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
354
|
+
* [`SubscriptionCreatePortalSessionUnauthorizedError`](./src/models/errors/subscription-create-portal-session-unauthorized-error.ts): Response for status 401. Status code `401`. Applicable to 1 of 12 methods.*
|
|
355
|
+
* [`HealthCheckForbiddenError`](./src/models/errors/health-check-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
356
|
+
* [`StoreGetForbiddenError`](./src/models/errors/store-get-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
357
|
+
* [`ProductsGetAllForbiddenError`](./src/models/errors/products-get-all-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
358
|
+
* [`ProductsGetByIdForbiddenError`](./src/models/errors/products-get-by-id-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
359
|
+
* [`CartGetForbiddenError`](./src/models/errors/cart-get-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
360
|
+
* [`CartClearForbiddenError`](./src/models/errors/cart-clear-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
361
|
+
* [`CartCreateForbiddenError`](./src/models/errors/cart-create-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
362
|
+
* [`CartUpdateLineForbiddenError`](./src/models/errors/cart-update-line-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
363
|
+
* [`CartRemoveLineForbiddenError`](./src/models/errors/cart-remove-line-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
364
|
+
* [`CartAddLineForbiddenError`](./src/models/errors/cart-add-line-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
365
|
+
* [`CheckoutCreateSessionForbiddenError`](./src/models/errors/checkout-create-session-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
366
|
+
* [`SubscriptionCreatePortalSessionForbiddenError`](./src/models/errors/subscription-create-portal-session-forbidden-error.ts): Response for status 403. Status code `403`. Applicable to 1 of 12 methods.*
|
|
367
|
+
* [`StoreGetNotFoundError`](./src/models/errors/store-get-not-found-error.ts): Response for status 404. Status code `404`. Applicable to 1 of 12 methods.*
|
|
368
|
+
* [`ProductsGetByIdNotFoundError`](./src/models/errors/products-get-by-id-not-found-error.ts): Response for status 404. Status code `404`. Applicable to 1 of 12 methods.*
|
|
369
|
+
* [`CartGetNotFoundError`](./src/models/errors/cart-get-not-found-error.ts): Response for status 404. Status code `404`. Applicable to 1 of 12 methods.*
|
|
370
|
+
* [`CartUpdateLineNotFoundError`](./src/models/errors/cart-update-line-not-found-error.ts): Response for status 404. Status code `404`. Applicable to 1 of 12 methods.*
|
|
371
|
+
* [`CartRemoveLineNotFoundError`](./src/models/errors/cart-remove-line-not-found-error.ts): Response for status 404. Status code `404`. Applicable to 1 of 12 methods.*
|
|
372
|
+
* [`CartAddLineNotFoundError`](./src/models/errors/cart-add-line-not-found-error.ts): Response for status 404. Status code `404`. Applicable to 1 of 12 methods.*
|
|
373
|
+
* [`CartClearConflictError`](./src/models/errors/cart-clear-conflict-error.ts): Response for status 409. Status code `409`. Applicable to 1 of 12 methods.*
|
|
374
|
+
* [`CartCreateConflictError`](./src/models/errors/cart-create-conflict-error.ts): Response for status 409. Status code `409`. Applicable to 1 of 12 methods.*
|
|
375
|
+
* [`CartUpdateLineConflictError`](./src/models/errors/cart-update-line-conflict-error.ts): Response for status 409. Status code `409`. Applicable to 1 of 12 methods.*
|
|
376
|
+
* [`CartRemoveLineConflictError`](./src/models/errors/cart-remove-line-conflict-error.ts): Response for status 409. Status code `409`. Applicable to 1 of 12 methods.*
|
|
377
|
+
* [`CartAddLineConflictError`](./src/models/errors/cart-add-line-conflict-error.ts): Response for status 409. Status code `409`. Applicable to 1 of 12 methods.*
|
|
378
|
+
* [`CheckoutCreateSessionConflictError`](./src/models/errors/checkout-create-session-conflict-error.ts): Response for status 409. Status code `409`. Applicable to 1 of 12 methods.*
|
|
379
|
+
* [`SubscriptionCreatePortalSessionConflictError`](./src/models/errors/subscription-create-portal-session-conflict-error.ts): Response for status 409. Status code `409`. Applicable to 1 of 12 methods.*
|
|
380
|
+
* [`HealthCheckTooManyRequestsError`](./src/models/errors/health-check-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
381
|
+
* [`StoreGetTooManyRequestsError`](./src/models/errors/store-get-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
382
|
+
* [`ProductsGetAllTooManyRequestsError`](./src/models/errors/products-get-all-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
383
|
+
* [`ProductsGetByIdTooManyRequestsError`](./src/models/errors/products-get-by-id-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
384
|
+
* [`CartGetTooManyRequestsError`](./src/models/errors/cart-get-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
385
|
+
* [`CartClearTooManyRequestsError`](./src/models/errors/cart-clear-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
386
|
+
* [`CartCreateTooManyRequestsError`](./src/models/errors/cart-create-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
387
|
+
* [`CartUpdateLineTooManyRequestsError`](./src/models/errors/cart-update-line-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
388
|
+
* [`CartRemoveLineTooManyRequestsError`](./src/models/errors/cart-remove-line-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
389
|
+
* [`CartAddLineTooManyRequestsError`](./src/models/errors/cart-add-line-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
390
|
+
* [`CheckoutCreateSessionTooManyRequestsError`](./src/models/errors/checkout-create-session-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
391
|
+
* [`SubscriptionCreatePortalSessionTooManyRequestsError`](./src/models/errors/subscription-create-portal-session-too-many-requests-error.ts): Response for status 429. Status code `429`. Applicable to 1 of 12 methods.*
|
|
392
|
+
* [`ResponseValidationError`](./src/models/errors/response-validation-error.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
|
|
393
|
+
|
|
394
|
+
</details>
|
|
395
|
+
|
|
396
|
+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
|
|
397
|
+
<!-- End Error Handling [errors] -->
|
|
398
|
+
|
|
399
|
+
<!-- Start Custom HTTP Client [http-client] -->
|
|
400
|
+
## Custom HTTP Client
|
|
401
|
+
|
|
402
|
+
The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
|
|
403
|
+
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
|
|
404
|
+
client is a thin wrapper around `fetch` and provides the ability to attach hooks
|
|
405
|
+
around the request lifecycle that can be used to modify the request or handle
|
|
406
|
+
errors and response.
|
|
407
|
+
|
|
408
|
+
The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
409
|
+
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
410
|
+
the HTTP client and feed in fixtures.
|
|
411
|
+
|
|
412
|
+
The following example shows how to:
|
|
413
|
+
- route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
|
|
414
|
+
- use the `"beforeRequest"` hook to add a custom header and a timeout to requests
|
|
415
|
+
- use the `"requestError"` hook to log errors
|
|
416
|
+
|
|
417
|
+
```typescript
|
|
418
|
+
import { Quickshops } from "@quickshops/sdk";
|
|
419
|
+
import { ProxyAgent } from "undici";
|
|
420
|
+
import { HTTPClient } from "@quickshops/sdk/lib/http";
|
|
421
|
+
|
|
422
|
+
const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
|
|
423
|
+
|
|
424
|
+
const httpClient = new HTTPClient({
|
|
425
|
+
// 'fetcher' takes a function that has the same signature as native 'fetch'.
|
|
426
|
+
fetcher: (input, init) =>
|
|
427
|
+
// 'dispatcher' is specific to undici and not part of the standard Fetch API.
|
|
428
|
+
fetch(input, { ...init, dispatcher } as RequestInit),
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
httpClient.addHook("beforeRequest", (request) => {
|
|
432
|
+
const nextRequest = new Request(request, {
|
|
433
|
+
signal: request.signal || AbortSignal.timeout(5000)
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
nextRequest.headers.set("x-custom-header", "custom value");
|
|
437
|
+
|
|
438
|
+
return nextRequest;
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
httpClient.addHook("requestError", (error, request) => {
|
|
442
|
+
console.group("Request Error");
|
|
443
|
+
console.log("Reason:", `${error}`);
|
|
444
|
+
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
445
|
+
console.groupEnd();
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
const sdk = new Quickshops({ httpClient: httpClient });
|
|
449
|
+
```
|
|
450
|
+
<!-- End Custom HTTP Client [http-client] -->
|
|
451
|
+
|
|
452
|
+
<!-- Start Debugging [debug] -->
|
|
453
|
+
## Debugging
|
|
454
|
+
|
|
455
|
+
You can setup your SDK to emit debug logs for SDK requests and responses.
|
|
456
|
+
|
|
457
|
+
You can pass a logger that matches `console`'s interface as an SDK option.
|
|
458
|
+
|
|
459
|
+
> [!WARNING]
|
|
460
|
+
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
|
|
461
|
+
|
|
462
|
+
```typescript
|
|
463
|
+
import { Quickshops } from "@quickshops/sdk";
|
|
464
|
+
|
|
465
|
+
const sdk = new Quickshops({ debugLogger: console });
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
You can also enable a default debug logger by setting an environment variable `QUICKSHOPS_DEBUG` to true.
|
|
469
|
+
<!-- End Debugging [debug] -->
|
|
470
|
+
|
|
471
|
+
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
472
|
+
|
|
473
|
+
# Development
|
|
474
|
+
|
|
475
|
+
## Maturity
|
|
476
|
+
|
|
477
|
+
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
|
|
478
|
+
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
|
|
479
|
+
looking for the latest version.
|
|
480
|
+
|
|
481
|
+
## Contributions
|
|
482
|
+
|
|
483
|
+
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
|
|
484
|
+
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
|
|
485
|
+
|
|
486
|
+
### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=quickshops&utm_campaign=typescript)
|
package/RUNTIMES.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Supported JavaScript runtimes
|
|
2
|
+
|
|
3
|
+
This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features:
|
|
4
|
+
|
|
5
|
+
- [Web Fetch API][web-fetch]
|
|
6
|
+
- [Web Streams API][web-streams] and in particular `ReadableStream`
|
|
7
|
+
- [Async iterables][async-iter] using `Symbol.asyncIterator`
|
|
8
|
+
|
|
9
|
+
[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
|
|
10
|
+
[web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API
|
|
11
|
+
[async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols
|
|
12
|
+
|
|
13
|
+
Runtime environments that are explicitly supported are:
|
|
14
|
+
|
|
15
|
+
- Evergreen browsers which include: Chrome, Safari, Edge, Firefox
|
|
16
|
+
- Node.js active and maintenance LTS releases
|
|
17
|
+
- Currently, this is v18 and v20
|
|
18
|
+
- Bun v1 and above
|
|
19
|
+
- Deno v1.39
|
|
20
|
+
- Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming])
|
|
21
|
+
|
|
22
|
+
[deno-file-streaming]: https://github.com/denoland/deno/issues/11018
|
|
23
|
+
|
|
24
|
+
## Recommended TypeScript compiler options
|
|
25
|
+
|
|
26
|
+
The following `tsconfig.json` options are recommended for projects using this
|
|
27
|
+
SDK in order to get static type support for features like async iterables,
|
|
28
|
+
streams and `fetch`-related APIs ([`for await...of`][for-await-of],
|
|
29
|
+
[`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and
|
|
30
|
+
so on):
|
|
31
|
+
|
|
32
|
+
[for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
|
|
33
|
+
[abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
|
|
34
|
+
[request]: https://developer.mozilla.org/en-US/docs/Web/API/Request
|
|
35
|
+
[response]: https://developer.mozilla.org/en-US/docs/Web/API/Response
|
|
36
|
+
|
|
37
|
+
```jsonc
|
|
38
|
+
{
|
|
39
|
+
"compilerOptions": {
|
|
40
|
+
"target": "es2020", // or higher
|
|
41
|
+
"lib": ["es2020", "dom", "dom.iterable"]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
While `target` can be set to older ECMAScript versions, it may result in extra,
|
|
47
|
+
unnecessary compatibility code being generated if you are not targeting old
|
|
48
|
+
runtimes.
|
package/esm/core.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ClientSDK } from "./lib/sdks.js";
|
|
2
|
+
/**
|
|
3
|
+
* A minimal client to use when calling standalone SDK functions. Typically, an
|
|
4
|
+
* instance of this class would be instantiated once at the start of an
|
|
5
|
+
* application and passed around through some dependency injection mechanism to
|
|
6
|
+
* parts of an application that need to make SDK calls.
|
|
7
|
+
*/
|
|
8
|
+
export declare class QuickshopsCore extends ClientSDK {
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,SAAS;CAAG"}
|
package/esm/core.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import { ClientSDK } from "./lib/sdks.js";
|
|
5
|
+
/**
|
|
6
|
+
* A minimal client to use when calling standalone SDK functions. Typically, an
|
|
7
|
+
* instance of this class would be instantiated once at the start of an
|
|
8
|
+
* application and passed around through some dependency injection mechanism to
|
|
9
|
+
* parts of an application that need to make SDK calls.
|
|
10
|
+
*/
|
|
11
|
+
export class QuickshopsCore extends ClientSDK {
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=core.js.map
|
package/esm/core.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,SAAS;CAAG"}
|