@ikas/storefront 0.0.161-alpha.1 → 0.0.161-alpha.10
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/build/__generated__/global-types.d.ts +2 -0
- package/build/api/customer/__generated__/registerCustomer.d.ts +1 -0
- package/build/api/customer/index.d.ts +1 -1
- package/build/index.es.js +49 -16
- package/build/index.js +49 -16
- package/build/models/ui/validator/form/register.d.ts +3 -0
- package/build/store/customer.d.ts +1 -1
- package/package.json +1 -1
|
@@ -221,6 +221,7 @@ export declare enum ProductFilterDisplayTypeEnum {
|
|
|
221
221
|
export declare enum ProductFilterSortTypeEnum {
|
|
222
222
|
ALPHABETICAL_ASC = "ALPHABETICAL_ASC",
|
|
223
223
|
ALPHABETICAL_DESC = "ALPHABETICAL_DESC",
|
|
224
|
+
CUSTOM_SORT = "CUSTOM_SORT",
|
|
224
225
|
PRODUCT_COUNT_ASC = "PRODUCT_COUNT_ASC",
|
|
225
226
|
PRODUCT_COUNT_DESC = "PRODUCT_COUNT_DESC"
|
|
226
227
|
}
|
|
@@ -262,6 +263,7 @@ export declare enum SortByDirectionEnum {
|
|
|
262
263
|
export declare enum SortByTypeEnum {
|
|
263
264
|
CREATED_AT = "CREATED_AT",
|
|
264
265
|
DISCOUNT_RATIO = "DISCOUNT_RATIO",
|
|
266
|
+
MANUAL_SORT = "MANUAL_SORT",
|
|
265
267
|
NAME = "NAME",
|
|
266
268
|
PRICE = "PRICE"
|
|
267
269
|
}
|
|
@@ -9,7 +9,7 @@ export declare class IkasCustomerAPI {
|
|
|
9
9
|
token: string;
|
|
10
10
|
tokenExpiry: number;
|
|
11
11
|
} | undefined>;
|
|
12
|
-
static register(email: string, password: string, firstName: string, lastName: string): Promise<{
|
|
12
|
+
static register(email: string, password: string, firstName: string, lastName: string, isAcceptMarketing?: boolean): Promise<{
|
|
13
13
|
customer: IkasCustomer;
|
|
14
14
|
__typename: "CustomerLoginResponse";
|
|
15
15
|
token: string;
|
package/build/index.es.js
CHANGED
|
@@ -23548,11 +23548,11 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
23548
23548
|
}
|
|
23549
23549
|
});
|
|
23550
23550
|
}); };
|
|
23551
|
-
this.register = function (firstName, lastName, email, password) { return __awaiter(_this, void 0, void 0, function () {
|
|
23551
|
+
this.register = function (firstName, lastName, email, password, isMarketingAccepted) { return __awaiter(_this, void 0, void 0, function () {
|
|
23552
23552
|
var response;
|
|
23553
23553
|
return __generator(this, function (_a) {
|
|
23554
23554
|
switch (_a.label) {
|
|
23555
|
-
case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName)];
|
|
23555
|
+
case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName, isMarketingAccepted)];
|
|
23556
23556
|
case 1:
|
|
23557
23557
|
response = _a.sent();
|
|
23558
23558
|
if (response) {
|
|
@@ -27626,6 +27626,7 @@ var ProductFilterSortTypeEnum;
|
|
|
27626
27626
|
(function (ProductFilterSortTypeEnum) {
|
|
27627
27627
|
ProductFilterSortTypeEnum["ALPHABETICAL_ASC"] = "ALPHABETICAL_ASC";
|
|
27628
27628
|
ProductFilterSortTypeEnum["ALPHABETICAL_DESC"] = "ALPHABETICAL_DESC";
|
|
27629
|
+
ProductFilterSortTypeEnum["CUSTOM_SORT"] = "CUSTOM_SORT";
|
|
27629
27630
|
ProductFilterSortTypeEnum["PRODUCT_COUNT_ASC"] = "PRODUCT_COUNT_ASC";
|
|
27630
27631
|
ProductFilterSortTypeEnum["PRODUCT_COUNT_DESC"] = "PRODUCT_COUNT_DESC";
|
|
27631
27632
|
})(ProductFilterSortTypeEnum || (ProductFilterSortTypeEnum = {}));
|
|
@@ -27672,6 +27673,7 @@ var SortByTypeEnum;
|
|
|
27672
27673
|
(function (SortByTypeEnum) {
|
|
27673
27674
|
SortByTypeEnum["CREATED_AT"] = "CREATED_AT";
|
|
27674
27675
|
SortByTypeEnum["DISCOUNT_RATIO"] = "DISCOUNT_RATIO";
|
|
27676
|
+
SortByTypeEnum["MANUAL_SORT"] = "MANUAL_SORT";
|
|
27675
27677
|
SortByTypeEnum["NAME"] = "NAME";
|
|
27676
27678
|
SortByTypeEnum["PRICE"] = "PRICE";
|
|
27677
27679
|
})(SortByTypeEnum || (SortByTypeEnum = {}));
|
|
@@ -29674,6 +29676,7 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29674
29676
|
lastName: "",
|
|
29675
29677
|
email: "",
|
|
29676
29678
|
password: "",
|
|
29679
|
+
isMarketingAccepted: false,
|
|
29677
29680
|
};
|
|
29678
29681
|
this.onFirstNameChange = function (value) {
|
|
29679
29682
|
_this.firstName = value;
|
|
@@ -29773,6 +29776,16 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29773
29776
|
enumerable: false,
|
|
29774
29777
|
configurable: true
|
|
29775
29778
|
});
|
|
29779
|
+
Object.defineProperty(RegisterForm.prototype, "isMarketingAccepted", {
|
|
29780
|
+
get: function () {
|
|
29781
|
+
return this.model.isMarketingAccepted;
|
|
29782
|
+
},
|
|
29783
|
+
set: function (value) {
|
|
29784
|
+
this.model.isMarketingAccepted = value;
|
|
29785
|
+
},
|
|
29786
|
+
enumerable: false,
|
|
29787
|
+
configurable: true
|
|
29788
|
+
});
|
|
29776
29789
|
Object.defineProperty(RegisterForm.prototype, "hasError", {
|
|
29777
29790
|
get: function () {
|
|
29778
29791
|
return this.validator.hasError;
|
|
@@ -29838,7 +29851,7 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29838
29851
|
_b.label = 2;
|
|
29839
29852
|
case 2:
|
|
29840
29853
|
_b.trys.push([2, 4, , 5]);
|
|
29841
|
-
return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password)];
|
|
29854
|
+
return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password, this.model.isMarketingAccepted)];
|
|
29842
29855
|
case 3:
|
|
29843
29856
|
isRegisterSuccess = _b.sent();
|
|
29844
29857
|
if (isRegisterSuccess) {
|
|
@@ -34353,13 +34366,13 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
34353
34366
|
});
|
|
34354
34367
|
});
|
|
34355
34368
|
};
|
|
34356
|
-
IkasCustomerAPI.register = function (email, password, firstName, lastName) {
|
|
34369
|
+
IkasCustomerAPI.register = function (email, password, firstName, lastName, isAcceptMarketing) {
|
|
34357
34370
|
return __awaiter(this, void 0, void 0, function () {
|
|
34358
34371
|
var MUTATION, _a, data, errors, err_2;
|
|
34359
34372
|
return __generator(this, function (_b) {
|
|
34360
34373
|
switch (_b.label) {
|
|
34361
34374
|
case 0:
|
|
34362
|
-
MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
|
|
34375
|
+
MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
|
|
34363
34376
|
_b.label = 1;
|
|
34364
34377
|
case 1:
|
|
34365
34378
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -34372,6 +34385,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
34372
34385
|
password: password,
|
|
34373
34386
|
firstName: firstName,
|
|
34374
34387
|
lastName: lastName,
|
|
34388
|
+
isAcceptMarketing: isAcceptMarketing,
|
|
34375
34389
|
},
|
|
34376
34390
|
})];
|
|
34377
34391
|
case 2:
|
|
@@ -36759,7 +36773,7 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
36759
36773
|
return [2 /*return*/];
|
|
36760
36774
|
_c.label = 1;
|
|
36761
36775
|
case 1:
|
|
36762
|
-
_c.trys.push([1,
|
|
36776
|
+
_c.trys.push([1, 6, 7, 8]);
|
|
36763
36777
|
this._isLoadingCart = true;
|
|
36764
36778
|
customerId = (_a = this.baseStore.customerStore.customer) === null || _a === void 0 ? void 0 : _a.id;
|
|
36765
36779
|
cartId = ((_b = this.cart) === null || _b === void 0 ? void 0 : _b.id) || localStorage.getItem(CART_LS_KEY);
|
|
@@ -36774,17 +36788,20 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
36774
36788
|
return [4 /*yield*/, this.setCart(cart)];
|
|
36775
36789
|
case 3:
|
|
36776
36790
|
_c.sent();
|
|
36777
|
-
|
|
36778
|
-
case 4:
|
|
36779
|
-
|
|
36791
|
+
return [3 /*break*/, 5];
|
|
36792
|
+
case 4:
|
|
36793
|
+
this.removeCart();
|
|
36794
|
+
_c.label = 5;
|
|
36795
|
+
case 5: return [3 /*break*/, 8];
|
|
36796
|
+
case 6:
|
|
36780
36797
|
err_1 = _c.sent();
|
|
36781
36798
|
console.log(err_1);
|
|
36782
|
-
return [3 /*break*/,
|
|
36783
|
-
case
|
|
36799
|
+
return [3 /*break*/, 8];
|
|
36800
|
+
case 7:
|
|
36784
36801
|
this._isLoadingCart = false;
|
|
36785
36802
|
this._cartLoadFinished = true;
|
|
36786
36803
|
return [7 /*endfinally*/];
|
|
36787
|
-
case
|
|
36804
|
+
case 8: return [2 /*return*/];
|
|
36788
36805
|
}
|
|
36789
36806
|
});
|
|
36790
36807
|
}); };
|
|
@@ -37903,7 +37920,7 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37903
37920
|
id: storefront.salesChannelId,
|
|
37904
37921
|
}),
|
|
37905
37922
|
routing: storefront.routings.length
|
|
37906
|
-
? storefront.routings.find(function (r) { return r.locale === locale; }) || //storefront.routings.find((r) => !r.path && !r.domain) ||
|
|
37923
|
+
? storefront.routings.find(function (r) { return r.locale === locale || r.id === locale; }) || //storefront.routings.find((r) => !r.path && !r.domain) ||
|
|
37907
37924
|
storefront.routings[0]
|
|
37908
37925
|
: new IkasStorefrontRouting({}),
|
|
37909
37926
|
favicon: localTheme.settings.favicon,
|
|
@@ -37954,7 +37971,7 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37954
37971
|
SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes) {
|
|
37955
37972
|
var _a;
|
|
37956
37973
|
return __awaiter(this, void 0, void 0, function () {
|
|
37957
|
-
var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds, components, componentDirs, _b, _c;
|
|
37974
|
+
var isLocal, locale, serverRuntimeConfig, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds, components, componentDirs, nextI18nConf, _b, _c;
|
|
37958
37975
|
var _d, _e;
|
|
37959
37976
|
return __generator(this, function (_f) {
|
|
37960
37977
|
switch (_f.label) {
|
|
@@ -37967,6 +37984,7 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37967
37984
|
notFound: true,
|
|
37968
37985
|
}];
|
|
37969
37986
|
}
|
|
37987
|
+
serverRuntimeConfig = getConfig().serverRuntimeConfig;
|
|
37970
37988
|
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
37971
37989
|
case 1:
|
|
37972
37990
|
settings = _f.sent();
|
|
@@ -38007,16 +38025,31 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
38007
38025
|
return componentIds.includes(c.id);
|
|
38008
38026
|
});
|
|
38009
38027
|
componentDirs = __spreadArrays(["common"], components.map(function (c) { return c.dir; }));
|
|
38028
|
+
nextI18nConf = serverRuntimeConfig.nextI18nConf;
|
|
38010
38029
|
if (!isServer) return [3 /*break*/, 4];
|
|
38011
38030
|
_d = {};
|
|
38012
38031
|
_b = [{}];
|
|
38013
|
-
return [4 /*yield*/, serverSideTranslations(locale, componentDirs
|
|
38032
|
+
return [4 /*yield*/, serverSideTranslations(locale, componentDirs, {
|
|
38033
|
+
i18n: {
|
|
38034
|
+
locales: nextI18nConf.i18n.locales,
|
|
38035
|
+
defaultLocale: nextI18nConf.i18n.defaultLocale,
|
|
38036
|
+
},
|
|
38037
|
+
serializeConfig: false,
|
|
38038
|
+
localePath: nextI18nConf.localePath,
|
|
38039
|
+
})];
|
|
38014
38040
|
case 3: return [2 /*return*/, (_d.props = __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_f.sent())])), provider.nextPageData.props]),
|
|
38015
38041
|
_d)];
|
|
38016
38042
|
case 4:
|
|
38017
38043
|
_e = {};
|
|
38018
38044
|
_c = [{}];
|
|
38019
|
-
return [4 /*yield*/, serverSideTranslations(locale, componentDirs
|
|
38045
|
+
return [4 /*yield*/, serverSideTranslations(locale, componentDirs, {
|
|
38046
|
+
i18n: {
|
|
38047
|
+
locales: nextI18nConf.i18n.locales,
|
|
38048
|
+
defaultLocale: nextI18nConf.i18n.defaultLocale,
|
|
38049
|
+
},
|
|
38050
|
+
serializeConfig: false,
|
|
38051
|
+
localePath: nextI18nConf.localePath,
|
|
38052
|
+
})];
|
|
38020
38053
|
case 5: return [2 /*return*/, (_e.props = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), provider.nextPageData.props]),
|
|
38021
38054
|
_e.revalidate = 60,
|
|
38022
38055
|
_e)];
|
package/build/index.js
CHANGED
|
@@ -23554,11 +23554,11 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
23554
23554
|
}
|
|
23555
23555
|
});
|
|
23556
23556
|
}); };
|
|
23557
|
-
this.register = function (firstName, lastName, email, password) { return __awaiter(_this, void 0, void 0, function () {
|
|
23557
|
+
this.register = function (firstName, lastName, email, password, isMarketingAccepted) { return __awaiter(_this, void 0, void 0, function () {
|
|
23558
23558
|
var response;
|
|
23559
23559
|
return __generator(this, function (_a) {
|
|
23560
23560
|
switch (_a.label) {
|
|
23561
|
-
case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName)];
|
|
23561
|
+
case 0: return [4 /*yield*/, IkasCustomerAPI.register(email, password, firstName, lastName, isMarketingAccepted)];
|
|
23562
23562
|
case 1:
|
|
23563
23563
|
response = _a.sent();
|
|
23564
23564
|
if (response) {
|
|
@@ -27607,6 +27607,7 @@ var ProductFilterSortTypeEnum;
|
|
|
27607
27607
|
(function (ProductFilterSortTypeEnum) {
|
|
27608
27608
|
ProductFilterSortTypeEnum["ALPHABETICAL_ASC"] = "ALPHABETICAL_ASC";
|
|
27609
27609
|
ProductFilterSortTypeEnum["ALPHABETICAL_DESC"] = "ALPHABETICAL_DESC";
|
|
27610
|
+
ProductFilterSortTypeEnum["CUSTOM_SORT"] = "CUSTOM_SORT";
|
|
27610
27611
|
ProductFilterSortTypeEnum["PRODUCT_COUNT_ASC"] = "PRODUCT_COUNT_ASC";
|
|
27611
27612
|
ProductFilterSortTypeEnum["PRODUCT_COUNT_DESC"] = "PRODUCT_COUNT_DESC";
|
|
27612
27613
|
})(ProductFilterSortTypeEnum || (ProductFilterSortTypeEnum = {}));
|
|
@@ -27653,6 +27654,7 @@ var SortByTypeEnum;
|
|
|
27653
27654
|
(function (SortByTypeEnum) {
|
|
27654
27655
|
SortByTypeEnum["CREATED_AT"] = "CREATED_AT";
|
|
27655
27656
|
SortByTypeEnum["DISCOUNT_RATIO"] = "DISCOUNT_RATIO";
|
|
27657
|
+
SortByTypeEnum["MANUAL_SORT"] = "MANUAL_SORT";
|
|
27656
27658
|
SortByTypeEnum["NAME"] = "NAME";
|
|
27657
27659
|
SortByTypeEnum["PRICE"] = "PRICE";
|
|
27658
27660
|
})(SortByTypeEnum || (SortByTypeEnum = {}));
|
|
@@ -29652,6 +29654,7 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29652
29654
|
lastName: "",
|
|
29653
29655
|
email: "",
|
|
29654
29656
|
password: "",
|
|
29657
|
+
isMarketingAccepted: false,
|
|
29655
29658
|
};
|
|
29656
29659
|
this.onFirstNameChange = function (value) {
|
|
29657
29660
|
_this.firstName = value;
|
|
@@ -29751,6 +29754,16 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29751
29754
|
enumerable: false,
|
|
29752
29755
|
configurable: true
|
|
29753
29756
|
});
|
|
29757
|
+
Object.defineProperty(RegisterForm.prototype, "isMarketingAccepted", {
|
|
29758
|
+
get: function () {
|
|
29759
|
+
return this.model.isMarketingAccepted;
|
|
29760
|
+
},
|
|
29761
|
+
set: function (value) {
|
|
29762
|
+
this.model.isMarketingAccepted = value;
|
|
29763
|
+
},
|
|
29764
|
+
enumerable: false,
|
|
29765
|
+
configurable: true
|
|
29766
|
+
});
|
|
29754
29767
|
Object.defineProperty(RegisterForm.prototype, "hasError", {
|
|
29755
29768
|
get: function () {
|
|
29756
29769
|
return this.validator.hasError;
|
|
@@ -29816,7 +29829,7 @@ var RegisterForm = /** @class */ (function () {
|
|
|
29816
29829
|
_b.label = 2;
|
|
29817
29830
|
case 2:
|
|
29818
29831
|
_b.trys.push([2, 4, , 5]);
|
|
29819
|
-
return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password)];
|
|
29832
|
+
return [4 /*yield*/, this.store.customerStore.register(this.model.firstName, this.model.lastName, this.model.email, this.model.password, this.model.isMarketingAccepted)];
|
|
29820
29833
|
case 3:
|
|
29821
29834
|
isRegisterSuccess = _b.sent();
|
|
29822
29835
|
if (isRegisterSuccess) {
|
|
@@ -34330,13 +34343,13 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
34330
34343
|
});
|
|
34331
34344
|
});
|
|
34332
34345
|
};
|
|
34333
|
-
IkasCustomerAPI.register = function (email, password, firstName, lastName) {
|
|
34346
|
+
IkasCustomerAPI.register = function (email, password, firstName, lastName, isAcceptMarketing) {
|
|
34334
34347
|
return __awaiter(this, void 0, void 0, function () {
|
|
34335
34348
|
var MUTATION, _a, data, errors, err_2;
|
|
34336
34349
|
return __generator(this, function (_b) {
|
|
34337
34350
|
switch (_b.label) {
|
|
34338
34351
|
case 0:
|
|
34339
|
-
MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
|
|
34352
|
+
MUTATION = src(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "], ["\n mutation registerCustomer(\n $email: String!\n $password: String!\n $firstName: String!\n $lastName: String!\n $isAcceptMarketing: Boolean\n ) {\n registerCustomer(\n email: $email\n password: $password\n firstName: $firstName\n lastName: $lastName\n isAcceptMarketing: $isAcceptMarketing\n ) {\n token\n tokenExpiry\n customer {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n }\n "])));
|
|
34340
34353
|
_b.label = 1;
|
|
34341
34354
|
case 1:
|
|
34342
34355
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -34349,6 +34362,7 @@ var IkasCustomerAPI = /** @class */ (function () {
|
|
|
34349
34362
|
password: password,
|
|
34350
34363
|
firstName: firstName,
|
|
34351
34364
|
lastName: lastName,
|
|
34365
|
+
isAcceptMarketing: isAcceptMarketing,
|
|
34352
34366
|
},
|
|
34353
34367
|
})];
|
|
34354
34368
|
case 2:
|
|
@@ -36736,7 +36750,7 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
36736
36750
|
return [2 /*return*/];
|
|
36737
36751
|
_c.label = 1;
|
|
36738
36752
|
case 1:
|
|
36739
|
-
_c.trys.push([1,
|
|
36753
|
+
_c.trys.push([1, 6, 7, 8]);
|
|
36740
36754
|
this._isLoadingCart = true;
|
|
36741
36755
|
customerId = (_a = this.baseStore.customerStore.customer) === null || _a === void 0 ? void 0 : _a.id;
|
|
36742
36756
|
cartId = ((_b = this.cart) === null || _b === void 0 ? void 0 : _b.id) || localStorage.getItem(CART_LS_KEY);
|
|
@@ -36751,17 +36765,20 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
36751
36765
|
return [4 /*yield*/, this.setCart(cart)];
|
|
36752
36766
|
case 3:
|
|
36753
36767
|
_c.sent();
|
|
36754
|
-
|
|
36755
|
-
case 4:
|
|
36756
|
-
|
|
36768
|
+
return [3 /*break*/, 5];
|
|
36769
|
+
case 4:
|
|
36770
|
+
this.removeCart();
|
|
36771
|
+
_c.label = 5;
|
|
36772
|
+
case 5: return [3 /*break*/, 8];
|
|
36773
|
+
case 6:
|
|
36757
36774
|
err_1 = _c.sent();
|
|
36758
36775
|
console.log(err_1);
|
|
36759
|
-
return [3 /*break*/,
|
|
36760
|
-
case
|
|
36776
|
+
return [3 /*break*/, 8];
|
|
36777
|
+
case 7:
|
|
36761
36778
|
this._isLoadingCart = false;
|
|
36762
36779
|
this._cartLoadFinished = true;
|
|
36763
36780
|
return [7 /*endfinally*/];
|
|
36764
|
-
case
|
|
36781
|
+
case 8: return [2 /*return*/];
|
|
36765
36782
|
}
|
|
36766
36783
|
});
|
|
36767
36784
|
}); };
|
|
@@ -37880,7 +37897,7 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37880
37897
|
id: storefront.salesChannelId,
|
|
37881
37898
|
}),
|
|
37882
37899
|
routing: storefront.routings.length
|
|
37883
|
-
? storefront.routings.find(function (r) { return r.locale === locale; }) || //storefront.routings.find((r) => !r.path && !r.domain) ||
|
|
37900
|
+
? storefront.routings.find(function (r) { return r.locale === locale || r.id === locale; }) || //storefront.routings.find((r) => !r.path && !r.domain) ||
|
|
37884
37901
|
storefront.routings[0]
|
|
37885
37902
|
: new IkasStorefrontRouting({}),
|
|
37886
37903
|
favicon: localTheme.settings.favicon,
|
|
@@ -37931,7 +37948,7 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37931
37948
|
SettingsHelper.getPageData = function (context, isServer, pageType, possiblePageTypes) {
|
|
37932
37949
|
var _a;
|
|
37933
37950
|
return __awaiter(this, void 0, void 0, function () {
|
|
37934
|
-
var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds, components, componentDirs, _b, _c;
|
|
37951
|
+
var isLocal, locale, serverRuntimeConfig, settings, storefront, themeLocalization, salesChannel, routing, favicon, stockPreference, provider, componentIds, components, componentDirs, nextI18nConf, _b, _c;
|
|
37935
37952
|
var _d, _e;
|
|
37936
37953
|
return __generator(this, function (_f) {
|
|
37937
37954
|
switch (_f.label) {
|
|
@@ -37944,6 +37961,7 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37944
37961
|
notFound: true,
|
|
37945
37962
|
}];
|
|
37946
37963
|
}
|
|
37964
|
+
serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
|
|
37947
37965
|
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
37948
37966
|
case 1:
|
|
37949
37967
|
settings = _f.sent();
|
|
@@ -37984,16 +38002,31 @@ var SettingsHelper = /** @class */ (function () {
|
|
|
37984
38002
|
return componentIds.includes(c.id);
|
|
37985
38003
|
});
|
|
37986
38004
|
componentDirs = __spreadArrays(["common"], components.map(function (c) { return c.dir; }));
|
|
38005
|
+
nextI18nConf = serverRuntimeConfig.nextI18nConf;
|
|
37987
38006
|
if (!isServer) return [3 /*break*/, 4];
|
|
37988
38007
|
_d = {};
|
|
37989
38008
|
_b = [{}];
|
|
37990
|
-
return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs
|
|
38009
|
+
return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs, {
|
|
38010
|
+
i18n: {
|
|
38011
|
+
locales: nextI18nConf.i18n.locales,
|
|
38012
|
+
defaultLocale: nextI18nConf.i18n.defaultLocale,
|
|
38013
|
+
},
|
|
38014
|
+
serializeConfig: false,
|
|
38015
|
+
localePath: nextI18nConf.localePath,
|
|
38016
|
+
})];
|
|
37991
38017
|
case 3: return [2 /*return*/, (_d.props = __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_f.sent())])), provider.nextPageData.props]),
|
|
37992
38018
|
_d)];
|
|
37993
38019
|
case 4:
|
|
37994
38020
|
_e = {};
|
|
37995
38021
|
_c = [{}];
|
|
37996
|
-
return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs
|
|
38022
|
+
return [4 /*yield*/, serverSideTranslations.serverSideTranslations(locale, componentDirs, {
|
|
38023
|
+
i18n: {
|
|
38024
|
+
locales: nextI18nConf.i18n.locales,
|
|
38025
|
+
defaultLocale: nextI18nConf.i18n.defaultLocale,
|
|
38026
|
+
},
|
|
38027
|
+
serializeConfig: false,
|
|
38028
|
+
localePath: nextI18nConf.localePath,
|
|
38029
|
+
})];
|
|
37997
38030
|
case 5: return [2 /*return*/, (_e.props = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_f.sent())])), provider.nextPageData.props]),
|
|
37998
38031
|
_e.revalidate = 60,
|
|
37999
38032
|
_e)];
|
|
@@ -12,6 +12,7 @@ declare type RegisterFormModel = {
|
|
|
12
12
|
lastName: string;
|
|
13
13
|
email: string;
|
|
14
14
|
password: string;
|
|
15
|
+
isMarketingAccepted?: boolean;
|
|
15
16
|
};
|
|
16
17
|
export declare class RegisterForm {
|
|
17
18
|
private model;
|
|
@@ -26,6 +27,8 @@ export declare class RegisterForm {
|
|
|
26
27
|
set email(value: string);
|
|
27
28
|
get password(): string;
|
|
28
29
|
set password(value: string);
|
|
30
|
+
get isMarketingAccepted(): boolean | undefined;
|
|
31
|
+
set isMarketingAccepted(value: boolean | undefined);
|
|
29
32
|
get hasError(): boolean;
|
|
30
33
|
get firstNameErrorMessage(): string | undefined;
|
|
31
34
|
get lastNameErrorMessage(): string | undefined;
|
|
@@ -15,7 +15,7 @@ export declare class IkasCustomerStore {
|
|
|
15
15
|
get canCreateEmailSubscription(): boolean;
|
|
16
16
|
get customerConsentGranted(): boolean;
|
|
17
17
|
login: (email: string, password: string) => Promise<boolean>;
|
|
18
|
-
register: (firstName: string, lastName: string, email: string, password: string) => Promise<boolean>;
|
|
18
|
+
register: (firstName: string, lastName: string, email: string, password: string, isMarketingAccepted?: boolean | undefined) => Promise<boolean>;
|
|
19
19
|
saveContactForm: (input: SaveContactForm) => Promise<boolean | undefined>;
|
|
20
20
|
checkEmail: (email: string) => Promise<boolean>;
|
|
21
21
|
forgotPassword: (email: string) => Promise<boolean>;
|