@djust-b2b/djust-front-sdk 1.7.5 → 1.7.7

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
@@ -23,7 +23,7 @@ export declare const DjustSDK: {
23
23
  }>) => void;
24
24
  getCommercialOrders({ locale, nbPreviewLines, }: import("./interfaces").GetCommercialOrdersParameters): Promise<import("./interfaces").GetCommercialOrdersResponse>;
25
25
  createCommercialOrder({ nbPreviewLines, channel, customFields, locale, originId, paymentInfo, }: import("./interfaces").CreateCommercialOrderParameters): Promise<import("./interfaces").CreateCommercialOrderResponse>;
26
- getCommercialOrder({ orderId, locale, }: import("./interfaces").GetCommercialOrderParameters): Promise<import("./interfaces").GetCommercialOrderResponse>;
26
+ getCommercialOrder({ orderId, idType, locale, nbPreviewLines, }: import("./interfaces").GetCommercialOrderParameters): Promise<import("./interfaces").GetCommercialOrderResponse>;
27
27
  updateCommercialOrderBillingInformation({ orderId, billingAddressId, }: import("./interfaces").UpdateCommercialOrderBillingInformationParameters): Promise<void>;
28
28
  setCommercialOrderStatusAsCreated({ orderId, paymentInfo, }: import("./interfaces").SetCommercialOrderStatusAsCreatedParameters): Promise<void>;
29
29
  setCommercialOrderStatusAsOnHold({ orderId, }: import("./interfaces").SetCommercialOrderStatusAsOnHoldParameters): Promise<void>;
@@ -31,11 +31,11 @@ export declare const DjustSDK: {
31
31
  updateCommercialOrderShippingAddress({ orderId, shippingAddressId, }: import("./interfaces").UpdateCommercialOrderShippingAddressParameters): Promise<void>;
32
32
  updateCommercialOrderShippingInformation({ orderId, shippingAddressId, shippingType, }: import("./interfaces").UpdateCommercialOrderShippingInformationParameters): Promise<void>;
33
33
  updateCommercialOrderShippingType({ orderId, shippingType, }: import("./interfaces").UpdateCommercialOrderShippingTypeParameters): Promise<void>;
34
+ updateLogisticOrderCustomFields({ orderLogisticId, lines, }: import("./interfaces").UpdateOrderLogisticCustomFieldParameters): Promise<void>;
34
35
  getLogisticOrders({ approvalIds, locale, logisticStatus, incident, paymentOptions, nbPreviewLines, page, size, sort, }: import("./interfaces").GetLogisticOrdersParameters): Promise<import("./interfaces").GetLogisticOrdersResponse>;
35
36
  getLogisticOrderCustomFields({ customFieldIds, page, size, sort, }: import("./interfaces").GetLogisticOrderCustomFieldsParameters): Promise<import("./interfaces").GetLogisticOrderCustomFieldsResponse>;
36
37
  getLogisticOrderLineCustomFields({ customFieldIds, page, size, sort, }: import("./interfaces").GetLogisticOrderLineCustomFieldsParameters): Promise<import("./interfaces").GetLogisticOrderLineCustomFieldsResponse>;
37
38
  getLogisticOrder({ orderId, locale, nbPreviewLines, }: import("./interfaces").GetLogisticOrderParameters): Promise<import("./interfaces").GetLogisticOrderResponse>;
38
- updateLogisticOrderCustomFields({ orderId, locale, nbPreviewLines, customFields, }: import("./interfaces").UpdateLogisticOrderCustomFieldsParameters): Promise<import("./interfaces").UpdateLogisticOrderCustomFieldsResponse>;
39
39
  getLogisticOrderAccountingDocuments({ orderId, }: import("./interfaces").GetLogisticOrderAccountingDocumentsParameters): Promise<import("./interfaces").GetLogisticOrderAccountingDocumentsResponse>;
40
40
  getLogisticOrderAccountingDocumentUrl({ orderId, documentId, }: import("./interfaces").GetLogisticOrderAccountingDocumentUrlParameters): Promise<string[]>;
41
41
  approveLogisticOrder({ orderId, locale, nbPreviewLines, }: import("./interfaces").ApproveLogisticOrderParameters): Promise<import("./interfaces").ApproveLogisticOrderResponse>;
package/lib/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
37
  };
@@ -53,6 +53,16 @@ export interface UpdateCommercialOrderShippingTypeParameters {
53
53
  orderId: string;
54
54
  shippingType: string;
55
55
  }
56
+ export interface UpdateCustomFields {
57
+ id: string;
58
+ quantity: number;
59
+ updateAction: string;
60
+ customFields: CustomFieldValueRequest[];
61
+ }
62
+ export interface UpdateOrderLogisticCustomFieldParameters {
63
+ orderLogisticId: string;
64
+ lines: UpdateCustomFields[];
65
+ }
56
66
  /**
57
67
  * Response type definitions
58
68
  */
