@shopify/shop-minis-platform 0.13.0 → 0.14.1
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 +7 -3
- package/src/actions/actions.ts +3 -0
- package/src/actions/params.ts +27 -0
- package/src/actions/scopes.ts +1 -1
- package/src/types/minis.ts +1 -0
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/shop-minis-platform",
|
|
3
3
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.1",
|
|
5
5
|
"description": "Shared type definitions for Shop Minis Platform",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./src/index.ts",
|
|
9
|
+
"./package.json": "./package.json",
|
|
9
10
|
"./actions": "./src/actions/index.ts",
|
|
10
11
|
"./events": "./src/events/index.ts"
|
|
11
12
|
},
|
|
@@ -20,7 +21,9 @@
|
|
|
20
21
|
],
|
|
21
22
|
"dependencies": {},
|
|
22
23
|
"peerDependencies": {},
|
|
23
|
-
"devDependencies": {
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"typescript": "^5.8.3"
|
|
26
|
+
},
|
|
24
27
|
"author": "Shopify",
|
|
25
28
|
"repository": {
|
|
26
29
|
"type": "git",
|
|
@@ -29,6 +32,7 @@
|
|
|
29
32
|
},
|
|
30
33
|
"scripts": {
|
|
31
34
|
"test": "TZ=UTC jest",
|
|
32
|
-
"type-check": "tsc --noEmit"
|
|
35
|
+
"type-check": "tsc --noEmit",
|
|
36
|
+
"typecheck": "pnpm run type-check"
|
|
33
37
|
}
|
|
34
38
|
}
|
package/src/actions/actions.ts
CHANGED
|
@@ -93,6 +93,8 @@ import {
|
|
|
93
93
|
ShareSingleResponse,
|
|
94
94
|
RequestPermissionParams,
|
|
95
95
|
RequestPermissionResponse,
|
|
96
|
+
CheckPermissionParams,
|
|
97
|
+
CheckPermissionResponse,
|
|
96
98
|
ReportErrorParams,
|
|
97
99
|
ReportFetchParams,
|
|
98
100
|
} from './params'
|
|
@@ -235,6 +237,7 @@ export interface ShopActionEvents {
|
|
|
235
237
|
RequestPermissionParams,
|
|
236
238
|
RequestPermissionResponse
|
|
237
239
|
>
|
|
240
|
+
CHECK_PERMISSION: ShopAction<CheckPermissionParams, CheckPermissionResponse>
|
|
238
241
|
REPORT_ERROR: ShopAction<ReportErrorParams, void>
|
|
239
242
|
REPORT_FETCH: ShopAction<ReportFetchParams, void>
|
|
240
243
|
}
|
package/src/actions/params.ts
CHANGED
|
@@ -34,6 +34,33 @@ export interface RequestPermissionResponse {
|
|
|
34
34
|
errorMessage?: string
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* The current state of a permission for the Mini.
|
|
39
|
+
*
|
|
40
|
+
* - `granted`: The user has approved the in-app consent dialog and the OS has granted the permission.
|
|
41
|
+
* - `denied`: The user has previously denied the permission, either in the in-app consent dialog or at the OS level. The permission can still be requested again.
|
|
42
|
+
* - `blocked`: The permission is blocked at the OS level. The user must enable it from device settings.
|
|
43
|
+
* - `undetermined`: The user has not yet been shown the in-app consent dialog for this permission.
|
|
44
|
+
* - `unavailable`: The permission is not declared in the Mini's manifest, or the feature is not available on this device.
|
|
45
|
+
*
|
|
46
|
+
* @publicDocs
|
|
47
|
+
*/
|
|
48
|
+
export type PermissionStatus =
|
|
49
|
+
| 'granted'
|
|
50
|
+
| 'denied'
|
|
51
|
+
| 'blocked'
|
|
52
|
+
| 'undetermined'
|
|
53
|
+
| 'unavailable'
|
|
54
|
+
|
|
55
|
+
export interface CheckPermissionParams {
|
|
56
|
+
permission: MiniPermission
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface CheckPermissionResponse {
|
|
60
|
+
status: PermissionStatus
|
|
61
|
+
errorMessage?: string
|
|
62
|
+
}
|
|
63
|
+
|
|
37
64
|
export interface FavoriteParams {
|
|
38
65
|
shopId: string
|
|
39
66
|
productId: string
|
package/src/actions/scopes.ts
CHANGED
package/src/types/minis.ts
CHANGED