@ikas/storefront 0.0.55 → 0.0.56
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/api/brand/__generated__/listProductBrand.d.ts +1 -1
- package/build/api/cart/__generated__/getCart.d.ts +2 -2
- package/build/api/cart/__generated__/saveItemToCart.d.ts +2 -2
- package/build/api/category/__generated__/listCategory.d.ts +2 -1
- package/build/api/checkout/__generated__/getCheckoutByCartId.d.ts +1 -1
- package/build/api/checkout/__generated__/getCheckoutById.d.ts +3 -3
- package/build/api/checkout/__generated__/listPaymentGateway.d.ts +1 -1
- package/build/api/checkout/__generated__/saveCheckout.d.ts +1 -1
- package/build/api/city/__generated__/listCity.d.ts +1 -1
- package/build/api/country/__generated__/listCountry.d.ts +1 -1
- package/build/api/customer/__generated__/customerLogin.d.ts +2 -2
- package/build/api/customer/__generated__/getCustomerOrders.d.ts +3 -3
- package/build/api/customer/__generated__/getMyCustomer.d.ts +2 -2
- package/build/api/customer/__generated__/listOrderTransactions.d.ts +1 -1
- package/build/api/customer/__generated__/registerCustomer.d.ts +2 -2
- package/build/api/customer/__generated__/saveMyCustomer.d.ts +2 -2
- package/build/api/district/__generated__/listDistrict.d.ts +1 -1
- package/build/api/favorite-product/__generated__/listFavoriteProducts.d.ts +1 -1
- package/build/api/product/__generated__/listProduct.d.ts +2 -2
- package/build/api/product-attribute/__generated__/listProductAttribute.d.ts +2 -2
- package/build/api/state/__generated__/listState.d.ts +1 -1
- package/build/api/stock-location/__generated__/listStockLocation.d.ts +1 -1
- package/build/api/storefront/__generated__/getStorefront.d.ts +2 -2
- package/build/api/variant-type/__generated__/listVariantType.d.ts +2 -2
- package/build/index.es.js +56 -8
- package/build/index.js +56 -8
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ export interface listProductBrand_listProductBrand_data_metaData {
|
|
|
10
10
|
}
|
|
11
11
|
export interface listProductBrand_listProductBrand_data {
|
|
12
12
|
__typename: "ProductBrand";
|
|
13
|
-
id: string
|
|
13
|
+
id: string;
|
|
14
14
|
name: string;
|
|
15
15
|
imageId: string | null;
|
|
16
16
|
metaData: listProductBrand_listProductBrand_data_metaData | null;
|
|
@@ -32,7 +32,7 @@ export interface getCart_getCart_items {
|
|
|
32
32
|
discount: getCart_getCart_items_discount | null;
|
|
33
33
|
discountPrice: number | null;
|
|
34
34
|
finalPrice: number | null;
|
|
35
|
-
id: string
|
|
35
|
+
id: string;
|
|
36
36
|
originalOrderLineItemId: string | null;
|
|
37
37
|
price: number;
|
|
38
38
|
quantity: number;
|
|
@@ -50,7 +50,7 @@ export interface getCart_getCart {
|
|
|
50
50
|
currencyCode: string | null;
|
|
51
51
|
customerId: string | null;
|
|
52
52
|
dueDate: any;
|
|
53
|
-
id: string
|
|
53
|
+
id: string;
|
|
54
54
|
itemCount: number;
|
|
55
55
|
items: getCart_getCart_items[];
|
|
56
56
|
merchantId: string;
|
|
@@ -33,7 +33,7 @@ export interface saveItemToCart_saveItemToCart_items {
|
|
|
33
33
|
discount: saveItemToCart_saveItemToCart_items_discount | null;
|
|
34
34
|
discountPrice: number | null;
|
|
35
35
|
finalPrice: number | null;
|
|
36
|
-
id: string
|
|
36
|
+
id: string;
|
|
37
37
|
originalOrderLineItemId: string | null;
|
|
38
38
|
price: number;
|
|
39
39
|
quantity: number;
|
|
@@ -46,7 +46,7 @@ export interface saveItemToCart_saveItemToCart_items {
|
|
|
46
46
|
}
|
|
47
47
|
export interface saveItemToCart_saveItemToCart {
|
|
48
48
|
__typename: "Cart";
|
|
49
|
-
id: string
|
|
49
|
+
id: string;
|
|
50
50
|
createdAt: any | null;
|
|
51
51
|
updatedAt: any | null;
|
|
52
52
|
dueDate: any;
|
|
@@ -10,7 +10,7 @@ export interface listCategory_listCategory_data_metaData {
|
|
|
10
10
|
}
|
|
11
11
|
export interface listCategory_listCategory_data {
|
|
12
12
|
__typename: "Category";
|
|
13
|
-
id: string
|
|
13
|
+
id: string;
|
|
14
14
|
createdAt: any | null;
|
|
15
15
|
updatedAt: any | null;
|
|
16
16
|
deleted: boolean | null;
|
|
@@ -18,6 +18,7 @@ export interface listCategory_listCategory_data {
|
|
|
18
18
|
parentId: string | null;
|
|
19
19
|
imageId: string | null;
|
|
20
20
|
metaData: listCategory_listCategory_data_metaData | null;
|
|
21
|
+
categoryPath: string[] | null;
|
|
21
22
|
}
|
|
22
23
|
export interface listCategory_listCategory {
|
|
23
24
|
__typename: "CategoryPaginationResponse";
|
|
@@ -138,7 +138,7 @@ export interface getCheckoutById_getCheckoutById_cart_items {
|
|
|
138
138
|
discount: getCheckoutById_getCheckoutById_cart_items_discount | null;
|
|
139
139
|
discountPrice: number | null;
|
|
140
140
|
finalPrice: number | null;
|
|
141
|
-
id: string
|
|
141
|
+
id: string;
|
|
142
142
|
originalOrderLineItemId: string | null;
|
|
143
143
|
price: number;
|
|
144
144
|
quantity: number;
|
|
@@ -156,7 +156,7 @@ export interface getCheckoutById_getCheckoutById_cart {
|
|
|
156
156
|
currencyCode: string | null;
|
|
157
157
|
customerId: string | null;
|
|
158
158
|
dueDate: any;
|
|
159
|
-
id: string
|
|
159
|
+
id: string;
|
|
160
160
|
itemCount: number;
|
|
161
161
|
items: getCheckoutById_getCheckoutById_cart_items[];
|
|
162
162
|
merchantId: string;
|
|
@@ -182,7 +182,7 @@ export interface getCheckoutById_getCheckoutById {
|
|
|
182
182
|
createdAt: any | null;
|
|
183
183
|
customer: getCheckoutById_getCheckoutById_customer | null;
|
|
184
184
|
deleted: boolean | null;
|
|
185
|
-
id: string
|
|
185
|
+
id: string;
|
|
186
186
|
merchantId: string;
|
|
187
187
|
orderId: string | null;
|
|
188
188
|
orderNumber: string | null;
|
|
@@ -8,7 +8,7 @@ export interface listPaymentGateway_listPaymentGateway {
|
|
|
8
8
|
__typename: "PaymentGateway";
|
|
9
9
|
paymentMethods: listPaymentGateway_listPaymentGateway_paymentMethods[];
|
|
10
10
|
paymentMethodType: PaymentMethodEnum;
|
|
11
|
-
id: string
|
|
11
|
+
id: string;
|
|
12
12
|
name: string;
|
|
13
13
|
testMode: boolean | null;
|
|
14
14
|
}
|
|
@@ -31,7 +31,7 @@ export interface customerLogin_customerLogin_customer_addresses {
|
|
|
31
31
|
company: string | null;
|
|
32
32
|
country: customerLogin_customerLogin_customer_addresses_country;
|
|
33
33
|
district: customerLogin_customerLogin_customer_addresses_district | null;
|
|
34
|
-
id: string
|
|
34
|
+
id: string;
|
|
35
35
|
firstName: string;
|
|
36
36
|
isDefault: boolean | null;
|
|
37
37
|
lastName: string;
|
|
@@ -43,7 +43,7 @@ export interface customerLogin_customerLogin_customer_addresses {
|
|
|
43
43
|
}
|
|
44
44
|
export interface customerLogin_customerLogin_customer {
|
|
45
45
|
__typename: "Customer";
|
|
46
|
-
id: string
|
|
46
|
+
id: string;
|
|
47
47
|
isEmailVerified: boolean | null;
|
|
48
48
|
isPhoneVerified: boolean | null;
|
|
49
49
|
lastName: string | null;
|
|
@@ -95,7 +95,7 @@ export interface getCustomerOrders_getCustomerOrders_orderLineItems {
|
|
|
95
95
|
discount: getCustomerOrders_getCustomerOrders_orderLineItems_discount | null;
|
|
96
96
|
discountPrice: number | null;
|
|
97
97
|
finalPrice: number | null;
|
|
98
|
-
id: string
|
|
98
|
+
id: string;
|
|
99
99
|
originalOrderLineItemId: string | null;
|
|
100
100
|
price: number;
|
|
101
101
|
quantity: number;
|
|
@@ -121,7 +121,7 @@ export interface getCustomerOrders_getCustomerOrders_orderPackages {
|
|
|
121
121
|
orderPackageNumber: string;
|
|
122
122
|
orderPackageFulfillStatus: OrderPackageFulfillStatusEnum;
|
|
123
123
|
orderLineItemIds: string[];
|
|
124
|
-
id: string
|
|
124
|
+
id: string;
|
|
125
125
|
deleted: boolean | null;
|
|
126
126
|
createdAt: any | null;
|
|
127
127
|
}
|
|
@@ -188,7 +188,7 @@ export interface getCustomerOrders_getCustomerOrders {
|
|
|
188
188
|
currencyRates: getCustomerOrders_getCustomerOrders_currencyRates[];
|
|
189
189
|
customer: getCustomerOrders_getCustomerOrders_customer | null;
|
|
190
190
|
deleted: boolean | null;
|
|
191
|
-
id: string
|
|
191
|
+
id: string;
|
|
192
192
|
merchantId: string;
|
|
193
193
|
note: string | null;
|
|
194
194
|
orderedAt: any | null;
|
|
@@ -31,7 +31,7 @@ export interface getMyCustomer_getMyCustomer_addresses {
|
|
|
31
31
|
company: string | null;
|
|
32
32
|
country: getMyCustomer_getMyCustomer_addresses_country;
|
|
33
33
|
district: getMyCustomer_getMyCustomer_addresses_district | null;
|
|
34
|
-
id: string
|
|
34
|
+
id: string;
|
|
35
35
|
firstName: string;
|
|
36
36
|
isDefault: boolean | null;
|
|
37
37
|
lastName: string;
|
|
@@ -44,7 +44,7 @@ export interface getMyCustomer_getMyCustomer_addresses {
|
|
|
44
44
|
}
|
|
45
45
|
export interface getMyCustomer_getMyCustomer {
|
|
46
46
|
__typename: "Customer";
|
|
47
|
-
id: string
|
|
47
|
+
id: string;
|
|
48
48
|
isEmailVerified: boolean | null;
|
|
49
49
|
isPhoneVerified: boolean | null;
|
|
50
50
|
lastName: string | null;
|
|
@@ -31,7 +31,7 @@ export interface listOrderTransactions_listOrderTransactions {
|
|
|
31
31
|
customerId: string | null;
|
|
32
32
|
deleted: boolean | null;
|
|
33
33
|
error: listOrderTransactions_listOrderTransactions_error | null;
|
|
34
|
-
id: string
|
|
34
|
+
id: string;
|
|
35
35
|
orderId: string | null;
|
|
36
36
|
paymentGatewayId: string;
|
|
37
37
|
paymentGatewayName: string;
|
|
@@ -31,7 +31,7 @@ export interface registerCustomer_registerCustomer_customer_addresses {
|
|
|
31
31
|
company: string | null;
|
|
32
32
|
country: registerCustomer_registerCustomer_customer_addresses_country;
|
|
33
33
|
district: registerCustomer_registerCustomer_customer_addresses_district | null;
|
|
34
|
-
id: string
|
|
34
|
+
id: string;
|
|
35
35
|
firstName: string;
|
|
36
36
|
isDefault: boolean | null;
|
|
37
37
|
lastName: string;
|
|
@@ -43,7 +43,7 @@ export interface registerCustomer_registerCustomer_customer_addresses {
|
|
|
43
43
|
}
|
|
44
44
|
export interface registerCustomer_registerCustomer_customer {
|
|
45
45
|
__typename: "Customer";
|
|
46
|
-
id: string
|
|
46
|
+
id: string;
|
|
47
47
|
isEmailVerified: boolean | null;
|
|
48
48
|
isPhoneVerified: boolean | null;
|
|
49
49
|
lastName: string | null;
|
|
@@ -31,7 +31,7 @@ export interface saveMyCustomer_saveMyCustomer_addresses {
|
|
|
31
31
|
company: string | null;
|
|
32
32
|
country: saveMyCustomer_saveMyCustomer_addresses_country;
|
|
33
33
|
district: saveMyCustomer_saveMyCustomer_addresses_district | null;
|
|
34
|
-
id: string
|
|
34
|
+
id: string;
|
|
35
35
|
firstName: string;
|
|
36
36
|
isDefault: boolean | null;
|
|
37
37
|
lastName: string;
|
|
@@ -44,7 +44,7 @@ export interface saveMyCustomer_saveMyCustomer_addresses {
|
|
|
44
44
|
}
|
|
45
45
|
export interface saveMyCustomer_saveMyCustomer {
|
|
46
46
|
__typename: "Customer";
|
|
47
|
-
id: string
|
|
47
|
+
id: string;
|
|
48
48
|
isEmailVerified: boolean | null;
|
|
49
49
|
isPhoneVerified: boolean | null;
|
|
50
50
|
lastName: string | null;
|
|
@@ -40,7 +40,7 @@ export interface listProduct_listProduct_data_variants_prices {
|
|
|
40
40
|
}
|
|
41
41
|
export interface listProduct_listProduct_data_variants {
|
|
42
42
|
__typename: "Variant";
|
|
43
|
-
id: string
|
|
43
|
+
id: string;
|
|
44
44
|
createdAt: any | null;
|
|
45
45
|
updatedAt: any | null;
|
|
46
46
|
deleted: boolean | null;
|
|
@@ -60,7 +60,7 @@ export interface listProduct_listProduct_data_attributes {
|
|
|
60
60
|
}
|
|
61
61
|
export interface listProduct_listProduct_data {
|
|
62
62
|
__typename: "Product";
|
|
63
|
-
id: string
|
|
63
|
+
id: string;
|
|
64
64
|
createdAt: any | null;
|
|
65
65
|
updatedAt: any | null;
|
|
66
66
|
deleted: boolean | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StringFilterInput, ProductAttributeTypeEnum } from "../../../__generated__/global-types";
|
|
2
2
|
export interface listProductAttribute_listProductAttribute_options {
|
|
3
3
|
__typename: "ProductAttributeOption";
|
|
4
|
-
id: string
|
|
4
|
+
id: string;
|
|
5
5
|
createdAt: any | null;
|
|
6
6
|
updatedAt: any | null;
|
|
7
7
|
deleted: boolean | null;
|
|
@@ -9,7 +9,7 @@ export interface listProductAttribute_listProductAttribute_options {
|
|
|
9
9
|
}
|
|
10
10
|
export interface listProductAttribute_listProductAttribute {
|
|
11
11
|
__typename: "ProductAttribute";
|
|
12
|
-
id: string
|
|
12
|
+
id: string;
|
|
13
13
|
createdAt: any | null;
|
|
14
14
|
updatedAt: any | null;
|
|
15
15
|
deleted: boolean | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface getStorefront_getStorefront_regions {
|
|
2
2
|
__typename: "StorefrontRegion";
|
|
3
|
-
id: string
|
|
3
|
+
id: string;
|
|
4
4
|
locale: string;
|
|
5
5
|
privacyPolicy: string | null;
|
|
6
6
|
returnPolicy: string | null;
|
|
@@ -8,7 +8,7 @@ export interface getStorefront_getStorefront_regions {
|
|
|
8
8
|
}
|
|
9
9
|
export interface getStorefront_getStorefront {
|
|
10
10
|
__typename: "Storefront";
|
|
11
|
-
id: string
|
|
11
|
+
id: string;
|
|
12
12
|
name: string;
|
|
13
13
|
themeId: string;
|
|
14
14
|
themeVersionId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StringFilterInput, VariantSelectionTypeEnum } from "../../../__generated__/global-types";
|
|
2
2
|
export interface listVariantType_listVariantType_values {
|
|
3
3
|
__typename: "VariantValue";
|
|
4
|
-
id: string
|
|
4
|
+
id: string;
|
|
5
5
|
createdAt: any | null;
|
|
6
6
|
updatedAt: any | null;
|
|
7
7
|
deleted: boolean | null;
|
|
@@ -11,7 +11,7 @@ export interface listVariantType_listVariantType_values {
|
|
|
11
11
|
}
|
|
12
12
|
export interface listVariantType_listVariantType {
|
|
13
13
|
__typename: "VariantType";
|
|
14
|
-
id: string
|
|
14
|
+
id: string;
|
|
15
15
|
createdAt: any | null;
|
|
16
16
|
updatedAt: any | null;
|
|
17
17
|
deleted: boolean | null;
|
package/build/index.es.js
CHANGED
|
@@ -21781,14 +21781,14 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
21781
21781
|
}
|
|
21782
21782
|
IkasCategoryAPI.listCategories = function (params) {
|
|
21783
21783
|
return __awaiter(this, void 0, void 0, function () {
|
|
21784
|
-
var LIST_QUERY, _a, data, errors, count, categories, err_1;
|
|
21784
|
+
var LIST_QUERY, _a, data, errors, count, categories, _loop_1, this_1, i, err_1, err_2;
|
|
21785
21785
|
return __generator(this, function (_b) {
|
|
21786
21786
|
switch (_b.label) {
|
|
21787
21787
|
case 0:
|
|
21788
|
-
LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "])));
|
|
21788
|
+
LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "])));
|
|
21789
21789
|
_b.label = 1;
|
|
21790
21790
|
case 1:
|
|
21791
|
-
_b.trys.push([1,
|
|
21791
|
+
_b.trys.push([1, 10, , 11]);
|
|
21792
21792
|
return [4 /*yield*/, apollo
|
|
21793
21793
|
.getClient()
|
|
21794
21794
|
.query({
|
|
@@ -21828,18 +21828,66 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
21828
21828
|
image: c.imageId ? new IkasImage(c.imageId) : undefined,
|
|
21829
21829
|
});
|
|
21830
21830
|
});
|
|
21831
|
-
|
|
21832
|
-
categories: categories,
|
|
21833
|
-
count: count,
|
|
21834
|
-
}];
|
|
21831
|
+
_b.label = 3;
|
|
21835
21832
|
case 3:
|
|
21833
|
+
_b.trys.push([3, 8, , 9]);
|
|
21834
|
+
_loop_1 = function (i) {
|
|
21835
|
+
var categoryPath, path_1, listCategoriesResult_1;
|
|
21836
|
+
return __generator(this, function (_a) {
|
|
21837
|
+
switch (_a.label) {
|
|
21838
|
+
case 0:
|
|
21839
|
+
categoryPath = data.listCategory.data[i].categoryPath;
|
|
21840
|
+
if (!(categoryPath && categoryPath.length)) return [3 /*break*/, 2];
|
|
21841
|
+
path_1 = [];
|
|
21842
|
+
return [4 /*yield*/, this_1.listCategories({
|
|
21843
|
+
idList: categoryPath,
|
|
21844
|
+
})];
|
|
21845
|
+
case 1:
|
|
21846
|
+
listCategoriesResult_1 = _a.sent();
|
|
21847
|
+
categoryPath.forEach(function (categoryId) {
|
|
21848
|
+
var _a;
|
|
21849
|
+
var category = listCategoriesResult_1.categories.find(function (c) { return c.id === categoryId; });
|
|
21850
|
+
path_1.push(new IkasCategoryPath({
|
|
21851
|
+
id: category.id,
|
|
21852
|
+
name: category.name,
|
|
21853
|
+
slug: (_a = category.metaData) === null || _a === void 0 ? void 0 : _a.slug,
|
|
21854
|
+
}));
|
|
21855
|
+
});
|
|
21856
|
+
categories[i].path = path_1;
|
|
21857
|
+
_a.label = 2;
|
|
21858
|
+
case 2: return [2 /*return*/];
|
|
21859
|
+
}
|
|
21860
|
+
});
|
|
21861
|
+
};
|
|
21862
|
+
this_1 = this;
|
|
21863
|
+
i = 0;
|
|
21864
|
+
_b.label = 4;
|
|
21865
|
+
case 4:
|
|
21866
|
+
if (!(i < data.listCategory.data.length)) return [3 /*break*/, 7];
|
|
21867
|
+
return [5 /*yield**/, _loop_1(i)];
|
|
21868
|
+
case 5:
|
|
21869
|
+
_b.sent();
|
|
21870
|
+
_b.label = 6;
|
|
21871
|
+
case 6:
|
|
21872
|
+
i++;
|
|
21873
|
+
return [3 /*break*/, 4];
|
|
21874
|
+
case 7: return [3 /*break*/, 9];
|
|
21875
|
+
case 8:
|
|
21836
21876
|
err_1 = _b.sent();
|
|
21837
21877
|
console.log(err_1);
|
|
21878
|
+
return [3 /*break*/, 9];
|
|
21879
|
+
case 9: return [2 /*return*/, {
|
|
21880
|
+
categories: categories,
|
|
21881
|
+
count: count,
|
|
21882
|
+
}];
|
|
21883
|
+
case 10:
|
|
21884
|
+
err_2 = _b.sent();
|
|
21885
|
+
console.log(err_2);
|
|
21838
21886
|
return [2 /*return*/, {
|
|
21839
21887
|
categories: [],
|
|
21840
21888
|
count: 0,
|
|
21841
21889
|
}];
|
|
21842
|
-
case
|
|
21890
|
+
case 11: return [2 /*return*/];
|
|
21843
21891
|
}
|
|
21844
21892
|
});
|
|
21845
21893
|
});
|
package/build/index.js
CHANGED
|
@@ -21759,14 +21759,14 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
21759
21759
|
}
|
|
21760
21760
|
IkasCategoryAPI.listCategories = function (params) {
|
|
21761
21761
|
return __awaiter(this, void 0, void 0, function () {
|
|
21762
|
-
var LIST_QUERY, _a, data, errors, count, categories, err_1;
|
|
21762
|
+
var LIST_QUERY, _a, data, errors, count, categories, _loop_1, this_1, i, err_1, err_2;
|
|
21763
21763
|
return __generator(this, function (_b) {
|
|
21764
21764
|
switch (_b.label) {
|
|
21765
21765
|
case 0:
|
|
21766
|
-
LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n }\n count\n }\n }\n "])));
|
|
21766
|
+
LIST_QUERY = src(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "], ["\n query listCategory(\n $id: StringFilterInput\n $pagination: PaginationInput\n $name: StringFilterInput\n ) {\n listCategory(id: $id, pagination: $pagination, name: $name) {\n data {\n id\n createdAt\n updatedAt\n deleted\n name\n parentId\n imageId\n metaData {\n slug\n pageTitle\n description\n targetId\n targetType\n redirectTo\n }\n categoryPath\n }\n count\n }\n }\n "])));
|
|
21767
21767
|
_b.label = 1;
|
|
21768
21768
|
case 1:
|
|
21769
|
-
_b.trys.push([1,
|
|
21769
|
+
_b.trys.push([1, 10, , 11]);
|
|
21770
21770
|
return [4 /*yield*/, apollo
|
|
21771
21771
|
.getClient()
|
|
21772
21772
|
.query({
|
|
@@ -21806,18 +21806,66 @@ var IkasCategoryAPI = /** @class */ (function () {
|
|
|
21806
21806
|
image: c.imageId ? new IkasImage(c.imageId) : undefined,
|
|
21807
21807
|
});
|
|
21808
21808
|
});
|
|
21809
|
-
|
|
21810
|
-
categories: categories,
|
|
21811
|
-
count: count,
|
|
21812
|
-
}];
|
|
21809
|
+
_b.label = 3;
|
|
21813
21810
|
case 3:
|
|
21811
|
+
_b.trys.push([3, 8, , 9]);
|
|
21812
|
+
_loop_1 = function (i) {
|
|
21813
|
+
var categoryPath, path_1, listCategoriesResult_1;
|
|
21814
|
+
return __generator(this, function (_a) {
|
|
21815
|
+
switch (_a.label) {
|
|
21816
|
+
case 0:
|
|
21817
|
+
categoryPath = data.listCategory.data[i].categoryPath;
|
|
21818
|
+
if (!(categoryPath && categoryPath.length)) return [3 /*break*/, 2];
|
|
21819
|
+
path_1 = [];
|
|
21820
|
+
return [4 /*yield*/, this_1.listCategories({
|
|
21821
|
+
idList: categoryPath,
|
|
21822
|
+
})];
|
|
21823
|
+
case 1:
|
|
21824
|
+
listCategoriesResult_1 = _a.sent();
|
|
21825
|
+
categoryPath.forEach(function (categoryId) {
|
|
21826
|
+
var _a;
|
|
21827
|
+
var category = listCategoriesResult_1.categories.find(function (c) { return c.id === categoryId; });
|
|
21828
|
+
path_1.push(new IkasCategoryPath({
|
|
21829
|
+
id: category.id,
|
|
21830
|
+
name: category.name,
|
|
21831
|
+
slug: (_a = category.metaData) === null || _a === void 0 ? void 0 : _a.slug,
|
|
21832
|
+
}));
|
|
21833
|
+
});
|
|
21834
|
+
categories[i].path = path_1;
|
|
21835
|
+
_a.label = 2;
|
|
21836
|
+
case 2: return [2 /*return*/];
|
|
21837
|
+
}
|
|
21838
|
+
});
|
|
21839
|
+
};
|
|
21840
|
+
this_1 = this;
|
|
21841
|
+
i = 0;
|
|
21842
|
+
_b.label = 4;
|
|
21843
|
+
case 4:
|
|
21844
|
+
if (!(i < data.listCategory.data.length)) return [3 /*break*/, 7];
|
|
21845
|
+
return [5 /*yield**/, _loop_1(i)];
|
|
21846
|
+
case 5:
|
|
21847
|
+
_b.sent();
|
|
21848
|
+
_b.label = 6;
|
|
21849
|
+
case 6:
|
|
21850
|
+
i++;
|
|
21851
|
+
return [3 /*break*/, 4];
|
|
21852
|
+
case 7: return [3 /*break*/, 9];
|
|
21853
|
+
case 8:
|
|
21814
21854
|
err_1 = _b.sent();
|
|
21815
21855
|
console.log(err_1);
|
|
21856
|
+
return [3 /*break*/, 9];
|
|
21857
|
+
case 9: return [2 /*return*/, {
|
|
21858
|
+
categories: categories,
|
|
21859
|
+
count: count,
|
|
21860
|
+
}];
|
|
21861
|
+
case 10:
|
|
21862
|
+
err_2 = _b.sent();
|
|
21863
|
+
console.log(err_2);
|
|
21816
21864
|
return [2 /*return*/, {
|
|
21817
21865
|
categories: [],
|
|
21818
21866
|
count: 0,
|
|
21819
21867
|
}];
|
|
21820
|
-
case
|
|
21868
|
+
case 11: return [2 /*return*/];
|
|
21821
21869
|
}
|
|
21822
21870
|
});
|
|
21823
21871
|
});
|