@djust-b2b/djust-front-sdk 3.0.0-beta.2 → 3.0.0-beta.20
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 +51 -7
- package/dist/.tsbuildinfo +1 -0
- package/dist/.tsbuildinfo-esm +1 -0
- package/dist/client/create-client.d.ts +248 -0
- package/dist/client/create-client.d.ts.map +1 -0
- package/dist/client/index.d.ts +14 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/performance.d.ts +203 -0
- package/dist/client/performance.d.ts.map +1 -0
- package/dist/client/transport.d.ts +372 -0
- package/dist/client/transport.d.ts.map +1 -0
- package/dist/errors/base.d.ts +101 -0
- package/dist/errors/base.d.ts.map +1 -0
- package/dist/errors/classes/auth.error.d.ts +64 -0
- package/dist/errors/classes/auth.error.d.ts.map +1 -0
- package/dist/errors/classes/forbidden.error.d.ts +52 -0
- package/dist/errors/classes/forbidden.error.d.ts.map +1 -0
- package/dist/errors/classes/index.d.ts +17 -0
- package/dist/errors/classes/index.d.ts.map +1 -0
- package/dist/errors/classes/network.error.d.ts +63 -0
- package/dist/errors/classes/network.error.d.ts.map +1 -0
- package/dist/errors/classes/not-found.error.d.ts +58 -0
- package/dist/errors/classes/not-found.error.d.ts.map +1 -0
- package/dist/errors/classes/rate-limit.error.d.ts +49 -0
- package/dist/errors/classes/rate-limit.error.d.ts.map +1 -0
- package/dist/errors/classes/server.error.d.ts +63 -0
- package/dist/errors/classes/server.error.d.ts.map +1 -0
- package/dist/errors/classes/timeout.error.d.ts +64 -0
- package/dist/errors/classes/timeout.error.d.ts.map +1 -0
- package/dist/errors/classes/unexpected.error.d.ts +70 -0
- package/dist/errors/classes/unexpected.error.d.ts.map +1 -0
- package/dist/errors/classes/validation.error.d.ts +68 -0
- package/dist/errors/classes/validation.error.d.ts.map +1 -0
- package/dist/errors/codes.d.ts +111 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/compat.d.ts +99 -0
- package/dist/errors/compat.d.ts.map +1 -0
- package/dist/errors/factory.d.ts +33 -0
- package/dist/errors/factory.d.ts.map +1 -0
- package/dist/errors/guards.d.ts +142 -0
- package/dist/errors/guards.d.ts.map +1 -0
- package/dist/errors/index.d.ts +25 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/types.d.ts +100 -0
- package/dist/errors/types.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +42 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/parameters-validation.d.ts +3 -0
- package/dist/helpers/parameters-validation.d.ts.map +1 -0
- package/dist/helpers/utils.d.ts +5 -0
- package/dist/helpers/utils.d.ts.map +1 -0
- package/dist/index.cjs +182 -0
- package/dist/index.d.ts +266 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +11611 -0
- package/dist/interfaces/index.d.ts +31 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/models/address.d.ts +61 -0
- package/dist/interfaces/models/address.d.ts.map +1 -0
- package/dist/interfaces/models/attribute.d.ts +31 -0
- package/dist/interfaces/models/attribute.d.ts.map +1 -0
- package/dist/interfaces/models/auth.d.ts +37 -0
- package/dist/interfaces/models/auth.d.ts.map +1 -0
- package/dist/interfaces/models/cart.d.ts +64 -0
- package/dist/interfaces/models/cart.d.ts.map +1 -0
- package/dist/interfaces/models/common.d.ts +68 -0
- package/dist/interfaces/models/common.d.ts.map +1 -0
- package/dist/interfaces/models/custom-field.d.ts +57 -0
- package/dist/interfaces/models/custom-field.d.ts.map +1 -0
- package/dist/interfaces/models/customer-account.d.ts +52 -0
- package/dist/interfaces/models/customer-account.d.ts.map +1 -0
- package/dist/interfaces/models/customer-organisation.d.ts +14 -0
- package/dist/interfaces/models/customer-organisation.d.ts.map +1 -0
- package/dist/interfaces/models/customer-user.d.ts +114 -0
- package/dist/interfaces/models/customer-user.d.ts.map +1 -0
- package/dist/interfaces/models/incident.d.ts +37 -0
- package/dist/interfaces/models/incident.d.ts.map +1 -0
- package/dist/interfaces/models/navigation-category.d.ts +22 -0
- package/dist/interfaces/models/navigation-category.d.ts.map +1 -0
- package/dist/interfaces/models/offer.d.ts +151 -0
- package/dist/interfaces/models/offer.d.ts.map +1 -0
- package/dist/interfaces/models/order.d.ts +701 -0
- package/dist/interfaces/models/order.d.ts.map +1 -0
- package/dist/interfaces/models/payment.d.ts +20 -0
- package/dist/interfaces/models/payment.d.ts.map +1 -0
- package/dist/interfaces/models/price.d.ts +6 -0
- package/dist/interfaces/models/price.d.ts.map +1 -0
- package/dist/interfaces/models/product.d.ts +243 -0
- package/dist/interfaces/models/product.d.ts.map +1 -0
- package/dist/interfaces/models/quote.d.ts +77 -0
- package/dist/interfaces/models/quote.d.ts.map +1 -0
- package/dist/interfaces/models/searchProduct.d.ts +128 -0
- package/dist/interfaces/models/searchProduct.d.ts.map +1 -0
- package/dist/interfaces/models/supplier.d.ts +72 -0
- package/dist/interfaces/models/supplier.d.ts.map +1 -0
- package/dist/services/attributes/attributes.service.d.ts +18 -0
- package/dist/services/attributes/attributes.service.d.ts.map +1 -0
- package/dist/services/attributes/definitions.d.ts +28 -0
- package/dist/services/attributes/definitions.d.ts.map +1 -0
- package/dist/services/attributes/endpoints.d.ts +12 -0
- package/dist/services/attributes/endpoints.d.ts.map +1 -0
- package/dist/services/attributes/index.d.ts +33 -0
- package/dist/services/attributes/index.d.ts.map +1 -0
- package/dist/services/attributes/module.d.ts +11 -0
- package/dist/services/attributes/module.d.ts.map +1 -0
- package/dist/services/attributes/types.d.ts +35 -0
- package/dist/services/attributes/types.d.ts.map +1 -0
- package/dist/services/auth/__mocks__/auth.mocks.d.ts +249 -0
- package/dist/services/auth/__mocks__/auth.mocks.d.ts.map +1 -0
- package/dist/services/auth/auth.service.d.ts +286 -0
- package/dist/services/auth/auth.service.d.ts.map +1 -0
- package/dist/services/auth/definitions.d.ts +69 -0
- package/dist/services/auth/definitions.d.ts.map +1 -0
- package/dist/services/auth/definitions.requests.d.ts +25 -0
- package/dist/services/auth/definitions.requests.d.ts.map +1 -0
- package/dist/services/auth/endpoints.d.ts +30 -0
- package/dist/services/auth/endpoints.d.ts.map +1 -0
- package/dist/services/auth/index.d.ts +232 -0
- package/dist/services/auth/index.d.ts.map +1 -0
- package/dist/services/auth/module.d.ts +11 -0
- package/dist/services/auth/module.d.ts.map +1 -0
- package/dist/services/auth/types.d.ts +124 -0
- package/dist/services/auth/types.d.ts.map +1 -0
- package/dist/services/base.service.d.ts +83 -0
- package/dist/services/base.service.d.ts.map +1 -0
- package/dist/services/cart/cart.service.d.ts +443 -0
- package/dist/services/cart/cart.service.d.ts.map +1 -0
- package/dist/services/cart/definitions.d.ts +84 -0
- package/dist/services/cart/definitions.d.ts.map +1 -0
- package/dist/services/cart/endpoints.d.ts +24 -0
- package/dist/services/cart/endpoints.d.ts.map +1 -0
- package/dist/services/cart/index.d.ts +330 -0
- package/dist/services/cart/index.d.ts.map +1 -0
- package/dist/services/cart/module.d.ts +11 -0
- package/dist/services/cart/module.d.ts.map +1 -0
- package/dist/services/cart/types.d.ts +236 -0
- package/dist/services/cart/types.d.ts.map +1 -0
- package/dist/services/commercial-order/commercial-order.service.d.ts +435 -0
- package/dist/services/commercial-order/commercial-order.service.d.ts.map +1 -0
- package/dist/services/commercial-order/definitions.d.ts +181 -0
- package/dist/services/commercial-order/definitions.d.ts.map +1 -0
- package/dist/services/commercial-order/endpoints.d.ts +28 -0
- package/dist/services/commercial-order/endpoints.d.ts.map +1 -0
- package/dist/services/commercial-order/index.d.ts +712 -0
- package/dist/services/commercial-order/index.d.ts.map +1 -0
- package/dist/services/commercial-order/module.d.ts +11 -0
- package/dist/services/commercial-order/module.d.ts.map +1 -0
- package/dist/services/commercial-order/types.d.ts +244 -0
- package/dist/services/commercial-order/types.d.ts.map +1 -0
- package/dist/services/custom-field/custom-field.service.d.ts +23 -0
- package/dist/services/custom-field/custom-field.service.d.ts.map +1 -0
- package/dist/services/custom-field/definitions.d.ts +107 -0
- package/dist/services/custom-field/definitions.d.ts.map +1 -0
- package/dist/services/custom-field/endpoints.d.ts +13 -0
- package/dist/services/custom-field/endpoints.d.ts.map +1 -0
- package/dist/services/custom-field/index.d.ts +115 -0
- package/dist/services/custom-field/index.d.ts.map +1 -0
- package/dist/services/custom-field/module.d.ts +11 -0
- package/dist/services/custom-field/module.d.ts.map +1 -0
- package/dist/services/custom-field/types.d.ts +51 -0
- package/dist/services/custom-field/types.d.ts.map +1 -0
- package/dist/services/customer-account/customer-account.service.d.ts +387 -0
- package/dist/services/customer-account/customer-account.service.d.ts.map +1 -0
- package/dist/services/customer-account/definitions.d.ts +164 -0
- package/dist/services/customer-account/definitions.d.ts.map +1 -0
- package/dist/services/customer-account/endpoints.d.ts +25 -0
- package/dist/services/customer-account/endpoints.d.ts.map +1 -0
- package/dist/services/customer-account/index.d.ts +656 -0
- package/dist/services/customer-account/index.d.ts.map +1 -0
- package/dist/services/customer-account/module.d.ts +11 -0
- package/dist/services/customer-account/module.d.ts.map +1 -0
- package/dist/services/customer-account/types.d.ts +253 -0
- package/dist/services/customer-account/types.d.ts.map +1 -0
- package/dist/services/customer-user/customer-user.service.d.ts +280 -0
- package/dist/services/customer-user/customer-user.service.d.ts.map +1 -0
- package/dist/services/customer-user/definitions.d.ts +84 -0
- package/dist/services/customer-user/definitions.d.ts.map +1 -0
- package/dist/services/customer-user/endpoints.d.ts +19 -0
- package/dist/services/customer-user/endpoints.d.ts.map +1 -0
- package/dist/services/customer-user/index.d.ts +394 -0
- package/dist/services/customer-user/index.d.ts.map +1 -0
- package/dist/services/customer-user/module.d.ts +11 -0
- package/dist/services/customer-user/module.d.ts.map +1 -0
- package/dist/services/customer-user/types.d.ts +118 -0
- package/dist/services/customer-user/types.d.ts.map +1 -0
- package/dist/services/factory.d.ts +104 -0
- package/dist/services/factory.d.ts.map +1 -0
- package/dist/services/incident/definitions.d.ts +85 -0
- package/dist/services/incident/definitions.d.ts.map +1 -0
- package/dist/services/incident/endpoints.d.ts +17 -0
- package/dist/services/incident/endpoints.d.ts.map +1 -0
- package/dist/services/incident/incident.service.d.ts +24 -0
- package/dist/services/incident/incident.service.d.ts.map +1 -0
- package/dist/services/incident/index.d.ts +270 -0
- package/dist/services/incident/index.d.ts.map +1 -0
- package/dist/services/incident/module.d.ts +11 -0
- package/dist/services/incident/module.d.ts.map +1 -0
- package/dist/services/incident/types.d.ts +116 -0
- package/dist/services/incident/types.d.ts.map +1 -0
- package/dist/services/logistic-order/definitions.d.ts +296 -0
- package/dist/services/logistic-order/definitions.d.ts.map +1 -0
- package/dist/services/logistic-order/endpoints.d.ts +44 -0
- package/dist/services/logistic-order/endpoints.d.ts.map +1 -0
- package/dist/services/logistic-order/index.d.ts +1338 -0
- package/dist/services/logistic-order/index.d.ts.map +1 -0
- package/dist/services/logistic-order/logistic-order.service.d.ts +62 -0
- package/dist/services/logistic-order/logistic-order.service.d.ts.map +1 -0
- package/dist/services/logistic-order/module.d.ts +11 -0
- package/dist/services/logistic-order/module.d.ts.map +1 -0
- package/dist/services/logistic-order/types.d.ts +411 -0
- package/dist/services/logistic-order/types.d.ts.map +1 -0
- package/dist/services/module.d.ts +64 -0
- package/dist/services/module.d.ts.map +1 -0
- package/dist/services/navigation-category/definitions.d.ts +31 -0
- package/dist/services/navigation-category/definitions.d.ts.map +1 -0
- package/dist/services/navigation-category/endpoints.d.ts +15 -0
- package/dist/services/navigation-category/endpoints.d.ts.map +1 -0
- package/dist/services/navigation-category/index.d.ts +114 -0
- package/dist/services/navigation-category/index.d.ts.map +1 -0
- package/dist/services/navigation-category/module.d.ts +11 -0
- package/dist/services/navigation-category/module.d.ts.map +1 -0
- package/dist/services/navigation-category/navigation-category.service.d.ts +148 -0
- package/dist/services/navigation-category/navigation-category.service.d.ts.map +1 -0
- package/dist/services/navigation-category/types.d.ts +51 -0
- package/dist/services/navigation-category/types.d.ts.map +1 -0
- package/dist/services/offer-inventories/definitions.d.ts +73 -0
- package/dist/services/offer-inventories/definitions.d.ts.map +1 -0
- package/dist/services/offer-inventories/endpoints.d.ts +16 -0
- package/dist/services/offer-inventories/endpoints.d.ts.map +1 -0
- package/dist/services/offer-inventories/index.d.ts +120 -0
- package/dist/services/offer-inventories/index.d.ts.map +1 -0
- package/dist/services/offer-inventories/module.d.ts +11 -0
- package/dist/services/offer-inventories/module.d.ts.map +1 -0
- package/dist/services/offer-inventories/offer-inventories.service.d.ts +26 -0
- package/dist/services/offer-inventories/offer-inventories.service.d.ts.map +1 -0
- package/dist/services/offer-inventories/types.d.ts +85 -0
- package/dist/services/offer-inventories/types.d.ts.map +1 -0
- package/dist/services/offer-prices/__mocks__/offer-prices.mocks.d.ts +109 -0
- package/dist/services/offer-prices/__mocks__/offer-prices.mocks.d.ts.map +1 -0
- package/dist/services/offer-prices/definitions.d.ts +24 -0
- package/dist/services/offer-prices/definitions.d.ts.map +1 -0
- package/dist/services/offer-prices/endpoints.d.ts +12 -0
- package/dist/services/offer-prices/endpoints.d.ts.map +1 -0
- package/dist/services/offer-prices/index.d.ts +36 -0
- package/dist/services/offer-prices/index.d.ts.map +1 -0
- package/dist/services/offer-prices/module.d.ts +11 -0
- package/dist/services/offer-prices/module.d.ts.map +1 -0
- package/dist/services/offer-prices/offer-prices.service.d.ts +18 -0
- package/dist/services/offer-prices/offer-prices.service.d.ts.map +1 -0
- package/dist/services/offer-prices/types.d.ts +33 -0
- package/dist/services/offer-prices/types.d.ts.map +1 -0
- package/dist/services/operation/definitions.d.ts +280 -0
- package/dist/services/operation/definitions.d.ts.map +1 -0
- package/dist/services/operation/endpoints.d.ts +18 -0
- package/dist/services/operation/endpoints.d.ts.map +1 -0
- package/dist/services/operation/index.d.ts +520 -0
- package/dist/services/operation/index.d.ts.map +1 -0
- package/dist/services/operation/module.d.ts +11 -0
- package/dist/services/operation/module.d.ts.map +1 -0
- package/dist/services/operation/operation.service.d.ts +32 -0
- package/dist/services/operation/operation.service.d.ts.map +1 -0
- package/dist/services/operation/types.d.ts +174 -0
- package/dist/services/operation/types.d.ts.map +1 -0
- package/dist/services/payment/definitions.d.ts +79 -0
- package/dist/services/payment/definitions.d.ts.map +1 -0
- package/dist/services/payment/endpoints.d.ts +16 -0
- package/dist/services/payment/endpoints.d.ts.map +1 -0
- package/dist/services/payment/index.d.ts +150 -0
- package/dist/services/payment/index.d.ts.map +1 -0
- package/dist/services/payment/module.d.ts +11 -0
- package/dist/services/payment/module.d.ts.map +1 -0
- package/dist/services/payment/payment.service.d.ts +224 -0
- package/dist/services/payment/payment.service.d.ts.map +1 -0
- package/dist/services/payment/types.d.ts +93 -0
- package/dist/services/payment/types.d.ts.map +1 -0
- package/dist/services/product/definitions.d.ts +150 -0
- package/dist/services/product/definitions.d.ts.map +1 -0
- package/dist/services/product/endpoints.d.ts +40 -0
- package/dist/services/product/endpoints.d.ts.map +1 -0
- package/dist/services/product/index.d.ts +388 -0
- package/dist/services/product/index.d.ts.map +1 -0
- package/dist/services/product/module.d.ts +11 -0
- package/dist/services/product/module.d.ts.map +1 -0
- package/dist/services/product/product.service.d.ts +452 -0
- package/dist/services/product/product.service.d.ts.map +1 -0
- package/dist/services/product/types.d.ts +344 -0
- package/dist/services/product/types.d.ts.map +1 -0
- package/dist/services/product-variant/definitions.d.ts +172 -0
- package/dist/services/product-variant/definitions.d.ts.map +1 -0
- package/dist/services/product-variant/endpoints.d.ts +15 -0
- package/dist/services/product-variant/endpoints.d.ts.map +1 -0
- package/dist/services/product-variant/index.d.ts +123 -0
- package/dist/services/product-variant/index.d.ts.map +1 -0
- package/dist/services/product-variant/module.d.ts +11 -0
- package/dist/services/product-variant/module.d.ts.map +1 -0
- package/dist/services/product-variant/product-variant.service.d.ts +21 -0
- package/dist/services/product-variant/product-variant.service.d.ts.map +1 -0
- package/dist/services/product-variant/types.d.ts +73 -0
- package/dist/services/product-variant/types.d.ts.map +1 -0
- package/dist/services/quote/definitions.d.ts +102 -0
- package/dist/services/quote/definitions.d.ts.map +1 -0
- package/dist/services/quote/endpoints.d.ts +20 -0
- package/dist/services/quote/endpoints.d.ts.map +1 -0
- package/dist/services/quote/index.d.ts +378 -0
- package/dist/services/quote/index.d.ts.map +1 -0
- package/dist/services/quote/module.d.ts +11 -0
- package/dist/services/quote/module.d.ts.map +1 -0
- package/dist/services/quote/quote.service.d.ts +346 -0
- package/dist/services/quote/quote.service.d.ts.map +1 -0
- package/dist/services/quote/types.d.ts +160 -0
- package/dist/services/quote/types.d.ts.map +1 -0
- package/dist/services/supplier/__mocks__/supplier-mocks.d.ts +49 -0
- package/dist/services/supplier/__mocks__/supplier-mocks.d.ts.map +1 -0
- package/dist/services/supplier/definitions.d.ts +30 -0
- package/dist/services/supplier/definitions.d.ts.map +1 -0
- package/dist/services/supplier/endpoints.d.ts +14 -0
- package/dist/services/supplier/endpoints.d.ts.map +1 -0
- package/dist/services/supplier/index.d.ts +102 -0
- package/dist/services/supplier/index.d.ts.map +1 -0
- package/dist/services/supplier/module.d.ts +11 -0
- package/dist/services/supplier/module.d.ts.map +1 -0
- package/dist/services/supplier/supplier.service.d.ts +20 -0
- package/dist/services/supplier/supplier.service.d.ts.map +1 -0
- package/dist/services/supplier/types.d.ts +58 -0
- package/dist/services/supplier/types.d.ts.map +1 -0
- package/dist/services/types.d.ts +81 -0
- package/dist/services/types.d.ts.map +1 -0
- package/dist/settings/fetch-instance.d.ts +30 -0
- package/dist/settings/fetch-instance.d.ts.map +1 -0
- package/package.json +12 -10
- package/dist/djust-b2b-djust-front-sdk-3.0.0-beta.2.tgz +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Attribute } from "../../interfaces/models/attribute";
|
|
2
|
+
import { PageableObject, PageableParameters, Order } from "../../interfaces/models/common";
|
|
3
|
+
/**
|
|
4
|
+
* Request parameters type definitions
|
|
5
|
+
*/
|
|
6
|
+
export interface GetAttributesParameters {
|
|
7
|
+
searchCriteria?: string;
|
|
8
|
+
pageable?: PageableParameters;
|
|
9
|
+
searchable?: boolean;
|
|
10
|
+
sortable?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Response type definitions
|
|
14
|
+
*/
|
|
15
|
+
export interface GetAttributesResponse {
|
|
16
|
+
content: Attribute[];
|
|
17
|
+
empty: boolean;
|
|
18
|
+
first: boolean;
|
|
19
|
+
last: boolean;
|
|
20
|
+
number: number;
|
|
21
|
+
numberOfElements: number;
|
|
22
|
+
pageable: PageableObject;
|
|
23
|
+
size: number;
|
|
24
|
+
sort: Order[];
|
|
25
|
+
totalElements: number;
|
|
26
|
+
totalPages: number;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/services/attributes/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,KAAK,EACN,MAAM,gCAAgC,CAAC;AAExC;;GAEG;AAEH,MAAM,WAAW,uBAAuB;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AAEH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJUST SDK Attributes Service - Endpoints
|
|
3
|
+
* API endpoint constants for attributes operations.
|
|
4
|
+
*
|
|
5
|
+
* @module services/attributes/endpoints
|
|
6
|
+
* @since 2.17.0
|
|
7
|
+
*/
|
|
8
|
+
export declare const AttributesEndpoints: {
|
|
9
|
+
readonly ATTRIBUTES: "/v1/shop/attributes";
|
|
10
|
+
};
|
|
11
|
+
export type AttributesEndpoint = (typeof AttributesEndpoints)[keyof typeof AttributesEndpoints];
|
|
12
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/services/attributes/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,mBAAmB;;CAEtB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { GetAttributesParameters, GetAttributesResponse } from "./definitions";
|
|
2
|
+
/**
|
|
3
|
+
* 🛒 Retrieves all attributes.
|
|
4
|
+
*
|
|
5
|
+
* This function allows fetching the list of attributes.
|
|
6
|
+
*
|
|
7
|
+
* 🛠 **Endpoint**: `GET /v1/shop/attributes [listAttribute]`
|
|
8
|
+
*
|
|
9
|
+
* | Parameter | Type | Required | Description |
|
|
10
|
+
* |------------------|----------------------|------------|------------------------------------------------------------| |
|
|
11
|
+
* | `searchCriteria` | `string` | ❌ | The search term. |
|
|
12
|
+
* | `searchable` | `boolean` | ❌ | If appears in search response. |
|
|
13
|
+
* | `sortable` | `boolean` | ❌ | If is sortable. |
|
|
14
|
+
* | `pageable` | `object` | ❌ | The pagination parameters. , `BUYING_LIST`). |
|
|
15
|
+
*
|
|
16
|
+
* 📤 **Returns**:
|
|
17
|
+
* A `Promise` resolving to a `GetAttributesResponse` object, containing the list of attributes and pagination information.
|
|
18
|
+
*
|
|
19
|
+
* 🛠 **Example usage**:
|
|
20
|
+
* ```ts
|
|
21
|
+
* const attributes = await getAttributes({ pageable: { page: 1, size: 10 } });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param {GetAttributesParameters} params - The parameters for retrieving the attributes, including:
|
|
25
|
+
* - `searchCriteria` - The search term.
|
|
26
|
+
* - `searchable` - The boolean if attributes appears in search response.
|
|
27
|
+
* - `sortable` - The boolean if can sort by this attribute.
|
|
28
|
+
* - `pageable` - The pagination parameters.
|
|
29
|
+
*
|
|
30
|
+
* @returns {Promise<GetAttributesResponse>} - An object containing the list of attributes and pagination information.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getAttributes({ searchCriteria, searchable, sortable, pageable, }: GetAttributesParameters): Promise<GetAttributesResponse>;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/attributes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,aAAa,CAAC,EAClC,cAAc,EACd,UAAU,EACV,QAAQ,EACR,QAAQ,GACT,EAAE,uBAAuB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAe1D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJUST SDK Attributes Module
|
|
3
|
+
* Re-exports all attributes-related types and service.
|
|
4
|
+
*
|
|
5
|
+
* @module services/attributes
|
|
6
|
+
* @since 2.17.0
|
|
7
|
+
*/
|
|
8
|
+
export type { GetAttributesParams, Attribute, AttributeValue, GetAttributesResponse, } from "./types";
|
|
9
|
+
export { AttributesEndpoints, type AttributesEndpoint } from "./endpoints";
|
|
10
|
+
export { AttributesService } from "./attributes.service";
|
|
11
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/services/attributes/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJUST SDK Attributes Service - Types
|
|
3
|
+
* Type definitions for attributes operations.
|
|
4
|
+
*
|
|
5
|
+
* @module services/attributes/types
|
|
6
|
+
* @since 2.17.0
|
|
7
|
+
*/
|
|
8
|
+
import type { Pageable, PaginatedResponse } from "../types";
|
|
9
|
+
export interface GetAttributesParams {
|
|
10
|
+
searchCriteria?: string;
|
|
11
|
+
searchable?: boolean;
|
|
12
|
+
sortable?: boolean;
|
|
13
|
+
pageable?: Pageable;
|
|
14
|
+
}
|
|
15
|
+
export interface Attribute {
|
|
16
|
+
id: string;
|
|
17
|
+
externalId?: string;
|
|
18
|
+
name: string;
|
|
19
|
+
code: string;
|
|
20
|
+
type: string;
|
|
21
|
+
searchable: boolean;
|
|
22
|
+
sortable: boolean;
|
|
23
|
+
filterable: boolean;
|
|
24
|
+
values?: AttributeValue[];
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
export interface AttributeValue {
|
|
29
|
+
id: string;
|
|
30
|
+
value: string;
|
|
31
|
+
label?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface GetAttributesResponse extends PaginatedResponse<Attribute> {
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/attributes/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAM5D,MAAM,WAAW,mBAAmB;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAMD,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB,CAAC,SAAS,CAAC;CAAG"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mocks centralisés pour les tests du module auth
|
|
3
|
+
*/
|
|
4
|
+
export declare const mockTokens: {
|
|
5
|
+
validToken: string;
|
|
6
|
+
invalidToken: string;
|
|
7
|
+
refreshToken: string;
|
|
8
|
+
resetPasswordToken: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const mockUsers: {
|
|
11
|
+
validUser: {
|
|
12
|
+
username: string;
|
|
13
|
+
password: string;
|
|
14
|
+
};
|
|
15
|
+
invalidUser: {
|
|
16
|
+
username: string;
|
|
17
|
+
password: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const mockAuthResponses: {
|
|
21
|
+
loginSuccess: {
|
|
22
|
+
token: {
|
|
23
|
+
accessToken: string;
|
|
24
|
+
expireAt: number;
|
|
25
|
+
refreshToken: string;
|
|
26
|
+
};
|
|
27
|
+
user: {
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
refreshTokenSuccess: {
|
|
32
|
+
token: {
|
|
33
|
+
accessToken: string;
|
|
34
|
+
expireAt: number;
|
|
35
|
+
refreshToken: string;
|
|
36
|
+
};
|
|
37
|
+
user: {
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare const mockParameters: {
|
|
43
|
+
isTokenValid: {
|
|
44
|
+
valid: {
|
|
45
|
+
token: string;
|
|
46
|
+
};
|
|
47
|
+
invalid: {
|
|
48
|
+
token: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
refreshToken: {
|
|
52
|
+
valid: {
|
|
53
|
+
refreshToken: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
resetPassword: {
|
|
57
|
+
valid: {
|
|
58
|
+
newPassword: string;
|
|
59
|
+
resetPasswordToken: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
sendResetPasswordEmail: {
|
|
63
|
+
valid: {
|
|
64
|
+
email: string;
|
|
65
|
+
};
|
|
66
|
+
invalid: {
|
|
67
|
+
email: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
login: {
|
|
71
|
+
valid: {
|
|
72
|
+
username: string;
|
|
73
|
+
password: string;
|
|
74
|
+
};
|
|
75
|
+
withUserFalse: {
|
|
76
|
+
username: string;
|
|
77
|
+
password: string;
|
|
78
|
+
withUser: boolean;
|
|
79
|
+
};
|
|
80
|
+
invalid: {
|
|
81
|
+
username: string;
|
|
82
|
+
password: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
getStore: {
|
|
86
|
+
valid: {
|
|
87
|
+
storeId: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export declare const mockResponses: {
|
|
92
|
+
isTokenValid: {
|
|
93
|
+
success: {
|
|
94
|
+
data: boolean;
|
|
95
|
+
headers: Headers;
|
|
96
|
+
status: number;
|
|
97
|
+
};
|
|
98
|
+
failure: {
|
|
99
|
+
data: boolean;
|
|
100
|
+
headers: Headers;
|
|
101
|
+
status: number;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
refreshToken: {
|
|
105
|
+
success: {
|
|
106
|
+
data: {
|
|
107
|
+
token: {
|
|
108
|
+
accessToken: string;
|
|
109
|
+
expireAt: number;
|
|
110
|
+
refreshToken: string;
|
|
111
|
+
};
|
|
112
|
+
user: {
|
|
113
|
+
id: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
headers: Headers;
|
|
117
|
+
status: number;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
resetPassword: {
|
|
121
|
+
success: {
|
|
122
|
+
data: undefined;
|
|
123
|
+
headers: Headers;
|
|
124
|
+
status: number;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
sendResetPasswordEmail: {
|
|
128
|
+
success: {
|
|
129
|
+
data: undefined;
|
|
130
|
+
headers: Headers;
|
|
131
|
+
status: number;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
login: {
|
|
135
|
+
success: {
|
|
136
|
+
data: {
|
|
137
|
+
token: {
|
|
138
|
+
accessToken: string;
|
|
139
|
+
expireAt: number;
|
|
140
|
+
refreshToken: string;
|
|
141
|
+
};
|
|
142
|
+
user: {
|
|
143
|
+
id: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
headers: Headers;
|
|
147
|
+
status: number;
|
|
148
|
+
};
|
|
149
|
+
withUserFalse: {
|
|
150
|
+
data: {
|
|
151
|
+
token: {
|
|
152
|
+
accessToken: string;
|
|
153
|
+
expireAt: number;
|
|
154
|
+
refreshToken: string;
|
|
155
|
+
};
|
|
156
|
+
user: {
|
|
157
|
+
id: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
headers: Headers;
|
|
161
|
+
status: number;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
logout: {
|
|
165
|
+
success: {
|
|
166
|
+
data: undefined;
|
|
167
|
+
headers: Headers;
|
|
168
|
+
status: number;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
getSettings: {
|
|
172
|
+
success: {
|
|
173
|
+
data: {
|
|
174
|
+
manualAccountCheck: boolean;
|
|
175
|
+
};
|
|
176
|
+
headers: Headers;
|
|
177
|
+
status: number;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
getStore: {
|
|
181
|
+
success: {
|
|
182
|
+
data: {
|
|
183
|
+
active: boolean;
|
|
184
|
+
customFieldValues: {
|
|
185
|
+
customField: {
|
|
186
|
+
externalId: string;
|
|
187
|
+
externalSource: string;
|
|
188
|
+
faceted: boolean;
|
|
189
|
+
id: string;
|
|
190
|
+
indexable: boolean;
|
|
191
|
+
mandatory: boolean;
|
|
192
|
+
name: {
|
|
193
|
+
fr: string;
|
|
194
|
+
en: string;
|
|
195
|
+
};
|
|
196
|
+
role: string;
|
|
197
|
+
sealedTarget: string;
|
|
198
|
+
searchable: boolean;
|
|
199
|
+
sortable: boolean;
|
|
200
|
+
status: string;
|
|
201
|
+
};
|
|
202
|
+
value: {
|
|
203
|
+
fr: string;
|
|
204
|
+
en: string;
|
|
205
|
+
};
|
|
206
|
+
}[];
|
|
207
|
+
description: string;
|
|
208
|
+
externalId: string;
|
|
209
|
+
id: string;
|
|
210
|
+
name: string;
|
|
211
|
+
storeLocales: {
|
|
212
|
+
active: boolean;
|
|
213
|
+
code: string;
|
|
214
|
+
id: string;
|
|
215
|
+
label: string;
|
|
216
|
+
main: boolean;
|
|
217
|
+
}[];
|
|
218
|
+
};
|
|
219
|
+
headers: Headers;
|
|
220
|
+
status: number;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
export declare const mockErrors: {
|
|
225
|
+
networkError: Error;
|
|
226
|
+
unauthorized: Error;
|
|
227
|
+
badRequest: Error;
|
|
228
|
+
notFound: Error;
|
|
229
|
+
serverError: Error;
|
|
230
|
+
};
|
|
231
|
+
export declare const mockHttpErrors: {
|
|
232
|
+
400: {
|
|
233
|
+
status: number;
|
|
234
|
+
message: string;
|
|
235
|
+
};
|
|
236
|
+
401: {
|
|
237
|
+
status: number;
|
|
238
|
+
message: string;
|
|
239
|
+
};
|
|
240
|
+
404: {
|
|
241
|
+
status: number;
|
|
242
|
+
message: string;
|
|
243
|
+
};
|
|
244
|
+
500: {
|
|
245
|
+
status: number;
|
|
246
|
+
message: string;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
//# sourceMappingURL=auth.mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.mocks.d.ts","sourceRoot":"","sources":["../../../../src/services/auth/__mocks__/auth.mocks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,UAAU;;;;;CAOtB,CAAC;AAGF,eAAO,MAAM,SAAS;;;;;;;;;CASrB,CAAC;AAGF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;CAqB7B,CAAC;AAGF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC1B,CAAC;AAYF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GzB,CAAC;AAGF,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC;AAGF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;CAK1B,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;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,sBAAsB,CAC1B,MAAM,EAAE,4BAA4B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;IAgBhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACG,KAAK,CACT,MAAM,EAAE,WAAW,EACnB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,aAAa,CAAC;IA0CzB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,MAAM,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCrD;;;;;;;;;;;;;;;;;;;OAmBG;IACG,WAAW,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAUtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACG,QAAQ,CACZ,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,KAAK,CAAC;CAWlB"}
|