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

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.
Files changed (91) hide show
  1. package/lib/packages/api-client/src/api/getCollection/index.d.ts +9 -0
  2. package/lib/packages/api-client/src/api/getCollection/index.d.ts.map +1 -0
  3. package/{server → lib/packages/api-client/src}/api/getProductCollection/index.d.ts +6 -4
  4. package/lib/packages/api-client/src/api/getProductCollection/index.d.ts.map +1 -0
  5. package/lib/packages/api-client/src/api/getProductFacets/index.d.ts +3 -0
  6. package/lib/packages/api-client/src/api/getProductFacets/index.d.ts.map +1 -0
  7. package/lib/packages/api-client/src/api/getProductListing/index.d.ts +15 -0
  8. package/lib/packages/api-client/src/api/getProductListing/index.d.ts.map +1 -0
  9. package/lib/packages/api-client/src/api/index.d.ts +6 -0
  10. package/lib/packages/api-client/src/api/index.d.ts.map +1 -0
  11. package/lib/packages/api-client/src/api/proxyInstantsearch/index.d.ts +6 -0
  12. package/lib/packages/api-client/src/api/proxyInstantsearch/index.d.ts.map +1 -0
  13. package/lib/packages/api-client/src/index.d.ts.map +1 -0
  14. package/lib/packages/api-client/src/index.server.d.ts.map +1 -0
  15. package/lib/packages/api-client/src/types/api/endpoints.d.ts +20 -0
  16. package/lib/packages/api-client/src/types/api/endpoints.d.ts.map +1 -0
  17. package/lib/packages/api-client/src/types/api/index.d.ts +65 -0
  18. package/lib/packages/api-client/src/types/api/index.d.ts.map +1 -0
  19. package/lib/packages/api-client/src/types/config/index.d.ts.map +1 -0
  20. package/lib/packages/api-client/src/types/context/index.d.ts.map +1 -0
  21. package/lib/packages/api-client/src/types/index.d.ts.map +1 -0
  22. package/lib/utils/elasticsearch/productGroup.d.ts +23 -0
  23. package/lib/utils/elasticsearch/productGroup.d.ts.map +1 -0
  24. package/package.json +2 -2
  25. package/server/index.js +183 -33
  26. package/server/index.js.map +1 -1
  27. package/server/packages/api-client/src/api/getCollection/index.d.ts +9 -0
  28. package/server/packages/api-client/src/api/getCollection/index.d.ts.map +1 -0
  29. package/{lib → server/packages/api-client/src}/api/getProductCollection/index.d.ts +6 -4
  30. package/server/packages/api-client/src/api/getProductCollection/index.d.ts.map +1 -0
  31. package/server/packages/api-client/src/api/getProductFacets/index.d.ts +3 -0
  32. package/server/packages/api-client/src/api/getProductFacets/index.d.ts.map +1 -0
  33. package/server/packages/api-client/src/api/getProductListing/index.d.ts +15 -0
  34. package/server/packages/api-client/src/api/getProductListing/index.d.ts.map +1 -0
  35. package/server/packages/api-client/src/api/index.d.ts +6 -0
  36. package/server/packages/api-client/src/api/index.d.ts.map +1 -0
  37. package/server/packages/api-client/src/api/proxyInstantsearch/index.d.ts +6 -0
  38. package/server/packages/api-client/src/api/proxyInstantsearch/index.d.ts.map +1 -0
  39. package/server/packages/api-client/src/index.d.ts.map +1 -0
  40. package/server/packages/api-client/src/index.server.d.ts.map +1 -0
  41. package/server/packages/api-client/src/types/api/endpoints.d.ts +20 -0
  42. package/server/packages/api-client/src/types/api/endpoints.d.ts.map +1 -0
  43. package/server/packages/api-client/src/types/api/index.d.ts +65 -0
  44. package/server/packages/api-client/src/types/api/index.d.ts.map +1 -0
  45. package/server/packages/api-client/src/types/config/index.d.ts.map +1 -0
  46. package/server/packages/api-client/src/types/context/index.d.ts.map +1 -0
  47. package/server/packages/api-client/src/types/index.d.ts.map +1 -0
  48. package/server/utils/elasticsearch/productGroup.d.ts +23 -0
  49. package/server/utils/elasticsearch/productGroup.d.ts.map +1 -0
  50. package/lib/api/exampleEndpoint/index.d.ts +0 -3
  51. package/lib/api/exampleEndpoint/index.d.ts.map +0 -1
  52. package/lib/api/getPageContent/index.d.ts +0 -15
  53. package/lib/api/getPageContent/index.d.ts.map +0 -1
  54. package/lib/api/getProductCollection/index.d.ts.map +0 -1
  55. package/lib/api/index.d.ts +0 -4
  56. package/lib/api/index.d.ts.map +0 -1
  57. package/lib/index.d.ts.map +0 -1
  58. package/lib/index.server.d.ts.map +0 -1
  59. package/lib/types/api/endpoints.d.ts +0 -16
  60. package/lib/types/api/endpoints.d.ts.map +0 -1
  61. package/lib/types/api/index.d.ts +0 -2
  62. package/lib/types/api/index.d.ts.map +0 -1
  63. package/lib/types/config/index.d.ts.map +0 -1
  64. package/lib/types/context/index.d.ts.map +0 -1
  65. package/lib/types/index.d.ts.map +0 -1
  66. package/server/api/exampleEndpoint/index.d.ts +0 -3
  67. package/server/api/exampleEndpoint/index.d.ts.map +0 -1
  68. package/server/api/getPageContent/index.d.ts +0 -15
  69. package/server/api/getPageContent/index.d.ts.map +0 -1
  70. package/server/api/getProductCollection/index.d.ts.map +0 -1
  71. package/server/api/index.d.ts +0 -4
  72. package/server/api/index.d.ts.map +0 -1
  73. package/server/index.d.ts.map +0 -1
  74. package/server/index.server.d.ts.map +0 -1
  75. package/server/types/api/endpoints.d.ts +0 -16
  76. package/server/types/api/endpoints.d.ts.map +0 -1
  77. package/server/types/api/index.d.ts +0 -2
  78. package/server/types/api/index.d.ts.map +0 -1
  79. package/server/types/config/index.d.ts.map +0 -1
  80. package/server/types/context/index.d.ts.map +0 -1
  81. package/server/types/index.d.ts.map +0 -1
  82. /package/lib/{index.d.ts → packages/api-client/src/index.d.ts} +0 -0
  83. /package/lib/{index.server.d.ts → packages/api-client/src/index.server.d.ts} +0 -0
  84. /package/lib/{types → packages/api-client/src/types}/config/index.d.ts +0 -0
  85. /package/lib/{types → packages/api-client/src/types}/context/index.d.ts +0 -0
  86. /package/lib/{types → packages/api-client/src/types}/index.d.ts +0 -0
  87. /package/server/{index.d.ts → packages/api-client/src/index.d.ts} +0 -0
  88. /package/server/{index.server.d.ts → packages/api-client/src/index.server.d.ts} +0 -0
  89. /package/server/{types → packages/api-client/src/types}/config/index.d.ts +0 -0
  90. /package/server/{types → packages/api-client/src/types}/context/index.d.ts +0 -0
  91. /package/server/{types → packages/api-client/src/types}/index.d.ts +0 -0
