@djust-b2b/djust-front-sdk 1.15.0 → 1.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +7 -7
- package/lib/services/auth/definitions.requests.d.ts +21 -0
- package/lib/services/auth/definitions.requests.js +2 -0
- package/lib/services/auth/index.d.ts +14 -4
- package/lib/services/auth/index.js +12 -3
- package/lib/services/cart/index.d.ts +0 -5
- package/lib/services/cart/index.js +0 -5
- package/lib/services/custom-field/index.d.ts +5 -10
- package/lib/services/custom-field/index.js +5 -15
- package/lib/services/customer-user/index.d.ts +107 -125
- package/lib/services/customer-user/index.js +107 -125
- package/lib/services/navigation-category/index.d.ts +68 -119
- package/lib/services/navigation-category/index.js +68 -119
- package/lib/services/product/index.d.ts +296 -1687
- package/lib/services/product/index.js +312 -1706
- package/lib/services/product-variant/index.d.ts +53 -160
- package/lib/services/product-variant/index.js +53 -160
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -88,13 +88,13 @@ export declare const DjustSDK: {
|
|
|
88
88
|
getProductVariantSuppliers({ productVariantId, }: import("./interfaces").GetProductVariantSuppliersParameters): Promise<import("./interfaces").GetProductVariantSuppliersResponse>;
|
|
89
89
|
getProduct({ productIdentifier, productIdType, locale, }: import("./interfaces").GetProductParameters): Promise<import("./interfaces").GetProductsListResponse>;
|
|
90
90
|
getProductOffers({ productIdentifier, productIdType, locale, currency, }: import("./interfaces").GetProductOffersParameters): Promise<import("./interfaces").GetProductOffersResponse>;
|
|
91
|
-
|
|
92
|
-
getRelatedProducts({ productIdentifier, productIdType, locale, currency, pageable, }: import("./interfaces").GetRelatedProductsParameters): Promise<import("./interfaces").GetRelatedProductsResponse>;
|
|
91
|
+
getRelatedProducts({ productIdentifier, productIdType, locale, currency, pageable, }: import("./interfaces").GetRelatedProductsParameters): Promise<import("./interfaces").GetRelatedProductsParameters>;
|
|
93
92
|
getProductReviews({ productIdentifier, productIdType, }: import("./interfaces").GetProductReviewsParameters): Promise<import("./interfaces").GetProductReviewsResponse>;
|
|
94
93
|
getProductStatReviews({ productIdentifier, productIdType, }: import("./interfaces").GetProductStatReviewsParameters): Promise<import("./interfaces").GetProductStatReviewsResponse>;
|
|
95
94
|
getProductVariantAttributes({ productIdentifier, productIdType, locale, }: import("./interfaces").GetProductVariantAttributesParameters): Promise<import("./interfaces").GetProductVariantAttributesResponse>;
|
|
96
95
|
createProductReview({ message, productSku, rating, }: import("./interfaces").CreateProductReviewParameters): Promise<import("./interfaces").CreateProductReviewResponse>;
|
|
97
96
|
updateProductReview({ productReviewId, message, rating, }: import("./interfaces").UpdateProductReviewParameters): Promise<import("./interfaces").UpdateProductReviewResponse>;
|
|
97
|
+
getProductPaginatedOffers({ productIdentifier, productIdType, currency, locale, withoutPrices, pageable, }: import("./interfaces").GetProductPaginatedOffersParameters): Promise<import("./interfaces").GetProductPaginatedOffersResponse>;
|
|
98
98
|
getNavigationCategories({ locale, }: import("./interfaces").GetNavigationCategoriesParameters): Promise<import("./interfaces").GetNavigationCategoriesResponse>;
|
|
99
99
|
getNavigationCategory({ locale, idType, navigationCategoryId, }: import("./interfaces").GetNavigationCategoryParameters): Promise<import("./interfaces").GetNavigationCategoryResponse>;
|
|
100
100
|
getNavigationCategoryBreadcrumbs({ locale, idType, navigationCategoryId, }: import("./interfaces").GetNavigationCategoryBreadcrumbsParameters): Promise<import("./interfaces").GetNavigationCategoryBreadcrumbsResponse>;
|
|
@@ -142,11 +142,11 @@ export declare const DjustSDK: {
|
|
|
142
142
|
deleteBuyingList({ buyingListId, }: import("./interfaces").DeleteBuyingListParameters): Promise<void>;
|
|
143
143
|
deleteBuyingListItems({ buyingListId, itemIds, }: import("./interfaces").DeleteBuyingListItemsParameters): Promise<void>;
|
|
144
144
|
updateBuyingListOwner({ buyingListId, newOwnerEmail, }: import("./interfaces").UpdateBuyingListOwnerParameters): Promise<void>;
|
|
145
|
-
isTokenValid({ token, }: import("./
|
|
146
|
-
refreshToken({ refreshToken, }: import("./
|
|
147
|
-
resetPassword({ newPassword, resetPasswordToken, }: import("./
|
|
148
|
-
sendResetPasswordEmail({ email, }: import("./
|
|
149
|
-
login({ username, password, }: import("./
|
|
145
|
+
isTokenValid({ token, }: import("./services/auth/definitions.requests").IsTokenValidParameters): Promise<boolean>;
|
|
146
|
+
refreshToken({ refreshToken, }: import("./services/auth/definitions.requests").RefreshTokenParameters): Promise<import("./interfaces").RefreshTokenResponse>;
|
|
147
|
+
resetPassword({ newPassword, resetPasswordToken, }: import("./services/auth/definitions.requests").ResetPasswordParameters): Promise<void>;
|
|
148
|
+
sendResetPasswordEmail({ email, }: import("./services/auth/definitions.requests").SendResetPasswordEmailParameters): Promise<void>;
|
|
149
|
+
login({ username, password, }: import("./services/auth/definitions.requests").LoginParameters): Promise<import("./interfaces").LoginResponse>;
|
|
150
150
|
logout(): Promise<void>;
|
|
151
151
|
};
|
|
152
152
|
export * from "./interfaces";
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
redirectUrl: string;
|
|
17
|
+
}
|
|
18
|
+
export interface LoginParameters {
|
|
19
|
+
username: string;
|
|
20
|
+
password: string;
|
|
21
|
+
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* # Auth Service
|
|
3
3
|
*
|
|
4
|
-
*
|
|
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.
|
|
5
14
|
*/
|
|
6
|
-
import {
|
|
15
|
+
import { LoginResponse, RefreshTokenResponse } from "./definitions";
|
|
16
|
+
import { IsTokenValidParameters, LoginParameters, RefreshTokenParameters, ResetPasswordParameters, SendResetPasswordEmailParameters } from "./definitions.requests";
|
|
7
17
|
/**
|
|
8
|
-
*
|
|
18
|
+
* AUTH ENDPOINT
|
|
9
19
|
*/
|
|
10
20
|
/**
|
|
11
21
|
* ##R eturns true if the token is valid and not expired, false otherwise
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* # Auth Service
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* This module provides all functionalities related to user authentication and authorization.
|
|
6
|
+
*
|
|
7
|
+
* ## Features:
|
|
8
|
+
* - Validate tokens
|
|
9
|
+
* - Refresh tokens
|
|
10
|
+
* - Reset user passwords
|
|
11
|
+
* - Manage user login and logout
|
|
12
|
+
* - Send password reset emails
|
|
13
|
+
*
|
|
14
|
+
* Each function is described with its input parameters, output responses, and example usages.
|
|
6
15
|
*/
|
|
7
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
17
|
exports.isTokenValid = isTokenValid;
|
|
@@ -14,7 +23,7 @@ exports.logout = logout;
|
|
|
14
23
|
const parameters_validation_1 = require("../../helpers/parameters-validation");
|
|
15
24
|
const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
16
25
|
/**
|
|
17
|
-
*
|
|
26
|
+
* AUTH ENDPOINT
|
|
18
27
|
*/
|
|
19
28
|
/**
|
|
20
29
|
* ##R eturns true if the token is valid and not expired, false otherwise
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
*
|
|
4
|
-
* @document documents/cart.md
|
|
5
|
-
*/
|
|
6
1
|
import { CreateCartParameters, DeleteCartsResponse, DeleteCartParameters, GetCartParameters, GetCartResponse, GetCartsParameters, GetCartsResponse, UpdateCartParameters, InitializeOrdersFromCartParameters, GetCartLinesParameters, DeleteCartLinesResponse, DeleteCartLinesParameters, GetCartLinesResponse, UpdateCartLinesResponse, UpdateCartLinesParameters, UpdateCartLinesByVariantParameters, UpdateCartLinesByVariantResponse } from "./definitions";
|
|
7
2
|
/**
|
|
8
3
|
* CART ENDPOINT
|
|
@@ -86,23 +86,18 @@ export declare function getCustomFields(params: GetCustomFieldParameters): Promi
|
|
|
86
86
|
* This function allows publishing a media file associated with a specific custom field.
|
|
87
87
|
*
|
|
88
88
|
* @param {PostMediaCustomFieldParameters} params - The parameters for publishing the media field, including:
|
|
89
|
-
* #### id - `string` |
|
|
90
|
-
*
|
|
89
|
+
* #### id - `string` | **required**
|
|
91
90
|
* The identifier of the custom field to which the media is associated.
|
|
92
|
-
* #### customFieldIdType - `string` |
|
|
93
|
-
*
|
|
91
|
+
* #### customFieldIdType - `string` | **required**
|
|
94
92
|
* The type of the custom field identifier (e.g., 'externalId').
|
|
95
93
|
* #### sealedTarget - `boolean`
|
|
96
|
-
*
|
|
97
94
|
* Indicates whether the media should be sealed.
|
|
98
|
-
* #### fileName - `string` |
|
|
99
|
-
*
|
|
95
|
+
* #### fileName - `string` | **required**
|
|
100
96
|
* The name of the media file being uploaded.
|
|
101
|
-
* #### fileSize - `number` |
|
|
102
|
-
*
|
|
97
|
+
* #### fileSize - `number` | **required**
|
|
103
98
|
* The size of the media file in bytes.
|
|
104
99
|
*
|
|
105
|
-
* @returns {Promise<string>} - A promise that resolves to the
|
|
100
|
+
* @returns {Promise<string>} - A promise that resolves to the URL where the media can be posted.
|
|
106
101
|
*
|
|
107
102
|
* @example
|
|
108
103
|
* #### input
|
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCustomFields = getCustomFields;
|
|
4
4
|
exports.postMediaCustomField = postMediaCustomField;
|
|
5
|
-
/**
|
|
6
|
-
* @packageDocumentation
|
|
7
|
-
*
|
|
8
|
-
* @document documents/custom-field.md
|
|
9
|
-
*/
|
|
10
5
|
const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
11
6
|
/**
|
|
12
7
|
* APICODE(listPaginatedCustomFields)
|
|
@@ -102,23 +97,18 @@ async function getCustomFields(params) {
|
|
|
102
97
|
* This function allows publishing a media file associated with a specific custom field.
|
|
103
98
|
*
|
|
104
99
|
* @param {PostMediaCustomFieldParameters} params - The parameters for publishing the media field, including:
|
|
105
|
-
* #### id - `string` |
|
|
106
|
-
*
|
|
100
|
+
* #### id - `string` | **required**
|
|
107
101
|
* The identifier of the custom field to which the media is associated.
|
|
108
|
-
* #### customFieldIdType - `string` |
|
|
109
|
-
*
|
|
102
|
+
* #### customFieldIdType - `string` | **required**
|
|
110
103
|
* The type of the custom field identifier (e.g., 'externalId').
|
|
111
104
|
* #### sealedTarget - `boolean`
|
|
112
|
-
*
|
|
113
105
|
* Indicates whether the media should be sealed.
|
|
114
|
-
* #### fileName - `string` |
|
|
115
|
-
*
|
|
106
|
+
* #### fileName - `string` | **required**
|
|
116
107
|
* The name of the media file being uploaded.
|
|
117
|
-
* #### fileSize - `number` |
|
|
118
|
-
*
|
|
108
|
+
* #### fileSize - `number` | **required**
|
|
119
109
|
* The size of the media file in bytes.
|
|
120
110
|
*
|
|
121
|
-
* @returns {Promise<string>} - A promise that resolves to the
|
|
111
|
+
* @returns {Promise<string>} - A promise that resolves to the URL where the media can be posted.
|
|
122
112
|
*
|
|
123
113
|
* @example
|
|
124
114
|
* #### input
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
*
|
|
4
|
-
* @document documents/customer-user.md
|
|
5
|
-
*/
|
|
6
1
|
import { ActivateCustomerUserParameters, CreateCustomerUserParameters, CreateCustomerUserResponse, GetAuthenticatedUserResponse, GetCustomerUserAddressesParameters, GetCustomerUserOrganisationsResponse, SendCustomerUserActivationRequestParameters, UpdateCustomerUserParameters, UpdateCustomerUserResponse } from "./definitions";
|
|
7
2
|
/**
|
|
8
|
-
*
|
|
3
|
+
* 🚚 **Retrieve Authenticated User**
|
|
4
|
+
*
|
|
5
|
+
* **APICODE(USER-500)**
|
|
9
6
|
* Retrieves the authenticated user.
|
|
10
7
|
*
|
|
11
8
|
* This function sends a request to obtain the details of the currently authenticated user.
|
|
12
9
|
*
|
|
13
|
-
*
|
|
10
|
+
* 🛠 **Endpoint**: `GET /v1/authenticated-user`
|
|
11
|
+
*
|
|
12
|
+
* | Parameter | Type | Required | Description |
|
|
13
|
+
* |-----------|--------|----------|---------------------------|
|
|
14
|
+
* | N/A | N/A | N/A | This function does not require any parameters. |
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* 📤 **Returns**:
|
|
17
|
+
* A `Promise` resolving to an object containing the authenticated user's data.
|
|
18
|
+
*
|
|
19
|
+
* 🛠 **Example usage**:
|
|
20
|
+
* ```ts
|
|
18
21
|
* const user = await getAuthenticatedUser();
|
|
19
22
|
* ```
|
|
20
|
-
* ####
|
|
23
|
+
* #### Output
|
|
21
24
|
* ```json
|
|
22
25
|
* {
|
|
23
26
|
* "id": "user1",
|
|
@@ -27,57 +30,36 @@ import { ActivateCustomerUserParameters, CreateCustomerUserParameters, CreateCus
|
|
|
27
30
|
*/
|
|
28
31
|
export declare function getAuthenticatedUser(): Promise<GetAuthenticatedUserResponse>;
|
|
29
32
|
/**
|
|
30
|
-
*
|
|
33
|
+
* 🚚 **Create Customer User**
|
|
34
|
+
*
|
|
35
|
+
* **APICODE(USER-100)**
|
|
31
36
|
* Creates a customer user.
|
|
32
37
|
*
|
|
33
38
|
* This function sends a request to create a new customer user with the specified parameters.
|
|
34
39
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* The
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* The
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* Custom fields for additional user information.
|
|
60
|
-
* #### externalId - `string`
|
|
61
|
-
*
|
|
62
|
-
* An external identifier for the user.
|
|
63
|
-
* #### status - `string`
|
|
64
|
-
*
|
|
65
|
-
* The status of the user (e.g., active, inactive).
|
|
66
|
-
* #### mainOrganisationId - `string`
|
|
67
|
-
*
|
|
68
|
-
* The ID of the main organization associated with the user.
|
|
69
|
-
* #### organisations - `string[]`
|
|
70
|
-
*
|
|
71
|
-
* The list of organizations associated with the user.
|
|
72
|
-
* #### phone - `string`
|
|
73
|
-
*
|
|
74
|
-
* The phone number of the user.
|
|
75
|
-
*
|
|
76
|
-
* @returns {Promise<CreateCustomerUserResponse>} - The data of the created user.
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* #### input
|
|
80
|
-
* ```typescript
|
|
40
|
+
* 🛠 **Endpoint**: `POST /v1/shop/customer-users`
|
|
41
|
+
*
|
|
42
|
+
* | Parameter | Type | Required | Description |
|
|
43
|
+
* |--------------------|--------|----------|--------------------------------------------------|
|
|
44
|
+
* | `email` | string | ✅ | The email address of the user. |
|
|
45
|
+
* | `password` | string | ✅ | The password of the user. |
|
|
46
|
+
* | `firstName` | string | ✅ | The first name of the user. |
|
|
47
|
+
* | `lastName` | string | ✅ | The last name of the user. |
|
|
48
|
+
* | `groups` | string[] | ✅ | The groups to which the user belongs. |
|
|
49
|
+
* | `activationUrl` | string | ❌ | The URL for user activation. |
|
|
50
|
+
* | `civility` | string | ❌ | The civility of the user (e.g., Mr., Ms.). |
|
|
51
|
+
* | `customFieldValues`| object | ❌ | Custom fields for additional user information. |
|
|
52
|
+
* | `externalId` | string | ❌ | An external identifier for the user. |
|
|
53
|
+
* | `status` | string | ❌ | The status of the user (e.g., active, inactive). |
|
|
54
|
+
* | `mainOrganisationId`| string | ❌ | The ID of the main organization associated with the user. |
|
|
55
|
+
* | `organisations` | string[] | ❌ | The list of organizations associated with the user. |
|
|
56
|
+
* | `phone` | string | ❌ | The phone number of the user. |
|
|
57
|
+
*
|
|
58
|
+
* 📤 **Returns**:
|
|
59
|
+
* A `Promise` resolving to an object containing the created user's data.
|
|
60
|
+
*
|
|
61
|
+
* 🛠 **Example usage**:
|
|
62
|
+
* ```ts
|
|
81
63
|
* const newUser = await createCustomerUser({
|
|
82
64
|
* email: 'user@example.com',
|
|
83
65
|
* password: 'securePassword',
|
|
@@ -94,7 +76,7 @@ export declare function getAuthenticatedUser(): Promise<GetAuthenticatedUserResp
|
|
|
94
76
|
* phone: '123-456-7890'
|
|
95
77
|
* });
|
|
96
78
|
* ```
|
|
97
|
-
* ####
|
|
79
|
+
* #### Output
|
|
98
80
|
* ```json
|
|
99
81
|
* {
|
|
100
82
|
* "id": "user1",
|
|
@@ -104,33 +86,28 @@ export declare function getAuthenticatedUser(): Promise<GetAuthenticatedUserResp
|
|
|
104
86
|
*/
|
|
105
87
|
export declare function createCustomerUser(params: CreateCustomerUserParameters): Promise<CreateCustomerUserResponse>;
|
|
106
88
|
/**
|
|
107
|
-
*
|
|
89
|
+
* 🚚 **Update Customer User**
|
|
90
|
+
*
|
|
91
|
+
* **APICODE(USER-201)**
|
|
108
92
|
* Updates a customer user.
|
|
109
93
|
*
|
|
110
94
|
* This function sends a request to update the details of an existing customer user.
|
|
111
95
|
*
|
|
112
|
-
*
|
|
113
|
-
* #### firstName - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
114
|
-
*
|
|
115
|
-
* The first name of the user.
|
|
116
|
-
* #### lastName - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
117
|
-
*
|
|
118
|
-
* The last name of the user.
|
|
119
|
-
* #### civility - `string`
|
|
120
|
-
*
|
|
121
|
-
* The civility of the user (e.g., Mr., Ms.).
|
|
122
|
-
* #### phone - `string`
|
|
123
|
-
*
|
|
124
|
-
* The phone number of the user.
|
|
125
|
-
* #### customFieldValues - `object`
|
|
96
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/customer-users`
|
|
126
97
|
*
|
|
127
|
-
*
|
|
98
|
+
* | Parameter | Type | Required | Description |
|
|
99
|
+
* |--------------------|--------|----------|--------------------------------------------------|
|
|
100
|
+
* | `firstName` | string | ✅ | The first name of the user. |
|
|
101
|
+
* | `lastName` | string | ✅ | The last name of the user. |
|
|
102
|
+
* | `civility` | string | ❌ | The civility of the user (e.g., Mr., Ms.). |
|
|
103
|
+
* | `phone` | string | ❌ | The phone number of the user. |
|
|
104
|
+
* | `customFieldValues`| object | ❌ | Custom fields for additional user information. |
|
|
128
105
|
*
|
|
129
|
-
*
|
|
106
|
+
* 📤 **Returns**:
|
|
107
|
+
* A `Promise` resolving to an object containing the updated user's data.
|
|
130
108
|
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* ```typescript
|
|
109
|
+
* 🛠 **Example usage**:
|
|
110
|
+
* ```ts
|
|
134
111
|
* const updatedUser = await updateCustomerUser({
|
|
135
112
|
* firstName: 'John',
|
|
136
113
|
* lastName: 'Doe',
|
|
@@ -139,7 +116,7 @@ export declare function createCustomerUser(params: CreateCustomerUserParameters)
|
|
|
139
116
|
* customFieldValues: {}
|
|
140
117
|
* });
|
|
141
118
|
* ```
|
|
142
|
-
* ####
|
|
119
|
+
* #### Output
|
|
143
120
|
* ```json
|
|
144
121
|
* {
|
|
145
122
|
* "detail": "User updated successfully"
|
|
@@ -148,24 +125,27 @@ export declare function createCustomerUser(params: CreateCustomerUserParameters)
|
|
|
148
125
|
*/
|
|
149
126
|
export declare function updateCustomerUser({ civility, firstName, lastName, phone, customFieldValues, }: UpdateCustomerUserParameters): Promise<UpdateCustomerUserResponse>;
|
|
150
127
|
/**
|
|
151
|
-
*
|
|
128
|
+
* 🚚 **Activate Customer User**
|
|
129
|
+
*
|
|
130
|
+
* **APICODE(USER-200)**
|
|
152
131
|
* Activates a customer user.
|
|
153
132
|
*
|
|
154
133
|
* This function sends a request to activate a customer user with a specified token.
|
|
155
134
|
*
|
|
156
|
-
*
|
|
157
|
-
* #### token - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
135
|
+
* 🛠 **Endpoint**: `POST /v1/shop/customer-users/activate`
|
|
158
136
|
*
|
|
159
|
-
*
|
|
137
|
+
* | Parameter | Type | Required | Description |
|
|
138
|
+
* |-----------|--------|----------|--------------------------------------------------|
|
|
139
|
+
* | `token` | string | ✅ | The activation token of the user. |
|
|
160
140
|
*
|
|
161
|
-
*
|
|
141
|
+
* 📤 **Returns**:
|
|
142
|
+
* A `Promise` resolving when the user is activated.
|
|
162
143
|
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* ```typescript
|
|
144
|
+
* 🛠 **Example usage**:
|
|
145
|
+
* ```ts
|
|
166
146
|
* await activateCustomerUser({ token: 'activationToken' });
|
|
167
147
|
* ```
|
|
168
|
-
* ####
|
|
148
|
+
* #### Output
|
|
169
149
|
* ```json
|
|
170
150
|
* {
|
|
171
151
|
* "detail": "User activated successfully"
|
|
@@ -174,30 +154,27 @@ export declare function updateCustomerUser({ civility, firstName, lastName, phon
|
|
|
174
154
|
*/
|
|
175
155
|
export declare function activateCustomerUser(params: ActivateCustomerUserParameters): Promise<void>;
|
|
176
156
|
/**
|
|
177
|
-
*
|
|
157
|
+
* 🚚 **Retrieve Customer User Addresses**
|
|
158
|
+
*
|
|
159
|
+
* **APICODE(USER-501)**
|
|
178
160
|
* Retrieves customer user addresses.
|
|
179
161
|
*
|
|
180
162
|
* This function sends a request to obtain the addresses associated with a customer user.
|
|
181
163
|
*
|
|
182
|
-
*
|
|
183
|
-
* #### shipping - `boolean`
|
|
184
|
-
*
|
|
185
|
-
* Indicates whether to retrieve shipping addresses.
|
|
186
|
-
* #### billing - `boolean`
|
|
187
|
-
*
|
|
188
|
-
* Indicates whether to retrieve billing addresses.
|
|
189
|
-
* #### account - `string`
|
|
190
|
-
*
|
|
191
|
-
* The ID of the account for which to retrieve addresses.
|
|
192
|
-
* #### organisationIds - `string[]`
|
|
164
|
+
* 🛠 **Endpoint**: `GET /v1/shop/customer-users/addresses`
|
|
193
165
|
*
|
|
194
|
-
*
|
|
166
|
+
* | Parameter | Type | Required | Description |
|
|
167
|
+
* |------------------|---------|----------|-----------------------------------------------|
|
|
168
|
+
* | `shipping` | boolean | ✅ | Indicates whether to retrieve shipping addresses. |
|
|
169
|
+
* | `billing` | boolean | ✅ | Indicates whether to retrieve billing addresses. |
|
|
170
|
+
* | `account` | string | ✅ | The ID of the account for which to retrieve addresses. |
|
|
171
|
+
* | `organisationIds`| string[]| ❌ | An array of organization IDs to filter the addresses. |
|
|
195
172
|
*
|
|
196
|
-
*
|
|
173
|
+
* 📤 **Returns**:
|
|
174
|
+
* A `Promise` resolving to the list of addresses associated with the customer user.
|
|
197
175
|
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* ```typescript
|
|
176
|
+
* 🛠 **Example usage**:
|
|
177
|
+
* ```ts
|
|
201
178
|
* const addresses = await getCustomerUserAddresses({
|
|
202
179
|
* shipping: true,
|
|
203
180
|
* billing: false,
|
|
@@ -205,7 +182,7 @@ export declare function activateCustomerUser(params: ActivateCustomerUserParamet
|
|
|
205
182
|
* organisationIds: ['org1', 'org2']
|
|
206
183
|
* });
|
|
207
184
|
* ```
|
|
208
|
-
* ####
|
|
185
|
+
* #### Output
|
|
209
186
|
* ```json
|
|
210
187
|
* {
|
|
211
188
|
* "addresses": [
|
|
@@ -219,19 +196,23 @@ export declare function activateCustomerUser(params: ActivateCustomerUserParamet
|
|
|
219
196
|
*/
|
|
220
197
|
export declare function getCustomerUserAddresses({ shipping, billing, account, organisationIds, }: GetCustomerUserAddressesParameters): Promise<void>;
|
|
221
198
|
/**
|
|
222
|
-
*
|
|
199
|
+
* 🚚 **Retrieve Customer User Organisations**
|
|
200
|
+
*
|
|
201
|
+
* **APICODE(USER-502)**
|
|
223
202
|
* Retrieves customer user organisations.
|
|
224
203
|
*
|
|
225
204
|
* This function sends a request to obtain the organisations associated with a customer user.
|
|
226
205
|
*
|
|
227
|
-
*
|
|
206
|
+
* 🛠 **Endpoint**: `GET /v1/shop/customer-users/organisations`
|
|
207
|
+
*
|
|
208
|
+
* 📤 **Returns**:
|
|
209
|
+
* A `Promise` resolving to the list of organisations associated with the customer user.
|
|
228
210
|
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
* ```typescript
|
|
211
|
+
* 🛠 **Example usage**:
|
|
212
|
+
* ```ts
|
|
232
213
|
* const organisations = await getCustomerUserOrganisations();
|
|
233
214
|
* ```
|
|
234
|
-
* ####
|
|
215
|
+
* #### Output
|
|
235
216
|
* ```json
|
|
236
217
|
* {
|
|
237
218
|
* "organisations": [
|
|
@@ -249,30 +230,31 @@ export declare function getCustomerUserAddresses({ shipping, billing, account, o
|
|
|
249
230
|
*/
|
|
250
231
|
export declare function getCustomerUserOrganisations(): Promise<GetCustomerUserOrganisationsResponse>;
|
|
251
232
|
/**
|
|
252
|
-
*
|
|
233
|
+
* 🚚 **Send Customer User Activation Request**
|
|
234
|
+
*
|
|
235
|
+
* **APICODE(USER-203)**
|
|
253
236
|
* Sends a customer user activation request.
|
|
254
237
|
*
|
|
255
238
|
* This function sends a request to resend an activation request to a customer user.
|
|
256
239
|
*
|
|
257
|
-
*
|
|
258
|
-
* #### token - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
259
|
-
*
|
|
260
|
-
* The activation token of the user.
|
|
261
|
-
* #### redirectUrl - `string`
|
|
240
|
+
* 🛠 **Endpoint**: `POST /v1/shop/customer-users/resend-activation-request`
|
|
262
241
|
*
|
|
263
|
-
*
|
|
242
|
+
* | Parameter | Type | Required | Description |
|
|
243
|
+
* |-------------|--------|----------|--------------------------------------------------|
|
|
244
|
+
* | `token` | string | ✅ | The activation token of the user. |
|
|
245
|
+
* | `redirectUrl`| string | ❌ | The URL to redirect the user after activation. |
|
|
264
246
|
*
|
|
265
|
-
*
|
|
247
|
+
* 📤 **Returns**:
|
|
248
|
+
* A `Promise` resolving when the request is sent.
|
|
266
249
|
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
* ```typescript
|
|
250
|
+
* 🛠 **Example usage**:
|
|
251
|
+
* ```ts
|
|
270
252
|
* await sendCustomerUserActivationRequest({
|
|
271
253
|
* token: 'activationToken',
|
|
272
254
|
* redirectUrl: 'http://example.com/redirect'
|
|
273
255
|
* });
|
|
274
256
|
* ```
|
|
275
|
-
* ####
|
|
257
|
+
* #### Output
|
|
276
258
|
* ```json
|
|
277
259
|
* {
|
|
278
260
|
* "detail": "Activation request sent successfully"
|