@djust-b2b/djust-front-sdk 1.14.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 -9
- package/lib/interfaces/models/incident.d.ts +1 -0
- 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/definitions.d.ts +100 -0
- package/lib/services/custom-field/definitions.js +60 -0
- package/lib/services/custom-field/index.d.ts +116 -0
- package/lib/services/custom-field/index.js +135 -0
- package/lib/services/customer-user/index.d.ts +107 -125
- package/lib/services/customer-user/index.js +107 -125
- package/lib/services/incident/definitions.d.ts +9 -27
- package/lib/services/incident/index.d.ts +38 -119
- package/lib/services/incident/index.js +46 -153
- package/lib/services/navigation-category/index.d.ts +68 -119
- package/lib/services/navigation-category/index.js +68 -119
- package/lib/services/product/definitions.d.ts +1 -1
- package/lib/services/product/index.d.ts +366 -14
- package/lib/services/product/index.js +366 -17
- package/lib/services/product-variant/index.d.ts +53 -160
- package/lib/services/product-variant/index.js +53 -160
- package/package.json +1 -1
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @packageDocumentation
|
|
4
|
-
*
|
|
5
|
-
* @document documents/customer-user.md
|
|
6
|
-
*/
|
|
7
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
3
|
exports.getAuthenticatedUser = getAuthenticatedUser;
|
|
9
4
|
exports.createCustomerUser = createCustomerUser;
|
|
@@ -15,19 +10,27 @@ exports.sendCustomerUserActivationRequest = sendCustomerUserActivationRequest;
|
|
|
15
10
|
const parameters_validation_1 = require("../../helpers/parameters-validation");
|
|
16
11
|
const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
17
12
|
/**
|
|
18
|
-
*
|
|
13
|
+
* 🚚 **Retrieve Authenticated User**
|
|
14
|
+
*
|
|
15
|
+
* **APICODE(USER-500)**
|
|
19
16
|
* Retrieves the authenticated user.
|
|
20
17
|
*
|
|
21
18
|
* This function sends a request to obtain the details of the currently authenticated user.
|
|
22
19
|
*
|
|
23
|
-
*
|
|
20
|
+
* 🛠 **Endpoint**: `GET /v1/authenticated-user`
|
|
21
|
+
*
|
|
22
|
+
* | Parameter | Type | Required | Description |
|
|
23
|
+
* |-----------|--------|----------|---------------------------|
|
|
24
|
+
* | N/A | N/A | N/A | This function does not require any parameters. |
|
|
24
25
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* 📤 **Returns**:
|
|
27
|
+
* A `Promise` resolving to an object containing the authenticated user's data.
|
|
28
|
+
*
|
|
29
|
+
* 🛠 **Example usage**:
|
|
30
|
+
* ```ts
|
|
28
31
|
* const user = await getAuthenticatedUser();
|
|
29
32
|
* ```
|
|
30
|
-
* ####
|
|
33
|
+
* #### Output
|
|
31
34
|
* ```json
|
|
32
35
|
* {
|
|
33
36
|
* "id": "user1",
|
|
@@ -43,57 +46,36 @@ async function getAuthenticatedUser() {
|
|
|
43
46
|
return data;
|
|
44
47
|
}
|
|
45
48
|
/**
|
|
46
|
-
*
|
|
49
|
+
* 🚚 **Create Customer User**
|
|
50
|
+
*
|
|
51
|
+
* **APICODE(USER-100)**
|
|
47
52
|
* Creates a customer user.
|
|
48
53
|
*
|
|
49
54
|
* This function sends a request to create a new customer user with the specified parameters.
|
|
50
55
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* The
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* The
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* Custom fields for additional user information.
|
|
76
|
-
* #### externalId - `string`
|
|
77
|
-
*
|
|
78
|
-
* An external identifier for the user.
|
|
79
|
-
* #### status - `string`
|
|
80
|
-
*
|
|
81
|
-
* The status of the user (e.g., active, inactive).
|
|
82
|
-
* #### mainOrganisationId - `string`
|
|
83
|
-
*
|
|
84
|
-
* The ID of the main organization associated with the user.
|
|
85
|
-
* #### organisations - `string[]`
|
|
86
|
-
*
|
|
87
|
-
* The list of organizations associated with the user.
|
|
88
|
-
* #### phone - `string`
|
|
89
|
-
*
|
|
90
|
-
* The phone number of the user.
|
|
91
|
-
*
|
|
92
|
-
* @returns {Promise<CreateCustomerUserResponse>} - The data of the created user.
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* #### input
|
|
96
|
-
* ```typescript
|
|
56
|
+
* 🛠 **Endpoint**: `POST /v1/shop/customer-users`
|
|
57
|
+
*
|
|
58
|
+
* | Parameter | Type | Required | Description |
|
|
59
|
+
* |--------------------|--------|----------|--------------------------------------------------|
|
|
60
|
+
* | `email` | string | ✅ | The email address of the user. |
|
|
61
|
+
* | `password` | string | ✅ | The password of the user. |
|
|
62
|
+
* | `firstName` | string | ✅ | The first name of the user. |
|
|
63
|
+
* | `lastName` | string | ✅ | The last name of the user. |
|
|
64
|
+
* | `groups` | string[] | ✅ | The groups to which the user belongs. |
|
|
65
|
+
* | `activationUrl` | string | ❌ | The URL for user activation. |
|
|
66
|
+
* | `civility` | string | ❌ | The civility of the user (e.g., Mr., Ms.). |
|
|
67
|
+
* | `customFieldValues`| object | ❌ | Custom fields for additional user information. |
|
|
68
|
+
* | `externalId` | string | ❌ | An external identifier for the user. |
|
|
69
|
+
* | `status` | string | ❌ | The status of the user (e.g., active, inactive). |
|
|
70
|
+
* | `mainOrganisationId`| string | ❌ | The ID of the main organization associated with the user. |
|
|
71
|
+
* | `organisations` | string[] | ❌ | The list of organizations associated with the user. |
|
|
72
|
+
* | `phone` | string | ❌ | The phone number of the user. |
|
|
73
|
+
*
|
|
74
|
+
* 📤 **Returns**:
|
|
75
|
+
* A `Promise` resolving to an object containing the created user's data.
|
|
76
|
+
*
|
|
77
|
+
* 🛠 **Example usage**:
|
|
78
|
+
* ```ts
|
|
97
79
|
* const newUser = await createCustomerUser({
|
|
98
80
|
* email: 'user@example.com',
|
|
99
81
|
* password: 'securePassword',
|
|
@@ -110,7 +92,7 @@ async function getAuthenticatedUser() {
|
|
|
110
92
|
* phone: '123-456-7890'
|
|
111
93
|
* });
|
|
112
94
|
* ```
|
|
113
|
-
* ####
|
|
95
|
+
* #### Output
|
|
114
96
|
* ```json
|
|
115
97
|
* {
|
|
116
98
|
* "id": "user1",
|
|
@@ -143,33 +125,28 @@ async function createCustomerUser(params) {
|
|
|
143
125
|
return data;
|
|
144
126
|
}
|
|
145
127
|
/**
|
|
146
|
-
*
|
|
128
|
+
* 🚚 **Update Customer User**
|
|
129
|
+
*
|
|
130
|
+
* **APICODE(USER-201)**
|
|
147
131
|
* Updates a customer user.
|
|
148
132
|
*
|
|
149
133
|
* This function sends a request to update the details of an existing customer user.
|
|
150
134
|
*
|
|
151
|
-
*
|
|
152
|
-
* #### firstName - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
153
|
-
*
|
|
154
|
-
* The first name of the user.
|
|
155
|
-
* #### lastName - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
156
|
-
*
|
|
157
|
-
* The last name of the user.
|
|
158
|
-
* #### civility - `string`
|
|
159
|
-
*
|
|
160
|
-
* The civility of the user (e.g., Mr., Ms.).
|
|
161
|
-
* #### phone - `string`
|
|
162
|
-
*
|
|
163
|
-
* The phone number of the user.
|
|
164
|
-
* #### customFieldValues - `object`
|
|
135
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/customer-users`
|
|
165
136
|
*
|
|
166
|
-
*
|
|
137
|
+
* | Parameter | Type | Required | Description |
|
|
138
|
+
* |--------------------|--------|----------|--------------------------------------------------|
|
|
139
|
+
* | `firstName` | string | ✅ | The first name of the user. |
|
|
140
|
+
* | `lastName` | string | ✅ | The last name of the user. |
|
|
141
|
+
* | `civility` | string | ❌ | The civility of the user (e.g., Mr., Ms.). |
|
|
142
|
+
* | `phone` | string | ❌ | The phone number of the user. |
|
|
143
|
+
* | `customFieldValues`| object | ❌ | Custom fields for additional user information. |
|
|
167
144
|
*
|
|
168
|
-
*
|
|
145
|
+
* 📤 **Returns**:
|
|
146
|
+
* A `Promise` resolving to an object containing the updated user's data.
|
|
169
147
|
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
* ```typescript
|
|
148
|
+
* 🛠 **Example usage**:
|
|
149
|
+
* ```ts
|
|
173
150
|
* const updatedUser = await updateCustomerUser({
|
|
174
151
|
* firstName: 'John',
|
|
175
152
|
* lastName: 'Doe',
|
|
@@ -178,7 +155,7 @@ async function createCustomerUser(params) {
|
|
|
178
155
|
* customFieldValues: {}
|
|
179
156
|
* });
|
|
180
157
|
* ```
|
|
181
|
-
* ####
|
|
158
|
+
* #### Output
|
|
182
159
|
* ```json
|
|
183
160
|
* {
|
|
184
161
|
* "detail": "User updated successfully"
|
|
@@ -201,24 +178,27 @@ async function updateCustomerUser({ civility, firstName, lastName, phone, custom
|
|
|
201
178
|
return data;
|
|
202
179
|
}
|
|
203
180
|
/**
|
|
204
|
-
*
|
|
181
|
+
* 🚚 **Activate Customer User**
|
|
182
|
+
*
|
|
183
|
+
* **APICODE(USER-200)**
|
|
205
184
|
* Activates a customer user.
|
|
206
185
|
*
|
|
207
186
|
* This function sends a request to activate a customer user with a specified token.
|
|
208
187
|
*
|
|
209
|
-
*
|
|
210
|
-
* #### token - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
188
|
+
* 🛠 **Endpoint**: `POST /v1/shop/customer-users/activate`
|
|
211
189
|
*
|
|
212
|
-
*
|
|
190
|
+
* | Parameter | Type | Required | Description |
|
|
191
|
+
* |-----------|--------|----------|--------------------------------------------------|
|
|
192
|
+
* | `token` | string | ✅ | The activation token of the user. |
|
|
213
193
|
*
|
|
214
|
-
*
|
|
194
|
+
* 📤 **Returns**:
|
|
195
|
+
* A `Promise` resolving when the user is activated.
|
|
215
196
|
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* ```typescript
|
|
197
|
+
* 🛠 **Example usage**:
|
|
198
|
+
* ```ts
|
|
219
199
|
* await activateCustomerUser({ token: 'activationToken' });
|
|
220
200
|
* ```
|
|
221
|
-
* ####
|
|
201
|
+
* #### Output
|
|
222
202
|
* ```json
|
|
223
203
|
* {
|
|
224
204
|
* "detail": "User activated successfully"
|
|
@@ -237,30 +217,27 @@ async function activateCustomerUser(params) {
|
|
|
237
217
|
});
|
|
238
218
|
}
|
|
239
219
|
/**
|
|
240
|
-
*
|
|
220
|
+
* 🚚 **Retrieve Customer User Addresses**
|
|
221
|
+
*
|
|
222
|
+
* **APICODE(USER-501)**
|
|
241
223
|
* Retrieves customer user addresses.
|
|
242
224
|
*
|
|
243
225
|
* This function sends a request to obtain the addresses associated with a customer user.
|
|
244
226
|
*
|
|
245
|
-
*
|
|
246
|
-
* #### shipping - `boolean`
|
|
247
|
-
*
|
|
248
|
-
* Indicates whether to retrieve shipping addresses.
|
|
249
|
-
* #### billing - `boolean`
|
|
250
|
-
*
|
|
251
|
-
* Indicates whether to retrieve billing addresses.
|
|
252
|
-
* #### account - `string`
|
|
253
|
-
*
|
|
254
|
-
* The ID of the account for which to retrieve addresses.
|
|
255
|
-
* #### organisationIds - `string[]`
|
|
227
|
+
* 🛠 **Endpoint**: `GET /v1/shop/customer-users/addresses`
|
|
256
228
|
*
|
|
257
|
-
*
|
|
229
|
+
* | Parameter | Type | Required | Description |
|
|
230
|
+
* |------------------|---------|----------|-----------------------------------------------|
|
|
231
|
+
* | `shipping` | boolean | ✅ | Indicates whether to retrieve shipping addresses. |
|
|
232
|
+
* | `billing` | boolean | ✅ | Indicates whether to retrieve billing addresses. |
|
|
233
|
+
* | `account` | string | ✅ | The ID of the account for which to retrieve addresses. |
|
|
234
|
+
* | `organisationIds`| string[]| ❌ | An array of organization IDs to filter the addresses. |
|
|
258
235
|
*
|
|
259
|
-
*
|
|
236
|
+
* 📤 **Returns**:
|
|
237
|
+
* A `Promise` resolving to the list of addresses associated with the customer user.
|
|
260
238
|
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
* ```typescript
|
|
239
|
+
* 🛠 **Example usage**:
|
|
240
|
+
* ```ts
|
|
264
241
|
* const addresses = await getCustomerUserAddresses({
|
|
265
242
|
* shipping: true,
|
|
266
243
|
* billing: false,
|
|
@@ -268,7 +245,7 @@ async function activateCustomerUser(params) {
|
|
|
268
245
|
* organisationIds: ['org1', 'org2']
|
|
269
246
|
* });
|
|
270
247
|
* ```
|
|
271
|
-
* ####
|
|
248
|
+
* #### Output
|
|
272
249
|
* ```json
|
|
273
250
|
* {
|
|
274
251
|
* "addresses": [
|
|
@@ -294,19 +271,23 @@ async function getCustomerUserAddresses({ shipping, billing, account, organisati
|
|
|
294
271
|
return data;
|
|
295
272
|
}
|
|
296
273
|
/**
|
|
297
|
-
*
|
|
274
|
+
* 🚚 **Retrieve Customer User Organisations**
|
|
275
|
+
*
|
|
276
|
+
* **APICODE(USER-502)**
|
|
298
277
|
* Retrieves customer user organisations.
|
|
299
278
|
*
|
|
300
279
|
* This function sends a request to obtain the organisations associated with a customer user.
|
|
301
280
|
*
|
|
302
|
-
*
|
|
281
|
+
* 🛠 **Endpoint**: `GET /v1/shop/customer-users/organisations`
|
|
282
|
+
*
|
|
283
|
+
* 📤 **Returns**:
|
|
284
|
+
* A `Promise` resolving to the list of organisations associated with the customer user.
|
|
303
285
|
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
* ```typescript
|
|
286
|
+
* 🛠 **Example usage**:
|
|
287
|
+
* ```ts
|
|
307
288
|
* const organisations = await getCustomerUserOrganisations();
|
|
308
289
|
* ```
|
|
309
|
-
* ####
|
|
290
|
+
* #### Output
|
|
310
291
|
* ```json
|
|
311
292
|
* {
|
|
312
293
|
* "organisations": [
|
|
@@ -330,30 +311,31 @@ async function getCustomerUserOrganisations() {
|
|
|
330
311
|
return data;
|
|
331
312
|
}
|
|
332
313
|
/**
|
|
333
|
-
*
|
|
314
|
+
* 🚚 **Send Customer User Activation Request**
|
|
315
|
+
*
|
|
316
|
+
* **APICODE(USER-203)**
|
|
334
317
|
* Sends a customer user activation request.
|
|
335
318
|
*
|
|
336
319
|
* This function sends a request to resend an activation request to a customer user.
|
|
337
320
|
*
|
|
338
|
-
*
|
|
339
|
-
* #### token - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
340
|
-
*
|
|
341
|
-
* The activation token of the user.
|
|
342
|
-
* #### redirectUrl - `string`
|
|
321
|
+
* 🛠 **Endpoint**: `POST /v1/shop/customer-users/resend-activation-request`
|
|
343
322
|
*
|
|
344
|
-
*
|
|
323
|
+
* | Parameter | Type | Required | Description |
|
|
324
|
+
* |-------------|--------|----------|--------------------------------------------------|
|
|
325
|
+
* | `token` | string | ✅ | The activation token of the user. |
|
|
326
|
+
* | `redirectUrl`| string | ❌ | The URL to redirect the user after activation. |
|
|
345
327
|
*
|
|
346
|
-
*
|
|
328
|
+
* 📤 **Returns**:
|
|
329
|
+
* A `Promise` resolving when the request is sent.
|
|
347
330
|
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
* ```typescript
|
|
331
|
+
* 🛠 **Example usage**:
|
|
332
|
+
* ```ts
|
|
351
333
|
* await sendCustomerUserActivationRequest({
|
|
352
334
|
* token: 'activationToken',
|
|
353
335
|
* redirectUrl: 'http://example.com/redirect'
|
|
354
336
|
* });
|
|
355
337
|
* ```
|
|
356
|
-
* ####
|
|
338
|
+
* #### Output
|
|
357
339
|
* ```json
|
|
358
340
|
* {
|
|
359
341
|
* "detail": "Activation request sent successfully"
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
import { IncidentDto, IncidentStatus, IncidentIdType, IncidentCreatedDto } from "../../interfaces/models/incident";
|
|
1
|
+
import { IncidentDto, IncidentStatus, IncidentIdType, IncidentLogisticOrder, IncidentCreatedDto } from "../../interfaces/models/incident";
|
|
2
2
|
import { CustomFieldValueRequest } from "../../interfaces/models/custom-field";
|
|
3
3
|
/**
|
|
4
4
|
* Request parameters type definitions
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
7
|
-
|
|
6
|
+
export interface getIncidentsParameters {
|
|
7
|
+
customerAccountIds: String[];
|
|
8
|
+
linkedType: IncidentLogisticOrder;
|
|
9
|
+
ids: String[];
|
|
8
10
|
status: IncidentStatus[];
|
|
9
11
|
idType: IncidentIdType;
|
|
10
12
|
page: number;
|
|
11
13
|
size: number;
|
|
12
14
|
sort: String[];
|
|
13
15
|
}
|
|
14
|
-
export interface
|
|
15
|
-
logisticOrderId: string;
|
|
16
|
+
export interface getIncidentParameters {
|
|
16
17
|
incidentId: string;
|
|
17
18
|
idType: IncidentIdType;
|
|
18
19
|
}
|
|
19
|
-
export interface getOrderLogisticLineIncidentsParameters {
|
|
20
|
-
logisticOrderId: string;
|
|
21
|
-
lineId: string;
|
|
22
|
-
status: IncidentStatus[];
|
|
23
|
-
idType: IncidentIdType;
|
|
24
|
-
page: number;
|
|
25
|
-
size: number;
|
|
26
|
-
sort: String[];
|
|
27
|
-
}
|
|
28
20
|
export interface createOrderLogisticIncidentParameters {
|
|
29
21
|
logisticOrderId: string;
|
|
30
22
|
idType: IncidentIdType;
|
|
@@ -45,24 +37,14 @@ export interface createOrderLogisticLineIncidentParameters {
|
|
|
45
37
|
}[];
|
|
46
38
|
reasonCode: string[];
|
|
47
39
|
}
|
|
48
|
-
export interface getCustomerAccountIncidentsParameters {
|
|
49
|
-
customerAccountId: string;
|
|
50
|
-
status: IncidentStatus[];
|
|
51
|
-
page: number;
|
|
52
|
-
size: number;
|
|
53
|
-
sort: String[];
|
|
54
|
-
}
|
|
55
40
|
/**
|
|
41
|
+
* Request response type definitions
|
|
56
42
|
*/
|
|
57
|
-
export interface
|
|
43
|
+
export interface getIncidentsResponse extends Array<IncidentDto> {
|
|
58
44
|
}
|
|
59
|
-
export interface
|
|
60
|
-
}
|
|
61
|
-
export interface getOrderLogisticLineIncidentsResponse extends Array<IncidentDto> {
|
|
45
|
+
export interface getIncidentResponse extends IncidentDto {
|
|
62
46
|
}
|
|
63
47
|
export interface createOrderLogisticIncidentResponse extends IncidentCreatedDto {
|
|
64
48
|
}
|
|
65
49
|
export interface createOrderLogisticLineIncidentResponse extends IncidentCreatedDto {
|
|
66
50
|
}
|
|
67
|
-
export interface getCustomerAccountIncidentsResponse extends Array<IncidentDto> {
|
|
68
|
-
}
|
|
@@ -1,114 +1,70 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getIncidentsParameters, getIncidentParameters, createOrderLogisticIncidentParameters, createOrderLogisticLineIncidentParameters, getIncidentsResponse, getIncidentResponse, createOrderLogisticIncidentResponse, createOrderLogisticLineIncidentResponse } from "./definitions";
|
|
2
2
|
/**
|
|
3
|
-
* 🚚
|
|
3
|
+
* 🚚 Retrieves a list of incidents based on various filter criteria.
|
|
4
4
|
*
|
|
5
|
-
* This function
|
|
6
|
-
* filtered by status and other parameters. The `logisticOrderId` parameter is mandatory
|
|
7
|
-
* and validated before the request is executed.
|
|
5
|
+
* This function allows you to fetch incidents with detailed filtering options, such as customer account IDs, status, and sorting preferences.
|
|
8
6
|
*
|
|
9
|
-
* 🛠 **Endpoint**: `GET /v1/shop/
|
|
7
|
+
* 🛠 **Endpoint**: `GET /v1/shop/incidents [ORDER-559]`
|
|
10
8
|
*
|
|
11
|
-
* | Parameter
|
|
12
|
-
*
|
|
13
|
-
* | `
|
|
14
|
-
* | `
|
|
15
|
-
* | `
|
|
16
|
-
* | `
|
|
17
|
-
* | `
|
|
18
|
-
* | `
|
|
9
|
+
* | Parameter | Type | Required | Description |
|
|
10
|
+
* |-----------------------|--------------------|----------|-----------------------------------------------------------------------------|
|
|
11
|
+
* | `customerAccountIds` | `string[]` | ❌ | List of customer account IDs to filter incidents by. |
|
|
12
|
+
* | `linkedType` | `string` | ✅ | Type of entity linked to the incident (e.g., ORDER or ORDER_LINES). |
|
|
13
|
+
* | `ids` | `string[]` | ❌ | Specific incident IDs to retrieve. |
|
|
14
|
+
* | `status` | `IncidentStatus[]`| ❌ | List of statuses to filter incidents by (e.g., OPEN, ON_GOING, CLOSED). |
|
|
15
|
+
* | `idType` | `IncidentIdType` | ❌ | Type of ID used for filtering (e.g., DJUST_ID, EXTERNAL_ID). |
|
|
16
|
+
* | `page` | `number` | ❌ | Page number for paginated results (starting at 0). |
|
|
17
|
+
* | `size` | `number` | ❌ | Number of incidents per page. |
|
|
18
|
+
* | `sort` | `string[]` | ❌ | Sorting criteria in the format `field,(asc|desc)` (e.g., `status,desc`). |
|
|
19
19
|
*
|
|
20
20
|
* 📤 **Returns**:
|
|
21
|
-
* A `Promise
|
|
21
|
+
* A `Promise<getIncidentsResponse>` containing a paginated list of incidents matching the filter criteria.
|
|
22
22
|
*
|
|
23
23
|
* 🛠 **Example usage**:
|
|
24
24
|
* ```ts
|
|
25
|
-
* const incidents = await
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* page:
|
|
25
|
+
* const incidents = await getIncidents({
|
|
26
|
+
* customerAccountIds: ["acc123", "acc456"],
|
|
27
|
+
* linkedType: "ORDER",
|
|
28
|
+
* status: ["OPEN", "ON_GOING"],
|
|
29
|
+
* page: 0,
|
|
30
30
|
* size: 10,
|
|
31
31
|
* sort: ["createdAt,desc"],
|
|
32
32
|
* });
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
|
-
* @param {
|
|
36
|
-
* @throws {Error} If `
|
|
37
|
-
* @returns {Promise<
|
|
35
|
+
* @param {getIncidentsParameters} params - The parameters for filtering and retrieving incidents.
|
|
36
|
+
* @throws {Error} If the required `linkedType` is missing.
|
|
37
|
+
* @returns {Promise<getIncidentsResponse>} A promise that resolves to a response object containing the incidents.
|
|
38
38
|
*/
|
|
39
|
-
export declare function
|
|
39
|
+
export declare function getIncidents({ customerAccountIds, linkedType, ids, status, idType, page, size, sort, }: getIncidentsParameters): Promise<getIncidentsResponse>;
|
|
40
40
|
/**
|
|
41
|
-
* 🚚
|
|
41
|
+
* 🚚 Retrieves details of a specific incident.
|
|
42
42
|
*
|
|
43
|
-
* This function
|
|
44
|
-
* the `logisticOrderId` and `incidentId`. Both parameters are mandatory and validated
|
|
45
|
-
* before the request is executed.
|
|
43
|
+
* This function fetches detailed information about an incident identified by its ID, with an optional ID type for filtering.
|
|
46
44
|
*
|
|
47
|
-
* 🛠 **Endpoint**: `GET /v1/shop/
|
|
45
|
+
* 🛠 **Endpoint**: `GET /v1/shop/incidents/{incidentId} [ORDER-503]`
|
|
48
46
|
*
|
|
49
|
-
* | Parameter
|
|
50
|
-
*
|
|
51
|
-
* | `
|
|
52
|
-
* | `
|
|
53
|
-
* | `idType` | `IncidentIdType` | ❌ | Specifies whether the ID is internal (`DJUST_ID`) or external (`EXTERNAL_ID`). |
|
|
47
|
+
* | Parameter | Type | Required | Description |
|
|
48
|
+
* |--------------|-------------------|----------|------------------------------------------------------------------|
|
|
49
|
+
* | `incidentId` | `string` | ✅ | The unique identifier of the incident to retrieve. |
|
|
50
|
+
* | `idType` | `IncidentIdType` | ❌ | The type of ID used (e.g., DJUST_ID, EXTERNAL_ID) for the incident. |
|
|
54
51
|
*
|
|
55
52
|
* 📤 **Returns**:
|
|
56
|
-
* A `Promise
|
|
53
|
+
* A `Promise<getIncidentResponse>` containing the details of the specified incident.
|
|
57
54
|
*
|
|
58
55
|
* 🛠 **Example usage**:
|
|
59
56
|
* ```ts
|
|
60
|
-
* const incident = await
|
|
61
|
-
*
|
|
62
|
-
* incidentId: "incident_1",
|
|
57
|
+
* const incident = await getIncident({
|
|
58
|
+
* incidentId: "incident123",
|
|
63
59
|
* idType: "EXTERNAL_ID",
|
|
64
60
|
* });
|
|
65
61
|
* ```
|
|
66
62
|
*
|
|
67
|
-
* @param {
|
|
68
|
-
* @throws {Error} If
|
|
69
|
-
* @returns {Promise<
|
|
63
|
+
* @param {getIncidentParameters} params - The parameters for identifying the incident.
|
|
64
|
+
* @throws {Error} If the required `incidentId` is missing.
|
|
65
|
+
* @returns {Promise<getIncidentResponse>} A promise that resolves to the incident details.
|
|
70
66
|
*/
|
|
71
|
-
export declare function
|
|
72
|
-
/**
|
|
73
|
-
* 🚚 Fetches incidents for a specific line of a logistic order.
|
|
74
|
-
*
|
|
75
|
-
* This function retrieves a list of incidents for a specific line in a logistic order,
|
|
76
|
-
* filtered by status and other parameters. The `logisticOrderId` and `lineId` parameters
|
|
77
|
-
* are mandatory and validated before the request is executed.
|
|
78
|
-
*
|
|
79
|
-
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/{logisticOrderId}/incidents/lines/{lineId} [ORDER-559]`
|
|
80
|
-
*
|
|
81
|
-
* | Parameter | Type | Required | Description |
|
|
82
|
-
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
83
|
-
* | `logisticOrderId` | `string` | ✅ | The ID of the logistic order to fetch incidents for. |
|
|
84
|
-
* | `lineId` | `string` | ✅ | The ID of the line in the logistic order to fetch incidents for. |
|
|
85
|
-
* | `status` | `IncidentStatus[]` | ❌ | Array of statuses to filter incidents (e.g., `["OPEN"]`). |
|
|
86
|
-
* | `idType` | `IncidentIdType` | ❌ | Specifies whether the ID is internal (`DJUST_ID`) or external (`EXTERNAL_ID`). |
|
|
87
|
-
* | `page` | `number` | ❌ | The page number for pagination. |
|
|
88
|
-
* | `size` | `number` | ❌ | The number of results per page. |
|
|
89
|
-
* | `sort` | `String[]` | ❌ | Sorting criteria (e.g., `["createdAt,desc"]`). |
|
|
90
|
-
*
|
|
91
|
-
* 📤 **Returns**:
|
|
92
|
-
* A `Promise` resolving to an array of `getOrderLogisticLineIncidentsResponse` objects representing the incidents.
|
|
93
|
-
*
|
|
94
|
-
* 🛠 **Example usage**:
|
|
95
|
-
* ```ts
|
|
96
|
-
* const incidents = await getOrderLogisticLineIncidents({
|
|
97
|
-
* logisticOrderId: "12345",
|
|
98
|
-
* lineId: "line_1",
|
|
99
|
-
* status: ["OPEN"],
|
|
100
|
-
* idType: "EXTERNAL_ID",
|
|
101
|
-
* page: 1,
|
|
102
|
-
* size: 10,
|
|
103
|
-
* sort: ["createdAt,desc"],
|
|
104
|
-
* });
|
|
105
|
-
* ```
|
|
106
|
-
*
|
|
107
|
-
* @param {getOrderLogisticLineIncidentsParameters} params - The parameters for the request.
|
|
108
|
-
* @throws {Error} If `logisticOrderId` or `lineId` is missing.
|
|
109
|
-
* @returns {Promise<getOrderLogisticLineIncidentsResponse>} A promise resolving to the response containing the incidents.
|
|
110
|
-
*/
|
|
111
|
-
export declare function getOrderLogisticLineIncidents({ logisticOrderId, lineId, status, idType, page, size, sort, }: getOrderLogisticLineIncidentsParameters): Promise<getOrderLogisticLineIncidentsResponse>;
|
|
67
|
+
export declare function getIncident({ incidentId, idType, }: getIncidentParameters): Promise<getIncidentResponse>;
|
|
112
68
|
/**
|
|
113
69
|
* 🚚 Creates a new incident for a specific logistic order.
|
|
114
70
|
*
|
|
@@ -183,40 +139,3 @@ export declare function createOrderLogisticIncident({ logisticOrderId, idType, c
|
|
|
183
139
|
* @returns {Promise<createOrderLogisticLineIncidentResponse>} A promise resolving to the response containing the created incident's details.
|
|
184
140
|
*/
|
|
185
141
|
export declare function createOrderLogisticLineIncident({ logisticOrderId, idType, customFieldIdType, orderLines, reasonCode, }: createOrderLogisticLineIncidentParameters): Promise<createOrderLogisticLineIncidentResponse>;
|
|
186
|
-
/**
|
|
187
|
-
* 🧑💼 Fetches incidents for a specific customer account.
|
|
188
|
-
*
|
|
189
|
-
* This function retrieves incidents associated with a particular customer account,
|
|
190
|
-
* using parameters such as `status`, `page`, `size`, and `sort` to filter and paginate the results.
|
|
191
|
-
* The `customerAccountId` is a mandatory parameter and is validated before making the request.
|
|
192
|
-
*
|
|
193
|
-
* 🛠 **Endpoint**: `GET /v1/shop/customer-accounts/{customerAccountId}/incidents [ACCOUNT-551]`
|
|
194
|
-
*
|
|
195
|
-
* | Parameter | Type | Required | Description |
|
|
196
|
-
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
197
|
-
* | `customerAccountId`| `string` | ✅ | The ID of the customer account for which incidents are to be fetched. |
|
|
198
|
-
* | `status` | `IncidentStatus[]` | ❌ | Array of statuses to filter incidents by (e.g., `["OPEN"]`). |
|
|
199
|
-
* | `page` | `number` | ❌ | The page number for pagination. |
|
|
200
|
-
* | `size` | `number` | ❌ | The number of results per page. |
|
|
201
|
-
* | `sort` | `string[]` | ❌ | Sorting criteria (e.g., `["createdAt,desc"]`). |
|
|
202
|
-
*
|
|
203
|
-
* 📤 **Returns**:
|
|
204
|
-
* A `Promise` resolving to an array of `getCustomerAccountIncidentsResponse` objects,
|
|
205
|
-
* representing the incidents for the given customer account.
|
|
206
|
-
*
|
|
207
|
-
* 🛠 **Example usage**:
|
|
208
|
-
* ```ts
|
|
209
|
-
* const incidents = await getCustomerAccountIncidents({
|
|
210
|
-
* customerAccountId: "98765",
|
|
211
|
-
* status: ["OPEN"],
|
|
212
|
-
* page: 1,
|
|
213
|
-
* size: 10,
|
|
214
|
-
* sort: ["createdAt,desc"],
|
|
215
|
-
* });
|
|
216
|
-
* ```
|
|
217
|
-
*
|
|
218
|
-
* @param {getCustomerAccountIncidentsParameters} params - The parameters for the request.
|
|
219
|
-
* @throws {Error} If `customerAccountId` is missing.
|
|
220
|
-
* @returns {Promise<getCustomerAccountIncidentsResponse>} A promise resolving to the incidents response.
|
|
221
|
-
*/
|
|
222
|
-
export declare function getCustomerAccountIncidents({ customerAccountId, status, page, size, sort, }: getCustomerAccountIncidentsParameters): Promise<getCustomerAccountIncidentsResponse>;
|