@djust-b2b/djust-front-sdk 1.8.0 → 1.9.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 +2 -0
- 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
|
@@ -89,6 +89,7 @@ export declare const DjustSDK: {
|
|
|
89
89
|
getAuthenticatedUser(): Promise<any>;
|
|
90
90
|
createCustomerUser({ activationUrl, civility, customFieldValues, email, externalId, firstName, lastName, password, groups, status, mainOrganisationId, organisations, phone, }: import("./interfaces").CreateCustomerUserParameters): Promise<import("./interfaces").CreateCustomerUserResponse>;
|
|
91
91
|
updateCustomerUser({ civility, firstName, lastName, phone, customFieldValues, }: import("./interfaces").UpdateCustomerUserParameters): Promise<import("./interfaces").UpdateCustomerUserResponse>;
|
|
92
|
+
removeCustomerUserFromAccount({ userId, }: import("./interfaces").RemoveCustomerUserParameters): Promise<void>;
|
|
92
93
|
activateCustomerUser({ token, }: import("./interfaces").ActivateCustomerUserParameters): Promise<void>;
|
|
93
94
|
getCustomerUserAddresses({ shipping, billing, account, organisationIds, }: import("./interfaces").GetCustomerUserAddressesParameters): Promise<void>;
|
|
94
95
|
getCustomerUserOrganisations(): Promise<import("./interfaces").GetCustomerUserOrganisationsResponse>;
|
|
@@ -102,6 +103,7 @@ export declare const DjustSDK: {
|
|
|
102
103
|
updateCustomerAccountAddress({ addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }: import("./interfaces").UpdateCustomerAccountAddressParameters): Promise<import("./interfaces").UpdateCustomerAccountAddressResponse>;
|
|
103
104
|
getCustomerAccountOrders({ pageable, locale, }: import("./interfaces").GetCustomerAccountOrdersParameters): Promise<import("./interfaces").GetCustomerAccountOrdersResponse>;
|
|
104
105
|
getCustomerAccountUsers({ pageable, }: import("./interfaces").GetCustomerAccountUsersParameters): Promise<import("./interfaces").GetCustomerAccountUsersResponse>;
|
|
106
|
+
createCustomerAccountUser({ accountId, civility, firstName, lastName, email, password, groups, }: import("./interfaces").CreateCustomerAccountUsersParameters): Promise<void>;
|
|
105
107
|
createCustomerAccountOrganisation({ externalId, name, parentId, }: import("./interfaces").CreateCustomerAccountOrganisationParameters): Promise<import("./interfaces").CreateCustomerAccountOrganisationResponse>;
|
|
106
108
|
updateCustomerAccountOrganisation({ organisationId, name, parentId, status, }: import("./interfaces").UpdateCustomerAccountOrganisationParameters): Promise<import("./interfaces").UpdateCustomerAccountOrganisationResponse>;
|
|
107
109
|
getCustomerAccountOrganisations(): Promise<import("./interfaces").GetCustomerAccountOrganisationResponse>;
|
|
@@ -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
|
*/
|