@plentymarkets/shop-api 0.135.0 → 0.137.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/api/doRegisterUser/index.d.ts +19 -13
- package/lib/api/doRegisterUser/index.d.ts.map +1 -1
- package/lib/api/doSaveAddress/index.d.ts.map +1 -1
- package/lib/getters/categoryGetters.d.ts +2 -0
- package/lib/getters/categoryGetters.d.ts.map +1 -1
- package/lib/getters/productPriceGetters.d.ts.map +1 -1
- package/lib/helpers/address.helper.d.ts +1 -0
- package/lib/helpers/address.helper.d.ts.map +1 -1
- package/lib/index.cjs.js +65 -56
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.es.js +65 -56
- package/lib/index.es.js.map +1 -1
- package/lib/types/api/register.d.ts +16 -2
- package/lib/types/api/register.d.ts.map +1 -1
- package/package.json +2 -2
- package/server/api/doRegisterUser/index.d.ts +19 -13
- package/server/api/doRegisterUser/index.d.ts.map +1 -1
- package/server/api/doSaveAddress/index.d.ts.map +1 -1
- package/server/getters/categoryGetters.d.ts +2 -0
- package/server/getters/categoryGetters.d.ts.map +1 -1
- package/server/getters/productPriceGetters.d.ts.map +1 -1
- package/server/helpers/address.helper.d.ts +1 -0
- package/server/helpers/address.helper.d.ts.map +1 -1
- package/server/index.js +59 -52
- package/server/index.js.map +1 -1
- package/server/types/api/register.d.ts +16 -2
- package/server/types/api/register.d.ts.map +1 -1
|
@@ -4,22 +4,28 @@ import { PlentysystemsIntegrationContext } from '../../types/context';
|
|
|
4
4
|
* Method doRegisterUser - Creates a new user account.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Calls /rest/storefront/customer/
|
|
8
|
+
* This method is used to register a new user account.
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
11
|
-
*
|
|
12
|
-
* password: string - User password.
|
|
13
|
-
*
|
|
14
|
-
* @returns
|
|
10
|
+
* @param params - Registration parameters including contact email, password, and optional address details.
|
|
11
|
+
* @returns A promise resolving to the user change response data.
|
|
15
12
|
*
|
|
16
13
|
* @example
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* password: 'Testuser1234'
|
|
21
|
-
*
|
|
22
|
-
*
|
|
14
|
+
* const response = await doRegisterUser(context, {
|
|
15
|
+
* 'cf-turnstile-response': '03Ag24...',
|
|
16
|
+
* contact: {
|
|
17
|
+
* password: 'Testuser1234',
|
|
18
|
+
* typeId: 1,
|
|
19
|
+
* referrerId: 123,
|
|
20
|
+
* options: {
|
|
21
|
+
* typeId: {
|
|
22
|
+
* value: 'user@test.com',
|
|
23
|
+
* subTypeId: 2,
|
|
24
|
+
* priority: 1,
|
|
25
|
+
* typeId: 1
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* },
|
|
23
29
|
*/
|
|
24
30
|
export declare const doRegisterUser: (context: PlentysystemsIntegrationContext, params: RegisterParams) => Promise<Data<UserChangeResponse>>;
|
|
25
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/doRegisterUser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/doRegisterUser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAGtE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,cAAc,GACzB,SAAS,+BAA+B,EACxC,QAAQ,cAAc,KACrB,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAoBlC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/doSaveAddress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,IAAI,EACJ,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/doSaveAddress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,IAAI,EACJ,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAMtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,aAAa,GACxB,SAAS,+BAA+B,EACxC,QAAQ,mBAAmB,KAC1B,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAyBzB,CAAC"}
|
|
@@ -4,6 +4,7 @@ declare function getParentId(category: Category): number;
|
|
|
4
4
|
declare function getCategoryDetails(category: Category): CategoryDetails | null;
|
|
5
5
|
declare function getCategoryDescription1(category: Category): string;
|
|
6
6
|
declare function getCategoryDescription2(category: Category): string;
|
|
7
|
+
declare function getCategoryShortDescription(category: Category): string;
|
|
7
8
|
declare function getMetaTitle(category: Category): string;
|
|
8
9
|
declare function getMetaDescription(category: Category): string;
|
|
9
10
|
declare function getMetaKeywords(category: Category): string;
|
|
@@ -26,6 +27,7 @@ export declare const categoryGetters: {
|
|
|
26
27
|
getCategoryRobots: typeof getCategoryRobots;
|
|
27
28
|
getCategoryDescription1: typeof getCategoryDescription1;
|
|
28
29
|
getCategoryDescription2: typeof getCategoryDescription2;
|
|
30
|
+
getCategoryShortDescription: typeof getCategoryShortDescription;
|
|
29
31
|
};
|
|
30
32
|
export {};
|
|
31
33
|
//# sourceMappingURL=categoryGetters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categoryGetters.d.ts","sourceRoot":"","sources":["../../src/getters/categoryGetters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE1D,iBAAS,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEzC;AAED,iBAAS,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE/C;AACD,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,eAAe,GAAG,IAAI,CAEtE;AAED,iBAAS,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE3D;AAED,iBAAS,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE3D;AAED,iBAAS,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEhD;AAED,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEtD;AAED,iBAAS,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEnD;AAED,iBAAS,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEnD;AAED,iBAAS,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEnD;AAED,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEpD;AAED,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAErD;AAED,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAErD;AAED,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"categoryGetters.d.ts","sourceRoot":"","sources":["../../src/getters/categoryGetters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,e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.ts","sourceRoot":"","sources":["../../src/getters/productPriceGetters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6GjE,eAAO,MAAM,mBAAmB;wBA3GL,OAAO,KAAG,MAAM,GAAG,IAAI;+BAIhB,OAAO,KAAG,MAAM,GAAG,IAAI;+BAIvB,OAAO,KAAG,MAAM,GAAG,IAAI;8BAIxB,OAAO,KAAG,MAAM,GAAG,IAAI;kCAInB,OAAO,KAAG,OAAO,EAAE;2CAS7C,OAAO,YACN,MAAM,KACf,OAAO,GAAG,IAAI;gCAakB,OAAO,KAAG,kBAAkB,EAAE;yCAiBrB,OAAO,KAAG,MAAM;kDAQP,OAAO,KAAG,MAAM;wCAgB1B,OAAO,KAAG,MAAM;iCAJvB,OAAO,KAAG,MAAM;wCAJT,OAAO,KAAG,MAAM;gCAYxB,OAAO,KAAG,OAAO;yCAMR,OAAO,KAAG,MAAM;mCAItB,OAAO,KAAG,MAAM;uCAIZ,OAAO,KAAG,MAAM;uCAIhB,OAAO,KAAG,MAAM;CAsBzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/address.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"address.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/address.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AAWtB,eAAO,MAAM,mBAAmB,GAAI,SAAS,OAAO,KAAG,MAuBtD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,aAAa,WAAW,KAAG,OAuC9D,CAAC"}
|
package/lib/index.cjs.js
CHANGED
|
@@ -208,6 +208,36 @@ class ApiError {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
const convertToNumberOrNull = (value) => {
|
|
212
|
+
if (value === null || value === undefined || value === '')
|
|
213
|
+
return null;
|
|
214
|
+
const parsedNumber = Number(value);
|
|
215
|
+
return isNaN(parsedNumber) ? null : parsedNumber;
|
|
216
|
+
};
|
|
217
|
+
const mapAddressForServer = (address) => {
|
|
218
|
+
return {
|
|
219
|
+
...(address.id && { id: address.id }),
|
|
220
|
+
gender: '',
|
|
221
|
+
countryId: Number(address?.country ?? 0),
|
|
222
|
+
email: address.email,
|
|
223
|
+
name1: address.companyName,
|
|
224
|
+
name2: address.firstName,
|
|
225
|
+
name3: address.lastName,
|
|
226
|
+
vatNumber: address.vatNumber,
|
|
227
|
+
contactPerson: '',
|
|
228
|
+
address1: address.streetName,
|
|
229
|
+
address2: address.apartment,
|
|
230
|
+
address3: address.additionalAddressInformation,
|
|
231
|
+
postalCode: address.zipCode,
|
|
232
|
+
postNumber: address.postNumber?.trim() !== '' ? address.postNumber : null,
|
|
233
|
+
town: address.city,
|
|
234
|
+
telephone: address.phoneNumber,
|
|
235
|
+
stateId: convertToNumberOrNull(address.state),
|
|
236
|
+
birthday: address.birthday,
|
|
237
|
+
...(address.primary && { isPrimary: true }),
|
|
238
|
+
...(address.id && { pivot: { isPrimary: true } }),
|
|
239
|
+
};
|
|
240
|
+
};
|
|
211
241
|
const mapAddressForClient = (addressData) => {
|
|
212
242
|
const address = {
|
|
213
243
|
id: addressData.id,
|
|
@@ -344,30 +374,6 @@ const doSaveAddress = async (context, params) => {
|
|
|
344
374
|
mappedResponse.sort((a, b) => b.primary > a.primary ? 1 : -1);
|
|
345
375
|
return { data: mappedResponse };
|
|
346
376
|
};
|
|
347
|
-
function mapAddressForServer(address) {
|
|
348
|
-
return {
|
|
349
|
-
...(address.id && { id: address.id }),
|
|
350
|
-
gender: '',
|
|
351
|
-
countryId: Number(address?.country ?? 0),
|
|
352
|
-
email: address.email,
|
|
353
|
-
name1: address.companyName,
|
|
354
|
-
name2: address.firstName,
|
|
355
|
-
name3: address.lastName,
|
|
356
|
-
vatNumber: address.vatNumber,
|
|
357
|
-
contactPerson: '',
|
|
358
|
-
address1: address.streetName,
|
|
359
|
-
address2: address.apartment,
|
|
360
|
-
address3: address.additionalAddressInformation,
|
|
361
|
-
postalCode: address.zipCode,
|
|
362
|
-
postNumber: address.postNumber?.trim() !== '' ? address.postNumber : null,
|
|
363
|
-
town: address.city,
|
|
364
|
-
telephone: address.phoneNumber,
|
|
365
|
-
stateId: address.state,
|
|
366
|
-
birthday: address.birthday,
|
|
367
|
-
...(address.primary && { isPrimary: true }),
|
|
368
|
-
...(address.id && { pivot: { isPrimary: true } }),
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
377
|
|
|
372
378
|
/**
|
|
373
379
|
* Method setCheckoutAddress - sets a billing or shipping address as default.
|
|
@@ -1352,41 +1358,42 @@ const doLoginAsGuest = async (context, params) => {
|
|
|
1352
1358
|
* Method doRegisterUser - Creates a new user account.
|
|
1353
1359
|
*
|
|
1354
1360
|
* @remarks
|
|
1355
|
-
*
|
|
1356
|
-
*
|
|
1361
|
+
* Calls /rest/storefront/customer/
|
|
1362
|
+
* This method is used to register a new user account.
|
|
1357
1363
|
*
|
|
1358
|
-
* @param
|
|
1359
|
-
*
|
|
1360
|
-
* password: string - User password.
|
|
1361
|
-
*
|
|
1362
|
-
* @returns
|
|
1364
|
+
* @param params - Registration parameters including contact email, password, and optional address details.
|
|
1365
|
+
* @returns A promise resolving to the user change response data.
|
|
1363
1366
|
*
|
|
1364
1367
|
* @example
|
|
1365
|
-
*
|
|
1366
|
-
*
|
|
1367
|
-
*
|
|
1368
|
-
* password: 'Testuser1234'
|
|
1369
|
-
*
|
|
1370
|
-
*
|
|
1368
|
+
* const response = await doRegisterUser(context, {
|
|
1369
|
+
* 'cf-turnstile-response': '03Ag24...',
|
|
1370
|
+
* contact: {
|
|
1371
|
+
* password: 'Testuser1234',
|
|
1372
|
+
* typeId: 1,
|
|
1373
|
+
* referrerId: 123,
|
|
1374
|
+
* options: {
|
|
1375
|
+
* typeId: {
|
|
1376
|
+
* value: 'user@test.com',
|
|
1377
|
+
* subTypeId: 2,
|
|
1378
|
+
* priority: 1,
|
|
1379
|
+
* typeId: 1
|
|
1380
|
+
* }
|
|
1381
|
+
* }
|
|
1382
|
+
* },
|
|
1371
1383
|
*/
|
|
1372
1384
|
const doRegisterUser = async (context, params) => {
|
|
1373
1385
|
const url = new URL('/rest/storefront/customer/', context.config.api.url);
|
|
1374
|
-
const
|
|
1386
|
+
const payload = {
|
|
1387
|
+
contact: params.contact,
|
|
1388
|
+
...(params.billingAddress && {
|
|
1389
|
+
billingAddress: mapAddressForServer(params.billingAddress),
|
|
1390
|
+
}),
|
|
1391
|
+
...(params.deliveryAddress && {
|
|
1392
|
+
deliveryAddress: mapAddressForServer(params.deliveryAddress),
|
|
1393
|
+
}),
|
|
1375
1394
|
'cf-turnstile-response': params['cf-turnstile-response'],
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
typeId: 1,
|
|
1379
|
-
referrerId: 1,
|
|
1380
|
-
options: {
|
|
1381
|
-
typeId: {
|
|
1382
|
-
value: params.email,
|
|
1383
|
-
subTypeId: 4,
|
|
1384
|
-
priority: 0,
|
|
1385
|
-
typeId: 2,
|
|
1386
|
-
},
|
|
1387
|
-
},
|
|
1388
|
-
},
|
|
1389
|
-
});
|
|
1395
|
+
};
|
|
1396
|
+
const { data } = await context.client.post(url.href, payload);
|
|
1390
1397
|
return { data: data };
|
|
1391
1398
|
};
|
|
1392
1399
|
|
|
@@ -3935,13 +3942,11 @@ const getGraduatedList = (product) => {
|
|
|
3935
3942
|
const graduatedPrices = getGraduatedPrices(product);
|
|
3936
3943
|
return graduatedPrices
|
|
3937
3944
|
.filter((price) => price.minimumOrderQuantity > 1)
|
|
3938
|
-
.map((price
|
|
3945
|
+
.map((price) => {
|
|
3939
3946
|
const preparedPrice = ((price.price.value ?? 0) / startPrice) * 100;
|
|
3940
3947
|
return {
|
|
3941
3948
|
price: price.price.value || 0,
|
|
3942
|
-
quantity:
|
|
3943
|
-
? '+'
|
|
3944
|
-
: '-' + (array[index + 1].minimumOrderQuantity - 1)}`,
|
|
3949
|
+
quantity: String(price.minimumOrderQuantity),
|
|
3945
3950
|
discount: (100 - preparedPrice).toFixed(1),
|
|
3946
3951
|
};
|
|
3947
3952
|
});
|
|
@@ -4661,6 +4666,9 @@ function getCategoryDescription1(category) {
|
|
|
4661
4666
|
function getCategoryDescription2(category) {
|
|
4662
4667
|
return category.details?.[0]?.description2 || '';
|
|
4663
4668
|
}
|
|
4669
|
+
function getCategoryShortDescription(category) {
|
|
4670
|
+
return category.details?.[0]?.shortDescription || '';
|
|
4671
|
+
}
|
|
4664
4672
|
function getMetaTitle(category) {
|
|
4665
4673
|
return category.details?.[0]?.metaTitle || '';
|
|
4666
4674
|
}
|
|
@@ -4699,6 +4707,7 @@ const categoryGetters = {
|
|
|
4699
4707
|
getCategoryRobots,
|
|
4700
4708
|
getCategoryDescription1,
|
|
4701
4709
|
getCategoryDescription2,
|
|
4710
|
+
getCategoryShortDescription,
|
|
4702
4711
|
};
|
|
4703
4712
|
|
|
4704
4713
|
function getAll(
|
package/lib/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/index.es.js
CHANGED
|
@@ -184,6 +184,36 @@ class ApiError {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
const convertToNumberOrNull = (value) => {
|
|
188
|
+
if (value === null || value === undefined || value === '')
|
|
189
|
+
return null;
|
|
190
|
+
const parsedNumber = Number(value);
|
|
191
|
+
return isNaN(parsedNumber) ? null : parsedNumber;
|
|
192
|
+
};
|
|
193
|
+
const mapAddressForServer = (address) => {
|
|
194
|
+
return {
|
|
195
|
+
...(address.id && { id: address.id }),
|
|
196
|
+
gender: '',
|
|
197
|
+
countryId: Number(address?.country ?? 0),
|
|
198
|
+
email: address.email,
|
|
199
|
+
name1: address.companyName,
|
|
200
|
+
name2: address.firstName,
|
|
201
|
+
name3: address.lastName,
|
|
202
|
+
vatNumber: address.vatNumber,
|
|
203
|
+
contactPerson: '',
|
|
204
|
+
address1: address.streetName,
|
|
205
|
+
address2: address.apartment,
|
|
206
|
+
address3: address.additionalAddressInformation,
|
|
207
|
+
postalCode: address.zipCode,
|
|
208
|
+
postNumber: address.postNumber?.trim() !== '' ? address.postNumber : null,
|
|
209
|
+
town: address.city,
|
|
210
|
+
telephone: address.phoneNumber,
|
|
211
|
+
stateId: convertToNumberOrNull(address.state),
|
|
212
|
+
birthday: address.birthday,
|
|
213
|
+
...(address.primary && { isPrimary: true }),
|
|
214
|
+
...(address.id && { pivot: { isPrimary: true } }),
|
|
215
|
+
};
|
|
216
|
+
};
|
|
187
217
|
const mapAddressForClient = (addressData) => {
|
|
188
218
|
const address = {
|
|
189
219
|
id: addressData.id,
|
|
@@ -320,30 +350,6 @@ const doSaveAddress = async (context, params) => {
|
|
|
320
350
|
mappedResponse.sort((a, b) => b.primary > a.primary ? 1 : -1);
|
|
321
351
|
return { data: mappedResponse };
|
|
322
352
|
};
|
|
323
|
-
function mapAddressForServer(address) {
|
|
324
|
-
return {
|
|
325
|
-
...(address.id && { id: address.id }),
|
|
326
|
-
gender: '',
|
|
327
|
-
countryId: Number(address?.country ?? 0),
|
|
328
|
-
email: address.email,
|
|
329
|
-
name1: address.companyName,
|
|
330
|
-
name2: address.firstName,
|
|
331
|
-
name3: address.lastName,
|
|
332
|
-
vatNumber: address.vatNumber,
|
|
333
|
-
contactPerson: '',
|
|
334
|
-
address1: address.streetName,
|
|
335
|
-
address2: address.apartment,
|
|
336
|
-
address3: address.additionalAddressInformation,
|
|
337
|
-
postalCode: address.zipCode,
|
|
338
|
-
postNumber: address.postNumber?.trim() !== '' ? address.postNumber : null,
|
|
339
|
-
town: address.city,
|
|
340
|
-
telephone: address.phoneNumber,
|
|
341
|
-
stateId: address.state,
|
|
342
|
-
birthday: address.birthday,
|
|
343
|
-
...(address.primary && { isPrimary: true }),
|
|
344
|
-
...(address.id && { pivot: { isPrimary: true } }),
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
353
|
|
|
348
354
|
/**
|
|
349
355
|
* Method setCheckoutAddress - sets a billing or shipping address as default.
|
|
@@ -1328,41 +1334,42 @@ const doLoginAsGuest = async (context, params) => {
|
|
|
1328
1334
|
* Method doRegisterUser - Creates a new user account.
|
|
1329
1335
|
*
|
|
1330
1336
|
* @remarks
|
|
1331
|
-
*
|
|
1332
|
-
*
|
|
1337
|
+
* Calls /rest/storefront/customer/
|
|
1338
|
+
* This method is used to register a new user account.
|
|
1333
1339
|
*
|
|
1334
|
-
* @param
|
|
1335
|
-
*
|
|
1336
|
-
* password: string - User password.
|
|
1337
|
-
*
|
|
1338
|
-
* @returns
|
|
1340
|
+
* @param params - Registration parameters including contact email, password, and optional address details.
|
|
1341
|
+
* @returns A promise resolving to the user change response data.
|
|
1339
1342
|
*
|
|
1340
1343
|
* @example
|
|
1341
|
-
*
|
|
1342
|
-
*
|
|
1343
|
-
*
|
|
1344
|
-
* password: 'Testuser1234'
|
|
1345
|
-
*
|
|
1346
|
-
*
|
|
1344
|
+
* const response = await doRegisterUser(context, {
|
|
1345
|
+
* 'cf-turnstile-response': '03Ag24...',
|
|
1346
|
+
* contact: {
|
|
1347
|
+
* password: 'Testuser1234',
|
|
1348
|
+
* typeId: 1,
|
|
1349
|
+
* referrerId: 123,
|
|
1350
|
+
* options: {
|
|
1351
|
+
* typeId: {
|
|
1352
|
+
* value: 'user@test.com',
|
|
1353
|
+
* subTypeId: 2,
|
|
1354
|
+
* priority: 1,
|
|
1355
|
+
* typeId: 1
|
|
1356
|
+
* }
|
|
1357
|
+
* }
|
|
1358
|
+
* },
|
|
1347
1359
|
*/
|
|
1348
1360
|
const doRegisterUser = async (context, params) => {
|
|
1349
1361
|
const url = new URL('/rest/storefront/customer/', context.config.api.url);
|
|
1350
|
-
const
|
|
1362
|
+
const payload = {
|
|
1363
|
+
contact: params.contact,
|
|
1364
|
+
...(params.billingAddress && {
|
|
1365
|
+
billingAddress: mapAddressForServer(params.billingAddress),
|
|
1366
|
+
}),
|
|
1367
|
+
...(params.deliveryAddress && {
|
|
1368
|
+
deliveryAddress: mapAddressForServer(params.deliveryAddress),
|
|
1369
|
+
}),
|
|
1351
1370
|
'cf-turnstile-response': params['cf-turnstile-response'],
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
typeId: 1,
|
|
1355
|
-
referrerId: 1,
|
|
1356
|
-
options: {
|
|
1357
|
-
typeId: {
|
|
1358
|
-
value: params.email,
|
|
1359
|
-
subTypeId: 4,
|
|
1360
|
-
priority: 0,
|
|
1361
|
-
typeId: 2,
|
|
1362
|
-
},
|
|
1363
|
-
},
|
|
1364
|
-
},
|
|
1365
|
-
});
|
|
1371
|
+
};
|
|
1372
|
+
const { data } = await context.client.post(url.href, payload);
|
|
1366
1373
|
return { data: data };
|
|
1367
1374
|
};
|
|
1368
1375
|
|
|
@@ -3911,13 +3918,11 @@ const getGraduatedList = (product) => {
|
|
|
3911
3918
|
const graduatedPrices = getGraduatedPrices(product);
|
|
3912
3919
|
return graduatedPrices
|
|
3913
3920
|
.filter((price) => price.minimumOrderQuantity > 1)
|
|
3914
|
-
.map((price
|
|
3921
|
+
.map((price) => {
|
|
3915
3922
|
const preparedPrice = ((price.price.value ?? 0) / startPrice) * 100;
|
|
3916
3923
|
return {
|
|
3917
3924
|
price: price.price.value || 0,
|
|
3918
|
-
quantity:
|
|
3919
|
-
? '+'
|
|
3920
|
-
: '-' + (array[index + 1].minimumOrderQuantity - 1)}`,
|
|
3925
|
+
quantity: String(price.minimumOrderQuantity),
|
|
3921
3926
|
discount: (100 - preparedPrice).toFixed(1),
|
|
3922
3927
|
};
|
|
3923
3928
|
});
|
|
@@ -4637,6 +4642,9 @@ function getCategoryDescription1(category) {
|
|
|
4637
4642
|
function getCategoryDescription2(category) {
|
|
4638
4643
|
return category.details?.[0]?.description2 || '';
|
|
4639
4644
|
}
|
|
4645
|
+
function getCategoryShortDescription(category) {
|
|
4646
|
+
return category.details?.[0]?.shortDescription || '';
|
|
4647
|
+
}
|
|
4640
4648
|
function getMetaTitle(category) {
|
|
4641
4649
|
return category.details?.[0]?.metaTitle || '';
|
|
4642
4650
|
}
|
|
@@ -4675,6 +4683,7 @@ const categoryGetters = {
|
|
|
4675
4683
|
getCategoryRobots,
|
|
4676
4684
|
getCategoryDescription1,
|
|
4677
4685
|
getCategoryDescription2,
|
|
4686
|
+
getCategoryShortDescription,
|
|
4678
4687
|
};
|
|
4679
4688
|
|
|
4680
4689
|
function getAll(
|
package/lib/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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from './address';
|
|
2
3
|
export interface RegisterParams extends RecaptchaPayload {
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
contact: {
|
|
5
|
+
password: string;
|
|
6
|
+
typeId: number;
|
|
7
|
+
referrerId: number;
|
|
8
|
+
options: {
|
|
9
|
+
typeId: {
|
|
10
|
+
value: string;
|
|
11
|
+
subTypeId: number;
|
|
12
|
+
priority: number;
|
|
13
|
+
typeId: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
deliveryAddress?: Address;
|
|
18
|
+
billingAddress?: Address;
|
|
5
19
|
}
|
|
6
20
|
export interface RequestPasswordResetParams {
|
|
7
21
|
email: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/types/api/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/types/api/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,OAAO,EAAE;QACP,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,KAAK,EAAE,MAAM,CAAC;gBACd,SAAS,EAAE,MAAM,CAAC;gBAClB,QAAQ,EAAE,MAAM,CAAC;gBACjB,MAAM,EAAE,MAAM,CAAC;aAChB,CAAC;SACH,CAAC;KACH,CAAC;IACF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plentymarkets/shop-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.137.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"lib/**/*",
|
|
48
48
|
"server/**/*"
|
|
49
49
|
],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "d52123462a8b739de8cd0678575ab25a9e60779a"
|
|
51
51
|
}
|
|
@@ -4,22 +4,28 @@ import { PlentysystemsIntegrationContext } from '../../types/context';
|
|
|
4
4
|
* Method doRegisterUser - Creates a new user account.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Calls /rest/storefront/customer/
|
|
8
|
+
* This method is used to register a new user account.
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
11
|
-
*
|
|
12
|
-
* password: string - User password.
|
|
13
|
-
*
|
|
14
|
-
* @returns
|
|
10
|
+
* @param params - Registration parameters including contact email, password, and optional address details.
|
|
11
|
+
* @returns A promise resolving to the user change response data.
|
|
15
12
|
*
|
|
16
13
|
* @example
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* password: 'Testuser1234'
|
|
21
|
-
*
|
|
22
|
-
*
|
|
14
|
+
* const response = await doRegisterUser(context, {
|
|
15
|
+
* 'cf-turnstile-response': '03Ag24...',
|
|
16
|
+
* contact: {
|
|
17
|
+
* password: 'Testuser1234',
|
|
18
|
+
* typeId: 1,
|
|
19
|
+
* referrerId: 123,
|
|
20
|
+
* options: {
|
|
21
|
+
* typeId: {
|
|
22
|
+
* value: 'user@test.com',
|
|
23
|
+
* subTypeId: 2,
|
|
24
|
+
* priority: 1,
|
|
25
|
+
* typeId: 1
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* },
|
|
23
29
|
*/
|
|
24
30
|
export declare const doRegisterUser: (context: PlentysystemsIntegrationContext, params: RegisterParams) => Promise<Data<UserChangeResponse>>;
|
|
25
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/doRegisterUser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/doRegisterUser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAGtE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,cAAc,GACzB,SAAS,+BAA+B,EACxC,QAAQ,cAAc,KACrB,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAoBlC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/doSaveAddress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,IAAI,EACJ,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/doSaveAddress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,IAAI,EACJ,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAMtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,aAAa,GACxB,SAAS,+BAA+B,EACxC,QAAQ,mBAAmB,KAC1B,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAyBzB,CAAC"}
|
|
@@ -4,6 +4,7 @@ declare function getParentId(category: Category): number;
|
|
|
4
4
|
declare function getCategoryDetails(category: Category): CategoryDetails | null;
|
|
5
5
|
declare function getCategoryDescription1(category: Category): string;
|
|
6
6
|
declare function getCategoryDescription2(category: Category): string;
|
|
7
|
+
declare function getCategoryShortDescription(category: Category): string;
|
|
7
8
|
declare function getMetaTitle(category: Category): string;
|
|
8
9
|
declare function getMetaDescription(category: Category): string;
|
|
9
10
|
declare function getMetaKeywords(category: Category): string;
|
|
@@ -26,6 +27,7 @@ export declare const categoryGetters: {
|
|
|
26
27
|
getCategoryRobots: typeof getCategoryRobots;
|
|
27
28
|
getCategoryDescription1: typeof getCategoryDescription1;
|
|
28
29
|
getCategoryDescription2: typeof getCategoryDescription2;
|
|
30
|
+
getCategoryShortDescription: typeof getCategoryShortDescription;
|
|
29
31
|
};
|
|
30
32
|
export {};
|
|
31
33
|
//# sourceMappingURL=categoryGetters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categoryGetters.d.ts","sourceRoot":"","sources":["../../src/getters/categoryGetters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE1D,iBAAS,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEzC;AAED,iBAAS,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE/C;AACD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AAM,CAE3D;AAED,iBAAS,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE/D;AAED,iBAAS,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEhD;AAED,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEtD;AAED,iBAAS,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEnD;AAED,iBAAS,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEnD;AAED,iBAAS,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEnD;AAED,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEpD;AAED,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAErD;AAED,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAErD;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAe3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productPriceGetters.d.ts","sourceRoot":"","sources":["../../src/getters/productPriceGetters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"productPriceGetters.d.ts","sourceRoot":"","sources":["../../src/getters/productPriceGetters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6GjE,eAAO,MAAM,mBAAmB;wBA3GL,OAAO,KAAG,MAAM,GAAG,IAAI;+BAIhB,OAAO,KAAG,MAAM,GAAG,IAAI;+BAIvB,OAAO,KAAG,MAAM,GAAG,IAAI;8BAIxB,OAAO,KAAG,MAAM,GAAG,IAAI;kCAInB,OAAO,KAAG,OAAO,EAAE;2CAS7C,OAAO,YACN,MAAM,KACf,OAAO,GAAG,IAAI;gCAakB,OAAO,KAAG,kBAAkB,EAAE;yCAiBrB,OAAO,KAAG,MAAM;kDAQP,OAAO,KAAG,MAAM;wCAgB1B,OAAO,KAAG,MAAM;iCAJvB,OAAO,KAAG,MAAM;wCAJT,OAAO,KAAG,MAAM;gCAYxB,OAAO,KAAG,OAAO;yCAMR,OAAO,KAAG,MAAM;mCAItB,OAAO,KAAG,MAAM;uCAIZ,OAAO,KAAG,MAAM;uCAIhB,OAAO,KAAG,MAAM;CAsBzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/address.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"address.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/address.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AAWtB,eAAO,MAAM,mBAAmB,GAAI,SAAS,OAAO,KAAG,MAuBtD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,aAAa,WAAW,KAAG,OAuC9D,CAAC"}
|
package/server/index.js
CHANGED
|
@@ -185,6 +185,36 @@ class ApiError {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
const convertToNumberOrNull = (value) => {
|
|
189
|
+
if (value === null || value === undefined || value === '')
|
|
190
|
+
return null;
|
|
191
|
+
const parsedNumber = Number(value);
|
|
192
|
+
return isNaN(parsedNumber) ? null : parsedNumber;
|
|
193
|
+
};
|
|
194
|
+
const mapAddressForServer = (address) => {
|
|
195
|
+
return {
|
|
196
|
+
...(address.id && { id: address.id }),
|
|
197
|
+
gender: '',
|
|
198
|
+
countryId: Number(address?.country ?? 0),
|
|
199
|
+
email: address.email,
|
|
200
|
+
name1: address.companyName,
|
|
201
|
+
name2: address.firstName,
|
|
202
|
+
name3: address.lastName,
|
|
203
|
+
vatNumber: address.vatNumber,
|
|
204
|
+
contactPerson: '',
|
|
205
|
+
address1: address.streetName,
|
|
206
|
+
address2: address.apartment,
|
|
207
|
+
address3: address.additionalAddressInformation,
|
|
208
|
+
postalCode: address.zipCode,
|
|
209
|
+
postNumber: address.postNumber?.trim() !== '' ? address.postNumber : null,
|
|
210
|
+
town: address.city,
|
|
211
|
+
telephone: address.phoneNumber,
|
|
212
|
+
stateId: convertToNumberOrNull(address.state),
|
|
213
|
+
birthday: address.birthday,
|
|
214
|
+
...(address.primary && { isPrimary: true }),
|
|
215
|
+
...(address.id && { pivot: { isPrimary: true } }),
|
|
216
|
+
};
|
|
217
|
+
};
|
|
188
218
|
const mapAddressForClient = (addressData) => {
|
|
189
219
|
const address = {
|
|
190
220
|
id: addressData.id,
|
|
@@ -332,30 +362,6 @@ const doSaveAddress = async (context, params) => {
|
|
|
332
362
|
mappedResponse.sort((a, b) => b.primary > a.primary ? 1 : -1);
|
|
333
363
|
return { data: mappedResponse };
|
|
334
364
|
};
|
|
335
|
-
function mapAddressForServer(address) {
|
|
336
|
-
return {
|
|
337
|
-
...(address.id && { id: address.id }),
|
|
338
|
-
gender: '',
|
|
339
|
-
countryId: Number(address?.country ?? 0),
|
|
340
|
-
email: address.email,
|
|
341
|
-
name1: address.companyName,
|
|
342
|
-
name2: address.firstName,
|
|
343
|
-
name3: address.lastName,
|
|
344
|
-
vatNumber: address.vatNumber,
|
|
345
|
-
contactPerson: '',
|
|
346
|
-
address1: address.streetName,
|
|
347
|
-
address2: address.apartment,
|
|
348
|
-
address3: address.additionalAddressInformation,
|
|
349
|
-
postalCode: address.zipCode,
|
|
350
|
-
postNumber: address.postNumber?.trim() !== '' ? address.postNumber : null,
|
|
351
|
-
town: address.city,
|
|
352
|
-
telephone: address.phoneNumber,
|
|
353
|
-
stateId: address.state,
|
|
354
|
-
birthday: address.birthday,
|
|
355
|
-
...(address.primary && { isPrimary: true }),
|
|
356
|
-
...(address.id && { pivot: { isPrimary: true } }),
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
365
|
|
|
360
366
|
/**
|
|
361
367
|
* Method setCheckoutAddress - sets a billing or shipping address as default.
|
|
@@ -1340,41 +1346,42 @@ const doLoginAsGuest = async (context, params) => {
|
|
|
1340
1346
|
* Method doRegisterUser - Creates a new user account.
|
|
1341
1347
|
*
|
|
1342
1348
|
* @remarks
|
|
1343
|
-
*
|
|
1344
|
-
*
|
|
1349
|
+
* Calls /rest/storefront/customer/
|
|
1350
|
+
* This method is used to register a new user account.
|
|
1345
1351
|
*
|
|
1346
|
-
* @param
|
|
1347
|
-
*
|
|
1348
|
-
* password: string - User password.
|
|
1349
|
-
*
|
|
1350
|
-
* @returns
|
|
1352
|
+
* @param params - Registration parameters including contact email, password, and optional address details.
|
|
1353
|
+
* @returns A promise resolving to the user change response data.
|
|
1351
1354
|
*
|
|
1352
1355
|
* @example
|
|
1353
|
-
*
|
|
1354
|
-
*
|
|
1355
|
-
*
|
|
1356
|
-
* password: 'Testuser1234'
|
|
1357
|
-
*
|
|
1358
|
-
*
|
|
1356
|
+
* const response = await doRegisterUser(context, {
|
|
1357
|
+
* 'cf-turnstile-response': '03Ag24...',
|
|
1358
|
+
* contact: {
|
|
1359
|
+
* password: 'Testuser1234',
|
|
1360
|
+
* typeId: 1,
|
|
1361
|
+
* referrerId: 123,
|
|
1362
|
+
* options: {
|
|
1363
|
+
* typeId: {
|
|
1364
|
+
* value: 'user@test.com',
|
|
1365
|
+
* subTypeId: 2,
|
|
1366
|
+
* priority: 1,
|
|
1367
|
+
* typeId: 1
|
|
1368
|
+
* }
|
|
1369
|
+
* }
|
|
1370
|
+
* },
|
|
1359
1371
|
*/
|
|
1360
1372
|
const doRegisterUser = async (context, params) => {
|
|
1361
1373
|
const url = new URL('/rest/storefront/customer/', context.config.api.url);
|
|
1362
|
-
const
|
|
1374
|
+
const payload = {
|
|
1375
|
+
contact: params.contact,
|
|
1376
|
+
...(params.billingAddress && {
|
|
1377
|
+
billingAddress: mapAddressForServer(params.billingAddress),
|
|
1378
|
+
}),
|
|
1379
|
+
...(params.deliveryAddress && {
|
|
1380
|
+
deliveryAddress: mapAddressForServer(params.deliveryAddress),
|
|
1381
|
+
}),
|
|
1363
1382
|
'cf-turnstile-response': params['cf-turnstile-response'],
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
typeId: 1,
|
|
1367
|
-
referrerId: 1,
|
|
1368
|
-
options: {
|
|
1369
|
-
typeId: {
|
|
1370
|
-
value: params.email,
|
|
1371
|
-
subTypeId: 4,
|
|
1372
|
-
priority: 0,
|
|
1373
|
-
typeId: 2,
|
|
1374
|
-
},
|
|
1375
|
-
},
|
|
1376
|
-
},
|
|
1377
|
-
});
|
|
1383
|
+
};
|
|
1384
|
+
const { data } = await context.client.post(url.href, payload);
|
|
1378
1385
|
return { data: data };
|
|
1379
1386
|
};
|
|
1380
1387
|
|
package/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { RecaptchaPayload } from './recaptcha';
|
|
2
|
+
import { Address } from './address';
|
|
2
3
|
export interface RegisterParams extends RecaptchaPayload {
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
contact: {
|
|
5
|
+
password: string;
|
|
6
|
+
typeId: number;
|
|
7
|
+
referrerId: number;
|
|
8
|
+
options: {
|
|
9
|
+
typeId: {
|
|
10
|
+
value: string;
|
|
11
|
+
subTypeId: number;
|
|
12
|
+
priority: number;
|
|
13
|
+
typeId: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
deliveryAddress?: Address;
|
|
18
|
+
billingAddress?: Address;
|
|
5
19
|
}
|
|
6
20
|
export interface RequestPasswordResetParams {
|
|
7
21
|
email: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/types/api/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/types/api/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,OAAO,EAAE;QACP,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,KAAK,EAAE,MAAM,CAAC;gBACd,SAAS,EAAE,MAAM,CAAC;gBAClB,QAAQ,EAAE,MAAM,CAAC;gBACjB,MAAM,EAAE,MAAM,CAAC;aAChB,CAAC;SACH,CAAC;KACH,CAAC;IACF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd"}
|