@shopify/shop-minis-platform 0.0.9 → 0.0.10
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 +2 -0
- package/src/actions/params.ts +7 -0
- package/src/types/user.ts +34 -1
package/package.json
CHANGED
package/src/actions/actions.ts
CHANGED
|
@@ -86,6 +86,7 @@ import {
|
|
|
86
86
|
CreateContentResponse,
|
|
87
87
|
GetContentParams,
|
|
88
88
|
GetContentResponse,
|
|
89
|
+
GenerateUserTokenResponse,
|
|
89
90
|
} from './params'
|
|
90
91
|
import {ShopAction, SnakeToCamelCase} from './shared'
|
|
91
92
|
|
|
@@ -214,4 +215,5 @@ export interface ShopActionEvents {
|
|
|
214
215
|
PREVIEW_PRODUCT_IN_AR: ShopAction<PreviewProductInARParams, void>
|
|
215
216
|
CREATE_CONTENT: ShopAction<CreateContentParams, CreateContentResponse>
|
|
216
217
|
GET_CONTENT: ShopAction<GetContentParams, GetContentResponse>
|
|
218
|
+
GENERATE_USER_TOKEN: ShopAction<void, GenerateUserTokenResponse>
|
|
217
219
|
}
|
package/src/actions/params.ts
CHANGED
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
Content,
|
|
16
16
|
ContentCreateUserErrors,
|
|
17
17
|
ContentIdentifierInput,
|
|
18
|
+
UserTokenGenerateUserErrors,
|
|
19
|
+
GeneratedTokenData,
|
|
18
20
|
} from '../types'
|
|
19
21
|
|
|
20
22
|
export interface FavoriteParams {
|
|
@@ -630,3 +632,8 @@ export interface GetContentParams {
|
|
|
630
632
|
export interface GetContentResponse {
|
|
631
633
|
data: Content[]
|
|
632
634
|
}
|
|
635
|
+
|
|
636
|
+
export interface GenerateUserTokenResponse {
|
|
637
|
+
data: GeneratedTokenData
|
|
638
|
+
userErrors?: UserTokenGenerateUserErrors[]
|
|
639
|
+
}
|
package/src/types/user.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface UserProfile {
|
|
1
|
+
/* eslint-disable @shopify/typescript/prefer-pascal-case-enums */ export interface UserProfile {
|
|
2
2
|
displayName?: string | null
|
|
3
3
|
avatarImage?: {
|
|
4
4
|
url: string
|
|
@@ -17,3 +17,36 @@ export interface TaxonomyCategory {
|
|
|
17
17
|
name: string
|
|
18
18
|
ancestors?: TaxonomyCategory[]
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
export enum UserTokenGenerateUserErrorCode {
|
|
22
|
+
MINI_NOT_FOUND = 'MINI_NOT_FOUND',
|
|
23
|
+
USER_NOT_FOUND = 'USER_NOT_FOUND',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export enum UserState {
|
|
27
|
+
GUEST = 'GUEST',
|
|
28
|
+
VERIFIED = 'VERIFIED',
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type ISO8601DateTime = string
|
|
32
|
+
|
|
33
|
+
export interface UserTokenGenerateUserErrors {
|
|
34
|
+
code: UserTokenGenerateUserErrorCode
|
|
35
|
+
message: string
|
|
36
|
+
field?: string[] | null
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface GeneratedTokenData {
|
|
40
|
+
/**
|
|
41
|
+
* A temporary token for the user.
|
|
42
|
+
*/
|
|
43
|
+
token?: string | null
|
|
44
|
+
/**
|
|
45
|
+
* The expiration time of the token.
|
|
46
|
+
*/
|
|
47
|
+
expiresAt?: ISO8601DateTime | null
|
|
48
|
+
/**
|
|
49
|
+
* Whether the user is verified or a guest.
|
|
50
|
+
*/
|
|
51
|
+
userState?: UserState | null
|
|
52
|
+
}
|