@djust-b2b/djust-front-sdk 3.0.0-beta.9 → 3.0.1
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 +34 -30
- package/dist/.tsbuildinfo +1 -1
- package/dist/.tsbuildinfo-esm +1 -1
- package/dist/client/create-client.d.ts +18 -0
- package/dist/client/create-client.d.ts.map +1 -1
- package/dist/client/transport.d.ts +5 -0
- package/dist/client/transport.d.ts.map +1 -1
- package/dist/errors/classes/not-found.error.d.ts +1 -1
- package/dist/errors/classes/not-found.error.d.ts.map +1 -1
- package/dist/errors/factory.d.ts.map +1 -1
- package/dist/errors/helpers/djust-api-error.d.ts +29 -0
- package/dist/errors/helpers/djust-api-error.d.ts.map +1 -0
- package/dist/errors/types.d.ts +4 -0
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/index.d.ts +42 -40
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +269 -63
- package/dist/interfaces/index.d.ts +15 -3
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/services/base.service.d.ts +2 -0
- package/dist/services/base.service.d.ts.map +1 -1
- package/dist/services/commercial-order/commercial-order.service.d.ts +8 -5
- package/dist/services/commercial-order/commercial-order.service.d.ts.map +1 -1
- package/dist/services/commercial-order/definitions.d.ts +13 -0
- package/dist/services/commercial-order/definitions.d.ts.map +1 -1
- package/dist/services/commercial-order/index.d.ts +30 -19
- package/dist/services/commercial-order/index.d.ts.map +1 -1
- package/dist/services/commercial-order/module.d.ts +1 -1
- package/dist/services/commercial-order/module.d.ts.map +1 -1
- package/dist/services/commercial-order/types.d.ts +1 -0
- package/dist/services/commercial-order/types.d.ts.map +1 -1
- package/dist/services/logistic-order/definitions.d.ts +23 -1
- package/dist/services/logistic-order/definitions.d.ts.map +1 -1
- package/dist/services/logistic-order/endpoints.d.ts +1 -0
- package/dist/services/logistic-order/endpoints.d.ts.map +1 -1
- package/dist/services/logistic-order/index.d.ts +77 -1
- package/dist/services/logistic-order/index.d.ts.map +1 -1
- package/dist/services/logistic-order/logistic-order.service.d.ts +6 -1
- package/dist/services/logistic-order/logistic-order.service.d.ts.map +1 -1
- package/dist/services/logistic-order/module.d.ts +1 -1
- package/dist/services/logistic-order/module.d.ts.map +1 -1
- package/dist/services/logistic-order/types.d.ts +9 -0
- package/dist/services/logistic-order/types.d.ts.map +1 -1
- package/dist/services/operation/definitions.d.ts +1 -18
- package/dist/services/operation/definitions.d.ts.map +1 -1
- package/dist/services/payment/definitions.d.ts +0 -10
- package/dist/services/payment/definitions.d.ts.map +1 -1
- package/dist/services/product/definitions.d.ts +1 -0
- package/dist/services/product/definitions.d.ts.map +1 -1
- package/dist/services/product/index.d.ts +6 -5
- package/dist/services/product/index.d.ts.map +1 -1
- package/dist/services/product-variant/definitions.d.ts +3 -142
- package/dist/services/product-variant/definitions.d.ts.map +1 -1
- package/dist/services/quote/index.d.ts +1 -1
- package/dist/settings/fetch-instance.d.ts.map +1 -1
- package/dist/settings/sdk-version.d.ts +3 -0
- package/dist/settings/sdk-version.d.ts.map +1 -0
- package/lib/.tsbuildinfo +1 -0
- package/lib/client/create-client.d.ts +251 -0
- package/lib/client/create-client.d.ts.map +1 -0
- package/lib/client/create-client.js +233 -0
- package/lib/client/create-client.js.map +1 -0
- package/lib/client/index.d.ts +14 -0
- package/lib/client/index.d.ts.map +1 -0
- package/lib/client/index.js +91 -0
- package/lib/client/index.js.map +1 -0
- package/lib/client/performance.d.ts +203 -0
- package/lib/client/performance.d.ts.map +1 -0
- package/lib/client/performance.js +409 -0
- package/lib/client/performance.js.map +1 -0
- package/lib/client/transport.d.ts +372 -0
- package/lib/client/transport.d.ts.map +1 -0
- package/lib/client/transport.js +735 -0
- package/lib/client/transport.js.map +1 -0
- package/lib/errors/base.d.ts +101 -0
- package/lib/errors/base.d.ts.map +1 -0
- package/lib/errors/base.js +145 -0
- package/lib/errors/base.js.map +1 -0
- package/lib/errors/classes/auth.error.d.ts +64 -0
- package/lib/errors/classes/auth.error.d.ts.map +1 -0
- package/lib/errors/classes/auth.error.js +116 -0
- package/lib/errors/classes/auth.error.js.map +1 -0
- package/lib/errors/classes/forbidden.error.d.ts +52 -0
- package/lib/errors/classes/forbidden.error.d.ts.map +1 -0
- package/lib/errors/classes/forbidden.error.js +90 -0
- package/lib/errors/classes/forbidden.error.js.map +1 -0
- package/lib/errors/classes/index.d.ts +17 -0
- package/lib/errors/classes/index.d.ts.map +1 -0
- package/lib/errors/classes/index.js +29 -0
- package/lib/errors/classes/index.js.map +1 -0
- package/lib/errors/classes/network.error.d.ts +63 -0
- package/lib/errors/classes/network.error.d.ts.map +1 -0
- package/lib/errors/classes/network.error.js +122 -0
- package/lib/errors/classes/network.error.js.map +1 -0
- package/lib/errors/classes/not-found.error.d.ts +58 -0
- package/lib/errors/classes/not-found.error.d.ts.map +1 -0
- package/lib/errors/classes/not-found.error.js +120 -0
- package/lib/errors/classes/not-found.error.js.map +1 -0
- package/lib/errors/classes/rate-limit.error.d.ts +49 -0
- package/lib/errors/classes/rate-limit.error.d.ts.map +1 -0
- package/lib/errors/classes/rate-limit.error.js +107 -0
- package/lib/errors/classes/rate-limit.error.js.map +1 -0
- package/lib/errors/classes/server.error.d.ts +63 -0
- package/lib/errors/classes/server.error.d.ts.map +1 -0
- package/lib/errors/classes/server.error.js +156 -0
- package/lib/errors/classes/server.error.js.map +1 -0
- package/lib/errors/classes/timeout.error.d.ts +64 -0
- package/lib/errors/classes/timeout.error.d.ts.map +1 -0
- package/lib/errors/classes/timeout.error.js +90 -0
- package/lib/errors/classes/timeout.error.js.map +1 -0
- package/lib/errors/classes/unexpected.error.d.ts +70 -0
- package/lib/errors/classes/unexpected.error.d.ts.map +1 -0
- package/lib/errors/classes/unexpected.error.js +105 -0
- package/lib/errors/classes/unexpected.error.js.map +1 -0
- package/lib/errors/classes/validation.error.d.ts +68 -0
- package/lib/errors/classes/validation.error.d.ts.map +1 -0
- package/lib/errors/classes/validation.error.js +103 -0
- package/lib/errors/classes/validation.error.js.map +1 -0
- package/lib/errors/codes.d.ts +111 -0
- package/lib/errors/codes.d.ts.map +1 -0
- package/lib/errors/codes.js +143 -0
- package/lib/errors/codes.js.map +1 -0
- package/lib/errors/compat.d.ts +99 -0
- package/lib/errors/compat.d.ts.map +1 -0
- package/lib/errors/compat.js +280 -0
- package/lib/errors/compat.js.map +1 -0
- package/lib/errors/factory.d.ts +33 -0
- package/lib/errors/factory.d.ts.map +1 -0
- package/lib/errors/factory.js +298 -0
- package/lib/errors/factory.js.map +1 -0
- package/lib/errors/guards.d.ts +142 -0
- package/lib/errors/guards.d.ts.map +1 -0
- package/lib/errors/guards.js +281 -0
- package/lib/errors/guards.js.map +1 -0
- package/lib/errors/helpers/djust-api-error.d.ts +29 -0
- package/lib/errors/helpers/djust-api-error.d.ts.map +1 -0
- package/lib/errors/helpers/djust-api-error.js +49 -0
- package/lib/errors/helpers/djust-api-error.js.map +1 -0
- package/lib/errors/index.d.ts +25 -0
- package/lib/errors/index.d.ts.map +1 -0
- package/lib/errors/index.js +89 -0
- package/lib/errors/index.js.map +1 -0
- package/lib/errors/types.d.ts +104 -0
- package/lib/errors/types.d.ts.map +1 -0
- package/lib/errors/types.js +10 -0
- package/lib/errors/types.js.map +1 -0
- package/lib/helpers/index.d.ts +42 -0
- package/lib/helpers/index.d.ts.map +1 -0
- package/lib/helpers/index.js +102 -0
- package/lib/helpers/index.js.map +1 -0
- package/lib/helpers/parameters-validation.d.ts +3 -0
- package/lib/helpers/parameters-validation.d.ts.map +1 -0
- package/lib/helpers/parameters-validation.js +22 -0
- package/lib/helpers/parameters-validation.js.map +1 -0
- package/lib/helpers/utils.d.ts +5 -0
- package/lib/helpers/utils.d.ts.map +1 -0
- package/lib/helpers/utils.js +30 -0
- package/lib/helpers/utils.js.map +1 -0
- package/lib/index.d.ts +267 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +182 -0
- package/lib/index.js.map +1 -0
- package/lib/interfaces/index.d.ts +43 -0
- package/lib/interfaces/index.d.ts.map +1 -0
- package/lib/interfaces/index.js +36 -0
- package/lib/interfaces/index.js.map +1 -0
- package/lib/interfaces/models/address.d.ts +61 -0
- package/lib/interfaces/models/address.d.ts.map +1 -0
- package/lib/interfaces/models/address.js +3 -0
- package/lib/interfaces/models/address.js.map +1 -0
- package/lib/interfaces/models/attribute.d.ts +31 -0
- package/lib/interfaces/models/attribute.d.ts.map +1 -0
- package/lib/interfaces/models/attribute.js +3 -0
- package/lib/interfaces/models/attribute.js.map +1 -0
- package/lib/interfaces/models/auth.d.ts +37 -0
- package/lib/interfaces/models/auth.d.ts.map +1 -0
- package/lib/interfaces/models/auth.js +3 -0
- package/lib/interfaces/models/auth.js.map +1 -0
- package/lib/interfaces/models/cart.d.ts +64 -0
- package/lib/interfaces/models/cart.d.ts.map +1 -0
- package/lib/interfaces/models/cart.js +3 -0
- package/lib/interfaces/models/cart.js.map +1 -0
- package/lib/interfaces/models/common.d.ts +68 -0
- package/lib/interfaces/models/common.d.ts.map +1 -0
- package/lib/interfaces/models/common.js +3 -0
- package/lib/interfaces/models/common.js.map +1 -0
- package/lib/interfaces/models/custom-field.d.ts +57 -0
- package/lib/interfaces/models/custom-field.d.ts.map +1 -0
- package/lib/interfaces/models/custom-field.js +3 -0
- package/lib/interfaces/models/custom-field.js.map +1 -0
- package/lib/interfaces/models/customer-account.d.ts +52 -0
- package/lib/interfaces/models/customer-account.d.ts.map +1 -0
- package/lib/interfaces/models/customer-account.js +3 -0
- package/lib/interfaces/models/customer-account.js.map +1 -0
- package/lib/interfaces/models/customer-organisation.d.ts +14 -0
- package/lib/interfaces/models/customer-organisation.d.ts.map +1 -0
- package/lib/interfaces/models/customer-organisation.js +3 -0
- package/lib/interfaces/models/customer-organisation.js.map +1 -0
- package/lib/interfaces/models/customer-user.d.ts +114 -0
- package/lib/interfaces/models/customer-user.d.ts.map +1 -0
- package/lib/interfaces/models/customer-user.js +3 -0
- package/lib/interfaces/models/customer-user.js.map +1 -0
- package/lib/interfaces/models/incident.d.ts +37 -0
- package/lib/interfaces/models/incident.d.ts.map +1 -0
- package/lib/interfaces/models/incident.js +3 -0
- package/lib/interfaces/models/incident.js.map +1 -0
- package/lib/interfaces/models/navigation-category.d.ts +22 -0
- package/lib/interfaces/models/navigation-category.d.ts.map +1 -0
- package/lib/interfaces/models/navigation-category.js +3 -0
- package/lib/interfaces/models/navigation-category.js.map +1 -0
- package/lib/interfaces/models/offer.d.ts +151 -0
- package/lib/interfaces/models/offer.d.ts.map +1 -0
- package/lib/interfaces/models/offer.js +3 -0
- package/lib/interfaces/models/offer.js.map +1 -0
- package/lib/interfaces/models/order.d.ts +701 -0
- package/lib/interfaces/models/order.d.ts.map +1 -0
- package/lib/interfaces/models/order.js +3 -0
- package/lib/interfaces/models/order.js.map +1 -0
- package/lib/interfaces/models/payment.d.ts +20 -0
- package/lib/interfaces/models/payment.d.ts.map +1 -0
- package/lib/interfaces/models/payment.js +3 -0
- package/lib/interfaces/models/payment.js.map +1 -0
- package/lib/interfaces/models/price.d.ts +6 -0
- package/lib/interfaces/models/price.d.ts.map +1 -0
- package/lib/interfaces/models/price.js +3 -0
- package/lib/interfaces/models/price.js.map +1 -0
- package/lib/interfaces/models/product.d.ts +243 -0
- package/lib/interfaces/models/product.d.ts.map +1 -0
- package/lib/interfaces/models/product.js +3 -0
- package/lib/interfaces/models/product.js.map +1 -0
- package/lib/interfaces/models/quote.d.ts +77 -0
- package/lib/interfaces/models/quote.d.ts.map +1 -0
- package/lib/interfaces/models/quote.js +3 -0
- package/lib/interfaces/models/quote.js.map +1 -0
- package/lib/interfaces/models/searchProduct.d.ts +128 -0
- package/lib/interfaces/models/searchProduct.d.ts.map +1 -0
- package/lib/interfaces/models/searchProduct.js +3 -0
- package/lib/interfaces/models/searchProduct.js.map +1 -0
- package/lib/interfaces/models/supplier.d.ts +72 -0
- package/lib/interfaces/models/supplier.d.ts.map +1 -0
- package/lib/interfaces/models/supplier.js +3 -0
- package/lib/interfaces/models/supplier.js.map +1 -0
- package/lib/services/attributes/attributes.service.d.ts +18 -0
- package/lib/services/attributes/attributes.service.d.ts.map +1 -0
- package/lib/services/attributes/attributes.service.js +37 -0
- package/lib/services/attributes/attributes.service.js.map +1 -0
- package/lib/services/attributes/definitions.d.ts +28 -0
- package/lib/services/attributes/definitions.d.ts.map +1 -0
- package/lib/services/attributes/definitions.js +3 -0
- package/lib/services/attributes/definitions.js.map +1 -0
- package/lib/services/attributes/endpoints.d.ts +12 -0
- package/lib/services/attributes/endpoints.d.ts.map +1 -0
- package/lib/services/attributes/endpoints.js +14 -0
- package/lib/services/attributes/endpoints.js.map +1 -0
- package/lib/services/attributes/index.d.ts +33 -0
- package/lib/services/attributes/index.d.ts.map +1 -0
- package/lib/services/attributes/index.js +50 -0
- package/lib/services/attributes/index.js.map +1 -0
- package/lib/services/attributes/module.d.ts +11 -0
- package/lib/services/attributes/module.d.ts.map +1 -0
- package/lib/services/attributes/module.js +15 -0
- package/lib/services/attributes/module.js.map +1 -0
- package/lib/services/attributes/types.d.ts +35 -0
- package/lib/services/attributes/types.d.ts.map +1 -0
- package/lib/services/attributes/types.js +10 -0
- package/lib/services/attributes/types.js.map +1 -0
- package/lib/services/auth/__mocks__/auth.mocks.d.ts +249 -0
- package/lib/services/auth/__mocks__/auth.mocks.d.ts.map +1 -0
- package/lib/services/auth/__mocks__/auth.mocks.js +221 -0
- package/lib/services/auth/__mocks__/auth.mocks.js.map +1 -0
- package/lib/services/auth/auth.service.d.ts +286 -0
- package/lib/services/auth/auth.service.d.ts.map +1 -0
- package/lib/services/auth/auth.service.js +423 -0
- package/lib/services/auth/auth.service.js.map +1 -0
- package/lib/services/auth/definitions.d.ts +69 -0
- package/lib/services/auth/definitions.d.ts.map +1 -0
- package/lib/services/auth/definitions.js +3 -0
- package/lib/services/auth/definitions.js.map +1 -0
- package/lib/services/auth/definitions.requests.d.ts +25 -0
- package/lib/services/auth/definitions.requests.d.ts.map +1 -0
- package/lib/services/auth/definitions.requests.js +6 -0
- package/lib/services/auth/definitions.requests.js.map +1 -0
- package/lib/services/auth/endpoints.d.ts +30 -0
- package/lib/services/auth/endpoints.d.ts.map +1 -0
- package/lib/services/auth/endpoints.js +32 -0
- package/lib/services/auth/endpoints.js.map +1 -0
- package/lib/services/auth/index.d.ts +232 -0
- package/lib/services/auth/index.d.ts.map +1 -0
- package/lib/services/auth/index.js +310 -0
- package/lib/services/auth/index.js.map +1 -0
- package/lib/services/auth/module.d.ts +11 -0
- package/lib/services/auth/module.d.ts.map +1 -0
- package/lib/services/auth/module.js +17 -0
- package/lib/services/auth/module.js.map +1 -0
- package/lib/services/auth/types.d.ts +124 -0
- package/lib/services/auth/types.d.ts.map +1 -0
- package/lib/services/auth/types.js +10 -0
- package/lib/services/auth/types.js.map +1 -0
- package/lib/services/base.service.d.ts +83 -0
- package/lib/services/base.service.d.ts.map +1 -0
- package/lib/services/base.service.js +121 -0
- package/lib/services/base.service.js.map +1 -0
- package/lib/services/cart/cart.service.d.ts +443 -0
- package/lib/services/cart/cart.service.d.ts.map +1 -0
- package/lib/services/cart/cart.service.js +551 -0
- package/lib/services/cart/cart.service.js.map +1 -0
- package/lib/services/cart/definitions.d.ts +84 -0
- package/lib/services/cart/definitions.d.ts.map +1 -0
- package/lib/services/cart/definitions.js +3 -0
- package/lib/services/cart/definitions.js.map +1 -0
- package/lib/services/cart/endpoints.d.ts +24 -0
- package/lib/services/cart/endpoints.d.ts.map +1 -0
- package/lib/services/cart/endpoints.js +26 -0
- package/lib/services/cart/endpoints.js.map +1 -0
- package/lib/services/cart/index.d.ts +330 -0
- package/lib/services/cart/index.d.ts.map +1 -0
- package/lib/services/cart/index.js +464 -0
- package/lib/services/cart/index.js.map +1 -0
- package/lib/services/cart/module.d.ts +11 -0
- package/lib/services/cart/module.d.ts.map +1 -0
- package/lib/services/cart/module.js +17 -0
- package/lib/services/cart/module.js.map +1 -0
- package/lib/services/cart/types.d.ts +236 -0
- package/lib/services/cart/types.d.ts.map +1 -0
- package/lib/services/cart/types.js +10 -0
- package/lib/services/cart/types.js.map +1 -0
- package/lib/services/commercial-order/commercial-order.service.d.ts +435 -0
- package/lib/services/commercial-order/commercial-order.service.d.ts.map +1 -0
- package/lib/services/commercial-order/commercial-order.service.js +690 -0
- package/lib/services/commercial-order/commercial-order.service.js.map +1 -0
- package/lib/services/commercial-order/definitions.d.ts +182 -0
- package/lib/services/commercial-order/definitions.d.ts.map +1 -0
- package/lib/services/commercial-order/definitions.js +3 -0
- package/lib/services/commercial-order/definitions.js.map +1 -0
- package/lib/services/commercial-order/endpoints.d.ts +28 -0
- package/lib/services/commercial-order/endpoints.d.ts.map +1 -0
- package/lib/services/commercial-order/endpoints.js +33 -0
- package/lib/services/commercial-order/endpoints.js.map +1 -0
- package/lib/services/commercial-order/index.d.ts +721 -0
- package/lib/services/commercial-order/index.d.ts.map +1 -0
- package/lib/services/commercial-order/index.js +986 -0
- package/lib/services/commercial-order/index.js.map +1 -0
- package/lib/services/commercial-order/module.d.ts +11 -0
- package/lib/services/commercial-order/module.d.ts.map +1 -0
- package/lib/services/commercial-order/module.js +15 -0
- package/lib/services/commercial-order/module.js.map +1 -0
- package/lib/services/commercial-order/types.d.ts +244 -0
- package/lib/services/commercial-order/types.d.ts.map +1 -0
- package/lib/services/commercial-order/types.js +10 -0
- package/lib/services/commercial-order/types.js.map +1 -0
- package/lib/services/custom-field/custom-field.service.d.ts +23 -0
- package/lib/services/custom-field/custom-field.service.d.ts.map +1 -0
- package/lib/services/custom-field/custom-field.service.js +64 -0
- package/lib/services/custom-field/custom-field.service.js.map +1 -0
- package/lib/services/custom-field/definitions.d.ts +107 -0
- package/lib/services/custom-field/definitions.d.ts.map +1 -0
- package/lib/services/custom-field/definitions.js +61 -0
- package/lib/services/custom-field/definitions.js.map +1 -0
- package/lib/services/custom-field/endpoints.d.ts +13 -0
- package/lib/services/custom-field/endpoints.d.ts.map +1 -0
- package/lib/services/custom-field/endpoints.js +15 -0
- package/lib/services/custom-field/endpoints.js.map +1 -0
- package/lib/services/custom-field/index.d.ts +115 -0
- package/lib/services/custom-field/index.d.ts.map +1 -0
- package/lib/services/custom-field/index.js +144 -0
- package/lib/services/custom-field/index.js.map +1 -0
- package/lib/services/custom-field/module.d.ts +11 -0
- package/lib/services/custom-field/module.d.ts.map +1 -0
- package/lib/services/custom-field/module.js +15 -0
- package/lib/services/custom-field/module.js.map +1 -0
- package/lib/services/custom-field/types.d.ts +51 -0
- package/lib/services/custom-field/types.d.ts.map +1 -0
- package/lib/services/custom-field/types.js +10 -0
- package/lib/services/custom-field/types.js.map +1 -0
- package/lib/services/customer-account/customer-account.service.d.ts +387 -0
- package/lib/services/customer-account/customer-account.service.d.ts.map +1 -0
- package/lib/services/customer-account/customer-account.service.js +579 -0
- package/lib/services/customer-account/customer-account.service.js.map +1 -0
- package/lib/services/customer-account/definitions.d.ts +164 -0
- package/lib/services/customer-account/definitions.d.ts.map +1 -0
- package/lib/services/customer-account/definitions.js +3 -0
- package/lib/services/customer-account/definitions.js.map +1 -0
- package/lib/services/customer-account/endpoints.d.ts +25 -0
- package/lib/services/customer-account/endpoints.d.ts.map +1 -0
- package/lib/services/customer-account/endpoints.js +33 -0
- package/lib/services/customer-account/endpoints.js.map +1 -0
- package/lib/services/customer-account/index.d.ts +656 -0
- package/lib/services/customer-account/index.d.ts.map +1 -0
- package/lib/services/customer-account/index.js +929 -0
- package/lib/services/customer-account/index.js.map +1 -0
- package/lib/services/customer-account/module.d.ts +11 -0
- package/lib/services/customer-account/module.d.ts.map +1 -0
- package/lib/services/customer-account/module.js +15 -0
- package/lib/services/customer-account/module.js.map +1 -0
- package/lib/services/customer-account/types.d.ts +253 -0
- package/lib/services/customer-account/types.d.ts.map +1 -0
- package/lib/services/customer-account/types.js +10 -0
- package/lib/services/customer-account/types.js.map +1 -0
- package/lib/services/customer-user/customer-user.service.d.ts +280 -0
- package/lib/services/customer-user/customer-user.service.d.ts.map +1 -0
- package/lib/services/customer-user/customer-user.service.js +402 -0
- package/lib/services/customer-user/customer-user.service.js.map +1 -0
- package/lib/services/customer-user/definitions.d.ts +84 -0
- package/lib/services/customer-user/definitions.d.ts.map +1 -0
- package/lib/services/customer-user/definitions.js +3 -0
- package/lib/services/customer-user/definitions.js.map +1 -0
- package/lib/services/customer-user/endpoints.d.ts +19 -0
- package/lib/services/customer-user/endpoints.d.ts.map +1 -0
- package/lib/services/customer-user/endpoints.js +21 -0
- package/lib/services/customer-user/endpoints.js.map +1 -0
- package/lib/services/customer-user/index.d.ts +394 -0
- package/lib/services/customer-user/index.d.ts.map +1 -0
- package/lib/services/customer-user/index.js +528 -0
- package/lib/services/customer-user/index.js.map +1 -0
- package/lib/services/customer-user/module.d.ts +11 -0
- package/lib/services/customer-user/module.d.ts.map +1 -0
- package/lib/services/customer-user/module.js +15 -0
- package/lib/services/customer-user/module.js.map +1 -0
- package/lib/services/customer-user/types.d.ts +118 -0
- package/lib/services/customer-user/types.d.ts.map +1 -0
- package/lib/services/customer-user/types.js +10 -0
- package/lib/services/customer-user/types.js.map +1 -0
- package/lib/services/factory.d.ts +104 -0
- package/lib/services/factory.d.ts.map +1 -0
- package/lib/services/factory.js +89 -0
- package/lib/services/factory.js.map +1 -0
- package/lib/services/incident/definitions.d.ts +85 -0
- package/lib/services/incident/definitions.d.ts.map +1 -0
- package/lib/services/incident/definitions.js +3 -0
- package/lib/services/incident/definitions.js.map +1 -0
- package/lib/services/incident/endpoints.d.ts +17 -0
- package/lib/services/incident/endpoints.d.ts.map +1 -0
- package/lib/services/incident/endpoints.js +19 -0
- package/lib/services/incident/endpoints.js.map +1 -0
- package/lib/services/incident/incident.service.d.ts +24 -0
- package/lib/services/incident/incident.service.d.ts.map +1 -0
- package/lib/services/incident/incident.service.js +141 -0
- package/lib/services/incident/incident.service.js.map +1 -0
- package/lib/services/incident/index.d.ts +270 -0
- package/lib/services/incident/index.d.ts.map +1 -0
- package/lib/services/incident/index.js +389 -0
- package/lib/services/incident/index.js.map +1 -0
- package/lib/services/incident/module.d.ts +11 -0
- package/lib/services/incident/module.d.ts.map +1 -0
- package/lib/services/incident/module.js +15 -0
- package/lib/services/incident/module.js.map +1 -0
- package/lib/services/incident/types.d.ts +116 -0
- package/lib/services/incident/types.d.ts.map +1 -0
- package/lib/services/incident/types.js +10 -0
- package/lib/services/incident/types.js.map +1 -0
- package/lib/services/logistic-order/definitions.d.ts +315 -0
- package/lib/services/logistic-order/definitions.d.ts.map +1 -0
- package/lib/services/logistic-order/definitions.js +3 -0
- package/lib/services/logistic-order/definitions.js.map +1 -0
- package/lib/services/logistic-order/endpoints.d.ts +44 -0
- package/lib/services/logistic-order/endpoints.d.ts.map +1 -0
- package/lib/services/logistic-order/endpoints.js +57 -0
- package/lib/services/logistic-order/endpoints.js.map +1 -0
- package/lib/services/logistic-order/index.d.ts +1376 -0
- package/lib/services/logistic-order/index.d.ts.map +1 -0
- package/lib/services/logistic-order/index.js +1823 -0
- package/lib/services/logistic-order/index.js.map +1 -0
- package/lib/services/logistic-order/logistic-order.service.d.ts +62 -0
- package/lib/services/logistic-order/logistic-order.service.d.ts.map +1 -0
- package/lib/services/logistic-order/logistic-order.service.js +499 -0
- package/lib/services/logistic-order/logistic-order.service.js.map +1 -0
- package/lib/services/logistic-order/module.d.ts +11 -0
- package/lib/services/logistic-order/module.d.ts.map +1 -0
- package/lib/services/logistic-order/module.js +15 -0
- package/lib/services/logistic-order/module.js.map +1 -0
- package/lib/services/logistic-order/types.d.ts +411 -0
- package/lib/services/logistic-order/types.d.ts.map +1 -0
- package/lib/services/logistic-order/types.js +10 -0
- package/lib/services/logistic-order/types.js.map +1 -0
- package/lib/services/module.d.ts +64 -0
- package/lib/services/module.d.ts.map +1 -0
- package/lib/services/module.js +147 -0
- package/lib/services/module.js.map +1 -0
- package/lib/services/navigation-category/definitions.d.ts +31 -0
- package/lib/services/navigation-category/definitions.d.ts.map +1 -0
- package/lib/services/navigation-category/definitions.js +3 -0
- package/lib/services/navigation-category/definitions.js.map +1 -0
- package/lib/services/navigation-category/endpoints.d.ts +15 -0
- package/lib/services/navigation-category/endpoints.d.ts.map +1 -0
- package/lib/services/navigation-category/endpoints.js +17 -0
- package/lib/services/navigation-category/endpoints.js.map +1 -0
- package/lib/services/navigation-category/index.d.ts +114 -0
- package/lib/services/navigation-category/index.d.ts.map +1 -0
- package/lib/services/navigation-category/index.js +160 -0
- package/lib/services/navigation-category/index.js.map +1 -0
- package/lib/services/navigation-category/module.d.ts +11 -0
- package/lib/services/navigation-category/module.d.ts.map +1 -0
- package/lib/services/navigation-category/module.js +15 -0
- package/lib/services/navigation-category/module.js.map +1 -0
- package/lib/services/navigation-category/navigation-category.service.d.ts +148 -0
- package/lib/services/navigation-category/navigation-category.service.d.ts.map +1 -0
- package/lib/services/navigation-category/navigation-category.service.js +191 -0
- package/lib/services/navigation-category/navigation-category.service.js.map +1 -0
- package/lib/services/navigation-category/types.d.ts +51 -0
- package/lib/services/navigation-category/types.d.ts.map +1 -0
- package/lib/services/navigation-category/types.js +10 -0
- package/lib/services/navigation-category/types.js.map +1 -0
- package/lib/services/offer-inventories/definitions.d.ts +73 -0
- package/lib/services/offer-inventories/definitions.d.ts.map +1 -0
- package/lib/services/offer-inventories/definitions.js +3 -0
- package/lib/services/offer-inventories/definitions.js.map +1 -0
- package/lib/services/offer-inventories/endpoints.d.ts +16 -0
- package/lib/services/offer-inventories/endpoints.d.ts.map +1 -0
- package/lib/services/offer-inventories/endpoints.js +18 -0
- package/lib/services/offer-inventories/endpoints.js.map +1 -0
- package/lib/services/offer-inventories/index.d.ts +120 -0
- package/lib/services/offer-inventories/index.d.ts.map +1 -0
- package/lib/services/offer-inventories/index.js +175 -0
- package/lib/services/offer-inventories/index.js.map +1 -0
- package/lib/services/offer-inventories/module.d.ts +11 -0
- package/lib/services/offer-inventories/module.d.ts.map +1 -0
- package/lib/services/offer-inventories/module.js +15 -0
- package/lib/services/offer-inventories/module.js.map +1 -0
- package/lib/services/offer-inventories/offer-inventories.service.d.ts +26 -0
- package/lib/services/offer-inventories/offer-inventories.service.d.ts.map +1 -0
- package/lib/services/offer-inventories/offer-inventories.service.js +80 -0
- package/lib/services/offer-inventories/offer-inventories.service.js.map +1 -0
- package/lib/services/offer-inventories/types.d.ts +85 -0
- package/lib/services/offer-inventories/types.d.ts.map +1 -0
- package/lib/services/offer-inventories/types.js +10 -0
- package/lib/services/offer-inventories/types.js.map +1 -0
- package/lib/services/offer-prices/__mocks__/offer-prices.mocks.d.ts +109 -0
- package/lib/services/offer-prices/__mocks__/offer-prices.mocks.d.ts.map +1 -0
- package/lib/services/offer-prices/__mocks__/offer-prices.mocks.js +201 -0
- package/lib/services/offer-prices/__mocks__/offer-prices.mocks.js.map +1 -0
- package/lib/services/offer-prices/definitions.d.ts +24 -0
- package/lib/services/offer-prices/definitions.d.ts.map +1 -0
- package/lib/services/offer-prices/definitions.js +3 -0
- package/lib/services/offer-prices/definitions.js.map +1 -0
- package/lib/services/offer-prices/endpoints.d.ts +12 -0
- package/lib/services/offer-prices/endpoints.d.ts.map +1 -0
- package/lib/services/offer-prices/endpoints.js +14 -0
- package/lib/services/offer-prices/endpoints.js.map +1 -0
- package/lib/services/offer-prices/index.d.ts +36 -0
- package/lib/services/offer-prices/index.d.ts.map +1 -0
- package/lib/services/offer-prices/index.js +53 -0
- package/lib/services/offer-prices/index.js.map +1 -0
- package/lib/services/offer-prices/module.d.ts +11 -0
- package/lib/services/offer-prices/module.d.ts.map +1 -0
- package/lib/services/offer-prices/module.js +15 -0
- package/lib/services/offer-prices/module.js.map +1 -0
- package/lib/services/offer-prices/offer-prices.service.d.ts +18 -0
- package/lib/services/offer-prices/offer-prices.service.d.ts.map +1 -0
- package/lib/services/offer-prices/offer-prices.service.js +36 -0
- package/lib/services/offer-prices/offer-prices.service.js.map +1 -0
- package/lib/services/offer-prices/types.d.ts +33 -0
- package/lib/services/offer-prices/types.d.ts.map +1 -0
- package/lib/services/offer-prices/types.js +10 -0
- package/lib/services/offer-prices/types.js.map +1 -0
- package/lib/services/operation/definitions.d.ts +263 -0
- package/lib/services/operation/definitions.d.ts.map +1 -0
- package/lib/services/operation/definitions.js +18 -0
- package/lib/services/operation/definitions.js.map +1 -0
- package/lib/services/operation/endpoints.d.ts +18 -0
- package/lib/services/operation/endpoints.d.ts.map +1 -0
- package/lib/services/operation/endpoints.js +22 -0
- package/lib/services/operation/endpoints.js.map +1 -0
- package/lib/services/operation/index.d.ts +520 -0
- package/lib/services/operation/index.d.ts.map +1 -0
- package/lib/services/operation/index.js +704 -0
- package/lib/services/operation/index.js.map +1 -0
- package/lib/services/operation/module.d.ts +11 -0
- package/lib/services/operation/module.d.ts.map +1 -0
- package/lib/services/operation/module.js +15 -0
- package/lib/services/operation/module.js.map +1 -0
- package/lib/services/operation/operation.service.d.ts +32 -0
- package/lib/services/operation/operation.service.d.ts.map +1 -0
- package/lib/services/operation/operation.service.js +206 -0
- package/lib/services/operation/operation.service.js.map +1 -0
- package/lib/services/operation/types.d.ts +174 -0
- package/lib/services/operation/types.d.ts.map +1 -0
- package/lib/services/operation/types.js +10 -0
- package/lib/services/operation/types.js.map +1 -0
- package/lib/services/payment/definitions.d.ts +69 -0
- package/lib/services/payment/definitions.d.ts.map +1 -0
- package/lib/services/payment/definitions.js +3 -0
- package/lib/services/payment/definitions.js.map +1 -0
- package/lib/services/payment/endpoints.d.ts +16 -0
- package/lib/services/payment/endpoints.d.ts.map +1 -0
- package/lib/services/payment/endpoints.js +18 -0
- package/lib/services/payment/endpoints.js.map +1 -0
- package/lib/services/payment/index.d.ts +150 -0
- package/lib/services/payment/index.d.ts.map +1 -0
- package/lib/services/payment/index.js +220 -0
- package/lib/services/payment/index.js.map +1 -0
- package/lib/services/payment/module.d.ts +11 -0
- package/lib/services/payment/module.d.ts.map +1 -0
- package/lib/services/payment/module.js +15 -0
- package/lib/services/payment/module.js.map +1 -0
- package/lib/services/payment/payment.service.d.ts +224 -0
- package/lib/services/payment/payment.service.d.ts.map +1 -0
- package/lib/services/payment/payment.service.js +288 -0
- package/lib/services/payment/payment.service.js.map +1 -0
- package/lib/services/payment/types.d.ts +93 -0
- package/lib/services/payment/types.d.ts.map +1 -0
- package/lib/services/payment/types.js +10 -0
- package/lib/services/payment/types.js.map +1 -0
- package/lib/services/product/definitions.d.ts +150 -0
- package/lib/services/product/definitions.d.ts.map +1 -0
- package/lib/services/product/definitions.js +9 -0
- package/lib/services/product/definitions.js.map +1 -0
- package/lib/services/product/endpoints.d.ts +40 -0
- package/lib/services/product/endpoints.d.ts.map +1 -0
- package/lib/services/product/endpoints.js +42 -0
- package/lib/services/product/endpoints.js.map +1 -0
- package/lib/services/product/index.d.ts +388 -0
- package/lib/services/product/index.d.ts.map +1 -0
- package/lib/services/product/index.js +564 -0
- package/lib/services/product/index.js.map +1 -0
- package/lib/services/product/module.d.ts +11 -0
- package/lib/services/product/module.d.ts.map +1 -0
- package/lib/services/product/module.js +17 -0
- package/lib/services/product/module.js.map +1 -0
- package/lib/services/product/product.service.d.ts +452 -0
- package/lib/services/product/product.service.d.ts.map +1 -0
- package/lib/services/product/product.service.js +624 -0
- package/lib/services/product/product.service.js.map +1 -0
- package/lib/services/product/types.d.ts +344 -0
- package/lib/services/product/types.d.ts.map +1 -0
- package/lib/services/product/types.js +10 -0
- package/lib/services/product/types.js.map +1 -0
- package/lib/services/product-variant/definitions.d.ts +33 -0
- package/lib/services/product-variant/definitions.d.ts.map +1 -0
- package/lib/services/product-variant/definitions.js +7 -0
- package/lib/services/product-variant/definitions.js.map +1 -0
- package/lib/services/product-variant/endpoints.d.ts +15 -0
- package/lib/services/product-variant/endpoints.d.ts.map +1 -0
- package/lib/services/product-variant/endpoints.js +17 -0
- package/lib/services/product-variant/endpoints.js.map +1 -0
- package/lib/services/product-variant/index.d.ts +123 -0
- package/lib/services/product-variant/index.d.ts.map +1 -0
- package/lib/services/product-variant/index.js +172 -0
- package/lib/services/product-variant/index.js.map +1 -0
- package/lib/services/product-variant/module.d.ts +11 -0
- package/lib/services/product-variant/module.d.ts.map +1 -0
- package/lib/services/product-variant/module.js +15 -0
- package/lib/services/product-variant/module.js.map +1 -0
- package/lib/services/product-variant/product-variant.service.d.ts +21 -0
- package/lib/services/product-variant/product-variant.service.d.ts.map +1 -0
- package/lib/services/product-variant/product-variant.service.js +69 -0
- package/lib/services/product-variant/product-variant.service.js.map +1 -0
- package/lib/services/product-variant/types.d.ts +73 -0
- package/lib/services/product-variant/types.d.ts.map +1 -0
- package/lib/services/product-variant/types.js +10 -0
- package/lib/services/product-variant/types.js.map +1 -0
- package/lib/services/quote/definitions.d.ts +102 -0
- package/lib/services/quote/definitions.d.ts.map +1 -0
- package/lib/services/quote/definitions.js +3 -0
- package/lib/services/quote/definitions.js.map +1 -0
- package/lib/services/quote/endpoints.d.ts +20 -0
- package/lib/services/quote/endpoints.d.ts.map +1 -0
- package/lib/services/quote/endpoints.js +24 -0
- package/lib/services/quote/endpoints.js.map +1 -0
- package/lib/services/quote/index.d.ts +378 -0
- package/lib/services/quote/index.d.ts.map +1 -0
- package/lib/services/quote/index.js +506 -0
- package/lib/services/quote/index.js.map +1 -0
- package/lib/services/quote/module.d.ts +11 -0
- package/lib/services/quote/module.d.ts.map +1 -0
- package/lib/services/quote/module.js +15 -0
- package/lib/services/quote/module.js.map +1 -0
- package/lib/services/quote/quote.service.d.ts +346 -0
- package/lib/services/quote/quote.service.d.ts.map +1 -0
- package/lib/services/quote/quote.service.js +479 -0
- package/lib/services/quote/quote.service.js.map +1 -0
- package/lib/services/quote/types.d.ts +160 -0
- package/lib/services/quote/types.d.ts.map +1 -0
- package/lib/services/quote/types.js +10 -0
- package/lib/services/quote/types.js.map +1 -0
- package/lib/services/supplier/__mocks__/supplier-mocks.d.ts +49 -0
- package/lib/services/supplier/__mocks__/supplier-mocks.d.ts.map +1 -0
- package/lib/services/supplier/__mocks__/supplier-mocks.js +168 -0
- package/lib/services/supplier/__mocks__/supplier-mocks.js.map +1 -0
- package/lib/services/supplier/definitions.d.ts +30 -0
- package/lib/services/supplier/definitions.d.ts.map +1 -0
- package/lib/services/supplier/definitions.js +3 -0
- package/lib/services/supplier/definitions.js.map +1 -0
- package/lib/services/supplier/endpoints.d.ts +14 -0
- package/lib/services/supplier/endpoints.d.ts.map +1 -0
- package/lib/services/supplier/endpoints.js +16 -0
- package/lib/services/supplier/endpoints.js.map +1 -0
- package/lib/services/supplier/index.d.ts +102 -0
- package/lib/services/supplier/index.d.ts.map +1 -0
- package/lib/services/supplier/index.js +146 -0
- package/lib/services/supplier/index.js.map +1 -0
- package/lib/services/supplier/module.d.ts +11 -0
- package/lib/services/supplier/module.d.ts.map +1 -0
- package/lib/services/supplier/module.js +15 -0
- package/lib/services/supplier/module.js.map +1 -0
- package/lib/services/supplier/supplier.service.d.ts +20 -0
- package/lib/services/supplier/supplier.service.d.ts.map +1 -0
- package/lib/services/supplier/supplier.service.js +63 -0
- package/lib/services/supplier/supplier.service.js.map +1 -0
- package/lib/services/supplier/types.d.ts +58 -0
- package/lib/services/supplier/types.d.ts.map +1 -0
- package/lib/services/supplier/types.js +10 -0
- package/lib/services/supplier/types.js.map +1 -0
- package/lib/services/types.d.ts +81 -0
- package/lib/services/types.d.ts.map +1 -0
- package/lib/services/types.js +10 -0
- package/lib/services/types.js.map +1 -0
- package/lib/settings/fetch-instance.d.ts +30 -0
- package/lib/settings/fetch-instance.d.ts.map +1 -0
- package/lib/settings/fetch-instance.js +223 -0
- package/lib/settings/fetch-instance.js.map +1 -0
- package/lib/settings/sdk-version.d.ts +3 -0
- package/lib/settings/sdk-version.d.ts.map +1 -0
- package/lib/settings/sdk-version.js +6 -0
- package/lib/settings/sdk-version.js.map +1 -0
- package/package.json +27 -8
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* # Product Service
|
|
4
|
+
*
|
|
5
|
+
* Complete product catalog management for B2B e-commerce.
|
|
6
|
+
*
|
|
7
|
+
* ## Features
|
|
8
|
+
* - Full-text search with autocomplete
|
|
9
|
+
* - Advanced filtering and faceted navigation
|
|
10
|
+
* - Product variants and attributes
|
|
11
|
+
* - Offers and supplier pricing
|
|
12
|
+
* - Customer reviews and ratings
|
|
13
|
+
*
|
|
14
|
+
* @module services/product
|
|
15
|
+
* @since 2.17.0
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ProductService = void 0;
|
|
19
|
+
const base_service_1 = require("../base.service");
|
|
20
|
+
const endpoints_1 = require("./endpoints");
|
|
21
|
+
/**
|
|
22
|
+
* Service for product catalog operations.
|
|
23
|
+
*
|
|
24
|
+
* Provides complete product management:
|
|
25
|
+
* - Search and discovery
|
|
26
|
+
* - Product details and variants
|
|
27
|
+
* - Offers and pricing from multiple suppliers
|
|
28
|
+
* - Reviews and ratings
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* import { createDjustClient } from '@djust-b2b/djust-front-sdk';
|
|
33
|
+
*
|
|
34
|
+
* const client = createDjustClient({ baseUrl, clientId, apiKey });
|
|
35
|
+
*
|
|
36
|
+
* // Autocomplete search
|
|
37
|
+
* const results = await client.product.autoCompleteSearch({
|
|
38
|
+
* input: 'laptop',
|
|
39
|
+
* locale: 'en-US',
|
|
40
|
+
* currency: 'USD',
|
|
41
|
+
* });
|
|
42
|
+
*
|
|
43
|
+
* // Get product details
|
|
44
|
+
* const product = await client.product.getProduct({
|
|
45
|
+
* productIdentifier: 'SKU-12345',
|
|
46
|
+
* productIdType: 'sku',
|
|
47
|
+
* locale: 'en-US',
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
class ProductService extends base_service_1.BaseService {
|
|
52
|
+
constructor() {
|
|
53
|
+
super(...arguments);
|
|
54
|
+
this.serviceName = "product";
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Search products with autocomplete suggestions.
|
|
58
|
+
*
|
|
59
|
+
* Returns matching products based on partial text input, ideal for
|
|
60
|
+
* implementing search-as-you-type functionality.
|
|
61
|
+
*
|
|
62
|
+
* **Endpoint**: `GET /v1/shop/products/autocomplete [PROD-100]`
|
|
63
|
+
*
|
|
64
|
+
* | Parameter | Type | Required | Description |
|
|
65
|
+
* |---------------|------------------|----------|--------------------------------------|
|
|
66
|
+
* | `input` | `string` | Yes | Search query text |
|
|
67
|
+
* | `locale` | `string` | Yes | Locale for translations (e.g., en-US)|
|
|
68
|
+
* | `currency` | `string` | Yes | Currency code for prices (e.g., USD) |
|
|
69
|
+
* | `aggregation` | `boolean` | No | Include faceted aggregations |
|
|
70
|
+
* | `productTags` | `string[]` | No | Filter by product tags |
|
|
71
|
+
* | `pageable` | `PageableParams` | No | Pagination settings |
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const results = await client.product.autoCompleteSearch({
|
|
76
|
+
* input: 'laptop pro',
|
|
77
|
+
* locale: 'en-US',
|
|
78
|
+
* currency: 'USD',
|
|
79
|
+
* aggregation: true,
|
|
80
|
+
* pageable: { page: 0, size: 10 },
|
|
81
|
+
* });
|
|
82
|
+
*
|
|
83
|
+
* console.log(`Found ${results.totalElements} products`);
|
|
84
|
+
* results.content.forEach(product => {
|
|
85
|
+
* console.log(`${product.name} - ${product.price} ${results.currency}`);
|
|
86
|
+
* });
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @param params - Search parameters
|
|
90
|
+
* @param context - Optional SSR request context
|
|
91
|
+
* @throws {ValidationError} If required parameters are missing
|
|
92
|
+
* @returns Search results with products and optional aggregations
|
|
93
|
+
*/
|
|
94
|
+
async autoCompleteSearch(params, context) {
|
|
95
|
+
this.required(params, ["input", "locale", "currency"]);
|
|
96
|
+
return this.request({
|
|
97
|
+
method: "GET",
|
|
98
|
+
path: endpoints_1.ProductEndpoints.AUTOCOMPLETE,
|
|
99
|
+
params: this.buildParams({
|
|
100
|
+
input: params.input,
|
|
101
|
+
locale: params.locale,
|
|
102
|
+
currency: params.currency,
|
|
103
|
+
aggregation: params.aggregation,
|
|
104
|
+
productTags: params.productTags,
|
|
105
|
+
page: params.pageable?.page,
|
|
106
|
+
size: params.pageable?.size,
|
|
107
|
+
sort: params.pageable?.sort,
|
|
108
|
+
}),
|
|
109
|
+
}, context);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Get paginated list of products with advanced filtering.
|
|
113
|
+
*
|
|
114
|
+
* Supports faceted search, category navigation, and multiple filter criteria.
|
|
115
|
+
*
|
|
116
|
+
* **Endpoint**: `GET /v1/shop/products [PROD-101]`
|
|
117
|
+
*
|
|
118
|
+
* | Parameter | Type | Required | Description |
|
|
119
|
+
* |------------|------------------|----------|--------------------------------------|
|
|
120
|
+
* | `locale` | `string` | Yes | Locale for translations |
|
|
121
|
+
* | `filters` | `ProductFilters` | No | Advanced filter criteria |
|
|
122
|
+
* | `pageable` | `PageableParams` | No | Pagination and sorting |
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* const { content: products, totalElements } = await client.product.getProductsList({
|
|
127
|
+
* locale: 'fr-FR',
|
|
128
|
+
* filters: {
|
|
129
|
+
* categoryId: 'electronics',
|
|
130
|
+
* priceMin: 100,
|
|
131
|
+
* priceMax: 500,
|
|
132
|
+
* inStock: true,
|
|
133
|
+
* },
|
|
134
|
+
* pageable: { page: 0, size: 20, sort: 'price,asc' },
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* @param params - Search parameters with filters
|
|
139
|
+
* @param context - Optional SSR request context
|
|
140
|
+
* @throws {ValidationError} If locale is missing
|
|
141
|
+
* @returns Paginated product list with total count
|
|
142
|
+
*/
|
|
143
|
+
async getProductsList(params, context) {
|
|
144
|
+
this.required(params, ["locale"]);
|
|
145
|
+
return this.request({
|
|
146
|
+
method: "GET",
|
|
147
|
+
path: endpoints_1.ProductEndpoints.SEARCH,
|
|
148
|
+
params: this.buildParams({
|
|
149
|
+
...params.filters,
|
|
150
|
+
locale: params.locale,
|
|
151
|
+
page: params.pageable?.page,
|
|
152
|
+
size: params.pageable?.size,
|
|
153
|
+
sort: params.pageable?.sort,
|
|
154
|
+
}),
|
|
155
|
+
}, context);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get detailed product information by identifier.
|
|
159
|
+
*
|
|
160
|
+
* Retrieves full product details including description, images,
|
|
161
|
+
* specifications, and available variants.
|
|
162
|
+
*
|
|
163
|
+
* **Endpoint**: `GET /v1/shop/products/{identifier} [PROD-102]`
|
|
164
|
+
*
|
|
165
|
+
* | Parameter | Type | Required | Description |
|
|
166
|
+
* |---------------------|----------|----------|--------------------------------|
|
|
167
|
+
* | `productIdentifier` | `string` | Yes | Product ID, SKU, or EAN |
|
|
168
|
+
* | `productIdType` | `string` | Yes | Identifier type: id, sku, ean |
|
|
169
|
+
* | `locale` | `string` | No | Locale for translations |
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* // Get by SKU
|
|
174
|
+
* const product = await client.product.getProduct({
|
|
175
|
+
* productIdentifier: 'LAPTOP-PRO-15',
|
|
176
|
+
* productIdType: 'sku',
|
|
177
|
+
* locale: 'en-US',
|
|
178
|
+
* });
|
|
179
|
+
*
|
|
180
|
+
* console.log(product.name);
|
|
181
|
+
* console.log(product.description);
|
|
182
|
+
* console.log(product.variants);
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* @param params - Product identification parameters
|
|
186
|
+
* @param context - Optional SSR request context
|
|
187
|
+
* @throws {ValidationError} If required parameters are missing
|
|
188
|
+
* @throws {NotFoundError} If product is not found
|
|
189
|
+
* @returns Full product details
|
|
190
|
+
*/
|
|
191
|
+
async getProduct(params, context) {
|
|
192
|
+
this.required(params, ["productIdentifier", "productIdType"]);
|
|
193
|
+
return this.request({
|
|
194
|
+
method: "GET",
|
|
195
|
+
path: this.buildPath(endpoints_1.ProductEndpoints.PRODUCT, {
|
|
196
|
+
productIdentifier: params.productIdentifier,
|
|
197
|
+
}),
|
|
198
|
+
params: this.buildParams({
|
|
199
|
+
productIdType: params.productIdType,
|
|
200
|
+
locale: params.locale,
|
|
201
|
+
}),
|
|
202
|
+
}, context);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get all offers available for a specific product variant.
|
|
206
|
+
*
|
|
207
|
+
* Returns pricing from all suppliers for a given variant, allowing
|
|
208
|
+
* customers to compare prices and select preferred suppliers.
|
|
209
|
+
*
|
|
210
|
+
* **Endpoint**: `GET /v1/shop/products/{identifier}/offers [PROD-103]`
|
|
211
|
+
*
|
|
212
|
+
* | Parameter | Type | Required | Description |
|
|
213
|
+
* |---------------------|-----------|----------|-------------------------------|
|
|
214
|
+
* | `productIdentifier` | `string` | Yes | Variant ID or SKU |
|
|
215
|
+
* | `productIdType` | `string` | Yes | Identifier type |
|
|
216
|
+
* | `currency` | `string` | No | Currency for prices |
|
|
217
|
+
* | `withoutPrice` | `boolean` | No | Exclude price calculation |
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* const offers = await client.product.getProductVariantOffers({
|
|
222
|
+
* productIdentifier: 'LAPTOP-PRO-15-BLACK',
|
|
223
|
+
* productIdType: 'sku',
|
|
224
|
+
* currency: 'EUR',
|
|
225
|
+
* });
|
|
226
|
+
*
|
|
227
|
+
* offers.forEach(offer => {
|
|
228
|
+
* console.log(`${offer.supplierName}: ${offer.price} ${offer.currency}`);
|
|
229
|
+
* console.log(` Stock: ${offer.stock}, Delivery: ${offer.deliveryTime}`);
|
|
230
|
+
* });
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* @param params - Variant identification parameters
|
|
234
|
+
* @param context - Optional SSR request context
|
|
235
|
+
* @throws {ValidationError} If required parameters are missing
|
|
236
|
+
* @returns List of offers from all suppliers
|
|
237
|
+
*/
|
|
238
|
+
async getProductVariantOffers(params, context) {
|
|
239
|
+
this.required(params, ["productIdentifier", "productIdType"]);
|
|
240
|
+
return this.request({
|
|
241
|
+
method: "GET",
|
|
242
|
+
path: this.buildPath(endpoints_1.ProductEndpoints.VARIANT_OFFERS, {
|
|
243
|
+
productIdentifier: params.productIdentifier,
|
|
244
|
+
}),
|
|
245
|
+
params: this.buildParams({
|
|
246
|
+
productIdType: params.productIdType,
|
|
247
|
+
currency: params.currency,
|
|
248
|
+
withoutPrice: params.withoutPrice,
|
|
249
|
+
}),
|
|
250
|
+
}, context);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Get list of suppliers offering a specific product variant.
|
|
254
|
+
*
|
|
255
|
+
* **Endpoint**: `GET /v1/shop/product-variants/{id}/suppliers [PROD-104]`
|
|
256
|
+
*
|
|
257
|
+
* | Parameter | Type | Required | Description |
|
|
258
|
+
* |--------------------|----------|----------|----------------------|
|
|
259
|
+
* | `productVariantId` | `string` | Yes | Product variant ID |
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* ```typescript
|
|
263
|
+
* const suppliers = await client.product.getProductVariantSuppliers({
|
|
264
|
+
* productVariantId: '123e4567-e89b-12d3-a456-426614174000',
|
|
265
|
+
* });
|
|
266
|
+
*
|
|
267
|
+
* suppliers.forEach(supplier => {
|
|
268
|
+
* console.log(`${supplier.name} - ${supplier.rating} stars`);
|
|
269
|
+
* });
|
|
270
|
+
* ```
|
|
271
|
+
*
|
|
272
|
+
* @param params - Variant identification
|
|
273
|
+
* @param context - Optional SSR request context
|
|
274
|
+
* @throws {ValidationError} If productVariantId is missing
|
|
275
|
+
* @returns List of suppliers with their details
|
|
276
|
+
*/
|
|
277
|
+
async getProductVariantSuppliers(params, context) {
|
|
278
|
+
this.required(params, ["productVariantId"]);
|
|
279
|
+
return this.request({
|
|
280
|
+
method: "GET",
|
|
281
|
+
path: this.buildPath(endpoints_1.ProductEndpoints.VARIANT_SUPPLIERS, {
|
|
282
|
+
productVariantId: params.productVariantId,
|
|
283
|
+
}),
|
|
284
|
+
}, context);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Get all offers for a product (all variants).
|
|
288
|
+
*
|
|
289
|
+
* @deprecated Use `getProductPaginatedOffers` for better performance
|
|
290
|
+
*
|
|
291
|
+
* **Endpoint**: `GET /v1/shop/products/{identifier}/offers [PROD-105]`
|
|
292
|
+
*
|
|
293
|
+
* @param params - Product identification parameters
|
|
294
|
+
* @param context - Optional SSR request context
|
|
295
|
+
* @returns List of all offers
|
|
296
|
+
*/
|
|
297
|
+
async getProductOffers(params, context) {
|
|
298
|
+
this.required(params, ["productIdentifier", "productIdType"]);
|
|
299
|
+
return this.request({
|
|
300
|
+
method: "GET",
|
|
301
|
+
path: this.buildPath(endpoints_1.ProductEndpoints.PRODUCT_OFFERS, {
|
|
302
|
+
productIdentifier: params.productIdentifier,
|
|
303
|
+
}),
|
|
304
|
+
params: this.buildParams({
|
|
305
|
+
productIdType: params.productIdType,
|
|
306
|
+
locale: params.locale,
|
|
307
|
+
currency: params.currency,
|
|
308
|
+
withoutPrice: params.withoutPrice,
|
|
309
|
+
}),
|
|
310
|
+
}, context);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Get paginated offers for a product.
|
|
314
|
+
*
|
|
315
|
+
* Recommended method for fetching product offers with pagination support.
|
|
316
|
+
*
|
|
317
|
+
* **Endpoint**: `GET /v1/shop/products/{identifier}/offers/paginated [PROD-106]`
|
|
318
|
+
*
|
|
319
|
+
* | Parameter | Type | Required | Description |
|
|
320
|
+
* |---------------------|------------------|----------|--------------------------|
|
|
321
|
+
* | `productIdentifier` | `string` | Yes | Product ID or SKU |
|
|
322
|
+
* | `productIdType` | `string` | Yes | Identifier type |
|
|
323
|
+
* | `currency` | `string` | No | Currency for prices |
|
|
324
|
+
* | `locale` | `string` | No | Locale for translations |
|
|
325
|
+
* | `withoutPrices` | `boolean` | No | Exclude price data |
|
|
326
|
+
* | `pageable` | `PageableParams` | No | Pagination settings |
|
|
327
|
+
*
|
|
328
|
+
* @example
|
|
329
|
+
* ```typescript
|
|
330
|
+
* const { content: offers, totalElements } = await client.product.getProductPaginatedOffers({
|
|
331
|
+
* productIdentifier: 'LAPTOP-PRO-15',
|
|
332
|
+
* productIdType: 'sku',
|
|
333
|
+
* currency: 'EUR',
|
|
334
|
+
* pageable: { page: 0, size: 10, sort: 'price,asc' },
|
|
335
|
+
* });
|
|
336
|
+
*
|
|
337
|
+
* console.log(`Found ${totalElements} offers`);
|
|
338
|
+
* ```
|
|
339
|
+
*
|
|
340
|
+
* @param params - Product and pagination parameters
|
|
341
|
+
* @param context - Optional SSR request context
|
|
342
|
+
* @throws {ValidationError} If required parameters are missing
|
|
343
|
+
* @returns Paginated offers list
|
|
344
|
+
*/
|
|
345
|
+
async getProductPaginatedOffers(params, context) {
|
|
346
|
+
this.required(params, ["productIdentifier", "productIdType"]);
|
|
347
|
+
return this.request({
|
|
348
|
+
method: "GET",
|
|
349
|
+
path: this.buildPath(endpoints_1.ProductEndpoints.PRODUCT_PAGINATED_OFFERS, {
|
|
350
|
+
productIdentifier: params.productIdentifier,
|
|
351
|
+
}),
|
|
352
|
+
params: this.buildParams({
|
|
353
|
+
productIdType: params.productIdType,
|
|
354
|
+
currency: params.currency,
|
|
355
|
+
locale: params.locale,
|
|
356
|
+
withoutPrices: params.withoutPrices,
|
|
357
|
+
page: params.pageable?.page,
|
|
358
|
+
size: params.pageable?.size,
|
|
359
|
+
sort: params.pageable?.sort,
|
|
360
|
+
}),
|
|
361
|
+
}, context);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Get related/recommended products.
|
|
365
|
+
*
|
|
366
|
+
* Returns products related to the specified product, useful for
|
|
367
|
+
* "You may also like" or cross-sell sections.
|
|
368
|
+
*
|
|
369
|
+
* **Endpoint**: `GET /v1/shop/products/{identifier}/related [PROD-107]`
|
|
370
|
+
*
|
|
371
|
+
* | Parameter | Type | Required | Description |
|
|
372
|
+
* |---------------------|------------------|----------|--------------------------|
|
|
373
|
+
* | `productIdentifier` | `string` | Yes | Product ID or SKU |
|
|
374
|
+
* | `productIdType` | `string` | Yes | Identifier type |
|
|
375
|
+
* | `locale` | `string` | No | Locale for translations |
|
|
376
|
+
* | `currency` | `string` | No | Currency for prices |
|
|
377
|
+
* | `pageable` | `PageableParams` | No | Pagination settings |
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```typescript
|
|
381
|
+
* const relatedProducts = await client.product.getRelatedProducts({
|
|
382
|
+
* productIdentifier: 'LAPTOP-PRO-15',
|
|
383
|
+
* productIdType: 'sku',
|
|
384
|
+
* locale: 'en-US',
|
|
385
|
+
* currency: 'USD',
|
|
386
|
+
* pageable: { page: 0, size: 4 },
|
|
387
|
+
* });
|
|
388
|
+
* ```
|
|
389
|
+
*
|
|
390
|
+
* @param params - Product identification and pagination
|
|
391
|
+
* @param context - Optional SSR request context
|
|
392
|
+
* @throws {ValidationError} If required parameters are missing
|
|
393
|
+
* @returns List of related products
|
|
394
|
+
*/
|
|
395
|
+
async getRelatedProducts(params, context) {
|
|
396
|
+
this.required(params, ["productIdentifier", "productIdType"]);
|
|
397
|
+
return this.request({
|
|
398
|
+
method: "GET",
|
|
399
|
+
path: this.buildPath(endpoints_1.ProductEndpoints.RELATED_PRODUCTS, {
|
|
400
|
+
productIdentifier: params.productIdentifier,
|
|
401
|
+
}),
|
|
402
|
+
params: this.buildParams({
|
|
403
|
+
productIdType: params.productIdType,
|
|
404
|
+
locale: params.locale,
|
|
405
|
+
currency: params.currency,
|
|
406
|
+
page: params.pageable?.page,
|
|
407
|
+
size: params.pageable?.size,
|
|
408
|
+
sort: params.pageable?.sort,
|
|
409
|
+
}),
|
|
410
|
+
}, context);
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Get customer reviews for a product.
|
|
414
|
+
*
|
|
415
|
+
* **Endpoint**: `GET /v1/shop/products/{identifier}/reviews [PROD-108]`
|
|
416
|
+
*
|
|
417
|
+
* | Parameter | Type | Required | Description |
|
|
418
|
+
* |---------------------|----------|----------|--------------------------|
|
|
419
|
+
* | `productIdentifier` | `string` | Yes | Product ID or SKU |
|
|
420
|
+
* | `productIdType` | `string` | Yes | Identifier type |
|
|
421
|
+
*
|
|
422
|
+
* @example
|
|
423
|
+
* ```typescript
|
|
424
|
+
* const reviews = await client.product.getProductReviews({
|
|
425
|
+
* productIdentifier: 'LAPTOP-PRO-15',
|
|
426
|
+
* productIdType: 'sku',
|
|
427
|
+
* });
|
|
428
|
+
*
|
|
429
|
+
* reviews.forEach(review => {
|
|
430
|
+
* console.log(`${review.rating}/5 - ${review.message}`);
|
|
431
|
+
* console.log(`By ${review.authorName} on ${review.createdAt}`);
|
|
432
|
+
* });
|
|
433
|
+
* ```
|
|
434
|
+
*
|
|
435
|
+
* @param params - Product identification parameters
|
|
436
|
+
* @param context - Optional SSR request context
|
|
437
|
+
* @throws {ValidationError} If required parameters are missing
|
|
438
|
+
* @returns List of product reviews
|
|
439
|
+
*/
|
|
440
|
+
async getProductReviews(params, context) {
|
|
441
|
+
this.required(params, ["productIdentifier", "productIdType"]);
|
|
442
|
+
return this.request({
|
|
443
|
+
method: "GET",
|
|
444
|
+
path: this.buildPath(endpoints_1.ProductEndpoints.PRODUCT_REVIEWS, {
|
|
445
|
+
productIdentifier: params.productIdentifier,
|
|
446
|
+
}),
|
|
447
|
+
params: this.buildParams({
|
|
448
|
+
productIdType: params.productIdType,
|
|
449
|
+
}),
|
|
450
|
+
}, context);
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Get review statistics for a product.
|
|
454
|
+
*
|
|
455
|
+
* Returns aggregated statistics including average rating and
|
|
456
|
+
* rating distribution.
|
|
457
|
+
*
|
|
458
|
+
* **Endpoint**: `GET /v1/shop/products/{identifier}/reviews/stats [PROD-109]`
|
|
459
|
+
*
|
|
460
|
+
* | Parameter | Type | Required | Description |
|
|
461
|
+
* |---------------------|----------|----------|--------------------------|
|
|
462
|
+
* | `productIdentifier` | `string` | Yes | Product ID or SKU |
|
|
463
|
+
* | `productIdType` | `string` | Yes | Identifier type |
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
* ```typescript
|
|
467
|
+
* const stats = await client.product.getProductStatReviews({
|
|
468
|
+
* productIdentifier: 'LAPTOP-PRO-15',
|
|
469
|
+
* productIdType: 'sku',
|
|
470
|
+
* });
|
|
471
|
+
*
|
|
472
|
+
* console.log(`Average: ${stats.averageRating}/5`);
|
|
473
|
+
* console.log(`Total reviews: ${stats.totalReviews}`);
|
|
474
|
+
* console.log(`5 stars: ${stats.distribution[5]} reviews`);
|
|
475
|
+
* ```
|
|
476
|
+
*
|
|
477
|
+
* @param params - Product identification parameters
|
|
478
|
+
* @param context - Optional SSR request context
|
|
479
|
+
* @throws {ValidationError} If required parameters are missing
|
|
480
|
+
* @returns Review statistics with distribution
|
|
481
|
+
*/
|
|
482
|
+
async getProductStatReviews(params, context) {
|
|
483
|
+
this.required(params, ["productIdentifier", "productIdType"]);
|
|
484
|
+
return this.request({
|
|
485
|
+
method: "GET",
|
|
486
|
+
path: this.buildPath(endpoints_1.ProductEndpoints.PRODUCT_STAT_REVIEWS, {
|
|
487
|
+
productIdentifier: params.productIdentifier,
|
|
488
|
+
}),
|
|
489
|
+
params: this.buildParams({
|
|
490
|
+
productIdType: params.productIdType,
|
|
491
|
+
}),
|
|
492
|
+
}, context);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Get attributes for a product variant.
|
|
496
|
+
*
|
|
497
|
+
* Returns variant-specific attributes like color, size, material, etc.
|
|
498
|
+
*
|
|
499
|
+
* **Endpoint**: `GET /v1/shop/products/{identifier}/variant-attributes [PROD-110]`
|
|
500
|
+
*
|
|
501
|
+
* | Parameter | Type | Required | Description |
|
|
502
|
+
* |---------------------|----------|----------|--------------------------|
|
|
503
|
+
* | `productIdentifier` | `string` | Yes | Product/variant ID |
|
|
504
|
+
* | `productIdType` | `string` | Yes | Identifier type |
|
|
505
|
+
* | `locale` | `string` | No | Locale for translations |
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* ```typescript
|
|
509
|
+
* const attributes = await client.product.getProductVariantAttributes({
|
|
510
|
+
* productIdentifier: 'LAPTOP-PRO-15-BLACK',
|
|
511
|
+
* productIdType: 'sku',
|
|
512
|
+
* locale: 'en-US',
|
|
513
|
+
* });
|
|
514
|
+
*
|
|
515
|
+
* attributes.forEach(attr => {
|
|
516
|
+
* console.log(`${attr.name}: ${attr.value}`);
|
|
517
|
+
* });
|
|
518
|
+
* ```
|
|
519
|
+
*
|
|
520
|
+
* @param params - Variant identification parameters
|
|
521
|
+
* @param context - Optional SSR request context
|
|
522
|
+
* @throws {ValidationError} If required parameters are missing
|
|
523
|
+
* @returns List of variant attributes
|
|
524
|
+
*/
|
|
525
|
+
async getProductVariantAttributes(params, context) {
|
|
526
|
+
this.required(params, ["productIdentifier", "productIdType"]);
|
|
527
|
+
return this.request({
|
|
528
|
+
method: "GET",
|
|
529
|
+
path: this.buildPath(endpoints_1.ProductEndpoints.VARIANT_ATTRIBUTES, {
|
|
530
|
+
productIdentifier: params.productIdentifier,
|
|
531
|
+
}),
|
|
532
|
+
params: this.buildParams({
|
|
533
|
+
productIdType: params.productIdType,
|
|
534
|
+
locale: params.locale,
|
|
535
|
+
}),
|
|
536
|
+
}, context);
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Create a new product review.
|
|
540
|
+
*
|
|
541
|
+
* Allows authenticated customers to submit reviews for purchased products.
|
|
542
|
+
*
|
|
543
|
+
* **Endpoint**: `POST /v1/shop/product-reviews [PROD-111]`
|
|
544
|
+
*
|
|
545
|
+
* | Parameter | Type | Required | Description |
|
|
546
|
+
* |--------------|----------|----------|--------------------------------|
|
|
547
|
+
* | `productSku` | `string` | Yes | Product SKU being reviewed |
|
|
548
|
+
* | `rating` | `number` | Yes | Rating from 1 to 5 |
|
|
549
|
+
* | `message` | `string` | Yes | Review text content |
|
|
550
|
+
*
|
|
551
|
+
* @example
|
|
552
|
+
* ```typescript
|
|
553
|
+
* const review = await client.product.createProductReview({
|
|
554
|
+
* productSku: 'LAPTOP-PRO-15',
|
|
555
|
+
* rating: 5,
|
|
556
|
+
* message: 'Excellent laptop! Great performance and build quality.',
|
|
557
|
+
* });
|
|
558
|
+
*
|
|
559
|
+
* console.log(`Review created with ID: ${review.id}`);
|
|
560
|
+
* ```
|
|
561
|
+
*
|
|
562
|
+
* @param params - Review content parameters
|
|
563
|
+
* @param context - Optional SSR request context
|
|
564
|
+
* @throws {ValidationError} If required parameters are missing
|
|
565
|
+
* @throws {AuthError} If user is not authenticated
|
|
566
|
+
* @returns Created review details
|
|
567
|
+
*/
|
|
568
|
+
async createProductReview(params, context) {
|
|
569
|
+
this.required(params, ["message", "productSku", "rating"]);
|
|
570
|
+
return this.request({
|
|
571
|
+
method: "POST",
|
|
572
|
+
path: endpoints_1.ProductEndpoints.REVIEWS,
|
|
573
|
+
body: {
|
|
574
|
+
message: params.message,
|
|
575
|
+
productSku: params.productSku,
|
|
576
|
+
rating: params.rating,
|
|
577
|
+
},
|
|
578
|
+
}, context);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Update an existing product review.
|
|
582
|
+
*
|
|
583
|
+
* Allows users to modify their own reviews.
|
|
584
|
+
*
|
|
585
|
+
* **Endpoint**: `PUT /v1/shop/product-reviews/{reviewId} [PROD-112]`
|
|
586
|
+
*
|
|
587
|
+
* | Parameter | Type | Required | Description |
|
|
588
|
+
* |-------------------|----------|----------|--------------------------|
|
|
589
|
+
* | `productReviewId` | `string` | Yes | Review ID to update |
|
|
590
|
+
* | `rating` | `number` | Yes | New rating (1-5) |
|
|
591
|
+
* | `message` | `string` | Yes | New review text |
|
|
592
|
+
*
|
|
593
|
+
* @example
|
|
594
|
+
* ```typescript
|
|
595
|
+
* const updated = await client.product.updateProductReview({
|
|
596
|
+
* productReviewId: 'review-123',
|
|
597
|
+
* rating: 4,
|
|
598
|
+
* message: 'Updated review after more usage. Still great, minor issues.',
|
|
599
|
+
* });
|
|
600
|
+
* ```
|
|
601
|
+
*
|
|
602
|
+
* @param params - Review update parameters
|
|
603
|
+
* @param context - Optional SSR request context
|
|
604
|
+
* @throws {ValidationError} If required parameters are missing
|
|
605
|
+
* @throws {AuthError} If user is not the review author
|
|
606
|
+
* @throws {NotFoundError} If review doesn't exist
|
|
607
|
+
* @returns Updated review details
|
|
608
|
+
*/
|
|
609
|
+
async updateProductReview(params, context) {
|
|
610
|
+
this.required(params, ["productReviewId", "message", "rating"]);
|
|
611
|
+
return this.request({
|
|
612
|
+
method: "PUT",
|
|
613
|
+
path: this.buildPath(endpoints_1.ProductEndpoints.REVIEW, {
|
|
614
|
+
productReviewId: params.productReviewId,
|
|
615
|
+
}),
|
|
616
|
+
body: {
|
|
617
|
+
message: params.message,
|
|
618
|
+
rating: params.rating,
|
|
619
|
+
},
|
|
620
|
+
}, context);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
exports.ProductService = ProductService;
|
|
624
|
+
//# sourceMappingURL=product.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.service.js","sourceRoot":"","sources":["../../../src/services/product/product.service.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,kDAA8C;AAE9C,2CAA+C;AA6B/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAa,cAAe,SAAQ,0BAAW;IAA/C;;QACW,gBAAW,GAAG,SAAS,CAAC;IA+pBnC,CAAC;IA7pBC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,KAAK,CAAC,kBAAkB,CACtB,MAAgC,EAChC,OAAwB;QAExB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;QAEvD,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,4BAAgB,CAAC,YAAY;YACnC,MAAM,EAAE,IAAI,CAAC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