@typewoo/sdk 3.0.0-alpha.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 +18 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/bus/event.bus.d.ts +38 -0
- package/dist/lib/bus/event.bus.d.ts.map +1 -0
- package/dist/lib/bus/event.bus.js +93 -0
- package/dist/lib/bus/event.bus.js.map +1 -0
- package/dist/lib/configs/index.d.ts +2 -0
- package/dist/lib/configs/index.d.ts.map +1 -0
- package/dist/lib/configs/index.js +2 -0
- package/dist/lib/configs/index.js.map +1 -0
- package/dist/lib/configs/sdk.config.d.ts +50 -0
- package/dist/lib/configs/sdk.config.d.ts.map +1 -0
- package/dist/lib/configs/sdk.config.js +2 -0
- package/dist/lib/configs/sdk.config.js.map +1 -0
- package/dist/lib/configs/simple.jwt.login.config.js +2 -0
- package/dist/lib/configs/simple.jwt.login.config.js.map +1 -0
- package/dist/lib/interceptors/admin-auth.interceptor.d.ts +3 -0
- package/dist/lib/interceptors/admin-auth.interceptor.d.ts.map +1 -0
- package/dist/lib/interceptors/admin-auth.interceptor.js +20 -0
- package/dist/lib/interceptors/admin-auth.interceptor.js.map +1 -0
- package/dist/lib/interceptors/api-key.interceptor.d.ts +7 -0
- package/dist/lib/interceptors/api-key.interceptor.d.ts.map +1 -0
- package/dist/lib/interceptors/api-key.interceptor.js +18 -0
- package/dist/lib/interceptors/api-key.interceptor.js.map +1 -0
- package/dist/lib/interceptors/cart.token.interceptor.d.ts +6 -0
- package/dist/lib/interceptors/cart.token.interceptor.d.ts.map +1 -0
- package/dist/lib/interceptors/cart.token.interceptor.js +35 -0
- package/dist/lib/interceptors/cart.token.interceptor.js.map +1 -0
- package/dist/lib/interceptors/nonce.interceptor.d.ts +6 -0
- package/dist/lib/interceptors/nonce.interceptor.d.ts.map +1 -0
- package/dist/lib/interceptors/nonce.interceptor.js +34 -0
- package/dist/lib/interceptors/nonce.interceptor.js.map +1 -0
- package/dist/lib/interceptors/refresh.token.interceptor.d.ts +5 -0
- package/dist/lib/interceptors/refresh.token.interceptor.d.ts.map +1 -0
- package/dist/lib/interceptors/refresh.token.interceptor.js +130 -0
- package/dist/lib/interceptors/refresh.token.interceptor.js.map +1 -0
- package/dist/lib/interceptors/token.interceptor.d.ts +3 -0
- package/dist/lib/interceptors/token.interceptor.d.ts.map +1 -0
- package/dist/lib/interceptors/token.interceptor.js +21 -0
- package/dist/lib/interceptors/token.interceptor.js.map +1 -0
- package/dist/lib/plugins/index.d.ts +2 -0
- package/dist/lib/plugins/index.d.ts.map +1 -0
- package/dist/lib/plugins/index.js +2 -0
- package/dist/lib/plugins/index.js.map +1 -0
- package/dist/lib/plugins/plugin.d.ts +17 -0
- package/dist/lib/plugins/plugin.d.ts.map +1 -0
- package/dist/lib/plugins/plugin.js +2 -0
- package/dist/lib/plugins/plugin.js.map +1 -0
- package/dist/lib/sdk.d.ts +32 -0
- package/dist/lib/sdk.d.ts.map +1 -0
- package/dist/lib/sdk.events.d.ts +30 -0
- package/dist/lib/sdk.events.d.ts.map +1 -0
- package/dist/lib/sdk.events.js +2 -0
- package/dist/lib/sdk.events.js.map +1 -0
- package/dist/lib/sdk.js +89 -0
- package/dist/lib/sdk.js.map +1 -0
- package/dist/lib/services/admin/coupon.service.d.ts +48 -0
- package/dist/lib/services/admin/coupon.service.d.ts.map +1 -0
- package/dist/lib/services/admin/coupon.service.js +81 -0
- package/dist/lib/services/admin/coupon.service.js.map +1 -0
- package/dist/lib/services/admin/customer.service.d.ts +48 -0
- package/dist/lib/services/admin/customer.service.d.ts.map +1 -0
- package/dist/lib/services/admin/customer.service.js +81 -0
- package/dist/lib/services/admin/customer.service.js.map +1 -0
- package/dist/lib/services/admin/data.service.d.ts +36 -0
- package/dist/lib/services/admin/data.service.d.ts.map +1 -0
- package/dist/lib/services/admin/data.service.js +86 -0
- package/dist/lib/services/admin/data.service.js.map +1 -0
- package/dist/lib/services/admin/order.service.d.ts +113 -0
- package/dist/lib/services/admin/order.service.d.ts.map +1 -0
- package/dist/lib/services/admin/order.service.js +226 -0
- package/dist/lib/services/admin/order.service.js.map +1 -0
- package/dist/lib/services/admin/payment-gateway.service.d.ts +24 -0
- package/dist/lib/services/admin/payment-gateway.service.d.ts.map +1 -0
- package/dist/lib/services/admin/payment-gateway.service.js +50 -0
- package/dist/lib/services/admin/payment-gateway.service.js.map +1 -0
- package/dist/lib/services/admin/product-attribute-term.service.d.ts +47 -0
- package/dist/lib/services/admin/product-attribute-term.service.d.ts.map +1 -0
- package/dist/lib/services/admin/product-attribute-term.service.js +83 -0
- package/dist/lib/services/admin/product-attribute-term.service.js.map +1 -0
- package/dist/lib/services/admin/product-attribute.service.d.ts +48 -0
- package/dist/lib/services/admin/product-attribute.service.d.ts.map +1 -0
- package/dist/lib/services/admin/product-attribute.service.js +81 -0
- package/dist/lib/services/admin/product-attribute.service.js.map +1 -0
- package/dist/lib/services/admin/product-brand.service.d.ts +48 -0
- package/dist/lib/services/admin/product-brand.service.d.ts.map +1 -0
- package/dist/lib/services/admin/product-brand.service.js +81 -0
- package/dist/lib/services/admin/product-brand.service.js.map +1 -0
- package/dist/lib/services/admin/product-category.service.d.ts +48 -0
- package/dist/lib/services/admin/product-category.service.d.ts.map +1 -0
- package/dist/lib/services/admin/product-category.service.js +81 -0
- package/dist/lib/services/admin/product-category.service.js.map +1 -0
- package/dist/lib/services/admin/product-review.service.d.ts +48 -0
- package/dist/lib/services/admin/product-review.service.d.ts.map +1 -0
- package/dist/lib/services/admin/product-review.service.js +81 -0
- package/dist/lib/services/admin/product-review.service.js.map +1 -0
- package/dist/lib/services/admin/product-tag.service.d.ts +48 -0
- package/dist/lib/services/admin/product-tag.service.d.ts.map +1 -0
- package/dist/lib/services/admin/product-tag.service.js +81 -0
- package/dist/lib/services/admin/product-tag.service.js.map +1 -0
- package/dist/lib/services/admin/product.service.d.ts +88 -0
- package/dist/lib/services/admin/product.service.d.ts.map +1 -0
- package/dist/lib/services/admin/product.service.js +167 -0
- package/dist/lib/services/admin/product.service.js.map +1 -0
- package/dist/lib/services/admin/refund.service.d.ts +17 -0
- package/dist/lib/services/admin/refund.service.d.ts.map +1 -0
- package/dist/lib/services/admin/refund.service.js +30 -0
- package/dist/lib/services/admin/refund.service.js.map +1 -0
- package/dist/lib/services/admin/report.service.d.ts +52 -0
- package/dist/lib/services/admin/report.service.d.ts.map +1 -0
- package/dist/lib/services/admin/report.service.js +135 -0
- package/dist/lib/services/admin/report.service.js.map +1 -0
- package/dist/lib/services/admin/setting.service.d.ts +49 -0
- package/dist/lib/services/admin/setting.service.d.ts.map +1 -0
- package/dist/lib/services/admin/setting.service.js +75 -0
- package/dist/lib/services/admin/setting.service.js.map +1 -0
- package/dist/lib/services/admin/shipping-class.service.d.ts +48 -0
- package/dist/lib/services/admin/shipping-class.service.d.ts.map +1 -0
- package/dist/lib/services/admin/shipping-class.service.js +81 -0
- package/dist/lib/services/admin/shipping-class.service.js.map +1 -0
- package/dist/lib/services/admin/shipping-method.service.d.ts +20 -0
- package/dist/lib/services/admin/shipping-method.service.d.ts.map +1 -0
- package/dist/lib/services/admin/shipping-method.service.js +40 -0
- package/dist/lib/services/admin/shipping-method.service.js.map +1 -0
- package/dist/lib/services/admin/shipping-zone.service.d.ts +60 -0
- package/dist/lib/services/admin/shipping-zone.service.d.ts.map +1 -0
- package/dist/lib/services/admin/shipping-zone.service.js +146 -0
- package/dist/lib/services/admin/shipping-zone.service.js.map +1 -0
- package/dist/lib/services/admin/system-status.service.d.ts +16 -0
- package/dist/lib/services/admin/system-status.service.d.ts.map +1 -0
- package/dist/lib/services/admin/system-status.service.js +27 -0
- package/dist/lib/services/admin/system-status.service.js.map +1 -0
- package/dist/lib/services/admin/tax.service.d.ts +72 -0
- package/dist/lib/services/admin/tax.service.d.ts.map +1 -0
- package/dist/lib/services/admin/tax.service.js +134 -0
- package/dist/lib/services/admin/tax.service.js.map +1 -0
- package/dist/lib/services/admin/webhook.service.d.ts +48 -0
- package/dist/lib/services/admin/webhook.service.d.ts.map +1 -0
- package/dist/lib/services/admin/webhook.service.js +81 -0
- package/dist/lib/services/admin/webhook.service.js.map +1 -0
- package/dist/lib/services/admin.service.d.ts +140 -0
- package/dist/lib/services/admin.service.d.ts.map +1 -0
- package/dist/lib/services/admin.service.js +228 -0
- package/dist/lib/services/admin.service.js.map +1 -0
- package/dist/lib/services/api.d.ts +5 -0
- package/dist/lib/services/api.d.ts.map +1 -0
- package/dist/lib/services/api.js +22 -0
- package/dist/lib/services/api.js.map +1 -0
- package/dist/lib/services/auth/auth.service.d.ts +15 -0
- package/dist/lib/services/auth/auth.service.d.ts.map +1 -0
- package/dist/lib/services/auth/auth.service.js +100 -0
- package/dist/lib/services/auth/auth.service.js.map +1 -0
- package/dist/lib/services/base.service.d.ts +13 -0
- package/dist/lib/services/base.service.d.ts.map +1 -0
- package/dist/lib/services/base.service.js +10 -0
- package/dist/lib/services/base.service.js.map +1 -0
- package/dist/lib/services/store/batch.service.d.ts +20 -0
- package/dist/lib/services/store/batch.service.d.ts.map +1 -0
- package/dist/lib/services/store/batch.service.js +35 -0
- package/dist/lib/services/store/batch.service.js.map +1 -0
- package/dist/lib/services/store/cart.coupon.service.d.ts +38 -0
- package/dist/lib/services/store/cart.coupon.service.d.ts.map +1 -0
- package/dist/lib/services/store/cart.coupon.service.js +88 -0
- package/dist/lib/services/store/cart.coupon.service.js.map +1 -0
- package/dist/lib/services/store/cart.extensions.service.d.ts +19 -0
- package/dist/lib/services/store/cart.extensions.service.d.ts.map +1 -0
- package/dist/lib/services/store/cart.extensions.service.js +34 -0
- package/dist/lib/services/store/cart.extensions.service.js.map +1 -0
- package/dist/lib/services/store/cart.item.service.d.ts +45 -0
- package/dist/lib/services/store/cart.item.service.d.ts.map +1 -0
- package/dist/lib/services/store/cart.item.service.js +115 -0
- package/dist/lib/services/store/cart.item.service.js.map +1 -0
- package/dist/lib/services/store/cart.service.d.ts +61 -0
- package/dist/lib/services/store/cart.service.d.ts.map +1 -0
- package/dist/lib/services/store/cart.service.js +172 -0
- package/dist/lib/services/store/cart.service.js.map +1 -0
- package/dist/lib/services/store/checkout.order.service.d.ts +19 -0
- package/dist/lib/services/store/checkout.order.service.d.ts.map +1 -0
- package/dist/lib/services/store/checkout.order.service.js +29 -0
- package/dist/lib/services/store/checkout.order.service.js.map +1 -0
- package/dist/lib/services/store/checkout.service.d.ts +30 -0
- package/dist/lib/services/store/checkout.service.d.ts.map +1 -0
- package/dist/lib/services/store/checkout.service.js +57 -0
- package/dist/lib/services/store/checkout.service.js.map +1 -0
- package/dist/lib/services/store/order.service.d.ts +20 -0
- package/dist/lib/services/store/order.service.d.ts.map +1 -0
- package/dist/lib/services/store/order.service.js +33 -0
- package/dist/lib/services/store/order.service.js.map +1 -0
- package/dist/lib/services/store/product.attribute.service.d.ts +21 -0
- package/dist/lib/services/store/product.attribute.service.d.ts.map +1 -0
- package/dist/lib/services/store/product.attribute.service.js +38 -0
- package/dist/lib/services/store/product.attribute.service.js.map +1 -0
- package/dist/lib/services/store/product.attribute.term.service.d.ts +17 -0
- package/dist/lib/services/store/product.attribute.term.service.d.ts.map +1 -0
- package/dist/lib/services/store/product.attribute.term.service.js +30 -0
- package/dist/lib/services/store/product.attribute.term.service.js.map +1 -0
- package/dist/lib/services/store/product.brand.service.d.ts +21 -0
- package/dist/lib/services/store/product.brand.service.d.ts.map +1 -0
- package/dist/lib/services/store/product.brand.service.js +40 -0
- package/dist/lib/services/store/product.brand.service.js.map +1 -0
- package/dist/lib/services/store/product.category.service.d.ts +22 -0
- package/dist/lib/services/store/product.category.service.d.ts.map +1 -0
- package/dist/lib/services/store/product.category.service.js +41 -0
- package/dist/lib/services/store/product.category.service.js.map +1 -0
- package/dist/lib/services/store/product.collection.data.service.d.ts +20 -0
- package/dist/lib/services/store/product.collection.data.service.d.ts.map +1 -0
- package/dist/lib/services/store/product.collection.data.service.js +31 -0
- package/dist/lib/services/store/product.collection.data.service.js.map +1 -0
- package/dist/lib/services/store/product.review.service.d.ts +18 -0
- package/dist/lib/services/store/product.review.service.d.ts.map +1 -0
- package/dist/lib/services/store/product.review.service.js +31 -0
- package/dist/lib/services/store/product.review.service.js.map +1 -0
- package/dist/lib/services/store/product.service.d.ts +28 -0
- package/dist/lib/services/store/product.service.d.ts.map +1 -0
- package/dist/lib/services/store/product.service.js +62 -0
- package/dist/lib/services/store/product.service.js.map +1 -0
- package/dist/lib/services/store/product.tag.service.d.ts +16 -0
- package/dist/lib/services/store/product.tag.service.d.ts.map +1 -0
- package/dist/lib/services/store/product.tag.service.js +29 -0
- package/dist/lib/services/store/product.tag.service.js.map +1 -0
- package/dist/lib/services/store.service.d.ts +104 -0
- package/dist/lib/services/store.service.d.ts.map +1 -0
- package/dist/lib/services/store.service.js +133 -0
- package/dist/lib/services/store.service.js.map +1 -0
- package/dist/lib/tests/config.tests.d.ts +11 -0
- package/dist/lib/tests/config.tests.d.ts.map +1 -0
- package/dist/lib/tests/config.tests.js +12 -0
- package/dist/lib/tests/config.tests.js.map +1 -0
- package/dist/lib/types/admin/attribute.types.d.ts +123 -0
- package/dist/lib/types/admin/attribute.types.d.ts.map +1 -0
- package/dist/lib/types/admin/attribute.types.js +93 -0
- package/dist/lib/types/admin/attribute.types.js.map +1 -0
- package/dist/lib/types/admin/common.types.d.ts +100 -0
- package/dist/lib/types/admin/common.types.d.ts.map +1 -0
- package/dist/lib/types/admin/common.types.js +77 -0
- package/dist/lib/types/admin/common.types.js.map +1 -0
- package/dist/lib/types/admin/coupon.types.d.ts +123 -0
- package/dist/lib/types/admin/coupon.types.d.ts.map +1 -0
- package/dist/lib/types/admin/coupon.types.js +211 -0
- package/dist/lib/types/admin/coupon.types.js.map +1 -0
- package/dist/lib/types/admin/customer.types.d.ts +134 -0
- package/dist/lib/types/admin/customer.types.d.ts.map +1 -0
- package/dist/lib/types/admin/customer.types.js +99 -0
- package/dist/lib/types/admin/customer.types.js.map +1 -0
- package/dist/lib/types/admin/data.types.d.ts +65 -0
- package/dist/lib/types/admin/data.types.d.ts.map +1 -0
- package/dist/lib/types/admin/data.types.js +49 -0
- package/dist/lib/types/admin/data.types.js.map +1 -0
- package/dist/lib/types/admin/index.d.ts +24 -0
- package/dist/lib/types/admin/index.d.ts.map +1 -0
- package/dist/lib/types/admin/index.js +23 -0
- package/dist/lib/types/admin/index.js.map +1 -0
- package/dist/lib/types/admin/order.types.d.ts +710 -0
- package/dist/lib/types/admin/order.types.d.ts.map +1 -0
- package/dist/lib/types/admin/order.types.js +365 -0
- package/dist/lib/types/admin/order.types.js.map +1 -0
- package/dist/lib/types/admin/payment-gateway.types.d.ts +44 -0
- package/dist/lib/types/admin/payment-gateway.types.d.ts.map +1 -0
- package/dist/lib/types/admin/payment-gateway.types.js +34 -0
- package/dist/lib/types/admin/payment-gateway.types.js.map +1 -0
- package/dist/lib/types/admin/product-brand.types.d.ts +92 -0
- package/dist/lib/types/admin/product-brand.types.d.ts.map +1 -0
- package/dist/lib/types/admin/product-brand.types.js +55 -0
- package/dist/lib/types/admin/product-brand.types.js.map +1 -0
- package/dist/lib/types/admin/product-review.types.d.ts +88 -0
- package/dist/lib/types/admin/product-review.types.d.ts.map +1 -0
- package/dist/lib/types/admin/product-review.types.js +55 -0
- package/dist/lib/types/admin/product-review.types.js.map +1 -0
- package/dist/lib/types/admin/product.types.d.ts +509 -0
- package/dist/lib/types/admin/product.types.d.ts.map +1 -0
- package/dist/lib/types/admin/product.types.js +287 -0
- package/dist/lib/types/admin/product.types.js.map +1 -0
- package/dist/lib/types/admin/refund.types.d.ts +237 -0
- package/dist/lib/types/admin/refund.types.d.ts.map +1 -0
- package/dist/lib/types/admin/refund.types.js +118 -0
- package/dist/lib/types/admin/refund.types.js.map +1 -0
- package/dist/lib/types/admin/report.types.d.ts +179 -0
- package/dist/lib/types/admin/report.types.d.ts.map +1 -0
- package/dist/lib/types/admin/report.types.js +96 -0
- package/dist/lib/types/admin/report.types.js.map +1 -0
- package/dist/lib/types/admin/setting.types.d.ts +50 -0
- package/dist/lib/types/admin/setting.types.d.ts.map +1 -0
- package/dist/lib/types/admin/setting.types.js +41 -0
- package/dist/lib/types/admin/setting.types.js.map +1 -0
- package/dist/lib/types/admin/shipping-method.types.d.ts +22 -0
- package/dist/lib/types/admin/shipping-method.types.d.ts.map +1 -0
- package/dist/lib/types/admin/shipping-method.types.js +14 -0
- package/dist/lib/types/admin/shipping-method.types.js.map +1 -0
- package/dist/lib/types/admin/shipping-zone.types.d.ts +103 -0
- package/dist/lib/types/admin/shipping-zone.types.d.ts.map +1 -0
- package/dist/lib/types/admin/shipping-zone.types.js +63 -0
- package/dist/lib/types/admin/shipping-zone.types.js.map +1 -0
- package/dist/lib/types/admin/system-status.types.d.ts +139 -0
- package/dist/lib/types/admin/system-status.types.d.ts.map +1 -0
- package/dist/lib/types/admin/system-status.types.js +133 -0
- package/dist/lib/types/admin/system-status.types.js.map +1 -0
- package/dist/lib/types/admin/tax.types.d.ts +99 -0
- package/dist/lib/types/admin/tax.types.d.ts.map +1 -0
- package/dist/lib/types/admin/tax.types.js +60 -0
- package/dist/lib/types/admin/tax.types.js.map +1 -0
- package/dist/lib/types/admin/taxonomy.types.d.ts +234 -0
- package/dist/lib/types/admin/taxonomy.types.d.ts.map +1 -0
- package/dist/lib/types/admin/taxonomy.types.js +177 -0
- package/dist/lib/types/admin/taxonomy.types.js.map +1 -0
- package/dist/lib/types/admin/webhook.types.d.ts +72 -0
- package/dist/lib/types/admin/webhook.types.d.ts.map +1 -0
- package/dist/lib/types/admin/webhook.types.js +42 -0
- package/dist/lib/types/admin/webhook.types.js.map +1 -0
- package/dist/lib/types/api.d.ts +46 -0
- package/dist/lib/types/api.d.ts.map +1 -0
- package/dist/lib/types/api.js +15 -0
- package/dist/lib/types/api.js.map +1 -0
- package/dist/lib/types/auth/index.d.ts +7 -0
- package/dist/lib/types/auth/index.d.ts.map +1 -0
- package/dist/lib/types/auth/index.js +7 -0
- package/dist/lib/types/auth/index.js.map +1 -0
- package/dist/lib/types/auth/one-time-token/auth.one.time.token.request.d.ts +6 -0
- package/dist/lib/types/auth/one-time-token/auth.one.time.token.request.d.ts.map +1 -0
- package/dist/lib/types/auth/one-time-token/auth.one.time.token.request.js +5 -0
- package/dist/lib/types/auth/one-time-token/auth.one.time.token.request.js.map +1 -0
- package/dist/lib/types/auth/one-time-token/auth.one.time.token.response.d.ts +7 -0
- package/dist/lib/types/auth/one-time-token/auth.one.time.token.response.d.ts.map +1 -0
- package/dist/lib/types/auth/one-time-token/auth.one.time.token.response.js +6 -0
- package/dist/lib/types/auth/one-time-token/auth.one.time.token.response.js.map +1 -0
- package/dist/lib/types/auth/one-time-token/index.d.ts +3 -0
- package/dist/lib/types/auth/one-time-token/index.d.ts.map +1 -0
- package/dist/lib/types/auth/one-time-token/index.js +3 -0
- package/dist/lib/types/auth/one-time-token/index.js.map +1 -0
- package/dist/lib/types/auth/refresh/auth.refresh.request.d.ts +6 -0
- package/dist/lib/types/auth/refresh/auth.refresh.request.d.ts.map +1 -0
- package/dist/lib/types/auth/refresh/auth.refresh.request.js +5 -0
- package/dist/lib/types/auth/refresh/auth.refresh.request.js.map +1 -0
- package/dist/lib/types/auth/refresh/index.d.ts +2 -0
- package/dist/lib/types/auth/refresh/index.d.ts.map +1 -0
- package/dist/lib/types/auth/refresh/index.js +2 -0
- package/dist/lib/types/auth/refresh/index.js.map +1 -0
- package/dist/lib/types/auth/revoke/auth.revoke.request.d.ts +9 -0
- package/dist/lib/types/auth/revoke/auth.revoke.request.d.ts.map +1 -0
- package/dist/lib/types/auth/revoke/auth.revoke.request.js +5 -0
- package/dist/lib/types/auth/revoke/auth.revoke.request.js.map +1 -0
- package/dist/lib/types/auth/revoke/auth.revoke.response.d.ts +8 -0
- package/dist/lib/types/auth/revoke/auth.revoke.response.d.ts.map +1 -0
- package/dist/lib/types/auth/revoke/auth.revoke.response.js +7 -0
- package/dist/lib/types/auth/revoke/auth.revoke.response.js.map +1 -0
- package/dist/lib/types/auth/revoke/index.d.ts +3 -0
- package/dist/lib/types/auth/revoke/index.d.ts.map +1 -0
- package/dist/lib/types/auth/revoke/index.js +3 -0
- package/dist/lib/types/auth/revoke/index.js.map +1 -0
- package/dist/lib/types/auth/status/auth.status.response.d.ts +18 -0
- package/dist/lib/types/auth/status/auth.status.response.d.ts.map +1 -0
- package/dist/lib/types/auth/status/auth.status.response.js +16 -0
- package/dist/lib/types/auth/status/auth.status.response.js.map +1 -0
- package/dist/lib/types/auth/status/index.d.ts +2 -0
- package/dist/lib/types/auth/status/index.d.ts.map +1 -0
- package/dist/lib/types/auth/status/index.js +2 -0
- package/dist/lib/types/auth/status/index.js.map +1 -0
- package/dist/lib/types/auth/token/auth.token.request.d.ts +9 -0
- package/dist/lib/types/auth/token/auth.token.request.d.ts.map +1 -0
- package/dist/lib/types/auth/token/auth.token.request.js +8 -0
- package/dist/lib/types/auth/token/auth.token.request.js.map +1 -0
- package/dist/lib/types/auth/token/auth.token.response.d.ts +16 -0
- package/dist/lib/types/auth/token/auth.token.response.d.ts.map +1 -0
- package/dist/lib/types/auth/token/auth.token.response.js +15 -0
- package/dist/lib/types/auth/token/auth.token.response.js.map +1 -0
- package/dist/lib/types/auth/token/index.d.ts +3 -0
- package/dist/lib/types/auth/token/index.d.ts.map +1 -0
- package/dist/lib/types/auth/token/index.js +3 -0
- package/dist/lib/types/auth/token/index.js.map +1 -0
- package/dist/lib/types/auth/validate/auth.validate.response.d.ts +16 -0
- package/dist/lib/types/auth/validate/auth.validate.response.d.ts.map +1 -0
- package/dist/lib/types/auth/validate/auth.validate.response.js +15 -0
- package/dist/lib/types/auth/validate/auth.validate.response.js.map +1 -0
- package/dist/lib/types/auth/validate/index.d.ts +2 -0
- package/dist/lib/types/auth/validate/index.d.ts.map +1 -0
- package/dist/lib/types/auth/validate/index.js +2 -0
- package/dist/lib/types/auth/validate/index.js.map +1 -0
- package/dist/lib/types/index.d.ts +5 -0
- package/dist/lib/types/index.d.ts.map +1 -0
- package/dist/lib/types/index.js +5 -0
- package/dist/lib/types/index.js.map +1 -0
- package/dist/lib/types/sdk.state.d.ts +195 -0
- package/dist/lib/types/sdk.state.d.ts.map +1 -0
- package/dist/lib/types/sdk.state.js +10 -0
- package/dist/lib/types/sdk.state.js.map +1 -0
- package/dist/lib/types/store/batch/batch.request.d.ts +32 -0
- package/dist/lib/types/store/batch/batch.request.d.ts.map +1 -0
- package/dist/lib/types/store/batch/batch.request.js +35 -0
- package/dist/lib/types/store/batch/batch.request.js.map +1 -0
- package/dist/lib/types/store/batch/batch.response.d.ts +16 -0
- package/dist/lib/types/store/batch/batch.response.d.ts.map +1 -0
- package/dist/lib/types/store/batch/batch.response.js +22 -0
- package/dist/lib/types/store/batch/batch.response.js.map +1 -0
- package/dist/lib/types/store/batch/index.d.ts +3 -0
- package/dist/lib/types/store/batch/index.d.ts.map +1 -0
- package/dist/lib/types/store/batch/index.js +3 -0
- package/dist/lib/types/store/batch/index.js.map +1 -0
- package/dist/lib/types/store/cart/cart.billing.response.d.ts +16 -0
- package/dist/lib/types/store/cart/cart.billing.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart/cart.billing.response.js +15 -0
- package/dist/lib/types/store/cart/cart.billing.response.js.map +1 -0
- package/dist/lib/types/store/cart/cart.customer.request.d.ts +30 -0
- package/dist/lib/types/store/cart/cart.customer.request.d.ts.map +1 -0
- package/dist/lib/types/store/cart/cart.customer.request.js +29 -0
- package/dist/lib/types/store/cart/cart.customer.request.js.map +1 -0
- package/dist/lib/types/store/cart/cart.response.d.ts +189 -0
- package/dist/lib/types/store/cart/cart.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart/cart.response.js +27 -0
- package/dist/lib/types/store/cart/cart.response.js.map +1 -0
- package/dist/lib/types/store/cart/cart.shipping.rate.response.d.ts +42 -0
- package/dist/lib/types/store/cart/cart.shipping.rate.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart/cart.shipping.rate.response.js +41 -0
- package/dist/lib/types/store/cart/cart.shipping.rate.response.js.map +1 -0
- package/dist/lib/types/store/cart/cart.shipping.response.d.ts +15 -0
- package/dist/lib/types/store/cart/cart.shipping.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart/cart.shipping.response.js +14 -0
- package/dist/lib/types/store/cart/cart.shipping.response.js.map +1 -0
- package/dist/lib/types/store/cart/cart.total.response.d.ts +27 -0
- package/dist/lib/types/store/cart/cart.total.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart/cart.total.response.js +26 -0
- package/dist/lib/types/store/cart/cart.total.response.js.map +1 -0
- package/dist/lib/types/store/cart/index.d.ts +7 -0
- package/dist/lib/types/store/cart/index.d.ts.map +1 -0
- package/dist/lib/types/store/cart/index.js +7 -0
- package/dist/lib/types/store/cart/index.js.map +1 -0
- package/dist/lib/types/store/cart-coupon/cart.coupon.response.d.ts +18 -0
- package/dist/lib/types/store/cart-coupon/cart.coupon.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart-coupon/cart.coupon.response.js +8 -0
- package/dist/lib/types/store/cart-coupon/cart.coupon.response.js.map +1 -0
- package/dist/lib/types/store/cart-coupon/cart.coupon.total.response.d.ts +14 -0
- package/dist/lib/types/store/cart-coupon/cart.coupon.total.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart-coupon/cart.coupon.total.response.js +13 -0
- package/dist/lib/types/store/cart-coupon/cart.coupon.total.response.js.map +1 -0
- package/dist/lib/types/store/cart-coupon/index.d.ts +3 -0
- package/dist/lib/types/store/cart-coupon/index.d.ts.map +1 -0
- package/dist/lib/types/store/cart-coupon/index.js +3 -0
- package/dist/lib/types/store/cart-coupon/index.js.map +1 -0
- package/dist/lib/types/store/cart-extensions/cart.extensions.request.d.ts +10 -0
- package/dist/lib/types/store/cart-extensions/cart.extensions.request.d.ts.map +1 -0
- package/dist/lib/types/store/cart-extensions/cart.extensions.request.js +15 -0
- package/dist/lib/types/store/cart-extensions/cart.extensions.request.js.map +1 -0
- package/dist/lib/types/store/cart-extensions/cart.extensions.response.d.ts +12 -0
- package/dist/lib/types/store/cart-extensions/cart.extensions.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart-extensions/cart.extensions.response.js +23 -0
- package/dist/lib/types/store/cart-extensions/cart.extensions.response.js.map +1 -0
- package/dist/lib/types/store/cart-extensions/index.d.ts +3 -0
- package/dist/lib/types/store/cart-extensions/index.d.ts.map +1 -0
- package/dist/lib/types/store/cart-extensions/index.js +3 -0
- package/dist/lib/types/store/cart-extensions/index.js.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.add.request.d.ts +8 -0
- package/dist/lib/types/store/cart-item/cart.item.add.request.d.ts.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.add.request.js +16 -0
- package/dist/lib/types/store/cart-item/cart.item.add.request.js.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.edit.request.d.ts +7 -0
- package/dist/lib/types/store/cart-item/cart.item.edit.request.d.ts.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.edit.request.js +12 -0
- package/dist/lib/types/store/cart-item/cart.item.edit.request.js.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.price.response.d.ts +22 -0
- package/dist/lib/types/store/cart-item/cart.item.price.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.price.response.js +21 -0
- package/dist/lib/types/store/cart-item/cart.item.price.response.js.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.quantity.limits.response.d.ts +9 -0
- package/dist/lib/types/store/cart-item/cart.item.quantity.limits.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.quantity.limits.response.js +8 -0
- package/dist/lib/types/store/cart-item/cart.item.quantity.limits.response.js.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.response.d.ts +73 -0
- package/dist/lib/types/store/cart-item/cart.item.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.response.js +30 -0
- package/dist/lib/types/store/cart-item/cart.item.response.js.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.total.response.d.ts +16 -0
- package/dist/lib/types/store/cart-item/cart.item.total.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.total.response.js +15 -0
- package/dist/lib/types/store/cart-item/cart.item.total.response.js.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.variation.response.d.ts +8 -0
- package/dist/lib/types/store/cart-item/cart.item.variation.response.d.ts.map +1 -0
- package/dist/lib/types/store/cart-item/cart.item.variation.response.js +7 -0
- package/dist/lib/types/store/cart-item/cart.item.variation.response.js.map +1 -0
- package/dist/lib/types/store/cart-item/index.d.ts +8 -0
- package/dist/lib/types/store/cart-item/index.d.ts.map +1 -0
- package/dist/lib/types/store/cart-item/index.js +8 -0
- package/dist/lib/types/store/cart-item/index.js.map +1 -0
- package/dist/lib/types/store/checkout/checkout.billing.response.d.ts +16 -0
- package/dist/lib/types/store/checkout/checkout.billing.response.d.ts.map +1 -0
- package/dist/lib/types/store/checkout/checkout.billing.response.js +15 -0
- package/dist/lib/types/store/checkout/checkout.billing.response.js.map +1 -0
- package/dist/lib/types/store/checkout/checkout.create.request.d.ts +38 -0
- package/dist/lib/types/store/checkout/checkout.create.request.d.ts.map +1 -0
- package/dist/lib/types/store/checkout/checkout.create.request.js +36 -0
- package/dist/lib/types/store/checkout/checkout.create.request.js.map +1 -0
- package/dist/lib/types/store/checkout/checkout.response.d.ts +44 -0
- package/dist/lib/types/store/checkout/checkout.response.d.ts.map +1 -0
- package/dist/lib/types/store/checkout/checkout.response.js +22 -0
- package/dist/lib/types/store/checkout/checkout.response.js.map +1 -0
- package/dist/lib/types/store/checkout/checkout.shipping.d.ts +15 -0
- package/dist/lib/types/store/checkout/checkout.shipping.d.ts.map +1 -0
- package/dist/lib/types/store/checkout/checkout.shipping.js +14 -0
- package/dist/lib/types/store/checkout/checkout.shipping.js.map +1 -0
- package/dist/lib/types/store/checkout/checkout.update.request.d.ts +8 -0
- package/dist/lib/types/store/checkout/checkout.update.request.d.ts.map +1 -0
- package/dist/lib/types/store/checkout/checkout.update.request.js +16 -0
- package/dist/lib/types/store/checkout/checkout.update.request.js.map +1 -0
- package/dist/lib/types/store/checkout/index.d.ts +6 -0
- package/dist/lib/types/store/checkout/index.d.ts.map +1 -0
- package/dist/lib/types/store/checkout/index.js +6 -0
- package/dist/lib/types/store/checkout/index.js.map +1 -0
- package/dist/lib/types/store/error.response.d.ts +10 -0
- package/dist/lib/types/store/error.response.d.ts.map +1 -0
- package/dist/lib/types/store/error.response.js +9 -0
- package/dist/lib/types/store/error.response.js.map +1 -0
- package/dist/lib/types/store/image.response.d.ts +12 -0
- package/dist/lib/types/store/image.response.d.ts.map +1 -0
- package/dist/lib/types/store/image.response.js +11 -0
- package/dist/lib/types/store/image.response.js.map +1 -0
- package/dist/lib/types/store/index.d.ts +19 -0
- package/dist/lib/types/store/index.d.ts.map +1 -0
- package/dist/lib/types/store/index.js +19 -0
- package/dist/lib/types/store/index.js.map +1 -0
- package/dist/lib/types/store/order/index.d.ts +7 -0
- package/dist/lib/types/store/order/index.d.ts.map +1 -0
- package/dist/lib/types/store/order/index.js +7 -0
- package/dist/lib/types/store/order/index.js.map +1 -0
- package/dist/lib/types/store/order/order.billing.response.d.ts +16 -0
- package/dist/lib/types/store/order/order.billing.response.d.ts.map +1 -0
- package/dist/lib/types/store/order/order.billing.response.js +15 -0
- package/dist/lib/types/store/order/order.billing.response.js.map +1 -0
- package/dist/lib/types/store/order/order.coupon.response.d.ts +17 -0
- package/dist/lib/types/store/order/order.coupon.response.d.ts.map +1 -0
- package/dist/lib/types/store/order/order.coupon.response.js +16 -0
- package/dist/lib/types/store/order/order.coupon.response.js.map +1 -0
- package/dist/lib/types/store/order/order.request.d.ts +37 -0
- package/dist/lib/types/store/order/order.request.d.ts.map +1 -0
- package/dist/lib/types/store/order/order.request.js +35 -0
- package/dist/lib/types/store/order/order.request.js.map +1 -0
- package/dist/lib/types/store/order/order.response.d.ts +141 -0
- package/dist/lib/types/store/order/order.response.d.ts.map +1 -0
- package/dist/lib/types/store/order/order.response.js +21 -0
- package/dist/lib/types/store/order/order.response.js.map +1 -0
- package/dist/lib/types/store/order/order.shipping.response.d.ts +15 -0
- package/dist/lib/types/store/order/order.shipping.response.d.ts.map +1 -0
- package/dist/lib/types/store/order/order.shipping.response.js +14 -0
- package/dist/lib/types/store/order/order.shipping.response.js.map +1 -0
- package/dist/lib/types/store/order/order.total.response.d.ts +18 -0
- package/dist/lib/types/store/order/order.total.response.d.ts.map +1 -0
- package/dist/lib/types/store/order/order.total.response.js +17 -0
- package/dist/lib/types/store/order/order.total.response.js.map +1 -0
- package/dist/lib/types/store/paginated.d.ts +8 -0
- package/dist/lib/types/store/paginated.d.ts.map +1 -0
- package/dist/lib/types/store/paginated.js +17 -0
- package/dist/lib/types/store/paginated.js.map +1 -0
- package/dist/lib/types/store/product/index.d.ts +4 -0
- package/dist/lib/types/store/product/index.d.ts.map +1 -0
- package/dist/lib/types/store/product/index.js +4 -0
- package/dist/lib/types/store/product/index.js.map +1 -0
- package/dist/lib/types/store/product/product.price.response.d.ts +16 -0
- package/dist/lib/types/store/product/product.price.response.d.ts.map +1 -0
- package/dist/lib/types/store/product/product.price.response.js +15 -0
- package/dist/lib/types/store/product/product.price.response.js.map +1 -0
- package/dist/lib/types/store/product/product.request.d.ts +94 -0
- package/dist/lib/types/store/product/product.request.d.ts.map +1 -0
- package/dist/lib/types/store/product/product.request.js +167 -0
- package/dist/lib/types/store/product/product.request.js.map +1 -0
- package/dist/lib/types/store/product/product.response.d.ts +82 -0
- package/dist/lib/types/store/product/product.response.d.ts.map +1 -0
- package/dist/lib/types/store/product/product.response.js +63 -0
- package/dist/lib/types/store/product/product.response.js.map +1 -0
- package/dist/lib/types/store/product-attribute/index.d.ts +2 -0
- package/dist/lib/types/store/product-attribute/index.d.ts.map +1 -0
- package/dist/lib/types/store/product-attribute/index.js +2 -0
- package/dist/lib/types/store/product-attribute/index.js.map +1 -0
- package/dist/lib/types/store/product-attribute/product.attribute.response.d.ts +11 -0
- package/dist/lib/types/store/product-attribute/product.attribute.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-attribute/product.attribute.response.js +10 -0
- package/dist/lib/types/store/product-attribute/product.attribute.response.js.map +1 -0
- package/dist/lib/types/store/product-attribute-term/index.d.ts +3 -0
- package/dist/lib/types/store/product-attribute-term/index.d.ts.map +1 -0
- package/dist/lib/types/store/product-attribute-term/index.js +3 -0
- package/dist/lib/types/store/product-attribute-term/index.js.map +1 -0
- package/dist/lib/types/store/product-attribute-term/product.attribute.term.request.d.ts +18 -0
- package/dist/lib/types/store/product-attribute-term/product.attribute.term.request.d.ts.map +1 -0
- package/dist/lib/types/store/product-attribute-term/product.attribute.term.request.js +18 -0
- package/dist/lib/types/store/product-attribute-term/product.attribute.term.request.js.map +1 -0
- package/dist/lib/types/store/product-attribute-term/product.attribute.term.response.d.ts +9 -0
- package/dist/lib/types/store/product-attribute-term/product.attribute.term.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-attribute-term/product.attribute.term.response.js +8 -0
- package/dist/lib/types/store/product-attribute-term/product.attribute.term.response.js.map +1 -0
- package/dist/lib/types/store/product-brand/index.d.ts +2 -0
- package/dist/lib/types/store/product-brand/index.d.ts.map +1 -0
- package/dist/lib/types/store/product-brand/index.js +2 -0
- package/dist/lib/types/store/product-brand/index.js.map +1 -0
- package/dist/lib/types/store/product-brand/product.brand.response.d.ts +22 -0
- package/dist/lib/types/store/product-brand/product.brand.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-brand/product.brand.response.js +14 -0
- package/dist/lib/types/store/product-brand/product.brand.response.js.map +1 -0
- package/dist/lib/types/store/product-category/index.d.ts +3 -0
- package/dist/lib/types/store/product-category/index.d.ts.map +1 -0
- package/dist/lib/types/store/product-category/index.js +3 -0
- package/dist/lib/types/store/product-category/index.js.map +1 -0
- package/dist/lib/types/store/product-category/product.category.request.d.ts +8 -0
- package/dist/lib/types/store/product-category/product.category.request.d.ts.map +1 -0
- package/dist/lib/types/store/product-category/product.category.request.js +3 -0
- package/dist/lib/types/store/product-category/product.category.request.js.map +1 -0
- package/dist/lib/types/store/product-category/product.category.response.d.ts +22 -0
- package/dist/lib/types/store/product-category/product.category.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-category/product.category.response.js +14 -0
- package/dist/lib/types/store/product-category/product.category.response.js.map +1 -0
- package/dist/lib/types/store/product-collection-data/index.d.ts +7 -0
- package/dist/lib/types/store/product-collection-data/index.d.ts.map +1 -0
- package/dist/lib/types/store/product-collection-data/index.js +7 -0
- package/dist/lib/types/store/product-collection-data/index.js.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.attribute.counts.response.d.ts +7 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.attribute.counts.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.attribute.counts.response.js +6 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.attribute.counts.response.js.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.price.range.response.d.ts +14 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.price.range.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.price.range.response.js +13 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.price.range.response.js.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.rating.counts.response.d.ts +7 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.rating.counts.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.rating.counts.response.js +6 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.rating.counts.response.js.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.request.d.ts +13 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.request.d.ts.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.request.js +36 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.request.js.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.response.d.ts +28 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.response.js +12 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.response.js.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.taxonomy.counts.response.d.ts +7 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.taxonomy.counts.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.taxonomy.counts.response.js +6 -0
- package/dist/lib/types/store/product-collection-data/product.collection.data.taxonomy.counts.response.js.map +1 -0
- package/dist/lib/types/store/product-review/index.d.ts +3 -0
- package/dist/lib/types/store/product-review/index.d.ts.map +1 -0
- package/dist/lib/types/store/product-review/index.js +3 -0
- package/dist/lib/types/store/product-review/index.js.map +1 -0
- package/dist/lib/types/store/product-review/product.review.request.d.ts +21 -0
- package/dist/lib/types/store/product-review/product.review.request.d.ts.map +1 -0
- package/dist/lib/types/store/product-review/product.review.request.js +22 -0
- package/dist/lib/types/store/product-review/product.review.request.js.map +1 -0
- package/dist/lib/types/store/product-review/product.review.response.d.ts +26 -0
- package/dist/lib/types/store/product-review/product.review.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-review/product.review.response.js +18 -0
- package/dist/lib/types/store/product-review/product.review.response.js.map +1 -0
- package/dist/lib/types/store/product-tag/index.d.ts +3 -0
- package/dist/lib/types/store/product-tag/index.d.ts.map +1 -0
- package/dist/lib/types/store/product-tag/index.js +3 -0
- package/dist/lib/types/store/product-tag/index.js.map +1 -0
- package/dist/lib/types/store/product-tag/product.tag.request.d.ts +8 -0
- package/dist/lib/types/store/product-tag/product.tag.request.d.ts.map +1 -0
- package/dist/lib/types/store/product-tag/product.tag.request.js +3 -0
- package/dist/lib/types/store/product-tag/product.tag.request.js.map +1 -0
- package/dist/lib/types/store/product-tag/product.tag.response.d.ts +11 -0
- package/dist/lib/types/store/product-tag/product.tag.response.d.ts.map +1 -0
- package/dist/lib/types/store/product-tag/product.tag.response.js +10 -0
- package/dist/lib/types/store/product-tag/product.tag.response.js.map +1 -0
- package/dist/lib/utilities/axios.utility.d.ts +9 -0
- package/dist/lib/utilities/axios.utility.d.ts.map +1 -0
- package/dist/lib/utilities/axios.utility.js +82 -0
- package/dist/lib/utilities/axios.utility.js.map +1 -0
- package/dist/lib/utilities/common.d.ts +14 -0
- package/dist/lib/utilities/common.d.ts.map +1 -0
- package/dist/lib/utilities/common.js +29 -0
- package/dist/lib/utilities/common.js.map +1 -0
- package/dist/lib/utilities/jwt.utility.d.ts +3 -0
- package/dist/lib/utilities/jwt.utility.d.ts.map +1 -0
- package/dist/lib/utilities/jwt.utility.js +15 -0
- package/dist/lib/utilities/jwt.utility.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BaseService } from '../base.service.js';
|
|
2
|
+
import { ApiPaginationResult, ApiResult } from '../../types/api.js';
|
|
3
|
+
import { CartCouponResponse } from '../../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Cart Coupons API
|
|
6
|
+
*/
|
|
7
|
+
export declare class CartCouponService extends BaseService {
|
|
8
|
+
private readonly endpoint;
|
|
9
|
+
/**
|
|
10
|
+
* List Cart Coupons
|
|
11
|
+
* @returns {CartCouponResponse[]}
|
|
12
|
+
*/
|
|
13
|
+
list(): Promise<ApiPaginationResult<CartCouponResponse[]>>;
|
|
14
|
+
/**
|
|
15
|
+
* Get a single cart coupon.
|
|
16
|
+
* @param code The coupon code of the cart coupon to retrieve.
|
|
17
|
+
* @returns {CartCouponResponse}
|
|
18
|
+
*/
|
|
19
|
+
single(code: string): Promise<ApiResult<CartCouponResponse>>;
|
|
20
|
+
/**
|
|
21
|
+
* Apply a coupon to the cart. Returns the new coupon object that was applied, or an error if it was not applied.
|
|
22
|
+
* @param code The coupon code you wish to apply to the cart.
|
|
23
|
+
* @returns {CartCouponResponse}
|
|
24
|
+
*/
|
|
25
|
+
add(code: string): Promise<ApiResult<CartCouponResponse>>;
|
|
26
|
+
/**
|
|
27
|
+
* Delete/remove a coupon from the cart.
|
|
28
|
+
* @param code The coupon code you wish to remove from the cart.
|
|
29
|
+
* @returns {unknown}
|
|
30
|
+
*/
|
|
31
|
+
delete(code: string): Promise<ApiResult<unknown>>;
|
|
32
|
+
/**
|
|
33
|
+
* Delete/remove all coupons from the cart.
|
|
34
|
+
* @returns {CartCouponResponse[]}
|
|
35
|
+
*/
|
|
36
|
+
clear(): Promise<ApiResult<CartCouponResponse[]>>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=cart.coupon.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.coupon.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/store/cart.coupon.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsC;IAE/D;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAShE;;;;OAIG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAOlE;;;;OAIG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAe/D;;;;OAIG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAevD;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC,CAAC;CAcxD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { BaseService } from '../base.service.js';
|
|
3
|
+
import { doDelete, doGet, doPost } from '../../utilities/axios.utility.js';
|
|
4
|
+
import { extractPagination } from '../../utilities/common.js';
|
|
5
|
+
/**
|
|
6
|
+
* Cart Coupons API
|
|
7
|
+
*/
|
|
8
|
+
export class CartCouponService extends BaseService {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.endpoint = 'wp-json/wc/store/v1/cart/coupons';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* List Cart Coupons
|
|
15
|
+
* @returns {CartCouponResponse[]}
|
|
16
|
+
*/
|
|
17
|
+
list() {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const url = `/${this.endpoint}`;
|
|
20
|
+
const { data, error, headers } = yield doGet(url);
|
|
21
|
+
const { total, totalPages, link } = extractPagination(headers);
|
|
22
|
+
return { data, error, total: total, totalPages, link };
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get a single cart coupon.
|
|
27
|
+
* @param code The coupon code of the cart coupon to retrieve.
|
|
28
|
+
* @returns {CartCouponResponse}
|
|
29
|
+
*/
|
|
30
|
+
single(code) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const url = `/${this.endpoint}/${code}`;
|
|
33
|
+
const { data, error } = yield doGet(url);
|
|
34
|
+
return { data, error };
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Apply a coupon to the cart. Returns the new coupon object that was applied, or an error if it was not applied.
|
|
39
|
+
* @param code The coupon code you wish to apply to the cart.
|
|
40
|
+
* @returns {CartCouponResponse}
|
|
41
|
+
*/
|
|
42
|
+
add(code) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const url = `/${this.endpoint}?code=${code}`;
|
|
45
|
+
this.events.emit('cart:loading', true);
|
|
46
|
+
this.events.emit('cart:request:start');
|
|
47
|
+
const { data, error } = yield doPost(url);
|
|
48
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
49
|
+
this.events.emitIf(!!error, 'cart:request:error', error);
|
|
50
|
+
this.events.emit('cart:loading', false);
|
|
51
|
+
return { data, error };
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Delete/remove a coupon from the cart.
|
|
56
|
+
* @param code The coupon code you wish to remove from the cart.
|
|
57
|
+
* @returns {unknown}
|
|
58
|
+
*/
|
|
59
|
+
delete(code) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const url = `/${this.endpoint}/${code}`;
|
|
62
|
+
this.events.emit('cart:loading', true);
|
|
63
|
+
this.events.emit('cart:request:start');
|
|
64
|
+
const { data, error } = yield doDelete(url);
|
|
65
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
66
|
+
this.events.emitIf(!!error, 'cart:request:error', error);
|
|
67
|
+
this.events.emit('cart:loading', false);
|
|
68
|
+
return { data, error };
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Delete/remove all coupons from the cart.
|
|
73
|
+
* @returns {CartCouponResponse[]}
|
|
74
|
+
*/
|
|
75
|
+
clear() {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const url = `/${this.endpoint}`;
|
|
78
|
+
this.events.emit('cart:loading', true);
|
|
79
|
+
this.events.emit('cart:request:start');
|
|
80
|
+
const { data, error } = yield doDelete(url);
|
|
81
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
82
|
+
this.events.emitIf(!!error, 'cart:request:error', error);
|
|
83
|
+
this.events.emit('cart:loading', false);
|
|
84
|
+
return { data, error };
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=cart.coupon.service.js.map
|
|
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C;YAEhC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;YAEvC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,QAAQ,CAAuB,GAAG,CAAC,CAAC;YAElE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;YACnD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,oBAAoB,EAAE,KAAK,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;YAExC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QACzB,CAAC;KAAA;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseService } from '../base.service.js';
|
|
2
|
+
import { ApiResult } from '../../types/api.js';
|
|
3
|
+
import { CartExtensionsRequest, CartExtensionsResponse } from '../../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Cart Extensions API
|
|
6
|
+
*
|
|
7
|
+
* The cart extensions API allows third-party plugins to store and retrieve data during the cart and checkout processes.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CartExtensionsService extends BaseService {
|
|
10
|
+
private readonly endpoint;
|
|
11
|
+
/**
|
|
12
|
+
* Store Extension Data
|
|
13
|
+
* Store data from third-party extensions in the cart
|
|
14
|
+
* @param params - Extension data to store
|
|
15
|
+
* @returns {CartExtensionsResponse} - Response indicating success/failure
|
|
16
|
+
*/
|
|
17
|
+
store(params: CartExtensionsRequest): Promise<ApiResult<CartExtensionsResponse>>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=cart.extensions.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.extensions.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/store/cart.extensions.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAE9B;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,WAAW;IACpD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyC;IAElE;;;;;OAKG;IACG,KAAK,CACT,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;CAmB9C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { BaseService } from '../base.service.js';
|
|
3
|
+
import { doPost } from '../../utilities/axios.utility.js';
|
|
4
|
+
/**
|
|
5
|
+
* Cart Extensions API
|
|
6
|
+
*
|
|
7
|
+
* The cart extensions API allows third-party plugins to store and retrieve data during the cart and checkout processes.
|
|
8
|
+
*/
|
|
9
|
+
export class CartExtensionsService extends BaseService {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.endpoint = 'wp-json/wc/store/v1/cart/extensions';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Store Extension Data
|
|
16
|
+
* Store data from third-party extensions in the cart
|
|
17
|
+
* @param params - Extension data to store
|
|
18
|
+
* @returns {CartExtensionsResponse} - Response indicating success/failure
|
|
19
|
+
*/
|
|
20
|
+
store(params) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const url = `/${this.endpoint}`;
|
|
23
|
+
const options = {};
|
|
24
|
+
this.events.emit('cart:extensions:loading', true);
|
|
25
|
+
this.events.emit('cart:extensions:request:start');
|
|
26
|
+
const { data, error } = yield doPost(url, params, options);
|
|
27
|
+
this.events.emitIf(!!data, 'cart:extensions:request:success');
|
|
28
|
+
this.events.emitIf(!!error, 'cart:extensions:request:error', { error });
|
|
29
|
+
this.events.emit('cart:extensions:loading', false);
|
|
30
|
+
return { data, error };
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=cart.extensions.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.extensions.service.js","sourceRoot":"","sources":["../../../../src/lib/services/store/cart.extensions.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAO1D;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IAAtD;;QACmB,aAAQ,GAAG,qCAAqC,CAAC;IA6BpE,CAAC;IA3BC;;;;;OAKG;IACG,KAAK,CACT,MAA6B;;YAE7B,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAEhC,MAAM,OAAO,GAAuB,EAAE,CAAC;YAEvC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;YAClD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;YAElD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAGlC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAExB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,iCAAiC,CAAC,CAAC;YAC9D,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,+BAA+B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YACxE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;YAEnD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QACzB,CAAC;KAAA;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseService } from '../base.service.js';
|
|
2
|
+
import { ApiPaginationResult, ApiResult } from '../../types/api.js';
|
|
3
|
+
import { CartItemResponse, CartItemAddRequest } from '../../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Cart Items API
|
|
6
|
+
*/
|
|
7
|
+
export declare class CartItemService extends BaseService {
|
|
8
|
+
private readonly endpoint;
|
|
9
|
+
/**
|
|
10
|
+
* List Cart Items
|
|
11
|
+
* @returns {CartItemResponse[]}
|
|
12
|
+
*/
|
|
13
|
+
list(): Promise<ApiPaginationResult<CartItemResponse[]>>;
|
|
14
|
+
/**
|
|
15
|
+
* Get a single cart item by its key.
|
|
16
|
+
* @param key The key of the cart item to retrieve.
|
|
17
|
+
* @returns {CartItemResponse}
|
|
18
|
+
*/
|
|
19
|
+
single(key: string): Promise<ApiResult<CartItemResponse>>;
|
|
20
|
+
/**
|
|
21
|
+
* Add Cart Item
|
|
22
|
+
* @param params
|
|
23
|
+
* @returns {CartItemResponse}
|
|
24
|
+
*/
|
|
25
|
+
add(params: CartItemAddRequest): Promise<ApiResult<CartItemResponse>>;
|
|
26
|
+
/**
|
|
27
|
+
* Edit Single Cart Item
|
|
28
|
+
* @param key The key of the cart item to edit.
|
|
29
|
+
* @param quantity Quantity of this item in the cart.
|
|
30
|
+
* @returns {CartItemResponse}
|
|
31
|
+
*/
|
|
32
|
+
update(key: string, quantity: number): Promise<ApiResult<CartItemResponse>>;
|
|
33
|
+
/**
|
|
34
|
+
* Delete Single Cart Item
|
|
35
|
+
* @param key The key of the cart item to edit.
|
|
36
|
+
* @returns {unknown}
|
|
37
|
+
*/
|
|
38
|
+
remove(key: string): Promise<ApiResult<unknown>>;
|
|
39
|
+
/**
|
|
40
|
+
* Delete All Cart Items
|
|
41
|
+
* @returns {CartItemResponse[]}
|
|
42
|
+
*/
|
|
43
|
+
clear(): Promise<ApiResult<CartItemResponse[]>>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=cart.item.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.item.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/store/cart.item.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAUjD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE5E;;GAEG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoC;IAE7D;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAe9D;;;;OAIG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAU/D;;;;OAIG;IACG,GAAG,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAsB3E;;;;;OAKG;IACG,MAAM,CACV,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAsBvC;;;;OAIG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAiBtD;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC;CAgBtD"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { BaseService } from '../base.service.js';
|
|
3
|
+
import { doDelete, doGet, doPost, doPut, } from '../../utilities/axios.utility.js';
|
|
4
|
+
import { extractPagination } from '../../utilities/common.js';
|
|
5
|
+
import * as qs from 'qs';
|
|
6
|
+
/**
|
|
7
|
+
* Cart Items API
|
|
8
|
+
*/
|
|
9
|
+
export class CartItemService extends BaseService {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.endpoint = 'wp-json/wc/store/v1/cart/items';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* List Cart Items
|
|
16
|
+
* @returns {CartItemResponse[]}
|
|
17
|
+
*/
|
|
18
|
+
list() {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const url = `/${this.endpoint}`;
|
|
21
|
+
const options = {};
|
|
22
|
+
const { data, error, headers } = yield doGet(url, options);
|
|
23
|
+
const { total, totalPages, link } = extractPagination(headers);
|
|
24
|
+
return { data, error, total, totalPages, link };
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get a single cart item by its key.
|
|
29
|
+
* @param key The key of the cart item to retrieve.
|
|
30
|
+
* @returns {CartItemResponse}
|
|
31
|
+
*/
|
|
32
|
+
single(key) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const url = `/${this.endpoint}/${key}`;
|
|
35
|
+
const options = {};
|
|
36
|
+
const { data, error } = yield doGet(url, options);
|
|
37
|
+
return { data, error };
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Add Cart Item
|
|
42
|
+
* @param params
|
|
43
|
+
* @returns {CartItemResponse}
|
|
44
|
+
*/
|
|
45
|
+
add(params) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const query = qs.stringify(params, { encode: true });
|
|
48
|
+
const url = `/${this.endpoint}?${query}`;
|
|
49
|
+
const options = {};
|
|
50
|
+
this.events.emit('cart:loading', true);
|
|
51
|
+
this.events.emit('cart:request:start');
|
|
52
|
+
const { data, error } = yield doPost(url, undefined, options);
|
|
53
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
54
|
+
this.events.emitIf(!!error, 'cart:request:error', error);
|
|
55
|
+
this.events.emit('cart:loading', false);
|
|
56
|
+
return { data, error };
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Edit Single Cart Item
|
|
61
|
+
* @param key The key of the cart item to edit.
|
|
62
|
+
* @param quantity Quantity of this item in the cart.
|
|
63
|
+
* @returns {CartItemResponse}
|
|
64
|
+
*/
|
|
65
|
+
update(key, quantity) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const query = qs.stringify({ quantity: quantity }, { encode: true });
|
|
68
|
+
const url = `/${this.endpoint}/${key}?${query}`;
|
|
69
|
+
const options = {};
|
|
70
|
+
this.events.emit('cart:loading', true);
|
|
71
|
+
this.events.emit('cart:request:start');
|
|
72
|
+
const { data, error } = yield doPut(url, undefined, options);
|
|
73
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
74
|
+
this.events.emitIf(!!error, 'cart:request:error', error);
|
|
75
|
+
this.events.emit('cart:loading', false);
|
|
76
|
+
return { data, error };
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Delete Single Cart Item
|
|
81
|
+
* @param key The key of the cart item to edit.
|
|
82
|
+
* @returns {unknown}
|
|
83
|
+
*/
|
|
84
|
+
remove(key) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
const url = `/${this.endpoint}/${key}`;
|
|
87
|
+
const options = {};
|
|
88
|
+
this.events.emit('cart:loading', true);
|
|
89
|
+
this.events.emit('cart:request:start');
|
|
90
|
+
const { data, error } = yield doDelete(url, options);
|
|
91
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
92
|
+
this.events.emitIf(!!error, 'cart:request:error', error);
|
|
93
|
+
this.events.emit('cart:loading', false);
|
|
94
|
+
return { data, error };
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Delete All Cart Items
|
|
99
|
+
* @returns {CartItemResponse[]}
|
|
100
|
+
*/
|
|
101
|
+
clear() {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
const url = `/${this.endpoint}`;
|
|
104
|
+
const options = {};
|
|
105
|
+
this.events.emit('cart:loading', true);
|
|
106
|
+
this.events.emit('cart:request:start');
|
|
107
|
+
const { data, error } = yield doDelete(url, options);
|
|
108
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
109
|
+
this.events.emitIf(!!error, 'cart:request:error', error);
|
|
110
|
+
this.events.emit('cart:loading', false);
|
|
111
|
+
return { data, error };
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=cart.item.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.item.service.js","sourceRoot":"","sources":["../../../../src/lib/services/store/cart.item.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,GACN,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAAhD;;QACmB,aAAQ,GAAG,gCAAgC,CAAC;IAwI/D,CAAC;IAtIC;;;OAGG;IACG,IAAI;;YACR,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAEhC,MAAM,OAAO,GAAuB,EAAE,CAAC;YAEvC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,KAAK,CAC1C,GAAG,EACH,OAAO,CACR,CAAC;YAEF,MAAM,EAAE,KAA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, CartItemAddRequest, CartCustomerRequest } from '../../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Cart API
|
|
6
|
+
*
|
|
7
|
+
* The cart API returns the current state of the cart for the current session or logged in user.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CartService extends BaseService {
|
|
10
|
+
private readonly endpoint;
|
|
11
|
+
/**
|
|
12
|
+
* Get Cart
|
|
13
|
+
* @returns {CartResponse}
|
|
14
|
+
*/
|
|
15
|
+
get(): Promise<ApiResult<CartResponse>>;
|
|
16
|
+
/**
|
|
17
|
+
* Add Item
|
|
18
|
+
* @param params
|
|
19
|
+
* @returns {CartResponse}
|
|
20
|
+
*/
|
|
21
|
+
add(params: CartItemAddRequest): Promise<ApiResult<CartResponse>>;
|
|
22
|
+
/**
|
|
23
|
+
* Update Item
|
|
24
|
+
* @param key The key of the cart item to edit.
|
|
25
|
+
* @param quantity Quantity of this item in the cart.
|
|
26
|
+
* @returns {CartResponse}
|
|
27
|
+
*/
|
|
28
|
+
update(key: string, quantity: number): Promise<ApiResult<CartResponse>>;
|
|
29
|
+
/**
|
|
30
|
+
* Remove Item
|
|
31
|
+
* @param key
|
|
32
|
+
* @returns {CartResponse}
|
|
33
|
+
*/
|
|
34
|
+
remove(key: string): Promise<ApiResult<CartResponse>>;
|
|
35
|
+
/**
|
|
36
|
+
* Apply Coupon
|
|
37
|
+
* @param code The coupon code you wish to apply to the cart.
|
|
38
|
+
* @returns {CartResponse}
|
|
39
|
+
*/
|
|
40
|
+
applyCoupon(code: string): Promise<ApiResult<CartResponse>>;
|
|
41
|
+
/**
|
|
42
|
+
* Remove Coupon
|
|
43
|
+
* @param code The coupon code you wish to remove from the cart.
|
|
44
|
+
* @returns {CartResponse}
|
|
45
|
+
*/
|
|
46
|
+
removeCoupon(code: string): Promise<ApiResult<CartResponse>>;
|
|
47
|
+
/**
|
|
48
|
+
* Update Customer
|
|
49
|
+
* @param body
|
|
50
|
+
* @returns {CartResponse}
|
|
51
|
+
*/
|
|
52
|
+
updateCustomer(body: CartCustomerRequest): Promise<ApiResult<CartResponse>>;
|
|
53
|
+
/**
|
|
54
|
+
* Select Shipping Rate
|
|
55
|
+
* @param packageId The ID of the shipping package within the cart.
|
|
56
|
+
* @param rateId The chosen rate ID for the package.
|
|
57
|
+
* @returns {CartResponse}s
|
|
58
|
+
*/
|
|
59
|
+
selectShippingRate(packageId: number, rateId: string): Promise<ApiResult<CartResponse>>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=cart.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/store/cart.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8B;IAEvD;;;OAGG;IACG,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAkB7C;;;;OAIG;IACG,GAAG,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAuBvE;;;;;OAKG;IACG,MAAM,CACV,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAuBnC;;;;OAIG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAsB3D;;;;OAIG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAsBjE;;;;OAIG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAsBlE;;;;OAIG;IACG,cAAc,CAClB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAsBnC;;;;;OAKG;IACG,kBAAkB,CACtB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;CAsBpC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import * as qs from 'qs';
|
|
3
|
+
import { BaseService } from '../base.service.js';
|
|
4
|
+
import { doGet, doPost } from '../../utilities/axios.utility.js';
|
|
5
|
+
/**
|
|
6
|
+
* Cart API
|
|
7
|
+
*
|
|
8
|
+
* The cart API returns the current state of the cart for the current session or logged in user.
|
|
9
|
+
*/
|
|
10
|
+
export class CartService extends BaseService {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.endpoint = 'wp-json/wc/store/v1/cart';
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get Cart
|
|
17
|
+
* @returns {CartResponse}
|
|
18
|
+
*/
|
|
19
|
+
get() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const url = `/${this.endpoint}`;
|
|
22
|
+
const options = {};
|
|
23
|
+
this.events.emit('cart:loading', true);
|
|
24
|
+
this.events.emit('cart:request:start');
|
|
25
|
+
const { data, error } = yield doGet(url, options);
|
|
26
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
27
|
+
this.events.emitIf(!!error, 'cart:request:error', { error });
|
|
28
|
+
this.events.emitIf(!!data, 'cart:updated', data);
|
|
29
|
+
this.events.emit('cart:loading', false);
|
|
30
|
+
return { data, error };
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Add Item
|
|
35
|
+
* @param params
|
|
36
|
+
* @returns {CartResponse}
|
|
37
|
+
*/
|
|
38
|
+
add(params) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const query = qs.stringify(params, { encode: true });
|
|
41
|
+
const url = `/${this.endpoint}/add-item?${query}`;
|
|
42
|
+
const options = {};
|
|
43
|
+
this.events.emit('cart:loading', true);
|
|
44
|
+
this.events.emit('cart:request:start');
|
|
45
|
+
const { data, error } = yield doPost(url, undefined, options);
|
|
46
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
47
|
+
this.events.emitIf(!!error, 'cart:request:error', { error });
|
|
48
|
+
this.events.emitIf(!!data, 'cart:updated', data);
|
|
49
|
+
this.events.emit('cart:loading', false);
|
|
50
|
+
return { data, error };
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Update Item
|
|
55
|
+
* @param key The key of the cart item to edit.
|
|
56
|
+
* @param quantity Quantity of this item in the cart.
|
|
57
|
+
* @returns {CartResponse}
|
|
58
|
+
*/
|
|
59
|
+
update(key, quantity) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const query = qs.stringify({ key, quantity }, { encode: true });
|
|
62
|
+
const url = `/${this.endpoint}/update-item?${query}`;
|
|
63
|
+
const options = {};
|
|
64
|
+
this.events.emit('cart:loading', true);
|
|
65
|
+
this.events.emit('cart:request:start');
|
|
66
|
+
const { data, error } = yield doPost(url, undefined, options);
|
|
67
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
68
|
+
this.events.emitIf(!!error, 'cart:request:error', { error });
|
|
69
|
+
this.events.emitIf(!!data, 'cart:updated', data);
|
|
70
|
+
this.events.emit('cart:loading', false);
|
|
71
|
+
return { data, error };
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Remove Item
|
|
76
|
+
* @param key
|
|
77
|
+
* @returns {CartResponse}
|
|
78
|
+
*/
|
|
79
|
+
remove(key) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const url = `/${this.endpoint}/remove-item?key=${key}`;
|
|
82
|
+
const options = {};
|
|
83
|
+
this.events.emit('cart:loading', true);
|
|
84
|
+
this.events.emit('cart:request:start');
|
|
85
|
+
const { data, error } = yield doPost(url, undefined, options);
|
|
86
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
87
|
+
this.events.emitIf(!!error, 'cart:request:error', { error });
|
|
88
|
+
this.events.emitIf(!!data, 'cart:updated', data);
|
|
89
|
+
this.events.emit('cart:loading', false);
|
|
90
|
+
return { data, error };
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Apply Coupon
|
|
95
|
+
* @param code The coupon code you wish to apply to the cart.
|
|
96
|
+
* @returns {CartResponse}
|
|
97
|
+
*/
|
|
98
|
+
applyCoupon(code) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const url = `/${this.endpoint}/apply-coupon?code=${code}`;
|
|
101
|
+
const options = {};
|
|
102
|
+
this.events.emit('cart:loading', true);
|
|
103
|
+
this.events.emit('cart:request:start');
|
|
104
|
+
const { data, error } = yield doPost(url, undefined, options);
|
|
105
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
106
|
+
this.events.emitIf(!!error, 'cart:request:error', { error });
|
|
107
|
+
this.events.emitIf(!!data, 'cart:updated', data);
|
|
108
|
+
this.events.emit('cart:loading', false);
|
|
109
|
+
return { data, error };
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Remove Coupon
|
|
114
|
+
* @param code The coupon code you wish to remove from the cart.
|
|
115
|
+
* @returns {CartResponse}
|
|
116
|
+
*/
|
|
117
|
+
removeCoupon(code) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const url = `/${this.endpoint}/remove-coupon?code=${code}`;
|
|
120
|
+
const options = {};
|
|
121
|
+
this.events.emit('cart:loading', true);
|
|
122
|
+
this.events.emit('cart:request:start');
|
|
123
|
+
const { data, error } = yield doPost(url, undefined, options);
|
|
124
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
125
|
+
this.events.emitIf(!!error, 'cart:request:error', { error });
|
|
126
|
+
this.events.emitIf(!!data, 'cart:updated', data);
|
|
127
|
+
this.events.emit('cart:loading', false);
|
|
128
|
+
return { data, error };
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Update Customer
|
|
133
|
+
* @param body
|
|
134
|
+
* @returns {CartResponse}
|
|
135
|
+
*/
|
|
136
|
+
updateCustomer(body) {
|
|
137
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
const url = `/${this.endpoint}/update-customer`;
|
|
139
|
+
const options = {};
|
|
140
|
+
this.events.emit('cart:loading', true);
|
|
141
|
+
this.events.emit('cart:request:start');
|
|
142
|
+
const { data, error } = yield doPost(url, body, options);
|
|
143
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
144
|
+
this.events.emitIf(!!error, 'cart:request:error', { error });
|
|
145
|
+
this.events.emitIf(!!data, 'cart:updated', data);
|
|
146
|
+
this.events.emit('cart:loading', false);
|
|
147
|
+
return { data, error };
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Select Shipping Rate
|
|
152
|
+
* @param packageId The ID of the shipping package within the cart.
|
|
153
|
+
* @param rateId The chosen rate ID for the package.
|
|
154
|
+
* @returns {CartResponse}s
|
|
155
|
+
*/
|
|
156
|
+
selectShippingRate(packageId, rateId) {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
// Fixed: use query string form. Path segment form caused rest_no_route errors.
|
|
159
|
+
const url = `/${this.endpoint}/select-shipping-rate?package_id=${packageId}&rate_id=${rateId}`;
|
|
160
|
+
const options = {};
|
|
161
|
+
this.events.emit('cart:loading', true);
|
|
162
|
+
this.events.emit('cart:request:start');
|
|
163
|
+
const { data, error } = yield doPost(url, undefined, options);
|
|
164
|
+
this.events.emitIf(!!data, 'cart:request:success');
|
|
165
|
+
this.events.emitIf(!!error, 'cart:request:error', { error });
|
|
166
|
+
this.events.emitIf(!!data, 'cart:updated', data);
|
|
167
|
+
this.events.emit('cart:loading', false);
|
|
168
|
+
return { data, error };
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=cart.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.service.js","sourceRoot":"","sources":["../../../../src/lib/services/store/cart.service.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAQjE;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;QACmB,aAAQ,GAAG,0BAA0B,CAAC;IAiOzD,CAAC;IA/NC;;;OAGG;IACG,GAAG;;YACP,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAEhC,MAAM,OAAO,GAAuB,EAAE,CAAC;YAEvC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;YAEvC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,KAAK,CAAe,GAAG,EAAE,OAAO,CAAC,CAAC;YAEhE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;YACnD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,oBAAoB,EAAE,EAAE,KAAK,EAAE,CAAC,C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I,CAAC,CAAC;YACjD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;YAExC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QACzB,CAAC;KAAA;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseService } from '../base.service.js';
|
|
2
|
+
import { ApiResult } from '../../types/api.js';
|
|
3
|
+
import { OrderRequest, CheckoutResponse } from '../../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Checkout order API
|
|
6
|
+
*
|
|
7
|
+
* The checkout order API facilitates the processing of existing orders and handling payments.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CheckoutOrderService extends BaseService {
|
|
10
|
+
private readonly endpoint;
|
|
11
|
+
/**
|
|
12
|
+
* Process Order and Payment
|
|
13
|
+
* @param orderId
|
|
14
|
+
* @param params
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
order(orderId: number, params: OrderRequest): Promise<ApiResult<CheckoutResponse>>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=checkout.order.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout.order.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/store/checkout.order.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEtE;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAE3D;;;;;OAKG;IACG,KAAK,CACT,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;CAaxC"}
|