@blackfisk/blackfisk-vue-storefront-api 1.0.6 → 1.0.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/getProductCollection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,kCAAkC;IACjD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AACD,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,kCAAkC,CAAC;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AACD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,GAAG,EAAE,CAAC;CACb;AAED,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,sBAAsB,CA2BlE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/getProductCollection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,kCAAkC;IACjD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AACD,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,kCAAkC,CAAC;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AACD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,GAAG,EAAE,CAAC;CACb;AAED,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,sBAAsB,CA0BlE,CAAC"}
@@ -14,6 +14,11 @@ export interface SearchProductCondition {
14
14
  name: string;
15
15
  description: string;
16
16
  }
17
+ export interface Color {
18
+ color: string;
19
+ hex: string;
20
+ hsl: string;
21
+ }
17
22
  export interface SearchProductImage {
18
23
  url: string;
19
24
  public_id: string;
@@ -34,7 +39,7 @@ export interface SearchProduct {
34
39
  categoryIds: number[];
35
40
  categoryName: string;
36
41
  channelId: number;
37
- colors: [];
42
+ colors: Color[];
38
43
  condition: SearchProductCondition;
39
44
  description: string;
40
45
  familyId: number;
@@ -58,6 +63,20 @@ export interface SearchProduct {
58
63
  title: string;
59
64
  upc: string;
60
65
  }
66
+ export interface SearchProductHit {
67
+ _index: string;
68
+ _id: string;
69
+ _score: number;
70
+ _ignored: string[];
71
+ _source: SearchProduct;
72
+ inner_hits: {
73
+ family: {
74
+ hits: {
75
+ hits: SearchProduct[];
76
+ };
77
+ };
78
+ };
79
+ }
61
80
  export interface ProductListing {
62
81
  [key: string]: any;
63
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/types/api/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,IAAI,EAAE,sBAAsB,EAAE,CAAC;IAC/B,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,QAAQ,EAAE,sBAAsB,EAAE,CAAC;CACpC;AACD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AACD,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,iBAAiB;CAAG;AACrC,MAAM,WAAW,aAAa;I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,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,iBAAiB,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,IAAI,EAAE,aAAa,EAAE,CAAC;aACvB,CAAA;SACF,CAAA;KACF,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AACD,cAAc,aAAa,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { SearchProductHit } from '@blackfisk/blackfisk-vue-storefront-api/src/types/api';
1
2
  export interface DisplayProductImage {
2
3
  src: string;
3
4
  url: string;
@@ -19,5 +20,5 @@ export interface DisplayProductGroup {
19
20
  groupPriceHigh: number;
20
21
  products: DisplayProduct[];
21
22
  }
22
- export declare const groupProductResult: (ProductResult: any) => unknown[];
23
+ export declare const groupProductResult: (ProductResult: SearchProductHit) => unknown[];
23
24
  //# sourceMappingURL=productGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"productGroup.d.ts","sourceRoot":"","sources":["../../../../../utils/elasticsearch/productGroup.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,mBAAmB,CAAC;CAC1B;AACD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AACD,eAAO,MAAM,kBAAkB,mCAmF9B,CAAA"}
1
+ {"version":3,"file":"productGroup.d.ts","sourceRoot":"","sources":["../../../../../utils/elasticsearch/productGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,uDAAuD,CAAA;AAC5G,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,mBAAmB,CAAC;CAC1B;AACD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AACD,eAAO,MAAM,kBAAkB,kBAAmB,gBAAgB,cAyGjE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blackfisk/blackfisk-vue-storefront-api",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "sideEffects": false,
5
5
  "server": "server/index.js",
6
6
  "main": "lib/index.cjs.js",
@@ -28,5 +28,5 @@
28
28
  "lib/**/*",
29
29
  "server/**/*"
30
30
  ],
31
- "gitHead": "d644c181a9276e1f6613eb0a7afd252077bedf55"
31
+ "gitHead": "c3722e1a48c62b4fa0c254778677fedc6950fc8a"
32
32
  }
package/server/index.js CHANGED
@@ -30,47 +30,69 @@ const groupProductResult = (ProductResult) => {
30
30
  img: formatDisplayProductImage(ProductCollectionItem),
31
31
  };
32
32
  };
33
+ // console.log({ProductCollectionItem: ProductCollectionItems[0]})
33
34
  const isGroupRepresented = {};
34
35
  let sortOrder = 0;
35
36
  const DisplayFamilies = ProductCollectionItems
36
- .reduce((accumulator, ProductCollectionItem) => {
37
- if (ProductCollectionItem.familyId > 0) {
38
- if (!accumulator['groups'][ProductCollectionItem.familyId]) {
39
- isGroupRepresented[ProductCollectionItem.familyId] = false;
40
- accumulator['sort'][ProductCollectionItem.familyId] = sortOrder;
37
+ .reduce((accumulator, ProductCollectionItemHit) => {
38
+ const ProductCollectionItem = ProductCollectionItemHit['_source'] || ProductCollectionItemHit;
39
+ if (ProductCollectionItem) {
40
+ if (ProductCollectionItem?.familyId > 0) {
41
+ if (!accumulator['groups'][ProductCollectionItem.familyId]) {
42
+ isGroupRepresented[ProductCollectionItem.familyId] = false;
43
+ accumulator['sort'][ProductCollectionItem.familyId] = sortOrder;
44
+ sortOrder++;
45
+ accumulator['groups'][ProductCollectionItem.familyId] = {
46
+ groupId: ProductCollectionItem.familyId,
47
+ groupName: ProductCollectionItem.parentName,
48
+ brandName: ProductCollectionItem.brandName,
49
+ groupPriceLow: ProductCollectionItem.priceSale,
50
+ groupPriceHigh: ProductCollectionItem.priceSale,
51
+ products: [formatDisplayProduct(ProductCollectionItem)],
52
+ };
53
+ }
54
+ else {
55
+ if (ProductCollectionItem.priceSale < accumulator['groups'][ProductCollectionItem.familyId].groupPriceLow) {
56
+ accumulator['groups'][ProductCollectionItem.familyId].groupPriceLow = ProductCollectionItem.priceSale;
57
+ }
58
+ if (ProductCollectionItem.priceSale > accumulator['groups'][ProductCollectionItem.familyId].groupPriceHigh) {
59
+ accumulator['groups'][ProductCollectionItem.familyId].groupPriceHigh = ProductCollectionItem.priceSale;
60
+ }
61
+ // accumulator['groups'][ProductCollectionItem.familyId].products.push()
62
+ }
63
+ const InnerHits = (ProductCollectionItemHit?.['inner_hits']?.['family']?.['hits']?.['hits'] ?? []);
64
+ if (InnerHits.length > 0) {
65
+ accumulator['groups'][ProductCollectionItem.familyId]['products'] = [
66
+ ...accumulator['groups'][ProductCollectionItem.familyId]['products'],
67
+ ...InnerHits
68
+ .filter((InnerHit) => InnerHit['_source']['id'] !== ProductCollectionItem.id)
69
+ .map((InnerHit) => formatDisplayProduct(InnerHit['_source'])),
70
+ ];
71
+ }
72
+ }
73
+ else if (!accumulator['groups'][`S${ProductCollectionItem.id}`]) {
74
+ isGroupRepresented[`S${ProductCollectionItem.id}`] = false;
75
+ accumulator['sort'][`S${ProductCollectionItem.id}`] = sortOrder;
41
76
  sortOrder++;
42
- accumulator['groups'][ProductCollectionItem.familyId] = {
77
+ accumulator['groups'][`S${ProductCollectionItem.id}`] = {
43
78
  groupId: ProductCollectionItem.familyId,
44
- groupName: ProductCollectionItem.parentName,
79
+ groupName: ProductCollectionItem.heading || ProductCollectionItem.productName,
45
80
  brandName: ProductCollectionItem.brandName,
46
81
  groupPriceLow: ProductCollectionItem.priceSale,
47
82
  groupPriceHigh: ProductCollectionItem.priceSale,
48
83
  products: [formatDisplayProduct(ProductCollectionItem)],
49
84
  };
50
- }
51
- else {
52
- if (ProductCollectionItem.priceSale < accumulator['groups'][ProductCollectionItem.familyId].groupPriceLow) {
53
- accumulator['groups'][ProductCollectionItem.familyId].groupPriceLow = ProductCollectionItem.priceSale;
54
- }
55
- if (ProductCollectionItem.priceSale > accumulator['groups'][ProductCollectionItem.familyId].groupPriceHigh) {
56
- accumulator['groups'][ProductCollectionItem.familyId].groupPriceHigh = ProductCollectionItem.priceSale;
85
+ const InnerHits = (ProductCollectionItemHit?.['inner_hits']?.['family']?.['hits']?.['hits'] ?? []);
86
+ if (InnerHits.length > 0) {
87
+ accumulator['groups'][`S${ProductCollectionItem.id}`]['products'] = [
88
+ ...accumulator['groups'][`S${ProductCollectionItem.id}`]['products'],
89
+ ...InnerHits
90
+ .filter((InnerHit) => InnerHit['_source']['id'] !== ProductCollectionItem.id)
91
+ .map((InnerHit) => formatDisplayProduct(InnerHit['_source'])),
92
+ ];
57
93
  }
58
- accumulator['groups'][ProductCollectionItem.familyId].products.push(formatDisplayProduct(ProductCollectionItem));
59
94
  }
60
95
  }
61
- else if (!accumulator['groups'][`S${ProductCollectionItem.id}`]) {
62
- isGroupRepresented[`S${ProductCollectionItem.id}`] = false;
63
- accumulator['sort'][`S${ProductCollectionItem.id}`] = sortOrder;
64
- sortOrder++;
65
- accumulator['groups'][`S${ProductCollectionItem.id}`] = {
66
- groupId: ProductCollectionItem.familyId,
67
- groupName: ProductCollectionItem.heading || ProductCollectionItem.productName,
68
- brandName: ProductCollectionItem.brandName,
69
- groupPriceLow: ProductCollectionItem.priceSale,
70
- groupPriceHigh: ProductCollectionItem.priceSale,
71
- products: [formatDisplayProduct(ProductCollectionItem)],
72
- };
73
- }
74
96
  return accumulator;
75
97
  }, {
76
98
  groups: {},
@@ -121,7 +143,6 @@ const getProductCollection = async (context, params = {
121
143
  data: params,
122
144
  });
123
145
  const productCollection = (data?.data ?? []);
124
- // console.log(productCollection)
125
146
  return { data: groupProductResult(productCollection) };
126
147
  };
127
148
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../utils/elasticsearch/productGroup.ts","../src/api/getProductCollection/index.ts","../src/api/getProductListing/index.ts","../src/api/proxyInstantsearch/index.ts","../src/api/getCollection/index.ts","../src/api/getProductFacets/index.ts","../src/index.server.ts"],"sourcesContent":["import type { SearchProduct } from '@blackfisk/blackfisk-vue-storefront-api/src/types/api'\nexport interface DisplayProductImage {\n src: string,\n url: string,\n alt: string,\n}\nexport interface DisplayProduct {\n id: number,\n slug: string,\n name: string,\n groupId: number,\n price: string,\n img: DisplayProductImage,\n}\nexport interface DisplayProductGroup {\n groupId: number,\n groupName: string,\n brandName: string,\n groupPriceLow: number,\n groupPriceHigh: number,\n products: DisplayProduct[],\n}\nexport const groupProductResult = (ProductResult) => {\n const ProductCollectionItems:SearchProduct[] = (Array.isArray(ProductResult) ? ProductResult : [ProductResult]);\n if (ProductCollectionItems.length > 0) {\n const formatDisplayProductImage = (ProductCollectionItem: SearchProduct) => {\n const primaryImage = ProductCollectionItem.images?.[0] ?? { public_id: '', alt: '', url: '' }\n return {\n src: primaryImage.public_id,\n url: primaryImage.url,\n alt: primaryImage.alt,\n }\n }\n const formatDisplayProduct = (ProductCollectionItem: SearchProduct) => {\n return {\n id: ProductCollectionItem.id,\n slug: ProductCollectionItem.slug,\n name: ProductCollectionItem.heading || ProductCollectionItem.productName,\n price: `$${ProductCollectionItem.priceSale}`,\n groupId: ProductCollectionItem.familyId,\n img: formatDisplayProductImage(ProductCollectionItem),\n }\n }\n const isGroupRepresented = {}\n let sortOrder = 0\n const DisplayFamilies: any = ProductCollectionItems\n .reduce((accumulator: {'groups': {[groupId: number | string]: DisplayProductGroup}, 'sort': {[groupId: number | string]: number}}, ProductCollectionItem: SearchProduct) => {\n if (ProductCollectionItem.familyId > 0) {\n if (!accumulator['groups'][ProductCollectionItem.familyId]) {\n isGroupRepresented[ProductCollectionItem.familyId] = false\n accumulator['sort'][ProductCollectionItem.familyId] = sortOrder\n sortOrder++\n accumulator['groups'][ProductCollectionItem.familyId] = {\n groupId: ProductCollectionItem.familyId,\n groupName: ProductCollectionItem.parentName,\n brandName: ProductCollectionItem.brandName,\n groupPriceLow: ProductCollectionItem.priceSale,\n groupPriceHigh: ProductCollectionItem.priceSale,\n products: [formatDisplayProduct(ProductCollectionItem)],\n }\n } else {\n if (ProductCollectionItem.priceSale < accumulator['groups'][ProductCollectionItem.familyId].groupPriceLow) {\n accumulator['groups'][ProductCollectionItem.familyId].groupPriceLow = ProductCollectionItem.priceSale\n }\n if (ProductCollectionItem.priceSale > accumulator['groups'][ProductCollectionItem.familyId].groupPriceHigh) {\n accumulator['groups'][ProductCollectionItem.familyId].groupPriceHigh = ProductCollectionItem.priceSale\n }\n accumulator['groups'][ProductCollectionItem.familyId].products.push(formatDisplayProduct(ProductCollectionItem))\n }\n } else if (!accumulator['groups'][`S${ProductCollectionItem.id}`]) {\n isGroupRepresented[`S${ProductCollectionItem.id}`] = false\n accumulator['sort'][`S${ProductCollectionItem.id}`] = sortOrder\n sortOrder++\n accumulator['groups'][`S${ProductCollectionItem.id}`] = {\n groupId: ProductCollectionItem.familyId,\n groupName: ProductCollectionItem.heading || ProductCollectionItem.productName,\n brandName: ProductCollectionItem.brandName,\n groupPriceLow: ProductCollectionItem.priceSale,\n groupPriceHigh: ProductCollectionItem.priceSale,\n products: [formatDisplayProduct(ProductCollectionItem)],\n }\n }\n return accumulator\n }, {\n groups: {},\n sort: {},\n })\n const SortedGroups = Object.entries(DisplayFamilies['groups'])\n .sort(([firstKey, firstVal]: any, [secondKey, secondVal]: any) => {\n const firstElSort = DisplayFamilies['sort'][firstKey]\n const secondElSort = DisplayFamilies['sort'][secondKey]\n if (firstElSort < secondElSort) {\n return -1\n } else if (firstElSort > secondElSort) {\n return 1\n } else {\n return 0\n }\n })\n .map(([groupId, group]) => group)\n // console.log({SortedGroups})\n return SortedGroups\n } else {\n return []\n }\n}\n","import { Endpoints } from '../../types';\nimport { groupProductResult } from 'utils/elasticsearch/productGroup'\n// import type { DisplayProductGroup } from 'utils/elasticsearch/productGroup'\nexport interface getProductCollectionTemplateParams {\n [key: string]: any,\n}\nexport interface getProductCollectionParams {\n collectionId: number | string,\n templateParams?: getProductCollectionTemplateParams,\n debug?: boolean,\n}\nexport interface getProductCollectionResponse {\n data: any[],\n}\n\nexport const getProductCollection: Endpoints['getProductCollection'] = async (\n context,\n params: getProductCollectionParams = {\n collectionId: 0,\n templateParams: {\n id: 0,\n ids: [],\n term: '',\n familyId: 0,\n categoryId: 0,\n brandId: 0,\n pricingStrategy: '',\n conditionId: 0,\n limit: 0,\n },\n debug: false,\n }\n) => {\n const RequestURL = new URL('v2/vsf/productCollection', context.config.api.url);\n const { data, status } = await context.client.request({\n method: 'POST',\n url: RequestURL.href,\n data: params,\n })\n const productCollection = (data?.data ?? [])\n // console.log(productCollection)\n return { data: groupProductResult(productCollection) };\n};\n","import { Endpoints, ProductListing } from '../../types';\nexport interface getProductListingTemplateParams {\n [key: string]: any,\n}\nexport interface getProductListingParams {\n collectionId: number | string,\n familyId: number | string,\n channelListingId: number | string,\n debug?: boolean,\n}\nexport interface getProductListingResponse {\n data: ProductListing[],\n}\nexport const getProductListing: Endpoints['getProductListing'] = async (\n context,\n params: getProductListingParams = {\n collectionId: 0,\n familyId: 0,\n channelListingId: 0,\n debug: false,\n }\n) => {\n const RequestURL = new URL('v2/vsf/product/variations', context.config.api.url);\n const { data, status } = await context.client.request({\n method: 'POST',\n url: RequestURL.href,\n data: params,\n })\n const productCollection = (data?.data ?? [])\n return { data: productCollection };\n};\n","import { Endpoints } from '../../types';\nimport { groupProductResult } from 'utils/elasticsearch/productGroup'\n\nexport interface proxyInstantsearchResponse {\n results: any[],\n}\n\nexport const proxyInstantsearch: Endpoints['proxyInstantsearch'] = async (\n context,\n ...searchRequests\n) => {\n // * Retrieve Brand & Category filters from Header\n const brandHeaderIndex = (context?.req?.rawHeaders ?? []).indexOf('x-brand-id')\n let brandId = 0\n if (brandHeaderIndex > -1) {\n brandId = (context?.req?.rawHeaders?.[brandHeaderIndex + 1] ?? 0)\n }\n const categoryHeaderIndex = (context?.req?.rawHeaders ?? []).indexOf('x-category-id')\n let categoryId = 0\n if (categoryHeaderIndex > -1) {\n categoryId = (context?.req?.rawHeaders?.[categoryHeaderIndex + 1] ?? 0)\n }\n\n const RequestURL = new URL('v2/searchkit/proxy', context.config.api.url);\n const { data, status } = await context.client.request({\n method: 'POST',\n url: RequestURL.href,\n headers: {\n 'X-Brand-Id': brandId,\n 'X-Category-Id': categoryId,\n },\n data: Array.isArray(searchRequests) ? searchRequests : [searchRequests],\n })\n const FormattedResults = data.results.map((result: any, index: number) => {\n if (index === 0 && (result?.hits ?? []).length > 0 && result.hits[0].id) {\n return {\n ...result,\n hits: groupProductResult(result.hits),\n }\n } else {\n return result\n }\n });\n return {\n results: FormattedResults,\n }\n};\n","import { Endpoints } from '../../types';\nexport interface getCollectionParams {\n collectionId: number\n}\nexport interface getCollectionResponse {\n data: any\n}\nexport const getCollection: Endpoints['getCollection'] = async (\n context,\n params = {\n collectionId: 0,\n },\n) => {\n const { collectionId = 0 } = params\n const RequestURL = new URL(`/blackfisk/collection/${collectionId}`, context.config.api.url);\n const { data, status } = await context.client.request({\n method: 'GET',\n url: RequestURL.href,\n })\n const Collection = (data?.data ?? [])\n return { data: (Collection?.[0] ?? null) };\n};\n","import { Endpoints } from '../../types';\n\nexport const getProductFacets: Endpoints['getProductFacets'] = async (\n context,\n params\n) => {\n const RequestURL = new URL(`/v2/vsf/product/facets`, context.config.api.url);\n const { data, status } = await context.client.request({\n method: 'GET',\n url: RequestURL.href,\n });\n const ProductFacets = (data?.data ?? []);\n return { data: ProductFacets };\n};\n","import axios from 'axios';\nimport { apiClientFactory } from '@vue-storefront/middleware';\nimport { MiddlewareConfig } from './index';\nimport * as apiEndpoints from './api';\n\n/**\n * In here you should create the client you'll use to communicate with the backend.\n * Axios is just an example.\n */\nconst buildClient = (settings: MiddlewareConfig) => {\n const defaultSettings = {\n accountId: 0,\n channelId: 0,\n accountSiteId: 0,\n baseURL: '',\n }\n const axiosInstance = axios.create({\n baseURL: settings.api.url || defaultSettings.baseURL,\n // baseURL: settings.api.url,\n headers: {\n 'X-Account-Id': settings.accountId || defaultSettings.accountId,\n 'X-Channel-Id': settings.channelId || defaultSettings.channelId,\n 'X-Site-Id': settings.accountSiteId || defaultSettings.accountSiteId,\n authorization: `${settings.api.auth_jwt || process.env.SECURITY_TOKEN || ''}`\n },\n });\n return axiosInstance\n}\n\nconst onCreate = (settings: MiddlewareConfig) => {\n const client = buildClient(settings);\n return {\n config: settings,\n client\n };\n};\n\nconst { createApiClient } = apiClientFactory<any, any>({\n onCreate,\n api: apiEndpoints,\n});\n\nexport { createApiClient };\n"],"names":["axios","apiClientFactory"],"mappings":";;;;;;;;;;;AAsBO,MAAM,kBAAkB,GAAG,CAAC,aAAa,KAAI;IAClD,MAAM,sBAAsB,IAAoB,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;AAChH,IAAA,IAAI,sBAAsB,CAAC,MAAM,GAAG,CAAC,EAAE;AACrC,QAAA,MAAM,yBAAyB,GAAG,CAAC,qBAAoC,KAAI;YACzE,MAAM,YAAY,GAAG,qBAAqB,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAA;YAC7F,OAAO;gBACL,GAAG,EAAE,YAAY,CAAC,SAAS;gBAC3B,GAAG,EAAE,YAAY,CAAC,GAA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D,YAAA,cAAc,EAAE,QAAQ,CAAC,SAAS,IAAI,eAAe,CAAC,SAAS;AAC/D,YAAA,WAAW,EAAE,QAAQ,CAAC,aAAa,IAAI,eAAe,CAAC,aAAa;AACpE,YAAA,aAAa,EAAE,CAAA,EAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAE,CAAA;AAC9E,SAAA;AACF,KAAA,CAAC,CAAC;AACH,IAAA,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,QAA0B,KAAI;AAC9C,IAAA,MAAM,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO;AACL,QAAA,MAAM,EAAE,QAAQ;QAChB,MAAM;KACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,EAAE,eAAe,EAAE,GAAGC,2BAAgB,CAAW;IACrD,QAAQ;AACR,IAAA,GAAG,EAAE,YAAY;AAClB,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../utils/elasticsearch/productGroup.ts","../src/api/getProductCollection/index.ts","../src/api/getProductListing/index.ts","../src/api/proxyInstantsearch/index.ts","../src/api/getCollection/index.ts","../src/api/getProductFacets/index.ts","../src/index.server.ts"],"sourcesContent":["import type { SearchProductHit, SearchProduct } from '@blackfisk/blackfisk-vue-storefront-api/src/types/api'\nexport interface DisplayProductImage {\n src: string,\n url: string,\n alt: string,\n}\nexport interface DisplayProduct {\n id: number,\n slug: string,\n name: string,\n groupId: number,\n price: string,\n img: DisplayProductImage,\n}\nexport interface DisplayProductGroup {\n groupId: number,\n groupName: string,\n brandName: string,\n groupPriceLow: number,\n groupPriceHigh: number,\n products: DisplayProduct[],\n}\nexport const groupProductResult = (ProductResult: SearchProductHit) => {\n const ProductCollectionItems:SearchProductHit[] = (Array.isArray(ProductResult) ? ProductResult : [ProductResult]);\n if (ProductCollectionItems.length > 0) {\n const formatDisplayProductImage = (ProductCollectionItem: SearchProduct) => {\n const primaryImage = ProductCollectionItem.images?.[0] ?? { public_id: '', alt: '', url: '' }\n return {\n src: primaryImage.public_id,\n url: primaryImage.url,\n alt: primaryImage.alt,\n }\n }\n const formatDisplayProduct = (ProductCollectionItem: SearchProduct) => {\n return {\n id: ProductCollectionItem.id,\n slug: ProductCollectionItem.slug,\n name: ProductCollectionItem.heading || ProductCollectionItem.productName,\n price: `$${ProductCollectionItem.priceSale}`,\n groupId: ProductCollectionItem.familyId,\n img: formatDisplayProductImage(ProductCollectionItem),\n }\n }\n // console.log({ProductCollectionItem: ProductCollectionItems[0]})\n const isGroupRepresented = {}\n let sortOrder = 0\n const DisplayFamilies: any = ProductCollectionItems\n .reduce((accumulator: {'groups': {[groupId: number | string]: DisplayProductGroup}, 'sort': {[groupId: number | string]: number}}, ProductCollectionItemHit: SearchProductHit | SearchProduct) => {\n const ProductCollectionItem = ProductCollectionItemHit['_source'] || ProductCollectionItemHit\n if (ProductCollectionItem) {\n if (ProductCollectionItem?.familyId > 0) {\n if (!accumulator['groups'][ProductCollectionItem.familyId]) {\n isGroupRepresented[ProductCollectionItem.familyId] = false\n accumulator['sort'][ProductCollectionItem.familyId] = sortOrder\n sortOrder++\n accumulator['groups'][ProductCollectionItem.familyId] = {\n groupId: ProductCollectionItem.familyId,\n groupName: ProductCollectionItem.parentName,\n brandName: ProductCollectionItem.brandName,\n groupPriceLow: ProductCollectionItem.priceSale,\n groupPriceHigh: ProductCollectionItem.priceSale,\n products: [formatDisplayProduct(ProductCollectionItem)],\n }\n } else {\n if (ProductCollectionItem.priceSale < accumulator['groups'][ProductCollectionItem.familyId].groupPriceLow) {\n accumulator['groups'][ProductCollectionItem.familyId].groupPriceLow = ProductCollectionItem.priceSale\n }\n if (ProductCollectionItem.priceSale > accumulator['groups'][ProductCollectionItem.familyId].groupPriceHigh) {\n accumulator['groups'][ProductCollectionItem.familyId].groupPriceHigh = ProductCollectionItem.priceSale\n }\n // accumulator['groups'][ProductCollectionItem.familyId].products.push()\n }\n const InnerHits = (ProductCollectionItemHit?.['inner_hits']?.['family']?.['hits']?.['hits'] ?? [])\n if (InnerHits.length > 0) {\n accumulator['groups'][ProductCollectionItem.familyId]['products'] = [\n ...accumulator['groups'][ProductCollectionItem.familyId]['products'],\n ...InnerHits\n .filter((InnerHit) => InnerHit['_source']['id'] !== ProductCollectionItem.id)\n .map((InnerHit) => formatDisplayProduct(InnerHit['_source'])),\n ]\n }\n } else if (!accumulator['groups'][`S${ProductCollectionItem.id}`]) {\n isGroupRepresented[`S${ProductCollectionItem.id}`] = false\n accumulator['sort'][`S${ProductCollectionItem.id}`] = sortOrder\n sortOrder++\n accumulator['groups'][`S${ProductCollectionItem.id}`] = {\n groupId: ProductCollectionItem.familyId,\n groupName: ProductCollectionItem.heading || ProductCollectionItem.productName,\n brandName: ProductCollectionItem.brandName,\n groupPriceLow: ProductCollectionItem.priceSale,\n groupPriceHigh: ProductCollectionItem.priceSale,\n products: [formatDisplayProduct(ProductCollectionItem)],\n }\n const InnerHits = (ProductCollectionItemHit?.['inner_hits']?.['family']?.['hits']?.['hits'] ?? [])\n if (InnerHits.length > 0) {\n accumulator['groups'][`S${ProductCollectionItem.id}`]['products'] = [\n ...accumulator['groups'][`S${ProductCollectionItem.id}`]['products'],\n ...InnerHits\n .filter((InnerHit) => InnerHit['_source']['id'] !== ProductCollectionItem.id)\n .map((InnerHit) => formatDisplayProduct(InnerHit['_source'])),\n ]\n }\n }\n }\n return accumulator\n }, {\n groups: {},\n sort: {},\n })\n const SortedGroups = Object.entries(DisplayFamilies['groups'])\n .sort(([firstKey, firstVal]: any, [secondKey, secondVal]: any) => {\n const firstElSort = DisplayFamilies['sort'][firstKey]\n const secondElSort = DisplayFamilies['sort'][secondKey]\n if (firstElSort < secondElSort) {\n return -1\n } else if (firstElSort > secondElSort) {\n return 1\n } else {\n return 0\n }\n })\n .map(([groupId, group]) => group)\n // console.log({SortedGroups})\n return SortedGroups\n } else {\n return []\n }\n}\n","import { Endpoints } from '../../types';\nimport { groupProductResult } from 'utils/elasticsearch/productGroup'\n// import type { DisplayProductGroup } from 'utils/elasticsearch/productGroup'\nexport interface getProductCollectionTemplateParams {\n [key: string]: any,\n}\nexport interface getProductCollectionParams {\n collectionId: number | string,\n templateParams?: getProductCollectionTemplateParams,\n debug?: boolean,\n}\nexport interface getProductCollectionResponse {\n data: any[],\n}\n\nexport const getProductCollection: Endpoints['getProductCollection'] = async (\n context,\n params: getProductCollectionParams = {\n collectionId: 0,\n templateParams: {\n id: 0,\n ids: [],\n term: '',\n familyId: 0,\n categoryId: 0,\n brandId: 0,\n pricingStrategy: '',\n conditionId: 0,\n limit: 0,\n },\n debug: false,\n }\n) => {\n const RequestURL = new URL('v2/vsf/productCollection', context.config.api.url);\n const { data, status } = await context.client.request({\n method: 'POST',\n url: RequestURL.href,\n data: params,\n })\n const productCollection = (data?.data ?? [])\n return { data: groupProductResult(productCollection) };\n};\n","import { Endpoints, ProductListing } from '../../types';\nexport interface getProductListingTemplateParams {\n [key: string]: any,\n}\nexport interface getProductListingParams {\n collectionId: number | string,\n familyId: number | string,\n channelListingId: number | string,\n debug?: boolean,\n}\nexport interface getProductListingResponse {\n data: ProductListing[],\n}\nexport const getProductListing: Endpoints['getProductListing'] = async (\n context,\n params: getProductListingParams = {\n collectionId: 0,\n familyId: 0,\n channelListingId: 0,\n debug: false,\n }\n) => {\n const RequestURL = new URL('v2/vsf/product/variations', context.config.api.url);\n const { data, status } = await context.client.request({\n method: 'POST',\n url: RequestURL.href,\n data: params,\n })\n const productCollection = (data?.data ?? [])\n return { data: productCollection };\n};\n","import { Endpoints } from '../../types';\nimport { groupProductResult } from 'utils/elasticsearch/productGroup'\n\nexport interface proxyInstantsearchResponse {\n results: any[],\n}\n\nexport const proxyInstantsearch: Endpoints['proxyInstantsearch'] = async (\n context,\n ...searchRequests\n) => {\n // * Retrieve Brand & Category filters from Header\n const brandHeaderIndex = (context?.req?.rawHeaders ?? []).indexOf('x-brand-id')\n let brandId = 0\n if (brandHeaderIndex > -1) {\n brandId = (context?.req?.rawHeaders?.[brandHeaderIndex + 1] ?? 0)\n }\n const categoryHeaderIndex = (context?.req?.rawHeaders ?? []).indexOf('x-category-id')\n let categoryId = 0\n if (categoryHeaderIndex > -1) {\n categoryId = (context?.req?.rawHeaders?.[categoryHeaderIndex + 1] ?? 0)\n }\n\n const RequestURL = new URL('v2/searchkit/proxy', context.config.api.url);\n const { data, status } = await context.client.request({\n method: 'POST',\n url: RequestURL.href,\n headers: {\n 'X-Brand-Id': brandId,\n 'X-Category-Id': categoryId,\n },\n data: Array.isArray(searchRequests) ? searchRequests : [searchRequests],\n })\n const FormattedResults = data.results.map((result: any, index: number) => {\n if (index === 0 && (result?.hits ?? []).length > 0 && result.hits[0].id) {\n return {\n ...result,\n hits: groupProductResult(result.hits),\n }\n } else {\n return result\n }\n });\n return {\n results: FormattedResults,\n }\n};\n","import { Endpoints } from '../../types';\nexport interface getCollectionParams {\n collectionId: number\n}\nexport interface getCollectionResponse {\n data: any\n}\nexport const getCollection: Endpoints['getCollection'] = async (\n context,\n params = {\n collectionId: 0,\n },\n) => {\n const { collectionId = 0 } = params\n const RequestURL = new URL(`/blackfisk/collection/${collectionId}`, context.config.api.url);\n const { data, status } = await context.client.request({\n method: 'GET',\n url: RequestURL.href,\n })\n const Collection = (data?.data ?? [])\n return { data: (Collection?.[0] ?? null) };\n};\n","import { Endpoints } from '../../types';\n\nexport const getProductFacets: Endpoints['getProductFacets'] = async (\n context,\n params\n) => {\n const RequestURL = new URL(`/v2/vsf/product/facets`, context.config.api.url);\n const { data, status } = await context.client.request({\n method: 'GET',\n url: RequestURL.href,\n });\n const ProductFacets = (data?.data ?? []);\n return { data: ProductFacets };\n};\n","import axios from 'axios';\nimport { apiClientFactory } from '@vue-storefront/middleware';\nimport { MiddlewareConfig } from './index';\nimport * as apiEndpoints from './api';\n\n/**\n * In here you should create the client you'll use to communicate with the backend.\n * Axios is just an example.\n */\nconst buildClient = (settings: MiddlewareConfig) => {\n const defaultSettings = {\n accountId: 0,\n channelId: 0,\n accountSiteId: 0,\n baseURL: '',\n }\n const axiosInstance = axios.create({\n baseURL: settings.api.url || defaultSettings.baseURL,\n // baseURL: settings.api.url,\n headers: {\n 'X-Account-Id': settings.accountId || defaultSettings.accountId,\n 'X-Channel-Id': settings.channelId || defaultSettings.channelId,\n 'X-Site-Id': settings.accountSiteId || defaultSettings.accountSiteId,\n authorization: `${settings.api.auth_jwt || process.env.SECURITY_TOKEN || ''}`\n },\n });\n return axiosInstance\n}\n\nconst onCreate = (settings: MiddlewareConfig) => {\n const client = buildClient(settings);\n return {\n config: settings,\n client\n };\n};\n\nconst { createApiClient } = apiClientFactory<any, any>({\n onCreate,\n api: apiEndpoints,\n});\n\nexport { createApiClient };\n"],"names":["axios","apiClientFactory"],"mappings":";;;;;;;;;;;AAsBO,MAAM,kBAAkB,GAAG,CAAC,aAA+B,KAAI;IACpE,MAAM,sBAAsB,IAAuB,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;AACnH,IAAA,IAAI,sBAAsB,CAAC,MAAM,GAAG,CAAC,EAAE;AACrC,QAAA,MAAM,yBAAyB,GAAG,CAAC,qBAAoC,KAAI;YACzE,MAAM,YAAY,GAAG,qBAAqB,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAA;YAC7F,OAAO;gBACL,GAAG,EAAE,YAAY,CAAC,SAAS;gBAC3B,GAAG,EAAE,YAAY,CAAC,GAAG;gBACrB,GAAG,EAAE,YAAY,CAAC,GAAG;aACtB,CAAA;AACH,SAAC,CAAA;AACD,QAAA,MAAM,oBAAoB,GAAG,CAAC,qBAAoC,KAAI;YACpE,OAAO;gBACL,EAAE,EAAE,qBAAqB,CAAC,EAAE;gBAC5B,IAAI,EAAE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,IAAI,eAAe,CAAC,aAAa;AACpE,YAAA,aAAa,EAAE,CAAA,EAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAE,CAAA;AAC9E,SAAA;AACF,KAAA,CAAC,CAAC;AACH,IAAA,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,QAA0B,KAAI;AAC9C,IAAA,MAAM,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO;AACL,QAAA,MAAM,EAAE,QAAQ;QAChB,MAAM;KACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,EAAE,eAAe,EAAE,GAAGC,2BAAgB,CAAW;IACrD,QAAQ;AACR,IAAA,GAAG,EAAE,YAAY;AAClB,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/getProductCollection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,kCAAkC;IACjD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AACD,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,kCAAkC,CAAC;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AACD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,GAAG,EAAE,CAAC;CACb;AAED,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,sBAAsB,CA2BlE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/getProductCollection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,kCAAkC;IACjD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AACD,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,kCAAkC,CAAC;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AACD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,GAAG,EAAE,CAAC;CACb;AAED,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,sBAAsB,CA0BlE,CAAC"}
@@ -14,6 +14,11 @@ export interface SearchProductCondition {
14
14
  name: string;
15
15
  description: string;
16
16
  }
17
+ export interface Color {
18
+ color: string;
19
+ hex: string;
20
+ hsl: string;
21
+ }
17
22
  export interface SearchProductImage {
18
23
  url: string;
19
24
  public_id: string;
@@ -34,7 +39,7 @@ export interface SearchProduct {
34
39
  categoryIds: number[];
35
40
  categoryName: string;
36
41
  channelId: number;
37
- colors: [];
42
+ colors: Color[];
38
43
  condition: SearchProductCondition;
39
44
  description: string;
40
45
  familyId: number;
@@ -58,6 +63,20 @@ export interface SearchProduct {
58
63
  title: string;
59
64
  upc: string;
60
65
  }
66
+ export interface SearchProductHit {
67
+ _index: string;
68
+ _id: string;
69
+ _score: number;
70
+ _ignored: string[];
71
+ _source: SearchProduct;
72
+ inner_hits: {
73
+ family: {
74
+ hits: {
75
+ hits: SearchProduct[];
76
+ };
77
+ };
78
+ };
79
+ }
61
80
  export interface ProductListing {
62
81
  [key: string]: any;
63
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/types/api/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,IAAI,EAAE,sBAAsB,EAAE,CAAC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Aa,CAAC;IACvB,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,IAAI,EAAE,aAAa,EAAE,CAAC;aACvB,CAAA;SACF,CAAA;KACF,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AACD,cAAc,aAAa,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { SearchProductHit } from '@blackfisk/blackfisk-vue-storefront-api/src/types/api';
1
2
  export interface DisplayProductImage {
2
3
  src: string;
3
4
  url: string;
@@ -19,5 +20,5 @@ export interface DisplayProductGroup {
19
20
  groupPriceHigh: number;
20
21
  products: DisplayProduct[];
21
22
  }
22
- export declare const groupProductResult: (ProductResult: any) => unknown[];
23
+ export declare const groupProductResult: (ProductResult: SearchProductHit) => unknown[];
23
24
  //# sourceMappingURL=productGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"productGroup.d.ts","sourceRoot":"","sources":["../../../../../utils/elasticsearch/productGroup.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,mBAAmB,CAAC;CAC1B;AACD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AACD,eAAO,MAAM,kBAAkB,mCAmF9B,CAAA"}
1
+ {"version":3,"file":"productGroup.d.ts","sourceRoot":"","sources":["../../../../../utils/elasticsearch/productGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,uDAAuD,CAAA;AAC5G,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,mBAAmB,CAAC;CAC1B;AACD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AACD,eAAO,MAAM,kBAAkB,kBAAmB,gBAAgB,cAyGjE,CAAA"}