@djust-b2b/djust-front-sdk 2.3.0 → 2.4.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
@@ -30,7 +30,7 @@ export declare const DjustSDK: {
30
30
  updateCommercialOrderShippingType({ orderId, shippingType, }: import("./interfaces").UpdateCommercialOrderShippingTypeParameters): Promise<void>;
31
31
  deleteCommercialOrder(commercialOrderId: string): Promise<void>;
32
32
  getCommercialOrderLines({ commercialOrderId, page, size, sort, supplierIds, productVariantIds, offerPriceIds, idType, locale, }: import("./interfaces").GetOrderCommercialLinesParameters): Promise<import("./interfaces").GetOrderCommercialLinesResponse>;
33
- updateCommercialOrderLines({ commercialOrderId, customFieldIdType, lineIdType, lineType, updateOrderCommercialLines, updateOrderLineIdType, updateOrderLineType, }: import("./interfaces").UpdateCommercialOrderLinesParameters): Promise<import("./interfaces").UpdateCommercialOrderLinesResponse>;
33
+ updateCommercialOrderLines({ commercialOrderId, customFieldIdType, lineIdType, lineType, updateOrderCommercialLines, metadata, }: import("./interfaces").UpdateCommercialOrderLinesParameters): Promise<import("./interfaces").UpdateCommercialOrderLinesResponse>;
34
34
  deleteCommercialOrderLines({ commercialOrderId, body, }: import("./interfaces").DeleteCommercialOrderLinesParameters): Promise<import("./interfaces").DeleteCommercialOrderLinesResponse>;
35
35
  punchoutOciCommercialOrder({ tenantConfigurationKey, commercialOrderId, locale, }: import("./interfaces").PunchoutOciCommercialOrderParameters): Promise<any>;
36
36
  getLogisticOrders({ approvalIds, locale, logisticStatus, incident, paymentOptions, connectedUserOnly, nbPreviewLines, page, size, sort, suppliersIds, creationDateFrom, creationDateTo, updateDateFrom, updateDateTo, }: import("./interfaces").GetLogisticOrdersParameters): Promise<import("./interfaces").GetLogisticOrdersResponse>;
@@ -80,10 +80,13 @@ export interface OrderLogisticLineDto {
80
80
  status: OrderLineStatus;
81
81
  }
82
82
  export interface OrderLogisticLineUpdate {
83
- customFieldValues: CustomFieldValueObject[];
83
+ customFieldValues: CustomFieldValueRequest[];
84
84
  id: string;
85
85
  quantity: number;
86
86
  updateAction: UpdateCartLineType;
87
+ metadata?: {
88
+ [key: string]: any;
89
+ };
87
90
  }
88
91
  export interface updateCommercialOrderLinesRequest {
89
92
  customFieldIdType?: IdType;
@@ -1,6 +1,6 @@
1
1
  import { Channel, Currency, IdType } from "../../interfaces/models/common";
2
2
  import { CustomFieldValueRequest } from "../../interfaces/models/custom-field";
3
- import { BrowserInfo, CardInformationDto, OrderCommercialDto, OrderIdType, OrderLogisticDto, OrderOrigin, PageOrderCommercialDto, PaymentCardInfo, PreauthorizationDto, OfferToDelete, OrderLogisticLineUpdate, OrderLineType, PageOrderCommercialLinesDto } from "../../interfaces/models/order";
3
+ import { BrowserInfo, CardInformationDto, OrderCommercialDto, OrderIdType, OrderLogisticDto, OrderOrigin, PageOrderCommercialDto, PaymentCardInfo, PreauthorizationDto, OfferToDelete, OrderLogisticLineUpdate, PageOrderCommercialLinesDto } from "../../interfaces/models/order";
4
4
  import { SingleWarningReportDto } from "../../interfaces/models/common";
5
5
  import { PaymentInfoRequest, PaymentOption, PaymentProvider } from "../../interfaces/models/payment";
6
6
  /**
@@ -121,8 +121,9 @@ export interface UpdateCommercialOrderLinesParameters {
121
121
  lineIdType?: IdType;
122
122
  lineType?: string;
123
123
  updateOrderCommercialLines?: OrderLogisticLineUpdate[];
124
- updateOrderLineIdType?: IdType;
125
- updateOrderLineType?: OrderLineType;
124
+ metadata?: {
125
+ [key: string]: any;
126
+ };
126
127
  }
127
128
  export interface GetCommercialOrderResponse extends OrderCommercialDto {
128
129
  }
@@ -134,9 +135,7 @@ export interface CreateCommercialOrderPreauthorizationResponse extends Preauthor
134
135
  }
135
136
  export interface UpdateOrderLogisticCustomFieldResponse extends OrderLogisticDto {
136
137
  }
137
- export interface DeleteCommercialOrderLinesResponse {
138
- singleWarningReportDtos: SingleWarningReportDto[];
138
+ export interface DeleteCommercialOrderLinesResponse extends Array<SingleWarningReportDto> {
139
139
  }
140
- export interface UpdateCommercialOrderLinesResponse {
141
- singleWarningReportDtos: SingleWarningReportDto[];
140
+ export interface UpdateCommercialOrderLinesResponse extends Array<SingleWarningReportDto> {
142
141
  }
@@ -543,8 +543,7 @@ export declare function getCommercialOrderLines({ commercialOrderId, page, size,
543
543
  * | `lineIdType` | `string` | ❌ | The line id type to use. |
544
544
  * | `lineType` | `string` | ❌ | The line type to use. |
545
545
  * | `updateOrderCommercialLines` | `OrderLogisticLineUpdate[]` | ❌ | Attributes to update. Can be empty object. |
546
- * | `updateOrderLineIdType` | `IdType` | ❌ | The line id type to use. |
547
- * | `updateOrderLineType` | `OrderLineType` | ❌ | The line type to use. |
546
+ * | `metadata` | `{ [key: string]: any }` | ❌ | Metadata to update. Can be empty object. |
548
547
  *
549
548
  * 📤 **Returns**:
550
549
  * A `Promise` resolving when the commercial order lines are successfully updated.
@@ -568,8 +567,9 @@ export declare function getCommercialOrderLines({ commercialOrderId, page, size,
568
567
  * updateAction: "ADD_QUANTITY"
569
568
  * }
570
569
  * ],
571
- * updateOrderLineIdType: "EXTERNAL_ID",
572
- * updateOrderLineType: "PRODUCT_VARIANT"
570
+ * metadata: {
571
+ * "key": "value"
572
+ * }
573
573
  * });
574
574
  * ```
575
575
  *
@@ -577,7 +577,7 @@ export declare function getCommercialOrderLines({ commercialOrderId, page, size,
577
577
  * @throws {Error} If `commercialOrderId` is missing.
578
578
  * @returns {Promise<UpdateCommercialOrderLinesResponse>} A promise resolving when the commercial order lines are successfully updated.
579
579
  */
580
- export declare function updateCommercialOrderLines({ commercialOrderId, customFieldIdType, lineIdType, lineType, updateOrderCommercialLines, updateOrderLineIdType, updateOrderLineType, }: UpdateCommercialOrderLinesParameters): Promise<UpdateCommercialOrderLinesResponse>;
580
+ export declare function updateCommercialOrderLines({ commercialOrderId, customFieldIdType, lineIdType, lineType, updateOrderCommercialLines, metadata, }: UpdateCommercialOrderLinesParameters): Promise<UpdateCommercialOrderLinesResponse>;
581
581
  /**
582
582
  * ❌ Deletes specific commercial order lines.
583
583
  *
@@ -742,8 +742,7 @@ async function getCommercialOrderLines({ commercialOrderId, page, size, sort, su
742
742
  * | `lineIdType` | `string` | ❌ | The line id type to use. |
743
743
  * | `lineType` | `string` | ❌ | The line type to use. |
744
744
  * | `updateOrderCommercialLines` | `OrderLogisticLineUpdate[]` | ❌ | Attributes to update. Can be empty object. |
745
- * | `updateOrderLineIdType` | `IdType` | ❌ | The line id type to use. |
746
- * | `updateOrderLineType` | `OrderLineType` | ❌ | The line type to use. |
745
+ * | `metadata` | `{ [key: string]: any }` | ❌ | Metadata to update. Can be empty object. |
747
746
  *
748
747
  * 📤 **Returns**:
749
748
  * A `Promise` resolving when the commercial order lines are successfully updated.
@@ -767,8 +766,9 @@ async function getCommercialOrderLines({ commercialOrderId, page, size, sort, su
767
766
  * updateAction: "ADD_QUANTITY"
768
767
  * }
769
768
  * ],
770
- * updateOrderLineIdType: "EXTERNAL_ID",
771
- * updateOrderLineType: "PRODUCT_VARIANT"
769
+ * metadata: {
770
+ * "key": "value"
771
+ * }
772
772
  * });
773
773
  * ```
774
774
  *
@@ -776,7 +776,7 @@ async function getCommercialOrderLines({ commercialOrderId, page, size, sort, su
776
776
  * @throws {Error} If `commercialOrderId` is missing.
777
777
  * @returns {Promise<UpdateCommercialOrderLinesResponse>} A promise resolving when the commercial order lines are successfully updated.
778
778
  */
779
- async function updateCommercialOrderLines({ commercialOrderId, customFieldIdType, lineIdType, lineType, updateOrderCommercialLines, updateOrderLineIdType, updateOrderLineType, }) {
779
+ async function updateCommercialOrderLines({ commercialOrderId, customFieldIdType, lineIdType, lineType, updateOrderCommercialLines, metadata, }) {
780
780
  (0, parameters_validation_1.required)({ commercialOrderId });
781
781
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
782
782
  method: "PUT",
@@ -786,8 +786,7 @@ async function updateCommercialOrderLines({ commercialOrderId, customFieldIdType
786
786
  lineIdType,
787
787
  lineType,
788
788
  updateOrderCommercialLines,
789
- updateOrderLineIdType,
790
- updateOrderLineType,
789
+ metadata,
791
790
  }),
792
791
  });
793
792
  return data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
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",