@ikas/storefront 0.0.123 → 0.0.125

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.
@@ -229,16 +229,20 @@ export declare enum SortByTypeEnum {
229
229
  PRICE = "PRICE"
230
230
  }
231
231
  /**
232
- * StorefrontStatusTypes
232
+ * StorefrontStatusEnum
233
233
  */
234
234
  export declare enum StorefrontStatusTypes {
235
+ FAILED = "FAILED",
236
+ NOT_DEPLOYED = "NOT_DEPLOYED",
235
237
  READY = "READY",
236
238
  WAITING = "WAITING"
237
239
  }
238
240
  /**
239
- * StorefrontThemeStatus
241
+ * StorefrontThemeStatusEnum
240
242
  */
241
243
  export declare enum StorefrontThemeStatus {
244
+ FAILED = "FAILED",
245
+ NOT_DEPLOYED = "NOT_DEPLOYED",
242
246
  READY = "READY",
243
247
  WAITING = "WAITING"
244
248
  }
@@ -350,6 +354,10 @@ export interface CustomerAddressStateInput {
350
354
  id?: string | null;
351
355
  name?: string | null;
352
356
  }
357
+ export interface HTMLMetaDataTargetTypeEnumFilter {
358
+ eq?: HTMLMetaDataTargetTypeEnum | null;
359
+ in?: HTMLMetaDataTargetTypeEnum[] | null;
360
+ }
353
361
  export interface OrderAddressCityInput {
354
362
  code?: string | null;
355
363
  id?: string | null;
@@ -431,6 +439,7 @@ export interface SaveCheckoutInput {
431
439
  customer?: CheckoutCustomerInput | null;
432
440
  deleted?: boolean | null;
433
441
  id?: string | null;
442
+ note?: string | null;
434
443
  shippingAddress?: OrderAddressInput | null;
435
444
  shippingMethod: ShippingMethodEnum;
436
445
  shippingSettingsId?: string | null;
@@ -27,6 +27,7 @@ export interface customerLogin_customerLogin_customer_addresses {
27
27
  __typename: "CustomerAddress";
28
28
  addressLine1: string;
29
29
  addressLine2: string | null;
30
+ identityNumber: string | null;
30
31
  city: customerLogin_customerLogin_customer_addresses_city;
31
32
  company: string | null;
32
33
  country: customerLogin_customerLogin_customer_addresses_country;
@@ -1,4 +1,4 @@
1
- import { StringFilterInput, HTMLMetaDataTargetTypeEnum } from "../../../__generated__/global-types";
1
+ import { StringFilterInput, HTMLMetaDataTargetTypeEnumFilter, HTMLMetaDataTargetTypeEnum } from "../../../__generated__/global-types";
2
2
  export interface listHTMLMetaData_listHTMLMetaData {
3
3
  __typename: "HTMLMetaData";
4
4
  slug: string;
@@ -14,4 +14,5 @@ export interface listHTMLMetaData {
14
14
  export interface listHTMLMetaDataVariables {
15
15
  slug?: StringFilterInput | null;
16
16
  targetId?: StringFilterInput | null;
17
+ targetType?: HTMLMetaDataTargetTypeEnumFilter | null;
17
18
  }
@@ -1,4 +1,4 @@
1
1
  import { IkasHTMLMetaData } from "../../models/index";
2
2
  export declare class IkasHTMLMetaDataAPI {
3
- static listHTMLMetaData(slug?: string, targetId?: string): Promise<IkasHTMLMetaData[]>;
3
+ static listHTMLMetaData(slug?: string, targetId?: string, targetType?: string[]): Promise<IkasHTMLMetaData[]>;
4
4
  }
package/build/index.es.js CHANGED
@@ -11896,6 +11896,9 @@ var ThemeComponent = observer(function (_a) {
11896
11896
  });
11897
11897
  });
11898
11898
  var Component = components[pageComponent.componentId];
11899
+ if (!Component) {
11900
+ console.error("COMPONENT NOT FOUND!", pageComponent.id, pageComponent.componentId, components ? Object.keys(components) : []);
11901
+ }
11899
11902
  return (createElement("div", { id: index + "" }, hasNullValue.get() ? null : (createElement(Component, __assign({ key: pageComponent.id }, propValues, { settings: settings, store: store })))));
11900
11903
  });
11901
11904
 
@@ -20811,12 +20814,19 @@ var IkasBrandList = /** @class */ (function () {
20811
20814
  })];
