@edgebound/bigcommerce 0.3.2 → 0.4.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/README.md +473 -0
- package/dist/bigcommerce-entities/addresses/index.d.ts +2 -0
- package/dist/bigcommerce-entities/addresses/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/addresses/index.js +18 -0
- package/dist/bigcommerce-entities/addresses/index.js.map +1 -0
- package/dist/{addresses.d.mts → bigcommerce-entities/addresses/schemas/address.schema.d.ts} +2 -9
- package/dist/bigcommerce-entities/addresses/schemas/address.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/addresses/schemas/address.schema.js +54 -0
- package/dist/bigcommerce-entities/addresses/schemas/address.schema.js.map +1 -0
- package/dist/bigcommerce-entities/addresses/schemas/form-field.schema.d.ts +6 -0
- package/dist/bigcommerce-entities/addresses/schemas/form-field.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/addresses/schemas/form-field.schema.js +42 -0
- package/dist/bigcommerce-entities/addresses/schemas/form-field.schema.js.map +1 -0
- package/dist/bigcommerce-entities/addresses/schemas/index.d.ts +3 -0
- package/dist/bigcommerce-entities/addresses/schemas/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/addresses/schemas/index.js +19 -0
- package/dist/bigcommerce-entities/addresses/schemas/index.js.map +1 -0
- package/dist/bigcommerce-entities/companies/companies.service.d.ts +309 -0
- package/dist/bigcommerce-entities/companies/companies.service.d.ts.map +1 -0
- package/dist/bigcommerce-entities/companies/companies.service.js +331 -0
- package/dist/bigcommerce-entities/companies/companies.service.js.map +1 -0
- package/dist/bigcommerce-entities/companies/index.d.ts +3 -0
- package/dist/bigcommerce-entities/companies/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/companies/index.js +19 -0
- package/dist/bigcommerce-entities/companies/index.js.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/company.schema.d.ts +63 -0
- package/dist/bigcommerce-entities/companies/schemas/company.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/company.schema.js +101 -0
- package/dist/bigcommerce-entities/companies/schemas/company.schema.js.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/credit.schemas.d.ts +15 -0
- package/dist/bigcommerce-entities/companies/schemas/credit.schemas.d.ts.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/credit.schemas.js +49 -0
- package/dist/bigcommerce-entities/companies/schemas/credit.schemas.js.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/extra-fields.schema.d.ts +28 -0
- package/dist/bigcommerce-entities/companies/schemas/extra-fields.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/extra-fields.schema.js +60 -0
- package/dist/bigcommerce-entities/companies/schemas/extra-fields.schema.js.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/index.d.ts +8 -0
- package/dist/bigcommerce-entities/companies/schemas/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/index.js +24 -0
- package/dist/bigcommerce-entities/companies/schemas/index.js.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/payment-methods.schema.d.ts +12 -0
- package/dist/bigcommerce-entities/companies/schemas/payment-methods.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/payment-methods.schema.js +50 -0
- package/dist/bigcommerce-entities/companies/schemas/payment-methods.schema.js.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/roles.d.ts +28 -0
- package/dist/bigcommerce-entities/companies/schemas/roles.d.ts.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/roles.js +59 -0
- package/dist/bigcommerce-entities/companies/schemas/roles.js.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/sales-staff.schema.d.ts +15 -0
- package/dist/bigcommerce-entities/companies/schemas/sales-staff.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/sales-staff.schema.js +51 -0
- package/dist/bigcommerce-entities/companies/schemas/sales-staff.schema.js.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/user.schema.d.ts +51 -0
- package/dist/bigcommerce-entities/companies/schemas/user.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/companies/schemas/user.schema.js +91 -0
- package/dist/bigcommerce-entities/companies/schemas/user.schema.js.map +1 -0
- package/dist/bigcommerce-entities/currencies/index.d.ts +2 -0
- package/dist/bigcommerce-entities/currencies/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/currencies/index.js +3 -0
- package/dist/bigcommerce-entities/currencies/index.js.map +1 -0
- package/dist/bigcommerce-entities/customers/customers.service.d.ts +270 -0
- package/dist/bigcommerce-entities/customers/customers.service.d.ts.map +1 -0
- package/dist/bigcommerce-entities/customers/customers.service.js +254 -0
- package/dist/bigcommerce-entities/customers/customers.service.js.map +1 -0
- package/dist/bigcommerce-entities/customers/index.d.ts +3 -0
- package/dist/bigcommerce-entities/customers/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/customers/index.js +19 -0
- package/dist/bigcommerce-entities/customers/index.js.map +1 -0
- package/dist/bigcommerce-entities/customers/schemas/customer-group.schema.d.ts +35 -0
- package/dist/bigcommerce-entities/customers/schemas/customer-group.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/customers/schemas/customer-group.schema.js +74 -0
- package/dist/bigcommerce-entities/customers/schemas/customer-group.schema.js.map +1 -0
- package/dist/bigcommerce-entities/customers/schemas/customer.schema.d.ts +38 -0
- package/dist/bigcommerce-entities/customers/schemas/customer.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/customers/schemas/customer.schema.js +65 -0
- package/dist/bigcommerce-entities/customers/schemas/customer.schema.js.map +1 -0
- package/dist/bigcommerce-entities/customers/schemas/find-addresses.schema.d.ts +35 -0
- package/dist/bigcommerce-entities/customers/schemas/find-addresses.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/customers/schemas/find-addresses.schema.js +81 -0
- package/dist/bigcommerce-entities/customers/schemas/find-addresses.schema.js.map +1 -0
- package/dist/bigcommerce-entities/customers/schemas/find-customer.criteria.d.ts +9 -0
- package/dist/bigcommerce-entities/customers/schemas/find-customer.criteria.d.ts.map +1 -0
- package/dist/bigcommerce-entities/customers/schemas/find-customer.criteria.js +54 -0
- package/dist/bigcommerce-entities/customers/schemas/find-customer.criteria.js.map +1 -0
- package/dist/bigcommerce-entities/customers/schemas/index.d.ts +5 -0
- package/dist/bigcommerce-entities/customers/schemas/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/customers/schemas/index.js +21 -0
- package/dist/bigcommerce-entities/customers/schemas/index.js.map +1 -0
- package/dist/bigcommerce-entities/index.d.ts +11 -0
- package/dist/bigcommerce-entities/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/index.js +27 -0
- package/dist/bigcommerce-entities/index.js.map +1 -0
- package/dist/bigcommerce-entities/orders/index.d.ts +3 -0
- package/dist/bigcommerce-entities/orders/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/orders/index.js +19 -0
- package/dist/bigcommerce-entities/orders/index.js.map +1 -0
- package/dist/bigcommerce-entities/orders/orders.service.d.ts +470 -0
- package/dist/bigcommerce-entities/orders/orders.service.d.ts.map +1 -0
- package/dist/bigcommerce-entities/orders/orders.service.js +274 -0
- package/dist/bigcommerce-entities/orders/orders.service.js.map +1 -0
- package/dist/bigcommerce-entities/orders/schemas/find-orders.criteria.d.ts +17 -0
- package/dist/bigcommerce-entities/orders/schemas/find-orders.criteria.d.ts.map +1 -0
- package/dist/bigcommerce-entities/orders/schemas/find-orders.criteria.js +55 -0
- package/dist/bigcommerce-entities/orders/schemas/find-orders.criteria.js.map +1 -0
- package/dist/bigcommerce-entities/orders/schemas/index.d.ts +6 -0
- package/dist/bigcommerce-entities/orders/schemas/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/orders/schemas/index.js +22 -0
- package/dist/bigcommerce-entities/orders/schemas/index.js.map +1 -0
- package/dist/bigcommerce-entities/orders/schemas/order-product.schema.d.ts +31 -0
- package/dist/bigcommerce-entities/orders/schemas/order-product.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/orders/schemas/order-product.schema.js +64 -0
- package/dist/bigcommerce-entities/orders/schemas/order-product.schema.js.map +1 -0
- package/dist/{addresses.d.ts → bigcommerce-entities/orders/schemas/order-shipping-address.schema.d.ts} +5 -9
- package/dist/bigcommerce-entities/orders/schemas/order-shipping-address.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/orders/schemas/order-shipping-address.schema.js +44 -0
- package/dist/bigcommerce-entities/orders/schemas/order-shipping-address.schema.js.map +1 -0
- package/dist/bigcommerce-entities/orders/schemas/order.schema.d.ts +104 -0
- package/dist/bigcommerce-entities/orders/schemas/order.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/orders/schemas/order.schema.js +109 -0
- package/dist/bigcommerce-entities/orders/schemas/order.schema.js.map +1 -0
- package/dist/{status.schema-BgztUtGy.d.mts → bigcommerce-entities/orders/schemas/status.schema.d.ts} +4 -6
- package/dist/bigcommerce-entities/orders/schemas/status.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/orders/schemas/status.schema.js +74 -0
- package/dist/bigcommerce-entities/orders/schemas/status.schema.js.map +1 -0
- package/dist/bigcommerce-entities/payments/index.d.ts +3 -0
- package/dist/bigcommerce-entities/payments/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/payments/index.js +19 -0
- package/dist/bigcommerce-entities/payments/index.js.map +1 -0
- package/dist/bigcommerce-entities/payments/payments.service.d.ts +40 -0
- package/dist/bigcommerce-entities/payments/payments.service.d.ts.map +1 -0
- package/dist/bigcommerce-entities/payments/payments.service.js +66 -0
- package/dist/bigcommerce-entities/payments/payments.service.js.map +1 -0
- package/dist/bigcommerce-entities/payments/schemas/index.d.ts +2 -0
- package/dist/bigcommerce-entities/payments/schemas/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/payments/schemas/index.js +18 -0
- package/dist/bigcommerce-entities/payments/schemas/index.js.map +1 -0
- package/dist/bigcommerce-entities/payments/schemas/payment-methods.schema.d.ts +14 -0
- package/dist/bigcommerce-entities/payments/schemas/payment-methods.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/payments/schemas/payment-methods.schema.js +46 -0
- package/dist/bigcommerce-entities/payments/schemas/payment-methods.schema.js.map +1 -0
- package/dist/bigcommerce-entities/price-lists/index.d.ts +3 -0
- package/dist/bigcommerce-entities/price-lists/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/price-lists/index.js +19 -0
- package/dist/bigcommerce-entities/price-lists/index.js.map +1 -0
- package/dist/bigcommerce-entities/price-lists/price-lists.service.d.ts +97 -0
- package/dist/bigcommerce-entities/price-lists/price-lists.service.d.ts.map +1 -0
- package/dist/bigcommerce-entities/price-lists/price-lists.service.js +126 -0
- package/dist/bigcommerce-entities/price-lists/price-lists.service.js.map +1 -0
- package/dist/bigcommerce-entities/price-lists/schemas/create-price-lists.schema.d.ts +11 -0
- package/dist/bigcommerce-entities/price-lists/schemas/create-price-lists.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/price-lists/schemas/create-price-lists.schema.js +47 -0
- package/dist/bigcommerce-entities/price-lists/schemas/create-price-lists.schema.js.map +1 -0
- package/dist/bigcommerce-entities/price-lists/schemas/get-prices-lists.schema.d.ts +32 -0
- package/dist/bigcommerce-entities/price-lists/schemas/get-prices-lists.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/price-lists/schemas/get-prices-lists.schema.js +66 -0
- package/dist/bigcommerce-entities/price-lists/schemas/get-prices-lists.schema.js.map +1 -0
- package/dist/bigcommerce-entities/price-lists/schemas/index.d.ts +3 -0
- package/dist/bigcommerce-entities/price-lists/schemas/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/price-lists/schemas/index.js +19 -0
- package/dist/bigcommerce-entities/price-lists/schemas/index.js.map +1 -0
- package/dist/bigcommerce-entities/products/index.d.ts +3 -0
- package/dist/bigcommerce-entities/products/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/products/index.js +19 -0
- package/dist/bigcommerce-entities/products/index.js.map +1 -0
- package/dist/bigcommerce-entities/products/products.service.d.ts +88 -0
- package/dist/bigcommerce-entities/products/products.service.d.ts.map +1 -0
- package/dist/bigcommerce-entities/products/products.service.js +165 -0
- package/dist/bigcommerce-entities/products/products.service.js.map +1 -0
- package/dist/bigcommerce-entities/products/schemas/index.d.ts +3 -0
- package/dist/bigcommerce-entities/products/schemas/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/products/schemas/index.js +19 -0
- package/dist/bigcommerce-entities/products/schemas/index.js.map +1 -0
- package/dist/bigcommerce-entities/products/schemas/set-inventory.schema.d.ts +26 -0
- package/dist/bigcommerce-entities/products/schemas/set-inventory.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/products/schemas/set-inventory.schema.js +57 -0
- package/dist/bigcommerce-entities/products/schemas/set-inventory.schema.js.map +1 -0
- package/dist/bigcommerce-entities/products/schemas/update-products.schema.d.ts +11 -0
- package/dist/bigcommerce-entities/products/schemas/update-products.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/products/schemas/update-products.schema.js +44 -0
- package/dist/bigcommerce-entities/products/schemas/update-products.schema.js.map +1 -0
- package/dist/bigcommerce-entities/sales-staff/index.d.ts +3 -0
- package/dist/bigcommerce-entities/sales-staff/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/sales-staff/index.js +19 -0
- package/dist/bigcommerce-entities/sales-staff/index.js.map +1 -0
- package/dist/bigcommerce-entities/sales-staff/sales-staff.service.d.ts +78 -0
- package/dist/bigcommerce-entities/sales-staff/sales-staff.service.d.ts.map +1 -0
- package/dist/bigcommerce-entities/sales-staff/sales-staff.service.js +102 -0
- package/dist/bigcommerce-entities/sales-staff/sales-staff.service.js.map +1 -0
- package/dist/bigcommerce-entities/sales-staff/schemas/get-sales-staff.schema.d.ts +31 -0
- package/dist/bigcommerce-entities/sales-staff/schemas/get-sales-staff.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/sales-staff/schemas/get-sales-staff.schema.js +62 -0
- package/dist/bigcommerce-entities/sales-staff/schemas/get-sales-staff.schema.js.map +1 -0
- package/dist/bigcommerce-entities/sales-staff/schemas/index.d.ts +2 -0
- package/dist/bigcommerce-entities/sales-staff/schemas/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/sales-staff/schemas/index.js +18 -0
- package/dist/bigcommerce-entities/sales-staff/schemas/index.js.map +1 -0
- package/dist/bigcommerce-entities/webhooks/index.d.ts +2 -0
- package/dist/bigcommerce-entities/webhooks/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/webhooks/index.js +18 -0
- package/dist/bigcommerce-entities/webhooks/index.js.map +1 -0
- package/dist/bigcommerce-entities/webhooks/schemas/customer.scope.schema.d.ts +28 -0
- package/dist/bigcommerce-entities/webhooks/schemas/customer.scope.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/webhooks/schemas/customer.scope.schema.js +64 -0
- package/dist/bigcommerce-entities/webhooks/schemas/customer.scope.schema.js.map +1 -0
- package/dist/bigcommerce-entities/webhooks/schemas/index.d.ts +4 -0
- package/dist/bigcommerce-entities/webhooks/schemas/index.d.ts.map +1 -0
- package/dist/bigcommerce-entities/webhooks/schemas/index.js +20 -0
- package/dist/bigcommerce-entities/webhooks/schemas/index.js.map +1 -0
- package/dist/bigcommerce-entities/webhooks/schemas/order.scope.schema.d.ts +26 -0
- package/dist/bigcommerce-entities/webhooks/schemas/order.scope.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/webhooks/schemas/order.scope.schema.js +57 -0
- package/dist/bigcommerce-entities/webhooks/schemas/order.scope.schema.js.map +1 -0
- package/dist/bigcommerce-entities/webhooks/schemas/webhooks.schema.d.ts +54 -0
- package/dist/bigcommerce-entities/webhooks/schemas/webhooks.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/webhooks/schemas/webhooks.schema.js +52 -0
- package/dist/bigcommerce-entities/webhooks/schemas/webhooks.schema.js.map +1 -0
- package/dist/bigcommerce.module.d.ts +16 -0
- package/dist/bigcommerce.module.d.ts.map +1 -0
- package/dist/bigcommerce.module.js +83 -0
- package/dist/bigcommerce.module.js.map +1 -0
- package/dist/constants.d.ts +52 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +55 -0
- package/dist/constants.js.map +1 -0
- package/dist/core/bigcommerce-fetcher.service.d.ts +40 -0
- package/dist/core/bigcommerce-fetcher.service.d.ts.map +1 -0
- package/dist/core/bigcommerce-fetcher.service.js +133 -0
- package/dist/core/bigcommerce-fetcher.service.js.map +1 -0
- package/dist/core/bigcommerce.error.d.ts +51 -0
- package/dist/core/bigcommerce.error.d.ts.map +1 -0
- package/dist/core/bigcommerce.error.js +160 -0
- package/dist/core/bigcommerce.error.js.map +1 -0
- package/dist/core/config.module.d.ts +12 -0
- package/dist/core/config.module.d.ts.map +1 -0
- package/dist/core/config.module.js +75 -0
- package/dist/core/config.module.js.map +1 -0
- package/dist/core/config.schema.d.ts +20 -0
- package/dist/core/config.schema.d.ts.map +1 -0
- package/dist/core/config.schema.js +74 -0
- package/dist/core/config.schema.js.map +1 -0
- package/dist/core/config.service.d.ts +13 -0
- package/dist/core/config.service.d.ts.map +1 -0
- package/dist/core/config.service.js +30 -0
- package/dist/core/config.service.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +22 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.d.ts +5 -36
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -371
- package/dist/index.js.map +1 -1
- package/dist/utils/chunk.d.ts +2 -0
- package/dist/utils/chunk.d.ts.map +1 -0
- package/dist/utils/chunk.js +12 -0
- package/dist/utils/chunk.js.map +1 -0
- package/dist/utils/concurrency.d.ts +11 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/concurrency.js +20 -0
- package/dist/utils/concurrency.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/validation.error.d.ts +6 -0
- package/dist/utils/validation.error.d.ts.map +1 -0
- package/dist/utils/validation.error.js +50 -0
- package/dist/utils/validation.error.js.map +1 -0
- package/dist/utils/while.d.ts +8 -0
- package/dist/utils/while.d.ts.map +1 -0
- package/dist/utils/while.js +23 -0
- package/dist/utils/while.js.map +1 -0
- package/package.json +23 -67
- package/dist/addresses.js +0 -69
- package/dist/addresses.js.map +0 -1
- package/dist/addresses.mjs +0 -9
- package/dist/addresses.mjs.map +0 -1
- package/dist/bigcommerce.fetcher-Ujztbs8P.d.mts +0 -90
- package/dist/bigcommerce.fetcher-Ujztbs8P.d.ts +0 -90
- package/dist/chunk-BWLQCNNX.mjs +0 -30
- package/dist/chunk-BWLQCNNX.mjs.map +0 -1
- package/dist/chunk-CERZFSUE.mjs +0 -20
- package/dist/chunk-CERZFSUE.mjs.map +0 -1
- package/dist/chunk-V2WZ3SDN.mjs +0 -333
- package/dist/chunk-V2WZ3SDN.mjs.map +0 -1
- package/dist/chunk-XONZC4AG.mjs +0 -45
- package/dist/chunk-XONZC4AG.mjs.map +0 -1
- package/dist/companies.d.mts +0 -346
- package/dist/companies.d.ts +0 -346
- package/dist/companies.js +0 -837
- package/dist/companies.js.map +0 -1
- package/dist/companies.mjs +0 -467
- package/dist/companies.mjs.map +0 -1
- package/dist/currencies.d.mts +0 -2
- package/dist/currencies.d.ts +0 -2
- package/dist/currencies.js +0 -2
- package/dist/currencies.js.map +0 -1
- package/dist/currencies.mjs +0 -1
- package/dist/currencies.mjs.map +0 -1
- package/dist/customers.d.mts +0 -235
- package/dist/customers.d.ts +0 -235
- package/dist/customers.js +0 -679
- package/dist/customers.js.map +0 -1
- package/dist/customers.mjs +0 -320
- package/dist/customers.mjs.map +0 -1
- package/dist/index.d.mts +0 -36
- package/dist/index.mjs +0 -39
- package/dist/index.mjs.map +0 -1
- package/dist/orders.d.mts +0 -492
- package/dist/orders.d.ts +0 -492
- package/dist/orders.js +0 -723
- package/dist/orders.js.map +0 -1
- package/dist/orders.mjs +0 -312
- package/dist/orders.mjs.map +0 -1
- package/dist/payments.d.mts +0 -28
- package/dist/payments.d.ts +0 -28
- package/dist/payments.js +0 -372
- package/dist/payments.js.map +0 -1
- package/dist/payments.mjs +0 -43
- package/dist/payments.mjs.map +0 -1
- package/dist/priceLists.d.mts +0 -81
- package/dist/priceLists.d.ts +0 -81
- package/dist/priceLists.js +0 -465
- package/dist/priceLists.js.map +0 -1
- package/dist/priceLists.mjs +0 -118
- package/dist/priceLists.mjs.map +0 -1
- package/dist/products.d.mts +0 -52
- package/dist/products.d.ts +0 -52
- package/dist/products.js +0 -470
- package/dist/products.js.map +0 -1
- package/dist/products.mjs +0 -120
- package/dist/products.mjs.map +0 -1
- package/dist/salesStaff.d.mts +0 -64
- package/dist/salesStaff.d.ts +0 -64
- package/dist/salesStaff.js +0 -426
- package/dist/salesStaff.js.map +0 -1
- package/dist/salesStaff.mjs +0 -82
- package/dist/salesStaff.mjs.map +0 -1
- package/dist/status.schema-BgztUtGy.d.ts +0 -39
- package/dist/validation.error-CHLpPYC_.d.mts +0 -14
- package/dist/validation.error-CHLpPYC_.d.ts +0 -14
- package/dist/webhooks.d.mts +0 -109
- package/dist/webhooks.d.ts +0 -109
- package/dist/webhooks.js +0 -157
- package/dist/webhooks.js.map +0 -1
- package/dist/webhooks.mjs +0 -79
- package/dist/webhooks.mjs.map +0 -1
package/dist/payments.js
DELETED
|
@@ -1,372 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/bigcommerce-entities/payments/index.ts
|
|
31
|
-
var payments_exports = {};
|
|
32
|
-
__export(payments_exports, {
|
|
33
|
-
GetPaymentMethodsResponseSchema: () => GetPaymentMethodsResponseSchema,
|
|
34
|
-
PaymentMethodSchema: () => PaymentMethodSchema,
|
|
35
|
-
getPaymentMethods: () => getPaymentMethods
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(payments_exports);
|
|
38
|
-
|
|
39
|
-
// src/bigcommerce-entities/payments/payment-methods.ts
|
|
40
|
-
var import_effect6 = require("effect");
|
|
41
|
-
var import_node_querystring = require("querystring");
|
|
42
|
-
|
|
43
|
-
// src/constants.ts
|
|
44
|
-
var import_effect = require("effect");
|
|
45
|
-
var DEFAULTS = {
|
|
46
|
-
retry: {
|
|
47
|
-
policy: import_effect.Schedule.exponential(import_effect.Duration.millis(200), 2).pipe(
|
|
48
|
-
import_effect.Schedule.intersect(import_effect.Schedule.recurs(3))
|
|
49
|
-
)
|
|
50
|
-
},
|
|
51
|
-
timeout: {
|
|
52
|
-
ms: 3e4
|
|
53
|
-
},
|
|
54
|
-
bigcommerceUrls: {
|
|
55
|
-
b2b: "https://api-b2b.bigcommerce.com/api",
|
|
56
|
-
regular: "https://api.bigcommerce.com/stores"
|
|
57
|
-
},
|
|
58
|
-
customers: {
|
|
59
|
-
getBatchSize: 250
|
|
60
|
-
},
|
|
61
|
-
salesStaff: {
|
|
62
|
-
getBatchSize: 250
|
|
63
|
-
},
|
|
64
|
-
companies: {
|
|
65
|
-
salesStaffAssignments: {
|
|
66
|
-
assignBatchSize: 10,
|
|
67
|
-
concurrency: 2
|
|
68
|
-
},
|
|
69
|
-
extraFields: {
|
|
70
|
-
getBatchSize: 250
|
|
71
|
-
},
|
|
72
|
-
roles: {
|
|
73
|
-
getBatchSize: 250
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
products: {
|
|
77
|
-
updateBatchSize: 5,
|
|
78
|
-
updateConcurrency: 2,
|
|
79
|
-
inventory: {
|
|
80
|
-
updateBatchSize: 2e3,
|
|
81
|
-
updateConcurrency: 2
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
orders: {
|
|
85
|
-
getAllBatchSize: 250,
|
|
86
|
-
shippingAddresses: {
|
|
87
|
-
getAllBatchSize: 250
|
|
88
|
-
},
|
|
89
|
-
products: {
|
|
90
|
-
getAllBatchSize: 250
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
priceLists: {
|
|
94
|
-
getAllBatchSize: 250
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// src/core/bigcommerce.error.ts
|
|
99
|
-
var import_effect2 = require("effect");
|
|
100
|
-
var BigCommerceUnprocessableEntityError = class extends import_effect2.Data.TaggedError(
|
|
101
|
-
"BigCommerceUnprocessableEntityError"
|
|
102
|
-
) {
|
|
103
|
-
};
|
|
104
|
-
var BigCommerceUnauthorizedError = class extends import_effect2.Data.TaggedError(
|
|
105
|
-
"BigCommerceUnauthorizedError"
|
|
106
|
-
) {
|
|
107
|
-
};
|
|
108
|
-
var BigCommerceForbiddenError = class extends import_effect2.Data.TaggedError("BigCommerceForbiddenError") {
|
|
109
|
-
};
|
|
110
|
-
var BigCommerceNotFoundError = class extends import_effect2.Data.TaggedError("BigCommerceNotFoundError") {
|
|
111
|
-
};
|
|
112
|
-
var BigCommerceConflictError = class extends import_effect2.Data.TaggedError("BigCommerceConflictError") {
|
|
113
|
-
};
|
|
114
|
-
var BigCommerceConnectionError = class extends import_effect2.Data.TaggedError("BigCommerceConnectionError") {
|
|
115
|
-
};
|
|
116
|
-
var BigCommerceUnknownError = class extends import_effect2.Data.TaggedError("BigCommerceUnknownError") {
|
|
117
|
-
};
|
|
118
|
-
var BigCommerceInvalidResponseError = class extends import_effect2.Data.TaggedError(
|
|
119
|
-
"BigCommerceInvalidResponseError"
|
|
120
|
-
) {
|
|
121
|
-
};
|
|
122
|
-
var BigCommerceInvalidRequestError = class extends import_effect2.Data.TaggedError(
|
|
123
|
-
"BigCommerceInvalidRequestError"
|
|
124
|
-
) {
|
|
125
|
-
};
|
|
126
|
-
var BigCommerceParseResponseError = class extends import_effect2.Data.TaggedError(
|
|
127
|
-
"BigCommerceParseResponseError"
|
|
128
|
-
) {
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
// src/core/bigcommerce.fetcher.ts
|
|
132
|
-
var import_effect3 = require("effect");
|
|
133
|
-
var BigCommerceFetcher = class extends import_effect3.Context.Tag("BigCommerceFetcher")() {
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
// src/core/bigcommerce.fetcher.live.ts
|
|
137
|
-
var import_effect5 = require("effect");
|
|
138
|
-
|
|
139
|
-
// src/core/config.ts
|
|
140
|
-
var import_effect4 = require("effect");
|
|
141
|
-
var NoBigCommerceConfigError = class extends import_effect4.Data.TaggedError("NoBigCommerceConfigError") {
|
|
142
|
-
};
|
|
143
|
-
var BigCommerceConfig = class extends import_effect4.Context.Tag("BigCommerceConfig")() {
|
|
144
|
-
};
|
|
145
|
-
var getBigCommerceConfig = (key) => {
|
|
146
|
-
return import_effect4.Config.nested(import_effect4.Config.string(key), "BIGCOMMERCE").pipe(
|
|
147
|
-
import_effect4.Effect.mapError(() => new NoBigCommerceConfigError({ key }))
|
|
148
|
-
);
|
|
149
|
-
};
|
|
150
|
-
var getBigCommerceTimeout = () => {
|
|
151
|
-
return import_effect4.Config.nested(import_effect4.Config.number("TIMEOUT"), "BIGCOMMERCE").pipe(
|
|
152
|
-
import_effect4.Effect.mapError(() => new NoBigCommerceConfigError({ key: "TIMEOUT" })),
|
|
153
|
-
// Default to 30 seconds if not configured
|
|
154
|
-
import_effect4.Effect.orElse(() => import_effect4.Effect.succeed(DEFAULTS.timeout.ms))
|
|
155
|
-
);
|
|
156
|
-
};
|
|
157
|
-
var BigCommerceConfigLive = import_effect4.Layer.effect(
|
|
158
|
-
BigCommerceConfig,
|
|
159
|
-
import_effect4.Effect.gen(function* () {
|
|
160
|
-
const [storeHash, clientId, clientSecret, accessToken, timeout] = yield* import_effect4.Effect.all([
|
|
161
|
-
getBigCommerceConfig("STORE_HASH"),
|
|
162
|
-
getBigCommerceConfig("CLIENT_ID"),
|
|
163
|
-
getBigCommerceConfig("CLIENT_SECRET"),
|
|
164
|
-
getBigCommerceConfig("ACCESS_TOKEN"),
|
|
165
|
-
getBigCommerceTimeout()
|
|
166
|
-
]);
|
|
167
|
-
return {
|
|
168
|
-
getStoreHash: import_effect4.Effect.succeed(storeHash),
|
|
169
|
-
getClientId: import_effect4.Effect.succeed(clientId),
|
|
170
|
-
getClientSecret: import_effect4.Effect.succeed(clientSecret),
|
|
171
|
-
getAccessToken: import_effect4.Effect.succeed(accessToken),
|
|
172
|
-
getTimeout: import_effect4.Effect.succeed(timeout)
|
|
173
|
-
};
|
|
174
|
-
})
|
|
175
|
-
);
|
|
176
|
-
var BigCommerceConfigTest = import_effect4.Layer.succeed(BigCommerceConfig, {
|
|
177
|
-
getAccessToken: import_effect4.Effect.succeed("test"),
|
|
178
|
-
getClientId: import_effect4.Effect.succeed("test"),
|
|
179
|
-
getClientSecret: import_effect4.Effect.succeed("test"),
|
|
180
|
-
getStoreHash: import_effect4.Effect.succeed("test"),
|
|
181
|
-
getTimeout: import_effect4.Effect.succeed(DEFAULTS.timeout.ms)
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
// src/core/bigcommerce.fetcher.live.ts
|
|
185
|
-
var BigCommerceStatusCodes = {
|
|
186
|
-
UNAUTHORIZED: 401,
|
|
187
|
-
CONFLICT: 409,
|
|
188
|
-
FORBIDDEN: 403,
|
|
189
|
-
NOT_FOUND: 404,
|
|
190
|
-
UNPROCESSABLE_ENTITY: 422,
|
|
191
|
-
INTERNAL_SERVER_ERROR: 500,
|
|
192
|
-
BAD_GATEWAY: 502,
|
|
193
|
-
SERVICE_UNAVAILABLE: 503,
|
|
194
|
-
GATEWAY_TIMEOUT: 504,
|
|
195
|
-
INVALID_REQUEST: 400
|
|
196
|
-
};
|
|
197
|
-
var BigCommerceFetcherLive = import_effect5.Layer.effect(
|
|
198
|
-
BigCommerceFetcher,
|
|
199
|
-
import_effect5.Effect.gen(function* () {
|
|
200
|
-
const config = yield* BigCommerceConfig;
|
|
201
|
-
const storeHash = yield* config.getStoreHash;
|
|
202
|
-
const accessToken = yield* config.getAccessToken;
|
|
203
|
-
const timeout = yield* config.getTimeout;
|
|
204
|
-
return {
|
|
205
|
-
fetch: (params) => {
|
|
206
|
-
const base = getBase(params);
|
|
207
|
-
const headers = {
|
|
208
|
-
Accept: "application/json",
|
|
209
|
-
"Content-Type": "application/json",
|
|
210
|
-
"x-auth-token": accessToken
|
|
211
|
-
};
|
|
212
|
-
if (params.isB2B) {
|
|
213
|
-
headers["x-store-hash"] = storeHash;
|
|
214
|
-
}
|
|
215
|
-
const url = applyParams(base.replace("[storeHash]", storeHash), params.query);
|
|
216
|
-
return import_effect5.Effect.tryPromise({
|
|
217
|
-
try: () => fetch(url, {
|
|
218
|
-
headers,
|
|
219
|
-
signal: AbortSignal.timeout(timeout),
|
|
220
|
-
method: params.method,
|
|
221
|
-
...params.body && { body: JSON.stringify(params.body) }
|
|
222
|
-
}),
|
|
223
|
-
catch: (error) => {
|
|
224
|
-
if (error instanceof Error && error.name === "TimeoutError") {
|
|
225
|
-
return new BigCommerceConnectionError({
|
|
226
|
-
message: `Request timeout after ${timeout}ms`,
|
|
227
|
-
type: "timeout"
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
if (error instanceof Error && error.name === "AbortError") {
|
|
231
|
-
return new BigCommerceConnectionError({
|
|
232
|
-
message: `Request timeout after ${timeout}ms`,
|
|
233
|
-
type: "timeout"
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
return new BigCommerceUnknownError({ cause: error });
|
|
237
|
-
}
|
|
238
|
-
}).pipe(
|
|
239
|
-
import_effect5.Effect.tapError(
|
|
240
|
-
(error) => import_effect5.Effect.logError("Failed to fetch from BigCommerce API", error.cause)
|
|
241
|
-
),
|
|
242
|
-
import_effect5.Effect.flatMap((response) => transformResponse(response, params.resultSchema))
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
})
|
|
247
|
-
);
|
|
248
|
-
var applyParams = (url, params) => {
|
|
249
|
-
const base = new URL(url);
|
|
250
|
-
if (!params) {
|
|
251
|
-
return base;
|
|
252
|
-
}
|
|
253
|
-
if (typeof params === "string") {
|
|
254
|
-
base.search = params;
|
|
255
|
-
} else {
|
|
256
|
-
for (const [key, value] of Object.entries(params)) {
|
|
257
|
-
base.searchParams.append(key, `${value}`);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
return base;
|
|
261
|
-
};
|
|
262
|
-
var getBase = ({
|
|
263
|
-
isB2B,
|
|
264
|
-
path,
|
|
265
|
-
version
|
|
266
|
-
}) => {
|
|
267
|
-
if (isB2B) {
|
|
268
|
-
return `${DEFAULTS.bigcommerceUrls.b2b}/${version}/io/${path}`;
|
|
269
|
-
}
|
|
270
|
-
return `${DEFAULTS.bigcommerceUrls.regular}/[storeHash]/${version}/${path}`;
|
|
271
|
-
};
|
|
272
|
-
async function safeJson(response) {
|
|
273
|
-
const text = await response.text();
|
|
274
|
-
if (!text || text.trim() === "") {
|
|
275
|
-
return null;
|
|
276
|
-
}
|
|
277
|
-
return JSON.parse(text);
|
|
278
|
-
}
|
|
279
|
-
function processSuccessResponse(response, schema) {
|
|
280
|
-
return import_effect5.Effect.tryPromise({
|
|
281
|
-
try: () => safeJson(response),
|
|
282
|
-
catch: (error) => new BigCommerceInvalidResponseError({ cause: error })
|
|
283
|
-
}).pipe(
|
|
284
|
-
import_effect5.Effect.tapError(
|
|
285
|
-
(error) => import_effect5.Effect.logError("Error parsing response from BigCommerce API", error.cause)
|
|
286
|
-
),
|
|
287
|
-
import_effect5.Effect.tryMap({
|
|
288
|
-
try: (json) => schema.parse(json),
|
|
289
|
-
catch: (error) => new BigCommerceParseResponseError({ error })
|
|
290
|
-
})
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
var processErrorResponse = (response) => {
|
|
294
|
-
const code = response.status;
|
|
295
|
-
return import_effect5.Effect.tryPromise({
|
|
296
|
-
try: () => safeJson(response),
|
|
297
|
-
catch: (error) => new BigCommerceInvalidResponseError({ cause: error })
|
|
298
|
-
}).pipe(
|
|
299
|
-
import_effect5.Effect.tapError((error) => import_effect5.Effect.logError("Error parsing error response", error.cause)),
|
|
300
|
-
import_effect5.Effect.flatMap(
|
|
301
|
-
(errorDetails) => import_effect5.Effect.fail(
|
|
302
|
-
import_effect5.Match.value(code).pipe(
|
|
303
|
-
import_effect5.Match.when(
|
|
304
|
-
BigCommerceStatusCodes.INVALID_REQUEST,
|
|
305
|
-
() => new BigCommerceInvalidRequestError({ errorDetails })
|
|
306
|
-
),
|
|
307
|
-
import_effect5.Match.when(BigCommerceStatusCodes.UNAUTHORIZED, () => new BigCommerceUnauthorizedError()),
|
|
308
|
-
import_effect5.Match.when(BigCommerceStatusCodes.FORBIDDEN, () => new BigCommerceForbiddenError()),
|
|
309
|
-
import_effect5.Match.when(BigCommerceStatusCodes.NOT_FOUND, () => new BigCommerceNotFoundError()),
|
|
310
|
-
import_effect5.Match.when(
|
|
311
|
-
BigCommerceStatusCodes.CONFLICT,
|
|
312
|
-
() => new BigCommerceConflictError({ details: errorDetails })
|
|
313
|
-
),
|
|
314
|
-
import_effect5.Match.when(
|
|
315
|
-
BigCommerceStatusCodes.UNPROCESSABLE_ENTITY,
|
|
316
|
-
() => new BigCommerceUnprocessableEntityError({ errorDetails })
|
|
317
|
-
),
|
|
318
|
-
import_effect5.Match.when(
|
|
319
|
-
(code2) => code2 >= 500,
|
|
320
|
-
() => new BigCommerceConnectionError({
|
|
321
|
-
message: `Server error: ${code}`,
|
|
322
|
-
type: code === BigCommerceStatusCodes.INTERNAL_SERVER_ERROR ? "internalError" : code === BigCommerceStatusCodes.BAD_GATEWAY || code === BigCommerceStatusCodes.GATEWAY_TIMEOUT ? "timeout" : "internalError"
|
|
323
|
-
})
|
|
324
|
-
),
|
|
325
|
-
import_effect5.Match.orElse(() => new BigCommerceUnknownError({ cause: errorDetails }))
|
|
326
|
-
)
|
|
327
|
-
)
|
|
328
|
-
)
|
|
329
|
-
);
|
|
330
|
-
};
|
|
331
|
-
var transformResponse = (response, schema) => {
|
|
332
|
-
if (response.ok) {
|
|
333
|
-
return processSuccessResponse(response, schema);
|
|
334
|
-
}
|
|
335
|
-
return processErrorResponse(response);
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
// src/bigcommerce-entities/payments/schemas/payment-methods.schema.ts
|
|
339
|
-
var z = __toESM(require("zod"));
|
|
340
|
-
var PaymentMethodSchema = z.object({
|
|
341
|
-
id: z.number(),
|
|
342
|
-
paymentCode: z.string(),
|
|
343
|
-
paymentTitle: z.string()
|
|
344
|
-
});
|
|
345
|
-
var GetPaymentMethodsResponseSchema = z.object({
|
|
346
|
-
data: PaymentMethodSchema.array()
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
// src/bigcommerce-entities/payments/payment-methods.ts
|
|
350
|
-
var getPaymentMethods = () => import_effect6.Effect.gen(function* () {
|
|
351
|
-
const fetcher = yield* BigCommerceFetcher;
|
|
352
|
-
return yield* import_effect6.Effect.retry(
|
|
353
|
-
fetcher.fetch({
|
|
354
|
-
isB2B: true,
|
|
355
|
-
method: "GET",
|
|
356
|
-
query: (0, import_node_querystring.stringify)({
|
|
357
|
-
limit: 250
|
|
358
|
-
}),
|
|
359
|
-
path: "payments",
|
|
360
|
-
resultSchema: GetPaymentMethodsResponseSchema,
|
|
361
|
-
version: "v3"
|
|
362
|
-
}),
|
|
363
|
-
DEFAULTS.retry.policy
|
|
364
|
-
);
|
|
365
|
-
});
|
|
366
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
367
|
-
0 && (module.exports = {
|
|
368
|
-
GetPaymentMethodsResponseSchema,
|
|
369
|
-
PaymentMethodSchema,
|
|
370
|
-
getPaymentMethods
|
|
371
|
-
});
|
|
372
|
-
//# sourceMappingURL=payments.js.map
|
package/dist/payments.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bigcommerce-entities/payments/index.ts","../src/bigcommerce-entities/payments/payment-methods.ts","../src/constants.ts","../src/core/bigcommerce.error.ts","../src/core/bigcommerce.fetcher.ts","../src/core/bigcommerce.fetcher.live.ts","../src/core/config.ts","../src/bigcommerce-entities/payments/schemas/payment-methods.schema.ts"],"sourcesContent":["export * from './payment-methods';\nexport * from './schemas';\n","import { Effect } from 'effect';\nimport { stringify } from 'node:querystring';\nimport { DEFAULTS } from '../../constants';\nimport { BigCommerceFetcher } from '../../core';\nimport { GetPaymentMethodsResponseSchema } from './schemas/payment-methods.schema';\nexport const getPaymentMethods = () =>\n Effect.gen(function* () {\n const fetcher = yield* BigCommerceFetcher;\n return yield* Effect.retry(\n fetcher.fetch({\n isB2B: true,\n method: 'GET',\n query: stringify({\n limit: 250,\n }),\n path: 'payments',\n resultSchema: GetPaymentMethodsResponseSchema,\n version: 'v3',\n }),\n DEFAULTS.retry.policy,\n );\n });\n","import { Duration, Schedule } from 'effect';\n\nexport const DEFAULTS = {\n retry: {\n policy: Schedule.exponential(Duration.millis(200), 2).pipe(\n Schedule.intersect(Schedule.recurs(3)),\n ),\n },\n timeout: {\n ms: 30000,\n },\n bigcommerceUrls: {\n b2b: 'https://api-b2b.bigcommerce.com/api',\n regular: 'https://api.bigcommerce.com/stores',\n },\n customers: {\n getBatchSize: 250,\n },\n salesStaff: {\n getBatchSize: 250,\n },\n companies: {\n salesStaffAssignments: {\n assignBatchSize: 10,\n concurrency: 2,\n },\n extraFields: {\n getBatchSize: 250,\n },\n roles: {\n getBatchSize: 250,\n },\n },\n products: {\n updateBatchSize: 5,\n updateConcurrency: 2,\n inventory: {\n updateBatchSize: 2000,\n updateConcurrency: 2,\n },\n },\n orders: {\n getAllBatchSize: 250,\n shippingAddresses: {\n getAllBatchSize: 250,\n },\n products: {\n getAllBatchSize: 250,\n },\n },\n priceLists: {\n getAllBatchSize: 250,\n },\n} as const;\n","import { Data } from 'effect';\nimport * as z from 'zod';\nexport class BigCommerceUnprocessableEntityError extends Data.TaggedError(\n 'BigCommerceUnprocessableEntityError',\n)<{\n readonly errorDetails: unknown;\n}> {}\n\nexport class BigCommerceUnauthorizedError extends Data.TaggedError(\n 'BigCommerceUnauthorizedError',\n) {}\n\nexport class BigCommerceForbiddenError extends Data.TaggedError('BigCommerceForbiddenError') {}\n\nexport class BigCommerceNotFoundError extends Data.TaggedError('BigCommerceNotFoundError') {}\n\nexport class BigCommerceConflictError extends Data.TaggedError('BigCommerceConflictError')<{\n readonly details: unknown;\n}> {}\n\nexport class BigCommerceConnectionError extends Data.TaggedError('BigCommerceConnectionError')<{\n readonly message: string;\n readonly type: 'timeout' | 'internalError' | 'unknown';\n}> {}\n\nexport class BigCommerceUnknownError extends Data.TaggedError('BigCommerceUnknownError')<{\n cause: unknown;\n}> {}\n\nexport class BigCommerceInvalidResponseError extends Data.TaggedError(\n 'BigCommerceInvalidResponseError',\n)<{\n cause: unknown;\n}> {}\n\nexport class BigCommerceInvalidRequestError extends Data.TaggedError(\n 'BigCommerceInvalidRequestError',\n)<{\n readonly errorDetails: unknown;\n}> {}\n\nexport class BigCommerceParseResponseError extends Data.TaggedError(\n 'BigCommerceParseResponseError',\n)<{\n readonly error: z.ZodError;\n}> {}\n\nexport type SomeBigCommerceError =\n | BigCommerceUnprocessableEntityError\n | BigCommerceUnauthorizedError\n | BigCommerceForbiddenError\n | BigCommerceNotFoundError\n | BigCommerceConflictError\n | BigCommerceConnectionError\n | BigCommerceUnknownError\n | BigCommerceInvalidResponseError\n | BigCommerceInvalidRequestError\n | BigCommerceParseResponseError;\n","import { Context, Effect } from 'effect';\nimport * as z from 'zod';\nimport { type SomeBigCommerceError } from './bigcommerce.error';\nexport type BigCommerceFetchMethods = 'GET' | 'POST' | 'PUT' | 'DELETE';\nexport interface BigCommerceFetchParams<\n // Always send json for now, maybe later send a Blob\n Body extends Record<string, unknown> | Array<Record<string, unknown>>,\n Query extends Record<string, string> | string,\n Result extends z.ZodType,\n> {\n readonly body?: Body;\n readonly query?: Query;\n readonly method: BigCommerceFetchMethods;\n readonly path: string;\n readonly headers?: Record<string, string>;\n readonly isB2B: boolean;\n readonly version: 'v3' | 'v2';\n readonly resultSchema: Result;\n}\n\nexport class BigCommerceFetcher extends Context.Tag('BigCommerceFetcher')<\n BigCommerceFetcher,\n {\n readonly fetch: <\n Body extends Record<string, unknown> | Array<Record<string, unknown>>,\n Query extends Record<string, string> | string,\n Result extends z.ZodType,\n >(\n params: BigCommerceFetchParams<Body, Query, Result>,\n ) => Effect.Effect<z.output<Result>, SomeBigCommerceError>;\n }\n>() {}\n","import { Effect, Layer, Match } from 'effect';\nimport * as z from 'zod';\nimport { DEFAULTS } from '../constants';\nimport {\n BigCommerceConflictError,\n BigCommerceConnectionError,\n BigCommerceForbiddenError,\n BigCommerceInvalidRequestError,\n BigCommerceInvalidResponseError,\n BigCommerceNotFoundError,\n BigCommerceParseResponseError,\n BigCommerceUnauthorizedError,\n BigCommerceUnknownError,\n BigCommerceUnprocessableEntityError,\n type SomeBigCommerceError,\n} from './bigcommerce.error';\nimport { BigCommerceFetcher } from './bigcommerce.fetcher';\nimport { BigCommerceConfig, type NoBigCommerceConfigError } from './config';\nconst BigCommerceStatusCodes = {\n UNAUTHORIZED: 401,\n CONFLICT: 409,\n FORBIDDEN: 403,\n NOT_FOUND: 404,\n UNPROCESSABLE_ENTITY: 422,\n INTERNAL_SERVER_ERROR: 500,\n BAD_GATEWAY: 502,\n SERVICE_UNAVAILABLE: 503,\n GATEWAY_TIMEOUT: 504,\n INVALID_REQUEST: 400,\n} as const;\n\nexport const BigCommerceFetcherLive: Layer.Layer<\n BigCommerceFetcher,\n NoBigCommerceConfigError,\n BigCommerceConfig\n> = Layer.effect(\n BigCommerceFetcher,\n Effect.gen(function* () {\n const config = yield* BigCommerceConfig;\n const storeHash = yield* config.getStoreHash;\n const accessToken = yield* config.getAccessToken;\n const timeout = yield* config.getTimeout;\n\n return {\n fetch: (params) => {\n const base = getBase(params);\n const headers: Record<string, string> = {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'x-auth-token': accessToken,\n };\n\n if (params.isB2B) {\n headers['x-store-hash'] = storeHash;\n }\n const url = applyParams(base.replace('[storeHash]', storeHash), params.query);\n\n return Effect.tryPromise({\n try: () =>\n fetch(url, {\n headers,\n signal: AbortSignal.timeout(timeout),\n method: params.method,\n ...(params.body && { body: JSON.stringify(params.body) }),\n }),\n catch: (error) => {\n if (error instanceof Error && error.name === 'TimeoutError') {\n return new BigCommerceConnectionError({\n message: `Request timeout after ${timeout}ms`,\n type: 'timeout',\n });\n }\n if (error instanceof Error && error.name === 'AbortError') {\n return new BigCommerceConnectionError({\n message: `Request timeout after ${timeout}ms`,\n type: 'timeout',\n });\n }\n return new BigCommerceUnknownError({ cause: error });\n },\n }).pipe(\n Effect.tapError((error) =>\n Effect.logError('Failed to fetch from BigCommerce API', error.cause),\n ),\n Effect.flatMap((response) => transformResponse(response, params.resultSchema)),\n );\n },\n };\n }),\n);\nconst applyParams = (url: string, params?: Record<string, string | number> | string): URL => {\n const base = new URL(url);\n if (!params) {\n return base;\n }\n if (typeof params === 'string') {\n base.search = params;\n } else {\n for (const [key, value] of Object.entries(params)) {\n base.searchParams.append(key, `${value}`);\n }\n }\n return base;\n};\n\nconst getBase = ({\n isB2B,\n path,\n version,\n}: {\n isB2B: boolean;\n path: string;\n version: 'v3' | 'v2';\n}): string => {\n if (isB2B) {\n return `${DEFAULTS.bigcommerceUrls.b2b}/${version}/io/${path}`;\n }\n return `${DEFAULTS.bigcommerceUrls.regular}/[storeHash]/${version}/${path}`;\n};\n\nasync function safeJson<T>(response: Response): Promise<T | null> {\n const text = await response.text();\n\n if (!text || text.trim() === '') {\n return null;\n }\n\n return JSON.parse(text) as T;\n}\n\nfunction processSuccessResponse<Schema extends z.ZodTypeAny>(response: Response, schema: Schema) {\n return Effect.tryPromise({\n try: () => safeJson(response),\n catch: (error) => new BigCommerceInvalidResponseError({ cause: error }),\n }).pipe(\n Effect.tapError((error) =>\n Effect.logError('Error parsing response from BigCommerce API', error.cause),\n ),\n Effect.tryMap({\n try: (json) => schema.parse(json),\n catch: (error) => new BigCommerceParseResponseError({ error: error as z.ZodError }),\n }),\n );\n}\nconst processErrorResponse = (response: Response) => {\n const code = response.status;\n return Effect.tryPromise({\n try: () => safeJson(response),\n catch: (error) => new BigCommerceInvalidResponseError({ cause: error }),\n }).pipe(\n Effect.tapError((error) => Effect.logError('Error parsing error response', error.cause)),\n Effect.flatMap((errorDetails) =>\n Effect.fail(\n Match.value(code).pipe(\n Match.when(\n BigCommerceStatusCodes.INVALID_REQUEST,\n () => new BigCommerceInvalidRequestError({ errorDetails }),\n ),\n Match.when(BigCommerceStatusCodes.UNAUTHORIZED, () => new BigCommerceUnauthorizedError()),\n Match.when(BigCommerceStatusCodes.FORBIDDEN, () => new BigCommerceForbiddenError()),\n Match.when(BigCommerceStatusCodes.NOT_FOUND, () => new BigCommerceNotFoundError()),\n Match.when(\n BigCommerceStatusCodes.CONFLICT,\n () => new BigCommerceConflictError({ details: errorDetails }),\n ),\n Match.when(\n BigCommerceStatusCodes.UNPROCESSABLE_ENTITY,\n () => new BigCommerceUnprocessableEntityError({ errorDetails }),\n ),\n Match.when(\n (code) => code >= 500,\n () =>\n new BigCommerceConnectionError({\n message: `Server error: ${code}`,\n type:\n code === BigCommerceStatusCodes.INTERNAL_SERVER_ERROR\n ? 'internalError'\n : code === BigCommerceStatusCodes.BAD_GATEWAY ||\n code === BigCommerceStatusCodes.GATEWAY_TIMEOUT\n ? 'timeout'\n : 'internalError',\n }),\n ),\n Match.orElse(() => new BigCommerceUnknownError({ cause: errorDetails })),\n ),\n ),\n ),\n );\n};\n\nconst transformResponse = <Schema extends z.ZodType>(\n response: Response,\n schema: Schema,\n): Effect.Effect<z.output<Schema>, SomeBigCommerceError> => {\n if (response.ok) {\n return processSuccessResponse(response, schema);\n }\n return processErrorResponse(response);\n};\n\n// type PendingErrors = Exclude<\n// SomeBigCommerceError,\n// Effect.Effect.Error<ReturnType<typeof processErrorResponse>> | BigCommerceParseResponseError\n// >;\n","import { Config, Context, Data, Effect, Layer } from 'effect';\nimport { DEFAULTS } from '../constants';\n\n// Define a custom error type using Data.TaggedError\nexport class NoBigCommerceConfigError extends Data.TaggedError('NoBigCommerceConfigError')<{\n readonly key: string;\n}> {}\n\nexport class BigCommerceConfig extends Context.Tag('BigCommerceConfig')<\n BigCommerceConfig,\n {\n readonly getStoreHash: Effect.Effect<string, NoBigCommerceConfigError>;\n readonly getClientId: Effect.Effect<string, NoBigCommerceConfigError>;\n readonly getClientSecret: Effect.Effect<string, NoBigCommerceConfigError>;\n readonly getAccessToken: Effect.Effect<string, NoBigCommerceConfigError>;\n readonly getTimeout: Effect.Effect<number, NoBigCommerceConfigError>;\n }\n>() {}\n\nconst getBigCommerceConfig = (key: string) => {\n return Config.nested(Config.string(key), 'BIGCOMMERCE').pipe(\n Effect.mapError(() => new NoBigCommerceConfigError({ key })),\n );\n};\n\nconst getBigCommerceTimeout = () => {\n return Config.nested(Config.number('TIMEOUT'), 'BIGCOMMERCE').pipe(\n Effect.mapError(() => new NoBigCommerceConfigError({ key: 'TIMEOUT' })),\n // Default to 30 seconds if not configured\n Effect.orElse(() => Effect.succeed(DEFAULTS.timeout.ms)),\n );\n};\n\nexport const BigCommerceConfigLive = Layer.effect(\n BigCommerceConfig,\n Effect.gen(function* () {\n const [storeHash, clientId, clientSecret, accessToken, timeout] = yield* Effect.all([\n getBigCommerceConfig('STORE_HASH'),\n getBigCommerceConfig('CLIENT_ID'),\n getBigCommerceConfig('CLIENT_SECRET'),\n getBigCommerceConfig('ACCESS_TOKEN'),\n getBigCommerceTimeout(),\n ]);\n\n return {\n getStoreHash: Effect.succeed(storeHash),\n getClientId: Effect.succeed(clientId),\n getClientSecret: Effect.succeed(clientSecret),\n getAccessToken: Effect.succeed(accessToken),\n getTimeout: Effect.succeed(timeout),\n };\n }),\n);\n\nexport const BigCommerceConfigTest = Layer.succeed(BigCommerceConfig, {\n getAccessToken: Effect.succeed('test'),\n getClientId: Effect.succeed('test'),\n getClientSecret: Effect.succeed('test'),\n getStoreHash: Effect.succeed('test'),\n getTimeout: Effect.succeed(DEFAULTS.timeout.ms),\n});\n\nexport const validateBigCommerceConfig = () =>\n Effect.gen(function* () {\n const config = yield* BigCommerceConfig;\n const [storeHash, clientId, clientSecret, accessToken, timeout] = yield* Effect.all([\n config.getStoreHash,\n config.getClientId,\n config.getClientSecret,\n config.getAccessToken,\n config.getTimeout,\n ]);\n\n return {\n storeHash,\n clientId,\n clientSecret,\n accessToken,\n timeout,\n };\n });\n","import * as z from 'zod';\nexport const PaymentMethodSchema = z.object({\n id: z.number(),\n paymentCode: z.string(),\n paymentTitle: z.string(),\n});\nexport const GetPaymentMethodsResponseSchema = z.object({\n data: PaymentMethodSchema.array(),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,iBAAuB;AACvB,8BAA0B;;;ACD1B,oBAAmC;AAE5B,IAAM,WAAW;AAAA,EACtB,OAAO;AAAA,IACL,QAAQ,uBAAS,YAAY,uBAAS,OAAO,GAAG,GAAG,CAAC,EAAE;AAAA,MACpD,uBAAS,UAAU,uBAAS,OAAO,CAAC,CAAC;AAAA,IACvC;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,IAAI;AAAA,EACN;AAAA,EACA,iBAAiB;AAAA,IACf,KAAK;AAAA,IACL,SAAS;AAAA,EACX;AAAA,EACA,WAAW;AAAA,IACT,cAAc;AAAA,EAChB;AAAA,EACA,YAAY;AAAA,IACV,cAAc;AAAA,EAChB;AAAA,EACA,WAAW;AAAA,IACT,uBAAuB;AAAA,MACrB,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,IACA,aAAa;AAAA,MACX,cAAc;AAAA,IAChB;AAAA,IACA,OAAO;AAAA,MACL,cAAc;AAAA,IAChB;AAAA,EACF;AAAA,EACA,UAAU;AAAA,IACR,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,WAAW;AAAA,MACT,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,IACrB;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,MACjB,iBAAiB;AAAA,IACnB;AAAA,IACA,UAAU;AAAA,MACR,iBAAiB;AAAA,IACnB;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,iBAAiB;AAAA,EACnB;AACF;;;ACrDA,IAAAC,iBAAqB;AAEd,IAAM,sCAAN,cAAkD,oBAAK;AAA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AACf,WAAO,uBAAuB,UAAU,MAAM;AAAA,EAChD;AACA,SAAO,qBAAqB,QAAQ;AACtC;;;AEtMA,QAAmB;AACZ,IAAM,sBAAwB,SAAO;AAAA,EAC1C,IAAM,SAAO;AAAA,EACb,aAAe,SAAO;AAAA,EACtB,cAAgB,SAAO;AACzB,CAAC;AACM,IAAM,kCAAoC,SAAO;AAAA,EACtD,MAAM,oBAAoB,MAAM;AAClC,CAAC;;;ANHM,IAAM,oBAAoB,MAC/B,sBAAO,IAAI,aAAa;AACtB,QAAM,UAAU,OAAO;AACvB,SAAO,OAAO,sBAAO;AAAA,IACnB,QAAQ,MAAM;AAAA,MACZ,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAO,mCAAU;AAAA,QACf,OAAO;AAAA,MACT,CAAC;AAAA,MACD,MAAM;AAAA,MACN,cAAc;AAAA,MACd,SAAS;AAAA,IACX,CAAC;AAAA,IACD,SAAS,MAAM;AAAA,EACjB;AACF,CAAC;","names":["import_effect","import_effect","import_effect","import_effect","import_effect","code"]}
|
package/dist/payments.mjs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BigCommerceFetcher,
|
|
3
|
-
DEFAULTS
|
|
4
|
-
} from "./chunk-V2WZ3SDN.mjs";
|
|
5
|
-
|
|
6
|
-
// src/bigcommerce-entities/payments/payment-methods.ts
|
|
7
|
-
import { Effect } from "effect";
|
|
8
|
-
import { stringify } from "querystring";
|
|
9
|
-
|
|
10
|
-
// src/bigcommerce-entities/payments/schemas/payment-methods.schema.ts
|
|
11
|
-
import * as z from "zod";
|
|
12
|
-
var PaymentMethodSchema = z.object({
|
|
13
|
-
id: z.number(),
|
|
14
|
-
paymentCode: z.string(),
|
|
15
|
-
paymentTitle: z.string()
|
|
16
|
-
});
|
|
17
|
-
var GetPaymentMethodsResponseSchema = z.object({
|
|
18
|
-
data: PaymentMethodSchema.array()
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// src/bigcommerce-entities/payments/payment-methods.ts
|
|
22
|
-
var getPaymentMethods = () => Effect.gen(function* () {
|
|
23
|
-
const fetcher = yield* BigCommerceFetcher;
|
|
24
|
-
return yield* Effect.retry(
|
|
25
|
-
fetcher.fetch({
|
|
26
|
-
isB2B: true,
|
|
27
|
-
method: "GET",
|
|
28
|
-
query: stringify({
|
|
29
|
-
limit: 250
|
|
30
|
-
}),
|
|
31
|
-
path: "payments",
|
|
32
|
-
resultSchema: GetPaymentMethodsResponseSchema,
|
|
33
|
-
version: "v3"
|
|
34
|
-
}),
|
|
35
|
-
DEFAULTS.retry.policy
|
|
36
|
-
);
|
|
37
|
-
});
|
|
38
|
-
export {
|
|
39
|
-
GetPaymentMethodsResponseSchema,
|
|
40
|
-
PaymentMethodSchema,
|
|
41
|
-
getPaymentMethods
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=payments.mjs.map
|
package/dist/payments.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bigcommerce-entities/payments/payment-methods.ts","../src/bigcommerce-entities/payments/schemas/payment-methods.schema.ts"],"sourcesContent":["import { Effect } from 'effect';\nimport { stringify } from 'node:querystring';\nimport { DEFAULTS } from '../../constants';\nimport { BigCommerceFetcher } from '../../core';\nimport { GetPaymentMethodsResponseSchema } from './schemas/payment-methods.schema';\nexport const getPaymentMethods = () =>\n Effect.gen(function* () {\n const fetcher = yield* BigCommerceFetcher;\n return yield* Effect.retry(\n fetcher.fetch({\n isB2B: true,\n method: 'GET',\n query: stringify({\n limit: 250,\n }),\n path: 'payments',\n resultSchema: GetPaymentMethodsResponseSchema,\n version: 'v3',\n }),\n DEFAULTS.retry.policy,\n );\n });\n","import * as z from 'zod';\nexport const PaymentMethodSchema = z.object({\n id: z.number(),\n paymentCode: z.string(),\n paymentTitle: z.string(),\n});\nexport const GetPaymentMethodsResponseSchema = z.object({\n data: PaymentMethodSchema.array(),\n});\n"],"mappings":";;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,iBAAiB;;;ACD1B,YAAY,OAAO;AACZ,IAAM,sBAAwB,SAAO;AAAA,EAC1C,IAAM,SAAO;AAAA,EACb,aAAe,SAAO;AAAA,EACtB,cAAgB,SAAO;AACzB,CAAC;AACM,IAAM,kCAAoC,SAAO;AAAA,EACtD,MAAM,oBAAoB,MAAM;AAClC,CAAC;;;ADHM,IAAM,oBAAoB,MAC/B,OAAO,IAAI,aAAa;AACtB,QAAM,UAAU,OAAO;AACvB,SAAO,OAAO,OAAO;AAAA,IACnB,QAAQ,MAAM;AAAA,MACZ,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO,UAAU;AAAA,QACf,OAAO;AAAA,MACT,CAAC;AAAA,MACD,MAAM;AAAA,MACN,cAAc;AAAA,MACd,SAAS;AAAA,IACX,CAAC;AAAA,IACD,SAAS,MAAM;AAAA,EACjB;AACF,CAAC;","names":[]}
|
package/dist/priceLists.d.mts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { I as InputValidationError } from './validation.error-CHLpPYC_.mjs';
|
|
2
|
-
import { S as SomeBigCommerceError, B as BigCommerceFetcher } from './bigcommerce.fetcher-Ujztbs8P.mjs';
|
|
3
|
-
import { Effect } from 'effect';
|
|
4
|
-
import * as z from 'zod';
|
|
5
|
-
import 'effect/Cause';
|
|
6
|
-
import 'effect/Types';
|
|
7
|
-
|
|
8
|
-
declare const CreatePriceListSchema: z.ZodObject<{
|
|
9
|
-
name: z.ZodString;
|
|
10
|
-
active: z.ZodBoolean;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
declare const CreatePriceListResponseSchema: z.ZodObject<{
|
|
13
|
-
data: z.ZodObject<{
|
|
14
|
-
id: z.ZodInt;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
|
|
18
|
-
declare const createPriceList: (data: z.input<typeof CreatePriceListSchema>) => Effect.Effect<{
|
|
19
|
-
data: {
|
|
20
|
-
id: number;
|
|
21
|
-
};
|
|
22
|
-
}, SomeBigCommerceError | InputValidationError, BigCommerceFetcher>;
|
|
23
|
-
|
|
24
|
-
declare const PriceListSchema: z.ZodObject<{
|
|
25
|
-
id: z.ZodInt;
|
|
26
|
-
name: z.ZodString;
|
|
27
|
-
date_created: z.ZodString;
|
|
28
|
-
date_modified: z.ZodString;
|
|
29
|
-
active: z.ZodBoolean;
|
|
30
|
-
}, z.core.$strip>;
|
|
31
|
-
declare const GetPriceListsResponseSchema: z.ZodObject<{
|
|
32
|
-
data: z.ZodArray<z.ZodObject<{
|
|
33
|
-
id: z.ZodInt;
|
|
34
|
-
name: z.ZodString;
|
|
35
|
-
date_created: z.ZodString;
|
|
36
|
-
date_modified: z.ZodString;
|
|
37
|
-
active: z.ZodBoolean;
|
|
38
|
-
}, z.core.$strip>>;
|
|
39
|
-
meta: z.ZodObject<{
|
|
40
|
-
pagination: z.ZodObject<{
|
|
41
|
-
total: z.ZodInt;
|
|
42
|
-
count: z.ZodInt;
|
|
43
|
-
per_page: z.ZodInt;
|
|
44
|
-
current_page: z.ZodInt;
|
|
45
|
-
total_pages: z.ZodInt;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
}, z.core.$strip>;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
declare const GetPriceListsCriteriaSchema: z.ZodObject<{
|
|
50
|
-
page: z.ZodOptional<z.ZodInt>;
|
|
51
|
-
limit: z.ZodOptional<z.ZodInt>;
|
|
52
|
-
'id:in': z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodInt>, z.ZodTransform<string, number[]>>>;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
|
|
55
|
-
declare const findPriceLists: (criteria?: z.input<typeof GetPriceListsCriteriaSchema>) => Effect.Effect<{
|
|
56
|
-
data: {
|
|
57
|
-
id: number;
|
|
58
|
-
name: string;
|
|
59
|
-
date_created: string;
|
|
60
|
-
date_modified: string;
|
|
61
|
-
active: boolean;
|
|
62
|
-
}[];
|
|
63
|
-
meta: {
|
|
64
|
-
pagination: {
|
|
65
|
-
total: number;
|
|
66
|
-
count: number;
|
|
67
|
-
per_page: number;
|
|
68
|
-
current_page: number;
|
|
69
|
-
total_pages: number;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
}, SomeBigCommerceError | InputValidationError, BigCommerceFetcher>;
|
|
73
|
-
declare const getAllPriceListsBy: (criteria?: Omit<z.input<typeof GetPriceListsCriteriaSchema>, "limit" | "page">) => Effect.Effect<{
|
|
74
|
-
id: number;
|
|
75
|
-
name: string;
|
|
76
|
-
date_created: string;
|
|
77
|
-
date_modified: string;
|
|
78
|
-
active: boolean;
|
|
79
|
-
}[], SomeBigCommerceError | InputValidationError, BigCommerceFetcher>;
|
|
80
|
-
|
|
81
|
-
export { CreatePriceListResponseSchema, CreatePriceListSchema, GetPriceListsCriteriaSchema, GetPriceListsResponseSchema, PriceListSchema, createPriceList, findPriceLists, getAllPriceListsBy };
|
package/dist/priceLists.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { I as InputValidationError } from './validation.error-CHLpPYC_.js';
|
|
2
|
-
import { S as SomeBigCommerceError, B as BigCommerceFetcher } from './bigcommerce.fetcher-Ujztbs8P.js';
|
|
3
|
-
import { Effect } from 'effect';
|
|
4
|
-
import * as z from 'zod';
|
|
5
|
-
import 'effect/Cause';
|
|
6
|
-
import 'effect/Types';
|
|
7
|
-
|
|
8
|
-
declare const CreatePriceListSchema: z.ZodObject<{
|
|
9
|
-
name: z.ZodString;
|
|
10
|
-
active: z.ZodBoolean;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
declare const CreatePriceListResponseSchema: z.ZodObject<{
|
|
13
|
-
data: z.ZodObject<{
|
|
14
|
-
id: z.ZodInt;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
|
|
18
|
-
declare const createPriceList: (data: z.input<typeof CreatePriceListSchema>) => Effect.Effect<{
|
|
19
|
-
data: {
|
|
20
|
-
id: number;
|
|
21
|
-
};
|
|
22
|
-
}, SomeBigCommerceError | InputValidationError, BigCommerceFetcher>;
|
|
23
|
-
|
|
24
|
-
declare const PriceListSchema: z.ZodObject<{
|
|
25
|
-
id: z.ZodInt;
|
|
26
|
-
name: z.ZodString;
|
|
27
|
-
date_created: z.ZodString;
|
|
28
|
-
date_modified: z.ZodString;
|
|
29
|
-
active: z.ZodBoolean;
|
|
30
|
-
}, z.core.$strip>;
|
|
31
|
-
declare const GetPriceListsResponseSchema: z.ZodObject<{
|
|
32
|
-
data: z.ZodArray<z.ZodObject<{
|
|
33
|
-
id: z.ZodInt;
|
|
34
|
-
name: z.ZodString;
|
|
35
|
-
date_created: z.ZodString;
|
|
36
|
-
date_modified: z.ZodString;
|
|
37
|
-
active: z.ZodBoolean;
|
|
38
|
-
}, z.core.$strip>>;
|
|
39
|
-
meta: z.ZodObject<{
|
|
40
|
-
pagination: z.ZodObject<{
|
|
41
|
-
total: z.ZodInt;
|
|
42
|
-
count: z.ZodInt;
|
|
43
|
-
per_page: z.ZodInt;
|
|
44
|
-
current_page: z.ZodInt;
|
|
45
|
-
total_pages: z.ZodInt;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
}, z.core.$strip>;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
declare const GetPriceListsCriteriaSchema: z.ZodObject<{
|
|
50
|
-
page: z.ZodOptional<z.ZodInt>;
|
|
51
|
-
limit: z.ZodOptional<z.ZodInt>;
|
|
52
|
-
'id:in': z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodInt>, z.ZodTransform<string, number[]>>>;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
|
|
55
|
-
declare const findPriceLists: (criteria?: z.input<typeof GetPriceListsCriteriaSchema>) => Effect.Effect<{
|
|
56
|
-
data: {
|
|
57
|
-
id: number;
|
|
58
|
-
name: string;
|
|
59
|
-
date_created: string;
|
|
60
|
-
date_modified: string;
|
|
61
|
-
active: boolean;
|
|
62
|
-
}[];
|
|
63
|
-
meta: {
|
|
64
|
-
pagination: {
|
|
65
|
-
total: number;
|
|
66
|
-
count: number;
|
|
67
|
-
per_page: number;
|
|
68
|
-
current_page: number;
|
|
69
|
-
total_pages: number;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
}, SomeBigCommerceError | InputValidationError, BigCommerceFetcher>;
|
|
73
|
-
declare const getAllPriceListsBy: (criteria?: Omit<z.input<typeof GetPriceListsCriteriaSchema>, "limit" | "page">) => Effect.Effect<{
|
|
74
|
-
id: number;
|
|
75
|
-
name: string;
|
|
76
|
-
date_created: string;
|
|
77
|
-
date_modified: string;
|
|
78
|
-
active: boolean;
|
|
79
|
-
}[], SomeBigCommerceError | InputValidationError, BigCommerceFetcher>;
|
|
80
|
-
|
|
81
|
-
export { CreatePriceListResponseSchema, CreatePriceListSchema, GetPriceListsCriteriaSchema, GetPriceListsResponseSchema, PriceListSchema, createPriceList, findPriceLists, getAllPriceListsBy };
|