@shopify/shop-minis-platform 0.12.0 → 0.13.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/scopes.ts +7 -29
- package/src/types/minis.ts +8 -0
package/package.json
CHANGED
package/src/actions/scopes.ts
CHANGED
|
@@ -8,25 +8,13 @@ export enum Scope {
|
|
|
8
8
|
USER_SETTINGS_READ = 'user_settings:read',
|
|
9
9
|
PROFILE = 'profile',
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
PRODUCTS_RECENT_READ = 'products:recent:read',
|
|
13
|
-
PRODUCTS_RECOMMENDATIONS_READ = 'products:recommendations:read',
|
|
14
|
-
|
|
15
|
-
// Shops
|
|
16
|
-
SHOPS_RECENT_READ = 'shops:recent:read',
|
|
17
|
-
SHOPS_FOLLOWS = 'shops:follows',
|
|
18
|
-
SHOPS_FOLLOWS_READ = 'shops:follows:read',
|
|
11
|
+
// Write scopes
|
|
19
12
|
SHOPS_FOLLOWS_WRITE = 'shops:follows:write',
|
|
20
|
-
SHOPS_RECOMMENDATIONS_READ = 'shops:recommendations:read',
|
|
21
|
-
|
|
22
|
-
// Orders
|
|
23
|
-
ORDERS = 'orders',
|
|
24
|
-
|
|
25
|
-
// Product lists
|
|
26
|
-
PRODUCT_LIST = 'product_list',
|
|
27
|
-
PRODUCT_LIST_READ = 'product_list:read',
|
|
28
13
|
PRODUCT_LIST_WRITE = 'product_list:write',
|
|
29
14
|
PRODUCT_LIST_ITEM_WRITE = 'product_list_item:write',
|
|
15
|
+
|
|
16
|
+
// Sensitive Scopes (require runtime consent)
|
|
17
|
+
ORDERS = 'orders',
|
|
30
18
|
}
|
|
31
19
|
/* eslint-enable @shopify/typescript/prefer-pascal-case-enums */
|
|
32
20
|
|
|
@@ -37,20 +25,13 @@ export const ActionToScopesMapping: {
|
|
|
37
25
|
GET_BUYER_ATTRIBUTES: Scope.PROFILE,
|
|
38
26
|
GET_CURRENT_USER: Scope.USER_SETTINGS_READ,
|
|
39
27
|
|
|
28
|
+
// Orders
|
|
29
|
+
GET_ORDERS: Scope.ORDERS,
|
|
30
|
+
|
|
40
31
|
// Shops
|
|
41
|
-
GET_FOLLOWED_SHOPS: Scope.SHOPS_FOLLOWS_READ,
|
|
42
|
-
GET_RECENT_SHOPS: Scope.SHOPS_RECENT_READ,
|
|
43
|
-
GET_RECOMMENDED_SHOPS: Scope.SHOPS_RECOMMENDATIONS_READ,
|
|
44
32
|
FOLLOW_SHOP: Scope.SHOPS_FOLLOWS_WRITE,
|
|
45
33
|
UNFOLLOW_SHOP: Scope.SHOPS_FOLLOWS_WRITE,
|
|
46
34
|
|
|
47
|
-
// Products
|
|
48
|
-
GET_RECENT_PRODUCTS: Scope.PRODUCTS_RECENT_READ,
|
|
49
|
-
GET_RECOMMENDED_PRODUCTS: Scope.PRODUCTS_RECOMMENDATIONS_READ,
|
|
50
|
-
|
|
51
|
-
// Orders
|
|
52
|
-
GET_ORDERS: Scope.ORDERS,
|
|
53
|
-
|
|
54
35
|
// Product lists
|
|
55
36
|
ADD_PRODUCT_LIST: Scope.PRODUCT_LIST_WRITE,
|
|
56
37
|
ADD_PRODUCT_LIST_ITEM: Scope.PRODUCT_LIST_ITEM_WRITE,
|
|
@@ -59,9 +40,6 @@ export const ActionToScopesMapping: {
|
|
|
59
40
|
REMOVE_PRODUCT_LIST: Scope.PRODUCT_LIST_WRITE,
|
|
60
41
|
REMOVE_PRODUCT_LIST_ITEM: Scope.PRODUCT_LIST_ITEM_WRITE,
|
|
61
42
|
RENAME_PRODUCT_LIST: Scope.PRODUCT_LIST_WRITE,
|
|
62
|
-
GET_SAVED_PRODUCTS: Scope.PRODUCT_LIST_READ,
|
|
63
|
-
GET_PRODUCT_LIST: Scope.PRODUCT_LIST_READ,
|
|
64
|
-
GET_PRODUCT_LISTS: Scope.PRODUCT_LIST_READ,
|
|
65
43
|
} as const
|
|
66
44
|
|
|
67
45
|
export const ActionToOptionalScopesMapping: {
|
package/src/types/minis.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
export interface SafeAreaInsets {
|
|
2
|
+
top: number
|
|
3
|
+
right: number
|
|
4
|
+
bottom: number
|
|
5
|
+
left: number
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
export interface MinisParams {
|
|
2
9
|
handle: string
|
|
3
10
|
initialUrl?: string
|
|
4
11
|
platform?: 'ios' | 'android' | 'web'
|
|
12
|
+
safeAreaInsets?: SafeAreaInsets
|
|
5
13
|
}
|
|
6
14
|
|
|
7
15
|
export type MiniPermission = 'CAMERA' | 'MICROPHONE' | 'MOTION'
|