@shopify/shop-minis-platform 0.0.12 → 0.1.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/actions.ts +3 -0
- package/src/actions/params.ts +11 -0
- package/src/types/index.ts +1 -0
- package/src/types/share.ts +60 -0
package/package.json
CHANGED
package/src/actions/actions.ts
CHANGED
|
@@ -88,6 +88,8 @@ import {
|
|
|
88
88
|
GetContentResponse,
|
|
89
89
|
GenerateUserTokenResponse,
|
|
90
90
|
TranslateContentUpParams,
|
|
91
|
+
ShareSingleParams,
|
|
92
|
+
ShareSingleResponse,
|
|
91
93
|
} from './params'
|
|
92
94
|
import {ShopAction, SnakeToCamelCase} from './shared'
|
|
93
95
|
|
|
@@ -184,6 +186,7 @@ export interface ShopActionEvents {
|
|
|
184
186
|
GetPopularProductsResponse
|
|
185
187
|
>
|
|
186
188
|
SHARE: ShopAction<ShareParams, ShareResponse>
|
|
189
|
+
SHARE_SINGLE: ShopAction<ShareSingleParams, ShareSingleResponse>
|
|
187
190
|
GET_CURATED_PRODUCTS: ShopAction<
|
|
188
191
|
GetCuratedProductsParams,
|
|
189
192
|
GetCuratedProductsResponse
|
package/src/actions/params.ts
CHANGED
|
@@ -17,6 +17,9 @@ import {
|
|
|
17
17
|
ContentIdentifierInput,
|
|
18
18
|
UserTokenGenerateUserErrors,
|
|
19
19
|
GeneratedTokenData,
|
|
20
|
+
BaseShareSingleOptions,
|
|
21
|
+
InstagramShareSingleOptions,
|
|
22
|
+
FacebookShareSingleOptions,
|
|
20
23
|
} from '../types'
|
|
21
24
|
|
|
22
25
|
export interface FavoriteParams {
|
|
@@ -567,6 +570,14 @@ export interface ShareResponse {
|
|
|
567
570
|
dismissedAction?: boolean
|
|
568
571
|
}
|
|
569
572
|
|
|
573
|
+
export type ShareSingleParams =
|
|
574
|
+
| BaseShareSingleOptions
|
|
575
|
+
| InstagramShareSingleOptions
|
|
576
|
+
| FacebookShareSingleOptions
|
|
577
|
+
export interface ShareSingleResponse {
|
|
578
|
+
message: string
|
|
579
|
+
success: boolean
|
|
580
|
+
}
|
|
570
581
|
export interface GetSavedProductsParams {
|
|
571
582
|
includeSensitive?: boolean
|
|
572
583
|
first?: number
|
package/src/types/index.ts
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Based on react-native-share shareSingle parameters
|
|
2
|
+
export enum Social {
|
|
3
|
+
Facebook = 'facebook',
|
|
4
|
+
FacebookStories = 'facebookstories',
|
|
5
|
+
Pagesmanager = 'pagesmanager',
|
|
6
|
+
Twitter = 'twitter',
|
|
7
|
+
Whatsapp = 'whatsapp',
|
|
8
|
+
Whatsappbusiness = 'whatsappbusiness',
|
|
9
|
+
Instagram = 'instagram',
|
|
10
|
+
InstagramStories = 'instagramstories',
|
|
11
|
+
Googleplus = 'googleplus',
|
|
12
|
+
Email = 'email',
|
|
13
|
+
Pinterest = 'pinterest',
|
|
14
|
+
Linkedin = 'linkedin',
|
|
15
|
+
Sms = 'sms',
|
|
16
|
+
Telegram = 'telegram',
|
|
17
|
+
Snapchat = 'snapchat',
|
|
18
|
+
Messenger = 'messenger',
|
|
19
|
+
Viber = 'viber',
|
|
20
|
+
Discord = 'discord',
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface BaseShareSingleOptions {
|
|
24
|
+
appId?: string
|
|
25
|
+
urls?: string[]
|
|
26
|
+
url?: string
|
|
27
|
+
type?: string
|
|
28
|
+
filename?: string
|
|
29
|
+
message?: string
|
|
30
|
+
title?: string
|
|
31
|
+
subject?: string
|
|
32
|
+
email?: string
|
|
33
|
+
recipient?: string
|
|
34
|
+
social: Exclude<Social, Social.FacebookStories | Social.InstagramStories>
|
|
35
|
+
forceDialog?: boolean
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface InstagramShareSingleOptions
|
|
39
|
+
extends BaseSocialStoriesShareSingleOptions {
|
|
40
|
+
social: Social.InstagramStories
|
|
41
|
+
appId: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface FacebookShareSingleOptions
|
|
45
|
+
extends BaseSocialStoriesShareSingleOptions {
|
|
46
|
+
social: Social.FacebookStories
|
|
47
|
+
appId: string
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface BaseSocialStoriesShareSingleOptions
|
|
51
|
+
extends Omit<BaseShareSingleOptions, 'social'> {
|
|
52
|
+
backgroundImage?: string
|
|
53
|
+
stickerImage?: string
|
|
54
|
+
backgroundBottomColor?: string
|
|
55
|
+
backgroundTopColor?: string
|
|
56
|
+
attributionURL?: string
|
|
57
|
+
backgroundVideo?: string
|
|
58
|
+
linkUrl?: string
|
|
59
|
+
linkText?: string
|
|
60
|
+
}
|