@djust-b2b/djust-front-sdk 3.0.0-beta.8 → 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 +43 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +274 -64
- 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/definitions.d.ts +3 -1
- package/dist/services/quote/definitions.d.ts.map +1 -1
- package/dist/services/quote/index.d.ts +2 -1
- package/dist/services/quote/index.d.ts.map +1 -1
- package/dist/services/quote/quote.service.d.ts +1 -0
- package/dist/services/quote/quote.service.d.ts.map +1 -1
- package/dist/services/quote/types.d.ts +2 -0
- package/dist/services/quote/types.d.ts.map +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,232 @@
|
|
|
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
|
+
*
|
|
13
|
+
* Each function is described with its input parameters, output responses, and example usages.
|
|
14
|
+
*/
|
|
15
|
+
import { LoginResponse, RefreshTokenResponse, SettingsResponse, Store } from "./definitions";
|
|
16
|
+
import { IsTokenValidParameters, LoginParameters, RefreshTokenParameters, ResetPasswordParameters, SendResetPasswordEmailParameters, GetStoreParameters } from "./definitions.requests";
|
|
17
|
+
/**
|
|
18
|
+
* 🔐 Validates if a token is still active and unexpired.
|
|
19
|
+
*
|
|
20
|
+
* This function checks whether the provided token is valid, ensuring it has not expired or been invalidated.
|
|
21
|
+
*
|
|
22
|
+
* 🛠 **Endpoint**: `GET /auth/is-token-valid [TOK-200]`
|
|
23
|
+
*
|
|
24
|
+
* | Parameter | Type | Required | Description |
|
|
25
|
+
* |-----------|----------|----------|-------------------------------------|
|
|
26
|
+
* | `token` | `string` | ✅ | The token to validate. |
|
|
27
|
+
*
|
|
28
|
+
* 📤 **Returns**:
|
|
29
|
+
* A `Promise<boolean>` resolving to `true` if the token is valid and active, or `false` otherwise.
|
|
30
|
+
*
|
|
31
|
+
* 🛠 **Example usage**:
|
|
32
|
+
* ```ts
|
|
33
|
+
* const isValid = await isTokenValid({
|
|
34
|
+
* token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
|
|
35
|
+
* });
|
|
36
|
+
* console.log(isValid); // true
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @param {IsTokenValidParameters} params - The parameters for validating the token.
|
|
40
|
+
* @throws {Error} If the required `token` parameter is missing.
|
|
41
|
+
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the token is valid.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isTokenValid({ token, }: IsTokenValidParameters): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* 🔄 Requests a new access token using a refresh token.
|
|
46
|
+
*
|
|
47
|
+
* This function allows you to obtain a new access token by providing a valid refresh token.
|
|
48
|
+
*
|
|
49
|
+
* 🛠 **Endpoint**: `POST /auth/refresh-token [AUTH-102]`
|
|
50
|
+
*
|
|
51
|
+
* | Parameter | Type | Required | Description |
|
|
52
|
+
* |-----------------|----------|----------|--------------------------------------------------|
|
|
53
|
+
* | `refreshToken` | `string` | ✅ | The refresh token used to request a new access token. |
|
|
54
|
+
*
|
|
55
|
+
* 📤 **Returns**:
|
|
56
|
+
* A `Promise<RefreshTokenResponse>` containing the new access token, its expiry time, and a refreshed token.
|
|
57
|
+
*
|
|
58
|
+
* 🛠 **Example usage**:
|
|
59
|
+
* ```ts
|
|
60
|
+
* const response = await refreshToken({
|
|
61
|
+
* refreshToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @param {RefreshTokenParameters} params - The parameters for requesting a new token.
|
|
66
|
+
* @throws {Error} If the required `refreshToken` parameter is missing.
|
|
67
|
+
* @returns {Promise<RefreshTokenResponse>} A promise that resolves to the response containing the new token and user details.
|
|
68
|
+
*/
|
|
69
|
+
export declare function refreshToken({ refreshToken, }: RefreshTokenParameters): Promise<RefreshTokenResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* 🔑 Resets the password of a user.
|
|
72
|
+
*
|
|
73
|
+
* This function allows a user to reset their password by providing a new password along with a valid reset token.
|
|
74
|
+
*
|
|
75
|
+
* 🛠 **Endpoint**: `POST /auth/reset-password [PWD-102]`
|
|
76
|
+
*
|
|
77
|
+
* | Parameter | Type | Required | Description |
|
|
78
|
+
* |-----------------------|----------|----------|--------------------------------------------------------------|
|
|
79
|
+
* | `newPassword` | `string` | ✅ | The new password to set for the user. |
|
|
80
|
+
* | `resetPasswordToken` | `string` | ✅ | The token required to authenticate the password reset process. |
|
|
81
|
+
*
|
|
82
|
+
* 📤 **Returns**:
|
|
83
|
+
* A `Promise<void>` that resolves with a success message `"OK"` if the password is successfully reset.
|
|
84
|
+
*
|
|
85
|
+
* 🛠 **Example usage**:
|
|
86
|
+
* ```ts
|
|
87
|
+
* await resetPassword({
|
|
88
|
+
* newPassword: "mySecurePassword2025!",
|
|
89
|
+
* resetPasswordToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @param {ResetPasswordParameters} params - The parameters required for resetting the password.
|
|
94
|
+
* @throws {Error} If the required parameters `newPassword` or `resetPasswordToken` are missing.
|
|
95
|
+
* @returns {Promise<void>} Resolves to `"OK"` if the password reset is successful.
|
|
96
|
+
*/
|
|
97
|
+
export declare function resetPassword({ newPassword, resetPasswordToken, }: ResetPasswordParameters): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* 📧 Sends a reset password email to a user.
|
|
100
|
+
*
|
|
101
|
+
* This function sends an email containing a reset password link to the specified email address.
|
|
102
|
+
*
|
|
103
|
+
* 🛠 **Endpoint**: `POST /auth/send-reset-password-email [PWD-101]`
|
|
104
|
+
*
|
|
105
|
+
* | Parameter | Type | Required | Description |
|
|
106
|
+
* |------------|----------|----------|----------------------------------------------------|
|
|
107
|
+
* | `email` | `string` | ✅ | The email address to which the reset link will be sent. |
|
|
108
|
+
*
|
|
109
|
+
* 📤 **Returns**:
|
|
110
|
+
* A `Promise<void>` that resolves when the reset password email is successfully sent.
|
|
111
|
+
*
|
|
112
|
+
* 🛠 **Example usage**:
|
|
113
|
+
* ```ts
|
|
114
|
+
* await sendResetPasswordEmail({
|
|
115
|
+
* email: "user@example.com",
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @param {SendResetPasswordEmailParameters} params - The parameters required to send the reset password email.
|
|
120
|
+
* @throws {Error} If the required parameter `email` is missing.
|
|
121
|
+
* @returns {Promise<void>} Resolves when the reset email is successfully sent.
|
|
122
|
+
*/
|
|
123
|
+
export declare function sendResetPasswordEmail({ email, }: SendResetPasswordEmailParameters): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* 🔐 Logs in a user.
|
|
126
|
+
*
|
|
127
|
+
* This function allows a user to log in by providing their username and password, and returns their login information, including an access token and user details.
|
|
128
|
+
*
|
|
129
|
+
* 🛠 **Endpoint**: `POST /auth/token?withUser=true [AUTH-101]`
|
|
130
|
+
*
|
|
131
|
+
* | Parameter | Type | Required | Description |
|
|
132
|
+
* |-------------|----------|----------|--------------------------------------|
|
|
133
|
+
* | `username` | `string` | ✅ | The username of the user to log in. |
|
|
134
|
+
* | `password` | `string` | ✅ | The password of the user to log in. |
|
|
135
|
+
* | `withUser` | `boolean`| ❌ | Whether to include user details in the response. Default: `true` |
|
|
136
|
+
*
|
|
137
|
+
* 📤 **Returns**:
|
|
138
|
+
* A `Promise<LoginResponse>` that resolves to the user's login information, including:
|
|
139
|
+
* - `token` (object): Contains the `accessToken`, `refreshToken`, and `expireAt` timestamp.
|
|
140
|
+
* - `user` (object): Contains the user's `id`.
|
|
141
|
+
*
|
|
142
|
+
* 🛠 **Example usage**:
|
|
143
|
+
* ```ts
|
|
144
|
+
* const loginResponse = await login({
|
|
145
|
+
* username: "user@example.com",
|
|
146
|
+
* password: "password123",
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* @param {LoginParameters} params - The parameters required for logging in the user.
|
|
151
|
+
* @throws {Error} If the required parameters `username` or `password` are missing.
|
|
152
|
+
* @returns {Promise<LoginResponse>} Resolves to an object containing the user's login information.
|
|
153
|
+
*/
|
|
154
|
+
export declare function login({ username, password, withUser, }: LoginParameters): Promise<LoginResponse>;
|
|
155
|
+
/**
|
|
156
|
+
* 🚪 Logs out the user.
|
|
157
|
+
*
|
|
158
|
+
* This function logs out the user by revoking their authentication token.
|
|
159
|
+
*
|
|
160
|
+
* 🛠 **Endpoint**: `POST /auth/revoke-token [AUTH-103]`
|
|
161
|
+
*
|
|
162
|
+
* | Parameter | Type | Required | Description |
|
|
163
|
+
* |-----------|------|----------|-------------|
|
|
164
|
+
* | *(none)* | - | - | This function does not require any parameters. |
|
|
165
|
+
*
|
|
166
|
+
* 📤 **Returns**:
|
|
167
|
+
* A `Promise<void>` that resolves when the user is successfully logged out. No additional data is returned.
|
|
168
|
+
*
|
|
169
|
+
* 🛠 **Example usage**:
|
|
170
|
+
* ```ts
|
|
171
|
+
* await logout();
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* @throws {Error} If there is an issue with the logout process (e.g., network error).
|
|
175
|
+
* @returns {Promise<void>} Resolves when the logout is successful.
|
|
176
|
+
*/
|
|
177
|
+
export declare function logout(): Promise<void>;
|
|
178
|
+
/**
|
|
179
|
+
* ⚙️ Récupère les paramètres globaux du shop.
|
|
180
|
+
*
|
|
181
|
+
* Cette fonction permet d'obtenir les paramètres de configuration du shop.
|
|
182
|
+
*
|
|
183
|
+
* 🛠 **Endpoint**: `GET /v1/shop/settings` [SETTINGS-500]
|
|
184
|
+
*
|
|
185
|
+
* 📤 **Returns**:
|
|
186
|
+
* A `Promise<SettingsResponse>` contenant les paramètres du shop, notamment:
|
|
187
|
+
* - `manualAccountCheck` (boolean): Indique si la vérification manuelle des comptes est activée.
|
|
188
|
+
*
|
|
189
|
+
* 🛠 **Example usage**:
|
|
190
|
+
* ```ts
|
|
191
|
+
* const settings = await getSettings();
|
|
192
|
+
* console.log(settings.manualAccountCheck); // true
|
|
193
|
+
* ```
|
|
194
|
+
*
|
|
195
|
+
* @returns {Promise<SettingsResponse>} Une promesse qui résout avec les paramètres du shop.
|
|
196
|
+
*/
|
|
197
|
+
export declare function getSettings(): Promise<SettingsResponse>;
|
|
198
|
+
/**
|
|
199
|
+
* 🏪 Récupère les informations d'un magasin spécifique.
|
|
200
|
+
*
|
|
201
|
+
* Cette fonction permet d'obtenir les détails d'un magasin à partir de son identifiant.
|
|
202
|
+
*
|
|
203
|
+
* 🛠 **Endpoint**: `GET /v1/shop/stores/{storeId}` [STORE-500]
|
|
204
|
+
*
|
|
205
|
+
* | Parameter | Type | Required | Description |
|
|
206
|
+
* |------------|----------|----------|--------------------------------------|
|
|
207
|
+
* | `storeId` | `string` | ✅ | L'identifiant unique du magasin. |
|
|
208
|
+
*
|
|
209
|
+
* 📤 **Returns**:
|
|
210
|
+
* A `Promise<Store>` contenant les informations détaillées du magasin, notamment:
|
|
211
|
+
* - `active`: État d'activation du magasin
|
|
212
|
+
* - `customFieldValues`: Valeurs des champs personnalisés
|
|
213
|
+
* - `description`: Description du magasin
|
|
214
|
+
* - `externalId`: Identifiant externe
|
|
215
|
+
* - `id`: Identifiant interne
|
|
216
|
+
* - `name`: Nom du magasin
|
|
217
|
+
* - `storeLocales`: Informations de localisation
|
|
218
|
+
*
|
|
219
|
+
* 🛠 **Example usage**:
|
|
220
|
+
* ```ts
|
|
221
|
+
* const store = await getStore({
|
|
222
|
+
* storeId: "123e4567-e89b-12d3-a456-426614174000"
|
|
223
|
+
* });
|
|
224
|
+
* console.log(store.name); // "Mon Magasin"
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* @param {GetStoreParameters} params - Les paramètres pour récupérer le magasin.
|
|
228
|
+
* @throws {Error} Si le paramètre `storeId` est manquant.
|
|
229
|
+
* @returns {Promise<Store>} Une promesse qui résout avec les informations du magasin.
|
|
230
|
+
*/
|
|
231
|
+
export declare function getStore({ storeId, }: GetStoreParameters): Promise<Store>;
|
|
232
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,gCAAgC,EAChC,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAAC,EACjC,KAAK,GACN,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,CAY3C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,YAAY,CAAC,EACjC,YAAY,GACb,EAAE,sBAAsB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAYxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,aAAa,CAAC,EAClC,WAAW,EACX,kBAAkB,GACnB,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAWzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,KAAK,GACN,EAAE,gCAAgC,GAAG,OAAO,CAAC,IAAI,CAAC,CAUlD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,KAAK,CAAC,EAC1B,QAAQ,EACR,QAAQ,EACR,QAAe,GAChB,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC,CAY1C;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAK5C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAO7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,QAAQ,CAAC,EAC7B,OAAO,GACR,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,CASrC"}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* # Auth Service
|
|
4
|
+
*
|
|
5
|
+
* This module provides all functionalities related to user authentication and authorization.
|
|
6
|
+
*
|
|
7
|
+
* ## Features:
|
|
8
|
+
* - Validate tokens
|
|
9
|
+
* - Refresh tokens
|
|
10
|
+
* - Reset user passwords
|
|
11
|
+
* - Manage user login and logout
|
|
12
|
+
* - Send password reset emails
|
|
13
|
+
*
|
|
14
|
+
* Each function is described with its input parameters, output responses, and example usages.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.isTokenValid = isTokenValid;
|
|
18
|
+
exports.refreshToken = refreshToken;
|
|
19
|
+
exports.resetPassword = resetPassword;
|
|
20
|
+
exports.sendResetPasswordEmail = sendResetPasswordEmail;
|
|
21
|
+
exports.login = login;
|
|
22
|
+
exports.logout = logout;
|
|
23
|
+
exports.getSettings = getSettings;
|
|
24
|
+
exports.getStore = getStore;
|
|
25
|
+
const parameters_validation_1 = require("../../helpers/parameters-validation");
|
|
26
|
+
const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
27
|
+
/**
|
|
28
|
+
* 🔐 Validates if a token is still active and unexpired.
|
|
29
|
+
*
|
|
30
|
+
* This function checks whether the provided token is valid, ensuring it has not expired or been invalidated.
|
|
31
|
+
*
|
|
32
|
+
* 🛠 **Endpoint**: `GET /auth/is-token-valid [TOK-200]`
|
|
33
|
+
*
|
|
34
|
+
* | Parameter | Type | Required | Description |
|
|
35
|
+
* |-----------|----------|----------|-------------------------------------|
|
|
36
|
+
* | `token` | `string` | ✅ | The token to validate. |
|
|
37
|
+
*
|
|
38
|
+
* 📤 **Returns**:
|
|
39
|
+
* A `Promise<boolean>` resolving to `true` if the token is valid and active, or `false` otherwise.
|
|
40
|
+
*
|
|
41
|
+
* 🛠 **Example usage**:
|
|
42
|
+
* ```ts
|
|
43
|
+
* const isValid = await isTokenValid({
|
|
44
|
+
* token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
|
|
45
|
+
* });
|
|
46
|
+
* console.log(isValid); // true
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @param {IsTokenValidParameters} params - The parameters for validating the token.
|
|
50
|
+
* @throws {Error} If the required `token` parameter is missing.
|
|
51
|
+
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the token is valid.
|
|
52
|
+
*/
|
|
53
|
+
async function isTokenValid({ token, }) {
|
|
54
|
+
(0, parameters_validation_1.required)({ token });
|
|
55
|
+
const response = await (0, fetch_instance_1.enhancedFetch)({
|
|
56
|
+
method: "GET",
|
|
57
|
+
path: `/auth/is-token-valid`,
|
|
58
|
+
params: {
|
|
59
|
+
token,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
return response?.data;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 🔄 Requests a new access token using a refresh token.
|
|
66
|
+
*
|
|
67
|
+
* This function allows you to obtain a new access token by providing a valid refresh token.
|
|
68
|
+
*
|
|
69
|
+
* 🛠 **Endpoint**: `POST /auth/refresh-token [AUTH-102]`
|
|
70
|
+
*
|
|
71
|
+
* | Parameter | Type | Required | Description |
|
|
72
|
+
* |-----------------|----------|----------|--------------------------------------------------|
|
|
73
|
+
* | `refreshToken` | `string` | ✅ | The refresh token used to request a new access token. |
|
|
74
|
+
*
|
|
75
|
+
* 📤 **Returns**:
|
|
76
|
+
* A `Promise<RefreshTokenResponse>` containing the new access token, its expiry time, and a refreshed token.
|
|
77
|
+
*
|
|
78
|
+
* 🛠 **Example usage**:
|
|
79
|
+
* ```ts
|
|
80
|
+
* const response = await refreshToken({
|
|
81
|
+
* refreshToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @param {RefreshTokenParameters} params - The parameters for requesting a new token.
|
|
86
|
+
* @throws {Error} If the required `refreshToken` parameter is missing.
|
|
87
|
+
* @returns {Promise<RefreshTokenResponse>} A promise that resolves to the response containing the new token and user details.
|
|
88
|
+
*/
|
|
89
|
+
async function refreshToken({ refreshToken, }) {
|
|
90
|
+
(0, parameters_validation_1.required)({ refreshToken });
|
|
91
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
92
|
+
method: "POST",
|
|
93
|
+
path: `/auth/refresh-token`,
|
|
94
|
+
body: JSON.stringify({
|
|
95
|
+
refreshToken,
|
|
96
|
+
}),
|
|
97
|
+
});
|
|
98
|
+
return data;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* 🔑 Resets the password of a user.
|
|
102
|
+
*
|
|
103
|
+
* This function allows a user to reset their password by providing a new password along with a valid reset token.
|
|
104
|
+
*
|
|
105
|
+
* 🛠 **Endpoint**: `POST /auth/reset-password [PWD-102]`
|
|
106
|
+
*
|
|
107
|
+
* | Parameter | Type | Required | Description |
|
|
108
|
+
* |-----------------------|----------|----------|--------------------------------------------------------------|
|
|
109
|
+
* | `newPassword` | `string` | ✅ | The new password to set for the user. |
|
|
110
|
+
* | `resetPasswordToken` | `string` | ✅ | The token required to authenticate the password reset process. |
|
|
111
|
+
*
|
|
112
|
+
* 📤 **Returns**:
|
|
113
|
+
* A `Promise<void>` that resolves with a success message `"OK"` if the password is successfully reset.
|
|
114
|
+
*
|
|
115
|
+
* 🛠 **Example usage**:
|
|
116
|
+
* ```ts
|
|
117
|
+
* await resetPassword({
|
|
118
|
+
* newPassword: "mySecurePassword2025!",
|
|
119
|
+
* resetPasswordToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
120
|
+
* });
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @param {ResetPasswordParameters} params - The parameters required for resetting the password.
|
|
124
|
+
* @throws {Error} If the required parameters `newPassword` or `resetPasswordToken` are missing.
|
|
125
|
+
* @returns {Promise<void>} Resolves to `"OK"` if the password reset is successful.
|
|
126
|
+
*/
|
|
127
|
+
async function resetPassword({ newPassword, resetPasswordToken, }) {
|
|
128
|
+
(0, parameters_validation_1.required)({ newPassword, resetPasswordToken });
|
|
129
|
+
await (0, fetch_instance_1.enhancedFetch)({
|
|
130
|
+
method: "POST",
|
|
131
|
+
path: `/auth/reset-password`,
|
|
132
|
+
body: JSON.stringify({
|
|
133
|
+
newPassword,
|
|
134
|
+
resetPasswordToken,
|
|
135
|
+
}),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 📧 Sends a reset password email to a user.
|
|
140
|
+
*
|
|
141
|
+
* This function 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
|
+
*
|
|
149
|
+
* 📤 **Returns**:
|
|
150
|
+
* A `Promise<void>` that resolves when the reset password email is successfully sent.
|
|
151
|
+
*
|
|
152
|
+
* 🛠 **Example usage**:
|
|
153
|
+
* ```ts
|
|
154
|
+
* await sendResetPasswordEmail({
|
|
155
|
+
* email: "user@example.com",
|
|
156
|
+
* });
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* @param {SendResetPasswordEmailParameters} params - The parameters required to send the reset password email.
|
|
160
|
+
* @throws {Error} If the required parameter `email` is missing.
|
|
161
|
+
* @returns {Promise<void>} Resolves when the reset email is successfully sent.
|
|
162
|
+
*/
|
|
163
|
+
async function sendResetPasswordEmail({ email, }) {
|
|
164
|
+
(0, parameters_validation_1.required)({ email });
|
|
165
|
+
await (0, fetch_instance_1.enhancedFetch)({
|
|
166
|
+
method: "POST",
|
|
167
|
+
path: `/auth/send-reset-password-email`,
|
|
168
|
+
body: JSON.stringify({
|
|
169
|
+
email,
|
|
170
|
+
}),
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 🔐 Logs in a user.
|
|
175
|
+
*
|
|
176
|
+
* This function allows a user to log in by providing their username and password, and returns their login information, including an access token and user details.
|
|
177
|
+
*
|
|
178
|
+
* 🛠 **Endpoint**: `POST /auth/token?withUser=true [AUTH-101]`
|
|
179
|
+
*
|
|
180
|
+
* | Parameter | Type | Required | Description |
|
|
181
|
+
* |-------------|----------|----------|--------------------------------------|
|
|
182
|
+
* | `username` | `string` | ✅ | The username of the user to log in. |
|
|
183
|
+
* | `password` | `string` | ✅ | The password of the user to log in. |
|
|
184
|
+
* | `withUser` | `boolean`| ❌ | Whether to include user details in the response. Default: `true` |
|
|
185
|
+
*
|
|
186
|
+
* 📤 **Returns**:
|
|
187
|
+
* A `Promise<LoginResponse>` that resolves to the user's login information, including:
|
|
188
|
+
* - `token` (object): Contains the `accessToken`, `refreshToken`, and `expireAt` timestamp.
|
|
189
|
+
* - `user` (object): Contains the user's `id`.
|
|
190
|
+
*
|
|
191
|
+
* 🛠 **Example usage**:
|
|
192
|
+
* ```ts
|
|
193
|
+
* const loginResponse = await login({
|
|
194
|
+
* username: "user@example.com",
|
|
195
|
+
* password: "password123",
|
|
196
|
+
* });
|
|
197
|
+
* ```
|
|
198
|
+
*
|
|
199
|
+
* @param {LoginParameters} params - The parameters required for logging in the user.
|
|
200
|
+
* @throws {Error} If the required parameters `username` or `password` are missing.
|
|
201
|
+
* @returns {Promise<LoginResponse>} Resolves to an object containing the user's login information.
|
|
202
|
+
*/
|
|
203
|
+
async function login({ username, password, withUser = true, }) {
|
|
204
|
+
(0, parameters_validation_1.required)({ username, password });
|
|
205
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
206
|
+
method: "POST",
|
|
207
|
+
path: `/auth/token?withUser=${withUser}`,
|
|
208
|
+
body: JSON.stringify({
|
|
209
|
+
username,
|
|
210
|
+
password,
|
|
211
|
+
}),
|
|
212
|
+
});
|
|
213
|
+
return data;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* 🚪 Logs out the user.
|
|
217
|
+
*
|
|
218
|
+
* This function logs out the user by revoking their authentication token.
|
|
219
|
+
*
|
|
220
|
+
* 🛠 **Endpoint**: `POST /auth/revoke-token [AUTH-103]`
|
|
221
|
+
*
|
|
222
|
+
* | Parameter | Type | Required | Description |
|
|
223
|
+
* |-----------|------|----------|-------------|
|
|
224
|
+
* | *(none)* | - | - | This function does not require any parameters. |
|
|
225
|
+
*
|
|
226
|
+
* 📤 **Returns**:
|
|
227
|
+
* A `Promise<void>` that resolves when the user is successfully logged out. No additional data is returned.
|
|
228
|
+
*
|
|
229
|
+
* 🛠 **Example usage**:
|
|
230
|
+
* ```ts
|
|
231
|
+
* await logout();
|
|
232
|
+
* ```
|
|
233
|
+
*
|
|
234
|
+
* @throws {Error} If there is an issue with the logout process (e.g., network error).
|
|
235
|
+
* @returns {Promise<void>} Resolves when the logout is successful.
|
|
236
|
+
*/
|
|
237
|
+
async function logout() {
|
|
238
|
+
await (0, fetch_instance_1.enhancedFetch)({
|
|
239
|
+
method: "POST",
|
|
240
|
+
path: `/auth/revoke-token`,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* ⚙️ Récupère les paramètres globaux du shop.
|
|
245
|
+
*
|
|
246
|
+
* Cette fonction permet d'obtenir les paramètres de configuration du shop.
|
|
247
|
+
*
|
|
248
|
+
* 🛠 **Endpoint**: `GET /v1/shop/settings` [SETTINGS-500]
|
|
249
|
+
*
|
|
250
|
+
* 📤 **Returns**:
|
|
251
|
+
* A `Promise<SettingsResponse>` contenant les paramètres du shop, notamment:
|
|
252
|
+
* - `manualAccountCheck` (boolean): Indique si la vérification manuelle des comptes est activée.
|
|
253
|
+
*
|
|
254
|
+
* 🛠 **Example usage**:
|
|
255
|
+
* ```ts
|
|
256
|
+
* const settings = await getSettings();
|
|
257
|
+
* console.log(settings.manualAccountCheck); // true
|
|
258
|
+
* ```
|
|
259
|
+
*
|
|
260
|
+
* @returns {Promise<SettingsResponse>} Une promesse qui résout avec les paramètres du shop.
|
|
261
|
+
*/
|
|
262
|
+
async function getSettings() {
|
|
263
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
264
|
+
method: "GET",
|
|
265
|
+
path: `/v1/shop/settings`,
|
|
266
|
+
});
|
|
267
|
+
return data;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* 🏪 Récupère les informations d'un magasin spécifique.
|
|
271
|
+
*
|
|
272
|
+
* Cette fonction permet d'obtenir les détails d'un magasin à partir de son identifiant.
|
|
273
|
+
*
|
|
274
|
+
* 🛠 **Endpoint**: `GET /v1/shop/stores/{storeId}` [STORE-500]
|
|
275
|
+
*
|
|
276
|
+
* | Parameter | Type | Required | Description |
|
|
277
|
+
* |------------|----------|----------|--------------------------------------|
|
|
278
|
+
* | `storeId` | `string` | ✅ | L'identifiant unique du magasin. |
|
|
279
|
+
*
|
|
280
|
+
* 📤 **Returns**:
|
|
281
|
+
* A `Promise<Store>` contenant les informations détaillées du magasin, notamment:
|
|
282
|
+
* - `active`: État d'activation du magasin
|
|
283
|
+
* - `customFieldValues`: Valeurs des champs personnalisés
|
|
284
|
+
* - `description`: Description du magasin
|
|
285
|
+
* - `externalId`: Identifiant externe
|
|
286
|
+
* - `id`: Identifiant interne
|
|
287
|
+
* - `name`: Nom du magasin
|
|
288
|
+
* - `storeLocales`: Informations de localisation
|
|
289
|
+
*
|
|
290
|
+
* 🛠 **Example usage**:
|
|
291
|
+
* ```ts
|
|
292
|
+
* const store = await getStore({
|
|
293
|
+
* storeId: "123e4567-e89b-12d3-a456-426614174000"
|
|
294
|
+
* });
|
|
295
|
+
* console.log(store.name); // "Mon Magasin"
|
|
296
|
+
* ```
|
|
297
|
+
*
|
|
298
|
+
* @param {GetStoreParameters} params - Les paramètres pour récupérer le magasin.
|
|
299
|
+
* @throws {Error} Si le paramètre `storeId` est manquant.
|
|
300
|
+
* @returns {Promise<Store>} Une promesse qui résout avec les informations du magasin.
|
|
301
|
+
*/
|
|
302
|
+
async function getStore({ storeId, }) {
|
|
303
|
+
(0, parameters_validation_1.required)({ storeId });
|
|
304
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
305
|
+
method: "GET",
|
|
306
|
+
path: `/v1/shop/stores/${storeId}`,
|
|
307
|
+
});
|
|
308
|
+
return data;
|
|
309
|
+
}
|
|
310
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/auth/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AA6CH,oCAcC;AA2BD,oCAcC;AA6BD,sCAcC;AA2BD,wDAYC;AAgCD,sBAgBC;AAwBD,wBAKC;AAqBD,kCAOC;AAmCD,4BAWC;AA3UD,+EAA+D;AAC/D,kEAA8D;AAgB9D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACI,KAAK,UAAU,YAAY,CAAC,EACjC,KAAK,GACkB;IACvB,IAAA,gCAAQ,EAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAEpB,MAAM,QAAQ,GAAG,MAAM,IAAA,8BAAa,EAAU;QAC5C,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE;YACN,KAAK;SACN;KACF,CAAC,CAAC;IAEH,OAAO,QAAQ,EAAE,IAAI,CAAC;AACxB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,KAAK,UAAU,YAAY,CAAC,EACjC,YAAY,GACW;IACvB,IAAA,gCAAQ,EAAC,EAAE,YAAY,EAAE,CAAC,CAAC;IAE3B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,8BAAa,EAAuB;QACzD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,YAAY;SACb,CAAC;KACH,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,aAAa,CAAC,EAClC,WAAW,EACX,kBAAkB,GACM;IACxB,IAAA,gCAAQ,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAE9C,MAAM,IAAA,8BAAa,EAAO;QACxB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,WAAW;YACX,kBAAkB;SACnB,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,KAAK,UAAU,sBAAsB,CAAC,EAC3C,KAAK,GAC4B;IACjC,IAAA,gCAAQ,EAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAEpB,MAAM,IAAA,8BAAa,EAAO;QACxB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,iCAAiC;QACvC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,KAAK;SACN,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACI,KAAK,UAAU,KAAK,CAAC,EAC1B,QAAQ,EACR,QAAQ,EACR,QAAQ,GAAG,IAAI,GACC;IAChB,IAAA,gCAAQ,EAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEjC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,8BAAa,EAAgB;QAClD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,wBAAwB,QAAQ,EAAE;QACxC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,QAAQ;YACR,QAAQ;SACT,CAAC;KACH,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACI,KAAK,UAAU,MAAM;IAC1B,MAAM,IAAA,8BAAa,EAAO;QACxB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,oBAAoB;KAC3B,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACI,KAAK,UAAU,WAAW;IAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,8BAAa,EAAmB;QACrD,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,mBAAmB;KAC1B,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACI,KAAK,UAAU,QAAQ,CAAC,EAC7B,OAAO,GACY;IACnB,IAAA,gCAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAEtB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,8BAAa,EAAQ;QAC1C,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,mBAAmB,OAAO,EAAE;KACnC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJUST SDK Auth Module
|
|
3
|
+
* Re-exports all auth-related types and service.
|
|
4
|
+
*
|
|
5
|
+
* @module services/auth
|
|
6
|
+
* @since 2.17.0
|
|
7
|
+
*/
|
|
8
|
+
export type { IsTokenValidParams, RefreshTokenParams, ResetPasswordParams, SendResetPasswordEmailParams, LoginParams, GetStoreParams, RefreshTokenResponse, LoginResponse, SettingsResponse, StoreLocale, CustomField, CustomFieldValue, Store, } from "./types";
|
|
9
|
+
export { AuthEndpoints, type AuthEndpoint } from "./endpoints";
|
|
10
|
+
export { AuthService } from "./auth.service";
|
|
11
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/services/auth/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,KAAK,GACN,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DJUST SDK Auth Module
|
|
4
|
+
* Re-exports all auth-related types and service.
|
|
5
|
+
*
|
|
6
|
+
* @module services/auth
|
|
7
|
+
* @since 2.17.0
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.AuthService = exports.AuthEndpoints = void 0;
|
|
11
|
+
// Endpoints
|
|
12
|
+
var endpoints_1 = require("./endpoints");
|
|
13
|
+
Object.defineProperty(exports, "AuthEndpoints", { enumerable: true, get: function () { return endpoints_1.AuthEndpoints; } });
|
|
14
|
+
// Service
|
|
15
|
+
var auth_service_1 = require("./auth.service");
|
|
16
|
+
Object.defineProperty(exports, "AuthService", { enumerable: true, get: function () { return auth_service_1.AuthService; } });
|
|
17
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/services/auth/module.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAmBH,YAAY;AACZ,yCAA+D;AAAtD,0GAAA,aAAa,OAAA;AAEtB,UAAU;AACV,+CAA6C;AAApC,2GAAA,WAAW,OAAA"}
|