@@ -0,0 +1,9 @@
1
+ import { Endpoints } from '../../types';
2
+ export interface getCollectionParams {
3
+ collectionId: number;
4
+ }
5
+ export interface getCollectionResponse {
6
+ data: any;
7
+ }
8
+ export declare const getCollection: Endpoints['getCollection'];
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/getCollection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAA;CACrB;AACD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,GAAG,CAAA;CACV;AACD,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,eAAe,CAcpD,CAAC"}
@@ -1,12 +1,14 @@
1
1
  import { Endpoints } from '../../types';
2
+ export interface getProductCollectionTemplateParams {
3
+ [key: string]: any;
4
+ }
2
5
  export interface getProductCollectionParams {
3
6
  collectionId: number | string;
7
+ templateParams?: getProductCollectionTemplateParams;
8
+ debug?: boolean;
4
9
  }
5
10
  export interface getProductCollectionResponse {
6
- data: {
7
- content: {};
8
- meta: {};
9
- };
11
+ data: any[];
10
12
  }
11
13
  export declare const getProductCollection: Endpoints['getProductCollection'];
12
14
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ import { Endpoints } from '../../types';
2
+ export declare const getProductFacets: Endpoints['getProductFacets'];
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/getProductFacets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,kBAAkB,CAW1D,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Endpoints, ProductListing } from '../../types';
2
+ export interface getProductListingTemplateParams {
3
+ [key: string]: any;
4
+ }
5
+ export interface getProductListingParams {
6
+ collectionId: number | string;
7
+ familyId: number | string;
8
+ channelListingId: number | string;
9
+ debug?: boolean;
10
+ }
11
+ export interface getProductListingResponse {
12
+ data: ProductListing[];
13
+ }
14
+ export declare const getProductListing: Endpoints['getProductListing'];
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/getProductListing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,MAAM,WAAW,+BAA+B;IAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AACD,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AACD,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,cAAc,EAAE,CAAC;CACxB;AACD,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,mBAAmB,CAiB5D,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { getProductCollection } from './getProductCollection';
2
+ export { getProductListing } from './getProductListing';
3
+ export { proxyInstantsearch } from './proxyInstantsearch';
4
+ export { getCollection } from './getCollection';
5
+ export { getProductFacets } from './getProductFacets';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Endpoints } from '../../types';
2
+ export interface proxyInstantsearchResponse {
3
+ results: any[];
4
+ }
5
+ export declare const proxyInstantsearch: Endpoints['proxyInstantsearch'];
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/proxyInstantsearch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,GAAG,EAAE,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,oBAAoB,CAuC9D,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../../../src/index.server.ts"],"names":[],"mappings":"AAqCA,QAAA,MAAQ,eAAe,kEAGrB,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { BfskIntegrationContext, TODO } from '..';
2
+ import { getProductCollectionParams, getProductCollectionResponse } from '../../api/getProductCollection/index';
3
+ import { getProductListingParams, getProductListingResponse } from '../../api/getProductListing/index';
4
+ import { proxyInstantsearchResponse } from '../../api/proxyInstantsearch/index';
5
+ import { getCollectionParams, getCollectionResponse } from '../../api/getCollection/index';
6
+ /**
7
+ * Definition of all API-client methods available in {@link https://docs.vuestorefront.io/v2/advanced/context.html#context-api | context}.
8
+ */
9
+ export interface Endpoints {
10
+ /**
11
+ * Here you can find an example endpoint definition. Based on this example, you should define how your endpoint will look like.
12
+ * This description will appear in the API extractor, so try to document all endpoints added here.
13
+ */
14
+ getProductCollection(context: BfskIntegrationContext, params: getProductCollectionParams): Promise<getProductCollectionResponse>;
15
+ getProductListing(context: BfskIntegrationContext, params: getProductListingParams): Promise<getProductListingResponse>;
16
+ proxyInstantsearch(context: BfskIntegrationContext, params: any): Promise<proxyInstantsearchResponse>;
17
+ getCollection(context: BfskIntegrationContext, params: getCollectionParams): Promise<getCollectionResponse>;
18
+ getProductFacets(context: BfskIntegrationContext, params: TODO): Promise<TODO>;
19
+ }
20
+ //# sourceMappingURL=endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../../../../src/types/api/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AACjD,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAA;AAC/G,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AACtG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAA;AAC/E,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAE1F;;GAEG;AACH,MAAM,WAAW,SAAS;IAExB;;;OAGG;IACH,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACjI,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACxH,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACtG,aAAa,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC5G,gBAAgB,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF"}
@@ -0,0 +1,65 @@
1
+ export interface SearchProductAttribute {
2
+ id: number;
3
+ name: string;
4
+ valueJSON: string;
5
+ }
6
+ export interface SearchProductAttributeTypes {
7
+ facets: SearchProductAttribute[];
8
+ misc: SearchProductAttribute[];
9
+ specifications: SearchProductAttribute[];
10
+ variants: SearchProductAttribute[];
11
+ }
12
+ export interface SearchProductCondition {
13
+ id: number;
14
+ name: string;
15
+ description: string;
16
+ }
17
+ export interface SearchProductImage {
18
+ url: string;
19
+ public_id: string;
20
+ isPrimary: number;
21
+ alt: string;
22
+ }
23
+ export interface SearchProductMeta {
24
+ }
25
+ export interface SearchProduct {
26
+ id: number;
27
+ accountId: number;
28
+ attributeListValues: string[];
29
+ attributeValues: string[];
30
+ attributes: SearchProductAttributeTypes;
31
+ brandId: number;
32
+ brandName: string;
33
+ categories: string[];
34
+ categoryIds: number[];
35
+ categoryName: string;
36
+ channelId: number;
37
+ colors: [];
38
+ condition: SearchProductCondition;
39
+ description: string;
40
+ familyId: number;
41
+ features: string[];
42
+ heading: string;
43
+ images: SearchProductImage[];
44
+ imagesCount: number;
45
+ isAvailable: boolean;
46
+ keywords: string[];
47
+ meta: SearchProductMeta;
48
+ metaDescription: string;
49
+ mpn: string;
50
+ parentName: string;
51
+ priceMAP: number;
52
+ priceSale: number;
53
+ pricingStrategy: string;
54
+ productName: string;
55
+ quantity: number;
56
+ sku: string;
57
+ slug: string;
58
+ title: string;
59
+ upc: string;
60
+ }
61
+ export interface ProductListing {
62
+ [key: string]: any;
63
+ }
64
+ export * from './endpoints';
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,eAAe,EAAE,MAA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QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,gBAAgB;IAE/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,mBAAmB,CAAC;CAC1B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/types/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAErE;;IAEI;AACJ,oBAAY,sBAAsB,GAAG,kBAAkB,CACrD,aAAa,EACb,gBAAgB,EAChB,uBAAuB,CACxB,CAAC;AAEF;;IAEI;AACJ,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,sBAAsB,CAAC;CAC/B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;GAEG;AACH,oBAAY,uBAAuB,GAAG;KACnC,CAAC,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAC3C,CAAC,EAAE,GAAG,EACN,GAAG,IAAI,EAAE,MAAM,CAAC,KACb,MAAM,CAAC,GACR,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GACjB,KAAK;CACV,CAAC;AAEF,oBAAY,IAAI,GAAG,GAAG,CAAC;AAEvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface DisplayProductImage {
2
+ src: string;
3
+ url: string;
4
+ alt: string;
5
+ }
6
+ export interface DisplayProduct {
7
+ id: number;
8
+ slug: string;
9
+ name: string;
10
+ groupId: number;
11
+ price: string;
12
+ img: DisplayProductImage;
13
+ }
14
+ export interface DisplayProductGroup {
15
+ groupId: number;
16
+ groupName: string;
17
+ brandName: string;
18
+ groupPriceLow: number;
19
+ groupPriceHigh: number;
20
+ products: DisplayProduct[];
21
+ }
22
+ export declare const groupProductResult: (ProductResult: any) => unknown[];
23
+ //# sourceMappingURL=productGroup.d.ts.map
@@ -0,0 +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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blackfisk/blackfisk-vue-storefront-api",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
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": "094c3d4d430d37b78ae5085ccbe6629ac79a8baf"
31
+ "gitHead": "d644c181a9276e1f6613eb0a7afd252077bedf55"
32
32
  }