@@ -1,4 +1,4 @@
1
- import { CreateCommercialOrderParameters, CreateCommercialOrderResponse, GetCommercialOrderParameters, GetCommercialOrderPaymentPageUrlParameters, GetCommercialOrderResponse, GetCommercialOrdersParameters, GetCommercialOrdersResponse, SetCommercialOrderStatusAsCreatedParameters, SetCommercialOrderStatusAsOnHoldParameters, UpdateCommercialOrderBillingInformationParameters, UpdateCommercialOrderShippingAddressParameters, UpdateCommercialOrderShippingInformationParameters, UpdateCommercialOrderShippingTypeParameters } from "./definitions";
1
+ import { CreateCommercialOrderParameters, CreateCommercialOrderResponse, GetCommercialOrderParameters, GetCommercialOrderPaymentPageUrlParameters, GetCommercialOrderResponse, GetCommercialOrdersParameters, GetCommercialOrdersResponse, SetCommercialOrderStatusAsCreatedParameters, SetCommercialOrderStatusAsOnHoldParameters, UpdateCommercialOrderBillingInformationParameters, UpdateCommercialOrderShippingAddressParameters, UpdateCommercialOrderShippingInformationParameters, UpdateCommercialOrderShippingTypeParameters, UpdateOrderLogisticCustomFieldParameters } from "./definitions";
2
2
  /**
3
3
  * Get commercial orders
4
4
  */
@@ -10,7 +10,7 @@ export declare function createCommercialOrder({ nbPreviewLines, channel, customF
10
10
  /**
11
11
  * Get commercial order
12
12
  */
13
- export declare function getCommercialOrder({ orderId, locale, }: GetCommercialOrderParameters): Promise<GetCommercialOrderResponse>;
13
+ export declare function getCommercialOrder({ orderId, idType, locale, nbPreviewLines, }: GetCommercialOrderParameters): Promise<GetCommercialOrderResponse>;
14
14
  /**
15
15
  * Update commercial order billing information
16
16
  */
@@ -39,3 +39,7 @@ export declare function updateCommercialOrderShippingInformation({ orderId, ship
39
39
  * Update commercial order shipping type
40
40
  */
41
41
  export declare function updateCommercialOrderShippingType({ orderId, shippingType, }: UpdateCommercialOrderShippingTypeParameters): Promise<void>;
42
+ /**
43
+ * Update commercial order shipping type
44
+ */
45
+ export declare function updateLogisticOrderCustomFields({ orderLogisticId, lines, }: UpdateOrderLogisticCustomFieldParameters): Promise<void>;
@@ -10,6 +10,7 @@ exports.getCommercialOrderPaymentPageUrl = getCommercialOrderPaymentPageUrl;
10
10
  exports.updateCommercialOrderShippingAddress = updateCommercialOrderShippingAddress;
11
11
  exports.updateCommercialOrderShippingInformation = updateCommercialOrderShippingInformation;
12
12
  exports.updateCommercialOrderShippingType = updateCommercialOrderShippingType;
13
+ exports.updateLogisticOrderCustomFields = updateLogisticOrderCustomFields;
13
14
  const parameters_validation_1 = require("../../helpers/parameters-validation");
14
15
  const fetch_instance_1 = require("../../settings/fetch-instance");
15
16
  /**
@@ -51,13 +52,15 @@ async function createCommercialOrder({ nbPreviewLines, channel, customFields, lo
51
52
  /**
52
53
  * Get commercial order
53
54
  */
54
- async function getCommercialOrder({ orderId, locale, }) {
55
+ async function getCommercialOrder({ orderId, idType, locale, nbPreviewLines, }) {
55
56
  (0, parameters_validation_1.required)({ orderId, locale });
56
57
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
57
58
  method: "GET",
58
59
  path: `/v1/shop/commercial-orders/${orderId}`,
59
60
  params: {
60
61
  locale,
62
+ idType,
63
+ nbPreviewLines,
61
64
  },
62
65
  });
63
66
  return data;
@@ -151,3 +154,16 @@ async function updateCommercialOrderShippingType({ orderId, shippingType, }) {
151
154
  }),
152
155
  });
153
156
  }
157
+ /**
158
+ * Update commercial order shipping type
159
+ */
160
+ async function updateLogisticOrderCustomFields({ orderLogisticId, lines, }) {
161
+ (0, parameters_validation_1.required)({ orderLogisticId });
162
+ (0, fetch_instance_1.enhancedFetch)({
163
+ method: "PUT",
164
+ path: `/v1/shop/logistic-orders/${orderLogisticId}/lines`,
165
+ body: JSON.stringify({
166
+ lines,
167
+ }),
168
+ });
169
+ }
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.enhancedFetch = exports.updateConfiguration = exports.initialize = void 0;
27
37
  const qs = __importStar(require("query-string"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
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",