@revenexx/sdk 0.0.4 → 0.0.6
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/dist/cjs/sdk.js +13491 -6163
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +13464 -6162
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +13491 -6163
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/address-type.ts +4 -0
- package/src/enums/cart-export-format.ts +4 -0
- package/src/enums/cart-io-apply-mode.ts +5 -0
- package/src/enums/cart-io-direction.ts +4 -0
- package/src/enums/cart-io-entity.ts +4 -0
- package/src/enums/cart-io-format.ts +4 -0
- package/src/enums/cart-item-type.ts +5 -0
- package/src/enums/channel-status.ts +4 -0
- package/src/enums/channel-type.ts +7 -0
- package/src/enums/contact-role.ts +6 -0
- package/src/enums/contact-status.ts +5 -0
- package/src/enums/location-type.ts +6 -0
- package/src/enums/market-status.ts +4 -0
- package/src/enums/order-comment-visibility.ts +4 -0
- package/src/enums/order-item-type.ts +5 -0
- package/src/enums/order-list-kind.ts +4 -0
- package/src/enums/order-payment-status.ts +9 -0
- package/src/enums/organization-status.ts +4 -0
- package/src/enums/page-status.ts +5 -0
- package/src/enums/payment-fee-type.ts +5 -0
- package/src/enums/payment-method-kind.ts +4 -0
- package/src/enums/price-entry-type.ts +4 -0
- package/src/enums/price-list-status.ts +4 -0
- package/src/enums/shipping-method-matrix-basis.ts +6 -0
- package/src/enums/shipping-method-pricing-type.ts +5 -0
- package/src/enums/store-asset-request-visibility.ts +4 -0
- package/src/enums/visibility.ts +4 -0
- package/src/index.ts +28 -2
- package/src/models.ts +5309 -1009
- package/src/services/apps.ts +154 -154
- package/src/services/avatars.ts +57 -57
- package/src/services/carts.ts +739 -104
- package/src/services/channels.ts +147 -19
- package/src/services/customers.ts +809 -69
- package/src/services/greetings.ts +18 -18
- package/src/services/inventories.ts +620 -65
- package/src/services/locale.ts +16 -16
- package/src/services/markets.ts +690 -75
- package/src/services/messaging.ts +273 -273
- package/src/services/orderlists.ts +889 -0
- package/src/services/orders.ts +692 -137
- package/src/services/pages.ts +661 -155
- package/src/services/payments.ts +591 -64
- package/src/services/prices.ts +585 -59
- package/src/services/products.ts +1908 -272
- package/src/services/search.ts +24 -24
- package/src/services/shipping.ts +451 -59
- package/src/services/sites.ts +116 -116
- package/src/services/storage.ts +933 -599
- package/src/services/tokens.ts +14 -14
- package/types/enums/address-type.d.ts +4 -0
- package/types/enums/cart-export-format.d.ts +4 -0
- package/types/enums/cart-io-apply-mode.d.ts +5 -0
- package/types/enums/cart-io-direction.d.ts +4 -0
- package/types/enums/cart-io-entity.d.ts +4 -0
- package/types/enums/cart-io-format.d.ts +4 -0
- package/types/enums/cart-item-type.d.ts +5 -0
- package/types/enums/channel-status.d.ts +4 -0
- package/types/enums/channel-type.d.ts +7 -0
- package/types/enums/contact-role.d.ts +6 -0
- package/types/enums/contact-status.d.ts +5 -0
- package/types/enums/location-type.d.ts +6 -0
- package/types/enums/market-status.d.ts +4 -0
- package/types/enums/order-comment-visibility.d.ts +4 -0
- package/types/enums/order-item-type.d.ts +5 -0
- package/types/enums/order-list-kind.d.ts +4 -0
- package/types/enums/order-payment-status.d.ts +9 -0
- package/types/enums/organization-status.d.ts +4 -0
- package/types/enums/page-status.d.ts +5 -0
- package/types/enums/payment-fee-type.d.ts +5 -0
- package/types/enums/payment-method-kind.d.ts +4 -0
- package/types/enums/price-entry-type.d.ts +4 -0
- package/types/enums/price-list-status.d.ts +4 -0
- package/types/enums/shipping-method-matrix-basis.d.ts +6 -0
- package/types/enums/shipping-method-pricing-type.d.ts +5 -0
- package/types/enums/store-asset-request-visibility.d.ts +4 -0
- package/types/enums/visibility.d.ts +4 -0
- package/types/index.d.ts +28 -2
- package/types/models.d.ts +5170 -1010
- package/types/services/carts.d.ts +271 -12
- package/types/services/channels.d.ts +54 -2
- package/types/services/customers.d.ts +298 -12
- package/types/services/inventories.d.ts +225 -11
- package/types/services/markets.d.ts +235 -6
- package/types/services/orderlists.d.ts +324 -0
- package/types/services/orders.d.ts +238 -16
- package/types/services/pages.d.ts +190 -6
- package/types/services/payments.d.ts +221 -7
- package/types/services/prices.d.ts +218 -6
- package/types/services/products.d.ts +672 -32
- package/types/services/shipping.d.ts +168 -6
- package/types/services/storage.d.ts +353 -285
|
@@ -2,6 +2,10 @@ import { Service } from '../service';
|
|
|
2
2
|
import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
|
|
5
|
+
import { AddressType } from '../enums/address-type';
|
|
6
|
+
import { ContactRole } from '../enums/contact-role';
|
|
7
|
+
import { ContactStatus } from '../enums/contact-status';
|
|
8
|
+
import { OrganizationStatus } from '../enums/organization-status';
|
|
5
9
|
|
|
6
10
|
export class Customers {
|
|
7
11
|
client: Client;
|
|
@@ -18,7 +22,7 @@ export class Customers {
|
|
|
18
22
|
customersAddressesList(): Promise<{}> {
|
|
19
23
|
|
|
20
24
|
const apiPath = '/v1/customers/addresses';
|
|
21
|
-
const
|
|
25
|
+
const apiPayload: Payload = {};
|
|
22
26
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
23
27
|
|
|
24
28
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -28,19 +32,143 @@ export class Customers {
|
|
|
28
32
|
'get',
|
|
29
33
|
uri,
|
|
30
34
|
apiHeaders,
|
|
31
|
-
|
|
35
|
+
apiPayload
|
|
32
36
|
);
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
/**
|
|
36
40
|
*
|
|
41
|
+
* @param {string} params.city -
|
|
42
|
+
* @param {string} params.country - ISO 3166-1 alpha-2 code.
|
|
43
|
+
* @param {string} params.street -
|
|
44
|
+
* @param {string} params.zip -
|
|
45
|
+
* @param {string} params.company -
|
|
46
|
+
* @param {string} params.contactId - Owning contact (personal address).
|
|
47
|
+
* @param {boolean} params.isDefault - The default address of its owner and type.
|
|
48
|
+
* @param {string} params.name - Recipient name.
|
|
49
|
+
* @param {string} params.organizationId - Owning organization (company address).
|
|
50
|
+
* @param {string} params.phone -
|
|
51
|
+
* @param {string} params.region -
|
|
52
|
+
* @param {string} params.street2 -
|
|
53
|
+
* @param {AddressType} params.type - Default 'shipping'.
|
|
37
54
|
* @throws {RevenexxException}
|
|
38
55
|
* @returns {Promise<Models.Address>}
|
|
39
56
|
*/
|
|
40
|
-
customersAddressesCreate(): Promise<Models.Address
|
|
57
|
+
customersAddressesCreate(params: { city: string, country: string, street: string, zip: string, company?: string, contactId?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street2?: string, type?: AddressType }): Promise<Models.Address>;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param {string} city -
|
|
61
|
+
* @param {string} country - ISO 3166-1 alpha-2 code.
|
|
62
|
+
* @param {string} street -
|
|
63
|
+
* @param {string} zip -
|
|
64
|
+
* @param {string} company -
|
|
65
|
+
* @param {string} contactId - Owning contact (personal address).
|
|
66
|
+
* @param {boolean} isDefault - The default address of its owner and type.
|
|
67
|
+
* @param {string} name - Recipient name.
|
|
68
|
+
* @param {string} organizationId - Owning organization (company address).
|
|
69
|
+
* @param {string} phone -
|
|
70
|
+
* @param {string} region -
|
|
71
|
+
* @param {string} street2 -
|
|
72
|
+
* @param {AddressType} type - Default 'shipping'.
|
|
73
|
+
* @throws {RevenexxException}
|
|
74
|
+
* @returns {Promise<Models.Address>}
|
|
75
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
76
|
+
*/
|
|
77
|
+
customersAddressesCreate(city: string, country: string, street: string, zip: string, company?: string, contactId?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street2?: string, type?: AddressType): Promise<Models.Address>;
|
|
78
|
+
customersAddressesCreate(
|
|
79
|
+
paramsOrFirst: { city: string, country: string, street: string, zip: string, company?: string, contactId?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street2?: string, type?: AddressType } | string,
|
|
80
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (AddressType)?]
|
|
81
|
+
): Promise<Models.Address> {
|
|
82
|
+
let params: { city: string, country: string, street: string, zip: string, company?: string, contactId?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street2?: string, type?: AddressType };
|
|
83
|
+
|
|
84
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
85
|
+
params = (paramsOrFirst || {}) as { city: string, country: string, street: string, zip: string, company?: string, contactId?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street2?: string, type?: AddressType };
|
|
86
|
+
} else {
|
|
87
|
+
params = {
|
|
88
|
+
city: paramsOrFirst as string,
|
|
89
|
+
country: rest[0] as string,
|
|
90
|
+
street: rest[1] as string,
|
|
91
|
+
zip: rest[2] as string,
|
|
92
|
+
company: rest[3] as string,
|
|
93
|
+
contactId: rest[4] as string,
|
|
94
|
+
isDefault: rest[5] as boolean,
|
|
95
|
+
name: rest[6] as string,
|
|
96
|
+
organizationId: rest[7] as string,
|
|
97
|
+
phone: rest[8] as string,
|
|
98
|
+
region: rest[9] as string,
|
|
99
|
+
street2: rest[10] as string,
|
|
100
|
+
type: rest[11] as AddressType
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const city = params.city;
|
|
105
|
+
const country = params.country;
|
|
106
|
+
const street = params.street;
|
|
107
|
+
const zip = params.zip;
|
|
108
|
+
const company = params.company;
|
|
109
|
+
const contactId = params.contactId;
|
|
110
|
+
const isDefault = params.isDefault;
|
|
111
|
+
const name = params.name;
|
|
112
|
+
const organizationId = params.organizationId;
|
|
113
|
+
const phone = params.phone;
|
|
114
|
+
const region = params.region;
|
|
115
|
+
const street2 = params.street2;
|
|
116
|
+
const type = params.type;
|
|
117
|
+
|
|
118
|
+
if (typeof city === 'undefined') {
|
|
119
|
+
throw new RevenexxException('Missing required parameter: "city"');
|
|
120
|
+
}
|
|
121
|
+
if (typeof country === 'undefined') {
|
|
122
|
+
throw new RevenexxException('Missing required parameter: "country"');
|
|
123
|
+
}
|
|
124
|
+
if (typeof street === 'undefined') {
|
|
125
|
+
throw new RevenexxException('Missing required parameter: "street"');
|
|
126
|
+
}
|
|
127
|
+
if (typeof zip === 'undefined') {
|
|
128
|
+
throw new RevenexxException('Missing required parameter: "zip"');
|
|
129
|
+
}
|
|
41
130
|
|
|
42
131
|
const apiPath = '/v1/customers/addresses';
|
|
43
|
-
const
|
|
132
|
+
const apiPayload: Payload = {};
|
|
133
|
+
if (typeof city !== 'undefined') {
|
|
134
|
+
apiPayload['city'] = city;
|
|
135
|
+
}
|
|
136
|
+
if (typeof company !== 'undefined') {
|
|
137
|
+
apiPayload['company'] = company;
|
|
138
|
+
}
|
|
139
|
+
if (typeof contactId !== 'undefined') {
|
|
140
|
+
apiPayload['contact_id'] = contactId;
|
|
141
|
+
}
|
|
142
|
+
if (typeof country !== 'undefined') {
|
|
143
|
+
apiPayload['country'] = country;
|
|
144
|
+
}
|
|
145
|
+
if (typeof isDefault !== 'undefined') {
|
|
146
|
+
apiPayload['is_default'] = isDefault;
|
|
147
|
+
}
|
|
148
|
+
if (typeof name !== 'undefined') {
|
|
149
|
+
apiPayload['name'] = name;
|
|
150
|
+
}
|
|
151
|
+
if (typeof organizationId !== 'undefined') {
|
|
152
|
+
apiPayload['organization_id'] = organizationId;
|
|
153
|
+
}
|
|
154
|
+
if (typeof phone !== 'undefined') {
|
|
155
|
+
apiPayload['phone'] = phone;
|
|
156
|
+
}
|
|
157
|
+
if (typeof region !== 'undefined') {
|
|
158
|
+
apiPayload['region'] = region;
|
|
159
|
+
}
|
|
160
|
+
if (typeof street !== 'undefined') {
|
|
161
|
+
apiPayload['street'] = street;
|
|
162
|
+
}
|
|
163
|
+
if (typeof street2 !== 'undefined') {
|
|
164
|
+
apiPayload['street2'] = street2;
|
|
165
|
+
}
|
|
166
|
+
if (typeof type !== 'undefined') {
|
|
167
|
+
apiPayload['type'] = type;
|
|
168
|
+
}
|
|
169
|
+
if (typeof zip !== 'undefined') {
|
|
170
|
+
apiPayload['zip'] = zip;
|
|
171
|
+
}
|
|
44
172
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
45
173
|
|
|
46
174
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -51,7 +179,7 @@ export class Customers {
|
|
|
51
179
|
'post',
|
|
52
180
|
uri,
|
|
53
181
|
apiHeaders,
|
|
54
|
-
|
|
182
|
+
apiPayload
|
|
55
183
|
);
|
|
56
184
|
}
|
|
57
185
|
|
|
@@ -90,7 +218,7 @@ export class Customers {
|
|
|
90
218
|
}
|
|
91
219
|
|
|
92
220
|
const apiPath = '/v1/customers/addresses/{id}'.replace('{id}', id);
|
|
93
|
-
const
|
|
221
|
+
const apiPayload: Payload = {};
|
|
94
222
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
95
223
|
|
|
96
224
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -100,7 +228,7 @@ export class Customers {
|
|
|
100
228
|
'delete',
|
|
101
229
|
uri,
|
|
102
230
|
apiHeaders,
|
|
103
|
-
|
|
231
|
+
apiPayload
|
|
104
232
|
);
|
|
105
233
|
}
|
|
106
234
|
|
|
@@ -139,7 +267,7 @@ export class Customers {
|
|
|
139
267
|
}
|
|
140
268
|
|
|
141
269
|
const apiPath = '/v1/customers/addresses/{id}'.replace('{id}', id);
|
|
142
|
-
const
|
|
270
|
+
const apiPayload: Payload = {};
|
|
143
271
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
144
272
|
|
|
145
273
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -149,46 +277,138 @@ export class Customers {
|
|
|
149
277
|
'get',
|
|
150
278
|
uri,
|
|
151
279
|
apiHeaders,
|
|
152
|
-
|
|
280
|
+
apiPayload
|
|
153
281
|
);
|
|
154
282
|
}
|
|
155
283
|
|
|
156
284
|
/**
|
|
157
285
|
*
|
|
158
286
|
* @param {string} params.id -
|
|
287
|
+
* @param {string} params.city -
|
|
288
|
+
* @param {string} params.company -
|
|
289
|
+
* @param {string} params.contactId - Owning contact (personal address).
|
|
290
|
+
* @param {string} params.country - ISO 3166-1 alpha-2 code.
|
|
291
|
+
* @param {boolean} params.isDefault - The default address of its owner and type.
|
|
292
|
+
* @param {string} params.name - Recipient name.
|
|
293
|
+
* @param {string} params.organizationId - Owning organization (company address).
|
|
294
|
+
* @param {string} params.phone -
|
|
295
|
+
* @param {string} params.region -
|
|
296
|
+
* @param {string} params.street -
|
|
297
|
+
* @param {string} params.street2 -
|
|
298
|
+
* @param {AddressType} params.type - Default 'shipping'.
|
|
299
|
+
* @param {string} params.zip -
|
|
159
300
|
* @throws {RevenexxException}
|
|
160
301
|
* @returns {Promise<Models.Address>}
|
|
161
302
|
*/
|
|
162
|
-
customersAddressesUpdate(params: { id: string }): Promise<Models.Address>;
|
|
303
|
+
customersAddressesUpdate(params: { id: string, city?: string, company?: string, contactId?: string, country?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street?: string, street2?: string, type?: AddressType, zip?: string }): Promise<Models.Address>;
|
|
163
304
|
/**
|
|
164
305
|
*
|
|
165
306
|
* @param {string} id -
|
|
307
|
+
* @param {string} city -
|
|
308
|
+
* @param {string} company -
|
|
309
|
+
* @param {string} contactId - Owning contact (personal address).
|
|
310
|
+
* @param {string} country - ISO 3166-1 alpha-2 code.
|
|
311
|
+
* @param {boolean} isDefault - The default address of its owner and type.
|
|
312
|
+
* @param {string} name - Recipient name.
|
|
313
|
+
* @param {string} organizationId - Owning organization (company address).
|
|
314
|
+
* @param {string} phone -
|
|
315
|
+
* @param {string} region -
|
|
316
|
+
* @param {string} street -
|
|
317
|
+
* @param {string} street2 -
|
|
318
|
+
* @param {AddressType} type - Default 'shipping'.
|
|
319
|
+
* @param {string} zip -
|
|
166
320
|
* @throws {RevenexxException}
|
|
167
321
|
* @returns {Promise<Models.Address>}
|
|
168
322
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
169
323
|
*/
|
|
170
|
-
customersAddressesUpdate(id: string): Promise<Models.Address>;
|
|
324
|
+
customersAddressesUpdate(id: string, city?: string, company?: string, contactId?: string, country?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street?: string, street2?: string, type?: AddressType, zip?: string): Promise<Models.Address>;
|
|
171
325
|
customersAddressesUpdate(
|
|
172
|
-
paramsOrFirst: { id: string } | string
|
|
326
|
+
paramsOrFirst: { id: string, city?: string, company?: string, contactId?: string, country?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street?: string, street2?: string, type?: AddressType, zip?: string } | string,
|
|
327
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (AddressType)?, (string)?]
|
|
173
328
|
): Promise<Models.Address> {
|
|
174
|
-
let params: { id: string };
|
|
329
|
+
let params: { id: string, city?: string, company?: string, contactId?: string, country?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street?: string, street2?: string, type?: AddressType, zip?: string };
|
|
175
330
|
|
|
176
331
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
177
|
-
params = (paramsOrFirst || {}) as { id: string };
|
|
332
|
+
params = (paramsOrFirst || {}) as { id: string, city?: string, company?: string, contactId?: string, country?: string, isDefault?: boolean, name?: string, organizationId?: string, phone?: string, region?: string, street?: string, street2?: string, type?: AddressType, zip?: string };
|
|
178
333
|
} else {
|
|
179
334
|
params = {
|
|
180
|
-
id: paramsOrFirst as string
|
|
335
|
+
id: paramsOrFirst as string,
|
|
336
|
+
city: rest[0] as string,
|
|
337
|
+
company: rest[1] as string,
|
|
338
|
+
contactId: rest[2] as string,
|
|
339
|
+
country: rest[3] as string,
|
|
340
|
+
isDefault: rest[4] as boolean,
|
|
341
|
+
name: rest[5] as string,
|
|
342
|
+
organizationId: rest[6] as string,
|
|
343
|
+
phone: rest[7] as string,
|
|
344
|
+
region: rest[8] as string,
|
|
345
|
+
street: rest[9] as string,
|
|
346
|
+
street2: rest[10] as string,
|
|
347
|
+
type: rest[11] as AddressType,
|
|
348
|
+
zip: rest[12] as string
|
|
181
349
|
};
|
|
182
350
|
}
|
|
183
351
|
|
|
184
352
|
const id = params.id;
|
|
353
|
+
const city = params.city;
|
|
354
|
+
const company = params.company;
|
|
355
|
+
const contactId = params.contactId;
|
|
356
|
+
const country = params.country;
|
|
357
|
+
const isDefault = params.isDefault;
|
|
358
|
+
const name = params.name;
|
|
359
|
+
const organizationId = params.organizationId;
|
|
360
|
+
const phone = params.phone;
|
|
361
|
+
const region = params.region;
|
|
362
|
+
const street = params.street;
|
|
363
|
+
const street2 = params.street2;
|
|
364
|
+
const type = params.type;
|
|
365
|
+
const zip = params.zip;
|
|
185
366
|
|
|
186
367
|
if (typeof id === 'undefined') {
|
|
187
368
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
188
369
|
}
|
|
189
370
|
|
|
190
371
|
const apiPath = '/v1/customers/addresses/{id}'.replace('{id}', id);
|
|
191
|
-
const
|
|
372
|
+
const apiPayload: Payload = {};
|
|
373
|
+
if (typeof city !== 'undefined') {
|
|
374
|
+
apiPayload['city'] = city;
|
|
375
|
+
}
|
|
376
|
+
if (typeof company !== 'undefined') {
|
|
377
|
+
apiPayload['company'] = company;
|
|
378
|
+
}
|
|
379
|
+
if (typeof contactId !== 'undefined') {
|
|
380
|
+
apiPayload['contact_id'] = contactId;
|
|
381
|
+
}
|
|
382
|
+
if (typeof country !== 'undefined') {
|
|
383
|
+
apiPayload['country'] = country;
|
|
384
|
+
}
|
|
385
|
+
if (typeof isDefault !== 'undefined') {
|
|
386
|
+
apiPayload['is_default'] = isDefault;
|
|
387
|
+
}
|
|
388
|
+
if (typeof name !== 'undefined') {
|
|
389
|
+
apiPayload['name'] = name;
|
|
390
|
+
}
|
|
391
|
+
if (typeof organizationId !== 'undefined') {
|
|
392
|
+
apiPayload['organization_id'] = organizationId;
|
|
393
|
+
}
|
|
394
|
+
if (typeof phone !== 'undefined') {
|
|
395
|
+
apiPayload['phone'] = phone;
|
|
396
|
+
}
|
|
397
|
+
if (typeof region !== 'undefined') {
|
|
398
|
+
apiPayload['region'] = region;
|
|
399
|
+
}
|
|
400
|
+
if (typeof street !== 'undefined') {
|
|
401
|
+
apiPayload['street'] = street;
|
|
402
|
+
}
|
|
403
|
+
if (typeof street2 !== 'undefined') {
|
|
404
|
+
apiPayload['street2'] = street2;
|
|
405
|
+
}
|
|
406
|
+
if (typeof type !== 'undefined') {
|
|
407
|
+
apiPayload['type'] = type;
|
|
408
|
+
}
|
|
409
|
+
if (typeof zip !== 'undefined') {
|
|
410
|
+
apiPayload['zip'] = zip;
|
|
411
|
+
}
|
|
192
412
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
193
413
|
|
|
194
414
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -199,19 +419,60 @@ export class Customers {
|
|
|
199
419
|
'put',
|
|
200
420
|
uri,
|
|
201
421
|
apiHeaders,
|
|
202
|
-
|
|
422
|
+
apiPayload
|
|
203
423
|
);
|
|
204
424
|
}
|
|
205
425
|
|
|
206
426
|
/**
|
|
207
427
|
*
|
|
428
|
+
* @param {string} params.email -
|
|
429
|
+
* @param {string} params.password -
|
|
430
|
+
* @throws {RevenexxException}
|
|
431
|
+
* @returns {Promise<Models.AuthLoginResponse>}
|
|
432
|
+
*/
|
|
433
|
+
customersAuthLogin(params: { email: string, password: string }): Promise<Models.AuthLoginResponse>;
|
|
434
|
+
/**
|
|
435
|
+
*
|
|
436
|
+
* @param {string} email -
|
|
437
|
+
* @param {string} password -
|
|
208
438
|
* @throws {RevenexxException}
|
|
209
439
|
* @returns {Promise<Models.AuthLoginResponse>}
|
|
440
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
210
441
|
*/
|
|
211
|
-
customersAuthLogin(): Promise<Models.AuthLoginResponse
|
|
442
|
+
customersAuthLogin(email: string, password: string): Promise<Models.AuthLoginResponse>;
|
|
443
|
+
customersAuthLogin(
|
|
444
|
+
paramsOrFirst: { email: string, password: string } | string,
|
|
445
|
+
...rest: [(string)?]
|
|
446
|
+
): Promise<Models.AuthLoginResponse> {
|
|
447
|
+
let params: { email: string, password: string };
|
|
448
|
+
|
|
449
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
450
|
+
params = (paramsOrFirst || {}) as { email: string, password: string };
|
|
451
|
+
} else {
|
|
452
|
+
params = {
|
|
453
|
+
email: paramsOrFirst as string,
|
|
454
|
+
password: rest[0] as string
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const email = params.email;
|
|
459
|
+
const password = params.password;
|
|
460
|
+
|
|
461
|
+
if (typeof email === 'undefined') {
|
|
462
|
+
throw new RevenexxException('Missing required parameter: "email"');
|
|
463
|
+
}
|
|
464
|
+
if (typeof password === 'undefined') {
|
|
465
|
+
throw new RevenexxException('Missing required parameter: "password"');
|
|
466
|
+
}
|
|
212
467
|
|
|
213
468
|
const apiPath = '/v1/customers/auth/login';
|
|
214
|
-
const
|
|
469
|
+
const apiPayload: Payload = {};
|
|
470
|
+
if (typeof email !== 'undefined') {
|
|
471
|
+
apiPayload['email'] = email;
|
|
472
|
+
}
|
|
473
|
+
if (typeof password !== 'undefined') {
|
|
474
|
+
apiPayload['password'] = password;
|
|
475
|
+
}
|
|
215
476
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
216
477
|
|
|
217
478
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -222,19 +483,60 @@ export class Customers {
|
|
|
222
483
|
'post',
|
|
223
484
|
uri,
|
|
224
485
|
apiHeaders,
|
|
225
|
-
|
|
486
|
+
apiPayload
|
|
226
487
|
);
|
|
227
488
|
}
|
|
228
489
|
|
|
229
490
|
/**
|
|
230
491
|
*
|
|
492
|
+
* @param {string} params.sessionId -
|
|
493
|
+
* @param {string} params.userId -
|
|
231
494
|
* @throws {RevenexxException}
|
|
232
495
|
* @returns {Promise<{}>}
|
|
233
496
|
*/
|
|
234
|
-
customersAuthLogout(): Promise<{}
|
|
497
|
+
customersAuthLogout(params: { sessionId: string, userId: string }): Promise<{}>;
|
|
498
|
+
/**
|
|
499
|
+
*
|
|
500
|
+
* @param {string} sessionId -
|
|
501
|
+
* @param {string} userId -
|
|
502
|
+
* @throws {RevenexxException}
|
|
503
|
+
* @returns {Promise<{}>}
|
|
504
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
505
|
+
*/
|
|
506
|
+
customersAuthLogout(sessionId: string, userId: string): Promise<{}>;
|
|
507
|
+
customersAuthLogout(
|
|
508
|
+
paramsOrFirst: { sessionId: string, userId: string } | string,
|
|
509
|
+
...rest: [(string)?]
|
|
510
|
+
): Promise<{}> {
|
|
511
|
+
let params: { sessionId: string, userId: string };
|
|
512
|
+
|
|
513
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
514
|
+
params = (paramsOrFirst || {}) as { sessionId: string, userId: string };
|
|
515
|
+
} else {
|
|
516
|
+
params = {
|
|
517
|
+
sessionId: paramsOrFirst as string,
|
|
518
|
+
userId: rest[0] as string
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const sessionId = params.sessionId;
|
|
523
|
+
const userId = params.userId;
|
|
524
|
+
|
|
525
|
+
if (typeof sessionId === 'undefined') {
|
|
526
|
+
throw new RevenexxException('Missing required parameter: "sessionId"');
|
|
527
|
+
}
|
|
528
|
+
if (typeof userId === 'undefined') {
|
|
529
|
+
throw new RevenexxException('Missing required parameter: "userId"');
|
|
530
|
+
}
|
|
235
531
|
|
|
236
532
|
const apiPath = '/v1/customers/auth/logout';
|
|
237
|
-
const
|
|
533
|
+
const apiPayload: Payload = {};
|
|
534
|
+
if (typeof sessionId !== 'undefined') {
|
|
535
|
+
apiPayload['session_id'] = sessionId;
|
|
536
|
+
}
|
|
537
|
+
if (typeof userId !== 'undefined') {
|
|
538
|
+
apiPayload['user_id'] = userId;
|
|
539
|
+
}
|
|
238
540
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
239
541
|
|
|
240
542
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -245,19 +547,57 @@ export class Customers {
|
|
|
245
547
|
'post',
|
|
246
548
|
uri,
|
|
247
549
|
apiHeaders,
|
|
248
|
-
|
|
550
|
+
apiPayload
|
|
249
551
|
);
|
|
250
552
|
}
|
|
251
553
|
|
|
252
554
|
/**
|
|
253
555
|
*
|
|
556
|
+
* @param {string} params.userId -
|
|
557
|
+
* @param {string} params.sessionId - Optional session to verify — answers 401 when the session is expired or revoked.
|
|
254
558
|
* @throws {RevenexxException}
|
|
255
559
|
* @returns {Promise<Models.AuthMeResponse>}
|
|
256
560
|
*/
|
|
257
|
-
customersAuthMe(): Promise<Models.AuthMeResponse
|
|
561
|
+
customersAuthMe(params: { userId: string, sessionId?: string }): Promise<Models.AuthMeResponse>;
|
|
562
|
+
/**
|
|
563
|
+
*
|
|
564
|
+
* @param {string} userId -
|
|
565
|
+
* @param {string} sessionId - Optional session to verify — answers 401 when the session is expired or revoked.
|
|
566
|
+
* @throws {RevenexxException}
|
|
567
|
+
* @returns {Promise<Models.AuthMeResponse>}
|
|
568
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
569
|
+
*/
|
|
570
|
+
customersAuthMe(userId: string, sessionId?: string): Promise<Models.AuthMeResponse>;
|
|
571
|
+
customersAuthMe(
|
|
572
|
+
paramsOrFirst: { userId: string, sessionId?: string } | string,
|
|
573
|
+
...rest: [(string)?]
|
|
574
|
+
): Promise<Models.AuthMeResponse> {
|
|
575
|
+
let params: { userId: string, sessionId?: string };
|
|
576
|
+
|
|
577
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
578
|
+
params = (paramsOrFirst || {}) as { userId: string, sessionId?: string };
|
|
579
|
+
} else {
|
|
580
|
+
params = {
|
|
581
|
+
userId: paramsOrFirst as string,
|
|
582
|
+
sessionId: rest[0] as string
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
const userId = params.userId;
|
|
587
|
+
const sessionId = params.sessionId;
|
|
588
|
+
|
|
589
|
+
if (typeof userId === 'undefined') {
|
|
590
|
+
throw new RevenexxException('Missing required parameter: "userId"');
|
|
591
|
+
}
|
|
258
592
|
|
|
259
593
|
const apiPath = '/v1/customers/auth/me';
|
|
260
|
-
const
|
|
594
|
+
const apiPayload: Payload = {};
|
|
595
|
+
if (typeof sessionId !== 'undefined') {
|
|
596
|
+
apiPayload['session_id'] = sessionId;
|
|
597
|
+
}
|
|
598
|
+
if (typeof userId !== 'undefined') {
|
|
599
|
+
apiPayload['user_id'] = userId;
|
|
600
|
+
}
|
|
261
601
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
262
602
|
|
|
263
603
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -268,19 +608,60 @@ export class Customers {
|
|
|
268
608
|
'post',
|
|
269
609
|
uri,
|
|
270
610
|
apiHeaders,
|
|
271
|
-
|
|
611
|
+
apiPayload
|
|
272
612
|
);
|
|
273
613
|
}
|
|
274
614
|
|
|
275
615
|
/**
|
|
276
616
|
*
|
|
617
|
+
* @param {string} params.email -
|
|
618
|
+
* @param {string} params.url - Redirect URL carrying userId + secret.
|
|
277
619
|
* @throws {RevenexxException}
|
|
278
620
|
* @returns {Promise<{}>}
|
|
279
621
|
*/
|
|
280
|
-
customersAuthRecovery(): Promise<{}
|
|
622
|
+
customersAuthRecovery(params: { email: string, url: string }): Promise<{}>;
|
|
623
|
+
/**
|
|
624
|
+
*
|
|
625
|
+
* @param {string} email -
|
|
626
|
+
* @param {string} url - Redirect URL carrying userId + secret.
|
|
627
|
+
* @throws {RevenexxException}
|
|
628
|
+
* @returns {Promise<{}>}
|
|
629
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
630
|
+
*/
|
|
631
|
+
customersAuthRecovery(email: string, url: string): Promise<{}>;
|
|
632
|
+
customersAuthRecovery(
|
|
633
|
+
paramsOrFirst: { email: string, url: string } | string,
|
|
634
|
+
...rest: [(string)?]
|
|
635
|
+
): Promise<{}> {
|
|
636
|
+
let params: { email: string, url: string };
|
|
637
|
+
|
|
638
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
639
|
+
params = (paramsOrFirst || {}) as { email: string, url: string };
|
|
640
|
+
} else {
|
|
641
|
+
params = {
|
|
642
|
+
email: paramsOrFirst as string,
|
|
643
|
+
url: rest[0] as string
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
const email = params.email;
|
|
648
|
+
const url = params.url;
|
|
649
|
+
|
|
650
|
+
if (typeof email === 'undefined') {
|
|
651
|
+
throw new RevenexxException('Missing required parameter: "email"');
|
|
652
|
+
}
|
|
653
|
+
if (typeof url === 'undefined') {
|
|
654
|
+
throw new RevenexxException('Missing required parameter: "url"');
|
|
655
|
+
}
|
|
281
656
|
|
|
282
657
|
const apiPath = '/v1/customers/auth/recovery';
|
|
283
|
-
const
|
|
658
|
+
const apiPayload: Payload = {};
|
|
659
|
+
if (typeof email !== 'undefined') {
|
|
660
|
+
apiPayload['email'] = email;
|
|
661
|
+
}
|
|
662
|
+
if (typeof url !== 'undefined') {
|
|
663
|
+
apiPayload['url'] = url;
|
|
664
|
+
}
|
|
284
665
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
285
666
|
|
|
286
667
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -291,19 +672,70 @@ export class Customers {
|
|
|
291
672
|
'post',
|
|
292
673
|
uri,
|
|
293
674
|
apiHeaders,
|
|
294
|
-
|
|
675
|
+
apiPayload
|
|
295
676
|
);
|
|
296
677
|
}
|
|
297
678
|
|
|
298
679
|
/**
|
|
299
680
|
*
|
|
681
|
+
* @param {string} params.password -
|
|
682
|
+
* @param {string} params.secret -
|
|
683
|
+
* @param {string} params.userId -
|
|
300
684
|
* @throws {RevenexxException}
|
|
301
685
|
* @returns {Promise<{}>}
|
|
302
686
|
*/
|
|
303
|
-
customersAuthRecoveryConfirm(): Promise<{}
|
|
687
|
+
customersAuthRecoveryConfirm(params: { password: string, secret: string, userId: string }): Promise<{}>;
|
|
688
|
+
/**
|
|
689
|
+
*
|
|
690
|
+
* @param {string} password -
|
|
691
|
+
* @param {string} secret -
|
|
692
|
+
* @param {string} userId -
|
|
693
|
+
* @throws {RevenexxException}
|
|
694
|
+
* @returns {Promise<{}>}
|
|
695
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
696
|
+
*/
|
|
697
|
+
customersAuthRecoveryConfirm(password: string, secret: string, userId: string): Promise<{}>;
|
|
698
|
+
customersAuthRecoveryConfirm(
|
|
699
|
+
paramsOrFirst: { password: string, secret: string, userId: string } | string,
|
|
700
|
+
...rest: [(string)?, (string)?]
|
|
701
|
+
): Promise<{}> {
|
|
702
|
+
let params: { password: string, secret: string, userId: string };
|
|
703
|
+
|
|
704
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
705
|
+
params = (paramsOrFirst || {}) as { password: string, secret: string, userId: string };
|
|
706
|
+
} else {
|
|
707
|
+
params = {
|
|
708
|
+
password: paramsOrFirst as string,
|
|
709
|
+
secret: rest[0] as string,
|
|
710
|
+
userId: rest[1] as string
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
const password = params.password;
|
|
715
|
+
const secret = params.secret;
|
|
716
|
+
const userId = params.userId;
|
|
717
|
+
|
|
718
|
+
if (typeof password === 'undefined') {
|
|
719
|
+
throw new RevenexxException('Missing required parameter: "password"');
|
|
720
|
+
}
|
|
721
|
+
if (typeof secret === 'undefined') {
|
|
722
|
+
throw new RevenexxException('Missing required parameter: "secret"');
|
|
723
|
+
}
|
|
724
|
+
if (typeof userId === 'undefined') {
|
|
725
|
+
throw new RevenexxException('Missing required parameter: "userId"');
|
|
726
|
+
}
|
|
304
727
|
|
|
305
728
|
const apiPath = '/v1/customers/auth/recovery';
|
|
306
|
-
const
|
|
729
|
+
const apiPayload: Payload = {};
|
|
730
|
+
if (typeof password !== 'undefined') {
|
|
731
|
+
apiPayload['password'] = password;
|
|
732
|
+
}
|
|
733
|
+
if (typeof secret !== 'undefined') {
|
|
734
|
+
apiPayload['secret'] = secret;
|
|
735
|
+
}
|
|
736
|
+
if (typeof userId !== 'undefined') {
|
|
737
|
+
apiPayload['user_id'] = userId;
|
|
738
|
+
}
|
|
307
739
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
308
740
|
|
|
309
741
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -314,19 +746,95 @@ export class Customers {
|
|
|
314
746
|
'put',
|
|
315
747
|
uri,
|
|
316
748
|
apiHeaders,
|
|
317
|
-
|
|
749
|
+
apiPayload
|
|
318
750
|
);
|
|
319
751
|
}
|
|
320
752
|
|
|
321
753
|
/**
|
|
322
754
|
*
|
|
755
|
+
* @param {string} params.email -
|
|
756
|
+
* @param {string} params.password -
|
|
757
|
+
* @param {string} params.firstName -
|
|
758
|
+
* @param {string} params.lastName -
|
|
759
|
+
* @param {string} params.locale - BCP 47, e.g. de-DE
|
|
760
|
+
* @param {string} params.organizationId - Join an existing organization.
|
|
761
|
+
* @param {string} params.organizationName - Found a new organization; the contact becomes its admin.
|
|
323
762
|
* @throws {RevenexxException}
|
|
324
763
|
* @returns {Promise<Models.AuthRegisterResponse>}
|
|
325
764
|
*/
|
|
326
|
-
customersAuthRegister(): Promise<Models.AuthRegisterResponse
|
|
765
|
+
customersAuthRegister(params: { email: string, password: string, firstName?: string, lastName?: string, locale?: string, organizationId?: string, organizationName?: string }): Promise<Models.AuthRegisterResponse>;
|
|
766
|
+
/**
|
|
767
|
+
*
|
|
768
|
+
* @param {string} email -
|
|
769
|
+
* @param {string} password -
|
|
770
|
+
* @param {string} firstName -
|
|
771
|
+
* @param {string} lastName -
|
|
772
|
+
* @param {string} locale - BCP 47, e.g. de-DE
|
|
773
|
+
* @param {string} organizationId - Join an existing organization.
|
|
774
|
+
* @param {string} organizationName - Found a new organization; the contact becomes its admin.
|
|
775
|
+
* @throws {RevenexxException}
|
|
776
|
+
* @returns {Promise<Models.AuthRegisterResponse>}
|
|
777
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
778
|
+
*/
|
|
779
|
+
customersAuthRegister(email: string, password: string, firstName?: string, lastName?: string, locale?: string, organizationId?: string, organizationName?: string): Promise<Models.AuthRegisterResponse>;
|
|
780
|
+
customersAuthRegister(
|
|
781
|
+
paramsOrFirst: { email: string, password: string, firstName?: string, lastName?: string, locale?: string, organizationId?: string, organizationName?: string } | string,
|
|
782
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?]
|
|
783
|
+
): Promise<Models.AuthRegisterResponse> {
|
|
784
|
+
let params: { email: string, password: string, firstName?: string, lastName?: string, locale?: string, organizationId?: string, organizationName?: string };
|
|
785
|
+
|
|
786
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
787
|
+
params = (paramsOrFirst || {}) as { email: string, password: string, firstName?: string, lastName?: string, locale?: string, organizationId?: string, organizationName?: string };
|
|
788
|
+
} else {
|
|
789
|
+
params = {
|
|
790
|
+
email: paramsOrFirst as string,
|
|
791
|
+
password: rest[0] as string,
|
|
792
|
+
firstName: rest[1] as string,
|
|
793
|
+
lastName: rest[2] as string,
|
|
794
|
+
locale: rest[3] as string,
|
|
795
|
+
organizationId: rest[4] as string,
|
|
796
|
+
organizationName: rest[5] as string
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
const email = params.email;
|
|
801
|
+
const password = params.password;
|
|
802
|
+
const firstName = params.firstName;
|
|
803
|
+
const lastName = params.lastName;
|
|
804
|
+
const locale = params.locale;
|
|
805
|
+
const organizationId = params.organizationId;
|
|
806
|
+
const organizationName = params.organizationName;
|
|
807
|
+
|
|
808
|
+
if (typeof email === 'undefined') {
|
|
809
|
+
throw new RevenexxException('Missing required parameter: "email"');
|
|
810
|
+
}
|
|
811
|
+
if (typeof password === 'undefined') {
|
|
812
|
+
throw new RevenexxException('Missing required parameter: "password"');
|
|
813
|
+
}
|
|
327
814
|
|
|
328
815
|
const apiPath = '/v1/customers/auth/register';
|
|
329
|
-
const
|
|
816
|
+
const apiPayload: Payload = {};
|
|
817
|
+
if (typeof email !== 'undefined') {
|
|
818
|
+
apiPayload['email'] = email;
|
|
819
|
+
}
|
|
820
|
+
if (typeof firstName !== 'undefined') {
|
|
821
|
+
apiPayload['first_name'] = firstName;
|
|
822
|
+
}
|
|
823
|
+
if (typeof lastName !== 'undefined') {
|
|
824
|
+
apiPayload['last_name'] = lastName;
|
|
825
|
+
}
|
|
826
|
+
if (typeof locale !== 'undefined') {
|
|
827
|
+
apiPayload['locale'] = locale;
|
|
828
|
+
}
|
|
829
|
+
if (typeof organizationId !== 'undefined') {
|
|
830
|
+
apiPayload['organization_id'] = organizationId;
|
|
831
|
+
}
|
|
832
|
+
if (typeof organizationName !== 'undefined') {
|
|
833
|
+
apiPayload['organization_name'] = organizationName;
|
|
834
|
+
}
|
|
835
|
+
if (typeof password !== 'undefined') {
|
|
836
|
+
apiPayload['password'] = password;
|
|
837
|
+
}
|
|
330
838
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
331
839
|
|
|
332
840
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -337,7 +845,7 @@ export class Customers {
|
|
|
337
845
|
'post',
|
|
338
846
|
uri,
|
|
339
847
|
apiHeaders,
|
|
340
|
-
|
|
848
|
+
apiPayload
|
|
341
849
|
);
|
|
342
850
|
}
|
|
343
851
|
|
|
@@ -349,7 +857,7 @@ export class Customers {
|
|
|
349
857
|
customersContactsList(): Promise<{}> {
|
|
350
858
|
|
|
351
859
|
const apiPath = '/v1/customers/contacts';
|
|
352
|
-
const
|
|
860
|
+
const apiPayload: Payload = {};
|
|
353
861
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
354
862
|
|
|
355
863
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -359,19 +867,106 @@ export class Customers {
|
|
|
359
867
|
'get',
|
|
360
868
|
uri,
|
|
361
869
|
apiHeaders,
|
|
362
|
-
|
|
870
|
+
apiPayload
|
|
363
871
|
);
|
|
364
872
|
}
|
|
365
873
|
|
|
366
874
|
/**
|
|
367
875
|
*
|
|
876
|
+
* @param {string} params.email -
|
|
877
|
+
* @param {string} params.firstName -
|
|
878
|
+
* @param {boolean} params.isPrimary - The primary contact of its organization.
|
|
879
|
+
* @param {string} params.lastName -
|
|
880
|
+
* @param {string} params.locale - BCP 47, e.g. de-DE
|
|
881
|
+
* @param {string} params.organizationId - Owning organization — membership is mirrored to the platform team.
|
|
882
|
+
* @param {string} params.phone -
|
|
883
|
+
* @param {ContactRole} params.role - Default 'buyer' — also the team role on the platform mirror.
|
|
884
|
+
* @param {ContactStatus} params.status - Default 'invited' on create.
|
|
885
|
+
* @throws {RevenexxException}
|
|
886
|
+
* @returns {Promise<Models.Contact>}
|
|
887
|
+
*/
|
|
888
|
+
customersContactsCreate(params: { email: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus }): Promise<Models.Contact>;
|
|
889
|
+
/**
|
|
890
|
+
*
|
|
891
|
+
* @param {string} email -
|
|
892
|
+
* @param {string} firstName -
|
|
893
|
+
* @param {boolean} isPrimary - The primary contact of its organization.
|
|
894
|
+
* @param {string} lastName -
|
|
895
|
+
* @param {string} locale - BCP 47, e.g. de-DE
|
|
896
|
+
* @param {string} organizationId - Owning organization — membership is mirrored to the platform team.
|
|
897
|
+
* @param {string} phone -
|
|
898
|
+
* @param {ContactRole} role - Default 'buyer' — also the team role on the platform mirror.
|
|
899
|
+
* @param {ContactStatus} status - Default 'invited' on create.
|
|
368
900
|
* @throws {RevenexxException}
|
|
369
901
|
* @returns {Promise<Models.Contact>}
|
|
902
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
370
903
|
*/
|
|
371
|
-
customersContactsCreate(): Promise<Models.Contact
|
|
904
|
+
customersContactsCreate(email: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus): Promise<Models.Contact>;
|
|
905
|
+
customersContactsCreate(
|
|
906
|
+
paramsOrFirst: { email: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus } | string,
|
|
907
|
+
...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (ContactRole)?, (ContactStatus)?]
|
|
908
|
+
): Promise<Models.Contact> {
|
|
909
|
+
let params: { email: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus };
|
|
910
|
+
|
|
911
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
912
|
+
params = (paramsOrFirst || {}) as { email: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus };
|
|
913
|
+
} else {
|
|
914
|
+
params = {
|
|
915
|
+
email: paramsOrFirst as string,
|
|
916
|
+
firstName: rest[0] as string,
|
|
917
|
+
isPrimary: rest[1] as boolean,
|
|
918
|
+
lastName: rest[2] as string,
|
|
919
|
+
locale: rest[3] as string,
|
|
920
|
+
organizationId: rest[4] as string,
|
|
921
|
+
phone: rest[5] as string,
|
|
922
|
+
role: rest[6] as ContactRole,
|
|
923
|
+
status: rest[7] as ContactStatus
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
const email = params.email;
|
|
928
|
+
const firstName = params.firstName;
|
|
929
|
+
const isPrimary = params.isPrimary;
|
|
930
|
+
const lastName = params.lastName;
|
|
931
|
+
const locale = params.locale;
|
|
932
|
+
const organizationId = params.organizationId;
|
|
933
|
+
const phone = params.phone;
|
|
934
|
+
const role = params.role;
|
|
935
|
+
const status = params.status;
|
|
936
|
+
|
|
937
|
+
if (typeof email === 'undefined') {
|
|
938
|
+
throw new RevenexxException('Missing required parameter: "email"');
|
|
939
|
+
}
|
|
372
940
|
|
|
373
941
|
const apiPath = '/v1/customers/contacts';
|
|
374
|
-
const
|
|
942
|
+
const apiPayload: Payload = {};
|
|
943
|
+
if (typeof email !== 'undefined') {
|
|
944
|
+
apiPayload['email'] = email;
|
|
945
|
+
}
|
|
946
|
+
if (typeof firstName !== 'undefined') {
|
|
947
|
+
apiPayload['first_name'] = firstName;
|
|
948
|
+
}
|
|
949
|
+
if (typeof isPrimary !== 'undefined') {
|
|
950
|
+
apiPayload['is_primary'] = isPrimary;
|
|
951
|
+
}
|
|
952
|
+
if (typeof lastName !== 'undefined') {
|
|
953
|
+
apiPayload['last_name'] = lastName;
|
|
954
|
+
}
|
|
955
|
+
if (typeof locale !== 'undefined') {
|
|
956
|
+
apiPayload['locale'] = locale;
|
|
957
|
+
}
|
|
958
|
+
if (typeof organizationId !== 'undefined') {
|
|
959
|
+
apiPayload['organization_id'] = organizationId;
|
|
960
|
+
}
|
|
961
|
+
if (typeof phone !== 'undefined') {
|
|
962
|
+
apiPayload['phone'] = phone;
|
|
963
|
+
}
|
|
964
|
+
if (typeof role !== 'undefined') {
|
|
965
|
+
apiPayload['role'] = role;
|
|
966
|
+
}
|
|
967
|
+
if (typeof status !== 'undefined') {
|
|
968
|
+
apiPayload['status'] = status;
|
|
969
|
+
}
|
|
375
970
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
376
971
|
|
|
377
972
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -382,7 +977,7 @@ export class Customers {
|
|
|
382
977
|
'post',
|
|
383
978
|
uri,
|
|
384
979
|
apiHeaders,
|
|
385
|
-
|
|
980
|
+
apiPayload
|
|
386
981
|
);
|
|
387
982
|
}
|
|
388
983
|
|
|
@@ -421,7 +1016,7 @@ export class Customers {
|
|
|
421
1016
|
}
|
|
422
1017
|
|
|
423
1018
|
const apiPath = '/v1/customers/contacts/{id}'.replace('{id}', id);
|
|
424
|
-
const
|
|
1019
|
+
const apiPayload: Payload = {};
|
|
425
1020
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
426
1021
|
|
|
427
1022
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -431,7 +1026,7 @@ export class Customers {
|
|
|
431
1026
|
'delete',
|
|
432
1027
|
uri,
|
|
433
1028
|
apiHeaders,
|
|
434
|
-
|
|
1029
|
+
apiPayload
|
|
435
1030
|
);
|
|
436
1031
|
}
|
|
437
1032
|
|
|
@@ -470,7 +1065,7 @@ export class Customers {
|
|
|
470
1065
|
}
|
|
471
1066
|
|
|
472
1067
|
const apiPath = '/v1/customers/contacts/{id}'.replace('{id}', id);
|
|
473
|
-
const
|
|
1068
|
+
const apiPayload: Payload = {};
|
|
474
1069
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
475
1070
|
|
|
476
1071
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -480,46 +1075,110 @@ export class Customers {
|
|
|
480
1075
|
'get',
|
|
481
1076
|
uri,
|
|
482
1077
|
apiHeaders,
|
|
483
|
-
|
|
1078
|
+
apiPayload
|
|
484
1079
|
);
|
|
485
1080
|
}
|
|
486
1081
|
|
|
487
1082
|
/**
|
|
488
1083
|
*
|
|
489
1084
|
* @param {string} params.id -
|
|
1085
|
+
* @param {string} params.email -
|
|
1086
|
+
* @param {string} params.firstName -
|
|
1087
|
+
* @param {boolean} params.isPrimary - The primary contact of its organization.
|
|
1088
|
+
* @param {string} params.lastName -
|
|
1089
|
+
* @param {string} params.locale - BCP 47, e.g. de-DE
|
|
1090
|
+
* @param {string} params.organizationId - Owning organization — membership is mirrored to the platform team.
|
|
1091
|
+
* @param {string} params.phone -
|
|
1092
|
+
* @param {ContactRole} params.role - Default 'buyer' — also the team role on the platform mirror.
|
|
1093
|
+
* @param {ContactStatus} params.status - Default 'invited' on create.
|
|
490
1094
|
* @throws {RevenexxException}
|
|
491
1095
|
* @returns {Promise<Models.Contact>}
|
|
492
1096
|
*/
|
|
493
|
-
customersContactsUpdate(params: { id: string }): Promise<Models.Contact>;
|
|
1097
|
+
customersContactsUpdate(params: { id: string, email?: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus }): Promise<Models.Contact>;
|
|
494
1098
|
/**
|
|
495
1099
|
*
|
|
496
1100
|
* @param {string} id -
|
|
1101
|
+
* @param {string} email -
|
|
1102
|
+
* @param {string} firstName -
|
|
1103
|
+
* @param {boolean} isPrimary - The primary contact of its organization.
|
|
1104
|
+
* @param {string} lastName -
|
|
1105
|
+
* @param {string} locale - BCP 47, e.g. de-DE
|
|
1106
|
+
* @param {string} organizationId - Owning organization — membership is mirrored to the platform team.
|
|
1107
|
+
* @param {string} phone -
|
|
1108
|
+
* @param {ContactRole} role - Default 'buyer' — also the team role on the platform mirror.
|
|
1109
|
+
* @param {ContactStatus} status - Default 'invited' on create.
|
|
497
1110
|
* @throws {RevenexxException}
|
|
498
1111
|
* @returns {Promise<Models.Contact>}
|
|
499
1112
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
500
1113
|
*/
|
|
501
|
-
customersContactsUpdate(id: string): Promise<Models.Contact>;
|
|
1114
|
+
customersContactsUpdate(id: string, email?: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus): Promise<Models.Contact>;
|
|
502
1115
|
customersContactsUpdate(
|
|
503
|
-
paramsOrFirst: { id: string } | string
|
|
1116
|
+
paramsOrFirst: { id: string, email?: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus } | string,
|
|
1117
|
+
...rest: [(string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (ContactRole)?, (ContactStatus)?]
|
|
504
1118
|
): Promise<Models.Contact> {
|
|
505
|
-
let params: { id: string };
|
|
1119
|
+
let params: { id: string, email?: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus };
|
|
506
1120
|
|
|
507
1121
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
508
|
-
params = (paramsOrFirst || {}) as { id: string };
|
|
1122
|
+
params = (paramsOrFirst || {}) as { id: string, email?: string, firstName?: string, isPrimary?: boolean, lastName?: string, locale?: string, organizationId?: string, phone?: string, role?: ContactRole, status?: ContactStatus };
|
|
509
1123
|
} else {
|
|
510
1124
|
params = {
|
|
511
|
-
id: paramsOrFirst as string
|
|
1125
|
+
id: paramsOrFirst as string,
|
|
1126
|
+
email: rest[0] as string,
|
|
1127
|
+
firstName: rest[1] as string,
|
|
1128
|
+
isPrimary: rest[2] as boolean,
|
|
1129
|
+
lastName: rest[3] as string,
|
|
1130
|
+
locale: rest[4] as string,
|
|
1131
|
+
organizationId: rest[5] as string,
|
|
1132
|
+
phone: rest[6] as string,
|
|
1133
|
+
role: rest[7] as ContactRole,
|
|
1134
|
+
status: rest[8] as ContactStatus
|
|
512
1135
|
};
|
|
513
1136
|
}
|
|
514
1137
|
|
|
515
1138
|
const id = params.id;
|
|
1139
|
+
const email = params.email;
|
|
1140
|
+
const firstName = params.firstName;
|
|
1141
|
+
const isPrimary = params.isPrimary;
|
|
1142
|
+
const lastName = params.lastName;
|
|
1143
|
+
const locale = params.locale;
|
|
1144
|
+
const organizationId = params.organizationId;
|
|
1145
|
+
const phone = params.phone;
|
|
1146
|
+
const role = params.role;
|
|
1147
|
+
const status = params.status;
|
|
516
1148
|
|
|
517
1149
|
if (typeof id === 'undefined') {
|
|
518
1150
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
519
1151
|
}
|
|
520
1152
|
|
|
521
1153
|
const apiPath = '/v1/customers/contacts/{id}'.replace('{id}', id);
|
|
522
|
-
const
|
|
1154
|
+
const apiPayload: Payload = {};
|
|
1155
|
+
if (typeof email !== 'undefined') {
|
|
1156
|
+
apiPayload['email'] = email;
|
|
1157
|
+
}
|
|
1158
|
+
if (typeof firstName !== 'undefined') {
|
|
1159
|
+
apiPayload['first_name'] = firstName;
|
|
1160
|
+
}
|
|
1161
|
+
if (typeof isPrimary !== 'undefined') {
|
|
1162
|
+
apiPayload['is_primary'] = isPrimary;
|
|
1163
|
+
}
|
|
1164
|
+
if (typeof lastName !== 'undefined') {
|
|
1165
|
+
apiPayload['last_name'] = lastName;
|
|
1166
|
+
}
|
|
1167
|
+
if (typeof locale !== 'undefined') {
|
|
1168
|
+
apiPayload['locale'] = locale;
|
|
1169
|
+
}
|
|
1170
|
+
if (typeof organizationId !== 'undefined') {
|
|
1171
|
+
apiPayload['organization_id'] = organizationId;
|
|
1172
|
+
}
|
|
1173
|
+
if (typeof phone !== 'undefined') {
|
|
1174
|
+
apiPayload['phone'] = phone;
|
|
1175
|
+
}
|
|
1176
|
+
if (typeof role !== 'undefined') {
|
|
1177
|
+
apiPayload['role'] = role;
|
|
1178
|
+
}
|
|
1179
|
+
if (typeof status !== 'undefined') {
|
|
1180
|
+
apiPayload['status'] = status;
|
|
1181
|
+
}
|
|
523
1182
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
524
1183
|
|
|
525
1184
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -530,7 +1189,7 @@ export class Customers {
|
|
|
530
1189
|
'put',
|
|
531
1190
|
uri,
|
|
532
1191
|
apiHeaders,
|
|
533
|
-
|
|
1192
|
+
apiPayload
|
|
534
1193
|
);
|
|
535
1194
|
}
|
|
536
1195
|
|
|
@@ -542,7 +1201,7 @@ export class Customers {
|
|
|
542
1201
|
customersOrganizationsList(): Promise<{}> {
|
|
543
1202
|
|
|
544
1203
|
const apiPath = '/v1/customers/organizations';
|
|
545
|
-
const
|
|
1204
|
+
const apiPayload: Payload = {};
|
|
546
1205
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
547
1206
|
|
|
548
1207
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -552,19 +1211,71 @@ export class Customers {
|
|
|
552
1211
|
'get',
|
|
553
1212
|
uri,
|
|
554
1213
|
apiHeaders,
|
|
555
|
-
|
|
1214
|
+
apiPayload
|
|
556
1215
|
);
|
|
557
1216
|
}
|
|
558
1217
|
|
|
559
1218
|
/**
|
|
560
1219
|
*
|
|
1220
|
+
* @param {string} params.name - Company name — mirrored to the platform team.
|
|
1221
|
+
* @param {object} params.settings - Free-form organization settings.
|
|
1222
|
+
* @param {OrganizationStatus} params.status - Default 'active'.
|
|
1223
|
+
* @param {string} params.vatId -
|
|
561
1224
|
* @throws {RevenexxException}
|
|
562
1225
|
* @returns {Promise<Models.Organization>}
|
|
563
1226
|
*/
|
|
564
|
-
customersOrganizationsCreate(): Promise<Models.Organization
|
|
1227
|
+
customersOrganizationsCreate(params: { name: string, settings?: object, status?: OrganizationStatus, vatId?: string }): Promise<Models.Organization>;
|
|
1228
|
+
/**
|
|
1229
|
+
*
|
|
1230
|
+
* @param {string} name - Company name — mirrored to the platform team.
|
|
1231
|
+
* @param {object} settings - Free-form organization settings.
|
|
1232
|
+
* @param {OrganizationStatus} status - Default 'active'.
|
|
1233
|
+
* @param {string} vatId -
|
|
1234
|
+
* @throws {RevenexxException}
|
|
1235
|
+
* @returns {Promise<Models.Organization>}
|
|
1236
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1237
|
+
*/
|
|
1238
|
+
customersOrganizationsCreate(name: string, settings?: object, status?: OrganizationStatus, vatId?: string): Promise<Models.Organization>;
|
|
1239
|
+
customersOrganizationsCreate(
|
|
1240
|
+
paramsOrFirst: { name: string, settings?: object, status?: OrganizationStatus, vatId?: string } | string,
|
|
1241
|
+
...rest: [(object)?, (OrganizationStatus)?, (string)?]
|
|
1242
|
+
): Promise<Models.Organization> {
|
|
1243
|
+
let params: { name: string, settings?: object, status?: OrganizationStatus, vatId?: string };
|
|
1244
|
+
|
|
1245
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1246
|
+
params = (paramsOrFirst || {}) as { name: string, settings?: object, status?: OrganizationStatus, vatId?: string };
|
|
1247
|
+
} else {
|
|
1248
|
+
params = {
|
|
1249
|
+
name: paramsOrFirst as string,
|
|
1250
|
+
settings: rest[0] as object,
|
|
1251
|
+
status: rest[1] as OrganizationStatus,
|
|
1252
|
+
vatId: rest[2] as string
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
const name = params.name;
|
|
1257
|
+
const settings = params.settings;
|
|
1258
|
+
const status = params.status;
|
|
1259
|
+
const vatId = params.vatId;
|
|
1260
|
+
|
|
1261
|
+
if (typeof name === 'undefined') {
|
|
1262
|
+
throw new RevenexxException('Missing required parameter: "name"');
|
|
1263
|
+
}
|
|
565
1264
|
|
|
566
1265
|
const apiPath = '/v1/customers/organizations';
|
|
567
|
-
const
|
|
1266
|
+
const apiPayload: Payload = {};
|
|
1267
|
+
if (typeof name !== 'undefined') {
|
|
1268
|
+
apiPayload['name'] = name;
|
|
1269
|
+
}
|
|
1270
|
+
if (typeof settings !== 'undefined') {
|
|
1271
|
+
apiPayload['settings'] = settings;
|
|
1272
|
+
}
|
|
1273
|
+
if (typeof status !== 'undefined') {
|
|
1274
|
+
apiPayload['status'] = status;
|
|
1275
|
+
}
|
|
1276
|
+
if (typeof vatId !== 'undefined') {
|
|
1277
|
+
apiPayload['vat_id'] = vatId;
|
|
1278
|
+
}
|
|
568
1279
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
569
1280
|
|
|
570
1281
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -575,7 +1286,7 @@ export class Customers {
|
|
|
575
1286
|
'post',
|
|
576
1287
|
uri,
|
|
577
1288
|
apiHeaders,
|
|
578
|
-
|
|
1289
|
+
apiPayload
|
|
579
1290
|
);
|
|
580
1291
|
}
|
|
581
1292
|
|
|
@@ -614,7 +1325,7 @@ export class Customers {
|
|
|
614
1325
|
}
|
|
615
1326
|
|
|
616
1327
|
const apiPath = '/v1/customers/organizations/{id}'.replace('{id}', id);
|
|
617
|
-
const
|
|
1328
|
+
const apiPayload: Payload = {};
|
|
618
1329
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
619
1330
|
|
|
620
1331
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -624,7 +1335,7 @@ export class Customers {
|
|
|
624
1335
|
'delete',
|
|
625
1336
|
uri,
|
|
626
1337
|
apiHeaders,
|
|
627
|
-
|
|
1338
|
+
apiPayload
|
|
628
1339
|
);
|
|
629
1340
|
}
|
|
630
1341
|
|
|
@@ -663,7 +1374,7 @@ export class Customers {
|
|
|
663
1374
|
}
|
|
664
1375
|
|
|
665
1376
|
const apiPath = '/v1/customers/organizations/{id}'.replace('{id}', id);
|
|
666
|
-
const
|
|
1377
|
+
const apiPayload: Payload = {};
|
|
667
1378
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
668
1379
|
|
|
669
1380
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -673,46 +1384,75 @@ export class Customers {
|
|
|
673
1384
|
'get',
|
|
674
1385
|
uri,
|
|
675
1386
|
apiHeaders,
|
|
676
|
-
|
|
1387
|
+
apiPayload
|
|
677
1388
|
);
|
|
678
1389
|
}
|
|
679
1390
|
|
|
680
1391
|
/**
|
|
681
1392
|
*
|
|
682
1393
|
* @param {string} params.id -
|
|
1394
|
+
* @param {string} params.name - Company name — mirrored to the platform team.
|
|
1395
|
+
* @param {object} params.settings - Free-form organization settings.
|
|
1396
|
+
* @param {OrganizationStatus} params.status - Default 'active'.
|
|
1397
|
+
* @param {string} params.vatId -
|
|
683
1398
|
* @throws {RevenexxException}
|
|
684
1399
|
* @returns {Promise<Models.Organization>}
|
|
685
1400
|
*/
|
|
686
|
-
customersOrganizationsUpdate(params: { id: string }): Promise<Models.Organization>;
|
|
1401
|
+
customersOrganizationsUpdate(params: { id: string, name?: string, settings?: object, status?: OrganizationStatus, vatId?: string }): Promise<Models.Organization>;
|
|
687
1402
|
/**
|
|
688
1403
|
*
|
|
689
1404
|
* @param {string} id -
|
|
1405
|
+
* @param {string} name - Company name — mirrored to the platform team.
|
|
1406
|
+
* @param {object} settings - Free-form organization settings.
|
|
1407
|
+
* @param {OrganizationStatus} status - Default 'active'.
|
|
1408
|
+
* @param {string} vatId -
|
|
690
1409
|
* @throws {RevenexxException}
|
|
691
1410
|
* @returns {Promise<Models.Organization>}
|
|
692
1411
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
693
1412
|
*/
|
|
694
|
-
customersOrganizationsUpdate(id: string): Promise<Models.Organization>;
|
|
1413
|
+
customersOrganizationsUpdate(id: string, name?: string, settings?: object, status?: OrganizationStatus, vatId?: string): Promise<Models.Organization>;
|
|
695
1414
|
customersOrganizationsUpdate(
|
|
696
|
-
paramsOrFirst: { id: string } | string
|
|
1415
|
+
paramsOrFirst: { id: string, name?: string, settings?: object, status?: OrganizationStatus, vatId?: string } | string,
|
|
1416
|
+
...rest: [(string)?, (object)?, (OrganizationStatus)?, (string)?]
|
|
697
1417
|
): Promise<Models.Organization> {
|
|
698
|
-
let params: { id: string };
|
|
1418
|
+
let params: { id: string, name?: string, settings?: object, status?: OrganizationStatus, vatId?: string };
|
|
699
1419
|
|
|
700
1420
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
701
|
-
params = (paramsOrFirst || {}) as { id: string };
|
|
1421
|
+
params = (paramsOrFirst || {}) as { id: string, name?: string, settings?: object, status?: OrganizationStatus, vatId?: string };
|
|
702
1422
|
} else {
|
|
703
1423
|
params = {
|
|
704
|
-
id: paramsOrFirst as string
|
|
1424
|
+
id: paramsOrFirst as string,
|
|
1425
|
+
name: rest[0] as string,
|
|
1426
|
+
settings: rest[1] as object,
|
|
1427
|
+
status: rest[2] as OrganizationStatus,
|
|
1428
|
+
vatId: rest[3] as string
|
|
705
1429
|
};
|
|
706
1430
|
}
|
|
707
1431
|
|
|
708
1432
|
const id = params.id;
|
|
1433
|
+
const name = params.name;
|
|
1434
|
+
const settings = params.settings;
|
|
1435
|
+
const status = params.status;
|
|
1436
|
+
const vatId = params.vatId;
|
|
709
1437
|
|
|
710
1438
|
if (typeof id === 'undefined') {
|
|
711
1439
|
throw new RevenexxException('Missing required parameter: "id"');
|
|
712
1440
|
}
|
|
713
1441
|
|
|
714
1442
|
const apiPath = '/v1/customers/organizations/{id}'.replace('{id}', id);
|
|
715
|
-
const
|
|
1443
|
+
const apiPayload: Payload = {};
|
|
1444
|
+
if (typeof name !== 'undefined') {
|
|
1445
|
+
apiPayload['name'] = name;
|
|
1446
|
+
}
|
|
1447
|
+
if (typeof settings !== 'undefined') {
|
|
1448
|
+
apiPayload['settings'] = settings;
|
|
1449
|
+
}
|
|
1450
|
+
if (typeof status !== 'undefined') {
|
|
1451
|
+
apiPayload['status'] = status;
|
|
1452
|
+
}
|
|
1453
|
+
if (typeof vatId !== 'undefined') {
|
|
1454
|
+
apiPayload['vat_id'] = vatId;
|
|
1455
|
+
}
|
|
716
1456
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
717
1457
|
|
|
718
1458
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -723,7 +1463,7 @@ export class Customers {
|
|
|
723
1463
|
'put',
|
|
724
1464
|
uri,
|
|
725
1465
|
apiHeaders,
|
|
726
|
-
|
|
1466
|
+
apiPayload
|
|
727
1467
|
);
|
|
728
1468
|
}
|
|
729
1469
|
}
|