@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
|
-
|
|
5
|
+
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
## 🚀 **Why use DJUST Front SDK ?**
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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
|
|
10
|
-
createCustomerUserRequest
|
|
11
|
-
createObjectCustomerAccountRequest
|
|
12
|
-
customFieldValues
|
|
13
|
-
customerTagList
|
|
14
|
-
fromFO
|
|
15
|
-
legalUser
|
|
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)
|