@fanapps/react-native 0.3.0 → 0.4.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/README.md +40 -21
- package/dist/apple.d.mts +5 -0
- package/dist/apple.d.ts +5 -0
- package/dist/apple.js +83 -0
- package/dist/apple.js.map +1 -0
- package/dist/apple.mjs +41 -0
- package/dist/apple.mjs.map +1 -0
- package/dist/chunk-SWOKCWWX.mjs +13 -0
- package/dist/chunk-SWOKCWWX.mjs.map +1 -0
- package/dist/chunk-YZINATR6.mjs +18 -0
- package/dist/chunk-YZINATR6.mjs.map +1 -0
- package/dist/google.d.mts +5 -0
- package/dist/google.d.ts +5 -0
- package/dist/google.js +52 -0
- package/dist/google.js.map +1 -0
- package/dist/google.mjs +17 -0
- package/dist/google.mjs.map +1 -0
- package/dist/index.d.mts +3 -159
- package/dist/index.d.ts +3 -159
- package/dist/index.js +19 -234
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -251
- package/dist/index.mjs.map +1 -1
- package/dist/push.d.mts +21 -0
- package/dist/push.d.ts +21 -0
- package/dist/push.js +211 -0
- package/dist/push.js.map +1 -0
- package/dist/push.mjs +164 -0
- package/dist/push.mjs.map +1 -0
- package/dist/types-CKpYrzCw.d.mts +147 -0
- package/dist/types-CKpYrzCw.d.ts +147 -0
- package/package.json +45 -10
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape for SDK persistent storage. Matches `@react-native-async-storage/async-storage`'s
|
|
3
|
+
* default-export interface so users can pass it through directly.
|
|
4
|
+
*
|
|
5
|
+
* The interface lives in the core entry (no implementation import) so consumers who don't
|
|
6
|
+
* use push features don't pull AsyncStorage into their bundle.
|
|
7
|
+
*/
|
|
8
|
+
interface StorageAdapter {
|
|
9
|
+
getItem(key: string): Promise<string | null>;
|
|
10
|
+
setItem(key: string, value: string): Promise<void>;
|
|
11
|
+
removeItem(key: string): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type Locale = string;
|
|
15
|
+
type EntryData = Record<string, unknown>;
|
|
16
|
+
interface Entry {
|
|
17
|
+
id: string | number;
|
|
18
|
+
slug: string;
|
|
19
|
+
published: boolean;
|
|
20
|
+
date: string | null;
|
|
21
|
+
order: number | null;
|
|
22
|
+
collection: string | null;
|
|
23
|
+
blueprint: string;
|
|
24
|
+
data: EntryData;
|
|
25
|
+
created_at: string;
|
|
26
|
+
updated_at: string;
|
|
27
|
+
locale: Locale;
|
|
28
|
+
available_locales?: Locale[];
|
|
29
|
+
}
|
|
30
|
+
type ArticleStatus = 'draft' | 'scheduled' | 'published';
|
|
31
|
+
interface Article {
|
|
32
|
+
id: string | number;
|
|
33
|
+
title: string;
|
|
34
|
+
content: string;
|
|
35
|
+
status: ArticleStatus;
|
|
36
|
+
published_at: string | null;
|
|
37
|
+
featured_image_url: string | null;
|
|
38
|
+
created_at: string;
|
|
39
|
+
updated_at: string;
|
|
40
|
+
locale: Locale;
|
|
41
|
+
available_locales?: Locale[];
|
|
42
|
+
}
|
|
43
|
+
interface TriviaAnswer {
|
|
44
|
+
id: string | number;
|
|
45
|
+
text: string;
|
|
46
|
+
is_correct: boolean;
|
|
47
|
+
sort_order: number;
|
|
48
|
+
}
|
|
49
|
+
interface Trivia {
|
|
50
|
+
id: string | number;
|
|
51
|
+
title: string;
|
|
52
|
+
description: string | null;
|
|
53
|
+
featured_image_id: string | number | null;
|
|
54
|
+
featured_image?: {
|
|
55
|
+
id: string | number;
|
|
56
|
+
url: string;
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
} | null;
|
|
59
|
+
awards_points: boolean;
|
|
60
|
+
points_amount: number;
|
|
61
|
+
max_time_seconds: number | null;
|
|
62
|
+
show_correct_after: boolean;
|
|
63
|
+
starts_at: string | null;
|
|
64
|
+
ends_at: string | null;
|
|
65
|
+
answers: TriviaAnswer[];
|
|
66
|
+
responses_count?: number;
|
|
67
|
+
created_at: string;
|
|
68
|
+
updated_at: string;
|
|
69
|
+
}
|
|
70
|
+
interface TriviaResponseResult {
|
|
71
|
+
is_correct: boolean;
|
|
72
|
+
points_awarded: number;
|
|
73
|
+
correct_answer?: TriviaAnswer;
|
|
74
|
+
}
|
|
75
|
+
interface PaginationMeta {
|
|
76
|
+
current_page: number;
|
|
77
|
+
last_page: number;
|
|
78
|
+
per_page: number;
|
|
79
|
+
total: number;
|
|
80
|
+
from: number | null;
|
|
81
|
+
to: number | null;
|
|
82
|
+
path?: string;
|
|
83
|
+
}
|
|
84
|
+
interface PaginationLinks {
|
|
85
|
+
first: string | null;
|
|
86
|
+
last: string | null;
|
|
87
|
+
prev: string | null;
|
|
88
|
+
next: string | null;
|
|
89
|
+
}
|
|
90
|
+
interface Paginated<T> {
|
|
91
|
+
data: T[];
|
|
92
|
+
meta: PaginationMeta;
|
|
93
|
+
links: PaginationLinks;
|
|
94
|
+
}
|
|
95
|
+
interface PaginationParams {
|
|
96
|
+
page?: number;
|
|
97
|
+
perPage?: number;
|
|
98
|
+
sort?: string;
|
|
99
|
+
}
|
|
100
|
+
interface EntryFilters extends PaginationParams {
|
|
101
|
+
blueprint?: string;
|
|
102
|
+
collection?: string;
|
|
103
|
+
slug?: string;
|
|
104
|
+
published?: boolean;
|
|
105
|
+
}
|
|
106
|
+
interface ArticleFilters extends PaginationParams {
|
|
107
|
+
status?: ArticleStatus;
|
|
108
|
+
}
|
|
109
|
+
interface HookOptions {
|
|
110
|
+
locale?: Locale;
|
|
111
|
+
enabled?: boolean;
|
|
112
|
+
}
|
|
113
|
+
type AuthStatus = 'loading' | 'signed-in' | 'signed-out';
|
|
114
|
+
interface AuthUser {
|
|
115
|
+
uid: string;
|
|
116
|
+
email: string | null;
|
|
117
|
+
displayName: string | null;
|
|
118
|
+
photoURL: string | null;
|
|
119
|
+
phoneNumber: string | null;
|
|
120
|
+
isAnonymous: boolean;
|
|
121
|
+
providerId: string | null;
|
|
122
|
+
}
|
|
123
|
+
interface PushTarget {
|
|
124
|
+
id: string;
|
|
125
|
+
app_user_id: number | string | null;
|
|
126
|
+
identifier: string;
|
|
127
|
+
provider: 'fcm' | 'apns';
|
|
128
|
+
provider_id: string | null;
|
|
129
|
+
device_brand: string | null;
|
|
130
|
+
device_model: string | null;
|
|
131
|
+
os_name: string | null;
|
|
132
|
+
os_version: string | null;
|
|
133
|
+
last_seen_at: string | null;
|
|
134
|
+
created_at: string;
|
|
135
|
+
updated_at: string;
|
|
136
|
+
}
|
|
137
|
+
interface CreatePushTargetInput {
|
|
138
|
+
targetId: string;
|
|
139
|
+
identifier: string;
|
|
140
|
+
providerId?: string;
|
|
141
|
+
deviceBrand?: string;
|
|
142
|
+
deviceModel?: string;
|
|
143
|
+
osName?: string;
|
|
144
|
+
osVersion?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type { AuthUser as A, CreatePushTargetInput as C, EntryFilters as E, HookOptions as H, Locale as L, PushTarget as P, StorageAdapter as S, Trivia as T, AuthStatus as a, Paginated as b, Entry as c, ArticleFilters as d, Article as e, TriviaResponseResult as f, ArticleStatus as g, EntryData as h, PaginationLinks as i, PaginationMeta as j, PaginationParams as k, TriviaAnswer as l };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape for SDK persistent storage. Matches `@react-native-async-storage/async-storage`'s
|
|
3
|
+
* default-export interface so users can pass it through directly.
|
|
4
|
+
*
|
|
5
|
+
* The interface lives in the core entry (no implementation import) so consumers who don't
|
|
6
|
+
* use push features don't pull AsyncStorage into their bundle.
|
|
7
|
+
*/
|
|
8
|
+
interface StorageAdapter {
|
|
9
|
+
getItem(key: string): Promise<string | null>;
|
|
10
|
+
setItem(key: string, value: string): Promise<void>;
|
|
11
|
+
removeItem(key: string): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type Locale = string;
|
|
15
|
+
type EntryData = Record<string, unknown>;
|
|
16
|
+
interface Entry {
|
|
17
|
+
id: string | number;
|
|
18
|
+
slug: string;
|
|
19
|
+
published: boolean;
|
|
20
|
+
date: string | null;
|
|
21
|
+
order: number | null;
|
|
22
|
+
collection: string | null;
|
|
23
|
+
blueprint: string;
|
|
24
|
+
data: EntryData;
|
|
25
|
+
created_at: string;
|
|
26
|
+
updated_at: string;
|
|
27
|
+
locale: Locale;
|
|
28
|
+
available_locales?: Locale[];
|
|
29
|
+
}
|
|
30
|
+
type ArticleStatus = 'draft' | 'scheduled' | 'published';
|
|
31
|
+
interface Article {
|
|
32
|
+
id: string | number;
|
|
33
|
+
title: string;
|
|
34
|
+
content: string;
|
|
35
|
+
status: ArticleStatus;
|
|
36
|
+
published_at: string | null;
|
|
37
|
+
featured_image_url: string | null;
|
|
38
|
+
created_at: string;
|
|
39
|
+
updated_at: string;
|
|
40
|
+
locale: Locale;
|
|
41
|
+
available_locales?: Locale[];
|
|
42
|
+
}
|
|
43
|
+
interface TriviaAnswer {
|
|
44
|
+
id: string | number;
|
|
45
|
+
text: string;
|
|
46
|
+
is_correct: boolean;
|
|
47
|
+
sort_order: number;
|
|
48
|
+
}
|
|
49
|
+
interface Trivia {
|
|
50
|
+
id: string | number;
|
|
51
|
+
title: string;
|
|
52
|
+
description: string | null;
|
|
53
|
+
featured_image_id: string | number | null;
|
|
54
|
+
featured_image?: {
|
|
55
|
+
id: string | number;
|
|
56
|
+
url: string;
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
} | null;
|
|
59
|
+
awards_points: boolean;
|
|
60
|
+
points_amount: number;
|
|
61
|
+
max_time_seconds: number | null;
|
|
62
|
+
show_correct_after: boolean;
|
|
63
|
+
starts_at: string | null;
|
|
64
|
+
ends_at: string | null;
|
|
65
|
+
answers: TriviaAnswer[];
|
|
66
|
+
responses_count?: number;
|
|
67
|
+
created_at: string;
|
|
68
|
+
updated_at: string;
|
|
69
|
+
}
|
|
70
|
+
interface TriviaResponseResult {
|
|
71
|
+
is_correct: boolean;
|
|
72
|
+
points_awarded: number;
|
|
73
|
+
correct_answer?: TriviaAnswer;
|
|
74
|
+
}
|
|
75
|
+
interface PaginationMeta {
|
|
76
|
+
current_page: number;
|
|
77
|
+
last_page: number;
|
|
78
|
+
per_page: number;
|
|
79
|
+
total: number;
|
|
80
|
+
from: number | null;
|
|
81
|
+
to: number | null;
|
|
82
|
+
path?: string;
|
|
83
|
+
}
|
|
84
|
+
interface PaginationLinks {
|
|
85
|
+
first: string | null;
|
|
86
|
+
last: string | null;
|
|
87
|
+
prev: string | null;
|
|
88
|
+
next: string | null;
|
|
89
|
+
}
|
|
90
|
+
interface Paginated<T> {
|
|
91
|
+
data: T[];
|
|
92
|
+
meta: PaginationMeta;
|
|
93
|
+
links: PaginationLinks;
|
|
94
|
+
}
|
|
95
|
+
interface PaginationParams {
|
|
96
|
+
page?: number;
|
|
97
|
+
perPage?: number;
|
|
98
|
+
sort?: string;
|
|
99
|
+
}
|
|
100
|
+
interface EntryFilters extends PaginationParams {
|
|
101
|
+
blueprint?: string;
|
|
102
|
+
collection?: string;
|
|
103
|
+
slug?: string;
|
|
104
|
+
published?: boolean;
|
|
105
|
+
}
|
|
106
|
+
interface ArticleFilters extends PaginationParams {
|
|
107
|
+
status?: ArticleStatus;
|
|
108
|
+
}
|
|
109
|
+
interface HookOptions {
|
|
110
|
+
locale?: Locale;
|
|
111
|
+
enabled?: boolean;
|
|
112
|
+
}
|
|
113
|
+
type AuthStatus = 'loading' | 'signed-in' | 'signed-out';
|
|
114
|
+
interface AuthUser {
|
|
115
|
+
uid: string;
|
|
116
|
+
email: string | null;
|
|
117
|
+
displayName: string | null;
|
|
118
|
+
photoURL: string | null;
|
|
119
|
+
phoneNumber: string | null;
|
|
120
|
+
isAnonymous: boolean;
|
|
121
|
+
providerId: string | null;
|
|
122
|
+
}
|
|
123
|
+
interface PushTarget {
|
|
124
|
+
id: string;
|
|
125
|
+
app_user_id: number | string | null;
|
|
126
|
+
identifier: string;
|
|
127
|
+
provider: 'fcm' | 'apns';
|
|
128
|
+
provider_id: string | null;
|
|
129
|
+
device_brand: string | null;
|
|
130
|
+
device_model: string | null;
|
|
131
|
+
os_name: string | null;
|
|
132
|
+
os_version: string | null;
|
|
133
|
+
last_seen_at: string | null;
|
|
134
|
+
created_at: string;
|
|
135
|
+
updated_at: string;
|
|
136
|
+
}
|
|
137
|
+
interface CreatePushTargetInput {
|
|
138
|
+
targetId: string;
|
|
139
|
+
identifier: string;
|
|
140
|
+
providerId?: string;
|
|
141
|
+
deviceBrand?: string;
|
|
142
|
+
deviceModel?: string;
|
|
143
|
+
osName?: string;
|
|
144
|
+
osVersion?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type { AuthUser as A, CreatePushTargetInput as C, EntryFilters as E, HookOptions as H, Locale as L, PushTarget as P, StorageAdapter as S, Trivia as T, AuthStatus as a, Paginated as b, Entry as c, ArticleFilters as d, Article as e, TriviaResponseResult as f, ArticleStatus as g, EntryData as h, PaginationLinks as i, PaginationMeta as j, PaginationParams as k, TriviaAnswer as l };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanapps/react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "React Native SDK for the Fanapps API.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -12,6 +12,24 @@
|
|
|
12
12
|
"react-native": "./dist/index.js",
|
|
13
13
|
"import": "./dist/index.mjs",
|
|
14
14
|
"require": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./push": {
|
|
17
|
+
"types": "./dist/push.d.ts",
|
|
18
|
+
"react-native": "./dist/push.js",
|
|
19
|
+
"import": "./dist/push.mjs",
|
|
20
|
+
"require": "./dist/push.js"
|
|
21
|
+
},
|
|
22
|
+
"./google": {
|
|
23
|
+
"types": "./dist/google.d.ts",
|
|
24
|
+
"react-native": "./dist/google.js",
|
|
25
|
+
"import": "./dist/google.mjs",
|
|
26
|
+
"require": "./dist/google.js"
|
|
27
|
+
},
|
|
28
|
+
"./apple": {
|
|
29
|
+
"types": "./dist/apple.d.ts",
|
|
30
|
+
"react-native": "./dist/apple.js",
|
|
31
|
+
"import": "./dist/apple.mjs",
|
|
32
|
+
"require": "./dist/apple.js"
|
|
15
33
|
}
|
|
16
34
|
},
|
|
17
35
|
"files": [
|
|
@@ -23,21 +41,38 @@
|
|
|
23
41
|
"dev": "tsup --watch",
|
|
24
42
|
"typecheck": "tsc --noEmit"
|
|
25
43
|
},
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"@invertase/react-native-apple-authentication": "^2.4.0",
|
|
28
|
-
"@react-native-async-storage/async-storage": "^1.24.0",
|
|
29
|
-
"@react-native-firebase/auth": "^20.0.0",
|
|
30
|
-
"@react-native-firebase/messaging": "^20.0.0",
|
|
31
|
-
"@react-native-google-signin/google-signin": "^13.0.0"
|
|
32
|
-
},
|
|
33
44
|
"peerDependencies": {
|
|
34
|
-
"@react-native-
|
|
45
|
+
"@invertase/react-native-apple-authentication": ">=2",
|
|
46
|
+
"@react-native-async-storage/async-storage": ">=3.0.2",
|
|
47
|
+
"@react-native-firebase/app": ">=23",
|
|
48
|
+
"@react-native-firebase/auth": ">=23",
|
|
49
|
+
"@react-native-firebase/messaging": ">=23",
|
|
50
|
+
"@react-native-google-signin/google-signin": ">=16",
|
|
35
51
|
"@tanstack/react-query": ">=5",
|
|
36
52
|
"react": ">=18",
|
|
37
53
|
"react-native": ">=0.73"
|
|
38
54
|
},
|
|
55
|
+
"peerDependenciesMeta": {
|
|
56
|
+
"@invertase/react-native-apple-authentication": {
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
59
|
+
"@react-native-async-storage/async-storage": {
|
|
60
|
+
"optional": true
|
|
61
|
+
},
|
|
62
|
+
"@react-native-firebase/messaging": {
|
|
63
|
+
"optional": true
|
|
64
|
+
},
|
|
65
|
+
"@react-native-google-signin/google-signin": {
|
|
66
|
+
"optional": true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
39
69
|
"devDependencies": {
|
|
40
|
-
"@react-native-
|
|
70
|
+
"@invertase/react-native-apple-authentication": "^2.5.1",
|
|
71
|
+
"@react-native-async-storage/async-storage": "^3.0.2",
|
|
72
|
+
"@react-native-firebase/app": "^23.8.8",
|
|
73
|
+
"@react-native-firebase/auth": "^23.8.8",
|
|
74
|
+
"@react-native-firebase/messaging": "^23.8.8",
|
|
75
|
+
"@react-native-google-signin/google-signin": "^16.0.0",
|
|
41
76
|
"@tanstack/react-query": "^5.0.0",
|
|
42
77
|
"@types/react": "^19.0.0",
|
|
43
78
|
"react": "^19.0.0",
|