@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,69 @@
|
|
|
1
|
+
import { AuthenticationResponseDto } from "../../interfaces/models/auth";
|
|
2
|
+
/**
|
|
3
|
+
* Request parameters type definitions
|
|
4
|
+
*/
|
|
5
|
+
export interface IsTokenValidParameters {
|
|
6
|
+
token: string;
|
|
7
|
+
}
|
|
8
|
+
export interface RefreshTokenParameters {
|
|
9
|
+
refreshToken: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ResetPasswordParameters {
|
|
12
|
+
newPassword: string;
|
|
13
|
+
resetPasswordToken: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SendResetPasswordEmailParameters {
|
|
16
|
+
email: string;
|
|
17
|
+
redirectUrl: string;
|
|
18
|
+
}
|
|
19
|
+
export interface LoginParameters {
|
|
20
|
+
username: string;
|
|
21
|
+
password: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SettingsResponse {
|
|
24
|
+
manualAccountCheck: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Response type definitions
|
|
28
|
+
*/
|
|
29
|
+
export interface RefreshTokenResponse extends AuthenticationResponseDto {
|
|
30
|
+
}
|
|
31
|
+
export interface LoginResponse extends AuthenticationResponseDto {
|
|
32
|
+
}
|
|
33
|
+
export interface StoreLocale {
|
|
34
|
+
active: boolean;
|
|
35
|
+
code: string;
|
|
36
|
+
id: string;
|
|
37
|
+
label: string;
|
|
38
|
+
main: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface CustomField {
|
|
41
|
+
externalId: string;
|
|
42
|
+
externalSource: string;
|
|
43
|
+
faceted: boolean;
|
|
44
|
+
id: string;
|
|
45
|
+
indexable: boolean;
|
|
46
|
+
mandatory: boolean;
|
|
47
|
+
name: {
|
|
48
|
+
[key: string]: string;
|
|
49
|
+
};
|
|
50
|
+
role: string;
|
|
51
|
+
sealedTarget: string;
|
|
52
|
+
searchable: boolean;
|
|
53
|
+
sortable: boolean;
|
|
54
|
+
status: string;
|
|
55
|
+
}
|
|
56
|
+
export interface CustomFieldValue {
|
|
57
|
+
customField: CustomField;
|
|
58
|
+
value: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
export interface Store {
|
|
61
|
+
active: boolean;
|
|
62
|
+
customFieldValues: CustomFieldValue[];
|
|
63
|
+
description: string;
|
|
64
|
+
externalId: string;
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
storeLocales: StoreLocale[];
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/services/auth/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAEzE;;GAEG;AAEH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AAEH,MAAM,WAAW,oBAAqB,SAAQ,yBAAyB;CAAG;AAE1E,MAAM,WAAW,aAAc,SAAQ,yBAAyB;CAAG;AAEnE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE;QACJ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request parameters type definitions
|
|
3
|
+
*/
|
|
4
|
+
export interface IsTokenValidParameters {
|
|
5
|
+
token: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RefreshTokenParameters {
|
|
8
|
+
refreshToken: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ResetPasswordParameters {
|
|
11
|
+
newPassword: string;
|
|
12
|
+
resetPasswordToken: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SendResetPasswordEmailParameters {
|
|
15
|
+
email: string;
|
|
16
|
+
}
|
|
17
|
+
export interface LoginParameters {
|
|
18
|
+
username: string;
|
|
19
|
+
password: string;
|
|
20
|
+
withUser?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface GetStoreParameters {
|
|
23
|
+
storeId: string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=definitions.requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.requests.d.ts","sourceRoot":"","sources":["../../../src/services/auth/definitions.requests.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJUST SDK Auth Service - Endpoints
|
|
3
|
+
* API endpoint constants for authentication operations.
|
|
4
|
+
*
|
|
5
|
+
* @module services/auth/endpoints
|
|
6
|
+
* @since 2.17.0
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Auth API endpoints.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AuthEndpoints: {
|
|
12
|
+
/** Validate token endpoint [TOK-200] */
|
|
13
|
+
readonly IS_TOKEN_VALID: "/auth/is-token-valid";
|
|
14
|
+
/** Refresh token endpoint [AUTH-102] */
|
|
15
|
+
readonly REFRESH_TOKEN: "/auth/refresh-token";
|
|
16
|
+
/** Reset password endpoint [PWD-102] */
|
|
17
|
+
readonly RESET_PASSWORD: "/auth/reset-password";
|
|
18
|
+
/** Send reset password email endpoint [PWD-101] */
|
|
19
|
+
readonly SEND_RESET_PASSWORD_EMAIL: "/auth/send-reset-password-email";
|
|
20
|
+
/** Login endpoint [AUTH-101] */
|
|
21
|
+
readonly TOKEN: "/auth/token";
|
|
22
|
+
/** Logout endpoint [AUTH-103] */
|
|
23
|
+
readonly REVOKE_TOKEN: "/auth/revoke-token";
|
|
24
|
+
/** Shop settings endpoint [SETTINGS-500] */
|
|
25
|
+
readonly SETTINGS: "/v1/shop/settings";
|
|
26
|
+
/** Store endpoint [STORE-500] */
|
|
27
|
+
readonly STORE: "/v1/shop/stores/{storeId}";
|
|
28
|
+
};
|
|
29
|
+
export type AuthEndpoint = (typeof AuthEndpoints)[keyof typeof AuthEndpoints];
|
|
30
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/services/auth/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB,wCAAwC;;IAGxC,wCAAwC;;IAGxC,wCAAwC;;IAGxC,mDAAmD;;IAGnD,gCAAgC;;IAGhC,iCAAiC;;IAGjC,4CAA4C;;IAG5C,iCAAiC;;CAEzB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -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,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,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJUST SDK Auth Service - Types
|
|
3
|
+
* Type definitions for authentication operations.
|
|
4
|
+
*
|
|
5
|
+
* @module services/auth/types
|
|
6
|
+
* @since 2.17.0
|
|
7
|
+
*/
|
|
8
|
+
import type { AuthenticationResponseDto } from "../../interfaces/models/auth";
|
|
9
|
+
/**
|
|
10
|
+
* Parameters for validating a token.
|
|
11
|
+
*/
|
|
12
|
+
export interface IsTokenValidParams {
|
|
13
|
+
/** The token to validate */
|
|
14
|
+
token: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parameters for refreshing an access token.
|
|
18
|
+
*/
|
|
19
|
+
export interface RefreshTokenParams {
|
|
20
|
+
/** The refresh token */
|
|
21
|
+
refreshToken: string;
|
|
22
|
+
/** Whether this is an automatic refresh (vs manual). Used for hooks. */
|
|
23
|
+
automatic?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Parameters for resetting a password.
|
|
27
|
+
*/
|
|
28
|
+
export interface ResetPasswordParams {
|
|
29
|
+
/** The new password */
|
|
30
|
+
newPassword: string;
|
|
31
|
+
/** The reset password token from email */
|
|
32
|
+
resetPasswordToken: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parameters for sending a reset password email.
|
|
36
|
+
*/
|
|
37
|
+
export interface SendResetPasswordEmailParams {
|
|
38
|
+
/** The user's email address */
|
|
39
|
+
email: string;
|
|
40
|
+
/** URL to redirect after password reset */
|
|
41
|
+
redirectUrl?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Parameters for user login.
|
|
45
|
+
*/
|
|
46
|
+
export interface LoginParams {
|
|
47
|
+
/** Username (usually email) */
|
|
48
|
+
username: string;
|
|
49
|
+
/** User password */
|
|
50
|
+
password: string;
|
|
51
|
+
/** Whether to include user details in response */
|
|
52
|
+
withUser?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Parameters for getting store information.
|
|
56
|
+
*/
|
|
57
|
+
export interface GetStoreParams {
|
|
58
|
+
/** The store ID */
|
|
59
|
+
storeId: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Response from token refresh operation.
|
|
63
|
+
*/
|
|
64
|
+
export interface RefreshTokenResponse extends AuthenticationResponseDto {
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Response from login operation.
|
|
68
|
+
*/
|
|
69
|
+
export interface LoginResponse extends AuthenticationResponseDto {
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Shop settings configuration.
|
|
73
|
+
*/
|
|
74
|
+
export interface SettingsResponse {
|
|
75
|
+
/** Whether manual account verification is required */
|
|
76
|
+
manualAccountCheck: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Store locale configuration.
|
|
80
|
+
*/
|
|
81
|
+
export interface StoreLocale {
|
|
82
|
+
active: boolean;
|
|
83
|
+
code: string;
|
|
84
|
+
id: string;
|
|
85
|
+
label: string;
|
|
86
|
+
main: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Custom field definition.
|
|
90
|
+
*/
|
|
91
|
+
export interface CustomField {
|
|
92
|
+
externalId: string;
|
|
93
|
+
externalSource: string;
|
|
94
|
+
faceted: boolean;
|
|
95
|
+
id: string;
|
|
96
|
+
indexable: boolean;
|
|
97
|
+
mandatory: boolean;
|
|
98
|
+
name: Record<string, string>;
|
|
99
|
+
role: string;
|
|
100
|
+
sealedTarget: string;
|
|
101
|
+
searchable: boolean;
|
|
102
|
+
sortable: boolean;
|
|
103
|
+
status: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Custom field value.
|
|
107
|
+
*/
|
|
108
|
+
export interface CustomFieldValue {
|
|
109
|
+
customField: CustomField;
|
|
110
|
+
value: Record<string, unknown>;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Store information.
|
|
114
|
+
*/
|
|
115
|
+
export interface Store {
|
|
116
|
+
active: boolean;
|
|
117
|
+
customFieldValues: CustomFieldValue[];
|
|
118
|
+
description: string;
|
|
119
|
+
externalId: string;
|
|
120
|
+
id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
storeLocales: StoreLocale[];
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/auth/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAM9E;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,wBAAwB;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,yBAAyB;CAAG;AAE1E;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,yBAAyB;CAAG;AAEnE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DJUST SDK Base Service
|
|
3
|
+
* Abstract base class for all API services.
|
|
4
|
+
*
|
|
5
|
+
* @module services/base
|
|
6
|
+
* @since 2.17.0
|
|
7
|
+
*/
|
|
8
|
+
import type { Transport, TransportRequest, RequestContext } from "../client/transport";
|
|
9
|
+
/**
|
|
10
|
+
* Abstract base class for all SDK services.
|
|
11
|
+
*
|
|
12
|
+
* Provides common functionality:
|
|
13
|
+
* - Transport wrapper
|
|
14
|
+
* - Parameter validation
|
|
15
|
+
* - Context management
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* class CartService extends BaseService {
|
|
20
|
+
* readonly serviceName = 'cart';
|
|
21
|
+
*
|
|
22
|
+
* async getCart(params: GetCartParams, context?: RequestContext) {
|
|
23
|
+
* this.required(params, ['cartId', 'currency']);
|
|
24
|
+
* return this.request<Cart>({
|
|
25
|
+
* method: 'GET',
|
|
26
|
+
* path: `/v2/shop/carts/${params.cartId}`,
|
|
27
|
+
* params: { currency: params.currency },
|
|
28
|
+
* }, context);
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare abstract class BaseService {
|
|
34
|
+
protected readonly transport: Transport;
|
|
35
|
+
/** Service name for logging and debugging */
|
|
36
|
+
abstract readonly serviceName: string;
|
|
37
|
+
constructor(transport: Transport);
|
|
38
|
+
/**
|
|
39
|
+
* Makes an HTTP request via the transport layer.
|
|
40
|
+
*
|
|
41
|
+
* @param request - The request configuration
|
|
42
|
+
* @param context - Optional request context (auth, headers, etc.)
|
|
43
|
+
* @returns The response data
|
|
44
|
+
*/
|
|
45
|
+
protected request<T>(request: TransportRequest, context?: RequestContext): Promise<T>;
|
|
46
|
+
/**
|
|
47
|
+
* Validates that required parameters are present.
|
|
48
|
+
*
|
|
49
|
+
* @param params - The parameters object to validate
|
|
50
|
+
* @param requiredFields - Array of field names that are required
|
|
51
|
+
* @throws ValidationError if any required field is missing
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* this.required(params, ['cartId', 'currency']);
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
protected required<T extends object>(params: T, requiredFields: (keyof T)[]): void;
|
|
59
|
+
/**
|
|
60
|
+
* Builds query parameters, filtering out undefined values.
|
|
61
|
+
* Arrays are kept as arrays so the transport can serialize them
|
|
62
|
+
* in the format expected by the API (e.g. repeat format for search: &brand=1664&brand=1664+BLANC).
|
|
63
|
+
*
|
|
64
|
+
* @param params - Object with potential query parameters
|
|
65
|
+
* @returns Cleaned object with only defined values
|
|
66
|
+
*/
|
|
67
|
+
protected buildParams<T extends object>(params: T): Record<string, unknown>;
|
|
68
|
+
/**
|
|
69
|
+
* Builds a path with path parameters.
|
|
70
|
+
*
|
|
71
|
+
* @param template - Path template with {param} placeholders
|
|
72
|
+
* @param params - Object with parameter values
|
|
73
|
+
* @returns Resolved path
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const path = this.buildPath('/carts/{cartId}/lines', { cartId: '123' });
|
|
78
|
+
* // Returns: '/carts/123/lines'
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
protected buildPath<T extends object>(template: string, params: T): string;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=base.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.service.d.ts","sourceRoot":"","sources":["../../src/services/base.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAG7B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,8BAAsB,WAAW;IAInB,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS;IAHnD,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEP,SAAS,EAAE,SAAS;IAEnD;;;;;;OAMG;cACa,OAAO,CAAC,CAAC,EACvB,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC;IAcb;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,QAAQ,CAAC,CAAC,SAAS,MAAM,EACjC,MAAM,EAAE,CAAC,EACT,cAAc,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAC1B,IAAI;IAWP;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAY3E;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM;CAW3E"}
|