20812
20815
  case 2:
20813
20816
  response_1 = _a.sent();
20814
- runInAction(function () {
20815
- _this.data = response_1.brands;
20816
- _this._count = response_1.count;
20817
- _this._initialized = true;
20818
- _this._minPage = _this.page;
20819
- });
20817
+ if (this.isStatic) {
20818
+ this.data = this._brandListPropValue
20819
+ .brandIds.map(function (bID) {
20820
+ return response_1.brands.find(function (b) { return b.id === bID; });
20821
+ })
20822
+ .filter(function (b) { return !!b; });
20823
+ }
20824
+ else {
20825
+ this.data = response_1.brands;
20826
+ }
20827
+ this._count = response_1.count;
20828
+ this._initialized = true;
20829
+ this._minPage = this.page;
20820
20830
  return [3 /*break*/, 5];
20821
20831
  case 3:
20822
20832
  err_1 = _a.sent();
@@ -21098,12 +21108,19 @@ var IkasCategoryList = /** @class */ (function () {
21098
21108
  })];
21099
21109
  case 2:
21100
21110
  response_1 = _a.sent();
21101
- runInAction(function () {
21102
- _this.data = response_1.categories;
21103
- _this._count = response_1.count;
21104
- _this._initialized = true;
21105
- _this._minPage = _this.page;
21106
- });
21111
+ if (this.isStatic) {
21112
+ this.data = this._categoryListPropValue
21113
+ .categoryIds.map(function (cID) {
21114
+ return response_1.categories.find(function (c) { return c.id === cID; });
21115
+ })
21116
+ .filter(function (c) { return !!c; });
21117
+ }
21118
+ else {
21119
+ this.data = response_1.categories;
21120
+ }
21121
+ this._count = response_1.count;
21122
+ this._initialized = true;
21123
+ this._minPage = this.page;
21107
21124
  return [3 /*break*/, 5];
21108
21125
  case 3:
21109
21126
  err_1 = _a.sent();