package/server/index.js CHANGED
@@ -9,55 +9,206 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
11
11
 
12
- const exampleEndpoint = async (context, params) => {
13
- console.log('exampleEndpoint has been called');
14
- // Example request could look like this:
15
- // return await context.client.get(`example-url?id=${params.id}`);
16
- return { data: 'Hello, Vue Storefront Integrator!' };
12
+ const groupProductResult = (ProductResult) => {
13
+ const ProductCollectionItems = (Array.isArray(ProductResult) ? ProductResult : [ProductResult]);
14
+ if (ProductCollectionItems.length > 0) {
15
+ const formatDisplayProductImage = (ProductCollectionItem) => {
16
+ const primaryImage = ProductCollectionItem.images?.[0] ?? { public_id: '', alt: '', url: '' };
17
+ return {
18
+ src: primaryImage.public_id,
19
+ url: primaryImage.url,
20
+ alt: primaryImage.alt,
21
+ };
22
+ };
23
+ const formatDisplayProduct = (ProductCollectionItem) => {
24
+ return {
25
+ id: ProductCollectionItem.id,
26
+ slug: ProductCollectionItem.slug,
27
+ name: ProductCollectionItem.heading || ProductCollectionItem.productName,
28
+ price: `$${ProductCollectionItem.priceSale}`,
29
+ groupId: ProductCollectionItem.familyId,
30
+ img: formatDisplayProductImage(ProductCollectionItem),
31
+ };
32
+ };
33
+ const isGroupRepresented = {};
34
+ let sortOrder = 0;
35
+ 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;
41
+ sortOrder++;
42
+ accumulator['groups'][ProductCollectionItem.familyId] = {
43
+ groupId: ProductCollectionItem.familyId,
44
+ groupName: ProductCollectionItem.parentName,
45
+ brandName: ProductCollectionItem.brandName,
46
+ groupPriceLow: ProductCollectionItem.priceSale,
47
+ groupPriceHigh: ProductCollectionItem.priceSale,
48
+ products: [formatDisplayProduct(ProductCollectionItem)],
49
+ };
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;
57
+ }
58
+ accumulator['groups'][ProductCollectionItem.familyId].products.push(formatDisplayProduct(ProductCollectionItem));
59
+ }
60
+ }
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
+ return accumulator;
75
+ }, {
76
+ groups: {},
77
+ sort: {},
78
+ });
79
+ const SortedGroups = Object.entries(DisplayFamilies['groups'])
80
+ .sort(([firstKey, firstVal], [secondKey, secondVal]) => {
81
+ const firstElSort = DisplayFamilies['sort'][firstKey];
82
+ const secondElSort = DisplayFamilies['sort'][secondKey];
83
+ if (firstElSort < secondElSort) {
84
+ return -1;
85
+ }
86
+ else if (firstElSort > secondElSort) {
87
+ return 1;
88
+ }
89
+ else {
90
+ return 0;
91
+ }
92
+ })
93
+ .map(([groupId, group]) => group);
94
+ // console.log({SortedGroups})
95
+ return SortedGroups;
96
+ }
97
+ else {
98
+ return [];
99
+ }
17
100
  };
