@ua/capacitor-airship 1.0.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 +12 -0
- package/UaCapacitorAirship.podspec +18 -0
- package/android/build.gradle +72 -0
- package/android/src/main/AndroidManifest.xml +33 -0
- package/android/src/main/java/com/airship/capacitor/AirshipCapacitorVersion.kt +7 -0
- package/android/src/main/java/com/airship/capacitor/AirshipPlugin.kt +331 -0
- package/android/src/main/java/com/airship/capacitor/CapacitorAutopilot.kt +39 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/esm/AirshipActions.d.ts +18 -0
- package/dist/esm/AirshipActions.js +20 -0
- package/dist/esm/AirshipActions.js.map +1 -0
- package/dist/esm/AirshipAnalytics.d.ts +30 -0
- package/dist/esm/AirshipAnalytics.js +39 -0
- package/dist/esm/AirshipAnalytics.js.map +1 -0
- package/dist/esm/AirshipChannel.d.ts +61 -0
- package/dist/esm/AirshipChannel.js +87 -0
- package/dist/esm/AirshipChannel.js.map +1 -0
- package/dist/esm/AirshipContact.d.ts +48 -0
- package/dist/esm/AirshipContact.js +68 -0
- package/dist/esm/AirshipContact.js.map +1 -0
- package/dist/esm/AirshipFeatureFlagManager.d.ts +24 -0
- package/dist/esm/AirshipFeatureFlagManager.js +28 -0
- package/dist/esm/AirshipFeatureFlagManager.js.map +1 -0
- package/dist/esm/AirshipInApp.d.ts +30 -0
- package/dist/esm/AirshipInApp.js +39 -0
- package/dist/esm/AirshipInApp.js.map +1 -0
- package/dist/esm/AirshipLocale.d.ts +24 -0
- package/dist/esm/AirshipLocale.js +31 -0
- package/dist/esm/AirshipLocale.js.map +1 -0
- package/dist/esm/AirshipMessageCenter.d.ts +77 -0
- package/dist/esm/AirshipMessageCenter.js +99 -0
- package/dist/esm/AirshipMessageCenter.js.map +1 -0
- package/dist/esm/AirshipPlugin.d.ts +31 -0
- package/dist/esm/AirshipPlugin.js +15 -0
- package/dist/esm/AirshipPlugin.js.map +1 -0
- package/dist/esm/AirshipPreferenceCenter.d.ts +38 -0
- package/dist/esm/AirshipPreferenceCenter.js +49 -0
- package/dist/esm/AirshipPreferenceCenter.js.map +1 -0
- package/dist/esm/AirshipPrivacyManager.d.ts +38 -0
- package/dist/esm/AirshipPrivacyManager.js +48 -0
- package/dist/esm/AirshipPrivacyManager.js.map +1 -0
- package/dist/esm/AirshipPush.d.ts +184 -0
- package/dist/esm/AirshipPush.js +232 -0
- package/dist/esm/AirshipPush.js.map +1 -0
- package/dist/esm/AirshipRoot.d.ts +49 -0
- package/dist/esm/AirshipRoot.js +55 -0
- package/dist/esm/AirshipRoot.js.map +1 -0
- package/dist/esm/AttributeEditor.d.ts +54 -0
- package/dist/esm/AttributeEditor.js +76 -0
- package/dist/esm/AttributeEditor.js.map +1 -0
- package/dist/esm/EventType.d.ts +25 -0
- package/dist/esm/EventType.js +14 -0
- package/dist/esm/EventType.js.map +1 -0
- package/dist/esm/ScopedSubscriptionListEditor.d.ts +59 -0
- package/dist/esm/ScopedSubscriptionListEditor.js +62 -0
- package/dist/esm/ScopedSubscriptionListEditor.js.map +1 -0
- package/dist/esm/SubscriptionListEditor.d.ts +50 -0
- package/dist/esm/SubscriptionListEditor.js +56 -0
- package/dist/esm/SubscriptionListEditor.js.map +1 -0
- package/dist/esm/TagEditor.d.ts +46 -0
- package/dist/esm/TagEditor.js +46 -0
- package/dist/esm/TagEditor.js.map +1 -0
- package/dist/esm/TagGroupEditor.d.ts +60 -0
- package/dist/esm/TagGroupEditor.js +60 -0
- package/dist/esm/TagGroupEditor.js.map +1 -0
- package/dist/esm/index.d.ts +20 -0
- package/dist/esm/index.js +25 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types.d.ts +651 -0
- package/dist/esm/types.js +167 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/plugin.cjs.js +1278 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +1281 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/AirshipCapacitorAutopilot.swift +94 -0
- package/ios/Plugin/AirshipCapacitorBootstrap.h +8 -0
- package/ios/Plugin/AirshipCapacitorBootstrap.m +24 -0
- package/ios/Plugin/AirshipCapacitorVersion.swift +7 -0
- package/ios/Plugin/AirshipPlugin.h +7 -0
- package/ios/Plugin/AirshipPlugin.m +9 -0
- package/ios/Plugin/AirshipPlugin.swift +557 -0
- package/ios/Plugin/Info.plist +24 -0
- package/package.json +75 -0
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
export declare type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
|
|
2
|
+
export declare type JsonObject = {
|
|
3
|
+
[key: string]: JsonValue;
|
|
4
|
+
};
|
|
5
|
+
export declare type JsonArray = JsonValue[];
|
|
6
|
+
export interface ChannelCreatedEvent {
|
|
7
|
+
/**
|
|
8
|
+
* The channel ID.
|
|
9
|
+
*/
|
|
10
|
+
channelId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PushTokenReceivedEvent {
|
|
13
|
+
/**
|
|
14
|
+
* The push token.
|
|
15
|
+
*/
|
|
16
|
+
pushToken: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Event fired when a push is received.
|
|
20
|
+
*/
|
|
21
|
+
export interface PushReceivedEvent {
|
|
22
|
+
pushPayload: PushPayload;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The push payload.
|
|
26
|
+
*/
|
|
27
|
+
export interface PushPayload {
|
|
28
|
+
/**
|
|
29
|
+
* The alert.
|
|
30
|
+
*/
|
|
31
|
+
alert?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The title.
|
|
34
|
+
*/
|
|
35
|
+
title?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The subtitle.
|
|
38
|
+
*/
|
|
39
|
+
subtitle?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The notification ID.
|
|
42
|
+
*/
|
|
43
|
+
notificationId?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The notification extras.
|
|
46
|
+
*/
|
|
47
|
+
extras: JsonObject;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Event fired when the user initiates a notification response.
|
|
51
|
+
*/
|
|
52
|
+
export interface NotificationResponseEvent {
|
|
53
|
+
/**
|
|
54
|
+
* The push notification.
|
|
55
|
+
*/
|
|
56
|
+
pushPayload: PushPayload;
|
|
57
|
+
/**
|
|
58
|
+
* The action button ID, if available.
|
|
59
|
+
*/
|
|
60
|
+
actionId?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Indicates whether the response was a foreground action.
|
|
63
|
+
* This value is always if the user taps the main notification,
|
|
64
|
+
* otherwise it is defined by the notification action button.
|
|
65
|
+
*/
|
|
66
|
+
isForeground: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Push notification status.
|
|
70
|
+
*/
|
|
71
|
+
export interface PushNotificationStatus {
|
|
72
|
+
/**
|
|
73
|
+
* If user notifications are enabled on [Airship.push].
|
|
74
|
+
*/
|
|
75
|
+
isUserNotificationsEnabled: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* If notifications are allowed at the system level for the application.
|
|
78
|
+
*/
|
|
79
|
+
areNotificationsAllowed: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* If the push feature is enabled on [Airship.privacyManager].
|
|
82
|
+
*/
|
|
83
|
+
isPushPrivacyFeatureEnabled: boolean;
|
|
84
|
+
isPushTokenRegistered: boolean;
|
|
85
|
+
isOptedIn: boolean;
|
|
86
|
+
isUserOptedIn: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Event fired when the notification status changes.
|
|
90
|
+
*/
|
|
91
|
+
export interface PushNotificationStatusChangedEvent {
|
|
92
|
+
/**
|
|
93
|
+
* The push notification status.
|
|
94
|
+
*/
|
|
95
|
+
status: PushNotificationStatus;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Event fired when the Message Center is updated.
|
|
99
|
+
*/
|
|
100
|
+
export interface MessageCenterUpdatedEvent {
|
|
101
|
+
/**
|
|
102
|
+
* The unread message count.
|
|
103
|
+
*/
|
|
104
|
+
messageUnreadCount: number;
|
|
105
|
+
/**
|
|
106
|
+
* The total message count.
|
|
107
|
+
*/
|
|
108
|
+
messageCount: number;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Event fired when the Message Center is requested to be displayed.
|
|
112
|
+
*/
|
|
113
|
+
export interface DisplayMessageCenterEvent {
|
|
114
|
+
/**
|
|
115
|
+
* The message ID, if available.
|
|
116
|
+
*/
|
|
117
|
+
messageId?: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Event fired when a deep link is opened.
|
|
121
|
+
*/
|
|
122
|
+
export interface DeepLinkEvent {
|
|
123
|
+
/**
|
|
124
|
+
* The deep link string.
|
|
125
|
+
*/
|
|
126
|
+
deepLink: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Event fired when a preference center is requested to be displayed.
|
|
130
|
+
*/
|
|
131
|
+
export interface DisplayPreferenceCenterEvent {
|
|
132
|
+
/**
|
|
133
|
+
* The preference center Id.
|
|
134
|
+
*/
|
|
135
|
+
preferenceCenterId: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Custom event
|
|
139
|
+
*/
|
|
140
|
+
export interface CustomEvent {
|
|
141
|
+
/**
|
|
142
|
+
* Event name
|
|
143
|
+
*/
|
|
144
|
+
eventName: string;
|
|
145
|
+
/**
|
|
146
|
+
* Event value
|
|
147
|
+
*/
|
|
148
|
+
eventValue?: number;
|
|
149
|
+
/**
|
|
150
|
+
* Event properties
|
|
151
|
+
*/
|
|
152
|
+
properties: JsonObject;
|
|
153
|
+
/**
|
|
154
|
+
* Transaction ID
|
|
155
|
+
*/
|
|
156
|
+
transactionId?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Interaction ID
|
|
159
|
+
*/
|
|
160
|
+
interactionId?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Interaction type
|
|
163
|
+
*/
|
|
164
|
+
interactionType?: string;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* iOS options
|
|
168
|
+
*/
|
|
169
|
+
export declare namespace iOS {
|
|
170
|
+
/**
|
|
171
|
+
* Quiet time
|
|
172
|
+
*/
|
|
173
|
+
interface QuietTime {
|
|
174
|
+
/**
|
|
175
|
+
* Start hour. Must be 0-23.
|
|
176
|
+
*/
|
|
177
|
+
startHour: number;
|
|
178
|
+
/**
|
|
179
|
+
* Start minute. Must be 0-59.
|
|
180
|
+
*/
|
|
181
|
+
startMinute: number;
|
|
182
|
+
/**
|
|
183
|
+
* End hour. Must be 0-23.
|
|
184
|
+
*/
|
|
185
|
+
endHour: number;
|
|
186
|
+
/**
|
|
187
|
+
* End minute. Must be 0-59.
|
|
188
|
+
*/
|
|
189
|
+
endMinute: number;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Enum of notification options. iOS only.
|
|
193
|
+
*/
|
|
194
|
+
enum NotificationOption {
|
|
195
|
+
/**
|
|
196
|
+
* Alerts.
|
|
197
|
+
*/
|
|
198
|
+
Alert = "alert",
|
|
199
|
+
/**
|
|
200
|
+
* Sounds.
|
|
201
|
+
*/
|
|
202
|
+
Sound = "sound",
|
|
203
|
+
/**
|
|
204
|
+
* Badges.
|
|
205
|
+
*/
|
|
206
|
+
Badge = "badge",
|
|
207
|
+
/**
|
|
208
|
+
* Car play.
|
|
209
|
+
*/
|
|
210
|
+
CarPlay = "car_play",
|
|
211
|
+
/**
|
|
212
|
+
* Critical Alert.
|
|
213
|
+
*/
|
|
214
|
+
CriticalAlert = "critical_alert",
|
|
215
|
+
/**
|
|
216
|
+
* Provides app notification settings.
|
|
217
|
+
*/
|
|
218
|
+
ProvidesAppNotificationSettings = "provides_app_notification_settings",
|
|
219
|
+
/**
|
|
220
|
+
* Provisional.
|
|
221
|
+
*/
|
|
222
|
+
Provisional = "provisional"
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Enum of foreground notification options.
|
|
226
|
+
*/
|
|
227
|
+
enum ForegroundPresentationOption {
|
|
228
|
+
/**
|
|
229
|
+
* Play the sound associated with the notification.
|
|
230
|
+
*/
|
|
231
|
+
Sound = "sound",
|
|
232
|
+
/**
|
|
233
|
+
* Apply the notification's badge value to the app’s icon.
|
|
234
|
+
*/
|
|
235
|
+
Badge = "badge",
|
|
236
|
+
/**
|
|
237
|
+
* Show the notification in Notification Center. On iOS 13 an older,
|
|
238
|
+
* this will also show the notification as a banner.
|
|
239
|
+
*/
|
|
240
|
+
List = "list",
|
|
241
|
+
/**
|
|
242
|
+
* Present the notification as a banner. On iOS 13 an older,
|
|
243
|
+
* this will also show the notification in the Notification Center.
|
|
244
|
+
*/
|
|
245
|
+
Banner = "banner"
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Enum of authorized notification options.
|
|
249
|
+
*/
|
|
250
|
+
enum AuthorizedNotificationSetting {
|
|
251
|
+
/**
|
|
252
|
+
* Alerts.
|
|
253
|
+
*/
|
|
254
|
+
Alert = "alert",
|
|
255
|
+
/**
|
|
256
|
+
* Sounds.
|
|
257
|
+
*/
|
|
258
|
+
Sound = "sound",
|
|
259
|
+
/**
|
|
260
|
+
* Badges.
|
|
261
|
+
*/
|
|
262
|
+
Badge = "badge",
|
|
263
|
+
/**
|
|
264
|
+
* CarPlay.
|
|
265
|
+
*/
|
|
266
|
+
CarPlay = "car_play",
|
|
267
|
+
/**
|
|
268
|
+
* Lock screen.
|
|
269
|
+
*/
|
|
270
|
+
LockScreen = "lock_screen",
|
|
271
|
+
/**
|
|
272
|
+
* Notification center.
|
|
273
|
+
*/
|
|
274
|
+
NotificationCenter = "notification_center",
|
|
275
|
+
/**
|
|
276
|
+
* Critical alert.
|
|
277
|
+
*/
|
|
278
|
+
CriticalAlert = "critical_alert",
|
|
279
|
+
/**
|
|
280
|
+
* Announcement.
|
|
281
|
+
*/
|
|
282
|
+
Announcement = "announcement",
|
|
283
|
+
/**
|
|
284
|
+
* Scheduled delivery.
|
|
285
|
+
*/
|
|
286
|
+
ScheduledDelivery = "scheduled_delivery",
|
|
287
|
+
/**
|
|
288
|
+
* Time sensitive.
|
|
289
|
+
*/
|
|
290
|
+
TimeSensitive = "time_sensitive"
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Enum of authorized status.
|
|
294
|
+
*/
|
|
295
|
+
enum AuthorizedNotificationStatus {
|
|
296
|
+
/**
|
|
297
|
+
* Not determined.
|
|
298
|
+
*/
|
|
299
|
+
NotDetermined = "not_determined",
|
|
300
|
+
/**
|
|
301
|
+
* Denied.
|
|
302
|
+
*/
|
|
303
|
+
Denied = "denied",
|
|
304
|
+
/**
|
|
305
|
+
* Authorized.
|
|
306
|
+
*/
|
|
307
|
+
Authorized = "authorized",
|
|
308
|
+
/**
|
|
309
|
+
* Provisional.
|
|
310
|
+
*/
|
|
311
|
+
Provisional = "provisional",
|
|
312
|
+
/**
|
|
313
|
+
* Ephemeral.
|
|
314
|
+
*/
|
|
315
|
+
Ephemeral = "ephemeral"
|
|
316
|
+
}
|
|
317
|
+
interface AuthorizedNotificationSettingsChangedEvent {
|
|
318
|
+
/**
|
|
319
|
+
* Authorized settings.
|
|
320
|
+
*/
|
|
321
|
+
authorizedSettings: AuthorizedNotificationSetting[];
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
export declare namespace Android {
|
|
325
|
+
/**
|
|
326
|
+
* Android notification config.
|
|
327
|
+
*/
|
|
328
|
+
interface NotificationConfig {
|
|
329
|
+
/**
|
|
330
|
+
* The icon resource name.
|
|
331
|
+
*/
|
|
332
|
+
icon?: string;
|
|
333
|
+
/**
|
|
334
|
+
* The large icon resource name.
|
|
335
|
+
*/
|
|
336
|
+
largeIcon?: string;
|
|
337
|
+
/**
|
|
338
|
+
* The default android notification channel ID.
|
|
339
|
+
*/
|
|
340
|
+
defaultChannelId?: string;
|
|
341
|
+
/**
|
|
342
|
+
* The accent color. Must be a hex value #AARRGGBB.
|
|
343
|
+
*/
|
|
344
|
+
accentColor?: string;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Airship config environment
|
|
349
|
+
*/
|
|
350
|
+
export interface ConfigEnvironment {
|
|
351
|
+
/**
|
|
352
|
+
* App key.
|
|
353
|
+
*/
|
|
354
|
+
appKey: string;
|
|
355
|
+
/**
|
|
356
|
+
* App secret.
|
|
357
|
+
*/
|
|
358
|
+
appSecret: string;
|
|
359
|
+
/**
|
|
360
|
+
* Optional log level.
|
|
361
|
+
*/
|
|
362
|
+
logLevel?: LogLevel;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Possible sites.
|
|
366
|
+
*/
|
|
367
|
+
export declare type Site = 'us' | 'eu';
|
|
368
|
+
/**
|
|
369
|
+
* Log levels.
|
|
370
|
+
*/
|
|
371
|
+
export declare type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'none';
|
|
372
|
+
/**
|
|
373
|
+
* Airship config
|
|
374
|
+
*/
|
|
375
|
+
export interface AirshipConfig {
|
|
376
|
+
/**
|
|
377
|
+
* Default environment.
|
|
378
|
+
*/
|
|
379
|
+
default?: ConfigEnvironment;
|
|
380
|
+
/**
|
|
381
|
+
* Development environment. Overrides default environment if inProduction is false.
|
|
382
|
+
*/
|
|
383
|
+
development?: ConfigEnvironment;
|
|
384
|
+
/**
|
|
385
|
+
* Production environment. Overrides default environment if inProduction is true.
|
|
386
|
+
*/
|
|
387
|
+
production?: ConfigEnvironment;
|
|
388
|
+
/**
|
|
389
|
+
* Cloud site.
|
|
390
|
+
*/
|
|
391
|
+
site?: Site;
|
|
392
|
+
/**
|
|
393
|
+
* Switches the environment from development or production. If the value is not
|
|
394
|
+
* set, Airship will determine the value at runtime.
|
|
395
|
+
*/
|
|
396
|
+
inProduction?: boolean;
|
|
397
|
+
/**
|
|
398
|
+
* URL allow list.
|
|
399
|
+
*/
|
|
400
|
+
urlAllowList?: string[];
|
|
401
|
+
/**
|
|
402
|
+
* URL allow list for open URL scope.
|
|
403
|
+
*/
|
|
404
|
+
urlAllowListScopeOpenUrl?: string[];
|
|
405
|
+
/**
|
|
406
|
+
* URL allow list for JS bridge injection.
|
|
407
|
+
*/
|
|
408
|
+
urlAllowListScopeJavaScriptInterface?: string[];
|
|
409
|
+
/**
|
|
410
|
+
* Enables delayed channel creation.
|
|
411
|
+
* Deprecated. Use the Private Manager to disable all features instead.
|
|
412
|
+
*/
|
|
413
|
+
isChannelCreationDelayEnabled?: boolean;
|
|
414
|
+
/**
|
|
415
|
+
* Initial config URL for custom Airship domains. The URL
|
|
416
|
+
* should also be added to the urlAllowList.
|
|
417
|
+
*/
|
|
418
|
+
initialConfigUrl?: string;
|
|
419
|
+
/**
|
|
420
|
+
* Enabled features. Defaults to all.
|
|
421
|
+
*/
|
|
422
|
+
enabledFeatures?: Feature[];
|
|
423
|
+
/**
|
|
424
|
+
* Enables channel capture feature.
|
|
425
|
+
* This config is enabled by default.
|
|
426
|
+
*/
|
|
427
|
+
isChannelCaptureEnabled?: boolean;
|
|
428
|
+
/**
|
|
429
|
+
* Whether to suppress console error messages about missing allow list entries during takeOff.
|
|
430
|
+
* This config is disabled by default.
|
|
431
|
+
*/
|
|
432
|
+
suppressAllowListError?: boolean;
|
|
433
|
+
/**
|
|
434
|
+
* Pauses In-App Automation on launch.
|
|
435
|
+
*/
|
|
436
|
+
autoPauseInAppAutomationOnLaunch?: boolean;
|
|
437
|
+
/**
|
|
438
|
+
* iOS config.
|
|
439
|
+
*/
|
|
440
|
+
ios?: {
|
|
441
|
+
/**
|
|
442
|
+
* itunesId for rate app and app store deep links.
|
|
443
|
+
*/
|
|
444
|
+
itunesId?: string;
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* Android config.
|
|
448
|
+
*/
|
|
449
|
+
android?: {
|
|
450
|
+
/**
|
|
451
|
+
* App store URI
|
|
452
|
+
*/
|
|
453
|
+
appStoreUri?: string;
|
|
454
|
+
/**
|
|
455
|
+
* Fcm app name if using multiple FCM projects.
|
|
456
|
+
*/
|
|
457
|
+
fcmFirebaseAppName?: string;
|
|
458
|
+
/**
|
|
459
|
+
* Notification config.
|
|
460
|
+
*/
|
|
461
|
+
notificationConfig?: Android.NotificationConfig;
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Enum of authorized Features.
|
|
466
|
+
*/
|
|
467
|
+
export declare enum Feature {
|
|
468
|
+
InAppAutomation = "in_app_automation",
|
|
469
|
+
MessageCenter = "message_center",
|
|
470
|
+
Push = "push",
|
|
471
|
+
Chat = "chat",
|
|
472
|
+
Analytics = "analytics",
|
|
473
|
+
TagsAndAttributes = "tags_and_attributes",
|
|
474
|
+
Contacts = "contacts",
|
|
475
|
+
Location = "location"
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* All available features.
|
|
479
|
+
*/
|
|
480
|
+
export declare const FEATURES_ALL: Feature[];
|
|
481
|
+
/**
|
|
482
|
+
* Subscription Scope types.
|
|
483
|
+
*/
|
|
484
|
+
export declare enum SubscriptionScope {
|
|
485
|
+
App = "app",
|
|
486
|
+
Web = "web",
|
|
487
|
+
Sms = "sms",
|
|
488
|
+
Email = "email"
|
|
489
|
+
}
|
|
490
|
+
export interface InboxMessage {
|
|
491
|
+
/**
|
|
492
|
+
* The message ID. Needed to display, mark as read, or delete the message.
|
|
493
|
+
*/
|
|
494
|
+
id: string;
|
|
495
|
+
/**
|
|
496
|
+
* The message title.
|
|
497
|
+
*/
|
|
498
|
+
title: string;
|
|
499
|
+
/**
|
|
500
|
+
* The message sent date in milliseconds.
|
|
501
|
+
*/
|
|
502
|
+
sentDate: number;
|
|
503
|
+
/**
|
|
504
|
+
* Optional - The icon url for the message.
|
|
505
|
+
*/
|
|
506
|
+
listIconUrl: string;
|
|
507
|
+
/**
|
|
508
|
+
* The unread / read status of the message.
|
|
509
|
+
*/
|
|
510
|
+
isRead: boolean;
|
|
511
|
+
/**
|
|
512
|
+
* String to String map of any message extras.
|
|
513
|
+
*/
|
|
514
|
+
extras: Record<string, string>;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* A preference center definition.
|
|
518
|
+
*
|
|
519
|
+
* @typedef {object} PreferenceCenter
|
|
520
|
+
* @property {string} id the ID of the preference center
|
|
521
|
+
* @property {Array<PreferenceCenter.CommonSection>} sections a list of sections
|
|
522
|
+
* @property {?CommonDisplay} display display information
|
|
523
|
+
*/
|
|
524
|
+
export declare type PreferenceCenter = {
|
|
525
|
+
id: string;
|
|
526
|
+
sections: Section[];
|
|
527
|
+
display?: CommonDisplay;
|
|
528
|
+
};
|
|
529
|
+
/**
|
|
530
|
+
* Preference center display information.
|
|
531
|
+
* @typedef {object} CommonDisplay
|
|
532
|
+
* @property {string} name
|
|
533
|
+
* @property {?string} description
|
|
534
|
+
*/
|
|
535
|
+
export declare type CommonDisplay = {
|
|
536
|
+
name: string;
|
|
537
|
+
description?: string;
|
|
538
|
+
};
|
|
539
|
+
export declare type Icon = {
|
|
540
|
+
icon: string;
|
|
541
|
+
};
|
|
542
|
+
export declare type IconDisplay = CommonDisplay & Partial<Icon>;
|
|
543
|
+
export interface ItemBase {
|
|
544
|
+
type: unknown;
|
|
545
|
+
id: string;
|
|
546
|
+
display: CommonDisplay;
|
|
547
|
+
conditions?: Condition[];
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* A channel subscription item.
|
|
551
|
+
* @typedef {object} ChannelSubscriptionItem
|
|
552
|
+
* @memberof PreferenceCenter
|
|
553
|
+
* @property {"channel_subscription"} type
|
|
554
|
+
* @property {string} id the item identifier
|
|
555
|
+
* @property {?CommonDisplay} display display information
|
|
556
|
+
* @property {string} subscription_id the subscription list id
|
|
557
|
+
*/
|
|
558
|
+
export interface ChannelSubscriptionItem extends ItemBase {
|
|
559
|
+
type: 'channel_subscription';
|
|
560
|
+
subscription_id: string;
|
|
561
|
+
}
|
|
562
|
+
export interface ContactSubscriptionGroupItem extends ItemBase {
|
|
563
|
+
type: 'contact_subscription_group';
|
|
564
|
+
id: string;
|
|
565
|
+
subscription_id: string;
|
|
566
|
+
components: ContactSubscriptionGroupItemComponent[];
|
|
567
|
+
}
|
|
568
|
+
export interface ContactSubscriptionGroupItemComponent {
|
|
569
|
+
scopes: SubscriptionScope[];
|
|
570
|
+
display: Omit<CommonDisplay, 'description'>;
|
|
571
|
+
}
|
|
572
|
+
export interface ContactSubscriptionItem extends ItemBase {
|
|
573
|
+
type: 'contact_subscription';
|
|
574
|
+
scopes: SubscriptionScope[];
|
|
575
|
+
subscription_id: string;
|
|
576
|
+
}
|
|
577
|
+
export interface AlertItem extends ItemBase {
|
|
578
|
+
type: 'alert';
|
|
579
|
+
display: IconDisplay;
|
|
580
|
+
button?: Button;
|
|
581
|
+
}
|
|
582
|
+
export interface ConditionBase {
|
|
583
|
+
type: unknown;
|
|
584
|
+
}
|
|
585
|
+
export interface NotificationOptInCondition extends ConditionBase {
|
|
586
|
+
type: 'notification_opt_in';
|
|
587
|
+
when_status: 'opt_in' | 'opt_out';
|
|
588
|
+
}
|
|
589
|
+
export declare type Condition = NotificationOptInCondition;
|
|
590
|
+
export declare type Actions = {
|
|
591
|
+
[key: string]: JsonValue;
|
|
592
|
+
};
|
|
593
|
+
export interface Button {
|
|
594
|
+
text: string;
|
|
595
|
+
content_description?: string;
|
|
596
|
+
actions: Actions;
|
|
597
|
+
}
|
|
598
|
+
export interface SectionBase {
|
|
599
|
+
type: unknown;
|
|
600
|
+
id: string;
|
|
601
|
+
display?: CommonDisplay;
|
|
602
|
+
items: Item[];
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* @typedef {object} CommonSection
|
|
606
|
+
* @memberof PreferenceCenter
|
|
607
|
+
* @property {"section"} type
|
|
608
|
+
* @property {string} id the section identifier
|
|
609
|
+
* @property {?CommonDisplay} display display information
|
|
610
|
+
* @property {Array<PreferenceCenter.ChannelSubscriptionItem>} items list of
|
|
611
|
+
* section items
|
|
612
|
+
*/
|
|
613
|
+
export interface CommonSection extends SectionBase {
|
|
614
|
+
type: 'section';
|
|
615
|
+
}
|
|
616
|
+
export interface LabeledSectionBreak extends SectionBase {
|
|
617
|
+
type: 'labeled_section_break';
|
|
618
|
+
items: never;
|
|
619
|
+
}
|
|
620
|
+
export declare type Item = ChannelSubscriptionItem | ContactSubscriptionGroupItem | ContactSubscriptionItem | AlertItem;
|
|
621
|
+
export declare type Section = CommonSection | LabeledSectionBreak;
|
|
622
|
+
/**
|
|
623
|
+
* An interface representing the eligibility status of a flag, and optional
|
|
624
|
+
* variables associated with the flag.
|
|
625
|
+
*/
|
|
626
|
+
export interface FeatureFlag {
|
|
627
|
+
/**
|
|
628
|
+
* A boolean representing flag eligibility; will be `true` if the current
|
|
629
|
+
* contact is eligible for the flag.
|
|
630
|
+
*/
|
|
631
|
+
readonly isEligible: boolean;
|
|
632
|
+
/**
|
|
633
|
+
* A variables associated with the flag, if any. Will be `null` if no data
|
|
634
|
+
* is associated with the flag, or if the flag does not exist.
|
|
635
|
+
*/
|
|
636
|
+
readonly variables: unknown | null;
|
|
637
|
+
/**
|
|
638
|
+
* A boolean representing if the flag exists or not. For ease of use and
|
|
639
|
+
* deployment, asking for a flag by any name will return a `FeatureFlag`
|
|
640
|
+
* interface, even if the flag was not found to exist. However this property
|
|
641
|
+
* may be checked to determine if the flag was actually resolved to a known
|
|
642
|
+
* flag name.
|
|
643
|
+
*/
|
|
644
|
+
readonly exists: boolean;
|
|
645
|
+
/**
|
|
646
|
+
* Reporting Metadata, the shape of which is private and not to be relied
|
|
647
|
+
* upon. When not provided, an interaction cannot be tracked on the flag.
|
|
648
|
+
* @ignore
|
|
649
|
+
*/
|
|
650
|
+
readonly _internal: unknown;
|
|
651
|
+
}
|