@shopify/shop-minis-platform 0.0.9 → 0.0.11

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.0.9",
4
+ "version": "0.0.11",
5
5
  "description": "Shared type definitions for Shop Minis Platform",
6
6
  "main": "src/index.ts",
7
7
  "exports": {
@@ -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
  }
@@ -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
+ }
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @shopify/typescript/prefer-pascal-case-enums */
2
- export interface Image {
2
+ export interface ImageType {
3
3
  url: string
4
4
  altText?: string | null
5
5
  height?: number | null
@@ -16,6 +16,8 @@ export interface ContentImage {
16
16
  url: string
17
17
  width?: number | null
18
18
  height?: number | null
19
+ thumbhash?: string | null
20
+ altText?: string | null
19
21
  }
20
22
 
21
23
  export interface ContentProduct {
package/src/types/shop.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type {Image} from './content'
1
+ import type {ImageType} from './content'
2
2
  import type {ProductImage} from './product'
3
3
 
4
4
  export interface Shop {
@@ -19,8 +19,8 @@ export interface Shop {
19
19
 
20
20
  export interface VisualTheme {
21
21
  id: string
22
- logoImage?: Image | null
23
- featuredImages: Image[]
22
+ logoImage?: ImageType | null
23
+ featuredImages: ImageType[]
24
24
  description?: string | null
25
25
  brandSettings?: BrandSettings | null
26
26
  }
@@ -45,14 +45,14 @@ export interface ColorTheme {
45
45
 
46
46
  export interface LogoTheme {
47
47
  id: string
48
- logoImage?: Image | null
48
+ logoImage?: ImageType | null
49
49
  }
50
50
 
51
51
  export interface HeaderTheme {
52
52
  id: string
53
- coverImage?: Image | null
54
- thumbnailImage?: Image | null
55
- wordmark?: Image | null
53
+ coverImage?: ImageType | null
54
+ thumbnailImage?: ImageType | null
55
+ wordmark?: ImageType | null
56
56
  videoUrl?: string | null
57
57
  startingScrimColor?: string | null
58
58
  endingScrimColor?: string | null
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
+ }