@djust-b2b/djust-front-sdk 1.19.2 → 1.20.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
@@ -9,6 +9,7 @@ export declare const DjustSDK: {
9
9
  accessToken?: string;
10
10
  storeId?: string;
11
11
  storeViewId?: string;
12
+ customerAccountId?: string;
12
13
  }) => void;
13
14
  updateConfiguration: (newConfig: Partial<{
14
15
  baseUrl: string;
@@ -20,6 +21,7 @@ export declare const DjustSDK: {
20
21
  accessToken?: string;
21
22
  storeId?: string;
22
23
  storeViewId?: string;
24
+ customerAccountId?: string;
23
25
  }>) => void;
24
26
  getIncidents({ customerAccountIds, linkedType, ids, status, idType, page, size, sort, }: import("./services/incident/definitions").getIncidentsParameters): Promise<import("./services/incident/definitions").getIncidentsResponse>;
25
27
  getIncident({ incidentId, idType, }: import("./services/incident/definitions").getIncidentParameters): Promise<import("./services/incident/definitions").getIncidentResponse>;
@@ -62,7 +64,7 @@ export declare const DjustSDK: {
62
64
  getLogisticOrderShippingInformation({ orderId, }: import("./interfaces").GetLogisticOrderShippingAddressParameters): Promise<import("./interfaces").GetLogisticOrderShippingAddressResponse>;
63
65
  updateLogisticOrderShippingInformation({ orderId, shippingAddressId, shippingType, }: import("./interfaces").UpdateLogisticOrderShippingInformationParameters): Promise<void>;
64
66
  updateLogisticOrderShippingType({ orderId, shippingType, }: import("./interfaces").UpdateLogisticOrderShippingTypeParameters): Promise<void>;
65
- createLogisticOrderThread({ orderId, lineId, message, reasonCode, }: import("./interfaces").CreateLogisticOrderThreadParameters): Promise<void>;
67
+ createLogisticOrderThread({ orderId, lineId, message, reasonCode, }: import("./interfaces").CreateLogisticOrderThreadParameters): Promise<import("./interfaces").CreateLogisticOrderThreadResponse>;
66
68
  getLogisticOrderReview({ orderId, }: import("./interfaces").GetLogisticOrderReviewParameters): Promise<import("./interfaces").GetLogisticOrderReviewResponse>;
67
69
  addLogisticOrderReview({ orderId, comment, grade, }: import("./interfaces").AddLogisticOrderReviewParameters): Promise<import("./interfaces").AddLogisticOrderReviewResponse>;
68
70
  getThreadReasonTypes(): Promise<import("./interfaces").GetThreadReasonTypesResponse>;
@@ -106,24 +108,24 @@ export declare const DjustSDK: {
106
108
  getCustomerUserAddresses({ shipping, billing, account, organisationIds, }: import("./interfaces").GetCustomerUserAddressesParameters): Promise<void>;
107
109
  getCustomerUserOrganisations(): Promise<import("./interfaces").GetCustomerUserOrganisationsResponse>;
108
110
  sendCustomerUserActivationRequest({ redirectUrl, token, }: import("./interfaces").SendCustomerUserActivationRequestParameters): Promise<void>;
109
- getCustomerAccount(): Promise<import("./interfaces").GetCustomerAccountResponse>;
110
- createCustomerAccount({ createAddressRequests, createCustomerUserRequest, createObjectCustomerAccountRequest, customFieldValues, customerTagList, fromFO, legalUser, }: import("./interfaces").CreateCustomerAccountParameters): Promise<import("./interfaces").CreateCustomerAccountResponse>;
111
- updateCustomerAccount({ accountManager, businessRegistrationNumber, companyRegistrationName, customFieldValues, customerTagList, legalUser, name, vatNumber, website, }: import("./interfaces").UpdateCustomerAccountParameters): Promise<import("./interfaces").UpdateCustomerAccountResponse>;
112
- getCustomerAccountAddresses({ shipping, billing, }: import("./interfaces").GetCustomerAccountAddressesParameters): Promise<import("./interfaces").GetCustomerAccountAddressesResponse>;
113
- createCustomerAccountAddress({ additionalAddress, address, billing, city, company, country, externalId, fullName, label, phone, shipping, state, zipcode, }: import("./interfaces").CreateCustomerAccountAddressParameters): Promise<import("./interfaces").CreateCustomerAccountAddressResponse>;
114
- deleteCustomerAccountAddress({ addressId, }: import("./interfaces").DeleteCustomerAccountAddressParameters): Promise<void>;
115
- updateCustomerAccountAddress({ addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }: import("./interfaces").UpdateCustomerAccountAddressParameters): Promise<import("./interfaces").UpdateCustomerAccountAddressResponse>;
116
- getCustomerAccountOrders(params: import("./interfaces").GetCustomerAccountOrdersParameters): Promise<import("./interfaces").GetCustomerAccountOrdersResponse>;
117
- getCustomerAccountUsers({ pageable, }: import("./interfaces").GetCustomerAccountUsersParameters): Promise<import("./interfaces").GetCustomerAccountUsersResponse>;
118
- createCustomerAccountOrganisation({ externalId, name, parentId, }: import("./interfaces").CreateCustomerAccountOrganisationParameters): Promise<import("./interfaces").CreateCustomerAccountOrganisationResponse>;
119
- updateCustomerAccountOrganisation({ organisationId, name, parentId, status, }: import("./interfaces").UpdateCustomerAccountOrganisationParameters): Promise<import("./interfaces").UpdateCustomerAccountOrganisationResponse>;
120
- getCustomerAccountOrganisations(): Promise<import("./interfaces").GetCustomerAccountOrganisationResponse>;
121
- getCustomerAccountOrganisationAddresses({ organisationId, }: import("./interfaces").GetCustomerAccountOrganisationAddressesParameters): Promise<import("./interfaces").GetCustomerAccountOrganisationAddressesResponse>;
122
- deleteCustomerAccountOrganisationAddress({ organisationId, addressId, }: import("./interfaces").DeleteCustomerAccountOrganisationAddressParameters): Promise<void>;
123
- updateCustomerAccountOrganisationAddress({ organisationId, addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }: import("./interfaces").UpdateCustomerAccountOrganisationAddressParameters): Promise<import("./interfaces").UpdateCustomerAccountOrganisationAddressResponse>;
124
- getCustomerAccountOrganisationOrders({ organisationId, pageable, locale, }: import("./interfaces").GetCustomerAccountOrganisationOrdersParameters): Promise<import("./interfaces").GetCustomerAccountOrganisationOrdersResponse>;
125
- getCustomerAccountOrganisationUsers({ organisationId, pageable, }: import("./interfaces").GetCustomerAccountOrganisationUsersParameters): Promise<import("./interfaces").GetCustomerAccountOrganisationUsersResponse>;
126
- updateCustomerAccountOrganisationUser({ organisationId, customerUserId, civility, customFieldValues, firstName, lastName, phone, }: import("./interfaces").UpdateCustomerAccountOrganisationUserParameters): Promise<import("./interfaces").UpdateCustomerAccountOrganisationUserResponse>;
111
+ getCustomerAccount(config?: import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").GetCustomerAccountResponse>;
112
+ createCustomerAccount({ createAddressRequests, createCustomerUserRequest, createObjectCustomerAccountRequest, customFieldValues, customerTagList, fromFO, legalUser, ...config }: import("./interfaces").CreateCustomerAccountParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").CreateCustomerAccountResponse>;
113
+ updateCustomerAccount({ accountManager, businessRegistrationNumber, companyRegistrationName, customFieldValues, customerTagList, legalUser, name, vatNumber, website, ...config }: import("./interfaces").UpdateCustomerAccountParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").UpdateCustomerAccountResponse>;
114
+ getCustomerAccountAddresses(params: import("./interfaces").GetCustomerAccountAddressesParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").GetCustomerAccountAddressesResponse>;
115
+ createCustomerAccountAddress(params: import("./interfaces").CreateCustomerAccountAddressParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").CreateCustomerAccountAddressResponse>;
116
+ deleteCustomerAccountAddress({ addressId, ...config }: import("./interfaces").DeleteCustomerAccountAddressParameters & import("./interfaces/models/common").DjustConfig): Promise<void>;
117
+ updateCustomerAccountAddress({ addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, ...config }: import("./interfaces").UpdateCustomerAccountAddressParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").UpdateCustomerAccountAddressResponse>;
118
+ getCustomerAccountOrders(params: import("./interfaces").GetCustomerAccountOrdersParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").GetCustomerAccountOrdersResponse>;
119
+ getCustomerAccountUsers(params: import("./interfaces").GetCustomerAccountUsersParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").GetCustomerAccountUsersResponse>;
120
+ createCustomerAccountOrganisation(params: import("./interfaces").CreateCustomerAccountOrganisationParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").CreateCustomerAccountOrganisationResponse>;
121
+ updateCustomerAccountOrganisation(params: import("./interfaces").UpdateCustomerAccountOrganisationParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").UpdateCustomerAccountOrganisationResponse>;
122
+ getCustomerAccountOrganisations(config?: import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").GetCustomerAccountOrganisationResponse>;
123
+ getCustomerAccountOrganisationAddresses(params: import("./interfaces").GetCustomerAccountOrganisationAddressesParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").GetCustomerAccountOrganisationAddressesResponse>;
124
+ deleteCustomerAccountOrganisationAddress(params: import("./interfaces").DeleteCustomerAccountOrganisationAddressParameters & import("./interfaces/models/common").DjustConfig): Promise<void>;
125
+ updateCustomerAccountOrganisationAddress(params: import("./interfaces").UpdateCustomerAccountOrganisationAddressParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").UpdateCustomerAccountOrganisationAddressResponse>;
126
+ getCustomerAccountOrganisationOrders(params: import("./interfaces").GetCustomerAccountOrganisationOrdersParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").GetCustomerAccountOrganisationOrdersResponse>;
127
+ getCustomerAccountOrganisationUsers(params: import("./interfaces").GetCustomerAccountOrganisationUsersParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").GetCustomerAccountOrganisationUsersResponse>;
128
+ updateCustomerAccountOrganisationUser(params: import("./interfaces").UpdateCustomerAccountOrganisationUserParameters & import("./interfaces/models/common").DjustConfig): Promise<import("./interfaces").UpdateCustomerAccountOrganisationUserResponse>;
127
129
  deleteCarts(): Promise<import("./interfaces").DeleteCartsResponse>;
128
130
  getCarts(params: import("./interfaces").GetCartsParameters): Promise<import("./interfaces").GetCartsResponse>;
129
131
  createCart(params: import("./interfaces").CreateCartParameters): Promise<import("./interfaces").CreateCartResponse>;
@@ -48,4 +48,9 @@ export interface DjustApiException {
48
48
  detail: string;
49
49
  code: string;
50
50
  }
51
+ export interface DjustConfig {
52
+ customerAccountId?: string;
53
+ storeId?: string;
54
+ storeViewId?: string;
55
+ }
51
56
  export {};
@@ -1,3 +1,4 @@
1
+ import { DjustConfig } from "../../interfaces/models/common";
1
2
  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
3
  /**
3
4
  * 📄 Get customer account details.
@@ -15,7 +16,7 @@ import { CreateCustomerAccountAddressParameters, CreateCustomerAccountAddressRes
15
16
  * console.log(response);
16
17
  * ```
17
18
  */
18
- export declare function getCustomerAccount(): Promise<GetCustomerAccountResponse>;
19
+ export declare function getCustomerAccount(config?: DjustConfig): Promise<GetCustomerAccountResponse>;
19
20
  /**
20
21
  * 📄 Creates a new customer account.
21
22
  *
@@ -108,7 +109,7 @@ export declare function getCustomerAccount(): Promise<GetCustomerAccountResponse
108
109
  * });
109
110
  * ```
110
111
  */
111
- export declare function createCustomerAccount({ createAddressRequests, createCustomerUserRequest, createObjectCustomerAccountRequest, customFieldValues, customerTagList, fromFO, legalUser, }: CreateCustomerAccountParameters): Promise<CreateCustomerAccountResponse>;
112
+ export declare function createCustomerAccount({ createAddressRequests, createCustomerUserRequest, createObjectCustomerAccountRequest, customFieldValues, customerTagList, fromFO, legalUser, ...config }: CreateCustomerAccountParameters & DjustConfig): Promise<CreateCustomerAccountResponse>;
112
113
  /**
113
114
  * 📄 Update customer account details.
114
115
  *
@@ -122,7 +123,7 @@ export declare function createCustomerAccount({ createAddressRequests, createCus
122
123
  * console.log(response);
123
124
  * ```
124
125
  */
125
- export declare function updateCustomerAccount({ accountManager, businessRegistrationNumber, companyRegistrationName, customFieldValues, customerTagList, legalUser, name, vatNumber, website, }: UpdateCustomerAccountParameters): Promise<UpdateCustomerAccountResponse>;
126
+ export declare function updateCustomerAccount({ accountManager, businessRegistrationNumber, companyRegistrationName, customFieldValues, customerTagList, legalUser, name, vatNumber, website, ...config }: UpdateCustomerAccountParameters & DjustConfig): Promise<UpdateCustomerAccountResponse>;
126
127
  /**
127
128
  * 📄 Get customer account's addresses.
128
129
  *
@@ -144,7 +145,7 @@ export declare function updateCustomerAccount({ accountManager, businessRegistra
144
145
  * console.log(response);
145
146
  * ```
146
147
  */
147
- export declare function getCustomerAccountAddresses({ shipping, billing, }: GetCustomerAccountAddressesParameters): Promise<GetCustomerAccountAddressesResponse>;
148
+ export declare function getCustomerAccountAddresses(params: GetCustomerAccountAddressesParameters & DjustConfig): Promise<GetCustomerAccountAddressesResponse>;
148
149
  /**
149
150
  * 📄 Create an address for a customer account.
150
151
  *
@@ -191,7 +192,7 @@ export declare function getCustomerAccountAddresses({ shipping, billing, }: GetC
191
192
  * console.log(response);
192
193
  * ```
193
194
  */
194
- export declare function createCustomerAccountAddress({ additionalAddress, address, billing, city, company, country, externalId, fullName, label, phone, shipping, state, zipcode, }: CreateCustomerAccountAddressParameters): Promise<CreateCustomerAccountAddressResponse>;
195
+ export declare function createCustomerAccountAddress(params: CreateCustomerAccountAddressParameters & DjustConfig): Promise<CreateCustomerAccountAddressResponse>;
195
196
  /**
196
197
  * 🗑️ Delete an address from a customer account.
197
198
  *
@@ -211,7 +212,7 @@ export declare function createCustomerAccountAddress({ additionalAddress, addres
211
212
  * console.log(response); // No content response
212
213
  * ```
213
214
  */
214
- export declare function deleteCustomerAccountAddress({ addressId, }: DeleteCustomerAccountAddressParameters): Promise<void>;
215
+ export declare function deleteCustomerAccountAddress({ addressId, ...config }: DeleteCustomerAccountAddressParameters & DjustConfig): Promise<void>;
215
216
  /**
216
217
  * ✏️ Update an address for a customer account.
217
218
  *
@@ -258,7 +259,7 @@ export declare function deleteCustomerAccountAddress({ addressId, }: DeleteCusto
258
259
  * console.log(response); // Updated address details
259
260
  * ```
260
261
  */
261
- export declare function updateCustomerAccountAddress({ addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }: UpdateCustomerAccountAddressParameters): Promise<UpdateCustomerAccountAddressResponse>;
262
+ export declare function updateCustomerAccountAddress({ addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, ...config }: UpdateCustomerAccountAddressParameters & DjustConfig): Promise<UpdateCustomerAccountAddressResponse>;
262
263
  /**
263
264
  * 📋 Retrieves orders for a customer account.
264
265
  *
@@ -294,7 +295,7 @@ export declare function updateCustomerAccountAddress({ addressId, additionalAddr
294
295
  *
295
296
  * @returns {Promise<GetCustomerAccountOrdersResponse>} - The response containing the customer account orders.
296
297
  */
297
- export declare function getCustomerAccountOrders(params: GetCustomerAccountOrdersParameters): Promise<GetCustomerAccountOrdersResponse>;
298
+ export declare function getCustomerAccountOrders(params: GetCustomerAccountOrdersParameters & DjustConfig): Promise<GetCustomerAccountOrdersResponse>;
298
299
  /**
299
300
  * ## Retrieve Customer Account Users
300
301
  *
@@ -320,7 +321,7 @@ export declare function getCustomerAccountOrders(params: GetCustomerAccountOrder
320
321
  * });
321
322
  * ```
322
323
  */
323
- export declare function getCustomerAccountUsers({ pageable, }: GetCustomerAccountUsersParameters): Promise<GetCustomerAccountUsersResponse>;
324
+ export declare function getCustomerAccountUsers(params: GetCustomerAccountUsersParameters & DjustConfig): Promise<GetCustomerAccountUsersResponse>;
324
325
  /**
325
326
  * ## Create a Customer Account's Organisation
326
327
  *
@@ -348,7 +349,7 @@ export declare function getCustomerAccountUsers({ pageable, }: GetCustomerAccoun
348
349
  * });
349
350
  * ```
350
351
  */
351
- export declare function createCustomerAccountOrganisation({ externalId, name, parentId, }: CreateCustomerAccountOrganisationParameters): Promise<CreateCustomerAccountOrganisationResponse>;
352
+ export declare function createCustomerAccountOrganisation(params: CreateCustomerAccountOrganisationParameters & DjustConfig): Promise<CreateCustomerAccountOrganisationResponse>;
352
353
  /**
353
354
  * ## Update a customer account's organisation
354
355
  *
@@ -380,7 +381,7 @@ export declare function createCustomerAccountOrganisation({ externalId, name, pa
380
381
  * console.log(response);
381
382
  * ```
382
383
  */
383
- export declare function updateCustomerAccountOrganisation({ organisationId, name, parentId, status, }: UpdateCustomerAccountOrganisationParameters): Promise<UpdateCustomerAccountOrganisationResponse>;
384
+ export declare function updateCustomerAccountOrganisation(params: UpdateCustomerAccountOrganisationParameters & DjustConfig): Promise<UpdateCustomerAccountOrganisationResponse>;
384
385
  /**
385
386
  * @deprecated
386
387
  * ## Get organisations from customer account
@@ -400,7 +401,7 @@ export declare function updateCustomerAccountOrganisation({ organisationId, name
400
401
  * console.log(response);
401
402
  * ```
402
403
  */
403
- export declare function getCustomerAccountOrganisations(): Promise<GetCustomerAccountOrganisationResponse>;
404
+ export declare function getCustomerAccountOrganisations(config?: DjustConfig): Promise<GetCustomerAccountOrganisationResponse>;
404
405
  /**
405
406
  * ## Get addresses from a customer account organisation
406
407
  *
@@ -423,7 +424,7 @@ export declare function getCustomerAccountOrganisations(): Promise<GetCustomerAc
423
424
  * console.log(addresses);
424
425
  * ```
425
426
  */
426
- export declare function getCustomerAccountOrganisationAddresses({ organisationId, }: GetCustomerAccountOrganisationAddressesParameters): Promise<GetCustomerAccountOrganisationAddressesResponse>;
427
+ export declare function getCustomerAccountOrganisationAddresses(params: GetCustomerAccountOrganisationAddressesParameters & DjustConfig): Promise<GetCustomerAccountOrganisationAddressesResponse>;
427
428
  /**
428
429
  * ## Delete an address from a customer account organisation
429
430
  *
@@ -450,7 +451,7 @@ export declare function getCustomerAccountOrganisationAddresses({ organisationId
450
451
  * console.log('Address deleted successfully.');
451
452
  * ```
452
453
  */
453
- export declare function deleteCustomerAccountOrganisationAddress({ organisationId, addressId, }: DeleteCustomerAccountOrganisationAddressParameters): Promise<void>;
454
+ export declare function deleteCustomerAccountOrganisationAddress(params: DeleteCustomerAccountOrganisationAddressParameters & DjustConfig): Promise<void>;
454
455
  /**
455
456
  * ## Update an address from a customer account organisation
456
457
  *
@@ -502,7 +503,7 @@ export declare function deleteCustomerAccountOrganisationAddress({ organisationI
502
503
  * console.log(response);
503
504
  * ```
504
505
  */
505
- export declare function updateCustomerAccountOrganisationAddress({ organisationId, addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }: UpdateCustomerAccountOrganisationAddressParameters): Promise<UpdateCustomerAccountOrganisationAddressResponse>;
506
+ export declare function updateCustomerAccountOrganisationAddress(params: UpdateCustomerAccountOrganisationAddressParameters & DjustConfig): Promise<UpdateCustomerAccountOrganisationAddressResponse>;
506
507
  /**
507
508
  * ## Get orders from a customer account organisation
508
509
  *
@@ -532,7 +533,7 @@ export declare function updateCustomerAccountOrganisationAddress({ organisationI
532
533
  * console.log(response);
533
534
  * ```
534
535
  */
535
- export declare function getCustomerAccountOrganisationOrders({ organisationId, pageable, locale, }: GetCustomerAccountOrganisationOrdersParameters): Promise<GetCustomerAccountOrganisationOrdersResponse>;
536
+ export declare function getCustomerAccountOrganisationOrders(params: GetCustomerAccountOrganisationOrdersParameters & DjustConfig): Promise<GetCustomerAccountOrganisationOrdersResponse>;
536
537
  /**
537
538
  * ## Get users from a customer account organisation
538
539
  *
@@ -560,7 +561,7 @@ export declare function getCustomerAccountOrganisationOrders({ organisationId, p
560
561
  * console.log(response);
561
562
  * ```
562
563
  */
563
- export declare function getCustomerAccountOrganisationUsers({ organisationId, pageable, }: GetCustomerAccountOrganisationUsersParameters): Promise<GetCustomerAccountOrganisationUsersResponse>;
564
+ export declare function getCustomerAccountOrganisationUsers(params: GetCustomerAccountOrganisationUsersParameters & DjustConfig): Promise<GetCustomerAccountOrganisationUsersResponse>;
564
565
  /**
565
566
  * ## Update a customer account organisation user
566
567
  *
@@ -603,4 +604,4 @@ export declare function getCustomerAccountOrganisationUsers({ organisationId, pa
603
604
  * console.log(response);
604
605
  * ```
605
606
  */
606
- export declare function updateCustomerAccountOrganisationUser({ organisationId, customerUserId, civility, customFieldValues, firstName, lastName, phone, }: UpdateCustomerAccountOrganisationUserParameters): Promise<UpdateCustomerAccountOrganisationUserResponse>;
607
+ export declare function updateCustomerAccountOrganisationUser(params: UpdateCustomerAccountOrganisationUserParameters & DjustConfig): Promise<UpdateCustomerAccountOrganisationUserResponse>;
@@ -36,10 +36,11 @@ const fetch_instance_1 = require("../../settings/fetch-instance");
36
36
  * console.log(response);
37
37
  * ```
38
38
  */
39
- async function getCustomerAccount() {
39
+ async function getCustomerAccount(config) {
40
40
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
41
41
  method: "GET",
42
- path: `/v1/shop/customer-accounts`,
42
+ path: "/v1/shop/customer-accounts",
43
+ params: config,
43
44
  });
44
45
  return data;
45
46
  }
@@ -135,7 +136,7 @@ async function getCustomerAccount() {
135
136
  * });
136
137
  * ```
137
138
  */
138
- async function createCustomerAccount({ createAddressRequests, createCustomerUserRequest, createObjectCustomerAccountRequest, customFieldValues, customerTagList, fromFO, legalUser, }) {
139
+ async function createCustomerAccount({ createAddressRequests, createCustomerUserRequest, createObjectCustomerAccountRequest, customFieldValues, customerTagList, fromFO, legalUser, ...config }) {
139
140
  (0, parameters_validation_1.required)({
140
141
  createAddressRequests,
141
142
  createCustomerUserRequest,
@@ -147,7 +148,8 @@ async function createCustomerAccount({ createAddressRequests, createCustomerUser
147
148
  });
148
149
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
149
150
  method: "POST",
150
- path: `/v1/shop/customer-accounts`,
151
+ path: "/v1/shop/customer-accounts",
152
+ params: config,
151
153
  body: JSON.stringify({
152
154
  createAddressRequests,
153
155
  createCustomerUserRequest,
@@ -173,10 +175,11 @@ async function createCustomerAccount({ createAddressRequests, createCustomerUser
173
175
  * console.log(response);
174
176
  * ```
175
177
  */
176
- async function updateCustomerAccount({ accountManager, businessRegistrationNumber, companyRegistrationName, customFieldValues, customerTagList, legalUser, name, vatNumber, website, }) {
178
+ async function updateCustomerAccount({ accountManager, businessRegistrationNumber, companyRegistrationName, customFieldValues, customerTagList, legalUser, name, vatNumber, website, ...config }) {
177
179
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
178
180
  method: "PUT",
179
- path: `/v1/shop/customer-accounts`,
181
+ path: "/v1/shop/customer-accounts",
182
+ params: config,
180
183
  body: JSON.stringify({
181
184
  accountManager,
182
185
  businessRegistrationNumber,
@@ -212,14 +215,11 @@ async function updateCustomerAccount({ accountManager, businessRegistrationNumbe
212
215
  * console.log(response);
213
216
  * ```
214
217
  */
215
- async function getCustomerAccountAddresses({ shipping, billing, }) {
218
+ async function getCustomerAccountAddresses(params) {
216
219
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
217
220
  method: "GET",
218
- path: `/v1/shop/customer-accounts/addresses`,
219
- params: {
220
- shipping,
221
- billing,
222
- },
221
+ path: "/v1/shop/customer-accounts/addresses",
222
+ params,
223
223
  });
224
224
  return data;
225
225
  }
@@ -269,26 +269,13 @@ async function getCustomerAccountAddresses({ shipping, billing, }) {
269
269
  * console.log(response);
270
270
  * ```
271
271
  */
272
- async function createCustomerAccountAddress({ additionalAddress, address, billing, city, company, country, externalId, fullName, label, phone, shipping, state, zipcode, }) {
273
- (0, parameters_validation_1.required)({ address, city, country, fullName, zipcode });
272
+ async function createCustomerAccountAddress(params) {
273
+ (0, parameters_validation_1.required)(params);
274
274
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
275
275
  method: "POST",
276
- path: `/v1/shop/customer-accounts/addresses`,
277
- params: {
278
- additionalAddress,
279
- address,
280
- billing,
281
- city,
282
- company,
283
- country,
284
- externalId,
285
- fullName,
286
- label,
287
- phone,
288
- shipping,
289
- state,
290
- zipcode,
291
- },
276
+ path: "/v1/shop/customer-accounts/addresses",
277
+ params,
278
+ body: JSON.stringify(params),
292
279
  });
293
280
  return data;
294
281
  }
@@ -311,11 +298,12 @@ async function createCustomerAccountAddress({ additionalAddress, address, billin
311
298
  * console.log(response); // No content response
312
299
  * ```
313
300
  */
314
- async function deleteCustomerAccountAddress({ addressId, }) {
301
+ async function deleteCustomerAccountAddress({ addressId, ...config }) {
315
302
  (0, parameters_validation_1.required)({ addressId });
316
- (0, fetch_instance_1.enhancedFetch)({
303
+ await (0, fetch_instance_1.enhancedFetch)({
317
304
  method: "DELETE",
318
305
  path: `/v1/shop/customer-accounts/addresses/${addressId}`,
306
+ params: config,
319
307
  });
320
308
  }
321
309
  /**
@@ -364,11 +352,12 @@ async function deleteCustomerAccountAddress({ addressId, }) {
364
352
  * console.log(response); // Updated address details
365
353
  * ```
366
354
  */
367
- async function updateCustomerAccountAddress({ addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }) {
355
+ async function updateCustomerAccountAddress({ addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, ...config }) {
368
356
  (0, parameters_validation_1.required)({ addressId });
369
357
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
370
358
  method: "PUT",
371
359
  path: `/v1/shop/customer-accounts/addresses/${addressId}`,
360
+ params: config,
372
361
  body: JSON.stringify({
373
362
  additionalAddress,
374
363
  address,
@@ -454,16 +443,12 @@ async function getCustomerAccountOrders(params) {
454
443
  * });
455
444
  * ```
456
445
  */
457
- async function getCustomerAccountUsers({ pageable, }) {
458
- (0, parameters_validation_1.required)({ pageable });
446
+ async function getCustomerAccountUsers(params) {
447
+ (0, parameters_validation_1.required)({ pageable: params.pageable });
459
448
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
460
449
  method: "GET",
461
450
  path: `/v1/shop/customer-accounts/users`,
462
- params: {
463
- page: pageable.page,
464
- size: pageable.size,
465
- sort: pageable.sort,
466
- },
451
+ params,
467
452
  });
468
453
  return data;
469
454
  }
@@ -494,16 +479,13 @@ async function getCustomerAccountUsers({ pageable, }) {
494
479
  * });
495
480
  * ```
496
481
  */
497
- async function createCustomerAccountOrganisation({ externalId, name, parentId, }) {
498
- (0, parameters_validation_1.required)({ externalId, name });
482
+ async function createCustomerAccountOrganisation(params) {
483
+ (0, parameters_validation_1.required)({ externalId: params.externalId, name: params.name });
499
484
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
500
485
  method: "POST",
501
486
  path: `/v1/shop/customer-accounts/organisations`,
502
- body: JSON.stringify({
503
- externalId,
504
- name,
505
- parentId,
506
- }),
487
+ params,
488
+ body: JSON.stringify(params),
507
489
  });
508
490
  return data;
509
491
  }
@@ -538,16 +520,13 @@ async function createCustomerAccountOrganisation({ externalId, name, parentId, }
538
520
  * console.log(response);
539
521
  * ```
540
522
  */
541
- async function updateCustomerAccountOrganisation({ organisationId, name, parentId, status, }) {
542
- (0, parameters_validation_1.required)({ organisationId });
523
+ async function updateCustomerAccountOrganisation(params) {
524
+ (0, parameters_validation_1.required)({ organisationId: params.organisationId });
543
525
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
544
526
  method: "PUT",
545
- path: `/v1/shop/customer-accounts/organisations/${organisationId}`,
546
- body: JSON.stringify({
547
- name,
548
- parentId,
549
- status,
550
- }),
527
+ path: `/v1/shop/customer-accounts/organisations/${params.organisationId}`,
528
+ params,
529
+ body: JSON.stringify(params),
551
530
  });
552
531
  return data;
553
532
  }
@@ -570,10 +549,11 @@ async function updateCustomerAccountOrganisation({ organisationId, name, parentI
570
549
  * console.log(response);
571
550
  * ```
572
551
  */
573
- async function getCustomerAccountOrganisations() {
552
+ async function getCustomerAccountOrganisations(config) {
574
553
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
575
554
  method: "GET",
576
555
  path: `/v1/shop/customer-accounts/organisations`,
556
+ params: config,
577
557
  });
578
558
  return data;
579
559
  }
@@ -599,11 +579,12 @@ async function getCustomerAccountOrganisations() {
599
579
  * console.log(addresses);
600
580
  * ```
601
581
  */
602
- async function getCustomerAccountOrganisationAddresses({ organisationId, }) {
603
- (0, parameters_validation_1.required)({ organisationId });
582
+ async function getCustomerAccountOrganisationAddresses(params) {
583
+ (0, parameters_validation_1.required)({ organisationId: params.organisationId });
604
584
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
605
585
  method: "GET",
606
- path: `/v1/shop/customer-accounts/organisations/${organisationId}/addresses`,
586
+ path: `/v1/shop/customer-accounts/organisations/${params.organisationId}/addresses`,
587
+ params,
607
588
  });
608
589
  return data;
609
590
  }
@@ -633,11 +614,15 @@ async function getCustomerAccountOrganisationAddresses({ organisationId, }) {
633
614
  * console.log('Address deleted successfully.');
634
615
  * ```
635
616
  */
636
- async function deleteCustomerAccountOrganisationAddress({ organisationId, addressId, }) {
637
- (0, parameters_validation_1.required)({ organisationId, addressId });
617
+ async function deleteCustomerAccountOrganisationAddress(params) {
618
+ (0, parameters_validation_1.required)({
619
+ organisationId: params.organisationId,
620
+ addressId: params.addressId,
621
+ });
638
622
  await (0, fetch_instance_1.enhancedFetch)({
639
623
  method: "DELETE",
640
- path: `/v1/shop/customer-accounts/organisations/${organisationId}/addresses/${addressId}`,
624
+ path: `/v1/shop/customer-accounts/organisations/${params.organisationId}/addresses/${params.addressId}`,
625
+ params,
641
626
  });
642
627
  }
643
628
  /**
@@ -691,25 +676,16 @@ async function deleteCustomerAccountOrganisationAddress({ organisationId, addres
691
676
  * console.log(response);
692
677
  * ```
693
678
  */
694
- async function updateCustomerAccountOrganisationAddress({ organisationId, addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }) {
695
- (0, parameters_validation_1.required)({ organisationId, addressId });
679
+ async function updateCustomerAccountOrganisationAddress(params) {
680
+ (0, parameters_validation_1.required)({
681
+ organisationId: params.organisationId,
682
+ addressId: params.addressId,
683
+ });
696
684
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
697
685
  method: "PUT",
698
- path: `/v1/shop/customer-accounts/organisations/${organisationId}/addresses/${addressId}`,
699
- body: JSON.stringify({
700
- additionalAddress,
701
- address,
702
- billing,
703
- city,
704
- company,
705
- country,
706
- fullName,
707
- label,
708
- phone,
709
- shipping,
710
- state,
711
- zipcode,
712
- }),
686
+ path: `/v1/shop/customer-accounts/organisations/${params.organisationId}/addresses/${params.addressId}`,
687
+ params,
688
+ body: JSON.stringify(params),
713
689
  });
714
690
  return data;
715
691
  }
@@ -742,18 +718,16 @@ async function updateCustomerAccountOrganisationAddress({ organisationId, addres
742
718
  * console.log(response);
743
719
  * ```
744
720
  */
745
- async function getCustomerAccountOrganisationOrders({ organisationId, pageable, locale, }) {
746
- (0, parameters_validation_1.required)({ organisationId, pageable, locale });
721
+ async function getCustomerAccountOrganisationOrders(params) {
722
+ (0, parameters_validation_1.required)({
723
+ organisationId: params.organisationId,
724
+ pageable: params.pageable,
725
+ locale: params.locale,
726
+ });
747
727
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
748
728
  method: "GET",
749
- path: `/v1/shop/customer-accounts/organisations/${organisationId}/orders`,
750
- params: {
751
- pageable,
752
- locale,
753
- page: pageable.page,
754
- size: pageable.size,
755
- sort: pageable.sort,
756
- },
729
+ path: `/v1/shop/customer-accounts/organisations/${params.organisationId}/orders`,
730
+ params,
757
731
  });
758
732
  return data;
759
733
  }
@@ -784,17 +758,15 @@ async function getCustomerAccountOrganisationOrders({ organisationId, pageable,
784
758
  * console.log(response);
785
759
  * ```
786
760
  */
787
- async function getCustomerAccountOrganisationUsers({ organisationId, pageable, }) {
788
- (0, parameters_validation_1.required)({ organisationId, pageable });
761
+ async function getCustomerAccountOrganisationUsers(params) {
762
+ (0, parameters_validation_1.required)({
763
+ organisationId: params.organisationId,
764
+ pageable: params.pageable,
765
+ });
789
766
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
790
767
  method: "GET",
791
- path: `/v1/shop/customer-accounts/organisations/${organisationId}/users`,
792
- params: {
793
- pageable,
794
- page: pageable.page,
795
- size: pageable.size,
796
- sort: pageable.sort,
797
- },
768
+ path: `/v1/shop/customer-accounts/organisations/${params.organisationId}/users`,
769
+ params,
798
770
  });
799
771
  return data;
800
772
  }
@@ -840,18 +812,16 @@ async function getCustomerAccountOrganisationUsers({ organisationId, pageable, }
840
812
  * console.log(response);
841
813
  * ```
842
814
  */
843
- async function updateCustomerAccountOrganisationUser({ organisationId, customerUserId, civility, customFieldValues, firstName, lastName, phone, }) {
844
- (0, parameters_validation_1.required)({ organisationId, customerUserId });
815
+ async function updateCustomerAccountOrganisationUser(params) {
816
+ (0, parameters_validation_1.required)({
817
+ organisationId: params.organisationId,
818
+ customerUserId: params.customerUserId,
819
+ });
845
820
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
846
821
  method: "PUT",
847
- path: `/v1/shop/customer-accounts/organisations/${organisationId}/users/${customerUserId}`,
848
- body: JSON.stringify({
849
- firstName,
850
- lastName,
851
- civility,
852
- customFieldValues,
853
- phone,
854
- }),
822
+ path: `/v1/shop/customer-accounts/organisations/${params.organisationId}/users/${params.customerUserId}`,
823
+ params,
824
+ body: JSON.stringify(params),
855
825
  });
856
826
  return data;
857
827
  }
@@ -174,6 +174,12 @@ export interface UpdateLogisticOrderLineCustomFieldsResponse extends OrderLogist
174
174
  }
175
175
  export interface GetLogisticOrderShippingAddressResponse extends Array<ShippingTypeInformationDto> {
176
176
  }
177
+ export interface CreateLogisticOrderThreadResponse {
178
+ messageExternalId: string;
179
+ messageId: string;
180
+ threadExternalId: string;
181
+ threadId: string;
182
+ }
177
183
  export interface GetLogisticOrderReviewResponse extends OrderRatingResponse {
178
184
  }
179
185
  export interface AddLogisticOrderReviewResponse extends OrderRatingResponse {
@@ -1,4 +1,4 @@
1
- import { AddLogisticOrderReviewParameters, AddLogisticOrderReviewResponse, ApproveLogisticOrderParameters, ApproveLogisticOrderResponse, CancelLogisticOrderParameters, CancelLogisticOrderResponse, ConfirmLogisticOrderReceptionParameters, ConfirmLogisticOrderReceptionResponse, CreateLogisticOrderParameters, CreateLogisticOrderThreadParameters, DisapproveLogisticOrderParameters, DisapproveLogisticOrderResponse, GetLogisticOrderAccountingDocumentsParameters, GetLogisticOrderAccountingDocumentsResponse, GetLogisticOrderAccountingDocumentUrlParameters, GetLogisticOrderApproversParameters, GetLogisticOrderApproversResponse, GetLogisticOrderCustomFieldsParameters, GetLogisticOrderCustomFieldsResponse, GetLogisticOrderDocumentsParameters, GetLogisticOrderDocumentsResponse, GetLogisticOrderDocumentUrlParameters, GetLogisticOrderLineCustomFieldsParameters, GetLogisticOrderLineCustomFieldsResponse, GetLogisticOrderLinesParameters, GetLogisticOrderLinesResponse, GetLogisticOrderParameters, GetLogisticOrderResponse, GetLogisticOrderReviewParameters, GetLogisticOrderReviewResponse, GetLogisticOrderShippingAddressParameters, GetLogisticOrderShippingAddressResponse, GetLogisticOrdersParameters, GetLogisticOrdersResponse, GetThreadReasonTypesResponse, GetThreadSubReasonsParameters, GetThreadSubReasonsResponse, UpdateLogisticOrderBillingInformationParameters, UpdateLogisticOrderCustomFieldsParameters, UpdateLogisticOrderCustomFieldsResponse, UpdateLogisticOrderLineCustomFieldsParameters, UpdateLogisticOrderLineCustomFieldsResponse, UpdateLogisticOrderShippingAddressParameters, UpdateLogisticOrderShippingInformationParameters, UpdateLogisticOrderShippingTypeParameters, UpdateOnHoldLogisticOrderLineParameters, UpdateOnHoldLogisticOrderLinesParameters, UpdateOnHoldLogisticOrderLinesResponse } from "./definitions";
1
+ import { AddLogisticOrderReviewParameters, AddLogisticOrderReviewResponse, ApproveLogisticOrderParameters, ApproveLogisticOrderResponse, CancelLogisticOrderParameters, CancelLogisticOrderResponse, ConfirmLogisticOrderReceptionParameters, ConfirmLogisticOrderReceptionResponse, CreateLogisticOrderParameters, CreateLogisticOrderThreadParameters, CreateLogisticOrderThreadResponse, DisapproveLogisticOrderParameters, DisapproveLogisticOrderResponse, GetLogisticOrderAccountingDocumentsParameters, GetLogisticOrderAccountingDocumentsResponse, GetLogisticOrderAccountingDocumentUrlParameters, GetLogisticOrderApproversParameters, GetLogisticOrderApproversResponse, GetLogisticOrderCustomFieldsParameters, GetLogisticOrderCustomFieldsResponse, GetLogisticOrderDocumentsParameters, GetLogisticOrderDocumentsResponse, GetLogisticOrderDocumentUrlParameters, GetLogisticOrderLineCustomFieldsParameters, GetLogisticOrderLineCustomFieldsResponse, GetLogisticOrderLinesParameters, GetLogisticOrderLinesResponse, GetLogisticOrderParameters, GetLogisticOrderResponse, GetLogisticOrderReviewParameters, GetLogisticOrderReviewResponse, GetLogisticOrderShippingAddressParameters, GetLogisticOrderShippingAddressResponse, GetLogisticOrdersParameters, GetLogisticOrdersResponse, GetThreadReasonTypesResponse, GetThreadSubReasonsParameters, GetThreadSubReasonsResponse, UpdateLogisticOrderBillingInformationParameters, UpdateLogisticOrderCustomFieldsParameters, UpdateLogisticOrderCustomFieldsResponse, UpdateLogisticOrderLineCustomFieldsParameters, UpdateLogisticOrderLineCustomFieldsResponse, UpdateLogisticOrderShippingAddressParameters, UpdateLogisticOrderShippingInformationParameters, UpdateLogisticOrderShippingTypeParameters, UpdateOnHoldLogisticOrderLineParameters, UpdateOnHoldLogisticOrderLinesParameters, UpdateOnHoldLogisticOrderLinesResponse } from "./definitions";
2
2
  /**
3
3
  * 🚚 Gets logistic orders.
4
4
  *
@@ -741,7 +741,7 @@ export declare function updateLogisticOrderShippingType({ orderId, shippingType,
741
741
  * the `orderId`. This parameter, as well as the `lineId`, the `message` and the `reasonCode`, is mandatory and validated
742
742
  * before the request is executed.
743
743
  *
744
- * 🛠 **Endpoint**: `POST /v1/shop/logistic-orders/${orderId}/threads [ORDER-100]`
744
+ * 🛠 **Endpoint**: `POST /v1/shop/logistic-orders/${orderId}/threads [THREAD-101]`
745
745
  *
746
746
  * | Parameter | Type | Required | Description |
747
747
  * |-------------------|---------------------------------|------------|------------------------------------------|
@@ -751,7 +751,7 @@ export declare function updateLogisticOrderShippingType({ orderId, shippingType,
751
751
  * | `reasonCode` | `string` | ✅ | The code indentifying the type of thread. |
752
752
  *
753
753
  * 📤 **Returns**:
754
- * A `Promise` resolving when the thread is created.
754
+ * A `Promise` resolving to a `CreateLogisticOrderThreadResponse` object when the thread is created.
755
755
  *
756
756
  * 🛠 **Example usage**:
757
757
  * ```ts
@@ -765,9 +765,9 @@ export declare function updateLogisticOrderShippingType({ orderId, shippingType,
765
765
  *
766
766
  * @param {CreateLogisticOrderThreadParameters} params - The parameters for the request.
767
767
  * @throws {Error} If `orderId`, `lineId`, `message` or `reasonCode` is missing.
768
- * @returns {Promise<void>} A promise resolving when the thread is created.
768
+ * @returns {Promise<CreateLogisticOrderThreadResponse>} A promise resolving when the thread is created.
769
769
  */
770
- export declare function createLogisticOrderThread({ orderId, lineId, message, reasonCode, }: CreateLogisticOrderThreadParameters): Promise<void>;
770
+ export declare function createLogisticOrderThread({ orderId, lineId, message, reasonCode, }: CreateLogisticOrderThreadParameters): Promise<CreateLogisticOrderThreadResponse>;
771
771
  /**
772
772
  * 🚚 Gets a specific logistic order's review.
773
773
  *
@@ -1000,7 +1000,7 @@ async function updateLogisticOrderShippingType({ orderId, shippingType, }) {
1000
1000
  * the `orderId`. This parameter, as well as the `lineId`, the `message` and the `reasonCode`, is mandatory and validated
1001
1001
  * before the request is executed.
1002
1002
  *
1003
- * 🛠 **Endpoint**: `POST /v1/shop/logistic-orders/${orderId}/threads [ORDER-100]`
1003
+ * 🛠 **Endpoint**: `POST /v1/shop/logistic-orders/${orderId}/threads [THREAD-101]`
1004
1004
  *
1005
1005
  * | Parameter | Type | Required | Description |
1006
1006
  * |-------------------|---------------------------------|------------|------------------------------------------|
@@ -1010,7 +1010,7 @@ async function updateLogisticOrderShippingType({ orderId, shippingType, }) {
1010
1010
  * | `reasonCode` | `string` | ✅ | The code indentifying the type of thread. |
1011
1011
  *
1012
1012
  * 📤 **Returns**:
1013
- * A `Promise` resolving when the thread is created.
1013
+ * A `Promise` resolving to a `CreateLogisticOrderThreadResponse` object when the thread is created.
1014
1014
  *
1015
1015
  * 🛠 **Example usage**:
1016
1016
  * ```ts
@@ -1024,15 +1024,16 @@ async function updateLogisticOrderShippingType({ orderId, shippingType, }) {
1024
1024
  *
1025
1025
  * @param {CreateLogisticOrderThreadParameters} params - The parameters for the request.
1026
1026
  * @throws {Error} If `orderId`, `lineId`, `message` or `reasonCode` is missing.
1027
- * @returns {Promise<void>} A promise resolving when the thread is created.
1027
+ * @returns {Promise<CreateLogisticOrderThreadResponse>} A promise resolving when the thread is created.
1028
1028
  */
1029
1029
  async function createLogisticOrderThread({ orderId, lineId, message, reasonCode, }) {
1030
1030
  (0, parameters_validation_1.required)({ orderId, lineId, message, reasonCode });
1031
- (0, fetch_instance_1.enhancedFetch)({
1031
+ const { data } = await (0, fetch_instance_1.enhancedFetch)({
1032
1032
  method: "POST",
1033
1033
  path: `/v1/shop/logistic-orders/${orderId}/threads`,
1034
1034
  body: JSON.stringify({ lineId, message, reasonCode }),
1035
1035
  });
1036
+ return data;
1036
1037
  }
1037
1038
  /**
1038
1039
  * 🚚 Gets a specific logistic order's review.
@@ -1,3 +1,4 @@
1
+ import { DjustConfig } from "../interfaces/models/common";
1
2
  type ClientConfig = {
2
3
  baseUrl: string;
3
4
  clientId: string;
@@ -8,13 +9,14 @@ type ClientConfig = {
8
9
  accessToken?: string;
9
10
  storeId?: string;
10
11
  storeViewId?: string;
12
+ customerAccountId?: string;
11
13
  };
12
14
  export declare const initialize: (initConfig: ClientConfig) => void;
13
15
  export declare const updateConfiguration: (newConfig: Partial<ClientConfig>) => void;
14
16
  export declare const enhancedFetch: <T = any>({ path, method, params, body, }: RequestInit & {
15
17
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
16
18
  path: string;
17
- params?: Record<string, any>;
19
+ params?: Record<string, any> & DjustConfig;
18
20
  }) => Promise<{
19
21
  data: T;
20
22
  headers: Headers;
@@ -60,12 +60,12 @@ const serializeParams = (params, useRepeat) => {
60
60
  }
61
61
  return qs.stringify(params, { arrayFormat: "bracket", skipNull: true });
62
62
  };
63
- const enhancedFetch = async ({ path, method, params, body, }) => {
64
- var _a, _b, _c;
63
+ const enhancedFetch = async ({ path, method, params = {}, body, }) => {
64
+ var _a, _b, _c, _d, _e, _f;
65
65
  if (!isClientInitialized(clientConfig)) {
66
66
  throw new Error('[Djust SDK] SDK not initialized. Provide both client ID and API key via the "initialize" method.');
67
67
  }
68
- const { clientId, apiKey, accessToken, locale, headers, storeId, storeViewId, } = clientConfig;
68
+ const { clientId, apiKey, accessToken, locale, headers } = clientConfig;
69
69
  const requestHeaders = new Headers({
70
70
  "dj-client": clientId,
71
71
  "dj-api-key": apiKey,
@@ -81,6 +81,13 @@ const enhancedFetch = async ({ path, method, params, body, }) => {
81
81
  requestHeaders.append("Authorization", `Bearer ${accessToken}`);
82
82
  if (locale)
83
83
  requestHeaders.append("locale", locale);
84
+ // Use provided params or fallback to clientConfig defaults
85
+ const customerAccountId = (_a = params.customerAccountId) !== null && _a !== void 0 ? _a : clientConfig.customerAccountId;
86
+ const storeId = (_b = params.storeId) !== null && _b !== void 0 ? _b : clientConfig.storeId;
87
+ const storeViewId = (_c = params.storeViewId) !== null && _c !== void 0 ? _c : clientConfig.storeViewId;
88
+ // Add headers dynamically if they exist
89
+ if (customerAccountId)
90
+ requestHeaders.append("customer-account-id", customerAccountId);
84
91
  if (storeId)
85
92
  requestHeaders.append("dj-store", storeId);
86
93
  if (storeViewId)
@@ -105,17 +112,17 @@ const enhancedFetch = async ({ path, method, params, body, }) => {
105
112
  const errorMessage = await response.text();
106
113
  throw new Error(`[Djust SDK] HTTP error ${status}: ${errorMessage}`);
107
114
  }
108
- const isJsonResponse = (_a = headers
109
- .get("content-type")) === null || _a === void 0 ? void 0 : _a.includes("application/json");
115
+ const isJsonResponse = (_d = headers
116
+ .get("content-type")) === null || _d === void 0 ? void 0 : _d.includes("application/json");
110
117
  // Additional check: ensure the response has content before attempting to parse JSON
111
118
  const responseText = await response.text();
112
119
  const data = isJsonResponse && responseText
113
120
  ? JSON.parse(responseText)
114
121
  : {};
115
122
  // Check if response data contains new accessToken and update configuration
116
- if (data && ((_b = data === null || data === void 0 ? void 0 : data.token) === null || _b === void 0 ? void 0 : _b.accessToken)) {
123
+ if (data && ((_e = data === null || data === void 0 ? void 0 : data.token) === null || _e === void 0 ? void 0 : _e.accessToken)) {
117
124
  (0, exports.updateConfiguration)({
118
- accessToken: (_c = data === null || data === void 0 ? void 0 : data.token) === null || _c === void 0 ? void 0 : _c.accessToken,
125
+ accessToken: (_f = data === null || data === void 0 ? void 0 : data.token) === null || _f === void 0 ? void 0 : _f.accessToken,
119
126
  });
120
127
  }
121
128
  return { data, headers, status };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "1.19.2",
3
+ "version": "1.20.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",