@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 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.12",
4
+ "version": "0.1.0",
5
5
  "description": "Shared type definitions for Shop Minis Platform",
6
6
  "main": "src/index.ts",
7
7
  "exports": {
@@ -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
@@ -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
@@ -5,5 +5,6 @@ export * from './user'
5
5
  export * from './content'
6
6
  export * from './order'
7
7
  export * from './permissions'
8
+ export * from './share'
8
9
  export * from './query'
9
10
  export * from './minis'
@@ -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
+ }