@jay-framework/wix-stores-v1 0.18.4 → 0.19.3

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.
@@ -37,6 +37,7 @@ tags:
37
37
  type: data
38
38
  dataType: string
39
39
  description: Category image URL
40
+ meta: {mediaType: wix-image}
40
41
 
41
42
  - tag: hasImage
42
43
  type: variant
@@ -58,17 +58,18 @@ tags:
58
58
  type: data
59
59
  dataType: string
60
60
  description: Media URL
61
-
61
+ meta: {mediaType: wix-image}
62
+
62
63
  - tag: altText
63
64
  type: data
64
65
  dataType: string
65
66
  description: Media alt text
66
-
67
+
67
68
  - tag: mediaType
68
69
  type: data
69
70
  dataType: enum (IMAGE | VIDEO | AUDIO | DOCUMENT | ZIP)
70
71
  description: Media item type
71
-
72
+
72
73
  - tag: items
73
74
  type: sub-contract
74
75
  repeated: true
@@ -79,27 +80,28 @@ tags:
79
80
  type: data
80
81
  dataType: string
81
82
  description: Media GUID
82
-
83
+
83
84
  - tag: url
84
85
  type: data
85
86
  dataType: string
86
87
  description: Media URL
87
-
88
+ meta: {mediaType: wix-image}
89
+
88
90
  - tag: altText
89
91
  type: data
90
92
  dataType: string
91
93
  description: Media alt text
92
-
94
+
93
95
  - tag: title
94
96
  type: data
95
97
  dataType: string
96
98
  description: Media item title
97
-
99
+
98
100
  - tag: mediaType
99
101
  type: data
100
102
  dataType: enum (IMAGE | VIDEO | AUDIO | DOCUMENT | ZIP)
101
103
  description: Media item type
102
-
104
+
103
105
  - tag: thumbnail
104
106
  type: sub-contract
105
107
  description: Media thumbnail
@@ -108,6 +110,7 @@ tags:
108
110
  type: data
109
111
  dataType: string
110
112
  description: Thumbnail URL
113
+ meta: {mediaType: wix-image}
111
114
 
112
115
  - tag: width
113
116
  type: data
@@ -1,5 +1,4 @@
1
1
  name: media
2
2
  tags:
3
- - {tag: url, type: data, dataType: string, description: Media Url}
3
+ - {tag: url, type: data, dataType: string, description: Media Url, meta: {mediaType: wix-image}}
4
4
  - {tag: mediaType, type: variant, dataType: "enum (IMAGE | VIDEO)", description: Media type}
