@djust-b2b/djust-front-sdk 1.21.2 → 1.21.4

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/README.md CHANGED
@@ -1,19 +1,50 @@
1
+ # Introduction
1
2
 
2
- DJUST Front SDK
3
+ **DJUST Front SDK** is a JavaScript development kit designed to simplify and optimize API calls to the DJUST backend. It offers a secure, high-performance, and ready-to-use solution for integration partners, thus facilitating the implementation of robust e-commerce solutions for your clients.
3
4
 
4
- Djust Team
5
+ ---
5
6
 
6
- DJUST Front SDK is a versatile JavaScript Software Development Kit (SDK) designed for seamless integration with DJUST's Frontend API. This SDK empowers developers by offering a collection of convenient methods for handling common data and executing essential actions required to craft engaging storefronts and streamline checkout processes.
7
+ ## 🚀 **Why use DJUST Front SDK ?**
7
8
 
8
- Features
9
- Universal Compatibility: DJUST Front SDK is built to seamlessly integrate with any JavaScript environment, making it a universal solution for frontend development.
9
+ ### **🔒 Secure API Calls**
10
+ Ensure secure communications between your frontend applications and the DJUST backend through integrated mechanisms for managing requests and responses.
10
11
 
11
- Storefront Creation: Simplify the process of creating captivating storefronts with our SDK's comprehensive set of tools. Effortlessly manage product displays, categories, and customer interactions.
12
+ ### **⚡ Performance Optimization**
13
+ DJUST Front SDK is designed to:
14
+ - Minimize response times through optimized methods.
15
+ - Efficiently manage API calls by avoiding redundancies.
12
16
 
13
- Checkout Flows: Enable smooth and intuitive checkout experiences with DJUST Front SDK. The SDK provides methods to handle various aspects of the checkout process, ensuring a hassle-free journey for users.
17
+ ### **🧩 A Simplified Integration**
18
+ - **Easy to configure** : A clear and documented API for a quick start.
19
+ - **Universal** : Compatible with all JavaScript environments (Vue.js, React, Nuxt, Angular, etc.).
14
20
 
15
- Customization: Tailor the look and feel of your storefront to match your brand identity. DJUST Front SDK offers customization options for UI elements, ensuring a cohesive and branded user experience.
21
+ ### **🔧 Flexibility and Modularity**
22
+ Use only the methods you need for your projects. The SDK is modular, allowing you to tailor the integration according to your clients' requirements.
16
23
 
24
+ ---
17
25
 
18
- License
19
- DJUST Front SDK is licensed under the MIT License. Feel free to use, modify, and distribute it in your projects.
26
+ ## 🛡️ **Security and Compliance**
27
+
28
+ The SDK incorporates best practices to ensure :
29
+ - A **secure management of authentication tokens**.
30
+ - Compliance with security standards to protect data exchanges.
31
+ - A **reliability** in requests through centralized error handling.
32
+
33
+ ---
34
+
35
+ ## 📈 **Benefits for Partners**
36
+
37
+ - **Accelerate your integrations** : Save time by using a ready-to-use SDK.
38
+ - **Secure your projects** : Assure your clients with robust and secure backend calls.
39
+ - **Maximize performance** : Provide smooth experiences with fast and optimized interactions.
40
+
41
+ ---
42
+
43
+ ## 📄 **Licence**
44
+
45
+ DJUST Front SDK is distributed under the **MIT license**, providing you with complete freedom to use it in your projects.
46
+
47
+
48
+ ---
49
+
50
+ With **DJUST Front SDK**, simplify your backend integrations, ensure exceptional performance, and provide reliable and secure e-commerce solutions for your clients.
@@ -6,13 +6,13 @@ import { CreateObjectCustomerAccountRequest, CustomerAccountDto, LegalUserDto }
6
6
  import { CustomerOrganisationDto, CustomerOrganisationStatus } from "../../interfaces/models/customer-organisation";
7
7
  import { CivilityType, CreateCustomerUserRequest, PageCustomerUser, PageCustomerUserDto } from "../../interfaces/models/customer-user";
8
8
  export interface CreateCustomerAccountParameters {
9
- createAddressRequests: CreateAddressRequest[];
10
- createCustomerUserRequest: CreateCustomerUserRequest;
11
- createObjectCustomerAccountRequest: CreateObjectCustomerAccountRequest;
12
- customFieldValues: CustomFieldValueRequest[];
13
- customerTagList: string[];
14
- fromFO: boolean;
15
- legalUser: LegalUserDto;
9
+ createAddressRequests?: CreateAddressRequest[];
10
+ createCustomerUserRequest?: CreateCustomerUserRequest;
11
+ createObjectCustomerAccountRequest?: CreateObjectCustomerAccountRequest;
12
+ customFieldValues?: CustomFieldValueRequest[];
13
+ customerTagList?: string[];
14
+ fromFO?: boolean;
15
+ legalUser?: LegalUserDto;
16
16
  }
