@djust-b2b/djust-front-sdk 3.0.0-beta.9 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mocks centralisés pour les tests du module auth
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.mockHttpErrors = exports.mockErrors = exports.mockResponses = exports.mockParameters = exports.mockAuthResponses = exports.mockUsers = exports.mockTokens = void 0;
|
|
7
|
+
// Mock data pour les tokens
|
|
8
|
+
exports.mockTokens = {
|
|
9
|
+
validToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
|
|
10
|
+
invalidToken: "invalid_token_123",
|
|
11
|
+
refreshToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
|
|
12
|
+
resetPasswordToken: "reset_password_token_123",
|
|
13
|
+
};
|
|
14
|
+
// Mock data pour les utilisateurs
|
|
15
|
+
exports.mockUsers = {
|
|
16
|
+
validUser: {
|
|
17
|
+
username: "test@example.com",
|
|
18
|
+
password: "password123",
|
|
19
|
+
},
|
|
20
|
+
invalidUser: {
|
|
21
|
+
username: "invalid@example.com",
|
|
22
|
+
password: "wrongpassword",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
// Mock data pour les réponses d'authentification
|
|
26
|
+
exports.mockAuthResponses = {
|
|
27
|
+
loginSuccess: {
|
|
28
|
+
token: {
|
|
29
|
+
accessToken: "new_access_token_123",
|
|
30
|
+
expireAt: 1735689600000, // 2025-01-01
|
|
31
|
+
refreshToken: "new_refresh_token_123",
|
|
32
|
+
},
|
|
33
|
+
user: {
|
|
34
|
+
id: "user_123",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
refreshTokenSuccess: {
|
|
38
|
+
token: {
|
|
39
|
+
accessToken: "refreshed_access_token_456",
|
|
40
|
+
expireAt: 1735689600000, // 2025-01-01
|
|
41
|
+
refreshToken: "new_refresh_token_456",
|
|
42
|
+
},
|
|
43
|
+
user: {
|
|
44
|
+
id: "user_123",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
// Mock data pour les paramètres de test
|
|
49
|
+
exports.mockParameters = {
|
|
50
|
+
isTokenValid: {
|
|
51
|
+
valid: { token: exports.mockTokens.validToken },
|
|
52
|
+
invalid: { token: exports.mockTokens.invalidToken },
|
|
53
|
+
},
|
|
54
|
+
refreshToken: {
|
|
55
|
+
valid: { refreshToken: exports.mockTokens.refreshToken },
|
|
56
|
+
},
|
|
57
|
+
resetPassword: {
|
|
58
|
+
valid: {
|
|
59
|
+
newPassword: "newSecurePassword2025!",
|
|
60
|
+
resetPasswordToken: exports.mockTokens.resetPasswordToken,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
sendResetPasswordEmail: {
|
|
64
|
+
valid: { email: "user@example.com" },
|
|
65
|
+
invalid: { email: "invalid-email" },
|
|
66
|
+
},
|
|
67
|
+
login: {
|
|
68
|
+
valid: {
|
|
69
|
+
username: exports.mockUsers.validUser.username,
|
|
70
|
+
password: exports.mockUsers.validUser.password,
|
|
71
|
+
},
|
|
72
|
+
withUserFalse: {
|
|
73
|
+
username: exports.mockUsers.validUser.username,
|
|
74
|
+
password: exports.mockUsers.validUser.password,
|
|
75
|
+
withUser: false,
|
|
76
|
+
},
|
|
77
|
+
invalid: {
|
|
78
|
+
username: exports.mockUsers.invalidUser.username,
|
|
79
|
+
password: exports.mockUsers.invalidUser.password,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
getStore: {
|
|
83
|
+
valid: { storeId: "store_123" },
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
// Mock Headers pour les tests
|
|
87
|
+
const createMockHeaders = () => {
|
|
88
|
+
const headers = new Headers();
|
|
89
|
+
headers.append("Content-Type", "application/json");
|
|
90
|
+
headers.append("dj-client", "test-client");
|
|
91
|
+
headers.append("dj-api-key", "test-api-key");
|
|
92
|
+
return headers;
|
|
93
|
+
};
|
|
94
|
+
// Mock data pour les réponses des endpoints
|
|
95
|
+
exports.mockResponses = {
|
|
96
|
+
isTokenValid: {
|
|
97
|
+
success: {
|
|
98
|
+
data: true,
|
|
99
|
+
headers: createMockHeaders(),
|
|
100
|
+
status: 200,
|
|
101
|
+
},
|
|
102
|
+
failure: {
|
|
103
|
+
data: false,
|
|
104
|
+
headers: createMockHeaders(),
|
|
105
|
+
status: 200,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
refreshToken: {
|
|
109
|
+
success: {
|
|
110
|
+
data: exports.mockAuthResponses.refreshTokenSuccess,
|
|
111
|
+
headers: createMockHeaders(),
|
|
112
|
+
status: 200,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
resetPassword: {
|
|
116
|
+
success: {
|
|
117
|
+
data: undefined,
|
|
118
|
+
headers: createMockHeaders(),
|
|
119
|
+
status: 200,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
sendResetPasswordEmail: {
|
|
123
|
+
success: {
|
|
124
|
+
data: undefined,
|
|
125
|
+
headers: createMockHeaders(),
|
|
126
|
+
status: 200,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
login: {
|
|
130
|
+
success: {
|
|
131
|
+
data: exports.mockAuthResponses.loginSuccess,
|
|
132
|
+
headers: createMockHeaders(),
|
|
133
|
+
status: 200,
|
|
134
|
+
},
|
|
135
|
+
withUserFalse: {
|
|
136
|
+
data: exports.mockAuthResponses.loginSuccess,
|
|
137
|
+
headers: createMockHeaders(),
|
|
138
|
+
status: 200,
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
logout: {
|
|
142
|
+
success: {
|
|
143
|
+
data: undefined,
|
|
144
|
+
headers: createMockHeaders(),
|
|
145
|
+
status: 200,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
getSettings: {
|
|
149
|
+
success: {
|
|
150
|
+
data: {
|
|
151
|
+
manualAccountCheck: true,
|
|
152
|
+
},
|
|
153
|
+
headers: createMockHeaders(),
|
|
154
|
+
status: 200,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
getStore: {
|
|
158
|
+
success: {
|
|
159
|
+
data: {
|
|
160
|
+
active: true,
|
|
161
|
+
customFieldValues: [
|
|
162
|
+
{
|
|
163
|
+
customField: {
|
|
164
|
+
externalId: "field_1",
|
|
165
|
+
externalSource: "manual",
|
|
166
|
+
faceted: false,
|
|
167
|
+
id: "cf_1",
|
|
168
|
+
indexable: true,
|
|
169
|
+
mandatory: false,
|
|
170
|
+
name: { fr: "Champ personnalisé", en: "Custom field" },
|
|
171
|
+
role: "store",
|
|
172
|
+
sealedTarget: "store",
|
|
173
|
+
searchable: true,
|
|
174
|
+
sortable: true,
|
|
175
|
+
status: "active",
|
|
176
|
+
},
|
|
177
|
+
value: { fr: "Valeur test", en: "Test value" },
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
description: "Description du magasin",
|
|
181
|
+
externalId: "store_ext_123",
|
|
182
|
+
id: "store_123",
|
|
183
|
+
name: "Mon Magasin",
|
|
184
|
+
storeLocales: [
|
|
185
|
+
{
|
|
186
|
+
active: true,
|
|
187
|
+
code: "fr",
|
|
188
|
+
id: "locale_fr",
|
|
189
|
+
label: "Français",
|
|
190
|
+
main: true,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
active: true,
|
|
194
|
+
code: "en",
|
|
195
|
+
id: "locale_en",
|
|
196
|
+
label: "English",
|
|
197
|
+
main: false,
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
headers: createMockHeaders(),
|
|
202
|
+
status: 200,
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
// Mock data pour les erreurs
|
|
207
|
+
exports.mockErrors = {
|
|
208
|
+
networkError: new Error("Network error"),
|
|
209
|
+
unauthorized: new Error("Unauthorized"),
|
|
210
|
+
badRequest: new Error("Bad request"),
|
|
211
|
+
notFound: new Error("Not found"),
|
|
212
|
+
serverError: new Error("Internal server error"),
|
|
213
|
+
};
|
|
214
|
+
// Mock data pour les cas d'erreur HTTP
|
|
215
|
+
exports.mockHttpErrors = {
|
|
216
|
+
400: { status: 400, message: "Bad Request" },
|
|
217
|
+
401: { status: 401, message: "Unauthorized" },
|
|
218
|
+
404: { status: 404, message: "Not Found" },
|
|
219
|
+
500: { status: 500, message: "Internal Server Error" },
|
|
220
|
+
};
|
|
221
|
+
//# sourceMappingURL=auth.mocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.mocks.js","sourceRoot":"","sources":["../../../../src/services/auth/__mocks__/auth.mocks.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,4BAA4B;AACf,QAAA,UAAU,GAAG;IACxB,UAAU,EACR,6JAA6J;IAC/J,YAAY,EAAE,mBAAmB;IACjC,YAAY,EACV,6JAA6J;IAC/J,kBAAkB,EAAE,0BAA0B;CAC/C,CAAC;AAEF,kCAAkC;AACrB,QAAA,SAAS,GAAG;IACvB,SAAS,EAAE;QACT,QAAQ,EAAE,kBAAkB;QAC5B,QAAQ,EAAE,aAAa;KACxB;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,qBAAqB;QAC/B,QAAQ,EAAE,eAAe;KAC1B;CACF,CAAC;AAEF,iDAAiD;AACpC,QAAA,iBAAiB,GAAG;IAC/B,YAAY,EAAE;QACZ,KAAK,EAAE;YACL,WAAW,EAAE,sBAAsB;YACnC,QAAQ,EAAE,aAAa,EAAE,aAAa;YACtC,YAAY,EAAE,uBAAuB;SACtC;QACD,IAAI,EAAE;YACJ,EAAE,EAAE,UAAU;SACf;KACF;IACD,mBAAmB,EAAE;QACnB,KAAK,EAAE;YACL,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,aAAa,EAAE,aAAa;YACtC,YAAY,EAAE,uBAAuB;SACtC;QACD,IAAI,EAAE;YACJ,EAAE,EAAE,UAAU;SACf;KACF;CACF,CAAC;AAEF,wCAAwC;AAC3B,QA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c,CAAC;IACvC,UAAU,EAAE,IAAI,KAAK,CAAC,aAAa,CAAC;IACpC,QAAQ,EAAE,IAAI,KAAK,CAAC,WAAW,CAAC;IAChC,WAAW,EAAE,IAAI,KAAK,CAAC,uBAAuB,CAAC;CAChD,CAAC;AAEF,uCAAuC;AAC1B,QAAA,cAAc,GAAG;IAC5B,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE;IAC5C,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE;IAC7C,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE;IAC1C,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,uBAAuB,EAAE;CACvD,CAAC"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Auth Service
|
|
3
|
+
*
|
|
4
|
+
* This module provides all functionalities related to user authentication and authorization.
|
|
5
|
+
*
|
|
6
|
+
* ## Features:
|
|
7
|
+
* - Validate tokens
|
|
8
|
+
* - Refresh tokens
|
|
9
|
+
* - Reset user passwords
|
|
10
|
+
* - Manage user login and logout
|
|
11
|
+
* - Send password reset emails
|
|
12
|
+
* - Retrieve shop settings and store information
|
|
13
|
+
*
|
|
14
|
+
* Each method is described with its input parameters, output responses, and example usages.
|
|
15
|
+
*
|
|
16
|
+
* @module services/auth
|
|
17
|
+
* @since 2.17.0
|
|
18
|
+
*/
|
|
19
|
+
import { BaseService } from "../base.service";
|
|
20
|
+
import type { RequestContext } from "../../client/transport";
|
|
21
|
+
import type { IsTokenValidParams, RefreshTokenParams, ResetPasswordParams, SendResetPasswordEmailParams, LoginParams, GetStoreParams, RefreshTokenResponse, LoginResponse, SettingsResponse, Store } from "./types";
|
|
22
|
+
/**
|
|
23
|
+
* Service for authentication and authorization operations.
|
|
24
|
+
*
|
|
25
|
+
* Provides methods for:
|
|
26
|
+
* - 🔐 User login/logout
|
|
27
|
+
* - 🔄 Token validation and refresh
|
|
28
|
+
* - 🔑 Password reset
|
|
29
|
+
* - ⚙️ Shop settings and store information
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { createDjustClient } from '@djust-b2b/djust-front-sdk';
|
|
34
|
+
*
|
|
35
|
+
* const client = createDjustClient({
|
|
36
|
+
* baseUrl: 'https://api.djust.io',
|
|
37
|
+
* clientId: 'your-client-id',
|
|
38
|
+
* apiKey: 'your-api-key',
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* // Login
|
|
42
|
+
* const { token, user } = await client.auth.login({
|
|
43
|
+
* username: 'user@example.com',
|
|
44
|
+
* password: 'password123',
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* // Validate token
|
|
48
|
+
* const isValid = await client.auth.isTokenValid({ token: token.accessToken });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare class AuthService extends BaseService {
|
|
52
|
+
readonly serviceName = "auth";
|
|
53
|
+
/**
|
|
54
|
+
* 🔐 Validates if a token is still active and unexpired.
|
|
55
|
+
*
|
|
56
|
+
* This method checks whether the provided token is valid, ensuring it has not expired or been invalidated.
|
|
57
|
+
*
|
|
58
|
+
* 🛠 **Endpoint**: `GET /auth/is-token-valid [TOK-200]`
|
|
59
|
+
*
|
|
60
|
+
* | Parameter | Type | Required | Description |
|
|
61
|
+
* |-----------|----------|----------|-------------------------------------|
|
|
62
|
+
* | `token` | `string` | ✅ | The token to validate. |
|
|
63
|
+
*
|
|
64
|
+
* 📤 **Returns**:
|
|
65
|
+
* A `Promise<boolean>` resolving to `true` if the token is valid and active, or `false` otherwise.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const isValid = await client.auth.isTokenValid({
|
|
70
|
+
* token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
71
|
+
* });
|
|
72
|
+
* console.log(isValid); // true
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @param params - The parameters for validating the token.
|
|
76
|
+
* @param context - Optional request context for SSR.
|
|
77
|
+
* @throws {ValidationError} If the required `token` parameter is missing.
|
|
78
|
+
* @returns A promise that resolves to a boolean indicating whether the token is valid.
|
|
79
|
+
*/
|
|
80
|
+
isTokenValid(params: IsTokenValidParams, context?: RequestContext): Promise<boolean>;
|
|
81
|
+
/**
|
|
82
|
+
* 🔄 Requests a new access token using a refresh token.
|
|
83
|
+
*
|
|
84
|
+
* This method allows you to obtain a new access token by providing a valid refresh token.
|
|
85
|
+
*
|
|
86
|
+
* 🛠 **Endpoint**: `POST /auth/refresh-token [AUTH-102]`
|
|
87
|
+
*
|
|
88
|
+
* | Parameter | Type | Required | Description |
|
|
89
|
+
* |-----------------|----------|----------|--------------------------------------------------|
|
|
90
|
+
* | `refreshToken` | `string` | ✅ | The refresh token used to request a new access token. |
|
|
91
|
+
*
|
|
92
|
+
* 📤 **Returns**:
|
|
93
|
+
* A `Promise<RefreshTokenResponse>` containing the new access token, its expiry time, and a refreshed token.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* const response = await client.auth.refreshToken({
|
|
98
|
+
* refreshToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
99
|
+
* });
|
|
100
|
+
* console.log(response.token.accessToken);
|
|
101
|
+
* console.log(response.token.expiresAt);
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @param params - The parameters for requesting a new token.
|
|
105
|
+
* @param context - Optional request context for SSR.
|
|
106
|
+
* @throws {ValidationError} If the required `refreshToken` parameter is missing.
|
|
107
|
+
* @returns A promise that resolves to the response containing the new token and user details.
|
|
108
|
+
*/
|
|
109
|
+
refreshToken(params: RefreshTokenParams, context?: RequestContext): Promise<RefreshTokenResponse>;
|
|
110
|
+
/**
|
|
111
|
+
* 🔑 Resets the password of a user.
|
|
112
|
+
*
|
|
113
|
+
* This method allows a user to reset their password by providing a new password along with a valid reset token.
|
|
114
|
+
*
|
|
115
|
+
* 🛠 **Endpoint**: `POST /auth/reset-password [PWD-102]`
|
|
116
|
+
*
|
|
117
|
+
* | Parameter | Type | Required | Description |
|
|
118
|
+
* |-----------------------|----------|----------|--------------------------------------------------------------|
|
|
119
|
+
* | `newPassword` | `string` | ✅ | The new password to set for the user. |
|
|
120
|
+
* | `resetPasswordToken` | `string` | ✅ | The token required to authenticate the password reset process. |
|
|
121
|
+
*
|
|
122
|
+
* 📤 **Returns**:
|
|
123
|
+
* A `Promise<void>` that resolves when the password is successfully reset.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* await client.auth.resetPassword({
|
|
128
|
+
* newPassword: "mySecurePassword2025!",
|
|
129
|
+
* resetPasswordToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
130
|
+
* });
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @param params - The parameters required for resetting the password.
|
|
134
|
+
* @param context - Optional request context for SSR.
|
|
135
|
+
* @throws {ValidationError} If the required parameters `newPassword` or `resetPasswordToken` are missing.
|
|
136
|
+
*/
|
|
137
|
+
resetPassword(params: ResetPasswordParams, context?: RequestContext): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* 📧 Sends a reset password email to a user.
|
|
140
|
+
*
|
|
141
|
+
* This method sends an email containing a reset password link to the specified email address.
|
|
142
|
+
*
|
|
143
|
+
* 🛠 **Endpoint**: `POST /auth/send-reset-password-email [PWD-101]`
|
|
144
|
+
*
|
|
145
|
+
* | Parameter | Type | Required | Description |
|
|
146
|
+
* |---------------|----------|----------|----------------------------------------------------|
|
|
147
|
+
* | `email` | `string` | ✅ | The email address to which the reset link will be sent. |
|
|
148
|
+
* | `redirectUrl` | `string` | ❌ | Optional URL to redirect after password reset. |
|
|
149
|
+
*
|
|
150
|
+
* 📤 **Returns**:
|
|
151
|
+
* A `Promise<void>` that resolves when the reset password email is successfully sent.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* await client.auth.sendResetPasswordEmail({
|
|
156
|
+
* email: "user@example.com",
|
|
157
|
+
* redirectUrl: "https://myapp.com/reset-password",
|
|
158
|
+
* });
|
|
159
|
+
* ```
|
|
160
|
+
*
|
|
161
|
+
* @param params - The parameters required to send the reset password email.
|
|
162
|
+
* @param context - Optional request context for SSR.
|
|
163
|
+
* @throws {ValidationError} If the required parameter `email` is missing.
|
|
164
|
+
*/
|
|
165
|
+
sendResetPasswordEmail(params: SendResetPasswordEmailParams, context?: RequestContext): Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* 🔐 Logs in a user.
|
|
168
|
+
*
|
|
169
|
+
* This method allows a user to log in by providing their username and password,
|
|
170
|
+
* and returns their login information, including an access token and user details.
|
|
171
|
+
*
|
|
172
|
+
* 🛠 **Endpoint**: `POST /auth/token?withUser=true [AUTH-101]`
|
|
173
|
+
*
|
|
174
|
+
* | Parameter | Type | Required | Description |
|
|
175
|
+
* |-------------|-----------|----------|--------------------------------------|
|
|
176
|
+
* | `username` | `string` | ✅ | The username of the user to log in. |
|
|
177
|
+
* | `password` | `string` | ✅ | The password of the user to log in. |
|
|
178
|
+
* | `withUser` | `boolean` | ❌ | Whether to include user details in the response. Default: `true` |
|
|
179
|
+
*
|
|
180
|
+
* 📤 **Returns**:
|
|
181
|
+
* A `Promise<LoginResponse>` that resolves to the user's login information, including:
|
|
182
|
+
* - `token` (object): Contains the `accessToken`, `refreshToken`, and `expireAt` timestamp.
|
|
183
|
+
* - `user` (object): Contains the user's `id` and details (if `withUser` is true).
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* const loginResponse = await client.auth.login({
|
|
188
|
+
* username: "user@example.com",
|
|
189
|
+
* password: "password123",
|
|
190
|
+
* });
|
|
191
|
+
*
|
|
192
|
+
* console.log(loginResponse.token.accessToken);
|
|
193
|
+
* console.log(loginResponse.user.id);
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* @param params - The parameters required for logging in the user.
|
|
197
|
+
* @param context - Optional request context for SSR.
|
|
198
|
+
* @throws {ValidationError} If the required parameters `username` or `password` are missing.
|
|
199
|
+
* @throws {AuthError} If credentials are invalid.
|
|
200
|
+
* @returns Resolves to an object containing the user's login information.
|
|
201
|
+
*/
|
|
202
|
+
login(params: LoginParams, context?: RequestContext): Promise<LoginResponse>;
|
|
203
|
+
/**
|
|
204
|
+
* 🚪 Logs out the user.
|
|
205
|
+
*
|
|
206
|
+
* This method logs out the user by revoking their authentication token.
|
|
207
|
+
*
|
|
208
|
+
* 🛠 **Endpoint**: `POST /auth/revoke-token [AUTH-103]`
|
|
209
|
+
*
|
|
210
|
+
* | Parameter | Type | Required | Description |
|
|
211
|
+
* |-----------|------|----------|-------------|
|
|
212
|
+
* | *(none)* | - | - | This method does not require any parameters. |
|
|
213
|
+
*
|
|
214
|
+
* 📤 **Returns**:
|
|
215
|
+
* A `Promise<void>` that resolves when the user is successfully logged out.
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```typescript
|
|
219
|
+
* await client.auth.logout();
|
|
220
|
+
* // User is now logged out, token is revoked
|
|
221
|
+
* ```
|
|
222
|
+
*
|
|
223
|
+
* @param context - Optional request context for SSR.
|
|
224
|
+
* @throws {NetworkError} If there is an issue with the logout process.
|
|
225
|
+
*/
|
|
226
|
+
logout(context?: RequestContext): Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* ⚙️ Retrieves shop settings.
|
|
229
|
+
*
|
|
230
|
+
* This method retrieves the global configuration settings for the shop.
|
|
231
|
+
*
|
|
232
|
+
* 🛠 **Endpoint**: `GET /v1/shop/settings [SETTINGS-500]`
|
|
233
|
+
*
|
|
234
|
+
* 📤 **Returns**:
|
|
235
|
+
* A `Promise<SettingsResponse>` containing the shop settings, including:
|
|
236
|
+
* - `manualAccountCheck` (boolean): Indicates if manual account verification is enabled.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* ```typescript
|
|
240
|
+
* const settings = await client.auth.getSettings();
|
|
241
|
+
* console.log(settings.manualAccountCheck); // true
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* @param context - Optional request context for SSR.
|
|
245
|
+
* @returns A promise that resolves with the shop settings.
|
|
246
|
+
*/
|
|
247
|
+
getSettings(context?: RequestContext): Promise<SettingsResponse>;
|
|
248
|
+
/**
|
|
249
|
+
* 🏪 Retrieves store information.
|
|
250
|
+
*
|
|
251
|
+
* This method retrieves detailed information about a specific store by its identifier.
|
|
252
|
+
*
|
|
253
|
+
* 🛠 **Endpoint**: `GET /v1/shop/stores/{storeId} [STORE-500]`
|
|
254
|
+
*
|
|
255
|
+
* | Parameter | Type | Required | Description |
|
|
256
|
+
* |------------|----------|----------|--------------------------------------|
|
|
257
|
+
* | `storeId` | `string` | ✅ | The unique identifier of the store. |
|
|
258
|
+
*
|
|
259
|
+
* 📤 **Returns**:
|
|
260
|
+
* A `Promise<Store>` containing detailed store information, including:
|
|
261
|
+
* - `active`: Store activation status
|
|
262
|
+
* - `customFieldValues`: Custom field values
|
|
263
|
+
* - `description`: Store description
|
|
264
|
+
* - `externalId`: External identifier
|
|
265
|
+
* - `id`: Internal identifier
|
|
266
|
+
* - `name`: Store name
|
|
267
|
+
* - `storeLocales`: Localization information
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* ```typescript
|
|
271
|
+
* const store = await client.auth.getStore({
|
|
272
|
+
* storeId: "123e4567-e89b-12d3-a456-426614174000"
|
|
273
|
+
* });
|
|
274
|
+
* console.log(store.name); // "My Store"
|
|
275
|
+
* console.log(store.active); // true
|
|
276
|
+
* ```
|
|
277
|
+
*
|
|
278
|
+
* @param params - The parameters to retrieve the store.
|
|
279
|
+
* @param context - Optional request context for SSR.
|
|
280
|
+
* @throws {ValidationError} If the `storeId` parameter is missing.
|
|
281
|
+
* @throws {NotFoundError} If the store is not found.
|
|
282
|
+
* @returns A promise that resolves with the store information.
|
|
283
|
+
*/
|
|
284
|
+
getStore(params: GetStoreParams, context?: RequestContext): Promise<Store>;
|
|
285
|
+
}
|
|
286
|
+
//# sourceMappingURL=auth.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../../src/services/auth/auth.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,KAAK,EACN,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C,QAAQ,CAAC,WAAW,UAAU;IAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,YAAY,CAChB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,OAAO,CAAC;IAanB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,YAAY,CAChB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,oBAAoB,CAAC;IA2ChC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,aAAa,CACjB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;IAgBhB;;;;;;;;;;;;;;;;;;;;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