@djust-b2b/djust-front-sdk 1.7.6 → 1.8.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
@@ -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>;
@@ -104,6 +104,7 @@ export declare const DjustSDK: {
104
104
  getCustomerAccountUsers({ pageable, }: import("./interfaces").GetCustomerAccountUsersParameters): Promise<import("./interfaces").GetCustomerAccountUsersResponse>;
105
105
  createCustomerAccountOrganisation({ externalId, name, parentId, }: import("./interfaces").CreateCustomerAccountOrganisationParameters): Promise<import("./interfaces").CreateCustomerAccountOrganisationResponse>;
106
106
  updateCustomerAccountOrganisation({ organisationId, name, parentId, status, }: import("./interfaces").UpdateCustomerAccountOrganisationParameters): Promise<import("./interfaces").UpdateCustomerAccountOrganisationResponse>;
107
+ getCustomerAccountOrganisations(): Promise<import("./interfaces").GetCustomerAccountOrganisationResponse>;
107
108
  getCustomerAccountOrganisationAddresses({ organisationId, }: import("./interfaces").GetCustomerAccountOrganisationAddressesParameters): Promise<import("./interfaces").GetCustomerAccountOrganisationAddressesResponse>;
108
109
  deleteCustomerAccountOrganisationAddress({ organisationId, addressId, }: import("./interfaces").DeleteCustomerAccountOrganisationAddressParameters): Promise<void>;
109
110
  updateCustomerAccountOrganisationAddress({ organisationId, addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }: import("./interfaces").UpdateCustomerAccountOrganisationAddressParameters): Promise<import("./interfaces").UpdateCustomerAccountOrganisationAddressResponse>;
@@ -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
  */
@@ -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
  /**
@@ -153,3 +154,16 @@ async function updateCommercialOrderShippingType({ orderId, shippingType, }) {
153
154
  }),
154
155
  });
155
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
+ }
@@ -109,6 +109,8 @@ export interface CreateCustomerAccountOrganisationResponse extends CustomerOrgan
109
109
  }
110
110
  export interface UpdateCustomerAccountOrganisationResponse extends CustomerOrganisationDto {
111
111
  }
112
+ export interface GetCustomerAccountOrganisationResponse extends CustomerOrganisationDto {
113
+ }
112
114
  export interface GetCustomerAccountOrganisationAddressesResponse extends Array<AddressDto> {
113
115
  }
114
116
  export interface UpdateCustomerAccountOrganisationAddressResponse extends AddressDto {
@@ -1,4 +1,4 @@
1
- import { CreateCustomerAccountAddressParameters, CreateCustomerAccountAddressResponse, CreateCustomerAccountOrganisationParameters, CreateCustomerAccountOrganisationResponse, CreateCustomerAccountParameters, CreateCustomerAccountResponse, DeleteCustomerAccountAddressParameters, DeleteCustomerAccountOrganisationAddressParameters, GetCustomerAccountAddressesParameters, GetCustomerAccountAddressesResponse, GetCustomerAccountOrdersParameters, GetCustomerAccountOrdersResponse, GetCustomerAccountOrganisationAddressesParameters, GetCustomerAccountOrganisationAddressesResponse, GetCustomerAccountOrganisationOrdersParameters, GetCustomerAccountOrganisationOrdersResponse, GetCustomerAccountOrganisationUsersParameters, GetCustomerAccountOrganisationUsersResponse, GetCustomerAccountResponse, GetCustomerAccountUsersParameters, GetCustomerAccountUsersResponse, UpdateCustomerAccountAddressParameters, UpdateCustomerAccountAddressResponse, UpdateCustomerAccountOrganisationAddressParameters, UpdateCustomerAccountOrganisationAddressResponse, UpdateCustomerAccountOrganisationParameters, UpdateCustomerAccountOrganisationResponse, UpdateCustomerAccountOrganisationUserParameters, UpdateCustomerAccountOrganisationUserResponse, UpdateCustomerAccountParameters, UpdateCustomerAccountResponse } from "./definitions";
1
+ import { CreateCustomerAccountAddressParameters, CreateCustomerAccountAddressResponse, CreateCustomerAccountOrganisationParameters, CreateCustomerAccountOrganisationResponse, CreateCustomerAccountParameters, CreateCustomerAccountResponse, DeleteCustomerAccountAddressParameters, DeleteCustomerAccountOrganisationAddressParameters, GetCustomerAccountAddressesParameters, GetCustomerAccountAddressesResponse, GetCustomerAccountOrdersParameters, GetCustomerAccountOrdersResponse, GetCustomerAccountOrganisationAddressesParameters, GetCustomerAccountOrganisationAddressesResponse, GetCustomerAccountOrganisationOrdersParameters, GetCustomerAccountOrganisationOrdersResponse, GetCustomerAccountOrganisationResponse, GetCustomerAccountOrganisationUsersParameters, GetCustomerAccountOrganisationUsersResponse, GetCustomerAccountResponse, GetCustomerAccountUsersParameters, GetCustomerAccountUsersResponse, UpdateCustomerAccountAddressParameters, UpdateCustomerAccountAddressResponse, UpdateCustomerAccountOrganisationAddressParameters, UpdateCustomerAccountOrganisationAddressResponse, UpdateCustomerAccountOrganisationParameters, UpdateCustomerAccountOrganisationResponse, UpdateCustomerAccountOrganisationUserParameters, UpdateCustomerAccountOrganisationUserResponse, UpdateCustomerAccountParameters, UpdateCustomerAccountResponse } from "./definitions";
2
2
  /**
3
3
  * Retrieve a customer account
4
4
  */
@@ -43,6 +43,10 @@ export declare function createCustomerAccountOrganisation({ externalId, name, pa
43
43
  * Update a customer account's organisation
44
44
  */
45
45
  export declare function updateCustomerAccountOrganisation({ organisationId, name, parentId, status, }: UpdateCustomerAccountOrganisationParameters): Promise<UpdateCustomerAccountOrganisationResponse>;
46
+ /**
47
+ * Get organisations from customer account
48
+ */
49
+ export declare function getCustomerAccountOrganisations(): Promise<GetCustomerAccountOrganisationResponse>;
46
50
  /**
47
51
  * Get addresses from a customer account organisation
48
52
  */
@@ -11,6 +11,7 @@ exports.getCustomerAccountOrders = getCustomerAccountOrders;
11
11
  exports.getCustomerAccountUsers = getCustomerAccountUsers;
12
12
  exports.createCustomerAccountOrganisation = createCustomerAccountOrganisation;
13
13
  exports.updateCustomerAccountOrganisation = updateCustomerAccountOrganisation;
14
+ exports.getCustomerAccountOrganisations = getCustomerAccountOrganisations;
14
15
  exports.getCustomerAccountOrganisationAddresses = getCustomerAccountOrganisationAddresses;
15
16
  exports.deleteCustomerAccountOrganisationAddress = deleteCustomerAccountOrganisationAddress;
16
17
  exports.updateCustomerAccountOrganisationAddress = updateCustomerAccountOrganisationAddress;
@@ -220,6 +221,16 @@ async function updateCustomerAccountOrganisation({ organisationId, name, parentI
220
221
  });
221
222
  return data;
222
223
  }
224
+ /**
225
+ * Get organisations from customer account
226
+ */
227
+ async function getCustomerAccountOrganisations() {
228
+ const { data } = await (0, fetch_instance_1.enhancedFetch)({
229
+ method: "GET",
230
+ path: `/v1/shop/customer-accounts/organisations`,
231
+ });
232
+ return data;
233
+ }
223
234
  /**
224
235
  * Get addresses from a customer account organisation
225
236
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "1.7.6",
3
+ "version": "1.8.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",