@djust-b2b/djust-front-sdk 1.22.2 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -10
- package/lib/{src/helpers → helpers}/parameters-validation.js +2 -2
- package/lib/{src/index.d.ts → index.d.ts} +18 -31
- package/lib/{src/index.js → index.js} +1 -2
- package/lib/{src/interfaces → interfaces}/models/common.d.ts +2 -2
- package/lib/{src/interfaces → interfaces}/models/customer-user.d.ts +1 -1
- package/lib/{src/interfaces → interfaces}/models/order.d.ts +90 -3
- package/lib/{src/services → services}/auth/definitions.requests.js +3 -0
- package/lib/{src/services → services}/cart/index.d.ts +2 -2
- package/lib/{src/services → services}/cart/index.js +2 -2
- package/lib/{src/services → services}/commercial-order/definitions.d.ts +33 -2
- package/lib/{src/services → services}/commercial-order/index.d.ts +167 -1
- package/lib/{src/services → services}/commercial-order/index.js +225 -4
- package/lib/{src/services → services}/customer-account/definitions.d.ts +14 -1
- package/lib/{src/services → services}/customer-account/index.d.ts +28 -2
- package/lib/{src/services → services}/customer-account/index.js +38 -0
- package/lib/{src/services → services}/customer-user/definitions.d.ts +1 -1
- package/lib/{src/services → services}/logistic-order/definitions.d.ts +94 -4
- package/lib/{src/services → services}/logistic-order/index.d.ts +423 -9
- package/lib/{src/services → services}/logistic-order/index.js +534 -8
- package/lib/{src/services → services}/navigation-category/definitions.d.ts +0 -3
- package/lib/{src/services → services}/product/definitions.d.ts +1 -2
- package/lib/{src/services → services}/product-variant/definitions.d.ts +1 -2
- package/lib/{src/settings → settings}/fetch-instance.d.ts +2 -3
- package/lib/{src/settings → settings}/fetch-instance.js +67 -30
- package/package.json +5 -6
- package/lib/instrument.d.ts +0 -2
- package/lib/instrument.js +0 -33
- /package/lib/{src/helpers → helpers}/parameters-validation.d.ts +0 -0
- /package/lib/{src/helpers → helpers}/utils.d.ts +0 -0
- /package/lib/{src/helpers → helpers}/utils.js +0 -0
- /package/lib/{src/interfaces → interfaces}/index.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/index.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/address.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/address.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/attribute.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/attribute.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/auth.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/auth.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/buying-list.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/buying-list.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/cart.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/cart.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/common.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/custom-field.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/custom-field.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/customer-account.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/customer-account.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/customer-organisation.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/customer-organisation.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/customer-user.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/incident.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/incident.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/navigation-category.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/navigation-category.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/offer.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/offer.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/order.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/payment.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/payment.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/price.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/price.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/product.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/product.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/quote.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/quote.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/searchProduct.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/searchProduct.js +0 -0
- /package/lib/{src/interfaces → interfaces}/models/supplier.d.ts +0 -0
- /package/lib/{src/interfaces → interfaces}/models/supplier.js +0 -0
- /package/lib/{src/services → services}/auth/definitions.d.ts +0 -0
- /package/lib/{src/services → services}/auth/definitions.js +0 -0
- /package/lib/{src/services → services}/auth/definitions.requests.d.ts +0 -0
- /package/lib/{src/services → services}/auth/index.d.ts +0 -0
- /package/lib/{src/services → services}/auth/index.js +0 -0
- /package/lib/{src/services → services}/buying-list/definitions.d.ts +0 -0
- /package/lib/{src/services → services}/buying-list/definitions.js +0 -0
- /package/lib/{src/services → services}/buying-list/index.d.ts +0 -0
- /package/lib/{src/services → services}/buying-list/index.js +0 -0
- /package/lib/{src/services → services}/cart/definitions.d.ts +0 -0
- /package/lib/{src/services → services}/cart/definitions.js +0 -0
- /package/lib/{src/services → services}/commercial-order/definitions.js +0 -0
- /package/lib/{src/services → services}/custom-field/definitions.d.ts +0 -0
- /package/lib/{src/services → services}/custom-field/definitions.js +0 -0
- /package/lib/{src/services → services}/custom-field/index.d.ts +0 -0
- /package/lib/{src/services → services}/custom-field/index.js +0 -0
- /package/lib/{src/services → services}/customer-account/definitions.js +0 -0
- /package/lib/{src/services → services}/customer-user/definitions.js +0 -0
- /package/lib/{src/services → services}/customer-user/index.d.ts +0 -0
- /package/lib/{src/services → services}/customer-user/index.js +0 -0
- /package/lib/{src/services → services}/incident/definitions.d.ts +0 -0
- /package/lib/{src/services → services}/incident/definitions.js +0 -0
- /package/lib/{src/services → services}/incident/index.d.ts +0 -0
- /package/lib/{src/services → services}/incident/index.js +0 -0
- /package/lib/{src/services → services}/logistic-order/definitions.js +0 -0
- /package/lib/{src/services → services}/navigation-category/definitions.js +0 -0
- /package/lib/{src/services → services}/navigation-category/index.d.ts +0 -0
- /package/lib/{src/services → services}/navigation-category/index.js +0 -0
- /package/lib/{src/services → services}/product/definitions.js +0 -0
- /package/lib/{src/services → services}/product/index.d.ts +0 -0
- /package/lib/{src/services → services}/product/index.js +0 -0
- /package/lib/{src/services → services}/product-variant/definitions.js +0 -0
- /package/lib/{src/services → services}/product-variant/index.d.ts +0 -0
- /package/lib/{src/services → services}/product-variant/index.js +0 -0
- /package/lib/{src/services → services}/quote/definitions.d.ts +0 -0
- /package/lib/{src/services → services}/quote/definitions.js +0 -0
- /package/lib/{src/services → services}/quote/index.d.ts +0 -0
- /package/lib/{src/services → services}/quote/index.js +0 -0
- /package/lib/{src/services → services}/supplier/definitions.d.ts +0 -0
- /package/lib/{src/services → services}/supplier/definitions.js +0 -0
- /package/lib/{src/services → services}/supplier/index.d.ts +0 -0
- /package/lib/{src/services → services}/supplier/index.js +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getLogisticOrders = getLogisticOrders;
|
|
4
|
+
exports.logisticOrdersPaginatedList = logisticOrdersPaginatedList;
|
|
4
5
|
exports.getLogisticOrderCustomFields = getLogisticOrderCustomFields;
|
|
5
6
|
exports.getLogisticOrderLineCustomFields = getLogisticOrderLineCustomFields;
|
|
6
7
|
exports.getLogisticOrder = getLogisticOrder;
|
|
@@ -25,6 +26,15 @@ exports.getLogisticOrderShippingInformation = getLogisticOrderShippingInformatio
|
|
|
25
26
|
exports.updateLogisticOrderShippingInformation = updateLogisticOrderShippingInformation;
|
|
26
27
|
exports.updateLogisticOrderShippingType = updateLogisticOrderShippingType;
|
|
27
28
|
exports.createLogisticOrderThread = createLogisticOrderThread;
|
|
29
|
+
exports.createLogisticOrderThreadV2 = createLogisticOrderThreadV2;
|
|
30
|
+
exports.getLogisticOrderThreads = getLogisticOrderThreads;
|
|
31
|
+
exports.getLogisticOrderThread = getLogisticOrderThread;
|
|
32
|
+
exports.createOrderLogisticThreadMessages = createOrderLogisticThreadMessages;
|
|
33
|
+
exports.updateOrderLogisticThreadMessage = updateOrderLogisticThreadMessage;
|
|
34
|
+
exports.createLogisticOrderIncidentThreads = createLogisticOrderIncidentThreads;
|
|
35
|
+
exports.getLogisticOrderIncidentThread = getLogisticOrderIncidentThread;
|
|
36
|
+
exports.createLogisticOrderIncidentThreadMessages = createLogisticOrderIncidentThreadMessages;
|
|
37
|
+
exports.updateLogisticOrderIncidentThreadMessage = updateLogisticOrderIncidentThreadMessage;
|
|
28
38
|
exports.getLogisticOrderReview = getLogisticOrderReview;
|
|
29
39
|
exports.addLogisticOrderReview = addLogisticOrderReview;
|
|
30
40
|
exports.getThreadReasonTypes = getThreadReasonTypes;
|
|
@@ -32,6 +42,7 @@ exports.getThreadSubReasons = getThreadSubReasons;
|
|
|
32
42
|
const parameters_validation_1 = require("../../helpers/parameters-validation");
|
|
33
43
|
const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
34
44
|
/**
|
|
45
|
+
* @deprecated
|
|
35
46
|
* 🚚 Gets logistic orders.
|
|
36
47
|
*
|
|
37
48
|
* This function retrieves all logistic orders. The parameter locale is mandatory and validated
|
|
@@ -60,7 +71,6 @@ const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
|
60
71
|
* locale: "fr",
|
|
61
72
|
* });
|
|
62
73
|
* ```
|
|
63
|
-
*
|
|
64
74
|
* @param {GetLogisticOrdersParameters} params - The parameters for the request.
|
|
65
75
|
* @throws {Error} If `locale` is missing.
|
|
66
76
|
* @returns {Promise<GetLogisticOrdersResponse>} A promise resolving to the response containing page object.
|
|
@@ -84,6 +94,113 @@ async function getLogisticOrders({ approvalIds, locale, logisticStatus, incident
|
|
|
84
94
|
});
|
|
85
95
|
return data;
|
|
86
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* 🚚 Get paginated and filtered Order logistics.
|
|
99
|
+
*
|
|
100
|
+
* 🛠 **Endpoint**: `POST /v1/shop/logistic-orders` [ORDER-550]
|
|
101
|
+
*
|
|
102
|
+
* | Parameter | Type | Required | Description |
|
|
103
|
+
* |-----------------------------------------|----------------------------|-----------|--------------------------------------------------------|
|
|
104
|
+
* | `page` | `number` | ❌ | Current Page |
|
|
105
|
+
* | `size` | `number` | ❌ | The size of the page to be returned |
|
|
106
|
+
* | `sort` | `string` | ❌ | Sorting criteria in the format: property,(asc|desc) |
|
|
107
|
+
* | `nbPreviewLines` | `number` | ❌ | The number of lines to display in the logistic order. |
|
|
108
|
+
* | `accountCustomFieldValueCriteria` | `CustomFieldValueObject[]` | ❌ | Account custom field value criteria |
|
|
109
|
+
* | `approvalIds` | `string[]` | ❌ | Approval IDs |
|
|
110
|
+
* | `connectedUserOnly` | `boolean` | ❌ | Connected user only |
|
|
111
|
+
* | `creationDateFrom` | `string` | ❌ | Creation date from |
|
|
112
|
+
* | `creationDateTo` | `string` | ❌ | Creation date to |
|
|
113
|
+
* | `customerAccountIds` | `string[]` | ❌ | Customer account IDs |
|
|
114
|
+
* | `incident` | `boolean` | ❌ | Incident |
|
|
115
|
+
* | `locale` | `string` | ✅ | Locale |
|
|
116
|
+
* | `logisticStatus` | `string[]` | ❌ | Logistic status |
|
|
117
|
+
* | `offerCustomFieldValueCriteria` | `CustomFieldValueObject[]` | ❌ | Offer custom field value criteria |
|
|
118
|
+
* | `orderLogisticCustomFieldValueCriteria` | `CustomFieldValueObject[]` | ❌ | Order logistic custom field value criteria |
|
|
119
|
+
* | `paymentOptions` | `string[]` | ❌ | Payment options |
|
|
120
|
+
* | `supplierIds` | `string[]` | ❌ | Supplier IDs |
|
|
121
|
+
* | `updateDateFrom` | `string` | ❌ | Update date from |
|
|
122
|
+
* | `updateDateTo` | `string` | ❌ | Update date to |
|
|
123
|
+
*
|
|
124
|
+
* 📤 **Returns**:
|
|
125
|
+
* A `Promise` resolving to a `GetPaginatedLogisticOrdersResponse`.
|
|
126
|
+
*
|
|
127
|
+
* 🛠 **Example usage**:
|
|
128
|
+
* ```ts
|
|
129
|
+
* await logisticOrdersPaginatedList({
|
|
130
|
+
* 1,
|
|
131
|
+
* 10,
|
|
132
|
+
* 'asc|desc',
|
|
133
|
+
* 20,
|
|
134
|
+
* {
|
|
135
|
+
* "accountCustomFieldValueCriteria": [
|
|
136
|
+
* {
|
|
137
|
+
* "customFieldId": "string",
|
|
138
|
+
* "customFieldValue": "string"
|
|
139
|
+
* }
|
|
140
|
+
* ],
|
|
141
|
+
* "approvalIds": [ "string" ],
|
|
142
|
+
* "connectedUserOnly": true,
|
|
143
|
+
* "creationDateFrom": "2025-03-26T15:38:31.964Z",
|
|
144
|
+
* "creationDateTo": "2025-03-26T15:38:31.964Z",
|
|
145
|
+
* "incident": true,
|
|
146
|
+
* "locale": "string",
|
|
147
|
+
* "logisticStatus": [ "CREATING" ],
|
|
148
|
+
* "offerCustomFieldValueCriteria": [
|
|
149
|
+
* {
|
|
150
|
+
* "customFieldId": "string",
|
|
151
|
+
* "customFieldValue": "string"
|
|
152
|
+
* }
|
|
153
|
+
* ],
|
|
154
|
+
* "customerAccountIds": [ "string" ],
|
|
155
|
+
* "orderLogisticCustomFieldValueCriteria": [
|
|
156
|
+
* {
|
|
157
|
+
* "customFieldId": "string",
|
|
158
|
+
* "customFieldValue": "string"
|
|
159
|
+
* }
|
|
160
|
+
* ],
|
|
161
|
+
* "paymentOptions": [ "BANK_WIRE" ],
|
|
162
|
+
* "supplierIds": [ "string" ],
|
|
163
|
+
* "updateDateFrom": "2025-03-26T15:38:31.964Z",
|
|
164
|
+
* "updateDateTo": "2025-03-26T15:38:31.964Z"
|
|
165
|
+
* }
|
|
166
|
+
* });
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @param {GetPaginatedLogisticOrdersParameters} params - The parameters for the request.
|
|
170
|
+
* @throws {Error} If `locale` is missing.
|
|
171
|
+
* @returns {Promise<GetPaginatedLogisticOrdersResponse>}
|
|
172
|
+
*/
|
|
173
|
+
async function logisticOrdersPaginatedList({ page, size, sort, nbPreviewLines, accountCustomFieldValueCriteria, approvalIds, connectedUserOnly, creationDateFrom, creationDateTo, customerAccountIds, incident, locale, logisticStatus, offerCustomFieldValueCriteria, orderLogisticCustomFieldValueCriteria, paymentOptions, supplierIds, updateDateFrom, updateDateTo, }) {
|
|
174
|
+
(0, parameters_validation_1.required)({ locale });
|
|
175
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
176
|
+
method: "POST",
|
|
177
|
+
path: `/v1/shop/logistic-orders`,
|
|
178
|
+
params: {
|
|
179
|
+
nbPreviewLines,
|
|
180
|
+
size,
|
|
181
|
+
page,
|
|
182
|
+
sort,
|
|
183
|
+
},
|
|
184
|
+
body: JSON.stringify({
|
|
185
|
+
accountCustomFieldValueCriteria,
|
|
186
|
+
approvalIds,
|
|
187
|
+
connectedUserOnly,
|
|
188
|
+
creationDateFrom,
|
|
189
|
+
creationDateTo,
|
|
190
|
+
customerAccountIds,
|
|
191
|
+
incident,
|
|
192
|
+
locale,
|
|
193
|
+
logisticStatus,
|
|
194
|
+
offerCustomFieldValueCriteria,
|
|
195
|
+
orderLogisticCustomFieldValueCriteria,
|
|
196
|
+
paymentOptions,
|
|
197
|
+
supplierIds,
|
|
198
|
+
updateDateFrom,
|
|
199
|
+
updateDateTo,
|
|
200
|
+
}),
|
|
201
|
+
});
|
|
202
|
+
return data;
|
|
203
|
+
}
|
|
87
204
|
/**
|
|
88
205
|
* 🚚 Get logistic order's custom fields.
|
|
89
206
|
*
|
|
@@ -1000,14 +1117,14 @@ async function updateLogisticOrderShippingType({ orderId, shippingType, }) {
|
|
|
1000
1117
|
* the `orderId`. This parameter, as well as the `lineId`, the `message` and the `reasonCode`, is mandatory and validated
|
|
1001
1118
|
* before the request is executed.
|
|
1002
1119
|
*
|
|
1003
|
-
* 🛠 **Endpoint**: `POST /v1/shop/logistic-orders/${orderId}/threads [THREAD-
|
|
1120
|
+
* 🛠 **Endpoint**: `POST /v1/shop/logistic-orders/${orderId}/threads [THREAD-100]`
|
|
1004
1121
|
*
|
|
1005
1122
|
* | Parameter | Type | Required | Description |
|
|
1006
1123
|
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
1007
1124
|
* | `orderId` | `string` | ✅ | The ID of the logistic order for which you want to create a thread. |
|
|
1008
|
-
* | `lineId` | `string` |
|
|
1009
|
-
* | `message` | `string` |
|
|
1010
|
-
* | `reasonCode` | `string` |
|
|
1125
|
+
* | `lineId` | `string` | ❌ | The ID of the logistic order line involved in the thread. |
|
|
1126
|
+
* | `message` | `string` | ❌ | A message to add comments on the thread. |
|
|
1127
|
+
* | `reasonCode` | `string` | ❌ | The code indentifying the type of thread. |
|
|
1011
1128
|
*
|
|
1012
1129
|
* 📤 **Returns**:
|
|
1013
1130
|
* A `Promise` resolving to a `CreateLogisticOrderThreadResponse` object when the thread is created.
|
|
@@ -1023,7 +1140,7 @@ async function updateLogisticOrderShippingType({ orderId, shippingType, }) {
|
|
|
1023
1140
|
* ```
|
|
1024
1141
|
*
|
|
1025
1142
|
* @param {CreateLogisticOrderThreadParameters} params - The parameters for the request.
|
|
1026
|
-
* @throws {Error} If `orderId
|
|
1143
|
+
* @throws {Error} If `orderId` is missing.
|
|
1027
1144
|
* @returns {Promise<CreateLogisticOrderThreadResponse>} A promise resolving when the thread is created.
|
|
1028
1145
|
*/
|
|
1029
1146
|
async function createLogisticOrderThread({ orderId, lineId, message, reasonCode, }) {
|
|
@@ -1035,6 +1152,415 @@ async function createLogisticOrderThread({ orderId, lineId, message, reasonCode,
|
|
|
1035
1152
|
});
|
|
1036
1153
|
return data;
|
|
1037
1154
|
}
|
|
1155
|
+
/**
|
|
1156
|
+
* 🚚 Creates a thread on a specific logistic order V2.
|
|
1157
|
+
*
|
|
1158
|
+
* This function creates a thread on a specific logistic order, identified by (Version 2)
|
|
1159
|
+
* the `logisticOrderId` and `reasonCode`, are mandatory and validated
|
|
1160
|
+
* before the request is executed.
|
|
1161
|
+
*
|
|
1162
|
+
* 🛠 **Endpoint**: `POST /v2/shop/logistic-orders/${logisticOrderId}/threads [THREAD-101]`
|
|
1163
|
+
*
|
|
1164
|
+
* | Parameter | Type | Required | Description |
|
|
1165
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
1166
|
+
* | `logisticOrderId` | `string` | ✅ | The ID of the logistic order for which you want to create a thread. |
|
|
1167
|
+
* | `idType` | `IdType` | ❌ | The type of the id. |
|
|
1168
|
+
* | `message` | `string` | ❌ | A message to add comments on the thread. |
|
|
1169
|
+
* | `name` | `string` | ❌ | The name of the thread. |
|
|
1170
|
+
* | `reasonCode` | `string` | ✅ | The code indentifying the type of thread. |
|
|
1171
|
+
*
|
|
1172
|
+
* 📤 **Returns**:
|
|
1173
|
+
* A `Promise` resolving to a `CreateLogisticOrderThreadResponseV2` object when the threads are created.
|
|
1174
|
+
*
|
|
1175
|
+
* 🛠 **Example usage**:
|
|
1176
|
+
* ```ts
|
|
1177
|
+
* await createLogisticOrderThreadV2({
|
|
1178
|
+
* logisticOrderId: "logisticOrder1",
|
|
1179
|
+
* idType: "DJUST_ID",
|
|
1180
|
+
* name: "This is a test thread",
|
|
1181
|
+
* message: "This is a message",
|
|
1182
|
+
* reasonCode: "REFUND"
|
|
1183
|
+
* });
|
|
1184
|
+
* ```
|
|
1185
|
+
*
|
|
1186
|
+
* @param {CreateLogisticOrderThreadParametersV2} params - The parameters for the request.
|
|
1187
|
+
* @throws {Error} If `logisticOrderId`, `reasonCode` is missing.
|
|
1188
|
+
* @returns {Promise<CreateLogisticOrderThreadResponseV2>} A promise resolving when the thread is created.
|
|
1189
|
+
*/
|
|
1190
|
+
async function createLogisticOrderThreadV2({ logisticOrderId, idType, message, reasonCode, }) {
|
|
1191
|
+
(0, parameters_validation_1.required)({ logisticOrderId, reasonCode });
|
|
1192
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
1193
|
+
method: "POST",
|
|
1194
|
+
path: `/v2/shop/logistic-orders/${logisticOrderId}/threads`,
|
|
1195
|
+
body: JSON.stringify({ name, message, reasonCode }),
|
|
1196
|
+
});
|
|
1197
|
+
return data;
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* 🚚 Get order logistic threads.
|
|
1201
|
+
*
|
|
1202
|
+
* This function return the list of threads related to a specific logistic order.
|
|
1203
|
+
*
|
|
1204
|
+
* 🛠 **Endpoint**: `GET /v2/shop/logistic-orders/${logisticOrderId}/threads [ORDER-558]`
|
|
1205
|
+
*
|
|
1206
|
+
* | Parameter | Type | Required | Description |
|
|
1207
|
+
* |-------------------|-------------|----------|------------------------------------------------------------------------|
|
|
1208
|
+
* | `logisticOrderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the review. |
|
|
1209
|
+
* | `pageable.page` | `number` | ❌ | The page number |
|
|
1210
|
+
* | `pageable.size` | `number` | ❌ | The number of items per page. |
|
|
1211
|
+
*
|
|
1212
|
+
* 📤 **Returns**:
|
|
1213
|
+
* A `Promise` resolving to a `GetLogisticOrderThreadsResponse`.
|
|
1214
|
+
*
|
|
1215
|
+
* 🛠 **Example usage**:
|
|
1216
|
+
* ```ts
|
|
1217
|
+
* const threads = await getLogisticOrderThreads({
|
|
1218
|
+
* logisticOrderId: "logisticOrder1",
|
|
1219
|
+
* pageable: { page: 1, size: 10 },
|
|
1220
|
+
* });
|
|
1221
|
+
* ```
|
|
1222
|
+
*
|
|
1223
|
+
* @param {GetLogisticOrderThreadsParams} params - The parameters for the request.
|
|
1224
|
+
* @throws {Error} If `logisticOrderId` is missing.
|
|
1225
|
+
* @returns {Promise<GetLogisticOrderThreadsResponse>} A promise resolving when the thread is created.
|
|
1226
|
+
*/
|
|
1227
|
+
async function getLogisticOrderThreads({ logisticOrderId, pageable, }) {
|
|
1228
|
+
(0, parameters_validation_1.required)({ logisticOrderId });
|
|
1229
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
1230
|
+
method: "GET",
|
|
1231
|
+
path: `/v2/shop/logistic-orders/${logisticOrderId}/threads`,
|
|
1232
|
+
params: {
|
|
1233
|
+
page: pageable === null || pageable === void 0 ? void 0 : pageable.page,
|
|
1234
|
+
size: pageable === null || pageable === void 0 ? void 0 : pageable.size,
|
|
1235
|
+
},
|
|
1236
|
+
});
|
|
1237
|
+
return data;
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* 🚚 Get a logistic order thread.
|
|
1241
|
+
*
|
|
1242
|
+
* This function retrieves a specific logistic order thread, identified by
|
|
1243
|
+
* the `logisticOrderId` and `threadId`. Both parameters are mandatory and validated
|
|
1244
|
+
* before the request is executed.
|
|
1245
|
+
*
|
|
1246
|
+
* 🛠 **Endpoint**: `GET /v2/shop/logistic-orders/${logisticOrderId}/threads/${threadId} [ORDER-509]`
|
|
1247
|
+
*
|
|
1248
|
+
* | Parameter | Type | Required | Description |
|
|
1249
|
+
* |-------------------|-------------|----------|------------------------------------------------------------------------|
|
|
1250
|
+
* | `logisticOrderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the review. |
|
|
1251
|
+
* | `threadId` | `string` | ✅ | The ID of the thread of which you want to retrieve the review. |
|
|
1252
|
+
*
|
|
1253
|
+
* 📤 **Returns**:
|
|
1254
|
+
* A `Promise` resolving to a `GetLogisticOrderThreadResponse`.
|
|
1255
|
+
*
|
|
1256
|
+
* 🛠 **Example usage**:
|
|
1257
|
+
* ```ts
|
|
1258
|
+
* const threads = await getLogisticOrderThread({
|
|
1259
|
+
* logisticOrderId: "logisticOrder1",
|
|
1260
|
+
* threadId: "thread1",
|
|
1261
|
+
* });
|
|
1262
|
+
* ```
|
|
1263
|
+
*
|
|
1264
|
+
* @param {GetLogisticOrderThreadsParams} params - The parameters for the request.
|
|
1265
|
+
* @throws {Error} If `logisticOrderId` or `threadId` is missing.
|
|
1266
|
+
* @returns {Promise<GetLogisticOrderThreadResponse>} A promise resolving when the thread is found.
|
|
1267
|
+
*/
|
|
1268
|
+
async function getLogisticOrderThread({ logisticOrderId, threadId, }) {
|
|
1269
|
+
(0, parameters_validation_1.required)({ logisticOrderId });
|
|
1270
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
1271
|
+
method: "GET",
|
|
1272
|
+
path: `/v2/shop/logistic-orders/${logisticOrderId}/threads/${threadId}`,
|
|
1273
|
+
});
|
|
1274
|
+
return data;
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* 🚚 Create messages for a specific logistic order thread.
|
|
1278
|
+
* This function retrieves a specific logistic order thread, identified by
|
|
1279
|
+
* the `logisticOrderId` and `threadId`. Both parameters are mandatory and validated
|
|
1280
|
+
* before the request is executed.
|
|
1281
|
+
*
|
|
1282
|
+
* 🛠 **Endpoint**: `GET /v2/shop/logistic-orders/${logisticOrderId}/threads/${threadId}/messages [ORDER-217]`
|
|
1283
|
+
*
|
|
1284
|
+
* | Parameter | Type | Required | Description |
|
|
1285
|
+
* |-------------------|---------------------------------------------------------|----------|------------------------------------------------------------------------|
|
|
1286
|
+
* | `logisticOrderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the review. |
|
|
1287
|
+
* | `threadId` | `string` | ✅ | The ID of the thread of which you want to retrieve the review. |
|
|
1288
|
+
* | `body` | `string` | ❌ | The body of the message to be added to the thread. |
|
|
1289
|
+
* | `customField` | `logisticOrderIncidentThreadsCustomFieldValueRequest[]` | ❌ | The custom fields to add to the created incident threads messages |
|
|
1290
|
+
*
|
|
1291
|
+
* 📤 **Returns**:
|
|
1292
|
+
* A `Promise` resolving to a `CreateLogisticOrderThreadMessagesResponse`.
|
|
1293
|
+
*
|
|
1294
|
+
* 🛠 **Example usage**:
|
|
1295
|
+
* ```ts
|
|
1296
|
+
* const threads = await createOrderLogisticThreadMessages({
|
|
1297
|
+
* logisticOrderId: "logisticOrder1",
|
|
1298
|
+
* threadId: "thread1",
|
|
1299
|
+
* body: "This is a message",
|
|
1300
|
+
* customField: {
|
|
1301
|
+
* customFieldValues: [{ customFieldId: "cf1", customFieldValue: "value1" }],
|
|
1302
|
+
* idType: "EXTERNAL_ID",
|
|
1303
|
+
* },
|
|
1304
|
+
* });
|
|
1305
|
+
* ```
|
|
1306
|
+
*
|
|
1307
|
+
* @param {GetLogisticOrderThreadsParams} params - The parameters for the request.
|
|
1308
|
+
* @throws {Error} If `logisticOrderId` or `threadId` is missing.
|
|
1309
|
+
* @returns {Promise<CreateLogisticOrderThreadMessagesResponse>} A promise resolving when the thread is found.
|
|
1310
|
+
*/
|
|
1311
|
+
async function createOrderLogisticThreadMessages({ logisticOrderId, threadId, body, customField, }) {
|
|
1312
|
+
(0, parameters_validation_1.required)({ logisticOrderId, threadId });
|
|
1313
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
1314
|
+
method: "POST",
|
|
1315
|
+
path: `/v2/shop/logistic-orders/${logisticOrderId}/threads/${threadId}/messages`,
|
|
1316
|
+
body: JSON.stringify({ body, customField }),
|
|
1317
|
+
});
|
|
1318
|
+
return data;
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* 🚚 Update messages for a specific logistic order thread.
|
|
1322
|
+
*
|
|
1323
|
+
* This function retrieves a specific logistic order thread, identified by
|
|
1324
|
+
* the `logisticOrderId` and `threadId`. Both parameters are mandatory and validated
|
|
1325
|
+
* before the request is executed.
|
|
1326
|
+
*
|
|
1327
|
+
* 🛠 **Endpoint**: `PATCH /v2/shop/logistic-orders/${logisticOrderId}/threads/${threadId}/messages/${messageId} [ORDER-216]`
|
|
1328
|
+
*
|
|
1329
|
+
* | Parameter | Type | Required | Description |
|
|
1330
|
+
* |---------------------|-----------------------------|----------|------------------------------------------------------------------------|
|
|
1331
|
+
* | `logisticOrderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the review. |
|
|
1332
|
+
* | `threadId` | `string` | ✅ | The ID of the thread of which you want to retrieve the review. |
|
|
1333
|
+
* | `messageId` | `string` | ✅ | The ID of the message to be updated. |
|
|
1334
|
+
* | `customFieldValues` | `CustomFieldValueRequest[]` | ❌ | The custom fields to add to the created incident threads messages |
|
|
1335
|
+
* | `idType` | `IdType` | ❌ | The type of the id. |
|
|
1336
|
+
*
|
|
1337
|
+
* 📤 **Returns**:
|
|
1338
|
+
* A `Promise` resolving when the message is updated.
|
|
1339
|
+
|
|
1340
|
+
*
|
|
1341
|
+
* 🛠 **Example usage**:
|
|
1342
|
+
* ```ts
|
|
1343
|
+
* const threads = await updateOrderLogisticThreadMessage({
|
|
1344
|
+
* logisticOrderId: "logisticOrder1",
|
|
1345
|
+
* threadId: "thread1",
|
|
1346
|
+
* body: "This is a message",
|
|
1347
|
+
* customField: {
|
|
1348
|
+
* customFieldValues: [{ customFieldId: "cf1", customFieldValue: "value1" }],
|
|
1349
|
+
* idType: "EXTERNAL_ID",
|
|
1350
|
+
* },
|
|
1351
|
+
* });
|
|
1352
|
+
* ```
|
|
1353
|
+
*
|
|
1354
|
+
* @param {GetLogisticOrderThreadsParams} params - The parameters for the request.
|
|
1355
|
+
* @throws {Error} If `logisticOrderId`, `threadId`, `messageId` is missing.
|
|
1356
|
+
* @returns {Promise<void>} A promise resolving when the message updated.
|
|
1357
|
+
*/
|
|
1358
|
+
async function updateOrderLogisticThreadMessage({ logisticOrderId, threadId, messageId, customFieldValues, idType, }) {
|
|
1359
|
+
(0, parameters_validation_1.required)({ logisticOrderId, threadId, messageId });
|
|
1360
|
+
await (0, fetch_instance_1.enhancedFetch)({
|
|
1361
|
+
method: "PATCH",
|
|
1362
|
+
path: `/v2/shop/logistic-orders/${logisticOrderId}/threads/${threadId}/messages/${messageId}`,
|
|
1363
|
+
body: JSON.stringify({ customFieldValues, idType }),
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* 🚚 Creates a thread on a specific incident on a specific logistic order.
|
|
1368
|
+
*
|
|
1369
|
+
* This function creates a thread on a specific incident on a specific logistic order, identified by ``
|
|
1370
|
+
* `logisticOrderId`, incidentId, reasonCode, the parameters required and validated before the request is executed.
|
|
1371
|
+
*
|
|
1372
|
+
* 🛠 **Endpoint**: `POST /v2/shop/logistic-orders/${logisticOrderId}/incidents/${incidentId}/threads [ORDER-106]`
|
|
1373
|
+
*
|
|
1374
|
+
* | Parameter | Type | Required | Description |
|
|
1375
|
+
* |-------------------|---------------------------------------------------------|----------------------------|----------------------------------------------------------|
|
|
1376
|
+
* | `logisticOrderId` | `string` | ✅ | The ID of the logistic order |
|
|
1377
|
+
* | `incidentId` | `string` | ✅ | The ID of the incident |
|
|
1378
|
+
* | `customField` | `logisticOrderIncidentThreadsCustomFieldValueRequest[]` | ❌ | The custom fields to add to the created incident threads |
|
|
1379
|
+
* | `message` | `string` | ❌ | A message to add comments on the thread. |
|
|
1380
|
+
* | `name` | `string` | ❌ | The name of the thread |
|
|
1381
|
+
* | `reasonCode` | `string` | ✅ | The code indentifying the type of thread. |
|
|
1382
|
+
*
|
|
1383
|
+
* 📤 **Returns**:
|
|
1384
|
+
* A `Promise` resolving to a `CreateLogisticOrderIncidentThreadsResponse` object when the thread is created.
|
|
1385
|
+
*
|
|
1386
|
+
* 🛠 **Example usage**:
|
|
1387
|
+
* ```ts
|
|
1388
|
+
* await createLogisticOrderIncidentThreads({
|
|
1389
|
+
* logisticOrderId: "logisticOrder1",
|
|
1390
|
+
* incidentId: "logisticOrderLine1",
|
|
1391
|
+
* customField: [
|
|
1392
|
+
* {
|
|
1393
|
+
* customFieldValues: [
|
|
1394
|
+
* {
|
|
1395
|
+
* "customFieldId": "string",
|
|
1396
|
+
* "customFieldValue": "string",
|
|
1397
|
+
* }
|
|
1398
|
+
* ],
|
|
1399
|
+
* "idType": "DJUST_ID"
|
|
1400
|
+
* }
|
|
1401
|
+
* ],
|
|
1402
|
+
* message: "string",
|
|
1403
|
+
* name: "string",
|
|
1404
|
+
* reasonCode: "string"
|
|
1405
|
+
* });
|
|
1406
|
+
* ```
|
|
1407
|
+
*
|
|
1408
|
+
* @param {CreateLogisticOrderIncidentThreadsParams} params - The parameters for the request.
|
|
1409
|
+
* @throws {Error} If `logisticOrderId`, `incidentId`, `reasonCode` is missing.
|
|
1410
|
+
* @returns {Promise<CreateLogisticOrderIncidentThreadsResponse>} A promise resolving when the thread is created.
|
|
1411
|
+
*/
|
|
1412
|
+
async function createLogisticOrderIncidentThreads({ logisticOrderId, incidentId, customField, message, name, reasonCode, }) {
|
|
1413
|
+
(0, parameters_validation_1.required)({ logisticOrderId, incidentId, reasonCode });
|
|
1414
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
1415
|
+
method: "POST",
|
|
1416
|
+
path: `/v2/shop/logistic-orders/${logisticOrderId}/incidents/${incidentId}/threads`,
|
|
1417
|
+
body: JSON.stringify({ customField, message, name, reasonCode }),
|
|
1418
|
+
});
|
|
1419
|
+
return data;
|
|
1420
|
+
}
|
|
1421
|
+
/**
|
|
1422
|
+
* 🚚 Gets a specific thread of specific incident of a specific logistic order.
|
|
1423
|
+
*
|
|
1424
|
+
* This function retrieves a specific logistic order line's review, identified by
|
|
1425
|
+
* The `orderId`, `incidentId` and `threadId` parameters are mandatory and validated
|
|
1426
|
+
* before the request is executed.
|
|
1427
|
+
*
|
|
1428
|
+
* 🛠 **Endpoint**: `GET /v2/shop/logistic-orders/${logisticOrderId}/incidents/${incidentId}/threads/${threadId} [ORDER-510]`
|
|
1429
|
+
*
|
|
1430
|
+
* | Parameter | Type | Required | Description |
|
|
1431
|
+
* |-------------------|---------------------------------|------------|------------------------------------------------------------------------|
|
|
1432
|
+
* | `logisticOrderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the review. |
|
|
1433
|
+
* | `incidentId` | `string` | ✅ | The ID of the incident of which you want to retrieve the review. |
|
|
1434
|
+
* | `threadId` | `string` | ✅ | The ID of the thread of which you want to retrieve the review. |
|
|
1435
|
+
*
|
|
1436
|
+
* 📤 **Returns**:
|
|
1437
|
+
* A `Promise` resolving to a single `GetLogisticOrderIncidentThreadResponse` object representing the review of the thread.
|
|
1438
|
+
*
|
|
1439
|
+
* 🛠 **Example usage**:
|
|
1440
|
+
* ```ts
|
|
1441
|
+
* const review = await getLogisticOrderIncidentThread({
|
|
1442
|
+
* orderId: "logisticOrder1",
|
|
1443
|
+
* incidentId: "logisticOrderLine1",
|
|
1444
|
+
* threadId: "thread1",
|
|
1445
|
+
* });
|
|
1446
|
+
* ```
|
|
1447
|
+
*
|
|
1448
|
+
* @param {GetLogisticOrderIncidentThreadParams} params - The parameters for the request.
|
|
1449
|
+
* @throws {Error} If `logisticOrderId`, or `incidentId`, or `threadId` is missing.
|
|
1450
|
+
* @returns {Promise<GetLogisticOrderIncidentThreadResponse>} A promise resolving to a response containing the review of the thread.
|
|
1451
|
+
*/
|
|
1452
|
+
async function getLogisticOrderIncidentThread({ logisticOrderId, incidentId, threadId, }) {
|
|
1453
|
+
(0, parameters_validation_1.required)({ logisticOrderId, incidentId, threadId });
|
|
1454
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
1455
|
+
method: "GET",
|
|
1456
|
+
path: `/v2/shop/logistic-orders/${logisticOrderId}/incidents/${incidentId}/threads/${threadId}`,
|
|
1457
|
+
});
|
|
1458
|
+
return data;
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* 🚚 Creates messages for a specific incident thread of a specific logistic order.
|
|
1462
|
+
*
|
|
1463
|
+
* This function creates a thread on a specific incident on a specific logistic order, identified by
|
|
1464
|
+
* `logisticOrderId`, incidentId, threadId parameters are required and validated before the request is executed.
|
|
1465
|
+
*
|
|
1466
|
+
* 🛠 **Endpoint**: `POST /v2/shop/logistic-orders/${logisticOrderId}/incidents/${incidentId}/threads/messages [ORDER-103]`
|
|
1467
|
+
*
|
|
1468
|
+
* | Parameter | Type | Required | Description |
|
|
1469
|
+
* |-------------------|---------------------------------------------------------|------------|------------------------------------------------------------------------|
|
|
1470
|
+
* | `logisticOrderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the review. |
|
|
1471
|
+
* | `incidentId` | `string` | ✅ | The ID of the incident of which you want to retrieve the review. |
|
|
1472
|
+
* | `threadId` | `string` | ✅ | The ID of the thread of which you want to retrieve the review. |
|
|
1473
|
+
* | `body` | `string` | ❌ | The body of the message to be added to the thread. |
|
|
1474
|
+
* | `customField` | `logisticOrderIncidentThreadsCustomFieldValueRequest[]` | ❌ | The custom fields to add to the created incident threads messages |
|
|
1475
|
+
*
|
|
1476
|
+
* 📤 **Returns**:
|
|
1477
|
+
* A `Promise` resolving to a `CreateLogisticOrderIncidentThreadMessagesResponse` object when the message is created.
|
|
1478
|
+
*
|
|
1479
|
+
* 🛠 **Example usage**:
|
|
1480
|
+
* ```ts
|
|
1481
|
+
* await createLogisticOrderIncidentThreadMessages({
|
|
1482
|
+
* logisticOrderId: "logisticOrder1",
|
|
1483
|
+
* incidentId: "logisticOrderLine1",
|
|
1484
|
+
* threadId: "thread1",
|
|
1485
|
+
* body: "This is a message",
|
|
1486
|
+
* customField: {
|
|
1487
|
+
* customFieldValues: [
|
|
1488
|
+
* {
|
|
1489
|
+
* "customFieldId": "string",
|
|
1490
|
+
* "customFieldValue": "string"
|
|
1491
|
+
* }
|
|
1492
|
+
* ],
|
|
1493
|
+
* idType: "EXTERNAL_ID",
|
|
1494
|
+
* },
|
|
1495
|
+
* });
|
|
1496
|
+
* ```
|
|
1497
|
+
*
|
|
1498
|
+
* @param {CreateLogisticOrderIncidentThreadsParams} params - The parameters for the request.
|
|
1499
|
+
* @throws {Error} If `logisticOrderId`, or `incidentId`, or `threadId` is missing.
|
|
1500
|
+
* @returns {Promise<CreateLogisticOrderIncidentThreadsResponse>} A promise resolving when the message is created for the logistic order incident thread.
|
|
1501
|
+
*/
|
|
1502
|
+
async function createLogisticOrderIncidentThreadMessages({ logisticOrderId, incidentId, threadId, body, customField, }) {
|
|
1503
|
+
(0, parameters_validation_1.required)({ logisticOrderId, incidentId, threadId });
|
|
1504
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
1505
|
+
method: "POST",
|
|
1506
|
+
path: `/v2/shop/logistic-orders/${logisticOrderId}/incidents/${incidentId}/threads/${threadId}/messages`,
|
|
1507
|
+
body: JSON.stringify({ customField, body }),
|
|
1508
|
+
});
|
|
1509
|
+
return data;
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* 🚚 Updadate a message for a specific incident thread of a specific logistic order.
|
|
1513
|
+
*
|
|
1514
|
+
* This function allow to update a message of a thread on a specific incident on a specific logistic order
|
|
1515
|
+
* `logisticOrderId`, incidentId, threadId, messageId parameters are required and validated before the request is executed.
|
|
1516
|
+
*
|
|
1517
|
+
* 🛠 **Endpoint**: `POST /v2/shop/logistic-orders/${logisticOrderId}/incidents/${incidentId}/threads/${threadId}/messages/${messageId} [ORDER-221]`
|
|
1518
|
+
*
|
|
1519
|
+
* | Parameter | Type | Required | Description |
|
|
1520
|
+
* |-------------------|---------------------------------------------------------|------------|----------------------------------------------------------------------|
|
|
1521
|
+
* | `logisticOrderId` | `string` | ✅ | The ID of the logistic order of which you want to update |
|
|
1522
|
+
* | `incidentId` | `string` | ✅ | The ID of the incident of which you want to update |
|
|
1523
|
+
* | `threadId` | `string` | ✅ | The ID of the thread of which you want to update |
|
|
1524
|
+
* | `messageId` | `string` | ✅ | The ID of the message of the thread to update. |
|
|
1525
|
+
* | `body` | `string` | ❌ | The body of the message to update |
|
|
1526
|
+
* | `customField` | `logisticOrderIncidentThreadsCustomFieldValueRequest[]` | ❌ | The custom fields to update to the created incident threads messages |
|
|
1527
|
+
*
|
|
1528
|
+
* 📤 **Returns**:
|
|
1529
|
+
* A `Promise` resolving when the message is updated.
|
|
1530
|
+
*
|
|
1531
|
+
* 🛠 **Example usage**:
|
|
1532
|
+
* ```ts
|
|
1533
|
+
* await updateLogisticOrderIncidentThreadMessage({
|
|
1534
|
+
* logisticOrderId: "logisticOrder1",
|
|
1535
|
+
* incidentId: "logisticOrderLine1",
|
|
1536
|
+
* threadId: "thread1",
|
|
1537
|
+
* messageId: "message1",
|
|
1538
|
+
* body: "string",
|
|
1539
|
+
* customField: {
|
|
1540
|
+
* customFieldValues: [
|
|
1541
|
+
* {
|
|
1542
|
+
* "customFieldId": "string",
|
|
1543
|
+
* "customFieldValue": "string"
|
|
1544
|
+
* }
|
|
1545
|
+
* ],
|
|
1546
|
+
* idType: "EXTERNAL_ID",
|
|
1547
|
+
* }
|
|
1548
|
+
* });
|
|
1549
|
+
* ```
|
|
1550
|
+
*
|
|
1551
|
+
* @param {CreateLogisticOrderIncidentThreadsParams} params - The parameters for the request.
|
|
1552
|
+
* @throws {Error} If `logisticOrderId`, `incidentId`, `threadId`, `messageId` is missing.
|
|
1553
|
+
* @returns {Promise<void>} A promise resolving when the message is updated.
|
|
1554
|
+
*/
|
|
1555
|
+
async function updateLogisticOrderIncidentThreadMessage({ logisticOrderId, incidentId, threadId, messageId, customFieldValues, idType, }) {
|
|
1556
|
+
(0, parameters_validation_1.required)({ logisticOrderId, incidentId, threadId, messageId });
|
|
1557
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
1558
|
+
method: "PATCH",
|
|
1559
|
+
path: `/v2/shop/logistic-orders/${logisticOrderId}/incidents/${incidentId}/threads/${threadId}/messages/${messageId}`,
|
|
1560
|
+
body: JSON.stringify({ customFieldValues, idType }),
|
|
1561
|
+
});
|
|
1562
|
+
return data;
|
|
1563
|
+
}
|
|
1038
1564
|
/**
|
|
1039
1565
|
* 🚚 Gets a specific logistic order's review.
|
|
1040
1566
|
*
|
|
@@ -1115,7 +1641,7 @@ async function addLogisticOrderReview({ orderId, comment, grade, }) {
|
|
|
1115
1641
|
*
|
|
1116
1642
|
* This function retrieves all the thread reason types. No parameters for this request.
|
|
1117
1643
|
*
|
|
1118
|
-
* 🛠 **Endpoint**: `GET /v1/shop/threads/reason-types [
|
|
1644
|
+
* 🛠 **Endpoint**: `GET /v1/shop/threads/reason-types [THREAD-550]`
|
|
1119
1645
|
*
|
|
1120
1646
|
* 📤 **Returns**:
|
|
1121
1647
|
* A `Promise` resolving to a single `GetThreadReasonTypesResponse` object representing the array of reason types.
|
|
@@ -1141,7 +1667,7 @@ async function getThreadReasonTypes() {
|
|
|
1141
1667
|
* the `reasonType`. This parameter is mandatory and validated
|
|
1142
1668
|
* before the request is executed.
|
|
1143
1669
|
*
|
|
1144
|
-
* 🛠 **Endpoint**: `GET /v1/shop/threads/reason-types/${reasonType}/sub-reasons [
|
|
1670
|
+
* 🛠 **Endpoint**: `GET /v1/shop/threads/reason-types/${reasonType}/sub-reasons [THREAD-551]`
|
|
1145
1671
|
*
|
|
1146
1672
|
* | Parameter | Type | Required | Description |
|
|
1147
1673
|
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { AttributeObject } from "../../interfaces/models/attribute";
|
|
2
|
-
import { PageableParameters } from "../../interfaces/models/common";
|
|
3
2
|
import { OfferResponse } from "../../interfaces/models/offer";
|
|
4
3
|
import { PageProductVariantResponse, Product, ProductAutocomplete, ProductReviewDto, ProductReviewRatings, ProductReviewsSummary, SearchThumbnailsAndAggregation } from "../../interfaces/models/product";
|
|
5
4
|
import { SearchProduct } from "../../interfaces/models/searchProduct";
|
|
6
5
|
import { SupplierSimpleView } from "../../interfaces/models/supplier";
|
|
7
|
-
import { Order, PageableObject } from "../../interfaces/models/common";
|
|
6
|
+
import { Order, PageableObject, PageableParameters } from "../../interfaces/models/common";
|
|
8
7
|
/**
|
|
9
8
|
* Requests parameters type definitions
|
|
10
9
|
*/
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { AttributeObject } from "../../interfaces/models/attribute";
|
|
2
|
-
import { PageableParameters } from "../../interfaces/models/common";
|
|
3
2
|
import { OfferResponse } from "../../interfaces/models/offer";
|
|
4
3
|
import { PageProductVariantResponse, Product, ProductAutocomplete, ProductReviewDto, ProductReviewRatings, ProductReviewsSummary, SearchThumbnailsAndAggregation } from "../../interfaces/models/product";
|
|
5
4
|
import { SearchProduct } from "../../interfaces/models/searchProduct";
|
|
6
5
|
import { SupplierSimpleView } from "../../interfaces/models/supplier";
|
|
7
|
-
import { Order, PageableObject } from "../../interfaces/models/common";
|
|
6
|
+
import { Order, PageableObject, PageableParameters } from "../../interfaces/models/common";
|
|
8
7
|
/**
|
|
9
8
|
* Requests parameters type definitions
|
|
10
9
|
*/
|