@jay-framework/wix-stores 0.15.4 → 0.15.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.
- package/dist/actions/get-variant-stock.jay-action +7 -0
- package/dist/actions/search-products.jay-action +12 -0
- package/dist/contracts/category-list.jay-contract +5 -0
- package/dist/contracts/category-list.jay-contract.d.ts +5 -1
- package/dist/contracts/media-gallery.jay-contract +1 -0
- package/dist/contracts/media.jay-contract +1 -0
- package/dist/contracts/product-card.jay-contract +1 -0
- package/dist/contracts/product-page.jay-contract +6 -52
- package/dist/contracts/product-page.jay-contract.d.ts +11 -39
- package/dist/contracts/product-search.jay-contract +74 -1
- package/dist/contracts/product-search.jay-contract.d.ts +48 -2
- package/dist/index.client.js +132 -38
- package/dist/index.d.ts +109 -126
- package/dist/index.js +286 -66
- package/package.json +21 -17
- package/plugin.yaml +11 -2
- package/dist/contracts/category-page.jay-contract +0 -193
- package/dist/contracts/category-page.jay-contract.d.ts +0 -133
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/wix-stores",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Wix Stores API client for Jay Framework",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -18,11 +18,13 @@
|
|
|
18
18
|
"./category-list.jay-contract": "./dist/contracts/category-list.jay-contract",
|
|
19
19
|
"./search-products.jay-action": "./dist/actions/search-products.jay-action",
|
|
20
20
|
"./get-product-by-slug.jay-action": "./dist/actions/get-product-by-slug.jay-action",
|
|
21
|
-
"./get-categories.jay-action": "./dist/actions/get-categories.jay-action"
|
|
21
|
+
"./get-categories.jay-action": "./dist/actions/get-categories.jay-action",
|
|
22
|
+
"./get-variant-stock.jay-action": "./dist/actions/get-variant-stock.jay-action"
|
|
22
23
|
},
|
|
23
24
|
"scripts": {
|
|
24
|
-
"build": "npm run clean && npm run definitions && npm run build:client && npm run build:server && npm run build:copy-contract && npm run build:types",
|
|
25
|
+
"build": "npm run clean && npm run definitions && npm run build:client && npm run build:server && npm run build:copy-contract && npm run build:types && npm run validate",
|
|
25
26
|
"definitions": "jay-cli definitions lib",
|
|
27
|
+
"validate": "jay-stack-cli validate-plugin",
|
|
26
28
|
"build:client": "vite build",
|
|
27
29
|
"build:server": "vite build --ssr",
|
|
28
30
|
"build:copy-contract": "mkdir -p dist/contracts && cp lib/contracts/*.jay-contract* dist/contracts/ && mkdir -p dist/actions && cp lib/actions/*.jay-action dist/actions/",
|
|
@@ -33,28 +35,30 @@
|
|
|
33
35
|
"test": ":"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
|
-
"@jay-framework/component": "^0.15.
|
|
37
|
-
"@jay-framework/fullstack-component": "^0.15.
|
|
38
|
-
"@jay-framework/reactive": "^0.15.
|
|
39
|
-
"@jay-framework/runtime": "^0.15.
|
|
40
|
-
"@jay-framework/secure": "^0.15.
|
|
41
|
-
"@jay-framework/stack-client-runtime": "^0.15.
|
|
42
|
-
"@jay-framework/stack-server-runtime": "^0.15.
|
|
43
|
-
"@jay-framework/wix-cart": "^0.15.
|
|
44
|
-
"@jay-framework/wix-server-client": "^0.15.
|
|
45
|
-
"@jay-framework/wix-utils": "^0.15.
|
|
38
|
+
"@jay-framework/component": "^0.15.6",
|
|
39
|
+
"@jay-framework/fullstack-component": "^0.15.6",
|
|
40
|
+
"@jay-framework/reactive": "^0.15.6",
|
|
41
|
+
"@jay-framework/runtime": "^0.15.6",
|
|
42
|
+
"@jay-framework/secure": "^0.15.6",
|
|
43
|
+
"@jay-framework/stack-client-runtime": "^0.15.6",
|
|
44
|
+
"@jay-framework/stack-server-runtime": "^0.15.6",
|
|
45
|
+
"@jay-framework/wix-cart": "^0.15.6",
|
|
46
|
+
"@jay-framework/wix-server-client": "^0.15.6",
|
|
47
|
+
"@jay-framework/wix-utils": "^0.15.6",
|
|
46
48
|
"@wix/categories": "^1.0.185",
|
|
47
49
|
"@wix/sdk": "^1.21.5",
|
|
48
|
-
"@wix/
|
|
50
|
+
"@wix/sdk-runtime": "^1.0.11",
|
|
51
|
+
"@wix/stores": "^1.0.742",
|
|
49
52
|
"js-yaml": "^4.1.0"
|
|
50
53
|
},
|
|
51
54
|
"devDependencies": {
|
|
52
55
|
"@babel/core": "^7.23.7",
|
|
53
56
|
"@babel/preset-env": "^7.23.8",
|
|
54
57
|
"@babel/preset-typescript": "^7.23.3",
|
|
55
|
-
"@jay-framework/compiler-jay-stack": "^0.15.
|
|
56
|
-
"@jay-framework/jay-cli": "^0.15.
|
|
57
|
-
"@jay-framework/
|
|
58
|
+
"@jay-framework/compiler-jay-stack": "^0.15.6",
|
|
59
|
+
"@jay-framework/jay-cli": "^0.15.6",
|
|
60
|
+
"@jay-framework/jay-stack-cli": "^0.15.6",
|
|
61
|
+
"@jay-framework/vite-plugin": "^0.15.6",
|
|
58
62
|
"nodemon": "^3.0.3",
|
|
59
63
|
"rimraf": "^5.0.5",
|
|
60
64
|
"tslib": "^2.6.2",
|
package/plugin.yaml
CHANGED
|
@@ -24,9 +24,18 @@ actions:
|
|
|
24
24
|
action: get-product-by-slug.jay-action
|
|
25
25
|
- name: getCategories
|
|
26
26
|
action: get-categories.jay-action
|
|
27
|
+
- name: getVariantStock
|
|
28
|
+
action: get-variant-stock.jay-action
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
services:
|
|
31
|
+
- name: wix-stores
|
|
32
|
+
marker: WIX_STORES_SERVICE_MARKER
|
|
33
|
+
description: Wix Stores Catalog V3 API (products, categories, inventory, customizations) with lazy-loaded caching
|
|
34
|
+
|
|
35
|
+
contexts:
|
|
36
|
+
- name: wix-stores
|
|
37
|
+
marker: WIX_STORES_CONTEXT
|
|
38
|
+
description: Client-side stores access with product variant resolution and delegated cart operations
|
|
30
39
|
|
|
31
40
|
setup:
|
|
32
41
|
handler: setupWixStores
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
name: category-page
|
|
2
|
-
tags:
|
|
3
|
-
# Category/Collection information (from Wix Stores Collection API)
|
|
4
|
-
- tag: _id
|
|
5
|
-
type: data
|
|
6
|
-
dataType: string
|
|
7
|
-
description: Collection GUID
|
|
8
|
-
|
|
9
|
-
- tag: name
|
|
10
|
-
type: data
|
|
11
|
-
dataType: string
|
|
12
|
-
required: true
|
|
13
|
-
description: Collection name
|
|
14
|
-
|
|
15
|
-
- tag: description
|
|
16
|
-
type: data
|
|
17
|
-
dataType: string
|
|
18
|
-
description: Collection description
|
|
19
|
-
|
|
20
|
-
- tag: slug
|
|
21
|
-
type: data
|
|
22
|
-
dataType: string
|
|
23
|
-
description: Collection slug
|
|
24
|
-
|
|
25
|
-
- tag: visible
|
|
26
|
-
type: data
|
|
27
|
-
dataType: boolean
|
|
28
|
-
description: Collection visibility (impacts dynamic pages only)
|
|
29
|
-
|
|
30
|
-
- tag: numberOfProducts
|
|
31
|
-
type: data
|
|
32
|
-
dataType: number
|
|
33
|
-
description: Number of products in the collection
|
|
34
|
-
|
|
35
|
-
# Media (from Wix Stores Collection API)
|
|
36
|
-
- tag: media
|
|
37
|
-
type: sub-contract
|
|
38
|
-
description: Media items associated with this collection
|
|
39
|
-
tags:
|
|
40
|
-
- tag: mainMedia
|
|
41
|
-
type: sub-contract
|
|
42
|
-
description: Primary media for the collection
|
|
43
|
-
tags:
|
|
44
|
-
- tag: _id
|
|
45
|
-
type: data
|
|
46
|
-
dataType: string
|
|
47
|
-
description: Media GUID
|
|
48
|
-
|
|
49
|
-
- tag: url
|
|
50
|
-
type: data
|
|
51
|
-
dataType: string
|
|
52
|
-
description: Media URL
|
|
53
|
-
|
|
54
|
-
- tag: altText
|
|
55
|
-
type: data
|
|
56
|
-
dataType: string
|
|
57
|
-
description: Media alt text
|
|
58
|
-
|
|
59
|
-
- tag: mediaType
|
|
60
|
-
type: data
|
|
61
|
-
dataType: enum (IMAGE | VIDEO | AUDIO | DOCUMENT | ZIP)
|
|
62
|
-
description: Media item type
|
|
63
|
-
|
|
64
|
-
- tag: items
|
|
65
|
-
type: sub-contract
|
|
66
|
-
repeated: true
|
|
67
|
-
trackBy: _id
|
|
68
|
-
description: All media items
|
|
69
|
-
tags:
|
|
70
|
-
- tag: _id
|
|
71
|
-
type: data
|
|
72
|
-
dataType: string
|
|
73
|
-
description: Media GUID
|
|
74
|
-
|
|
75
|
-
- tag: url
|
|
76
|
-
type: data
|
|
77
|
-
dataType: string
|
|
78
|
-
description: Media URL
|
|
79
|
-
|
|
80
|
-
- tag: altText
|
|
81
|
-
type: data
|
|
82
|
-
dataType: string
|
|
83
|
-
description: Media alt text
|
|
84
|
-
|
|
85
|
-
- tag: title
|
|
86
|
-
type: data
|
|
87
|
-
dataType: string
|
|
88
|
-
description: Media item title
|
|
89
|
-
|
|
90
|
-
- tag: mediaType
|
|
91
|
-
type: data
|
|
92
|
-
dataType: enum (IMAGE | VIDEO | AUDIO | DOCUMENT | ZIP)
|
|
93
|
-
description: Media item type
|
|
94
|
-
|
|
95
|
-
- tag: thumbnail
|
|
96
|
-
type: sub-contract
|
|
97
|
-
description: Media thumbnail
|
|
98
|
-
tags:
|
|
99
|
-
- tag: url
|
|
100
|
-
type: data
|
|
101
|
-
dataType: string
|
|
102
|
-
description: Thumbnail URL
|
|
103
|
-
|
|
104
|
-
- tag: width
|
|
105
|
-
type: data
|
|
106
|
-
dataType: number
|
|
107
|
-
description: Thumbnail width in pixels
|
|
108
|
-
|
|
109
|
-
- tag: height
|
|
110
|
-
type: data
|
|
111
|
-
dataType: number
|
|
112
|
-
description: Thumbnail height in pixels
|
|
113
|
-
|
|
114
|
-
- tag: format
|
|
115
|
-
type: data
|
|
116
|
-
dataType: string
|
|
117
|
-
description: Media format (mp4, png, etc.)
|
|
118
|
-
|
|
119
|
-
# Breadcrumbs navigation
|
|
120
|
-
- tag: breadcrumbs
|
|
121
|
-
type: sub-contract
|
|
122
|
-
repeated: true
|
|
123
|
-
trackBy: categoryId
|
|
124
|
-
description: Breadcrumb navigation path
|
|
125
|
-
tags:
|
|
126
|
-
- tag: categoryId
|
|
127
|
-
type: data
|
|
128
|
-
dataType: string
|
|
129
|
-
description: Category GUID
|
|
130
|
-
|
|
131
|
-
- tag: categoryName
|
|
132
|
-
type: data
|
|
133
|
-
dataType: string
|
|
134
|
-
description: Category name in breadcrumb
|
|
135
|
-
|
|
136
|
-
- tag: categorySlug
|
|
137
|
-
type: data
|
|
138
|
-
dataType: string
|
|
139
|
-
description: Category slug for link
|
|
140
|
-
|
|
141
|
-
- tag: categoryLink
|
|
142
|
-
type: interactive
|
|
143
|
-
elementType: HTMLAnchorElement
|
|
144
|
-
description: Link to category
|
|
145
|
-
|
|
146
|
-
# Initial products (SSR - loaded in slow phase)
|
|
147
|
-
- tag: products
|
|
148
|
-
type: sub-contract
|
|
149
|
-
repeated: true
|
|
150
|
-
trackBy: _id
|
|
151
|
-
description: Initial products in this category (rendered server-side)
|
|
152
|
-
link: ./product-card
|
|
153
|
-
|
|
154
|
-
# Additional products (loaded on client via "load more")
|
|
155
|
-
- tag: loadedProducts
|
|
156
|
-
type: sub-contract
|
|
157
|
-
repeated: true
|
|
158
|
-
trackBy: _id
|
|
159
|
-
phase: fast+interactive
|
|
160
|
-
description: Additional products loaded on the client
|
|
161
|
-
link: ./product-card
|
|
162
|
-
|
|
163
|
-
# Load more functionality
|
|
164
|
-
- tag: hasMore
|
|
165
|
-
type: variant
|
|
166
|
-
dataType: boolean
|
|
167
|
-
phase: fast+interactive
|
|
168
|
-
description: Whether there are more products to load
|
|
169
|
-
|
|
170
|
-
- tag: loadMoreButton
|
|
171
|
-
type: interactive
|
|
172
|
-
elementType: HTMLButtonElement
|
|
173
|
-
description: Button to load more products
|
|
174
|
-
|
|
175
|
-
- tag: loadedCount
|
|
176
|
-
type: data
|
|
177
|
-
dataType: number
|
|
178
|
-
phase: fast+interactive
|
|
179
|
-
description: Number of products currently loaded
|
|
180
|
-
|
|
181
|
-
# Loading state
|
|
182
|
-
- tag: isLoading
|
|
183
|
-
type: variant
|
|
184
|
-
dataType: boolean
|
|
185
|
-
phase: fast+interactive
|
|
186
|
-
description: Whether products are currently loading
|
|
187
|
-
|
|
188
|
-
# Empty state
|
|
189
|
-
- tag: hasProducts
|
|
190
|
-
type: variant
|
|
191
|
-
dataType: boolean
|
|
192
|
-
phase: fast+interactive
|
|
193
|
-
description: Whether category has any products
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import {HTMLElementCollectionProxy, HTMLElementProxy, JayContract} from "@jay-framework/runtime";
|
|
2
|
-
import {ProductCardViewState, ProductCardRefs, ProductCardRepeatedRefs} from "./product-card.jay-contract";
|
|
3
|
-
|
|
4
|
-
export enum MediaType {
|
|
5
|
-
IMAGE,
|
|
6
|
-
VIDEO,
|
|
7
|
-
AUDIO,
|
|
8
|
-
DOCUMENT,
|
|
9
|
-
ZIP
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface MainMediaOfMediaOfCategoryPageViewState {
|
|
13
|
-
_id: string,
|
|
14
|
-
url: string,
|
|
15
|
-
altText: string,
|
|
16
|
-
mediaType: MediaType
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export enum MediaType {
|
|
20
|
-
IMAGE,
|
|
21
|
-
VIDEO,
|
|
22
|
-
AUDIO,
|
|
23
|
-
DOCUMENT,
|
|
24
|
-
ZIP
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface ThumbnailOfItemOfMediaOfCategoryPageViewState {
|
|
28
|
-
url: string,
|
|
29
|
-
width: number,
|
|
30
|
-
height: number,
|
|
31
|
-
format: string
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface ItemOfMediaOfCategoryPageViewState {
|
|
35
|
-
_id: string,
|
|
36
|
-
url: string,
|
|
37
|
-
altText: string,
|
|
38
|
-
title: string,
|
|
39
|
-
mediaType: MediaType,
|
|
40
|
-
thumbnail: ThumbnailOfItemOfMediaOfCategoryPageViewState
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface MediaOfCategoryPageViewState {
|
|
44
|
-
mainMedia: MainMediaOfMediaOfCategoryPageViewState,
|
|
45
|
-
items: Array<ItemOfMediaOfCategoryPageViewState>
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface BreadcrumbOfCategoryPageViewState {
|
|
49
|
-
categoryId: string,
|
|
50
|
-
categoryName: string,
|
|
51
|
-
categorySlug: string
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface CategoryPageViewState {
|
|
55
|
-
_id: string,
|
|
56
|
-
name: string,
|
|
57
|
-
description: string,
|
|
58
|
-
slug: string,
|
|
59
|
-
visible: boolean,
|
|
60
|
-
numberOfProducts: number,
|
|
61
|
-
media: MediaOfCategoryPageViewState,
|
|
62
|
-
breadcrumbs: Array<BreadcrumbOfCategoryPageViewState>,
|
|
63
|
-
products: Array<ProductCardViewState>,
|
|
64
|
-
loadedProducts: Array<ProductCardViewState>,
|
|
65
|
-
hasMore: boolean,
|
|
66
|
-
loadedCount: number,
|
|
67
|
-
isLoading: boolean,
|
|
68
|
-
hasProducts: boolean
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export type CategoryPageSlowViewState = Pick<CategoryPageViewState, '_id' | 'name' | 'description' | 'slug' | 'visible' | 'numberOfProducts'> & {
|
|
72
|
-
media: CategoryPageViewState['media'];
|
|
73
|
-
breadcrumbs: Array<CategoryPageViewState['breadcrumbs'][number]>;
|
|
74
|
-
products: Array<Pick<CategoryPageViewState['products'][number], '_id' | 'name' | 'slug' | 'productUrl' | 'categoryPrefix' | 'hasDiscount' | 'hasRibbon' | 'productType' | 'quickAddType'> & {
|
|
75
|
-
mainMedia: CategoryPageViewState['products'][number]['mainMedia'];
|
|
76
|
-
thumbnail: CategoryPageViewState['products'][number]['thumbnail'];
|
|
77
|
-
inventory: CategoryPageViewState['products'][number]['inventory'];
|
|
78
|
-
ribbon: CategoryPageViewState['products'][number]['ribbon'];
|
|
79
|
-
brand: CategoryPageViewState['products'][number]['brand'];
|
|
80
|
-
quickOption: Pick<CategoryPageViewState['products'][number]['quickOption'], '_id' | 'name' | 'optionRenderType'> & {
|
|
81
|
-
choices: Array<Pick<CategoryPageViewState['products'][number]['quickOption']['choices'][number], 'choiceId' | 'name' | 'choiceType' | 'colorCode'>>;
|
|
82
|
-
};
|
|
83
|
-
secondQuickOption: Pick<CategoryPageViewState['products'][number]['secondQuickOption'], '_id' | 'name' | 'optionRenderType'> & {
|
|
84
|
-
choices: Array<Pick<CategoryPageViewState['products'][number]['secondQuickOption']['choices'][number], 'choiceId' | 'name' | 'choiceType' | 'colorCode'>>;
|
|
85
|
-
};
|
|
86
|
-
}>;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export type CategoryPageFastViewState = Pick<CategoryPageViewState, 'hasMore' | 'loadedCount' | 'isLoading' | 'hasProducts'> & {
|
|
90
|
-
products: Array<Pick<CategoryPageViewState['products'][number], '_id' | 'price' | 'strikethroughPrice' | 'isAddingToCart'> & {
|
|
91
|
-
quickOption: {
|
|
92
|
-
choices: Array<Pick<CategoryPageViewState['products'][number]['quickOption']['choices'][number], 'choiceId' | 'inStock' | 'isSelected'>>;
|
|
93
|
-
};
|
|
94
|
-
secondQuickOption: {
|
|
95
|
-
choices: Array<Pick<CategoryPageViewState['products'][number]['secondQuickOption']['choices'][number], 'choiceId' | 'inStock' | 'isSelected'>>;
|
|
96
|
-
};
|
|
97
|
-
}>;
|
|
98
|
-
loadedProducts: Array<CategoryPageViewState['loadedProducts'][number]>;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export type CategoryPageInteractiveViewState = Pick<CategoryPageViewState, 'hasMore' | 'loadedCount' | 'isLoading' | 'hasProducts'> & {
|
|
102
|
-
products: Array<Pick<CategoryPageViewState['products'][number], '_id' | 'price' | 'strikethroughPrice' | 'isAddingToCart'> & {
|
|
103
|
-
quickOption: {
|
|
104
|
-
choices: Array<Pick<CategoryPageViewState['products'][number]['quickOption']['choices'][number], 'choiceId' | 'inStock' | 'isSelected'>>;
|
|
105
|
-
};
|
|
106
|
-
secondQuickOption: {
|
|
107
|
-
choices: Array<Pick<CategoryPageViewState['products'][number]['secondQuickOption']['choices'][number], 'choiceId' | 'inStock' | 'isSelected'>>;
|
|
108
|
-
};
|
|
109
|
-
}>;
|
|
110
|
-
loadedProducts: Array<CategoryPageViewState['loadedProducts'][number]>;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
export interface CategoryPageRefs {
|
|
115
|
-
loadMoreButton: HTMLElementProxy<CategoryPageViewState, HTMLButtonElement>,
|
|
116
|
-
breadcrumbs: {
|
|
117
|
-
categoryLink: HTMLElementCollectionProxy<BreadcrumbOfCategoryPageViewState, HTMLAnchorElement>
|
|
118
|
-
},
|
|
119
|
-
products: ProductCardRepeatedRefs,
|
|
120
|
-
loadedProducts: ProductCardRepeatedRefs
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
export interface CategoryPageRepeatedRefs {
|
|
125
|
-
loadMoreButton: HTMLElementCollectionProxy<CategoryPageViewState, HTMLButtonElement>,
|
|
126
|
-
breadcrumbs: {
|
|
127
|
-
categoryLink: HTMLElementCollectionProxy<BreadcrumbOfCategoryPageViewState, HTMLAnchorElement>
|
|
128
|
-
},
|
|
129
|
-
products: ProductCardRepeatedRefs,
|
|
130
|
-
loadedProducts: ProductCardRepeatedRefs
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export type CategoryPageContract = JayContract<CategoryPageViewState, CategoryPageRefs, CategoryPageSlowViewState, CategoryPageFastViewState, CategoryPageInteractiveViewState>
|