@edgebound/bigcommerce 0.3.1 → 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 -364
- 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 +21 -65
- 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-PAXNZ36X.mjs +0 -326
- package/dist/chunk-PAXNZ36X.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 -232
- package/dist/companies.d.ts +0 -232
- package/dist/companies.js +0 -725
- package/dist/companies.js.map +0 -1
- package/dist/companies.mjs +0 -368
- 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 -157
- package/dist/customers.d.ts +0 -157
- package/dist/customers.js +0 -581
- package/dist/customers.js.map +0 -1
- package/dist/customers.mjs +0 -233
- 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 -716
- 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 -365
- 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 -458
- 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 -463
- 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 -419
- 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 -107
- package/dist/webhooks.d.ts +0 -107
- package/dist/webhooks.js +0 -155
- package/dist/webhooks.js.map +0 -1
- package/dist/webhooks.mjs +0 -77
- package/dist/webhooks.mjs.map +0 -1
package/dist/customers.js
DELETED
|
@@ -1,581 +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/customers/index.ts
|
|
31
|
-
var customers_exports = {};
|
|
32
|
-
__export(customers_exports, {
|
|
33
|
-
CreateCustomerGroupResponseSchema: () => CreateCustomerGroupResponseSchema,
|
|
34
|
-
CreateCustomerGroupSchema: () => CreateCustomerGroupSchema,
|
|
35
|
-
CustomerGroupSchema: () => CustomerGroupSchema,
|
|
36
|
-
CustomerSchema: () => CustomerSchema,
|
|
37
|
-
FindCustomerGroupsCriteriaSchema: () => FindCustomerGroupsCriteriaSchema,
|
|
38
|
-
FindCustomerResponse: () => FindCustomerResponse,
|
|
39
|
-
FindCustomersCriteriaSchema: () => FindCustomersCriteriaSchema,
|
|
40
|
-
SetCustomerGroupPriceListResponseSchema: () => SetCustomerGroupPriceListResponseSchema,
|
|
41
|
-
SetCustomerGroupPriceListSchema: () => SetCustomerGroupPriceListSchema,
|
|
42
|
-
createCustomerGroup: () => createCustomerGroup,
|
|
43
|
-
findCustomers: () => findCustomers,
|
|
44
|
-
findCustomersGroups: () => findCustomersGroups,
|
|
45
|
-
getAllCustomerGroupsBy: () => getAllCustomerGroupsBy,
|
|
46
|
-
getAllCustomersBy: () => getAllCustomersBy,
|
|
47
|
-
getCustomer: () => getCustomer,
|
|
48
|
-
setCustomerGroupPriceList: () => setCustomerGroupPriceList
|
|
49
|
-
});
|
|
50
|
-
module.exports = __toCommonJS(customers_exports);
|
|
51
|
-
|
|
52
|
-
// src/bigcommerce-entities/customers/create-customer-group.ts
|
|
53
|
-
var import_effect8 = require("effect");
|
|
54
|
-
|
|
55
|
-
// src/constants.ts
|
|
56
|
-
var import_effect = require("effect");
|
|
57
|
-
var DEFAULTS = {
|
|
58
|
-
retry: {
|
|
59
|
-
policy: import_effect.Schedule.exponential(import_effect.Duration.millis(200), 2).pipe(
|
|
60
|
-
import_effect.Schedule.intersect(import_effect.Schedule.recurs(3))
|
|
61
|
-
)
|
|
62
|
-
},
|
|
63
|
-
timeout: {
|
|
64
|
-
ms: 3e4
|
|
65
|
-
},
|
|
66
|
-
bigcommerceUrls: {
|
|
67
|
-
b2b: "https://api-b2b.bigcommerce.com/api",
|
|
68
|
-
regular: "https://api.bigcommerce.com/stores"
|
|
69
|
-
},
|
|
70
|
-
customers: {
|
|
71
|
-
getBatchSize: 250
|
|
72
|
-
},
|
|
73
|
-
salesStaff: {
|
|
74
|
-
getBatchSize: 250
|
|
75
|
-
},
|
|
76
|
-
companies: {
|
|
77
|
-
salesStaffAssignments: {
|
|
78
|
-
assignBatchSize: 10,
|
|
79
|
-
concurrency: 2
|
|
80
|
-
},
|
|
81
|
-
extraFields: {
|
|
82
|
-
getBatchSize: 250
|
|
83
|
-
},
|
|
84
|
-
roles: {
|
|
85
|
-
getBatchSize: 250
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
products: {
|
|
89
|
-
updateBatchSize: 5,
|
|
90
|
-
updateConcurrency: 2,
|
|
91
|
-
inventory: {
|
|
92
|
-
updateBatchSize: 2e3,
|
|
93
|
-
updateConcurrency: 2
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
orders: {
|
|
97
|
-
getAllBatchSize: 250,
|
|
98
|
-
shippingAddresses: {
|
|
99
|
-
getAllBatchSize: 250
|
|
100
|
-
},
|
|
101
|
-
products: {
|
|
102
|
-
getAllBatchSize: 250
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
priceLists: {
|
|
106
|
-
getAllBatchSize: 250
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// src/core/bigcommerce.error.ts
|
|
111
|
-
var import_effect2 = require("effect");
|
|
112
|
-
var BigCommerceUnprocessableEntityError = class extends import_effect2.Data.TaggedError(
|
|
113
|
-
"BigCommerceUnprocessableEntityError"
|
|
114
|
-
) {
|
|
115
|
-
};
|
|
116
|
-
var BigCommerceUnauthorizedError = class extends import_effect2.Data.TaggedError(
|
|
117
|
-
"BigCommerceUnauthorizedError"
|
|
118
|
-
) {
|
|
119
|
-
};
|
|
120
|
-
var BigCommerceForbiddenError = class extends import_effect2.Data.TaggedError("BigCommerceForbiddenError") {
|
|
121
|
-
};
|
|
122
|
-
var BigCommerceNotFoundError = class extends import_effect2.Data.TaggedError("BigCommerceNotFoundError") {
|
|
123
|
-
};
|
|
124
|
-
var BigCommerceConflictError = class extends import_effect2.Data.TaggedError("BigCommerceConflictError") {
|
|
125
|
-
};
|
|
126
|
-
var BigCommerceConnectionError = class extends import_effect2.Data.TaggedError("BigCommerceConnectionError") {
|
|
127
|
-
};
|
|
128
|
-
var BigCommerceUnknownError = class extends import_effect2.Data.TaggedError("BigCommerceUnknownError") {
|
|
129
|
-
};
|
|
130
|
-
var BigCommerceInvalidResponseError = class extends import_effect2.Data.TaggedError(
|
|
131
|
-
"BigCommerceInvalidResponseError"
|
|
132
|
-
) {
|
|
133
|
-
};
|
|
134
|
-
var BigCommerceInvalidRequestError = class extends import_effect2.Data.TaggedError(
|
|
135
|
-
"BigCommerceInvalidRequestError"
|
|
136
|
-
) {
|
|
137
|
-
};
|
|
138
|
-
var BigCommerceParseResponseError = class extends import_effect2.Data.TaggedError(
|
|
139
|
-
"BigCommerceParseResponseError"
|
|
140
|
-
) {
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
// src/core/bigcommerce.fetcher.ts
|
|
144
|
-
var import_effect3 = require("effect");
|
|
145
|
-
var BigCommerceFetcher = class extends import_effect3.Context.Tag("BigCommerceFetcher")() {
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
// src/core/bigcommerce.fetcher.live.ts
|
|
149
|
-
var import_effect5 = require("effect");
|
|
150
|
-
|
|
151
|
-
// src/core/config.ts
|
|
152
|
-
var import_effect4 = require("effect");
|
|
153
|
-
var NoBigCommerceConfigError = class extends import_effect4.Data.TaggedError("NoBigCommerceConfigError") {
|
|
154
|
-
};
|
|
155
|
-
var BigCommerceConfig = class extends import_effect4.Context.Tag("BigCommerceConfig")() {
|
|
156
|
-
};
|
|
157
|
-
var getBigCommerceConfig = (key) => {
|
|
158
|
-
return import_effect4.Config.nested(import_effect4.Config.string(key), "BIGCOMMERCE").pipe(
|
|
159
|
-
import_effect4.Effect.mapError(() => new NoBigCommerceConfigError({ key }))
|
|
160
|
-
);
|
|
161
|
-
};
|
|
162
|
-
var getBigCommerceTimeout = () => {
|
|
163
|
-
return import_effect4.Config.nested(import_effect4.Config.number("TIMEOUT"), "BIGCOMMERCE").pipe(
|
|
164
|
-
import_effect4.Effect.mapError(() => new NoBigCommerceConfigError({ key: "TIMEOUT" })),
|
|
165
|
-
// Default to 30 seconds if not configured
|
|
166
|
-
import_effect4.Effect.orElse(() => import_effect4.Effect.succeed(DEFAULTS.timeout.ms))
|
|
167
|
-
);
|
|
168
|
-
};
|
|
169
|
-
var BigCommerceConfigLive = import_effect4.Layer.effect(
|
|
170
|
-
BigCommerceConfig,
|
|
171
|
-
import_effect4.Effect.gen(function* () {
|
|
172
|
-
const [storeHash, clientId, clientSecret, accessToken, timeout] = yield* import_effect4.Effect.all([
|
|
173
|
-
getBigCommerceConfig("STORE_HASH"),
|
|
174
|
-
getBigCommerceConfig("CLIENT_ID"),
|
|
175
|
-
getBigCommerceConfig("CLIENT_SECRET"),
|
|
176
|
-
getBigCommerceConfig("ACCESS_TOKEN"),
|
|
177
|
-
getBigCommerceTimeout()
|
|
178
|
-
]);
|
|
179
|
-
return {
|
|
180
|
-
getStoreHash: import_effect4.Effect.succeed(storeHash),
|
|
181
|
-
getClientId: import_effect4.Effect.succeed(clientId),
|
|
182
|
-
getClientSecret: import_effect4.Effect.succeed(clientSecret),
|
|
183
|
-
getAccessToken: import_effect4.Effect.succeed(accessToken),
|
|
184
|
-
getTimeout: import_effect4.Effect.succeed(timeout)
|
|
185
|
-
};
|
|
186
|
-
})
|
|
187
|
-
);
|
|
188
|
-
var BigCommerceConfigTest = import_effect4.Layer.succeed(BigCommerceConfig, {
|
|
189
|
-
getAccessToken: import_effect4.Effect.succeed("test"),
|
|
190
|
-
getClientId: import_effect4.Effect.succeed("test"),
|
|
191
|
-
getClientSecret: import_effect4.Effect.succeed("test"),
|
|
192
|
-
getStoreHash: import_effect4.Effect.succeed("test"),
|
|
193
|
-
getTimeout: import_effect4.Effect.succeed(DEFAULTS.timeout.ms)
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
// src/core/bigcommerce.fetcher.live.ts
|
|
197
|
-
var BigCommerceStatusCodes = {
|
|
198
|
-
UNAUTHORIZED: 401,
|
|
199
|
-
CONFLICT: 409,
|
|
200
|
-
FORBIDDEN: 403,
|
|
201
|
-
NOT_FOUND: 404,
|
|
202
|
-
UNPROCESSABLE_ENTITY: 422,
|
|
203
|
-
INTERNAL_SERVER_ERROR: 500,
|
|
204
|
-
BAD_GATEWAY: 502,
|
|
205
|
-
SERVICE_UNAVAILABLE: 503,
|
|
206
|
-
GATEWAY_TIMEOUT: 504,
|
|
207
|
-
INVALID_REQUEST: 400
|
|
208
|
-
};
|
|
209
|
-
var BigCommerceFetcherLive = import_effect5.Layer.effect(
|
|
210
|
-
BigCommerceFetcher,
|
|
211
|
-
import_effect5.Effect.gen(function* () {
|
|
212
|
-
const config = yield* BigCommerceConfig;
|
|
213
|
-
const storeHash = yield* config.getStoreHash;
|
|
214
|
-
const accessToken = yield* config.getAccessToken;
|
|
215
|
-
const timeout = yield* config.getTimeout;
|
|
216
|
-
return {
|
|
217
|
-
fetch: (params) => {
|
|
218
|
-
const base = getBase(params);
|
|
219
|
-
const headers = {
|
|
220
|
-
Accept: "application/json",
|
|
221
|
-
"Content-Type": "application/json",
|
|
222
|
-
"x-auth-token": accessToken
|
|
223
|
-
};
|
|
224
|
-
if (params.isB2B) {
|
|
225
|
-
headers["x-store-hash"] = storeHash;
|
|
226
|
-
}
|
|
227
|
-
const url = applyParams(base.replace("[storeHash]", storeHash), params.query);
|
|
228
|
-
return import_effect5.Effect.tryPromise({
|
|
229
|
-
try: () => fetch(url, {
|
|
230
|
-
headers,
|
|
231
|
-
signal: AbortSignal.timeout(timeout),
|
|
232
|
-
method: params.method,
|
|
233
|
-
...params.body && { body: JSON.stringify(params.body) }
|
|
234
|
-
}),
|
|
235
|
-
catch: (error) => {
|
|
236
|
-
if (error instanceof Error && error.name === "TimeoutError") {
|
|
237
|
-
return new BigCommerceConnectionError({
|
|
238
|
-
message: `Request timeout after ${timeout}ms`,
|
|
239
|
-
type: "timeout"
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
if (error instanceof Error && error.name === "AbortError") {
|
|
243
|
-
return new BigCommerceConnectionError({
|
|
244
|
-
message: `Request timeout after ${timeout}ms`,
|
|
245
|
-
type: "timeout"
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
return new BigCommerceUnknownError({ cause: error });
|
|
249
|
-
}
|
|
250
|
-
}).pipe(
|
|
251
|
-
import_effect5.Effect.tapError(
|
|
252
|
-
(error) => import_effect5.Effect.logError("Failed to fetch from BigCommerce API", error.cause)
|
|
253
|
-
),
|
|
254
|
-
import_effect5.Effect.flatMap((response) => transformResponse(response, params.resultSchema))
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
})
|
|
259
|
-
);
|
|
260
|
-
var applyParams = (url, params) => {
|
|
261
|
-
const base = new URL(url);
|
|
262
|
-
if (!params) {
|
|
263
|
-
return base;
|
|
264
|
-
}
|
|
265
|
-
if (typeof params === "string") {
|
|
266
|
-
base.search = params;
|
|
267
|
-
} else {
|
|
268
|
-
for (const [key, value] of Object.entries(params)) {
|
|
269
|
-
base.searchParams.append(key, `${value}`);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return base;
|
|
273
|
-
};
|
|
274
|
-
var getBase = ({
|
|
275
|
-
isB2B,
|
|
276
|
-
path,
|
|
277
|
-
version
|
|
278
|
-
}) => {
|
|
279
|
-
if (isB2B) {
|
|
280
|
-
return `${DEFAULTS.bigcommerceUrls.b2b}/${version}/io/${path}`;
|
|
281
|
-
}
|
|
282
|
-
return `${DEFAULTS.bigcommerceUrls.regular}/[storeHash]/${version}/${path}`;
|
|
283
|
-
};
|
|
284
|
-
function processSuccessResponse(response, schema) {
|
|
285
|
-
return import_effect5.Effect.tryPromise({
|
|
286
|
-
try: () => response.json(),
|
|
287
|
-
catch: (error) => new BigCommerceInvalidResponseError({ cause: error })
|
|
288
|
-
}).pipe(
|
|
289
|
-
import_effect5.Effect.tapError(
|
|
290
|
-
(error) => import_effect5.Effect.logError("Error parsing response from BigCommerce API", error.cause)
|
|
291
|
-
),
|
|
292
|
-
import_effect5.Effect.tryMap({
|
|
293
|
-
try: (json) => schema.parse(json),
|
|
294
|
-
catch: (error) => new BigCommerceParseResponseError({ error })
|
|
295
|
-
})
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
var processErrorResponse = (response) => {
|
|
299
|
-
const code = response.status;
|
|
300
|
-
return import_effect5.Effect.tryPromise({
|
|
301
|
-
try: () => response.json(),
|
|
302
|
-
catch: (error) => new BigCommerceInvalidResponseError({ cause: error })
|
|
303
|
-
}).pipe(
|
|
304
|
-
import_effect5.Effect.tapError((error) => import_effect5.Effect.logError("Error parsing error response", error.cause)),
|
|
305
|
-
import_effect5.Effect.flatMap(
|
|
306
|
-
(errorDetails) => import_effect5.Effect.fail(
|
|
307
|
-
import_effect5.Match.value(code).pipe(
|
|
308
|
-
import_effect5.Match.when(
|
|
309
|
-
BigCommerceStatusCodes.INVALID_REQUEST,
|
|
310
|
-
() => new BigCommerceInvalidRequestError({ errorDetails })
|
|
311
|
-
),
|
|
312
|
-
import_effect5.Match.when(BigCommerceStatusCodes.UNAUTHORIZED, () => new BigCommerceUnauthorizedError()),
|
|
313
|
-
import_effect5.Match.when(BigCommerceStatusCodes.FORBIDDEN, () => new BigCommerceForbiddenError()),
|
|
314
|
-
import_effect5.Match.when(BigCommerceStatusCodes.NOT_FOUND, () => new BigCommerceNotFoundError()),
|
|
315
|
-
import_effect5.Match.when(
|
|
316
|
-
BigCommerceStatusCodes.CONFLICT,
|
|
317
|
-
() => new BigCommerceConflictError({ details: errorDetails })
|
|
318
|
-
),
|
|
319
|
-
import_effect5.Match.when(
|
|
320
|
-
BigCommerceStatusCodes.UNPROCESSABLE_ENTITY,
|
|
321
|
-
() => new BigCommerceUnprocessableEntityError({ errorDetails })
|
|
322
|
-
),
|
|
323
|
-
import_effect5.Match.when(
|
|
324
|
-
(code2) => code2 >= 500,
|
|
325
|
-
() => new BigCommerceConnectionError({
|
|
326
|
-
message: `Server error: ${code}`,
|
|
327
|
-
type: code === BigCommerceStatusCodes.INTERNAL_SERVER_ERROR ? "internalError" : code === BigCommerceStatusCodes.BAD_GATEWAY || code === BigCommerceStatusCodes.GATEWAY_TIMEOUT ? "timeout" : "internalError"
|
|
328
|
-
})
|
|
329
|
-
),
|
|
330
|
-
import_effect5.Match.orElse(() => new BigCommerceUnknownError({ cause: errorDetails }))
|
|
331
|
-
)
|
|
332
|
-
)
|
|
333
|
-
)
|
|
334
|
-
);
|
|
335
|
-
};
|
|
336
|
-
var transformResponse = (response, schema) => {
|
|
337
|
-
if (response.ok) {
|
|
338
|
-
return processSuccessResponse(response, schema);
|
|
339
|
-
}
|
|
340
|
-
return processErrorResponse(response);
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
// src/validation/index.ts
|
|
344
|
-
var import_effect7 = require("effect");
|
|
345
|
-
|
|
346
|
-
// src/validation/validation.error.ts
|
|
347
|
-
var import_effect6 = require("effect");
|
|
348
|
-
var InputValidationError = class extends import_effect6.Data.TaggedError("InputValidationError") {
|
|
349
|
-
};
|
|
350
|
-
|
|
351
|
-
// src/validation/index.ts
|
|
352
|
-
var validateInput = (schema, data) => {
|
|
353
|
-
return import_effect7.Effect.try({
|
|
354
|
-
try: () => schema.parse(data),
|
|
355
|
-
catch: (error) => new InputValidationError({ input: data, error })
|
|
356
|
-
});
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
// src/bigcommerce-entities/customers/schemas/customer-group.schema.ts
|
|
360
|
-
var z = __toESM(require("zod"));
|
|
361
|
-
var CreateCustomerGroupSchema = z.object({
|
|
362
|
-
name: z.string(),
|
|
363
|
-
discount_rules: z.array(
|
|
364
|
-
z.object({
|
|
365
|
-
type: z.literal("price_list"),
|
|
366
|
-
price_list_id: z.int()
|
|
367
|
-
})
|
|
368
|
-
)
|
|
369
|
-
});
|
|
370
|
-
var CreateCustomerGroupResponseSchema = z.object({
|
|
371
|
-
id: z.int()
|
|
372
|
-
});
|
|
373
|
-
var CustomerGroupSchema = z.object({
|
|
374
|
-
id: z.int(),
|
|
375
|
-
name: z.string(),
|
|
376
|
-
is_default: z.boolean(),
|
|
377
|
-
is_group_for_guests: z.boolean()
|
|
378
|
-
});
|
|
379
|
-
var FindCustomerGroupsCriteriaSchema = z.object({
|
|
380
|
-
limit: z.int().max(DEFAULTS.customers.getBatchSize).optional(),
|
|
381
|
-
page: z.int().positive().optional()
|
|
382
|
-
});
|
|
383
|
-
var SetCustomerGroupPriceListSchema = z.object({
|
|
384
|
-
data: z.object({
|
|
385
|
-
discount_rules: z.object({
|
|
386
|
-
type: z.literal("price_list"),
|
|
387
|
-
price_list_id: z.int()
|
|
388
|
-
}).array()
|
|
389
|
-
}),
|
|
390
|
-
customerGroupId: z.int()
|
|
391
|
-
});
|
|
392
|
-
var SetCustomerGroupPriceListResponseSchema = z.object({
|
|
393
|
-
id: z.int(),
|
|
394
|
-
name: z.string()
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
// src/bigcommerce-entities/customers/create-customer-group.ts
|
|
398
|
-
var createCustomerGroup = (data) => import_effect8.Effect.gen(function* () {
|
|
399
|
-
const fetcher = yield* BigCommerceFetcher;
|
|
400
|
-
const validatedBody = yield* validateInput(CreateCustomerGroupSchema, data);
|
|
401
|
-
return yield* import_effect8.Effect.retry(
|
|
402
|
-
fetcher.fetch({
|
|
403
|
-
body: validatedBody,
|
|
404
|
-
isB2B: false,
|
|
405
|
-
method: "POST",
|
|
406
|
-
path: "customer_groups",
|
|
407
|
-
resultSchema: CreateCustomerGroupResponseSchema,
|
|
408
|
-
version: "v2"
|
|
409
|
-
}),
|
|
410
|
-
DEFAULTS.retry.policy
|
|
411
|
-
);
|
|
412
|
-
});
|
|
413
|
-
|
|
414
|
-
// src/bigcommerce-entities/customers/find-customers.ts
|
|
415
|
-
var import_effect9 = require("effect");
|
|
416
|
-
var import_node_querystring = require("querystring");
|
|
417
|
-
|
|
418
|
-
// src/bigcommerce-entities/customers/schemas/customer.schema.ts
|
|
419
|
-
var z2 = __toESM(require("zod"));
|
|
420
|
-
var CustomerSchema = z2.object({
|
|
421
|
-
email: z2.email(),
|
|
422
|
-
first_name: z2.string(),
|
|
423
|
-
last_name: z2.string(),
|
|
424
|
-
company: z2.string().optional(),
|
|
425
|
-
phone: z2.string(),
|
|
426
|
-
customer_group_id: z2.int(),
|
|
427
|
-
id: z2.int(),
|
|
428
|
-
channel_ids: z2.array(z2.int())
|
|
429
|
-
});
|
|
430
|
-
var FindCustomerResponse = z2.object({
|
|
431
|
-
data: z2.array(CustomerSchema),
|
|
432
|
-
meta: z2.object({
|
|
433
|
-
pagination: z2.object({
|
|
434
|
-
total: z2.int(),
|
|
435
|
-
count: z2.int(),
|
|
436
|
-
per_page: z2.int(),
|
|
437
|
-
current_page: z2.int(),
|
|
438
|
-
total_pages: z2.int(),
|
|
439
|
-
links: z2.object({
|
|
440
|
-
previous: z2.string().optional().nullable(),
|
|
441
|
-
current: z2.string(),
|
|
442
|
-
next: z2.string().optional().nullable()
|
|
443
|
-
})
|
|
444
|
-
})
|
|
445
|
-
})
|
|
446
|
-
});
|
|
447
|
-
|
|
448
|
-
// src/bigcommerce-entities/customers/schemas/find-customer.criteria.ts
|
|
449
|
-
var z3 = __toESM(require("zod"));
|
|
450
|
-
var FindCustomersCriteriaSchema = z3.object({
|
|
451
|
-
"id:in": z3.array(z3.int()).transform((ids) => ids.join(",")).optional(),
|
|
452
|
-
page: z3.int().optional(),
|
|
453
|
-
limit: z3.int().optional(),
|
|
454
|
-
"company:in": z3.array(z3.string()).transform((companies) => companies.join(",")).optional(),
|
|
455
|
-
"customer_group_id:in": z3.array(z3.int()).transform((ids) => ids.join(",")).optional()
|
|
456
|
-
});
|
|
457
|
-
|
|
458
|
-
// src/bigcommerce-entities/customers/find-customers.ts
|
|
459
|
-
var findCustomers = (criteria) => {
|
|
460
|
-
return import_effect9.Effect.gen(function* () {
|
|
461
|
-
const fetcher = yield* BigCommerceFetcher;
|
|
462
|
-
const validatedQuery = yield* validateInput(FindCustomersCriteriaSchema, criteria ?? {});
|
|
463
|
-
return yield* fetcher.fetch({
|
|
464
|
-
method: "GET",
|
|
465
|
-
path: `customers`,
|
|
466
|
-
isB2B: false,
|
|
467
|
-
version: "v3",
|
|
468
|
-
resultSchema: FindCustomerResponse,
|
|
469
|
-
query: (0, import_node_querystring.stringify)(validatedQuery)
|
|
470
|
-
});
|
|
471
|
-
});
|
|
472
|
-
};
|
|
473
|
-
var getAllCustomersBy = (criteria) => {
|
|
474
|
-
return import_effect9.Effect.gen(function* () {
|
|
475
|
-
const allCustomers = [];
|
|
476
|
-
let page = 1;
|
|
477
|
-
let hasMoreCustomers = true;
|
|
478
|
-
while (hasMoreCustomers) {
|
|
479
|
-
const customers = yield* findCustomers({
|
|
480
|
-
...criteria,
|
|
481
|
-
page,
|
|
482
|
-
limit: DEFAULTS.customers.getBatchSize
|
|
483
|
-
});
|
|
484
|
-
if (customers.meta.pagination.links.next) {
|
|
485
|
-
allCustomers.push(...customers.data);
|
|
486
|
-
page++;
|
|
487
|
-
} else {
|
|
488
|
-
hasMoreCustomers = false;
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
return allCustomers;
|
|
492
|
-
});
|
|
493
|
-
};
|
|
494
|
-
|
|
495
|
-
// src/bigcommerce-entities/customers/get-all-customer-groups.ts
|
|
496
|
-
var import_effect10 = require("effect");
|
|
497
|
-
var import_node_querystring2 = require("querystring");
|
|
498
|
-
var z4 = __toESM(require("zod"));
|
|
499
|
-
var FindCustomerResponse2 = z4.union([
|
|
500
|
-
z4.array(CustomerGroupSchema),
|
|
501
|
-
z4.literal(""),
|
|
502
|
-
z4.literal(null)
|
|
503
|
-
]);
|
|
504
|
-
var findCustomersGroups = (criteria) => import_effect10.Effect.gen(function* () {
|
|
505
|
-
const fetcher = yield* BigCommerceFetcher;
|
|
506
|
-
const validatedQuery = yield* validateInput(FindCustomerGroupsCriteriaSchema, criteria ?? {});
|
|
507
|
-
const response = yield* fetcher.fetch({
|
|
508
|
-
method: "GET",
|
|
509
|
-
path: `customers`,
|
|
510
|
-
isB2B: false,
|
|
511
|
-
version: "v3",
|
|
512
|
-
resultSchema: FindCustomerResponse2,
|
|
513
|
-
query: (0, import_node_querystring2.stringify)(validatedQuery)
|
|
514
|
-
});
|
|
515
|
-
return response || [];
|
|
516
|
-
});
|
|
517
|
-
var getAllCustomerGroupsBy = (criteria) => import_effect10.Effect.gen(function* () {
|
|
518
|
-
const all = [];
|
|
519
|
-
let page = 1;
|
|
520
|
-
let hasMore = true;
|
|
521
|
-
while (hasMore) {
|
|
522
|
-
const groups = yield* findCustomersGroups({
|
|
523
|
-
...criteria,
|
|
524
|
-
page,
|
|
525
|
-
limit: DEFAULTS.customers.getBatchSize
|
|
526
|
-
});
|
|
527
|
-
if (groups.length) {
|
|
528
|
-
all.push(...groups);
|
|
529
|
-
page++;
|
|
530
|
-
} else {
|
|
531
|
-
hasMore = false;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
return all;
|
|
535
|
-
});
|
|
536
|
-
|
|
537
|
-
// src/bigcommerce-entities/customers/get-customer.ts
|
|
538
|
-
var import_effect11 = require("effect");
|
|
539
|
-
var getCustomer = (customerId) => {
|
|
540
|
-
return findCustomers({
|
|
541
|
-
"id:in": [customerId]
|
|
542
|
-
}).pipe(import_effect11.Effect.map((response) => response.data[0]));
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
// src/bigcommerce-entities/customers/set-customer-group-price-list.ts
|
|
546
|
-
var import_effect12 = require("effect");
|
|
547
|
-
var setCustomerGroupPriceList = (input) => import_effect12.Effect.gen(function* () {
|
|
548
|
-
const { customerGroupId, data } = yield* validateInput(SetCustomerGroupPriceListSchema, input);
|
|
549
|
-
const fetcher = yield* BigCommerceFetcher;
|
|
550
|
-
return yield* import_effect12.Effect.retry(
|
|
551
|
-
fetcher.fetch({
|
|
552
|
-
body: data,
|
|
553
|
-
isB2B: false,
|
|
554
|
-
method: "PUT",
|
|
555
|
-
path: `customer_groups/${customerGroupId}`,
|
|
556
|
-
resultSchema: SetCustomerGroupPriceListResponseSchema,
|
|
557
|
-
version: "v2"
|
|
558
|
-
}),
|
|
559
|
-
DEFAULTS.retry.policy
|
|
560
|
-
);
|
|
561
|
-
});
|
|
562
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
563
|
-
0 && (module.exports = {
|
|
564
|
-
CreateCustomerGroupResponseSchema,
|
|
565
|
-
CreateCustomerGroupSchema,
|
|
566
|
-
CustomerGroupSchema,
|
|
567
|
-
CustomerSchema,
|
|
568
|
-
FindCustomerGroupsCriteriaSchema,
|
|
569
|
-
FindCustomerResponse,
|
|
570
|
-
FindCustomersCriteriaSchema,
|
|
571
|
-
SetCustomerGroupPriceListResponseSchema,
|
|
572
|
-
SetCustomerGroupPriceListSchema,
|
|
573
|
-
createCustomerGroup,
|
|
574
|
-
findCustomers,
|
|
575
|
-
findCustomersGroups,
|
|
576
|
-
getAllCustomerGroupsBy,
|
|
577
|
-
getAllCustomersBy,
|
|
578
|
-
getCustomer,
|
|
579
|
-
setCustomerGroupPriceList
|
|
580
|
-
});
|
|
581
|
-
//# sourceMappingURL=customers.js.map
|
package/dist/customers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bigcommerce-entities/customers/index.ts","../src/bigcommerce-entities/customers/create-customer-group.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/validation/index.ts","../src/validation/validation.error.ts","../src/bigcommerce-entities/customers/schemas/customer-group.schema.ts","../src/bigcommerce-entities/customers/find-customers.ts","../src/bigcommerce-entities/customers/schemas/customer.schema.ts","../src/bigcommerce-entities/customers/schemas/find-customer.criteria.ts","../src/bigcommerce-entities/customers/get-all-customer-groups.ts","../src/bigcommerce-entities/customers/get-customer.ts","../src/bigcommerce-entities/customers/set-customer-group-price-list.ts"],"sourcesContent":["export * from './create-customer-group';\nexport * from './find-customers';\nexport * from './get-all-customer-groups';\nexport * from './get-customer';\nexport * from './schemas';\nexport * from './set-customer-group-price-list';\n","import { Effect } from 'effect';\nimport * as z from 'zod';\nimport { DEFAULTS } from '../../constants';\nimport { BigCommerceFetcher } from '../../core';\nimport { validateInput } from '../../validation';\nimport {\n CreateCustomerGroupResponseSchema,\n CreateCustomerGroupSchema,\n} from './schemas/customer-group.schema';\nexport const createCustomerGroup = (data: z.input<typeof CreateCustomerGroupSchema>) =>\n Effect.gen(function* () {\n const fetcher = yield* BigCommerceFetcher;\n const validatedBody = yield* validateInput(CreateCustomerGroupSchema, data);\n return yield* Effect.retry(\n fetcher.fetch({\n body: validatedBody,\n isB2B: false,\n method: 'POST',\n path: 'customer_groups',\n resultSchema: CreateCustomerGroupResponseSchema,\n version: 'v2',\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};\nfunction processSuccessResponse<Schema extends z.ZodTypeAny>(response: Response, schema: Schema) {\n return Effect.tryPromise({\n try: () => response.json(),\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: () => response.json(),\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 { Effect } from 'effect';\nimport * as z from 'zod';\nimport { InputValidationError } from './validation.error';\nexport const validateInput = <Schema extends z.ZodType>(schema: Schema, data: z.input<Schema>) => {\n return Effect.try({\n try: () => schema.parse(data),\n catch: (error) => new InputValidationError({ input: data, error: error as z.ZodError }),\n });\n};\n","import { Data } from 'effect';\nimport * as z from 'zod';\nexport class InputValidationError extends Data.TaggedError('InputValidationError')<{\n input: unknown;\n error: z.ZodError;\n}> {}\n","import * as z from 'zod';\nimport { DEFAULTS } from '../../../constants';\nexport const CreateCustomerGroupSchema = z.object({\n name: z.string(),\n discount_rules: z.array(\n z.object({\n type: z.literal('price_list'),\n price_list_id: z.int(),\n }),\n ),\n});\n\nexport const CreateCustomerGroupResponseSchema = z.object({\n id: z.int(),\n});\n\nexport const CustomerGroupSchema = z.object({\n id: z.int(),\n name: z.string(),\n is_default: z.boolean(),\n is_group_for_guests: z.boolean(),\n});\n\nexport const FindCustomerGroupsCriteriaSchema = z.object({\n limit: z.int().max(DEFAULTS.customers.getBatchSize).optional(),\n page: z.int().positive().optional(),\n});\n\nexport const SetCustomerGroupPriceListSchema = z.object({\n data: z.object({\n discount_rules: z\n .object({\n type: z.literal('price_list'),\n price_list_id: z.int(),\n })\n .array(),\n }),\n customerGroupId: z.int(),\n});\n\nexport const SetCustomerGroupPriceListResponseSchema = z.object({\n id: z.int(),\n name: z.string(),\n});\n","import { Effect } from 'effect';\nimport { stringify } from 'node:querystring';\nimport * as z from 'zod';\nimport { DEFAULTS } from '../../constants';\nimport { BigCommerceFetcher } from '../../core';\nimport { validateInput } from '../../validation';\nimport { FindCustomerResponse, type CustomerSchema } from './schemas/customer.schema';\nimport { FindCustomersCriteriaSchema } from './schemas/find-customer.criteria';\nexport const findCustomers = (criteria?: z.input<typeof FindCustomersCriteriaSchema>) => {\n return Effect.gen(function* () {\n const fetcher = yield* BigCommerceFetcher;\n const validatedQuery = yield* validateInput(FindCustomersCriteriaSchema, criteria ?? {});\n return yield* fetcher.fetch({\n method: 'GET',\n path: `customers`,\n isB2B: false,\n version: 'v3',\n resultSchema: FindCustomerResponse,\n query: stringify(validatedQuery),\n });\n });\n};\n\nexport const getAllCustomersBy = (\n criteria: Omit<z.input<typeof FindCustomersCriteriaSchema>, 'page' | 'limit'>,\n) => {\n return Effect.gen(function* () {\n const allCustomers: z.infer<typeof CustomerSchema>[] = [];\n let page = 1;\n let hasMoreCustomers = true;\n\n while (hasMoreCustomers) {\n const customers = yield* findCustomers({\n ...criteria,\n page,\n limit: DEFAULTS.customers.getBatchSize,\n });\n\n if (customers.meta.pagination.links.next) {\n allCustomers.push(...customers.data);\n page++;\n } else {\n hasMoreCustomers = false;\n }\n }\n\n return allCustomers;\n });\n};\n","import * as z from 'zod';\n\nexport const CustomerSchema = z.object({\n email: z.email(),\n first_name: z.string(),\n last_name: z.string(),\n company: z.string().optional(),\n phone: z.string(),\n customer_group_id: z.int(),\n id: z.int(),\n channel_ids: z.array(z.int()),\n});\n\nexport const FindCustomerResponse = z.object({\n data: z.array(CustomerSchema),\n meta: z.object({\n pagination: z.object({\n total: z.int(),\n count: z.int(),\n per_page: z.int(),\n current_page: z.int(),\n total_pages: z.int(),\n links: z.object({\n previous: z.string().optional().nullable(),\n current: z.string(),\n next: z.string().optional().nullable(),\n }),\n }),\n }),\n});\n","import * as z from 'zod';\nexport const FindCustomersCriteriaSchema = z.object({\n 'id:in': z\n .array(z.int())\n .transform((ids) => ids.join(','))\n .optional(),\n page: z.int().optional(),\n limit: z.int().optional(),\n 'company:in': z\n .array(z.string())\n .transform((companies) => companies.join(','))\n .optional(),\n 'customer_group_id:in': z\n .array(z.int())\n .transform((ids) => ids.join(','))\n .optional(),\n});\n","import { Effect } from 'effect';\nimport { stringify } from 'node:querystring';\nimport * as z from 'zod';\nimport { DEFAULTS } from '../../constants';\nimport { BigCommerceFetcher } from '../../core';\nimport { validateInput } from '../../validation';\nimport {\n CustomerGroupSchema,\n FindCustomerGroupsCriteriaSchema,\n} from './schemas/customer-group.schema';\nconst FindCustomerResponse = z.union([\n z.array(CustomerGroupSchema),\n z.literal(''),\n z.literal(null),\n]);\nexport const findCustomersGroups = (criteria?: z.input<typeof FindCustomerGroupsCriteriaSchema>) =>\n Effect.gen(function* () {\n const fetcher = yield* BigCommerceFetcher;\n const validatedQuery = yield* validateInput(FindCustomerGroupsCriteriaSchema, criteria ?? {});\n const response = yield* fetcher.fetch({\n method: 'GET',\n path: `customers`,\n isB2B: false,\n version: 'v3',\n resultSchema: FindCustomerResponse,\n query: stringify(validatedQuery),\n });\n return response || [];\n });\n\nexport const getAllCustomerGroupsBy = (\n criteria?: Omit<z.input<typeof FindCustomerGroupsCriteriaSchema>, 'page' | 'limit'>,\n) =>\n Effect.gen(function* () {\n const all: z.infer<typeof CustomerGroupSchema>[] = [];\n let page = 1;\n let hasMore = true;\n\n while (hasMore) {\n const groups = yield* findCustomersGroups({\n ...criteria,\n page,\n limit: DEFAULTS.customers.getBatchSize,\n });\n\n if (groups.length) {\n all.push(...groups);\n page++;\n } else {\n hasMore = false;\n }\n }\n\n return all;\n });\n","import { Effect } from 'effect';\nimport { findCustomers } from './find-customers';\n\nexport const getCustomer = (customerId: number) => {\n return findCustomers({\n 'id:in': [customerId],\n }).pipe(Effect.map((response) => response.data[0]));\n};\n","import { Effect } from 'effect';\nimport * as z from 'zod';\nimport { DEFAULTS } from '../../constants';\nimport { BigCommerceFetcher } from '../../core';\nimport { validateInput } from '../../validation';\nimport {\n SetCustomerGroupPriceListResponseSchema,\n SetCustomerGroupPriceListSchema,\n} from './schemas/customer-group.schema';\nexport const setCustomerGroupPriceList = (input: z.input<typeof SetCustomerGroupPriceListSchema>) =>\n Effect.gen(function* () {\n const { customerGroupId, data } = yield* validateInput(SetCustomerGroupPriceListSchema, input);\n const fetcher = yield* BigCommerceFetcher;\n\n return yield* Effect.retry(\n fetcher.fetch({\n body: data,\n isB2B: false,\n method: 'PUT',\n path: `customer_groups/${customerGroupId}`,\n resultSchema: SetCustomerGroupPriceListResponseSchema,\n version: 'v2',\n }),\n DEFAULT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;AAAA,IACpC,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,cAAcA;AAAA,IACd,WAAO,oCAAU,cAAc;AAAA,EACjC,CAAC;AACD,SAAO,YAAY,CAAC;AACtB,CAAC;AAEI,IAAM,yBAAyB,CACpC,aAEA,uBAAO,IAAI,aAAa;AACtB,QAAM,MAA6C,CAAC;AACpD,MAAI,OAAO;AACX,MAAI,UAAU;AAEd,SAAO,SAAS;AACd,UAAM,SAAS,OAAO,oBAAoB;AAAA,MACxC,GAAG;AAAA,MACH;AAAA,MACA,OAAO,SAAS,UAAU;AAAA,IAC5B,CAAC;AAED,QAAI,OAAO,QAAQ;AACjB,UAAI,KAAK,GAAG,MAAM;AAClB;AAAA,IACF,OAAO;AACL,gBAAU;AAAA,IACZ;AAAA,EACF;AAEA,SAAO;AACT,CAAC;;;ACtDH,IAAAC,kBAAuB;AAGhB,IAAM,cAAc,CAAC,eAAuB;AACjD,SAAO,cAAc;AAAA,IACnB,SAAS,CAAC,UAAU;AAAA,EACtB,CAAC,EAAE,KAAK,uBAAO,IAAI,CAAC,aAAa,SAAS,KAAK,CAAC,CAAC,CAAC;AACpD;;;ACPA,IAAAC,kBAAuB;AAShB,IAAM,4BAA4B,CAAC,UACxC,uBAAO,IAAI,aAAa;AACtB,QAAM,EAAE,iBAAiB,KAAK,IAAI,OAAO,cAAc,iCAAiC,KAAK;AAC7F,QAAM,UAAU,OAAO;AAEvB,SAAO,OAAO,uBAAO;AAAA,IACnB,QAAQ,MAAM;AAAA,MACZ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,MAAM,mBAAmB,eAAe;AAAA,MACxC,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","import_effect","import_effect","import_effect","z","z","import_effect","import_node_querystring","z","FindCustomerResponse","import_effect","import_effect"]}
|