5
- - {tag: thumbnail_50x50, type: data, dataType: string, description: Media Thumbnail Url }
@@ -8,11 +8,10 @@ export enum MediaType {
8
8
 
9
9
  export interface MediaViewState {
10
10
  url: string,
11
- mediaType: MediaType,
12
- thumbnail_50x50: string
11
+ mediaType: MediaType
13
12
  }
14
13
 
15
- export type MediaSlowViewState = Pick<MediaViewState, 'url' | 'mediaType' | 'thumbnail_50x50'>;
14
+ export type MediaSlowViewState = Pick<MediaViewState, 'url' | 'mediaType'>;
16
15
 
17
16
  export type MediaFastViewState = {};
18
17
 
@@ -36,17 +36,18 @@ tags:
36
36
  type: data
37
37
  dataType: string
38
38
  description: Media URL
39
-
39
+ meta: {mediaType: wix-image}
40
+
40
41
  - tag: altText
41
42
  type: data
42
43
  dataType: string
43
44
  description: Media alt text
44
-
45
+
45
46
  - tag: mediaType
46
47
  type: data
47
48
  dataType: enum (IMAGE | VIDEO)
48
49
  description: Media type
49
-
50
+
50
51
  - tag: thumbnail
51
52
  type: sub-contract
52
53
  description: Thumbnail image optimized for listings
@@ -55,17 +56,18 @@ tags:
55
56
  type: data
56
57
  dataType: string
57
58
  description: Thumbnail URL
58
-
59
+ meta: {mediaType: wix-image}
60
+
59
61
  - tag: altText
60
62
  type: data
61
63
  dataType: string
62
64
  description: Thumbnail alt text
63
-
65
+
64
66
  - tag: width
65
67
  type: data
66
68
  dataType: number
67
69
  description: Thumbnail width in pixels
68
-
70
+
69
71
  - tag: height
70
72
  type: data
71
73
  dataType: number
package/dist/index.d.ts CHANGED
@@ -412,8 +412,7 @@ declare enum MediaType$1 {
412
412
 
413
413
  interface MediaViewState {
414
414
  url: string,
415
- mediaType: MediaType$1,
416
- thumbnail_50x50: string
415
+ mediaType: MediaType$1
417
416
  }
418
417
 
419
418
  interface MediaRefs {}
@@ -1034,4 +1033,19 @@ declare const categoryPage: _jay_framework_fullstack_component.JayStackComponent
1034
1033
 
1035
1034
  declare const init: _jay_framework_fullstack_component.JayInit<WixStoresV1InitData>;
1036
1035
 
1037
- export { type CollectionPageParams, type CollectionViewState, type GetProductBySlugInput, type PriceAggregationData, type PriceRangeBucket, type ProductPageParams, type ProductSearchFilters, type ProductSortField, type SearchProductsInput, type SearchProductsOutput, type V1Collection, WIX_STORES_V1_CONTEXT, WIX_STORES_V1_SERVICE_MARKER, type WixStoresV1Context, type WixStoresV1InitData, type WixStoresV1Service, categoryList, categoryPage, collectionList, collectionPage, getCollections, getProductBySlug, init, productPage, productSearch, provideWixStoresV1Service, searchProducts };
1036
+ /**
1037
+ * Setup handler for wix-stores-v1 plugin.
1038
+ * Validates that the Wix Stores app is installed by querying products.
1039
+ */
1040
+ interface PluginSetupContext {
1041
+ configDir: string;
1042
+ projectRoot: string;
1043
+ initError?: Error;
1044
+ }
1045
+ interface PluginSetupResult {
1046
+ status: 'configured' | 'needs-config' | 'error';
1047
+ message?: string;
1048
+ }
1049
+ declare function setupWixStoresV1(ctx: PluginSetupContext): Promise<PluginSetupResult>;
1050
+
1051
+ export { type CollectionPageParams, type CollectionViewState, type GetProductBySlugInput, type PriceAggregationData, type PriceRangeBucket, type ProductPageParams, type ProductSearchFilters, type ProductSortField, type SearchProductsInput, type SearchProductsOutput, type V1Collection, WIX_STORES_V1_CONTEXT, WIX_STORES_V1_SERVICE_MARKER, type WixStoresV1Context, type WixStoresV1InitData, type WixStoresV1Service, categoryList, categoryPage, collectionList, collectionPage, getCollections, getProductBySlug, init, productPage, productSearch, provideWixStoresV1Service, searchProducts, setupWixStoresV1 };
package/dist/index.js CHANGED
@@ -400,20 +400,17 @@ function mapMedia(product) {
400
400
  const mainMedia = product.media?.mainMedia;
401
401
  const mediaItems = product.media?.items || [];
402
402
  const mainUrl = mainMedia?.image?.url || "";
403
- const mainThumbnail = mainMedia?.thumbnail?.url || "";
404
403
  const mainMediaType = mainMedia?.mediaType === "video" ? MediaType$1.VIDEO : MediaType$1.IMAGE;
405
404
  return {
406
405
  selectedMedia: {
407
406
  url: mainUrl,
408
- mediaType: mainMediaType,
409
- thumbnail_50x50: mainThumbnail
407
+ mediaType: mainMediaType
410
408
  },
411
409
  availableMedia: mediaItems.map((item, index) => ({
412
410
  mediaId: item._id || String(index),
413
411
  media: {
414
412
  url: item.image?.url || "",
415
- mediaType: item.mediaType === "video" ? MediaType$1.VIDEO : MediaType$1.IMAGE,
416
- thumbnail_50x50: item.thumbnail?.url || ""
413
+ mediaType: item.mediaType === "video" ? MediaType$1.VIDEO : MediaType$1.IMAGE
417
414
  },
418
415
  selected: item._id === mainMedia?._id ? Selected.selected : Selected.notSelected
419
416
  }))
@@ -829,6 +826,37 @@ const init = makeJayInit().withServer(async () => {
829
826
  enableClientSearch: true
830
827
  };
831
828
  });
829
+ async function setupWixStoresV1(ctx) {
830
+ if (ctx.initError) {
831
+ return {
832
+ status: "error",
833
+ message: `Service init failed (is wix-server-client configured?). ${ctx.initError.message}`
834
+ };
835
+ }
836
+ let service;
837
+ try {
838
+ service = getService(WIX_STORES_V1_SERVICE_MARKER);
839
+ } catch {
840
+ return {
841
+ status: "error",
842
+ message: "WixStoresV1Service not available. Run setup for wix-server-client first."
843
+ };
844
+ }
845
+ try {
846
+ await service.products.queryProducts().limit(1).find();
847
+ } catch (e) {
848
+ const msg = e.message || "";
849
+ const hint = msg.includes("404") || msg.includes("not found") ? "Wix Stores may not be installed on this site" : msg.includes("403") || msg.includes("permission") ? "API key may lack Wix Stores permissions" : "This package requires the Stores Catalog V1 API — if using Catalog V3, use @jay-framework/wix-stores instead";
850
+ return {
851
+ status: "error",
852
+ message: `Wix Stores V1 API check failed: ${hint}. (${msg})`
853
+ };
854
+ }
855
+ return {
856
+ status: "configured",
857
+ message: "Wix Stores V1 connected"
858
+ };
859
+ }
832
860
  export {
833
861
  WIX_CART_CONTEXT,
834
862
  WIX_CART_SERVICE,
@@ -848,5 +876,6 @@ export {
848
876
  provideWixCartContext,
849
877
  provideWixCartService,
850
878
  provideWixStoresV1Service,
851
- searchProducts
879
+ searchProducts,
880
+ setupWixStoresV1
852
881
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/wix-stores-v1",
3
- "version": "0.18.4",
3
+ "version": "0.19.3",
4
4
  "type": "module",
5
5
  "description": "Wix Stores Catalog V1 API client for Jay Framework",
6
6
  "license": "Apache-2.0",
@@ -35,16 +35,16 @@
35
35
  "test": ":"
36
36
  },
37
37
  "dependencies": {
38
- "@jay-framework/component": "^0.18.4",
39
- "@jay-framework/fullstack-component": "^0.18.4",
40
- "@jay-framework/reactive": "^0.18.4",
41
- "@jay-framework/runtime": "^0.18.4",
42
- "@jay-framework/secure": "^0.18.4",
43
- "@jay-framework/stack-client-runtime": "^0.18.4",
44
- "@jay-framework/stack-server-runtime": "^0.18.4",
45
- "@jay-framework/wix-cart": "^0.18.4",
46
- "@jay-framework/wix-server-client": "^0.18.4",
47
- "@jay-framework/wix-utils": "^0.18.4",
38
+ "@jay-framework/component": "^0.19.3",
39
+ "@jay-framework/fullstack-component": "^0.19.3",
40
+ "@jay-framework/reactive": "^0.19.3",
41
+ "@jay-framework/runtime": "^0.19.3",
42
+ "@jay-framework/secure": "^0.19.3",
43
+ "@jay-framework/stack-client-runtime": "^0.19.3",
44
+ "@jay-framework/stack-server-runtime": "^0.19.3",
45
+ "@jay-framework/wix-cart": "^0.19.3",
46
+ "@jay-framework/wix-server-client": "^0.19.3",
47
+ "@jay-framework/wix-utils": "^0.19.3",
48
48
  "@wix/sdk": "^1.21.5",
49
49
  "@wix/sdk-runtime": "^1.0.11",
50
50
  "@wix/stores": "^1.0.742"
@@ -53,9 +53,9 @@
53
53
  "@babel/core": "^7.23.7",
54
54
  "@babel/preset-env": "^7.23.8",
55
55
  "@babel/preset-typescript": "^7.23.3",
56
- "@jay-framework/compiler-jay-stack": "^0.18.4",
57
- "@jay-framework/jay-cli": "^0.18.4",
58
- "@jay-framework/vite-plugin": "^0.18.4",
56
+ "@jay-framework/compiler-jay-stack": "^0.19.3",
57
+ "@jay-framework/jay-cli": "^0.19.3",
58
+ "@jay-framework/vite-plugin": "^0.19.3",
59
59
  "nodemon": "^3.0.3",
60
60
  "rimraf": "^5.0.5",
61
61
  "tslib": "^2.6.2",
package/plugin.yaml CHANGED
@@ -38,4 +38,7 @@ contexts:
38
38
  marker: WIX_STORES_V1_CONTEXT
39
39
  description: Client-side V1 stores access with collection pagination and delegated cart operations
40
40
 
41
+ setup:
42
+ handler: setupWixStoresV1
43
+
41
44
  # Plugin initialization uses makeJayInit pattern in lib/init.ts