@djust-b2b/djust-front-sdk 2.8.0 → 2.9.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/lib/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare const DjustSDK: {
|
|
|
32
32
|
getIncidentsV2({ customerAccountIds, linkedType, ids, status, idType, page, size, sort, supplierIds, }: import("./services/incident/definitions").getIncidentsParameters): Promise<import("./services/incident/definitions").getIncidentsResponse>;
|
|
33
33
|
getCommercialOrders({ locale, nbPreviewLines, page, size, sort, connectedUserOnly, customerAccountIds, isValidated, }: import("./interfaces").GetCommercialOrdersParameters): Promise<import("./interfaces").GetCommercialOrdersResponse>;
|
|
34
34
|
createCommercialOrder({ nbPreviewLines, channel, customFields, locale, origin, originId, paymentInfo, }: import("./interfaces").CreateCommercialOrderParameters): Promise<import("./interfaces").CreateCommercialOrderResponse>;
|
|
35
|
-
createCommercialOrderV2({ customFieldIdType, customFields, }: import("./interfaces").CreateCommercialOrderV2Parameters): Promise<import("./interfaces").CreateCommercialOrderV2Response>;
|
|
35
|
+
createCommercialOrderV2({ customFieldIdType, customFields, isFull, sourceId, sourceType, }: import("./interfaces").CreateCommercialOrderV2Parameters): Promise<import("./interfaces").CreateCommercialOrderV2Response>;
|
|
36
36
|
getCommercialOrder({ orderId, idType, locale, nbPreviewLines, }: import("./interfaces").GetCommercialOrderParameters): Promise<import("./interfaces").GetCommercialOrderResponse>;
|
|
37
37
|
updateCommercialOrder({ commercialOrderId, customFieldIdType, customFields, }: import("./interfaces").UpdateCommercialOrderParameters): Promise<void>;
|
|
38
38
|
createCommercialOrderCardRegistration({ orderId, paymentProvider, currency, }: import("./interfaces").CreateCommercialOrderCardRegistrationParameters): Promise<import("./interfaces").CreateCommercialOrderCardRegistrationResponse>;
|
|
@@ -39,6 +39,9 @@ export interface CreateCommercialOrderParameters {
|
|
|
39
39
|
export interface CreateCommercialOrderV2Parameters {
|
|
40
40
|
customFieldIdType?: IdType;
|
|
41
41
|
customFields?: CustomFieldValueRequest[];
|
|
42
|
+
isFull?: boolean;
|
|
43
|
+
sourceId?: string;
|
|
44
|
+
sourceType?: string;
|
|
42
45
|
}
|
|
43
46
|
export interface UpdateCommercialOrderParameters extends CreateCommercialOrderV2Parameters {
|
|
44
47
|
commercialOrderId: string;
|
|
@@ -85,6 +85,9 @@ export declare function createCommercialOrder({ nbPreviewLines, channel, customF
|
|
|
85
85
|
* |----------------------|--------------------------------------|-----------------------------------------------------------------------|
|
|
86
86
|
* | `customFieldIdType` | `IdType` | ❌ | The custom field id type to use. |
|
|
87
87
|
* | `customFields` | `CustomFieldValueRequest[]` | ❌ | The custom fields to add to the created commercial order. |
|
|
88
|
+
* | `isFull` | `boolean` | ❌ | Whether the order is full or not. |
|
|
89
|
+
* | `sourceId` | `string` | ❌ | The source ID for the order. |
|
|
90
|
+
* | `sourceType` | `string` | ❌ | The type of source (e.g., "OPERATION"). |
|
|
88
91
|
*
|
|
89
92
|
* 📤 **Returns**:
|
|
90
93
|
* A `Promise` resolving to a single `CreateCommercialOrderV2Response` object representing the created commercial orders [ORDER-108].
|
|
@@ -92,20 +95,23 @@ export declare function createCommercialOrder({ nbPreviewLines, channel, customF
|
|
|
92
95
|
* 🛠 **Example usage**:
|
|
93
96
|
* ```ts
|
|
94
97
|
* const orders = await createCommercialOrderV2({
|
|
95
|
-
* customFieldIdType: "
|
|
98
|
+
* customFieldIdType: "EXTERNAL_ID",
|
|
96
99
|
* customFields: [
|
|
97
100
|
* {
|
|
98
101
|
* "customFieldId": "string",
|
|
99
102
|
* "customFieldValue": "string"
|
|
100
103
|
* }
|
|
101
104
|
* ],
|
|
105
|
+
* isFull: true,
|
|
106
|
+
* sourceId: "OPE-UK-SUMMER-2025",
|
|
107
|
+
* sourceType: "OPERATION"
|
|
102
108
|
* });
|
|
103
109
|
* ```
|
|
104
110
|
*
|
|
105
111
|
* @param {CreateCommercialOrderV2Parameters} params - The body of the request.
|
|
106
112
|
* @returns {Promise<CreateCommercialOrderV2Response>} A promise resolving to the response containing the created commercial orders.
|
|
107
113
|
*/
|
|
108
|
-
export declare function createCommercialOrderV2({ customFieldIdType, customFields, }: CreateCommercialOrderV2Parameters): Promise<CreateCommercialOrderV2Response>;
|
|
114
|
+
export declare function createCommercialOrderV2({ customFieldIdType, customFields, isFull, sourceId, sourceType, }: CreateCommercialOrderV2Parameters): Promise<CreateCommercialOrderV2Response>;
|
|
109
115
|
/**
|
|
110
116
|
* 🚚 Gets a specific commercial order.
|
|
111
117
|
*
|
|
@@ -143,6 +143,9 @@ async function createCommercialOrder({ nbPreviewLines, channel, customFields, lo
|
|
|
143
143
|
* |----------------------|--------------------------------------|-----------------------------------------------------------------------|
|
|
144
144
|
* | `customFieldIdType` | `IdType` | ❌ | The custom field id type to use. |
|
|
145
145
|
* | `customFields` | `CustomFieldValueRequest[]` | ❌ | The custom fields to add to the created commercial order. |
|
|
146
|
+
* | `isFull` | `boolean` | ❌ | Whether the order is full or not. |
|
|
147
|
+
* | `sourceId` | `string` | ❌ | The source ID for the order. |
|
|
148
|
+
* | `sourceType` | `string` | ❌ | The type of source (e.g., "OPERATION"). |
|
|
146
149
|
*
|
|
147
150
|
* 📤 **Returns**:
|
|
148
151
|
* A `Promise` resolving to a single `CreateCommercialOrderV2Response` object representing the created commercial orders [ORDER-108].
|
|
@@ -150,26 +153,32 @@ async function createCommercialOrder({ nbPreviewLines, channel, customFields, lo
|
|
|
150
153
|
* 🛠 **Example usage**:
|
|
151
154
|
* ```ts
|
|
152
155
|
* const orders = await createCommercialOrderV2({
|
|
153
|
-
* customFieldIdType: "
|
|
156
|
+
* customFieldIdType: "EXTERNAL_ID",
|
|
154
157
|
* customFields: [
|
|
155
158
|
* {
|
|
156
159
|
* "customFieldId": "string",
|
|
157
160
|
* "customFieldValue": "string"
|
|
158
161
|
* }
|
|
159
162
|
* ],
|
|
163
|
+
* isFull: true,
|
|
164
|
+
* sourceId: "OPE-UK-SUMMER-2025",
|
|
165
|
+
* sourceType: "OPERATION"
|
|
160
166
|
* });
|
|
161
167
|
* ```
|
|
162
168
|
*
|
|
163
169
|
* @param {CreateCommercialOrderV2Parameters} params - The body of the request.
|
|
164
170
|
* @returns {Promise<CreateCommercialOrderV2Response>} A promise resolving to the response containing the created commercial orders.
|
|
165
171
|
*/
|
|
166
|
-
async function createCommercialOrderV2({ customFieldIdType, customFields, }) {
|
|
172
|
+
async function createCommercialOrderV2({ customFieldIdType, customFields, isFull, sourceId, sourceType, }) {
|
|
167
173
|
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
168
174
|
method: "POST",
|
|
169
175
|
path: `/v2/shop/commercial-orders`,
|
|
170
176
|
body: JSON.stringify({
|
|
171
177
|
customFieldIdType,
|
|
172
178
|
customFields,
|
|
179
|
+
isFull,
|
|
180
|
+
sourceId,
|
|
181
|
+
sourceType,
|
|
173
182
|
}),
|
|
174
183
|
});
|
|
175
184
|
return data;
|