@djust-b2b/djust-front-sdk 2.13.0 → 2.14.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 CHANGED
@@ -20,6 +20,7 @@ export declare const DjustSDK: {
20
20
  getPaymentDetails({ details, }: import("./services/payment/definitions").GetPaymentDetailsRequest): Promise<import("./services/payment/definitions").GetPaymentDetailsResponse>;
21
21
  getPaymentMethods({ reference, countryCode, referenceType, locale, }: import("./services/payment/definitions").GetPaymentMethodsRequest): Promise<import("./services/payment/definitions").GetPaymentMethodsResponse>;
22
22
  deleteStoredPaymentMethodById({ storedPaymentMethodId, }: import("./services/payment/definitions").DeleteStoredPaymentMethodByIdRequest): Promise<void>;
23
+ precheckPurchaseCardL3({ reference, referenceType, }: import("./services/payment/definitions").PrecheckPurchaseCardL3Request): Promise<import("./services/payment/definitions").PrecheckPurchaseCardL3Response>;
23
24
  getCustomFields(params: import("./services/custom-field/definitions").GetCustomFieldParameters): Promise<import("./services/custom-field/definitions").GetCustomFieldResponse>;
24
25
  postMediaCustomField(params: import("./services/custom-field/definitions").PostMediaCustomFieldParameters): Promise<string>;
25
26
  getMediaUrl(params: import("./services/custom-field/definitions").GetMediaUrlParameters): Promise<string>;
@@ -72,7 +72,7 @@ export interface OfferInventory {
72
72
  minStockAlert: number;
73
73
  minShippingPrice: number;
74
74
  minShippingPriceAdditional: number;
75
- minShippingType: number;
75
+ minShippingType: string;
76
76
  minShippingZone: string;
77
77
  leadTimeToShip: number;
78
78
  customFieldValues: CustomFieldValueDto[];
@@ -125,3 +125,24 @@ export interface DeliveryTime {
125
125
  earliestDeliveryDate: string;
126
126
  latestDeliveryDate: string;
127
127
  }
128
+ export interface ProductVariantOfferCustomField {
129
+ externalId: string;
130
+ id: string;
131
+ name: {
132
+ [key: string]: string;
133
+ };
134
+ type: string;
135
+ }
136
+ export interface ProductVariantOfferCustomFieldValue {
137
+ customField: ProductVariantOfferCustomField;
138
+ value: unknown;
139
+ }
140
+ export interface ProductVariantOfferInventory extends Omit<OfferInventory, "customFieldValues"> {
141
+ customFieldValues: ProductVariantOfferCustomFieldValue[];
142
+ }
143
+ export interface ProductVariantOfferResponse {
144
+ estimatedDeliveryDates: DeliveryDates[];
145
+ offerInventory: ProductVariantOfferInventory;
146
+ offerPrices: OfferPriceResponse[];
147
+ supplier: SupplierResponse;
148
+ }
@@ -69,14 +69,19 @@ interface OrderPriceDto {
69
69
  export interface OrderLogisticLineDto {
70
70
  confirmedQuantity: number;
71
71
  customFieldValues: CustomFieldValueObject[];
72
+ externalId: string;
73
+ externalSource: ExternalSource;
72
74
  id: string;
73
75
  incidentDeclared: boolean;
74
76
  offerCustomFieldSnapshotDtos: OfferCustomFieldValueSnapshot[];
77
+ offerInventorySnapshotDto: OrderLogisticLineOfferInventoryDto;
78
+ offerPriceSnapshotDto: OrderCommercialLineOfferPriceDto;
75
79
  orderLogisticLinePriceDto: OrderLogisticLinePriceDto;
76
80
  orderLogisticLineProductDto: OrderLogisticLineProductDto;
77
81
  orderLogisticLineProductVariantDto: OrderLogisticLineProductVariantDto;
78
82
  paymentStatus: OrderLogisticLinePaymentStatus;
79
83
  quantity: number;
84
+ quoteLineExternalId: string;
80
85
  status: OrderLineStatus;
81
86
  }
82
87
  export interface OrderLogisticLineUpdate {
@@ -96,7 +101,7 @@ export interface updateCommercialOrderLinesRequest {
96
101
  updateOrderLineIdType?: IdType;
97
102
  updateOrderLineType?: string;
98
103
  }
99
- interface OfferCustomFieldSnapshot {
104
+ export interface OfferCustomFieldSnapshot {
100
105
  externalId: string;
101
106
  externalSource: string;
102
107
  mandatory: boolean;
@@ -108,10 +113,40 @@ interface OfferCustomFieldSnapshot {
108
113
  status: string;
109
114
  type: string;
110
115
  }
111
- interface OfferCustomFieldValueSnapshot {
116
+ export interface OfferCustomFieldValueSnapshot {
112
117
  offerCustomFieldSnapshotDto: OfferCustomFieldSnapshot;
113
118
  value: string;
114
119
  }
120
+ interface OrderLogisticLineOfferInventoryCustomFieldSnapshot {
121
+ externalId: string;
122
+ externalSource: string;
123
+ mandatory: boolean;
124
+ names: {
125
+ [key: string]: string;
126
+ };
127
+ role: string;
128
+ sealedTarget: string;
129
+ status: string;
130
+ type: string;
131
+ }
132
+ interface OrderLogisticLineOfferInventoryCustomFieldValueSnapshot {
133
+ customFieldSnapshotDto: OrderLogisticLineOfferInventoryCustomFieldSnapshot;
134
+ typedValue: unknown;
135
+ }
136
+ interface OrderLogisticLineOfferInventoryDto {
137
+ currency: Currency;
138
+ customFieldValueSnapshots: OrderLogisticLineOfferInventoryCustomFieldValueSnapshot[];
139
+ externalSource: ExternalSource;
140
+ maxOrderQuantity: number;
141
+ minOrderQuantity: number;
142
+ offerInventoryExternalId: string;
143
+ packingType: PackingType;
144
+ productTaxCode: string;
145
+ productTaxRate: number;
146
+ quantityPerItem: number;
147
+ shippingTaxCode: string;
148
+ shippingTaxRate: number;
149
+ }
115
150
  type OrderLogisticLineProductDto = {
116
151
  brand: string;
117
152
  classificationCategory: string;
@@ -140,7 +175,7 @@ type OrderLogisticLineProductDto = {
140
175
  * @deprecated
141
176
  */
142
177
  navigationCategories: string[];
143
- productAttributeValues: OrderLogisticLineAttributeValue;
178
+ productAttributeValues: OrderLogisticLineAttributeValue[];
144
179
  productUnit: string;
145
180
  sku: string;
146
181
  /**
@@ -186,7 +221,7 @@ interface TaxInformation {
186
221
  shippingTaxCode: string;
187
222
  shippingTaxRate: number;
188
223
  }
189
- interface OrderLogisticLineAttributeValue {
224
+ export interface OrderLogisticLineAttributeValue {
190
225
  /**
191
226
  * @deprecated
192
227
  */
@@ -414,6 +449,8 @@ export interface OrderCommercialLineOfferInventoryDto extends ThreadCustomFiedVa
414
449
  currency: string;
415
450
  customFieldValueSnapshots: OrderCommercialLineCustomFieldValuesDto[];
416
451
  externalSource: string;
452
+ maxOrderQuantity: number | null;
453
+ minOrderQuantity: number;
417
454
  offerInventoryExternalId: string;
418
455
  packingType: string;
419
456
  productTaxCode: string;
@@ -12,6 +12,7 @@ export interface SupplierSimpleView {
12
12
  }
13
13
  export interface SupplierResponse {
14
14
  customFieldValues: CustomFieldValueObject[];
15
+ externalId: string;
15
16
  id: string;
16
17
  name: string;
17
18
  returnPolicy: string;
@@ -63,3 +63,16 @@ export interface GetPaymentMethodsResponse {
63
63
  export interface DeleteStoredPaymentMethodByIdRequest {
64
64
  storedPaymentMethodId: string;
65
65
  }
66
+ export interface PrecheckPurchaseCardL3Request {
67
+ reference: string;
68
+ referenceType?: PaymentReferenceType;
69
+ }
70
+ export interface PrecheckPurchaseCardL3Response {
71
+ ready: boolean;
72
+ missingFields?: {
73
+ scope: string;
74
+ field: string;
75
+ path: string;
76
+ source: string;
77
+ }[];
78
+ }
@@ -1,4 +1,4 @@
1
- import { GetPaymentDetailsRequest, GetPaymentDetailsResponse, DeleteStoredPaymentMethodByIdRequest, GetPaymentMethodsRequest, GetPaymentMethodsResponse, InitPaymentRequest, InitPaymentResponse } from "./definitions";
1
+ import { GetPaymentDetailsRequest, GetPaymentDetailsResponse, DeleteStoredPaymentMethodByIdRequest, GetPaymentMethodsRequest, GetPaymentMethodsResponse, InitPaymentRequest, InitPaymentResponse, PrecheckPurchaseCardL3Request, PrecheckPurchaseCardL3Response } from "./definitions";
2
2
  /**
3
3
  * 💳 Initializes a payment transaction.
4
4
  *
@@ -126,3 +126,24 @@ export declare function getPaymentMethods({ reference, countryCode, referenceTyp
126
126
  * @returns {Promise<void>} A promise resolving when the stored payment method is successfully deleted
127
127
  */
128
128
  export declare function deleteStoredPaymentMethodById({ storedPaymentMethodId, }: DeleteStoredPaymentMethodByIdRequest): Promise<void>;
129
+ /**
130
+ * 💳 Prechecks a purchase card L3.
131
+ *
132
+ * This endpoint prechecks a purchase card L3.
133
+ * The `reference` parameter is mandatory and validated before the request is executed.
134
+ *
135
+ * 🛠 **Endpoint**: `GET /v1/shop/payments/precheck` [PAY-502]
136
+ *
137
+ * | Parameter | Type | Required | Description |
138
+ * |----------------|----------|----------|------------------------------------------------|
139
+ * | `reference` | `string` | ✅ | The payment reference identifier. |
140
+ * | `referenceType`| `string` | ❌ | The type of reference. |
141
+ *
142
+ * 📤 **Returns**:
143
+ * A `Promise` resolving to a `PrecheckPurchaseCardL3Response` containing the result of the precheck.
144
+ *
145
+ * @param {PrecheckPurchaseCardL3Request} params - The parameters for the precheck
146
+ * @throws {Error} If `reference` is missing
147
+ * @returns {Promise<PrecheckPurchaseCardL3Response>} A promise resolving to the response containing the result of the precheck
148
+ */
149
+ export declare function precheckPurchaseCardL3({ reference, referenceType, }: PrecheckPurchaseCardL3Request): Promise<PrecheckPurchaseCardL3Response>;
@@ -4,6 +4,7 @@ exports.initPayment = initPayment;
4
4
  exports.getPaymentDetails = getPaymentDetails;
5
5
  exports.getPaymentMethods = getPaymentMethods;
6
6
  exports.deleteStoredPaymentMethodById = deleteStoredPaymentMethodById;
7
+ exports.precheckPurchaseCardL3 = precheckPurchaseCardL3;
7
8
  const parameters_validation_1 = require("../../helpers/parameters-validation");
8
9
  const fetch_instance_1 = require("../../settings/fetch-instance");
9
10
  /**
@@ -184,3 +185,35 @@ async function deleteStoredPaymentMethodById({ storedPaymentMethodId, }) {
184
185
  path: `/v1/shop/payments/stored-payment-methods/${storedPaymentMethodId}`,
185
186
  });
186
187
  }
188
+ /**
189
+ * 💳 Prechecks a purchase card L3.
190
+ *
191
+ * This endpoint prechecks a purchase card L3.
192
+ * The `reference` parameter is mandatory and validated before the request is executed.
193
+ *
194
+ * 🛠 **Endpoint**: `GET /v1/shop/payments/precheck` [PAY-502]
195
+ *
196
+ * | Parameter | Type | Required | Description |
197
+ * |----------------|----------|----------|------------------------------------------------|
198
+ * | `reference` | `string` | ✅ | The payment reference identifier. |
199
+ * | `referenceType`| `string` | ❌ | The type of reference. |
200
+ *
201
+ * 📤 **Returns**:
202
+ * A `Promise` resolving to a `PrecheckPurchaseCardL3Response` containing the result of the precheck.
203
+ *
204
+ * @param {PrecheckPurchaseCardL3Request} params - The parameters for the precheck
205
+ * @throws {Error} If `reference` is missing
206
+ * @returns {Promise<PrecheckPurchaseCardL3Response>} A promise resolving to the response containing the result of the precheck
207
+ */
208
+ async function precheckPurchaseCardL3({ reference, referenceType, }) {
209
+ (0, parameters_validation_1.required)({ reference });
210
+ const { data } = await (0, fetch_instance_1.enhancedFetch)({
211
+ method: "GET",
212
+ path: `/v1/shop/payments/precheck`,
213
+ params: {
214
+ reference,
215
+ referenceType,
216
+ },
217
+ });
218
+ return data;
219
+ }
@@ -1,5 +1,5 @@
1
1
  import { AttributeObject } from "../../interfaces/models/attribute";
2
- import { OfferResponse } from "../../interfaces/models/offer";
2
+ import { OfferResponse, ProductVariantOfferResponse } from "../../interfaces/models/offer";
3
3
  import { PageProductVariantResponse, Product, ProductAutocomplete, ProductReviewDto, ProductReviewRatings, ProductReviewsSummary, SearchThumbnailsAndAggregation } from "../../interfaces/models/product";
4
4
  import { SearchProduct } from "../../interfaces/models/searchProduct";
5
5
  import { SupplierSimpleView } from "../../interfaces/models/supplier";
@@ -121,7 +121,7 @@ export interface SearchProductsResponse extends Array<ProductAutocomplete> {
121
121
  }
122
122
  export interface GetProductVariantSuppliersResponse extends Array<SupplierSimpleView> {
123
123
  }
124
- export interface GetProductVariantOffersResponse extends Array<OfferResponse> {
124
+ export interface GetProductVariantOffersResponse extends Array<ProductVariantOfferResponse> {
125
125
  }
126
126
  export interface GetRelatedProductsResponse extends SearchThumbnailsAndAggregation {
127
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "2.13.0",
3
+ "version": "2.14.1",
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",