@shopify/shop-minis-platform 0.8.5 → 0.10.0
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/package.json +1 -1
- package/src/actions/actions.ts +11 -0
- package/src/actions/params.ts +32 -0
- package/src/types/product.ts +13 -0
package/package.json
CHANGED
package/src/actions/actions.ts
CHANGED
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
AddProductListParams,
|
|
43
43
|
RemoveProductListParams,
|
|
44
44
|
RenameProductListParams,
|
|
45
|
+
SetProductListVisibilityParams,
|
|
45
46
|
AddProductListItemParams,
|
|
46
47
|
RemoveProductListItemParams,
|
|
47
48
|
GetRecommendedProductsParams,
|
|
@@ -73,6 +74,8 @@ import {
|
|
|
73
74
|
GetProductVariantsResponse,
|
|
74
75
|
GetProductMediaParams,
|
|
75
76
|
GetProductMediaResponse,
|
|
77
|
+
GetProductReviewsParams,
|
|
78
|
+
GetProductReviewsResponse,
|
|
76
79
|
GetShopParams,
|
|
77
80
|
GetShopResponse,
|
|
78
81
|
GetRecentShopsParams,
|
|
@@ -163,6 +166,10 @@ export interface ShopActionEvents {
|
|
|
163
166
|
ADD_PRODUCT_LIST: ShopAction<AddProductListParams, ProductList>
|
|
164
167
|
REMOVE_PRODUCT_LIST: ShopAction<RemoveProductListParams, void>
|
|
165
168
|
RENAME_PRODUCT_LIST: ShopAction<RenameProductListParams, ProductList>
|
|
169
|
+
SET_PRODUCT_LIST_VISIBILITY: ShopAction<
|
|
170
|
+
SetProductListVisibilityParams,
|
|
171
|
+
ProductList
|
|
172
|
+
>
|
|
166
173
|
ADD_PRODUCT_LIST_ITEM: ShopAction<AddProductListItemParams, void>
|
|
167
174
|
REMOVE_PRODUCT_LIST_ITEM: ShopAction<RemoveProductListItemParams, void>
|
|
168
175
|
GET_RECOMMENDED_PRODUCTS: ShopAction<
|
|
@@ -208,6 +215,10 @@ export interface ShopActionEvents {
|
|
|
208
215
|
GetProductVariantsResponse
|
|
209
216
|
>
|
|
210
217
|
GET_PRODUCT_MEDIA: ShopAction<GetProductMediaParams, GetProductMediaResponse>
|
|
218
|
+
GET_PRODUCT_REVIEWS: ShopAction<
|
|
219
|
+
GetProductReviewsParams,
|
|
220
|
+
GetProductReviewsResponse
|
|
221
|
+
>
|
|
211
222
|
GET_SHOP: ShopAction<GetShopParams, GetShopResponse>
|
|
212
223
|
GET_RECENT_SHOPS: ShopAction<GetRecentShopsParams, GetRecentShopsResponse>
|
|
213
224
|
GET_FOLLOWED_SHOPS: ShopAction<
|
package/src/actions/params.ts
CHANGED
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
Product,
|
|
6
6
|
ProductFilters,
|
|
7
7
|
ProductList,
|
|
8
|
+
ProductListPrivacyStatus,
|
|
8
9
|
ProductMedia,
|
|
10
|
+
ProductReview,
|
|
9
11
|
ProductSearchSortBy,
|
|
10
12
|
ProductVariant,
|
|
11
13
|
Shop,
|
|
@@ -386,6 +388,10 @@ export interface AddProductListParams {
|
|
|
386
388
|
* A description of the product list.
|
|
387
389
|
*/
|
|
388
390
|
description?: string
|
|
391
|
+
/**
|
|
392
|
+
* The privacy status of the product list. Defaults to 'PRIVATE'.
|
|
393
|
+
*/
|
|
394
|
+
privacyStatus?: ProductListPrivacyStatus
|
|
389
395
|
}
|
|
390
396
|
|
|
391
397
|
export interface RemoveProductListParams {
|
|
@@ -405,6 +411,22 @@ export interface RenameProductListParams {
|
|
|
405
411
|
*/
|
|
406
412
|
name: string
|
|
407
413
|
}
|
|
414
|
+
|
|
415
|
+
export interface SetProductListVisibilityParams {
|
|
416
|
+
/**
|
|
417
|
+
* The GID of the product list. E.g. `gid://shopapp/ProductList/123`.
|
|
418
|
+
*/
|
|
419
|
+
id: string
|
|
420
|
+
/**
|
|
421
|
+
* The name of the product list. Required to preserve the existing name.
|
|
422
|
+
*/
|
|
423
|
+
name: string
|
|
424
|
+
/**
|
|
425
|
+
* The privacy status to set for the product list.
|
|
426
|
+
*/
|
|
427
|
+
privacyStatus: ProductListPrivacyStatus
|
|
428
|
+
}
|
|
429
|
+
|
|
408
430
|
export interface AddProductListItemParams {
|
|
409
431
|
/**
|
|
410
432
|
* The GID of the shop. E.g. `gid://shopify/Shop/42`.
|
|
@@ -515,6 +537,16 @@ export interface GetProductMediaParams {
|
|
|
515
537
|
export interface GetProductMediaResponse
|
|
516
538
|
extends PaginatedResponse<ProductMedia[]> {}
|
|
517
539
|
|
|
540
|
+
export interface GetProductReviewsParams {
|
|
541
|
+
id: string
|
|
542
|
+
first?: number
|
|
543
|
+
after?: string
|
|
544
|
+
fetchPolicy?: DataHookFetchPolicy
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export interface GetProductReviewsResponse
|
|
548
|
+
extends PaginatedResponse<ProductReview[]> {}
|
|
549
|
+
|
|
518
550
|
export interface GetShopParams {
|
|
519
551
|
id: string
|
|
520
552
|
fetchPolicy?: DataHookFetchPolicy
|
package/src/types/product.ts
CHANGED
|
@@ -22,6 +22,16 @@ export interface ProductVariant {
|
|
|
22
22
|
compareAtPrice?: Money | null
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export interface ProductReview {
|
|
26
|
+
id: string
|
|
27
|
+
rating: number
|
|
28
|
+
title?: string | null
|
|
29
|
+
body?: string | null
|
|
30
|
+
submittedAt: string
|
|
31
|
+
merchantReply?: string | null
|
|
32
|
+
merchantRepliedAt?: string | null
|
|
33
|
+
}
|
|
34
|
+
|
|
25
35
|
export interface ProductShop {
|
|
26
36
|
id: string
|
|
27
37
|
name: string
|
|
@@ -85,10 +95,13 @@ export interface Product {
|
|
|
85
95
|
referral?: boolean
|
|
86
96
|
}
|
|
87
97
|
|
|
98
|
+
export type ProductListPrivacyStatus = 'PRIVATE' | 'PUBLIC'
|
|
99
|
+
|
|
88
100
|
export interface ProductList {
|
|
89
101
|
id: string
|
|
90
102
|
publicId: string | null
|
|
91
103
|
name: string | null
|
|
104
|
+
privacyStatus: ProductListPrivacyStatus
|
|
92
105
|
products: Product[]
|
|
93
106
|
}
|
|
94
107
|
|