@shopify/shop-minis-platform 0.16.0 → 0.17.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shopify/shop-minis-platform",
3
3
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "0.16.0",
4
+ "version": "0.17.0",
5
5
  "description": "Shared type definitions for Shop Minis Platform",
6
6
  "main": "src/index.ts",
7
7
  "exports": {
@@ -96,6 +96,9 @@ import {
96
96
  RequestPermissionResponse,
97
97
  CheckPermissionParams,
98
98
  CheckPermissionResponse,
99
+ CheckScopesConsentParams,
100
+ CheckScopesConsentResponse,
101
+ RequestScopesConsentResponse,
99
102
  ReportErrorParams,
100
103
  ReportFetchParams,
101
104
  } from './params'
@@ -239,6 +242,11 @@ export interface ShopActionEvents {
239
242
  RequestPermissionResponse
240
243
  >
241
244
  CHECK_PERMISSION: ShopAction<CheckPermissionParams, CheckPermissionResponse>
245
+ CHECK_SCOPES_CONSENT: ShopAction<
246
+ CheckScopesConsentParams,
247
+ {data: CheckScopesConsentResponse}
248
+ >
249
+ REQUEST_SCOPES_CONSENT: ShopAction<void, RequestScopesConsentResponse>
242
250
  REPORT_ERROR: ShopAction<ReportErrorParams, void>
243
251
  REPORT_FETCH: ShopAction<ReportFetchParams, void>
244
252
  INVOKE_INTENT: ShopAction<InvokeIntentParams, InvokeIntentResponse>
@@ -61,6 +61,20 @@ export interface CheckPermissionResponse {
61
61
  errorMessage?: string
62
62
  }
63
63
 
64
+ export interface CheckScopesConsentParams {
65
+ fetchPolicy?: DataHookFetchPolicy
66
+ }
67
+
68
+ export interface CheckScopesConsentResponse {
69
+ requiredScopes: string[]
70
+ grantedScopes: string[]
71
+ status: 'granted' | 'partially_granted' | 'not_granted'
72
+ }
73
+
74
+ export interface RequestScopesConsentResponse {
75
+ granted: boolean
76
+ }
77
+
64
78
  export interface FavoriteParams {
65
79
  shopId: string
66
80
  productId: string
@@ -304,19 +318,22 @@ export interface PaginatedResponse<T> {
304
318
  pageInfo: PaginationInfo
305
319
  }
306
320
 
307
- export interface GetProductListsResponse
308
- extends PaginatedResponse<ProductList[]> {}
309
- export interface GetProductListResponse
310
- extends PaginatedResponse<ProductList | null> {}
321
+ export interface GetProductListsResponse extends PaginatedResponse<
322
+ ProductList[]
323
+ > {}
324
+ export interface GetProductListResponse extends PaginatedResponse<ProductList | null> {}
311
325
 
312
- export interface GetRecommendedProductsResponse
313
- extends PaginatedResponse<Product[]> {}
326
+ export interface GetRecommendedProductsResponse extends PaginatedResponse<
327
+ Product[]
328
+ > {}
314
329
 
315
- export interface GetRecommendedShopsResponse
316
- extends PaginatedResponse<Shop[]> {}
330
+ export interface GetRecommendedShopsResponse extends PaginatedResponse<
331
+ Shop[]
332
+ > {}
317
333
 
318
- export interface SearchProductsByShopResponse
319
- extends PaginatedResponse<Product[]> {}
334
+ export interface SearchProductsByShopResponse extends PaginatedResponse<
335
+ Product[]
336
+ > {}
320
337
 
321
338
  export interface GetBuyerAttributesResponse {
322
339
  data: {
@@ -546,8 +563,9 @@ export interface GetPopularProductsParams {
546
563
  fetchPolicy?: DataHookFetchPolicy
547
564
  }
548
565
 
549
- export interface GetPopularProductsResponse
550
- extends PaginatedResponse<Product[]> {}
566
+ export interface GetPopularProductsResponse extends PaginatedResponse<
567
+ Product[]
568
+ > {}
551
569
 
552
570
  export interface PreviewProductInARParams {
553
571
  id: string
@@ -561,8 +579,9 @@ export interface GetProductMediaParams {
561
579
  fetchPolicy?: DataHookFetchPolicy
562
580
  }
563
581
 
564
- export interface GetProductMediaResponse
565
- extends PaginatedResponse<ProductMedia[]> {}
582
+ export interface GetProductMediaResponse extends PaginatedResponse<
583
+ ProductMedia[]
584
+ > {}
566
585
 
567
586
  export interface GetProductReviewsParams {
568
587
  id: string
@@ -571,8 +590,9 @@ export interface GetProductReviewsParams {
571
590
  fetchPolicy?: DataHookFetchPolicy
572
591
  }
573
592
 
574
- export interface GetProductReviewsResponse
575
- extends PaginatedResponse<ProductReview[]> {}
593
+ export interface GetProductReviewsResponse extends PaginatedResponse<
594
+ ProductReview[]
595
+ > {}
576
596
 
577
597
  export interface GetShopParams {
578
598
  id: string
@@ -646,8 +666,9 @@ export interface GetSavedProductsParams {
646
666
  fetchPolicy?: DataHookFetchPolicy
647
667
  }
648
668
 
649
- export interface GetSavedProductsResponse
650
- extends PaginatedResponse<Product[]> {}
669
+ export interface GetSavedProductsResponse extends PaginatedResponse<
670
+ Product[]
671
+ > {}
651
672
 
652
673
  export interface GetRecentProductsParams {
653
674
  includeSensitive?: boolean
@@ -656,8 +677,9 @@ export interface GetRecentProductsParams {
656
677
  fetchPolicy?: DataHookFetchPolicy
657
678
  }
658
679
 
659
- export interface GetRecentProductsResponse
660
- extends PaginatedResponse<Product[]> {}
680
+ export interface GetRecentProductsResponse extends PaginatedResponse<
681
+ Product[]
682
+ > {}
661
683
 
662
684
  export interface GetProductSearchParams {
663
685
  query: string
@@ -669,8 +691,9 @@ export interface GetProductSearchParams {
669
691
  fetchPolicy?: DataHookFetchPolicy
670
692
  }
671
693
 
672
- export interface GetProductSearchResponse
673
- extends PaginatedResponse<Product[]> {}
694
+ export interface GetProductSearchResponse extends PaginatedResponse<
695
+ Product[]
696
+ > {}
674
697
 
675
698
  export interface GetProductVariantsParams {
676
699
  id: string
@@ -679,8 +702,9 @@ export interface GetProductVariantsParams {
679
702
  fetchPolicy?: DataHookFetchPolicy
680
703
  }
681
704
 
682
- export interface GetProductVariantsResponse
683
- extends PaginatedResponse<ProductVariant[]> {}
705
+ export interface GetProductVariantsResponse extends PaginatedResponse<
706
+ ProductVariant[]
707
+ > {}
684
708
 
685
709
  export interface CreateContentParams {
686
710
  title: string