17
17
  export interface UpdateCustomerAccountParameters {
18
18
  organisationId: string;
@@ -411,10 +411,16 @@ async function updateCustomerAccountAddress({ addressId, additionalAddress, addr
411
411
  * @returns {Promise<GetCustomerAccountOrdersResponse>} - The response containing the customer account orders.
412
412
  */
413
413
  async function getCustomerAccountOrders(params) {
414
+ var _a, _b, _c;
414
415
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
415
416
  method: "GET",
416
417
  path: `/v1/shop/customer-accounts/orders`,
417
- params,
418
+ params: {
419
+ page: (_a = params.pageable) === null || _a === void 0 ? void 0 : _a.page,
420
+ size: (_b = params.pageable) === null || _b === void 0 ? void 0 : _b.size,
421
+ sort: (_c = params.pageable) === null || _c === void 0 ? void 0 : _c.sort,
422
+ locale: params.locale,
423
+ },
418
424
  });
419
425
  return data;
420
426
  }
@@ -444,11 +450,16 @@ async function getCustomerAccountOrders(params) {
444
450
  * ```
445
451
  */
446
452
  async function getCustomerAccountUsers(params) {
453
+ var _a, _b, _c;
447
454
  (0, parameters_validation_1.required)({ pageable: params.pageable });
448
455
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
449
456
  method: "GET",
450
457
  path: `/v1/shop/customer-accounts/users`,
451
- params,
458
+ params: {
459
+ page: (_a = params.pageable) === null || _a === void 0 ? void 0 : _a.page,
460
+ size: (_b = params.pageable) === null || _b === void 0 ? void 0 : _b.size,
461
+ sort: (_c = params.pageable) === null || _c === void 0 ? void 0 : _c.sort,
462
+ },
452
463
  });
453
464
  return data;
454
465
  }
@@ -719,6 +730,7 @@ async function updateCustomerAccountOrganisationAddress(params) {
719
730
  * ```
720
731
  */
721
732
  async function getCustomerAccountOrganisationOrders(params) {
733
+ var _a, _b, _c;
722
734
  (0, parameters_validation_1.required)({
723
735
  organisationId: params.organisationId,
724
736
  pageable: params.pageable,
@@ -727,7 +739,12 @@ async function getCustomerAccountOrganisationOrders(params) {
727
739
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
728
740
  method: "GET",
729
741
  path: `/v1/shop/customer-accounts/organisations/${params.organisationId}/orders`,
730
- params,
742
+ params: {
743
+ page: (_a = params.pageable) === null || _a === void 0 ? void 0 : _a.page,
744
+ size: (_b = params.pageable) === null || _b === void 0 ? void 0 : _b.size,
745
+ sort: (_c = params.pageable) === null || _c === void 0 ? void 0 : _c.sort,
746
+ locale: params.locale,
747
+ },
731
748
  });
732
749
  return data;
733
750
  }
@@ -759,6 +776,7 @@ async function getCustomerAccountOrganisationOrders(params) {
759
776
  * ```
760
777
  */
761
778
  async function getCustomerAccountOrganisationUsers(params) {
779
+ var _a, _b, _c;
762
780
  (0, parameters_validation_1.required)({
763
781
  organisationId: params.organisationId,
764
782
  pageable: params.pageable,
@@ -766,7 +784,11 @@ async function getCustomerAccountOrganisationUsers(params) {
766
784
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
767
785
  method: "GET",
768
786
  path: `/v1/shop/customer-accounts/organisations/${params.organisationId}/users`,
769
- params,
787
+ params: {
788
+ page: (_a = params.pageable) === null || _a === void 0 ? void 0 : _a.page,
789
+ size: (_b = params.pageable) === null || _b === void 0 ? void 0 : _b.size,
790
+ sort: (_c = params.pageable) === null || _c === void 0 ? void 0 : _c.sort,
791
+ },
770
792
  });
771
793
  return data;
772
794
  }
@@ -94,12 +94,6 @@ const enhancedFetch = async ({ path, method, params = {}, body, }) => {
94
94
  "dj-api-key": apiKey,
95
95
  "Content-Type": "application/json",
96
96
  });
97
- // if (isBrowser()) {
98
- // const token = getCookie("token");
99
- // if (token) {
100
- // requestHeaders.append("Authorization", `Bearer ${token}`);
101
- // }
102
- // }
103
97
  if (!isPublicRoute(path, method) && accessToken)
104
98
  requestHeaders.append("Authorization", `Bearer ${accessToken}`);
105
99
  if (locale)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "1.21.2",
3
+ "version": "1.21.4",
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",