@djust-b2b/djust-front-sdk 1.8.0 → 1.10.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 +4 -1
- package/lib/services/commercial-order/definitions.d.ts +4 -8
- package/lib/services/commercial-order/index.d.ts +3 -3
- package/lib/services/commercial-order/index.js +7 -6
- package/lib/services/customer-account/definitions.d.ts +9 -0
- package/lib/services/customer-account/index.d.ts +5 -1
- package/lib/services/customer-account/index.js +27 -0
- package/lib/services/customer-user/definitions.d.ts +3 -0
- package/lib/services/customer-user/index.d.ts +5 -1
- package/lib/services/customer-user/index.js +11 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -31,11 +31,12 @@ 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
|
-
|
|
34
|
+
updateLogisticOrderCustomFieldsValue({ orderLogisticId, customFieldsValues, }: import("./interfaces").UpdateOrderLogisticCustomFieldParameters): Promise<import("./interfaces").UpdateOrderLogisticCustomFieldResponse>;
|
|
35
35
|
getLogisticOrders({ approvalIds, locale, logisticStatus, incident, paymentOptions, nbPreviewLines, page, size, sort, }: import("./interfaces").GetLogisticOrdersParameters): Promise<import("./interfaces").GetLogisticOrdersResponse>;
|
|
36
36
|
getLogisticOrderCustomFields({ customFieldIds, page, size, sort, }: import("./interfaces").GetLogisticOrderCustomFieldsParameters): Promise<import("./interfaces").GetLogisticOrderCustomFieldsResponse>;
|
|
37
37
|
getLogisticOrderLineCustomFields({ customFieldIds, page, size, sort, }: import("./interfaces").GetLogisticOrderLineCustomFieldsParameters): Promise<import("./interfaces").GetLogisticOrderLineCustomFieldsResponse>;
|
|
38
38
|
getLogisticOrder({ orderId, locale, nbPreviewLines, }: import("./interfaces").GetLogisticOrderParameters): Promise<import("./interfaces").GetLogisticOrderResponse>;
|
|
39
|
+
updateLogisticOrderCustomFields({ orderId, locale, nbPreviewLines, customFields, }: import("./interfaces").UpdateLogisticOrderCustomFieldsParameters): Promise<import("./interfaces").UpdateLogisticOrderCustomFieldsResponse>;
|
|
39
40
|
getLogisticOrderAccountingDocuments({ orderId, }: import("./interfaces").GetLogisticOrderAccountingDocumentsParameters): Promise<import("./interfaces").GetLogisticOrderAccountingDocumentsResponse>;
|
|
40
41
|
getLogisticOrderAccountingDocumentUrl({ orderId, documentId, }: import("./interfaces").GetLogisticOrderAccountingDocumentUrlParameters): Promise<string[]>;
|
|
41
42
|
approveLogisticOrder({ orderId, locale, nbPreviewLines, }: import("./interfaces").ApproveLogisticOrderParameters): Promise<import("./interfaces").ApproveLogisticOrderResponse>;
|
|
@@ -89,6 +90,7 @@ export declare const DjustSDK: {
|
|
|
89
90
|
getAuthenticatedUser(): Promise<any>;
|
|
90
91
|
createCustomerUser({ activationUrl, civility, customFieldValues, email, externalId, firstName, lastName, password, groups, status, mainOrganisationId, organisations, phone, }: import("./interfaces").CreateCustomerUserParameters): Promise<import("./interfaces").CreateCustomerUserResponse>;
|
|
91
92
|
updateCustomerUser({ civility, firstName, lastName, phone, customFieldValues, }: import("./interfaces").UpdateCustomerUserParameters): Promise<import("./interfaces").UpdateCustomerUserResponse>;
|
|
93
|
+
removeCustomerUserFromAccount({ userId, }: import("./interfaces").RemoveCustomerUserParameters): Promise<void>;
|
|
92
94
|
activateCustomerUser({ token, }: import("./interfaces").ActivateCustomerUserParameters): Promise<void>;
|
|
93
95
|
getCustomerUserAddresses({ shipping, billing, account, organisationIds, }: import("./interfaces").GetCustomerUserAddressesParameters): Promise<void>;
|
|
94
96
|
getCustomerUserOrganisations(): Promise<import("./interfaces").GetCustomerUserOrganisationsResponse>;
|
|
@@ -102,6 +104,7 @@ export declare const DjustSDK: {
|
|
|
102
104
|
updateCustomerAccountAddress({ addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }: import("./interfaces").UpdateCustomerAccountAddressParameters): Promise<import("./interfaces").UpdateCustomerAccountAddressResponse>;
|
|
103
105
|
getCustomerAccountOrders({ pageable, locale, }: import("./interfaces").GetCustomerAccountOrdersParameters): Promise<import("./interfaces").GetCustomerAccountOrdersResponse>;
|
|
104
106
|
getCustomerAccountUsers({ pageable, }: import("./interfaces").GetCustomerAccountUsersParameters): Promise<import("./interfaces").GetCustomerAccountUsersResponse>;
|
|
107
|
+
createCustomerAccountUser({ accountId, civility, firstName, lastName, email, password, groups, }: import("./interfaces").CreateCustomerAccountUsersParameters): Promise<void>;
|
|
105
108
|
createCustomerAccountOrganisation({ externalId, name, parentId, }: import("./interfaces").CreateCustomerAccountOrganisationParameters): Promise<import("./interfaces").CreateCustomerAccountOrganisationResponse>;
|
|
106
109
|
updateCustomerAccountOrganisation({ organisationId, name, parentId, status, }: import("./interfaces").UpdateCustomerAccountOrganisationParameters): Promise<import("./interfaces").UpdateCustomerAccountOrganisationResponse>;
|
|
107
110
|
getCustomerAccountOrganisations(): Promise<import("./interfaces").GetCustomerAccountOrganisationResponse>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Channel } from "../../interfaces/models/common";
|
|
2
2
|
import { CustomFieldValueRequest } from "../../interfaces/models/custom-field";
|
|
3
|
-
import { OrderCommercialDto, OrderIdType, OrderOrigin, PageOrderCommercialDto } from "../../interfaces/models/order";
|
|
3
|
+
import { OrderCommercialDto, OrderIdType, OrderLogisticDto, OrderOrigin, PageOrderCommercialDto } from "../../interfaces/models/order";
|
|
4
4
|
import { PaymentInfoRequest, PaymentOption, PaymentProvider } from "../../interfaces/models/payment";
|
|
5
5
|
/**
|
|
6
6
|
* Request parameters type definitions
|
|
@@ -53,15 +53,9 @@ 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
56
|
export interface UpdateOrderLogisticCustomFieldParameters {
|
|
63
57
|
orderLogisticId: string;
|
|
64
|
-
|
|
58
|
+
customFieldsValues: CustomFieldValueRequest[];
|
|
65
59
|
}
|
|
66
60
|
/**
|
|
67
61
|
* Response type definitions
|
|
@@ -72,3 +66,5 @@ export interface CreateCommercialOrderResponse extends OrderCommercialDto {
|
|
|
72
66
|
}
|
|
73
67
|
export interface GetCommercialOrderResponse extends OrderCommercialDto {
|
|
74
68
|
}
|
|
69
|
+
export interface UpdateOrderLogisticCustomFieldResponse extends OrderLogisticDto {
|
|
70
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateCommercialOrderParameters, CreateCommercialOrderResponse, GetCommercialOrderParameters, GetCommercialOrderPaymentPageUrlParameters, GetCommercialOrderResponse, GetCommercialOrdersParameters, GetCommercialOrdersResponse, SetCommercialOrderStatusAsCreatedParameters, SetCommercialOrderStatusAsOnHoldParameters, UpdateCommercialOrderBillingInformationParameters, UpdateCommercialOrderShippingAddressParameters, UpdateCommercialOrderShippingInformationParameters, UpdateCommercialOrderShippingTypeParameters, UpdateOrderLogisticCustomFieldParameters } from "./definitions";
|
|
1
|
+
import { CreateCommercialOrderParameters, CreateCommercialOrderResponse, GetCommercialOrderParameters, GetCommercialOrderPaymentPageUrlParameters, GetCommercialOrderResponse, GetCommercialOrdersParameters, GetCommercialOrdersResponse, SetCommercialOrderStatusAsCreatedParameters, SetCommercialOrderStatusAsOnHoldParameters, UpdateCommercialOrderBillingInformationParameters, UpdateCommercialOrderShippingAddressParameters, UpdateCommercialOrderShippingInformationParameters, UpdateCommercialOrderShippingTypeParameters, UpdateOrderLogisticCustomFieldParameters, UpdateOrderLogisticCustomFieldResponse } from "./definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Get commercial orders
|
|
4
4
|
*/
|
|
@@ -40,6 +40,6 @@ export declare function updateCommercialOrderShippingInformation({ orderId, ship
|
|
|
40
40
|
*/
|
|
41
41
|
export declare function updateCommercialOrderShippingType({ orderId, shippingType, }: UpdateCommercialOrderShippingTypeParameters): Promise<void>;
|
|
42
42
|
/**
|
|
43
|
-
* Update
|
|
43
|
+
* Update order logistic custom fields value
|
|
44
44
|
*/
|
|
45
|
-
export declare function
|
|
45
|
+
export declare function updateLogisticOrderCustomFieldsValue({ orderLogisticId, customFieldsValues, }: UpdateOrderLogisticCustomFieldParameters): Promise<UpdateOrderLogisticCustomFieldResponse>;
|
|
@@ -10,7 +10,7 @@ exports.getCommercialOrderPaymentPageUrl = getCommercialOrderPaymentPageUrl;
|
|
|
10
10
|
exports.updateCommercialOrderShippingAddress = updateCommercialOrderShippingAddress;
|
|
11
11
|
exports.updateCommercialOrderShippingInformation = updateCommercialOrderShippingInformation;
|
|
12
12
|
exports.updateCommercialOrderShippingType = updateCommercialOrderShippingType;
|
|
13
|
-
exports.
|
|
13
|
+
exports.updateLogisticOrderCustomFieldsValue = updateLogisticOrderCustomFieldsValue;
|
|
14
14
|
const parameters_validation_1 = require("../../helpers/parameters-validation");
|
|
15
15
|
const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
16
16
|
/**
|
|
@@ -155,15 +155,16 @@ async function updateCommercialOrderShippingType({ orderId, shippingType, }) {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
|
-
* Update
|
|
158
|
+
* Update order logistic custom fields value
|
|
159
159
|
*/
|
|
160
|
-
async function
|
|
160
|
+
async function updateLogisticOrderCustomFieldsValue({ orderLogisticId, customFieldsValues, }) {
|
|
161
161
|
(0, parameters_validation_1.required)({ orderLogisticId });
|
|
162
|
-
(0, fetch_instance_1.enhancedFetch)({
|
|
162
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
163
163
|
method: "PUT",
|
|
164
|
-
path: `/v1/shop/logistic-orders/${orderLogisticId}
|
|
164
|
+
path: `/v1/shop/logistic-orders/${orderLogisticId}`,
|
|
165
165
|
body: JSON.stringify({
|
|
166
|
-
|
|
166
|
+
customFieldsValues,
|
|
167
167
|
}),
|
|
168
168
|
});
|
|
169
|
+
return data;
|
|
169
170
|
}
|
|
@@ -26,6 +26,15 @@ export interface UpdateCustomerAccountParameters {
|
|
|
26
26
|
vatNumber?: string;
|
|
27
27
|
website?: string;
|
|
28
28
|
}
|
|
29
|
+
export interface CreateCustomerAccountUsersParameters {
|
|
30
|
+
accountId: string;
|
|
31
|
+
civility: string;
|
|
32
|
+
firstName: string;
|
|
33
|
+
lastName: string;
|
|
34
|
+
email: string;
|
|
35
|
+
password: string;
|
|
36
|
+
groups: string[];
|
|
37
|
+
}
|
|
29
38
|
export interface GetCustomerAccountAddressesParameters {
|
|
30
39
|
shipping?: boolean;
|
|
31
40
|
billing?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
1
|
+
import { CreateCustomerAccountAddressParameters, CreateCustomerAccountAddressResponse, CreateCustomerAccountOrganisationParameters, CreateCustomerAccountOrganisationResponse, CreateCustomerAccountParameters, CreateCustomerAccountResponse, CreateCustomerAccountUsersParameters, 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
|
*/
|
|
@@ -35,6 +35,10 @@ export declare function getCustomerAccountOrders({ pageable, locale, }: GetCusto
|
|
|
35
35
|
* Get a customer account's users
|
|
36
36
|
*/
|
|
37
37
|
export declare function getCustomerAccountUsers({ pageable, }: GetCustomerAccountUsersParameters): Promise<GetCustomerAccountUsersResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Create a customer account's user
|
|
40
|
+
*/
|
|
41
|
+
export declare function createCustomerAccountUser({ accountId, civility, firstName, lastName, email, password, groups, }: CreateCustomerAccountUsersParameters): Promise<void>;
|
|
38
42
|
/**
|
|
39
43
|
* Create a customer account's organisation
|
|
40
44
|
*/
|
|
@@ -9,6 +9,7 @@ exports.deleteCustomerAccountAddress = deleteCustomerAccountAddress;
|
|
|
9
9
|
exports.updateCustomerAccountAddress = updateCustomerAccountAddress;
|
|
10
10
|
exports.getCustomerAccountOrders = getCustomerAccountOrders;
|
|
11
11
|
exports.getCustomerAccountUsers = getCustomerAccountUsers;
|
|
12
|
+
exports.createCustomerAccountUser = createCustomerAccountUser;
|
|
12
13
|
exports.createCustomerAccountOrganisation = createCustomerAccountOrganisation;
|
|
13
14
|
exports.updateCustomerAccountOrganisation = updateCustomerAccountOrganisation;
|
|
14
15
|
exports.getCustomerAccountOrganisations = getCustomerAccountOrganisations;
|
|
@@ -189,6 +190,32 @@ async function getCustomerAccountUsers({ pageable, }) {
|
|
|
189
190
|
});
|
|
190
191
|
return data;
|
|
191
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Create a customer account's user
|
|
195
|
+
*/
|
|
196
|
+
async function createCustomerAccountUser({ accountId, civility, firstName, lastName, email, password, groups, }) {
|
|
197
|
+
(0, parameters_validation_1.required)({
|
|
198
|
+
accountId,
|
|
199
|
+
civility,
|
|
200
|
+
firstName,
|
|
201
|
+
lastName,
|
|
202
|
+
email,
|
|
203
|
+
password,
|
|
204
|
+
groups,
|
|
205
|
+
});
|
|
206
|
+
await (0, fetch_instance_1.enhancedFetch)({
|
|
207
|
+
method: "POST",
|
|
208
|
+
path: `/v1/shop/customer-accounts/${accountId}/customer-users`,
|
|
209
|
+
body: JSON.stringify({
|
|
210
|
+
civility,
|
|
211
|
+
firstName,
|
|
212
|
+
lastName,
|
|
213
|
+
email,
|
|
214
|
+
password,
|
|
215
|
+
groups,
|
|
216
|
+
}),
|
|
217
|
+
});
|
|
218
|
+
}
|
|
192
219
|
/**
|
|
193
220
|
* Create a customer account's organisation
|
|
194
221
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActivateCustomerUserParameters, CreateCustomerUserParameters, CreateCustomerUserResponse, GetCustomerUserAddressesParameters, GetCustomerUserOrganisationsResponse, SendCustomerUserActivationRequestParameters, UpdateCustomerUserParameters, UpdateCustomerUserResponse } from "./definitions";
|
|
1
|
+
import { ActivateCustomerUserParameters, CreateCustomerUserParameters, CreateCustomerUserResponse, GetCustomerUserAddressesParameters, GetCustomerUserOrganisationsResponse, RemoveCustomerUserParameters, SendCustomerUserActivationRequestParameters, UpdateCustomerUserParameters, UpdateCustomerUserResponse } from "./definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Get authenticated user
|
|
4
4
|
*/
|
|
@@ -11,6 +11,10 @@ export declare function createCustomerUser({ activationUrl, civility, customFiel
|
|
|
11
11
|
* Update a customer user
|
|
12
12
|
*/
|
|
13
13
|
export declare function updateCustomerUser({ civility, firstName, lastName, phone, customFieldValues, }: UpdateCustomerUserParameters): Promise<UpdateCustomerUserResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Remove a customer user's access to an account
|
|
16
|
+
*/
|
|
17
|
+
export declare function removeCustomerUserFromAccount({ userId, }: RemoveCustomerUserParameters): Promise<void>;
|
|
14
18
|
/**
|
|
15
19
|
* Activate a customer user
|
|
16
20
|
*/
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getAuthenticatedUser = getAuthenticatedUser;
|
|
4
4
|
exports.createCustomerUser = createCustomerUser;
|
|
5
5
|
exports.updateCustomerUser = updateCustomerUser;
|
|
6
|
+
exports.removeCustomerUserFromAccount = removeCustomerUserFromAccount;
|
|
6
7
|
exports.activateCustomerUser = activateCustomerUser;
|
|
7
8
|
exports.getCustomerUserAddresses = getCustomerUserAddresses;
|
|
8
9
|
exports.getCustomerUserOrganisations = getCustomerUserOrganisations;
|
|
@@ -63,6 +64,16 @@ async function updateCustomerUser({ civility, firstName, lastName, phone, custom
|
|
|
63
64
|
});
|
|
64
65
|
return data;
|
|
65
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Remove a customer user's access to an account
|
|
69
|
+
*/
|
|
70
|
+
async function removeCustomerUserFromAccount({ userId, }) {
|
|
71
|
+
(0, parameters_validation_1.required)({ userId });
|
|
72
|
+
await (0, fetch_instance_1.enhancedFetch)({
|
|
73
|
+
method: "PUT",
|
|
74
|
+
path: `/v1/shop/customer-users/${userId}/accounts`,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
66
77
|
/**
|
|
67
78
|
* Activate a customer user
|
|
68
79
|
*/
|