18
101
 
19
- const getPageContent = async (context, params) => {
20
- console.log('getPageContent has been called. It\'s now updated.');
21
- const RequestURL = new URL('v2/vsf/cms/pageContent', context.config.api.url);
22
- for (const param in params) {
23
- RequestURL.searchParams.set(param, params[param]);
24
- }
25
- console.log({ RequestURL });
102
+ const getProductCollection = async (context, params = {
103
+ collectionId: 0,
104
+ templateParams: {
105
+ id: 0,
106
+ ids: [],
107
+ term: '',
108
+ familyId: 0,
109
+ categoryId: 0,
110
+ brandId: 0,
111
+ pricingStrategy: '',
112
+ conditionId: 0,
113
+ limit: 0,
114
+ },
115
+ debug: false,
116
+ }) => {
117
+ const RequestURL = new URL('v2/vsf/productCollection', context.config.api.url);
26
118
  const { data, status } = await context.client.request({
27
- method: 'GET',
119
+ method: 'POST',
28
120
  url: RequestURL.href,
121
+ data: params,
29
122
  });
30
- console.log({ status, PageContentResponse: data });
31
- const PageContent = data?.data?.[0] ?? {};
32
- console.log({ PageContent });
33
- return { data: PageContent };
123
+ const productCollection = (data?.data ?? []);
124
+ // console.log(productCollection)
125
+ return { data: groupProductResult(productCollection) };
34
126
  };
35
127
 
36
- const getProductCollection = async (context, params) => {
37
- console.log('getProductCollection has been called. It\'s now updated.');
38
- const RequestURL = new URL('v2/vsf/productCollection', context.config.api.url);
39
- if (!('collectionId' in params)) {
40
- params['collectionId'] = 145;
128
+ const getProductListing = async (context, params = {
129
+ collectionId: 0,
130
+ familyId: 0,
131
+ channelListingId: 0,
132
+ debug: false,
133
+ }) => {
134
+ const RequestURL = new URL('v2/vsf/product/variations', context.config.api.url);
135
+ const { data, status } = await context.client.request({
136
+ method: 'POST',
137
+ url: RequestURL.href,
138
+ data: params,
139
+ });
140
+ const productCollection = (data?.data ?? []);
141
+ return { data: productCollection };
142
+ };
143
+
144
+ const proxyInstantsearch = async (context, ...searchRequests) => {
145
+ // * Retrieve Brand & Category filters from Header
146
+ const brandHeaderIndex = (context?.req?.rawHeaders ?? []).indexOf('x-brand-id');
147
+ let brandId = 0;
148
+ if (brandHeaderIndex > -1) {
149
+ brandId = (context?.req?.rawHeaders?.[brandHeaderIndex + 1] ?? 0);
41
150
  }
42
- for (const param in params) {
43
- RequestURL.searchParams.set(param, params[param]);
151
+ const categoryHeaderIndex = (context?.req?.rawHeaders ?? []).indexOf('x-category-id');
152
+ let categoryId = 0;
153
+ if (categoryHeaderIndex > -1) {
154
+ categoryId = (context?.req?.rawHeaders?.[categoryHeaderIndex + 1] ?? 0);
44
155
  }
45
- console.log({ RequestURL });
156
+ const RequestURL = new URL('v2/searchkit/proxy', context.config.api.url);
157
+ const { data, status } = await context.client.request({
158
+ method: 'POST',
159
+ url: RequestURL.href,
160
+ headers: {
161
+ 'X-Brand-Id': brandId,
162
+ 'X-Category-Id': categoryId,
163
+ },
164
+ data: Array.isArray(searchRequests) ? searchRequests : [searchRequests],
165
+ });
166
+ const FormattedResults = data.results.map((result, index) => {
167
+ if (index === 0 && (result?.hits ?? []).length > 0 && result.hits[0].id) {
168
+ return {
169
+ ...result,
170
+ hits: groupProductResult(result.hits),
171
+ };
172
+ }
173
+ else {
174
+ return result;
175
+ }
176
+ });
177
+ return {
178
+ results: FormattedResults,
179
+ };
180
+ };
181
+
182
+ const getCollection = async (context, params = {
183
+ collectionId: 0,
184
+ }) => {
185
+ const { collectionId = 0 } = params;
186
+ const RequestURL = new URL(`/blackfisk/collection/${collectionId}`, context.config.api.url);
187
+ const { data, status } = await context.client.request({
188
+ method: 'GET',
189
+ url: RequestURL.href,
190
+ });
191
+ const Collection = (data?.data ?? []);
192
+ return { data: (Collection?.[0] ?? null) };
193
+ };
194
+
195
+ const getProductFacets = async (context, params) => {
196
+ const RequestURL = new URL(`/v2/vsf/product/facets`, context.config.api.url);
46
197
  const { data, status } = await context.client.request({
47
198
  method: 'GET',
48
199
  url: RequestURL.href,
49
200
  });
50
- console.log({ status, PageContentResponse: data });
51
- const PageContent = data?.data?.[0] ?? {};
52
- console.log({ PageContent });
53
- return { data: PageContent };
201
+ const ProductFacets = (data?.data ?? []);
202
+ return { data: ProductFacets };
54
203
  };
55
204
 
56
205
  var apiEndpoints = /*#__PURE__*/Object.freeze({
57
206
  __proto__: null,
58
- exampleEndpoint: exampleEndpoint,
59
- getPageContent: getPageContent,
60
- getProductCollection: getProductCollection
207
+ getProductCollection: getProductCollection,
208
+ getProductListing: getProductListing,
209
+ proxyInstantsearch: proxyInstantsearch,
210
+ getCollection: getCollection,
211
+ getProductFacets: getProductFacets
61
212
  });
62
213
 
63
214
  /**
@@ -84,7 +235,6 @@ const buildClient = (settings) => {
84
235
  return axiosInstance;
85
236
  };
86
237
  const onCreate = (settings) => {
87
- console.log({ settings });
88
238
  const client = buildClient(settings);
89
239
  return {
90
240
  config: settings,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/api/exampleEndpoint/index.ts","../src/api/getPageContent/index.ts","../src/api/getProductCollection/index.ts","../src/index.server.ts"],"sourcesContent":["import { Endpoints } from '../../types';\n\nexport const exampleEndpoint: Endpoints['exampleEndpoint'] = async (\n context,\n params\n) => {\n console.log('exampleEndpoint has been called');\n\n // Example request could look like this:\n // return await context.client.get(`example-url?id=${params.id}`);\n return { data: 'Hello, Vue Storefront Integrator!' };\n};\n","import { Endpoints } from '../../types';\nexport interface getPageContentParams {\n typeId: number,\n referenceId: string,\n collectionId: number,\n slug: string,\n}\nexport interface getPageContentResponse {\n data: {\n content: {},\n meta: {},\n },\n}\nexport const getPageContent: Endpoints['getPageContent'] = async (\n context,\n params: getPageContentParams\n) => {\n console.log('getPageContent has been called. It\\'s now updated.');\n const RequestURL = new URL('v2/vsf/cms/pageContent', context.config.api.url);\n for (const param in params) {\n RequestURL.searchParams.set(param, params[param]);\n }\n console.log({RequestURL})\n const { data, status } = await context.client.request({\n method: 'GET',\n url: RequestURL.href,\n })\n console.log({status, PageContentResponse: data})\n const PageContent = data?.data?.[0] ?? {}\n console.log({PageContent})\n return { data: PageContent };\n};\n","import { Endpoints } from '../../types';\nexport interface getProductCollectionParams {\n collectionId: number | string,\n}\nexport interface getProductCollectionResponse {\n data: {\n content: {},\n meta: {},\n },\n}\nexport const getProductCollection: Endpoints['getProductCollection'] = async (\n context,\n params: getProductCollectionParams\n) => {\n console.log('getProductCollection has been called. It\\'s now updated.');\n const RequestURL = new URL('v2/vsf/productCollection', context.config.api.url);\n if (!('collectionId' in params)) {\n params['collectionId'] = 145\n }\n for (const param in params) {\n RequestURL.searchParams.set(param, params[param]);\n }\n console.log({RequestURL})\n const { data, status } = await context.client.request({\n method: 'GET',\n url: RequestURL.href,\n })\n console.log({status, PageContentResponse: data})\n const PageContent = data?.data?.[0] ?? {}\n console.log({PageContent})\n return { data: PageContent };\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 console.log({settings});\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":";;;;;;;;;;;AAEO,MAAM,eAAe,GAAiC,OAC3D,O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GAAG,CAAC,GAAG,IAAI,eAAe,CAAC,OAAO;;AAEpD,QAAA,OAAO,EAAE;AACP,YAAA,cAAc,EAAE,QAAQ,CAAC,SAAS,IAAI,eAAe,CAAC,SAAS;AAC/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,OAAO,CAAC,GAAG,CAAC,EAAC,QAAQ,EAAC,CAAC,CAAC;AACxB,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 { 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 }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Y;AAClB,CAAA;;;;"}
@@ -0,0 +1,9 @@
1
+ import { Endpoints } from '../../types';
2
+ export interface getCollectionParams {
3
+ collectionId: number;
4
+ }
5
+ export interface getCollectionResponse {
6
+ data: any;
7
+ }
8
+ export declare const getCollection: Endpoints['getCollection'];
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/getCollection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAA;CACrB;AACD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,GAAG,CAAA;CACV;AACD,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,eAAe,CAcpD,CAAC"}
@@ -1,12 +1,14 @@
1
1
  import { Endpoints } from '../../types';
2
+ export interface getProductCollectionTemplateParams {
3
+ [key: string]: any;
4
+ }
2
5
  export interface getProductCollectionParams {
3
6
  collectionId: number | string;
7
+ templateParams?: getProductCollectionTemplateParams;
8
+ debug?: boolean;
4
9
  }
5
10
  export interface getProductCollectionResponse {
6
- data: {
7
- content: {};
8
- meta: {};
9
- };
11
+ data: any[];
10
12
  }
11
13
  export declare const getProductCollection: Endpoints['getProductCollection'];
12
14
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ import { Endpoints } from '../../types';
2
+ export declare const getProductFacets: Endpoints['getProductFacets'];
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/getProductFacets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,kBAAkB,CAW1D,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Endpoints, ProductListing } from '../../types';
2
+ export interface getProductListingTemplateParams {
3
+ [key: string]: any;
4
+ }
5
+ export interface getProductListingParams {
6
+ collectionId: number | string;
7
+ familyId: number | string;
8
+ channelListingId: number | string;
9
+ debug?: boolean;
10
+ }
11
+ export interface getProductListingResponse {
12
+ data: ProductListing[];
13
+ }
14
+ export declare const getProductListing: Endpoints['getProductListing'];
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/getProductListing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,MAAM,WAAW,+BAA+B;IAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AACD,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AACD,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,cAAc,EAAE,CAAC;CACxB;AACD,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,mBAAmB,CAiB5D,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { getProductCollection } from './getProductCollection';
2
+ export { getProductListing } from './getProductListing';
3
+ export { proxyInstantsearch } from './proxyInstantsearch';
4
+ export { getCollection } from './getCollection';
5
+ export { getProductFacets } from './getProductFacets';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Endpoints } from '../../types';
2
+ export interface proxyInstantsearchResponse {
3
+ results: any[];
4
+ }
5
+ export declare const proxyInstantsearch: Endpoints['proxyInstantsearch'];
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/proxyInstantsearch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,GAAG,EAAE,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,oBAAoB,CAuC9D,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../../../src/index.server.ts"],"names":[],"mappings":"AAqCA,QAAA,MAAQ,eAAe,kEAGrB,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { BfskIntegrationContext, TODO } from '..';
2
+ import { getProductCollectionParams, getProductCollectionResponse } from '../../api/getProductCollection/index';
3
+ import { getProductListingParams, getProductListingResponse } from '../../api/getProductListing/index';
4
+ import { proxyInstantsearchResponse } from '../../api/proxyInstantsearch/index';
5
+ import { getCollectionParams, getCollectionResponse } from '../../api/getCollection/index';
6
+ /**
7
+ * Definition of all API-client methods available in {@link https://docs.vuestorefront.io/v2/advanced/context.html#context-api | context}.
8
+ */
9
+ export interface Endpoints {
10
+ /**
11
+ * Here you can find an example endpoint definition. Based on this example, you should define how your endpoint will look like.
12
+ * This description will appear in the API extractor, so try to document all endpoints added here.
13
+ */
14
+ getProductCollection(context: BfskIntegrationContext, params: getProductCollectionParams): Promise<getProductCollectionResponse>;
15
+ getProductListing(context: BfskIntegrationContext, params: getProductListingParams): Promise<getProductListingResponse>;
16
+ proxyInstantsearch(context: BfskIntegrationContext, params: any): Promise<proxyInstantsearchResponse>;
17
+ getCollection(context: BfskIntegrationContext, params: getCollectionParams): Promise<getCollectionResponse>;
18
+ getProductFacets(context: BfskIntegrationContext, params: TODO): Promise<TODO>;
19
+ }
20
+ //# sourceMappingURL=endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../../../../src/types/api/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AACjD,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAA;AAC/G,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AACtG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAA;AAC/E,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAE1F;;GAEG;AACH,MAAM,WAAW,SAAS;IAExB;;;OAGG;IACH,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACjI,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACxH,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACtG,aAAa,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC5G,gBAAgB,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF"}
@@ -0,0 +1,65 @@
1
+ export interface SearchProductAttribute {
2
+ id: number;
3
+ name: string;
4
+ valueJSON: string;
5
+ }
6
+ export interface SearchProductAttributeTypes {
7
+ facets: SearchProductAttribute[];
8
+ misc: SearchProductAttribute[];
9
+ specifications: SearchProductAttribute[];
10
+ variants: SearchProductAttribute[];
11
+ }
12
+ export interface SearchProductCondition {
13
+ id: number;
14
+ name: string;
15
+ description: string;
16
+ }
17
+ export interface SearchProductImage {
18
+ url: string;
19
+ public_id: string;
20
+ isPrimary: number;
21
+ alt: string;
22
+ }
23
+ export interface SearchProductMeta {
24
+ }
25
+ export interface SearchProduct {
26
+ id: number;
27
+ accountId: number;
28
+ attributeListValues: string[];
29
+ attributeValues: string[];
30
+ attributes: SearchProductAttributeTypes;
31
+ brandId: number;
32
+ brandName: string;
33
+ categories: string[];
34
+ categoryIds: number[];
35
+ categoryName: string;
36
+ channelId: number;
37
+ colors: [];
38
+ condition: SearchProductCondition;
39
+ description: string;
40
+ familyId: number;
41
+ features: string[];
42
+ heading: string;
43
+ images: SearchProductImage[];
44
+ imagesCount: number;
45
+ isAvailable: boolean;
46
+ keywords: string[];
47
+ meta: SearchProductMeta;
48
+ metaDescription: string;
49
+ mpn: string;
50
+ parentName: string;
51
+ priceMAP: number;
52
+ priceSale: number;
53
+ pricingStrategy: string;
54
+ productName: string;
55
+ quantity: number;
56
+ sku: string;
57
+ slug: string;
58
+ title: string;
59
+ upc: string;
60
+ }
61
+ export interface ProductListing {
62
+ [key: string]: any;
63
+ }
64
+ export * from './endpoints';
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM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AAA;;GAEG;AACH,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,gBAAgB;IAE/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,mBAAmB,CAAC;CAC1B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/types/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAErE;;IAEI;AACJ,oBAAY,sBAAsB,GAAG,kBAAkB,CACrD,aAAa,EACb,gBAAgB,EAChB,uBAAuB,CACxB,CAAC;AAEF;;IAEI;AACJ,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,sBAAsB,CAAC;CAC/B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;GAEG;AACH,oBAAY,uBAAuB,GAAG;KACnC,CAAC,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAC3C,CAAC,EAAE,GAAG,EACN,GAAG,IAAI,EAAE,MAAM,CAAC,KACb,MAAM,CAAC,GACR,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GACjB,KAAK;CACV,CAAC;AAEF,oBAAY,IAAI,GAAG,GAAG,CAAC;AAEvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface DisplayProductImage {
2
+ src: string;
3
+ url: string;
4
+ alt: string;
5
+ }
6
+ export interface DisplayProduct {
7
+ id: number;
8
+ slug: string;
9
+ name: string;
10
+ groupId: number;
11
+ price: string;
12
+ img: DisplayProductImage;
13
+ }
14
+ export interface DisplayProductGroup {
15
+ groupId: number;
16
+ groupName: string;
17
+ brandName: string;
18
+ groupPriceLow: number;
19
+ groupPriceHigh: number;
20
+ products: DisplayProduct[];
21
+ }
22
+ export declare const groupProductResult: (ProductResult: any) => unknown[];
23
+ //# sourceMappingURL=productGroup.d.ts.map
@@ -0,0 +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,3 +0,0 @@
1
- import { Endpoints } from '../../types';
2
- export declare const exampleEndpoint: Endpoints['exampleEndpoint'];
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/exampleEndpoint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,iBAAiB,CASxD,CAAC"}
@@ -1,15 +0,0 @@
1
- import { Endpoints } from '../../types';
2
- export interface getPageContentParams {
3
- typeId: number;
4
- referenceId: string;
5
- collectionId: number;
6
- slug: string;
7
- }
8
- export interface getPageContentResponse {
9
- data: {
10
- content: {};
11
- meta: {};
12
- };
13
- }
14
- export declare const getPageContent: Endpoints['getPageContent'];
15
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/getPageContent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE,CAAC;QACZ,IAAI,EAAE,EAAE,CAAC;KACV,CAAC;CACH;AACD,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,gBAAgB,CAkBtD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/getProductCollection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AACD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE,CAAC;QACZ,IAAI,EAAE,EAAE,CAAC;KACV,CAAC;CACH;AACD,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,sBAAsB,CAqBlE,CAAC"}
@@ -1,4 +0,0 @@
1
- export { exampleEndpoint } from './exampleEndpoint';
2
- export { getPageContent } from './getPageContent';
3
- export { getProductCollection } from './getProductCollection';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../src/index.server.ts"],"names":[],"mappings":"AAsCA,QAAA,MAAQ,eAAe,kEAGrB,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,16 +0,0 @@
1
- import { BfskIntegrationContext, TODO } from '..';
2
- import { getPageContentParams, getPageContentResponse } from '../../api/getPageContent/index';
3
- import { getProductCollectionParams, getProductCollectionResponse } from '../../api/getProductCollection/index';
4
- /**
5
- * Definition of all API-client methods available in {@link https://docs.vuestorefront.io/v2/advanced/context.html#context-api | context}.
6
- */
7
- export interface Endpoints {
8
- /**
9
- * Here you can find an example endpoint definition. Based on this example, you should define how your endpoint will look like.
10
- * This description will appear in the API extractor, so try to document all endpoints added here.
11
- */
12
- exampleEndpoint(context: BfskIntegrationContext, params: TODO): Promise<TODO>;
13
- getPageContent(context: BfskIntegrationContext, params: getPageContentParams): Promise<getPageContentResponse>;
14
- getProductCollection(context: BfskIntegrationContext, params: getProductCollectionParams): Promise<getProductCollectionResponse>;
15
- }
16
- //# sourceMappingURL=endpoints.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/types/api/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAC7F,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAA;AAE/G;;GAEG;AACH,MAAM,WAAW,SAAS;IAExB;;;OAGG;IACH,eAAe,CACb,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,IAAI,GACX,OAAO,CAAC,IAAI,CAAC,CAAC;IACf,cAAc,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC/G,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;CACpI"}
@@ -1,2 +0,0 @@
1
- export * from './endpoints';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,gBAAgB;IAE/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,mBAAmB,CAAC;CAC1B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAErE;;IAEI;AACJ,oBAAY,sBAAsB,GAAG,kBAAkB,CACrD,aAAa,EACb,gBAAgB,EAChB,uBAAuB,CACxB,CAAC;AAEF;;IAEI;AACJ,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,sBAAsB,CAAC;CAC/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;GAEG;AACH,oBAAY,uBAAuB,GAAG;KACnC,CAAC,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAC3C,CAAC,EAAE,GAAG,EACN,GAAG,IAAI,EAAE,MAAM,CAAC,KACb,MAAM,CAAC,GACR,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GACjB,KAAK;CACV,CAAC;AAEF,oBAAY,IAAI,GAAG,GAAG,CAAC;AAEvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Endpoints } from '../../types';
2
- export declare const exampleEndpoint: Endpoints['exampleEndpoint'];
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/exampleEndpoint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,iBAAiB,CASxD,CAAC"}
@@ -1,15 +0,0 @@
1
- import { Endpoints } from '../../types';
2
- export interface getPageContentParams {
3
- typeId: number;
4
- referenceId: string;
5
- collectionId: number;
6
- slug: string;
7
- }
8
- export interface getPageContentResponse {
9
- data: {
10
- content: {};
11
- meta: {};
12
- };
13
- }
14
- export declare const getPageContent: Endpoints['getPageContent'];
15
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/getPageContent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE,CAAC;QACZ,IAAI,EAAE,EAAE,CAAC;KACV,CAAC;CACH;AACD,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,gBAAgB,CAkBtD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/getProductCollection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AACD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE,CAAC;QACZ,IAAI,EAAE,EAAE,CAAC;KACV,CAAC;CACH;AACD,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,sBAAsB,CAqBlE,CAAC"}
@@ -1,4 +0,0 @@
1
- export { exampleEndpoint } from './exampleEndpoint';
2
- export { getPageContent } from './getPageContent';
3
- export { getProductCollection } from './getProductCollection';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../src/index.server.ts"],"names":[],"mappings":"AAsCA,QAAA,MAAQ,eAAe,kEAGrB,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,16 +0,0 @@
1
- import { BfskIntegrationContext, TODO } from '..';
2
- import { getPageContentParams, getPageContentResponse } from '../../api/getPageContent/index';
3
- import { getProductCollectionParams, getProductCollectionResponse } from '../../api/getProductCollection/index';
4
- /**
5
- * Definition of all API-client methods available in {@link https://docs.vuestorefront.io/v2/advanced/context.html#context-api | context}.
6
- */
7
- export interface Endpoints {
8
- /**
9
- * Here you can find an example endpoint definition. Based on this example, you should define how your endpoint will look like.
10
- * This description will appear in the API extractor, so try to document all endpoints added here.
11
- */
12
- exampleEndpoint(context: BfskIntegrationContext, params: TODO): Promise<TODO>;
13
- getPageContent(context: BfskIntegrationContext, params: getPageContentParams): Promise<getPageContentResponse>;
14
- getProductCollection(context: BfskIntegrationContext, params: getProductCollectionParams): Promise<getProductCollectionResponse>;
15
- }
16
- //# sourceMappingURL=endpoints.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/types/api/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAC7F,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAA;AAE/G;;GAEG;AACH,MAAM,WAAW,SAAS;IAExB;;;OAGG;IACH,eAAe,CACb,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,IAAI,GACX,OAAO,CAAC,IAAI,CAAC,CAAC;IACf,cAAc,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC/G,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;CACpI"}
@@ -1,2 +0,0 @@
1
- export * from './endpoints';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,gBAAgB;IAE/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,mBAAmB,CAAC;CAC1B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAErE;;IAEI;AACJ,oBAAY,sBAAsB,GAAG,kBAAkB,CACrD,aAAa,EACb,gBAAgB,EAChB,uBAAuB,CACxB,CAAC;AAEF;;IAEI;AACJ,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,sBAAsB,CAAC;CAC/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;GAEG;AACH,oBAAY,uBAAuB,GAAG;KACnC,CAAC,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAC3C,CAAC,EAAE,GAAG,EACN,GAAG,IAAI,EAAE,MAAM,CAAC,KACb,MAAM,CAAC,GACR,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GACjB,KAAK;CACV,CAAC;AAEF,oBAAY,IAAI,GAAG,GAAG,CAAC;AAEvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}