@djust-b2b/djust-front-sdk 2.17.0 → 2.17.2

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
@@ -44,7 +44,7 @@ export declare const DjustSDK: {
44
44
  updateCommercialOrderBillingInformation({ orderId, billingAddressId, }: import("./interfaces").UpdateCommercialOrderBillingInformationParameters): Promise<void>;
45
45
  setCommercialOrderStatusAsCreated({ orderId, paymentInfo, }: import("./interfaces").SetCommercialOrderStatusAsCreatedParameters): Promise<void>;
46
46
  setCommercialOrderStatusAsOnHold({ orderId, }: import("./interfaces").SetCommercialOrderStatusAsOnHoldParameters): Promise<void>;
47
- syncCommercialOrder(orderId: string): Promise<void>;
47
+ syncCommercialOrder(orderId: string): Promise<unknown>;
48
48
  getCommercialOrderPaymentPageUrl({ orderId, paymentOption, paymentProvider, }: import("./interfaces").GetCommercialOrderPaymentPageUrlParameters): Promise<string>;
49
49
  createCommercialOrderPreauthorization({ orderId, paymentProvider, authorId, browserInfo, ipAddress, paymentCardInfo, }: import("./interfaces").CreateCommercialOrderPreauthorizationParameters): Promise<import("./interfaces").CreateCommercialOrderPreauthorizationResponse>;
50
50
  updateCommercialOrderShippingAddress({ orderId, shippingAddressId, }: import("./interfaces").UpdateCommercialOrderShippingAddressParameters): Promise<void>;
@@ -101,7 +101,7 @@ export declare const DjustSDK: {
101
101
  createMasterQuote({ description, name, }: import("./interfaces").CreateMasterQuoteParameters): Promise<import("./interfaces").CreateMasterQuoteResponse>;
102
102
  deleteMasterQuote({ masterQuoteId, }: import("./interfaces").DeleteMasterQuoteParameters): Promise<void>;
103
103
  getMasterQuote({ masterQuoteId, }: import("./interfaces").GetMasterQuoteParameters): Promise<import("./interfaces").GetMasterQuoteResponse>;
104
- updateMasterQuote({ masterQuoteId, customFieldValues, masterQuoteDetailsToAdd, masterQuoteDetailsToRemove, }: import("./interfaces").UpdateMasterQuoteParameters): Promise<import("./interfaces").UpdateMasterQuoteResponse>;
104
+ updateMasterQuote({ masterQuoteId, customFieldValues, masterQuoteDetailsToAdd, masterQuoteDetailsToRemove, idType, }: import("./interfaces").UpdateMasterQuoteParameters): Promise<import("./interfaces").UpdateMasterQuoteResponse>;
105
105
  createSupplierQuotes({ billingAddressId, createSupplierQuoteRequests, masterQuoteId, supplierQuoteUrl, }: import("./interfaces").CreateSupplierQuotesParameters): Promise<import("./interfaces").CreateSupplierQuotesResponse>;
106
106
  getSupplierQuote({ supplierQuoteId, }: import("./interfaces").GetSupplierQuoteParameters): Promise<import("./interfaces").GetSupplierQuoteResponse>;
107
107
  acceptSupplierQuote({ supplierQuoteId, }: import("./interfaces").AcceptSupplierQuoteParameters): Promise<import("./interfaces").AcceptSupplierQuoteResponse>;
@@ -380,9 +380,9 @@ export declare function setCommercialOrderStatusAsOnHold({ orderId, }: SetCommer
380
380
  * ```
381
381
  *
382
382
  * @param {string} orderId - The ID of the commercial order to synchronize
383
- * @returns {Promise<void>} A promise resolving when the synchronization is triggered
383
+ * @returns {Promise<unknown>} A promise resolving when the synchronization is triggered
384
384
  */
385
- export declare function syncCommercialOrder(orderId: string): Promise<void>;
385
+ export declare function syncCommercialOrder(orderId: string): Promise<unknown>;
386
386
  /**
387
387
  * 🚚 Gets payment page url for a specific order.
388
388
  *
@@ -529,11 +529,11 @@ async function setCommercialOrderStatusAsOnHold({ orderId, }) {
529
529
  * ```
530
530
  *
531
531
  * @param {string} orderId - The ID of the commercial order to synchronize
532
- * @returns {Promise<void>} A promise resolving when the synchronization is triggered
532
+ * @returns {Promise<unknown>} A promise resolving when the synchronization is triggered
533
533
  */
534
534
  async function syncCommercialOrder(orderId) {
535
535
  (0, parameters_validation_1.required)({ orderId });
536
- await (0, fetch_instance_1.enhancedFetch)({
536
+ return await (0, fetch_instance_1.enhancedFetch)({
537
537
  method: "PUT",
538
538
  path: `/v1/shop/commercial-orders/${orderId}/sync`,
539
539
  body: JSON.stringify({}),
@@ -1,6 +1,6 @@
1
1
  import { MasterQuote, PageMasterQuote, SupplierQuoteDto, SupplierQuoteIdType } from "../../interfaces/models/quote";
2
2
  import { OrderCommercialDto } from "../../interfaces/models/order";
3
- import { PageableParameters } from "../../interfaces/models/common";
3
+ import { IdType, PageableParameters } from "../../interfaces/models/common";
4
4
  import { CustomFieldValueRequest } from "../../interfaces/models/custom-field";
5
5
  /**
6
6
  * Request parameters type definitions
@@ -30,6 +30,8 @@ export interface UpdateMasterQuoteParameters {
30
30
  quantity: number;
31
31
  }[];
32
32
  masterQuoteDetailsToRemove: string[];
33
+ /** Type des productVariantId dans masterQuoteDetailsToAdd (ex. EXTERNAL_ID pour utiliser des externalId). */
34
+ idType?: IdType;
33
35
  }
34
36
  export interface CreateSupplierQuotesParameters {
35
37
  billingAddressId?: string;
@@ -129,6 +129,7 @@ export declare function getMasterQuote({ masterQuoteId, }: GetMasterQuoteParamet
129
129
  * | `customFieldValues` | `{ customFieldId: string; customFieldValue?: string; }[]` | ❌ | Custom field values to update for the master quote. |
130
130
  * | `masterQuoteDetailsToAdd` | `{ productVariantId: string; quantity: number; }[]` | ❌ | Details to add to the master quote. |
131
131
  * | `masterQuoteDetailsToRemove` | `string[]` | ❌ | IDs of details to remove from the master quote. |
132
+ * | `idType` | `"DJUST_ID" \| "EXTERNAL_ID"` | ❌ | Query param: type for productVariantId and customField id. Default BUSINESS_ID (Swagger: DJUST_ID). |
132
133
  *
133
134
  * 📤 **Returns**:
134
135
  * A `Promise` resolving to an `UpdateMasterQuoteResponse` object, which contains the updated details of the master quote.
@@ -149,7 +150,7 @@ export declare function getMasterQuote({ masterQuoteId, }: GetMasterQuoteParamet
149
150
  * @throws {Error} If `masterQuoteId` is missing.
150
151
  * @returns {Promise<UpdateMasterQuoteResponse>} A promise resolving to the updated details of the master quote.
151
152
  */
152
- export declare function updateMasterQuote({ masterQuoteId, customFieldValues, masterQuoteDetailsToAdd, masterQuoteDetailsToRemove, }: UpdateMasterQuoteParameters): Promise<UpdateMasterQuoteResponse>;
153
+ export declare function updateMasterQuote({ masterQuoteId, customFieldValues, masterQuoteDetailsToAdd, masterQuoteDetailsToRemove, idType, }: UpdateMasterQuoteParameters): Promise<UpdateMasterQuoteResponse>;
153
154
  /**
154
155
  * ✏️ Creates supplier quotes.
155
156
  *
@@ -180,6 +180,7 @@ async function getMasterQuote({ masterQuoteId, }) {
180
180
  * | `customFieldValues` | `{ customFieldId: string; customFieldValue?: string; }[]` | ❌ | Custom field values to update for the master quote. |
181
181
  * | `masterQuoteDetailsToAdd` | `{ productVariantId: string; quantity: number; }[]` | ❌ | Details to add to the master quote. |
182
182
  * | `masterQuoteDetailsToRemove` | `string[]` | ❌ | IDs of details to remove from the master quote. |
183
+ * | `idType` | `"DJUST_ID" \| "EXTERNAL_ID"` | ❌ | Query param: type for productVariantId and customField id. Default BUSINESS_ID (Swagger: DJUST_ID). |
183
184
  *
184
185
  * 📤 **Returns**:
185
186
  * A `Promise` resolving to an `UpdateMasterQuoteResponse` object, which contains the updated details of the master quote.
@@ -200,11 +201,12 @@ async function getMasterQuote({ masterQuoteId, }) {
200
201
  * @throws {Error} If `masterQuoteId` is missing.
201
202
  * @returns {Promise<UpdateMasterQuoteResponse>} A promise resolving to the updated details of the master quote.
202
203
  */
203
- async function updateMasterQuote({ masterQuoteId, customFieldValues, masterQuoteDetailsToAdd, masterQuoteDetailsToRemove, }) {
204
+ async function updateMasterQuote({ masterQuoteId, customFieldValues, masterQuoteDetailsToAdd, masterQuoteDetailsToRemove, idType, }) {
204
205
  (0, parameters_validation_1.required)({ masterQuoteId });
205
206
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
206
207
  method: "PUT",
207
208
  path: `/v1/shop/master-quotes/${masterQuoteId}`,
209
+ params: idType ? { idType } : {},
208
210
  body: JSON.stringify({
209
211
  masterQuoteDetailsToAdd,
210
212
  masterQuoteDetailsToRemove,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "2.17.0",
3
+ "version": "2.17.2",
4
4
  "description": "DJUST Front SDK is a versatile JavaScript Software Development Kit (SDK)",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",