@@ -24778,8 +24795,8 @@ var IkasCategoryListPropValue = /** @class */ (function () {
24778
24795
  this.categoryListType = data.categoryListType || IkasCategoryListType.ALL;
24779
24796
  this.initialSort = data.initialSort || IkasCategoryListSortType.A_Z;
24780
24797
  this.initialLimit = data.initialLimit || 20;
24781
- this.categoryCount = data.categoryCount;
24782
- this.categoryIds = data.categoryIds;
24798
+ this.categoryCount = data.categoryCount || null;
24799
+ this.categoryIds = data.categoryIds || null;
24783
24800
  makeAutoObservable(this);
24784
24801
  }
24785
24802
  return IkasCategoryListPropValue;
@@ -26073,13 +26090,13 @@ var templateObject_1$7;
26073
26090
  var IkasHTMLMetaDataAPI = /** @class */ (function () {
26074
26091
  function IkasHTMLMetaDataAPI() {
26075
26092
  }
26076
- IkasHTMLMetaDataAPI.listHTMLMetaData = function (slug, targetId) {
26093
+ IkasHTMLMetaDataAPI.listHTMLMetaData = function (slug, targetId, targetType) {
26077
26094
  return __awaiter(this, void 0, void 0, function () {
26078
26095
  var LIST_QUERY, _a, data, errors, err_1;
26079
26096
  return __generator(this, function (_b) {
26080
26097
  switch (_b.label) {
26081
26098
  case 0:
26082
- LIST_QUERY = src(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n ) {\n listHTMLMetaData(slug: $slug, targetId: $targetId) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "], ["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n ) {\n listHTMLMetaData(slug: $slug, targetId: $targetId) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "])));
26099
+ LIST_QUERY = src(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "], ["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "])));
26083
26100
  _b.label = 1;
26084
26101
  case 1:
26085
26102
  _b.trys.push([1, 3, , 4]);
@@ -26098,6 +26115,11 @@ var IkasHTMLMetaDataAPI = /** @class */ (function () {
26098
26115
  eq: targetId,
26099
26116
  }
26100
26117
  : undefined,
26118
+ targetType: targetType
26119
+ ? {
26120
+ in: targetType,
26121
+ }
26122
+ : undefined,
26101
26123
  },
26102
26124
  })];
26103
26125
  case 2:
@@ -29090,62 +29112,24 @@ var Page$1 = function (_a) {
29090
29112
  };
29091
29113
  var index$1 = observer(Page$1);
29092
29114
  var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void 0, function () {
29093
- var metaData, targetTypes, brandCategoryMetaData, productMetaData, productsResponse, productParams, _loop_1, _i, _a, product;
29094
- return __generator(this, function (_b) {
29095
- switch (_b.label) {
29096
- case 0: return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData()];
29097
- case 1:
29098
- metaData = _b.sent();
29115
+ var targetTypes, metaData;
29116
+ return __generator(this, function (_a) {
29117
+ switch (_a.label) {
29118
+ case 0:
29099
29119
  targetTypes = [
29100
29120
  IkasHTMLMetaDataTargetType.BRAND,
29101
29121
  IkasHTMLMetaDataTargetType.CATEGORY,
29102
29122
  ];
29103
- brandCategoryMetaData = metaData.filter(function (m) { return m.targetType && targetTypes.includes(m.targetType); });
29104
- productMetaData = metaData.filter(function (m) { return m.targetType && m.targetType === IkasHTMLMetaDataTargetType.PRODUCT; });
29105
- return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
29106
- productIdList: productMetaData.map(function (p) { return p.targetId; }),
29107
- priceListId: IkasStorefrontConfig.priceListId,
29108
- salesChannelId: IkasStorefrontConfig.salesChannelId,
29109
- })];
29110
- case 2:
29111
- productsResponse = _b.sent();
29112
- productParams = [];
29113
- _loop_1 = function (product) {
29114
- var meta = productMetaData.find(function (pm) { return pm.targetId === product.id; });
29115
- if (meta) {
29116
- for (var _i = 0, _a = product.variants; _i < _a.length; _i++) {
29117
- var variant = _a[_i];
29118
- if (product.hasVariant) {
29119
- var variantSlug = variant.variantValues
29120
- .map(function (vv) { return vv.slug; })
29121
- .join("-");
29122
- productParams.push({
29123
- slug: meta.slug + "-" + variantSlug,
29124
- });
29125
- }
29126
- else {
29127
- productParams.push({
29128
- slug: meta.slug,
29129
- });
29130
- }
29131
- }
29132
- }
29133
- };
29134
- for (_i = 0, _a = (productsResponse === null || productsResponse === void 0 ? void 0 : productsResponse.data) || []; _i < _a.length; _i++) {
29135
- product = _a[_i];
29136
- _loop_1(product);
29137
- }
29123
+ return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(undefined, undefined, targetTypes)];
29124
+ case 1:
29125
+ metaData = _a.sent();
29138
29126
  return [2 /*return*/, {
29139
- paths: brandCategoryMetaData
29140
- .map(function (m) { return ({
29127
+ paths: metaData.map(function (m) { return ({
29141
29128
  params: {
29142
29129
  slug: m.slug,
29143
29130
  originalSlug: m.slug,
29144
29131
  },
29145
- }); })
29146
- .concat(productParams.map(function (pp) { return ({
29147
- params: pp,
29148
- }); })),
29132
+ }); }),
29149
29133
  fallback: "blocking",
29150
29134
  }];
29151
29135
  }
package/build/index.js CHANGED
@@ -11911,6 +11911,9 @@ var ThemeComponent = mobxReactLite.observer(function (_a) {
11911
11911
  });
11912
11912
  });
11913
11913
  var Component = components[pageComponent.componentId];
11914
+ if (!Component) {
11915
+ console.error("COMPONENT NOT FOUND!", pageComponent.id, pageComponent.componentId, components ? Object.keys(components) : []);
11916
+ }
11914
11917
  return (React.createElement("div", { id: index + "" }, hasNullValue.get() ? null : (React.createElement(Component, __assign({ key: pageComponent.id }, propValues, { settings: settings, store: store })))));
11915
11918
  });
11916
11919
 
@@ -20798,12 +20801,19 @@ var IkasBrandList = /** @class */ (function () {
20798
20801
  })];
20799
20802
  case 2:
20800
20803
  response_1 = _a.sent();
20801
- mobx.runInAction(function () {
20802
- _this.data = response_1.brands;
20803
- _this._count = response_1.count;
20804
- _this._initialized = true;
20805
- _this._minPage = _this.page;
20806
- });
20804
+ if (this.isStatic) {
20805
+ this.data = this._brandListPropValue
20806
+ .brandIds.map(function (bID) {
20807
+ return response_1.brands.find(function (b) { return b.id === bID; });
20808
+ })
20809
+ .filter(function (b) { return !!b; });
20810
+ }
20811
+ else {
20812
+ this.data = response_1.brands;
20813
+ }
20814
+ this._count = response_1.count;
20815
+ this._initialized = true;
20816
+ this._minPage = this.page;
20807
20817
  return [3 /*break*/, 5];
20808
20818
  case 3:
20809
20819
  err_1 = _a.sent();
@@ -21083,12 +21093,19 @@ var IkasCategoryList = /** @class */ (function () {
21083
21093
  })];
21084
21094
  case 2:
21085
21095
  response_1 = _a.sent();
21086
- mobx.runInAction(function () {
21087
- _this.data = response_1.categories;
21088
- _this._count = response_1.count;
21089
- _this._initialized = true;
21090
- _this._minPage = _this.page;
21091
- });
21096
+ if (this.isStatic) {
21097
+ this.data = this._categoryListPropValue
21098
+ .categoryIds.map(function (cID) {
21099
+ return response_1.categories.find(function (c) { return c.id === cID; });
21100
+ })
21101
+ .filter(function (c) { return !!c; });
21102
+ }
21103
+ else {
21104
+ this.data = response_1.categories;
21105
+ }
21106
+ this._count = response_1.count;
21107
+ this._initialized = true;
21108
+ this._minPage = this.page;
21092
21109
  return [3 /*break*/, 5];
21093
21110
  case 3:
21094
21111
  err_1 = _a.sent();
@@ -24758,8 +24775,8 @@ var IkasCategoryListPropValue = /** @class */ (function () {
24758
24775
  this.categoryListType = data.categoryListType || exports.IkasCategoryListType.ALL;
24759
24776
  this.initialSort = data.initialSort || exports.IkasCategoryListSortType.A_Z;
24760
24777
  this.initialLimit = data.initialLimit || 20;
24761
- this.categoryCount = data.categoryCount;
24762
- this.categoryIds = data.categoryIds;
24778
+ this.categoryCount = data.categoryCount || null;
24779
+ this.categoryIds = data.categoryIds || null;
24763
24780
  mobx.makeAutoObservable(this);
24764
24781
  }
24765
24782
  return IkasCategoryListPropValue;
@@ -26053,13 +26070,13 @@ var templateObject_1$7;
26053
26070
  var IkasHTMLMetaDataAPI = /** @class */ (function () {
26054
26071
  function IkasHTMLMetaDataAPI() {
26055
26072
  }
26056
- IkasHTMLMetaDataAPI.listHTMLMetaData = function (slug, targetId) {
26073
+ IkasHTMLMetaDataAPI.listHTMLMetaData = function (slug, targetId, targetType) {
26057
26074
  return __awaiter(this, void 0, void 0, function () {
26058
26075
  var LIST_QUERY, _a, data, errors, err_1;
26059
26076
  return __generator(this, function (_b) {
26060
26077
  switch (_b.label) {
26061
26078
  case 0:
26062
- LIST_QUERY = src(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n ) {\n listHTMLMetaData(slug: $slug, targetId: $targetId) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "], ["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n ) {\n listHTMLMetaData(slug: $slug, targetId: $targetId) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "])));
26079
+ LIST_QUERY = src(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "], ["\n query listHTMLMetaData(\n $slug: StringFilterInput\n $targetId: StringFilterInput\n $targetType: HTMLMetaDataTargetTypeEnumFilter\n ) {\n listHTMLMetaData(\n slug: $slug\n targetId: $targetId\n targetType: $targetType\n ) {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n "])));
26063
26080
  _b.label = 1;
26064
26081
  case 1:
26065
26082
  _b.trys.push([1, 3, , 4]);
@@ -26078,6 +26095,11 @@ var IkasHTMLMetaDataAPI = /** @class */ (function () {
26078
26095
  eq: targetId,
26079
26096
  }
26080
26097
  : undefined,
26098
+ targetType: targetType
26099
+ ? {
26100
+ in: targetType,
26101
+ }
26102
+ : undefined,
26081
26103
  },
26082
26104
  })];
26083
26105
  case 2:
@@ -29070,62 +29092,24 @@ var Page$1 = function (_a) {
29070
29092
  };
29071
29093
  var index$1 = mobxReactLite.observer(Page$1);
29072
29094
  var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void 0, function () {
29073
- var metaData, targetTypes, brandCategoryMetaData, productMetaData, productsResponse, productParams, _loop_1, _i, _a, product;
29074
- return __generator(this, function (_b) {
29075
- switch (_b.label) {
29076
- case 0: return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData()];
29077
- case 1:
29078
- metaData = _b.sent();
29095
+ var targetTypes, metaData;
29096
+ return __generator(this, function (_a) {
29097
+ switch (_a.label) {
29098
+ case 0:
29079
29099
  targetTypes = [
29080
29100
  exports.IkasHTMLMetaDataTargetType.BRAND,
29081
29101
  exports.IkasHTMLMetaDataTargetType.CATEGORY,
29082
29102
  ];
29083
- brandCategoryMetaData = metaData.filter(function (m) { return m.targetType && targetTypes.includes(m.targetType); });
29084
- productMetaData = metaData.filter(function (m) { return m.targetType && m.targetType === exports.IkasHTMLMetaDataTargetType.PRODUCT; });
29085
- return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
29086
- productIdList: productMetaData.map(function (p) { return p.targetId; }),
29087
- priceListId: IkasStorefrontConfig.priceListId,
29088
- salesChannelId: IkasStorefrontConfig.salesChannelId,
29089
- })];
29090
- case 2:
29091
- productsResponse = _b.sent();
29092
- productParams = [];
29093
- _loop_1 = function (product) {
29094
- var meta = productMetaData.find(function (pm) { return pm.targetId === product.id; });
29095
- if (meta) {
29096
- for (var _i = 0, _a = product.variants; _i < _a.length; _i++) {
29097
- var variant = _a[_i];
29098
- if (product.hasVariant) {
29099
- var variantSlug = variant.variantValues
29100
- .map(function (vv) { return vv.slug; })
29101
- .join("-");
29102
- productParams.push({
29103
- slug: meta.slug + "-" + variantSlug,
29104
- });
29105
- }
29106
- else {
29107
- productParams.push({
29108
- slug: meta.slug,
29109
- });
29110
- }
29111
- }
29112
- }
29113
- };
29114
- for (_i = 0, _a = (productsResponse === null || productsResponse === void 0 ? void 0 : productsResponse.data) || []; _i < _a.length; _i++) {
29115
- product = _a[_i];
29116
- _loop_1(product);
29117
- }
29103
+ return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(undefined, undefined, targetTypes)];
29104
+ case 1:
29105
+ metaData = _a.sent();
29118
29106
  return [2 /*return*/, {
29119
- paths: brandCategoryMetaData
29120
- .map(function (m) { return ({
29107
+ paths: metaData.map(function (m) { return ({
29121
29108
  params: {
29122
29109
  slug: m.slug,
29123
29110
  originalSlug: m.slug,
29124
29111
  },
29125
- }); })
29126
- .concat(productParams.map(function (pp) { return ({
29127
- params: pp,
29128
- }); })),
29112
+ }); }),
29129
29113
  fallback: "blocking",
29130
29114
  }];
29131
29115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.123",
3
+ "version": "0.0.125",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",