@ua/capacitor-airship 2.2.0 → 2.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.
Files changed (33) hide show
  1. package/UaCapacitorAirship.podspec +2 -12
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/airship/capacitor/AirshipCapacitorVersion.kt +1 -1
  4. package/android/src/main/java/com/airship/capacitor/AirshipPlugin.kt +31 -1
  5. package/android/src/main/java/com/airship/capacitor/CapacitorAutopilot.kt +1 -3
  6. package/dist/esm/AirshipLiveActivityManager.d.ts +44 -0
  7. package/dist/esm/AirshipLiveActivityManager.js +56 -0
  8. package/dist/esm/AirshipLiveActivityManager.js.map +1 -0
  9. package/dist/esm/AirshipLiveUpdateManager.d.ts +43 -0
  10. package/dist/esm/AirshipLiveUpdateManager.js +55 -0
  11. package/dist/esm/AirshipLiveUpdateManager.js.map +1 -0
  12. package/dist/esm/AirshipRoot.d.ts +18 -0
  13. package/dist/esm/AirshipRoot.js +14 -0
  14. package/dist/esm/AirshipRoot.js.map +1 -1
  15. package/dist/esm/EventType.d.ts +4 -2
  16. package/dist/esm/EventType.js +1 -0
  17. package/dist/esm/EventType.js.map +1 -1
  18. package/dist/esm/index.d.ts +2 -0
  19. package/dist/esm/index.js +2 -0
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/esm/types.d.ts +230 -0
  22. package/dist/esm/types.js.map +1 -1
  23. package/dist/plugin.cjs.js +125 -0
  24. package/dist/plugin.cjs.js.map +1 -1
  25. package/dist/plugin.js +125 -0
  26. package/dist/plugin.js.map +1 -1
  27. package/ios/Plugin/AirshipCapacitorAutopilot.swift +1 -4
  28. package/ios/Plugin/AirshipCapacitorVersion.swift +1 -1
  29. package/ios/Plugin/AirshipPlugin.swift +50 -2
  30. package/ios/Plugin/AirshipPluginLoader.swift +11 -0
  31. package/package.json +1 -1
  32. package/ios/Bootloader/AirshipCapacitorBootstrap.m +0 -25
  33. package/ios/Bootloader/Public/AirshipCapacitorBootstrap.h +0 -8
@@ -172,6 +172,15 @@ export interface DisplayPreferenceCenterEvent {
172
172
  */
173
173
  preferenceCenterId: string;
174
174
  }
175
+ /**
176
+ * Event fired whenever any of the Live Activities update, create, or end.
177
+ */
178
+ export interface LiveActivitiesUpdatedEvent {
179
+ /**
180
+ * The Live Activities.
181
+ */
182
+ activities: LiveActivity[];
183
+ }
175
184
  /**
176
185
  * Custom event
177
186
  */
@@ -549,6 +558,10 @@ export interface InboxMessage {
549
558
  * The message sent date in milliseconds.
550
559
  */
551
560
  sentDate: number;
561
+ /**
562
+ * Optional - The message expiration date in milliseconds.
563
+ */
564
+ expirationDate?: number;
552
565
  /**
553
566
  * Optional - The icon url for the message.
554
567
  */
@@ -698,3 +711,220 @@ export interface FeatureFlag {
698
711
  */
699
712
  readonly _internal: unknown;
700
713
  }
714
+ /**
715
+ * Live Activity info.
716
+ */
717
+ export interface LiveActivity {
718
+ /**
719
+ * The activity ID.
720
+ */
721
+ id: string;
722
+ /**
723
+ * The attribute types.
724
+ */
725
+ attributeTypes: string;
726
+ /**
727
+ * The content.
728
+ */
729
+ content: LiveActivityContent;
730
+ /**
731
+ * The attributes.
732
+ */
733
+ attributes: JsonObject;
734
+ }
735
+ /**
736
+ * Live Activity content.
737
+ */
738
+ export interface LiveActivityContent {
739
+ /**
740
+ * The content state.
741
+ */
742
+ state: JsonObject;
743
+ /**
744
+ * Optional ISO 8601 date string that defines when the Live Activity will be stale.
745
+ */
746
+ staleDate?: string;
747
+ /**
748
+ * The relevance score.
749
+ */
750
+ relevanceScore: number;
751
+ }
752
+ /**
753
+ * Base Live Activity request.
754
+ */
755
+ export interface LiveActivityRequest {
756
+ /**
757
+ * Attributes types. This should match the Activity type of your Live Activity.
758
+ */
759
+ attributesType: string;
760
+ }
761
+ /**
762
+ * Live Activity list request.
763
+ */
764
+ export interface LiveActivityListRequest extends LiveActivityRequest {
765
+ }
766
+ /**
767
+ * Live Activity start request.
768
+ */
769
+ export interface LiveActivityStartRequest extends LiveActivityRequest {
770
+ /**
771
+ * Dynamic content.
772
+ */
773
+ content: LiveActivityContent;
774
+ /**
775
+ * Fixed attributes.
776
+ */
777
+ attributes: JsonObject;
778
+ }
779
+ /**
780
+ * Live Activity update request.
781
+ */
782
+ export interface LiveActivityUpdateRequest extends LiveActivityRequest {
783
+ /**
784
+ * The Live Activity ID to update.
785
+ */
786
+ activityId: string;
787
+ /**
788
+ * Dynamic content.
789
+ */
790
+ content: LiveActivityContent;
791
+ }
792
+ /**
793
+ * Live Activity end request.
794
+ */
795
+ export interface LiveActivityEndRequest extends LiveActivityRequest {
796
+ /**
797
+ * The Live Activity ID to update.
798
+ */
799
+ activityId: string;
800
+ /**
801
+ * Dynamic content.
802
+ */
803
+ content?: LiveActivityContent;
804
+ /**
805
+ * Dismissal policy. Defaults to `LiveActivityDismissalPolicyDefault`.
806
+ */
807
+ dismissalPolicy?: LiveActivityDismissalPolicy;
808
+ }
809
+ export declare type LiveActivityDismissalPolicy = LiveActivityDismissalPolicyImmediate | LiveActivityDismissalPolicyDefault | LiveActivityDismissalPolicyAfterDate;
810
+ /**
811
+ * Dismissal policy to immediately dismiss the Live Activity on end.
812
+ */
813
+ export interface LiveActivityDismissalPolicyImmediate {
814
+ type: 'immediate';
815
+ }
816
+ /**
817
+ * Dismissal policy to dismiss the Live Activity after the expiration.
818
+ */
819
+ export interface LiveActivityDismissalPolicyDefault {
820
+ type: 'default';
821
+ }
822
+ /**
823
+ * Dismissal policy to dismiss the Live Activity after a given date.
824
+ */
825
+ export interface LiveActivityDismissalPolicyAfterDate {
826
+ type: 'after';
827
+ date: string;
828
+ }
829
+ /**
830
+ * Live Update info.
831
+ */
832
+ export interface LiveUpdate {
833
+ /**
834
+ * The Live Update name.
835
+ */
836
+ name: string;
837
+ /**
838
+ * The Live Update type.
839
+ */
840
+ type: string;
841
+ /**
842
+ * Dynamic content.
843
+ */
844
+ content: JsonObject;
845
+ /**
846
+ * ISO 8601 date string of the last content update.
847
+ */
848
+ lastContentUpdateTimestamp: string;
849
+ /**
850
+ * ISO 8601 date string of the last state update.
851
+ */
852
+ lastStateChangeTimestamp: string;
853
+ /**
854
+ * Optional ISO 8601 date string that defines when to end this Live Update.
855
+ */
856
+ dismissTimestamp?: string;
857
+ }
858
+ /**
859
+ * Live Update list request.
860
+ */
861
+ export interface LiveUpdateListRequest {
862
+ type: string;
863
+ }
864
+ /**
865
+ * Live Update update request.
866
+ */
867
+ export interface LiveUpdateUpdateRequest {
868
+ /**
869
+ * The Live Update name.
870
+ */
871
+ name: string;
872
+ /**
873
+ * Dynamic content.
874
+ */
875
+ content: JsonObject;
876
+ /**
877
+ * Optional ISO 8601 date string, used to filter out of order updates/
878
+ */
879
+ timestamp?: string;
880
+ /**
881
+ * Optional ISO 8601 date string that defines when to end this Live Update.
882
+ */
883
+ dismissTimestamp?: string;
884
+ }
885
+ /**
886
+ * Live Update end request.
887
+ */
888
+ export interface LiveUpdateEndRequest {
889
+ /**
890
+ * The Live Update name.
891
+ */
892
+ name: string;
893
+ /**
894
+ * Dynamic content.
895
+ */
896
+ content?: JsonObject;
897
+ /**
898
+ * Optional ISO 8601 date string, used to filter out of order updates/
899
+ */
900
+ timestamp?: string;
901
+ /**
902
+ * Optional ISO 8601 date string that defines when to end this Live Update.
903
+ */
904
+ dismissTimestamp?: string;
905
+ }
906
+ /**
907
+ * Live Update start request.
908
+ */
909
+ export interface LiveUpdateStartRequest {
910
+ /**
911
+ * The Live Update name.
912
+ */
913
+ name: string;
914
+ /**
915
+ * The Live Update type.
916
+ */
917
+ type: string;
918
+ /**
919
+ * Dynamic content.
920
+ */
921
+ content: JsonObject;
922
+ /**
923
+ * Optional ISO 8601 date string, used to filter out of order updates/
924
+ */
925
+ timestamp?: string;
926
+ /**
927
+ * Optional ISO 8601 date string that defines when to end this Live Update.
928
+ */
929
+ dismissTimestamp?: string;
930
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"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","sourcesContent":["export type JsonValue =\n | string\n | number\n | boolean\n | null\n | JsonObject\n | JsonArray;\n\nexport type JsonObject = {\n [key: string]: JsonValue;\n};\n\nexport type JsonArray = JsonValue[];\n\nexport interface ChannelCreatedEvent {\n /**\n * The channel ID.\n */\n channelId: string;\n}\n\nexport interface PushTokenReceivedEvent {\n /**\n * The push token.\n */\n pushToken: string;\n}\n\n/**\n * Event fired when a push is received.\n */\nexport interface PushReceivedEvent {\n /**\n * The push payload.\n */\n pushPayload: PushPayload;\n\n /**\n * Indicates whether the push was received when the application was in the background or foreground.\n */\n isForeground: boolean;\n}\n\n/**\n * The push payload.\n */\nexport interface PushPayload {\n /**\n * The alert.\n */\n alert?: string;\n /**\n * The title.\n */\n title?: string;\n /**\n * The subtitle.\n */\n subtitle?: string;\n /**\n * The notification ID.\n */\n notificationId?: string;\n /**\n * The notification extras.\n */\n extras: JsonObject;\n}\n\n/**\n * Event fired when the user initiates a notification response.\n */\nexport interface NotificationResponseEvent {\n /**\n * The push notification.\n */\n pushPayload: PushPayload;\n\n /**\n * The action button ID, if available.\n */\n actionId?: string;\n\n /**\n * Indicates whether the response was a foreground action.\n * This value is always if the user taps the main notification,\n * otherwise it is defined by the notification action button.\n */\n isForeground: boolean;\n}\n\n/**\n * Push notification status.\n */\nexport interface PushNotificationStatus {\n /**\n * If user notifications are enabled on [Airship.push].\n */\n isUserNotificationsEnabled: boolean;\n\n /**\n * If notifications are allowed at the system level for the application.\n */\n areNotificationsAllowed: boolean;\n\n /**\n * If the push feature is enabled on [Airship.privacyManager].\n */\n isPushPrivacyFeatureEnabled: boolean;\n\n /*\n * If push registration was able to generate a token.\n */\n isPushTokenRegistered: boolean;\n\n /*\n * If Airship is able to send and display a push notification.\n */\n isOptedIn: boolean;\n\n /*\n * Checks for isUserNotificationsEnabled, areNotificationsAllowed, and isPushPrivacyFeatureEnabled. If this flag\n * is true but `isOptedIn` is false, that means push token was not able to be registered.\n */\n isUserOptedIn: boolean;\n\n /**\n * The notification permission status.\n */\n notificationPermissionStatus: PermissionStatus;\n}\n\n/**\n * Enum of permission status.\n */\nexport enum PermissionStatus {\n /**\n * Permission is granted.\n */\n Granted = 'granted',\n\n /**\n * Permission is denied.\n */\n Denied = 'denied',\n\n /**\n * Permission has not yet been requested.\n */\n NotDetermined = 'not_determined',\n}\n\n/**\n * Fallback when prompting for permission and the permission is\n * already denied on iOS or is denied silently on Android.\n */\nexport enum PromptPermissionFallback {\n /**\n * Take the user to the system settings to enable the permission.\n */\n SystemSettings = \"systemSettings\"\n}\n\n/**\n * Event fired when the notification status changes.\n */\nexport interface PushNotificationStatusChangedEvent {\n /**\n * The push notification status.\n */\n status: PushNotificationStatus;\n}\n\n/**\n * Event fired when the Message Center is updated.\n */\nexport interface MessageCenterUpdatedEvent {\n /**\n * The unread message count.\n */\n messageUnreadCount: number;\n /**\n * The total message count.\n */\n messageCount: number;\n}\n\n/**\n * Event fired when the Message Center is requested to be displayed.\n */\nexport interface DisplayMessageCenterEvent {\n /**\n * The message ID, if available.\n */\n messageId?: string;\n}\n\n/**\n * Event fired when a deep link is opened.\n */\nexport interface DeepLinkEvent {\n /**\n * The deep link string.\n */\n deepLink: string;\n}\n\n/**\n * Event fired when a preference center is requested to be displayed.\n */\nexport interface DisplayPreferenceCenterEvent {\n /**\n * The preference center Id.\n */\n preferenceCenterId: string;\n}\n\n/**\n * Custom event\n */\nexport interface CustomEvent {\n /**\n * Event name\n */\n eventName: string;\n /**\n * Event value\n */\n eventValue?: number;\n /**\n * Event properties\n */\n properties: JsonObject;\n /**\n * Transaction ID\n */\n transactionId?: string;\n /**\n * Interaction ID\n */\n interactionId?: string;\n /**\n * Interaction type\n */\n interactionType?: string;\n}\n\n/**\n * iOS options\n */\nexport namespace iOS {\n /**\n * Quiet time\n */\n export interface QuietTime {\n /**\n * Start hour. Must be 0-23.\n */\n startHour: number;\n\n /**\n * Start minute. Must be 0-59.\n */\n startMinute: number;\n\n /**\n * End hour. Must be 0-23.\n */\n endHour: number;\n\n /**\n * End minute. Must be 0-59.\n */\n endMinute: number;\n }\n\n /**\n * Enum of notification options. iOS only.\n */\n export enum NotificationOption {\n /**\n * Alerts.\n */\n Alert = 'alert',\n /**\n * Sounds.\n */\n Sound = 'sound',\n /**\n * Badges.\n */\n Badge = 'badge',\n /**\n * Car play.\n */\n CarPlay = 'car_play',\n /**\n * Critical Alert.\n */\n CriticalAlert = 'critical_alert',\n /**\n * Provides app notification settings.\n */\n ProvidesAppNotificationSettings = 'provides_app_notification_settings',\n /**\n * Provisional.\n */\n Provisional = 'provisional',\n }\n\n /**\n * Enum of foreground notification options.\n */\n export enum ForegroundPresentationOption {\n /**\n * Play the sound associated with the notification.\n */\n Sound = 'sound',\n /**\n * Apply the notification's badge value to the app’s icon.\n */\n Badge = 'badge',\n\n /**\n * Show the notification in Notification Center. On iOS 13 an older,\n * this will also show the notification as a banner.\n */\n List = 'list',\n\n /**\n * Present the notification as a banner. On iOS 13 an older,\n * this will also show the notification in the Notification Center.\n */\n Banner = 'banner',\n }\n\n /**\n * Enum of authorized notification options.\n */\n export enum AuthorizedNotificationSetting {\n /**\n * Alerts.\n */\n Alert = 'alert',\n /**\n * Sounds.\n */\n Sound = 'sound',\n /**\n * Badges.\n */\n Badge = 'badge',\n /**\n * CarPlay.\n */\n CarPlay = 'car_play',\n /**\n * Lock screen.\n */\n LockScreen = 'lock_screen',\n /**\n * Notification center.\n */\n NotificationCenter = 'notification_center',\n /**\n * Critical alert.\n */\n CriticalAlert = 'critical_alert',\n /**\n * Announcement.\n */\n Announcement = 'announcement',\n /**\n * Scheduled delivery.\n */\n ScheduledDelivery = 'scheduled_delivery',\n /**\n * Time sensitive.\n */\n TimeSensitive = 'time_sensitive',\n }\n\n /**\n * Enum of authorized status.\n */\n export enum AuthorizedNotificationStatus {\n /**\n * Not determined.\n */\n NotDetermined = 'not_determined',\n\n /**\n * Denied.\n */\n Denied = 'denied',\n\n /**\n * Authorized.\n */\n Authorized = 'authorized',\n\n /**\n * Provisional.\n */\n Provisional = 'provisional',\n\n /**\n * Ephemeral.\n */\n Ephemeral = 'ephemeral',\n }\n\n export interface AuthorizedNotificationSettingsChangedEvent {\n /**\n * Authorized settings.\n */\n authorizedSettings: AuthorizedNotificationSetting[];\n }\n}\n\nexport namespace Android {\n /**\n * Android notification config.\n */\n export interface NotificationConfig {\n /**\n * The icon resource name.\n */\n icon?: string;\n /**\n * The large icon resource name.\n */\n largeIcon?: string;\n /**\n * The default android notification channel ID.\n */\n defaultChannelId?: string;\n /**\n * The accent color. Must be a hex value #AARRGGBB.\n */\n accentColor?: string;\n }\n}\n\n/**\n * Airship config environment\n */\nexport interface ConfigEnvironment {\n /**\n * App key.\n */\n appKey: string;\n\n /**\n * App secret.\n */\n appSecret: string;\n\n /**\n * Optional log level.\n */\n logLevel?: LogLevel;\n\n /**\n * Optional iOS config\n */\n ios?: {\n /**\n * Log privacy level. By default it logs at `private`, not logging anything lower than info to the console\n * and redacting logs with string interpolation. `public` will log all configured log levels to the console\n * without redacting any of the log lines.\n */\n logPrivacyLevel?: 'private' | 'public';\n };\n}\n\n/**\n * Possible sites.\n */\nexport type Site = 'us' | 'eu';\n\n/**\n * Log levels.\n */\nexport type LogLevel =\n | 'verbose'\n | 'debug'\n | 'info'\n | 'warning'\n | 'error'\n | 'none';\n\n/**\n * Airship config\n */\nexport interface AirshipConfig {\n /**\n * Default environment.\n */\n default?: ConfigEnvironment;\n\n /**\n * Development environment. Overrides default environment if inProduction is false.\n */\n development?: ConfigEnvironment;\n\n /**\n * Production environment. Overrides default environment if inProduction is true.\n */\n production?: ConfigEnvironment;\n\n /**\n * Cloud site.\n */\n site?: Site;\n\n /**\n * Switches the environment from development or production. If the value is not\n * set, Airship will determine the value at runtime.\n */\n inProduction?: boolean;\n\n /**\n * URL allow list.\n */\n urlAllowList?: string[];\n\n /**\n * URL allow list for open URL scope.\n */\n urlAllowListScopeOpenUrl?: string[];\n\n /**\n * URL allow list for JS bridge injection.\n */\n urlAllowListScopeJavaScriptInterface?: string[];\n\n /**\n * Enables delayed channel creation.\n * Deprecated. Use the Private Manager to disable all features instead.\n */\n isChannelCreationDelayEnabled?: boolean;\n\n /**\n * Initial config URL for custom Airship domains. The URL\n * should also be added to the urlAllowList.\n */\n initialConfigUrl?: string;\n\n /**\n * Enabled features. Defaults to all.\n */\n enabledFeatures?: Feature[];\n\n /**\n * Enables channel capture feature.\n * This config is enabled by default.\n */\n isChannelCaptureEnabled?: boolean;\n\n /**\n * Whether to suppress console error messages about missing allow list entries during takeOff.\n * This config is disabled by default.\n */\n suppressAllowListError?: boolean;\n\n /**\n * Pauses In-App Automation on launch.\n */\n autoPauseInAppAutomationOnLaunch?: boolean;\n\n /**\n * iOS config.\n */\n ios?: {\n /**\n * itunesId for rate app and app store deep links.\n */\n itunesId?: string;\n };\n\n /**\n * Android config.\n */\n android?: {\n /**\n * App store URI\n */\n appStoreUri?: string;\n\n /**\n * Fcm app name if using multiple FCM projects.\n */\n fcmFirebaseAppName?: string;\n\n /**\n * Notification config.\n */\n notificationConfig?: Android.NotificationConfig;\n };\n}\n\n/**\n * Enum of authorized Features.\n */\nexport enum Feature {\n InAppAutomation = 'in_app_automation',\n MessageCenter = 'message_center',\n Push = 'push',\n // No longer used\n Chat = 'chat',\n Analytics = 'analytics',\n TagsAndAttributes = 'tags_and_attributes',\n Contacts = 'contacts',\n // No longer used\n Location = 'location',\n}\n\n/**\n * All available features.\n */\nexport const FEATURES_ALL = Object.values(Feature);\n\n/**\n * Subscription Scope types.\n */\nexport enum SubscriptionScope {\n App = 'app',\n Web = 'web',\n Sms = 'sms',\n Email = 'email',\n}\n\nexport interface InboxMessage {\n /**\n * The message ID. Needed to display, mark as read, or delete the message.\n */\n id: string;\n /**\n * The message title.\n */\n title: string;\n /**\n * The message sent date in milliseconds.\n */\n sentDate: number;\n /**\n * Optional - The icon url for the message.\n */\n listIconUrl: string;\n /**\n * The unread / read status of the message.\n */\n isRead: boolean;\n /**\n * String to String map of any message extras.\n */\n extras: Record<string, string>;\n}\n\n// ---\n// See: https://github.com/urbanairship/web-push-sdk/blob/master/src/remote-data/preference-center.ts\n// ---\n\n/**\n * A preference center definition.\n *\n * @typedef {object} PreferenceCenter\n * @property {string} id the ID of the preference center\n * @property {Array<PreferenceCenter.CommonSection>} sections a list of sections\n * @property {?CommonDisplay} display display information\n */\nexport type PreferenceCenter = {\n id: string;\n sections: Section[];\n display?: CommonDisplay;\n};\n\n/**\n * Preference center display information.\n * @typedef {object} CommonDisplay\n * @property {string} name\n * @property {?string} description\n */\nexport type CommonDisplay = {\n name: string;\n description?: string;\n};\n\nexport type Icon = {\n icon: string;\n};\n\nexport type IconDisplay = CommonDisplay & Partial<Icon>;\n\nexport interface ItemBase {\n type: unknown;\n id: string;\n display: CommonDisplay;\n conditions?: Condition[];\n}\n\n/**\n * A channel subscription item.\n * @typedef {object} ChannelSubscriptionItem\n * @memberof PreferenceCenter\n * @property {\"channel_subscription\"} type\n * @property {string} id the item identifier\n * @property {?CommonDisplay} display display information\n * @property {string} subscription_id the subscription list id\n */\nexport interface ChannelSubscriptionItem extends ItemBase {\n type: 'channel_subscription';\n subscription_id: string;\n}\n\nexport interface ContactSubscriptionGroupItem extends ItemBase {\n type: 'contact_subscription_group';\n id: string;\n subscription_id: string;\n components: ContactSubscriptionGroupItemComponent[];\n}\n\nexport interface ContactSubscriptionGroupItemComponent {\n scopes: SubscriptionScope[];\n display: Omit<CommonDisplay, 'description'>;\n}\n\nexport interface ContactSubscriptionItem extends ItemBase {\n type: 'contact_subscription';\n scopes: SubscriptionScope[];\n subscription_id: string;\n}\n\nexport interface AlertItem extends ItemBase {\n type: 'alert';\n display: IconDisplay;\n button?: Button;\n}\n\nexport interface ConditionBase {\n type: unknown;\n}\n\nexport interface NotificationOptInCondition extends ConditionBase {\n type: 'notification_opt_in';\n when_status: 'opt_in' | 'opt_out';\n}\n\nexport type Condition = NotificationOptInCondition;\n\n// Changed from `unknown` in spec\nexport type Actions = {\n [key: string]: JsonValue;\n};\n\nexport interface Button {\n text: string;\n content_description?: string;\n actions: Actions;\n}\n\nexport interface SectionBase {\n type: unknown;\n id: string;\n display?: CommonDisplay;\n items: Item[];\n}\n\n/**\n * @typedef {object} CommonSection\n * @memberof PreferenceCenter\n * @property {\"section\"} type\n * @property {string} id the section identifier\n * @property {?CommonDisplay} display display information\n * @property {Array<PreferenceCenter.ChannelSubscriptionItem>} items list of\n * section items\n */\nexport interface CommonSection extends SectionBase {\n type: 'section';\n}\n\nexport interface LabeledSectionBreak extends SectionBase {\n type: 'labeled_section_break';\n items: never;\n}\n\nexport type Item =\n | ChannelSubscriptionItem\n | ContactSubscriptionGroupItem\n | ContactSubscriptionItem\n | AlertItem;\n\nexport type Section = CommonSection | LabeledSectionBreak;\n\n/**\n * An interface representing the eligibility status of a flag, and optional\n * variables associated with the flag.\n */\nexport interface FeatureFlag {\n /**\n * A boolean representing flag eligibility; will be `true` if the current\n * contact is eligible for the flag.\n */\n readonly isEligible: boolean;\n /**\n * A variables associated with the flag, if any. Will be `null` if no data\n * is associated with the flag, or if the flag does not exist.\n */\n readonly variables: unknown | null;\n /**\n * A boolean representing if the flag exists or not. For ease of use and\n * deployment, asking for a flag by any name will return a `FeatureFlag`\n * interface, even if the flag was not found to exist. However this property\n * may be checked to determine if the flag was actually resolved to a known\n * flag name.\n */\n readonly exists: boolean;\n\n /**\n * Reporting Metadata, the shape of which is private and not to be relied\n * upon. When not provided, an interaction cannot be tracked on the flag.\n * @ignore\n */\n readonly _internal: unknown;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"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","sourcesContent":["export type JsonValue =\n | string\n | number\n | boolean\n | null\n | JsonObject\n | JsonArray;\n\nexport type JsonObject = {\n [key: string]: JsonValue;\n};\n\nexport type JsonArray = JsonValue[];\n\nexport interface ChannelCreatedEvent {\n /**\n * The channel ID.\n */\n channelId: string;\n}\n\nexport interface PushTokenReceivedEvent {\n /**\n * The push token.\n */\n pushToken: string;\n}\n\n/**\n * Event fired when a push is received.\n */\nexport interface PushReceivedEvent {\n /**\n * The push payload.\n */\n pushPayload: PushPayload;\n\n /**\n * Indicates whether the push was received when the application was in the background or foreground.\n */\n isForeground: boolean;\n}\n\n/**\n * The push payload.\n */\nexport interface PushPayload {\n /**\n * The alert.\n */\n alert?: string;\n /**\n * The title.\n */\n title?: string;\n /**\n * The subtitle.\n */\n subtitle?: string;\n /**\n * The notification ID.\n */\n notificationId?: string;\n /**\n * The notification extras.\n */\n extras: JsonObject;\n}\n\n/**\n * Event fired when the user initiates a notification response.\n */\nexport interface NotificationResponseEvent {\n /**\n * The push notification.\n */\n pushPayload: PushPayload;\n\n /**\n * The action button ID, if available.\n */\n actionId?: string;\n\n /**\n * Indicates whether the response was a foreground action.\n * This value is always if the user taps the main notification,\n * otherwise it is defined by the notification action button.\n */\n isForeground: boolean;\n}\n\n/**\n * Push notification status.\n */\nexport interface PushNotificationStatus {\n /**\n * If user notifications are enabled on [Airship.push].\n */\n isUserNotificationsEnabled: boolean;\n\n /**\n * If notifications are allowed at the system level for the application.\n */\n areNotificationsAllowed: boolean;\n\n /**\n * If the push feature is enabled on [Airship.privacyManager].\n */\n isPushPrivacyFeatureEnabled: boolean;\n\n /*\n * If push registration was able to generate a token.\n */\n isPushTokenRegistered: boolean;\n\n /*\n * If Airship is able to send and display a push notification.\n */\n isOptedIn: boolean;\n\n /*\n * Checks for isUserNotificationsEnabled, areNotificationsAllowed, and isPushPrivacyFeatureEnabled. If this flag\n * is true but `isOptedIn` is false, that means push token was not able to be registered.\n */\n isUserOptedIn: boolean;\n\n /**\n * The notification permission status.\n */\n notificationPermissionStatus: PermissionStatus;\n}\n\n/**\n * Enum of permission status.\n */\nexport enum PermissionStatus {\n /**\n * Permission is granted.\n */\n Granted = 'granted',\n\n /**\n * Permission is denied.\n */\n Denied = 'denied',\n\n /**\n * Permission has not yet been requested.\n */\n NotDetermined = 'not_determined',\n}\n\n/**\n * Fallback when prompting for permission and the permission is\n * already denied on iOS or is denied silently on Android.\n */\nexport enum PromptPermissionFallback {\n /**\n * Take the user to the system settings to enable the permission.\n */\n SystemSettings = \"systemSettings\"\n}\n\n/**\n * Event fired when the notification status changes.\n */\nexport interface PushNotificationStatusChangedEvent {\n /**\n * The push notification status.\n */\n status: PushNotificationStatus;\n}\n\n/**\n * Event fired when the Message Center is updated.\n */\nexport interface MessageCenterUpdatedEvent {\n /**\n * The unread message count.\n */\n messageUnreadCount: number;\n /**\n * The total message count.\n */\n messageCount: number;\n}\n\n/**\n * Event fired when the Message Center is requested to be displayed.\n */\nexport interface DisplayMessageCenterEvent {\n /**\n * The message ID, if available.\n */\n messageId?: string;\n}\n\n/**\n * Event fired when a deep link is opened.\n */\nexport interface DeepLinkEvent {\n /**\n * The deep link string.\n */\n deepLink: string;\n}\n\n/**\n * Event fired when a preference center is requested to be displayed.\n */\nexport interface DisplayPreferenceCenterEvent {\n /**\n * The preference center Id.\n */\n preferenceCenterId: string;\n}\n\n/**\n * Event fired whenever any of the Live Activities update, create, or end.\n */\nexport interface LiveActivitiesUpdatedEvent {\n /**\n * The Live Activities.\n */\n activities: LiveActivity[];\n}\n\n\n/**\n * Custom event\n */\nexport interface CustomEvent {\n /**\n * Event name\n */\n eventName: string;\n /**\n * Event value\n */\n eventValue?: number;\n /**\n * Event properties\n */\n properties: JsonObject;\n /**\n * Transaction ID\n */\n transactionId?: string;\n /**\n * Interaction ID\n */\n interactionId?: string;\n /**\n * Interaction type\n */\n interactionType?: string;\n}\n\n/**\n * iOS options\n */\nexport namespace iOS {\n /**\n * Quiet time\n */\n export interface QuietTime {\n /**\n * Start hour. Must be 0-23.\n */\n startHour: number;\n\n /**\n * Start minute. Must be 0-59.\n */\n startMinute: number;\n\n /**\n * End hour. Must be 0-23.\n */\n endHour: number;\n\n /**\n * End minute. Must be 0-59.\n */\n endMinute: number;\n }\n\n /**\n * Enum of notification options. iOS only.\n */\n export enum NotificationOption {\n /**\n * Alerts.\n */\n Alert = 'alert',\n /**\n * Sounds.\n */\n Sound = 'sound',\n /**\n * Badges.\n */\n Badge = 'badge',\n /**\n * Car play.\n */\n CarPlay = 'car_play',\n /**\n * Critical Alert.\n */\n CriticalAlert = 'critical_alert',\n /**\n * Provides app notification settings.\n */\n ProvidesAppNotificationSettings = 'provides_app_notification_settings',\n /**\n * Provisional.\n */\n Provisional = 'provisional',\n }\n\n /**\n * Enum of foreground notification options.\n */\n export enum ForegroundPresentationOption {\n /**\n * Play the sound associated with the notification.\n */\n Sound = 'sound',\n /**\n * Apply the notification's badge value to the app’s icon.\n */\n Badge = 'badge',\n\n /**\n * Show the notification in Notification Center. On iOS 13 an older,\n * this will also show the notification as a banner.\n */\n List = 'list',\n\n /**\n * Present the notification as a banner. On iOS 13 an older,\n * this will also show the notification in the Notification Center.\n */\n Banner = 'banner',\n }\n\n /**\n * Enum of authorized notification options.\n */\n export enum AuthorizedNotificationSetting {\n /**\n * Alerts.\n */\n Alert = 'alert',\n /**\n * Sounds.\n */\n Sound = 'sound',\n /**\n * Badges.\n */\n Badge = 'badge',\n /**\n * CarPlay.\n */\n CarPlay = 'car_play',\n /**\n * Lock screen.\n */\n LockScreen = 'lock_screen',\n /**\n * Notification center.\n */\n NotificationCenter = 'notification_center',\n /**\n * Critical alert.\n */\n CriticalAlert = 'critical_alert',\n /**\n * Announcement.\n */\n Announcement = 'announcement',\n /**\n * Scheduled delivery.\n */\n ScheduledDelivery = 'scheduled_delivery',\n /**\n * Time sensitive.\n */\n TimeSensitive = 'time_sensitive',\n }\n\n /**\n * Enum of authorized status.\n */\n export enum AuthorizedNotificationStatus {\n /**\n * Not determined.\n */\n NotDetermined = 'not_determined',\n\n /**\n * Denied.\n */\n Denied = 'denied',\n\n /**\n * Authorized.\n */\n Authorized = 'authorized',\n\n /**\n * Provisional.\n */\n Provisional = 'provisional',\n\n /**\n * Ephemeral.\n */\n Ephemeral = 'ephemeral',\n }\n\n export interface AuthorizedNotificationSettingsChangedEvent {\n /**\n * Authorized settings.\n */\n authorizedSettings: AuthorizedNotificationSetting[];\n }\n}\n\nexport namespace Android {\n /**\n * Android notification config.\n */\n export interface NotificationConfig {\n /**\n * The icon resource name.\n */\n icon?: string;\n /**\n * The large icon resource name.\n */\n largeIcon?: string;\n /**\n * The default android notification channel ID.\n */\n defaultChannelId?: string;\n /**\n * The accent color. Must be a hex value #AARRGGBB.\n */\n accentColor?: string;\n }\n}\n\n/**\n * Airship config environment\n */\nexport interface ConfigEnvironment {\n /**\n * App key.\n */\n appKey: string;\n\n /**\n * App secret.\n */\n appSecret: string;\n\n /**\n * Optional log level.\n */\n logLevel?: LogLevel;\n\n /**\n * Optional iOS config\n */\n ios?: {\n /**\n * Log privacy level. By default it logs at `private`, not logging anything lower than info to the console\n * and redacting logs with string interpolation. `public` will log all configured log levels to the console\n * without redacting any of the log lines.\n */\n logPrivacyLevel?: 'private' | 'public';\n };\n}\n\n/**\n * Possible sites.\n */\nexport type Site = 'us' | 'eu';\n\n/**\n * Log levels.\n */\nexport type LogLevel =\n | 'verbose'\n | 'debug'\n | 'info'\n | 'warning'\n | 'error'\n | 'none';\n\n/**\n * Airship config\n */\nexport interface AirshipConfig {\n /**\n * Default environment.\n */\n default?: ConfigEnvironment;\n\n /**\n * Development environment. Overrides default environment if inProduction is false.\n */\n development?: ConfigEnvironment;\n\n /**\n * Production environment. Overrides default environment if inProduction is true.\n */\n production?: ConfigEnvironment;\n\n /**\n * Cloud site.\n */\n site?: Site;\n\n /**\n * Switches the environment from development or production. If the value is not\n * set, Airship will determine the value at runtime.\n */\n inProduction?: boolean;\n\n /**\n * URL allow list.\n */\n urlAllowList?: string[];\n\n /**\n * URL allow list for open URL scope.\n */\n urlAllowListScopeOpenUrl?: string[];\n\n /**\n * URL allow list for JS bridge injection.\n */\n urlAllowListScopeJavaScriptInterface?: string[];\n\n /**\n * Enables delayed channel creation.\n * Deprecated. Use the Private Manager to disable all features instead.\n */\n isChannelCreationDelayEnabled?: boolean;\n\n /**\n * Initial config URL for custom Airship domains. The URL\n * should also be added to the urlAllowList.\n */\n initialConfigUrl?: string;\n\n /**\n * Enabled features. Defaults to all.\n */\n enabledFeatures?: Feature[];\n\n /**\n * Enables channel capture feature.\n * This config is enabled by default.\n */\n isChannelCaptureEnabled?: boolean;\n\n /**\n * Whether to suppress console error messages about missing allow list entries during takeOff.\n * This config is disabled by default.\n */\n suppressAllowListError?: boolean;\n\n /**\n * Pauses In-App Automation on launch.\n */\n autoPauseInAppAutomationOnLaunch?: boolean;\n\n /**\n * iOS config.\n */\n ios?: {\n /**\n * itunesId for rate app and app store deep links.\n */\n itunesId?: string;\n };\n\n /**\n * Android config.\n */\n android?: {\n /**\n * App store URI\n */\n appStoreUri?: string;\n\n /**\n * Fcm app name if using multiple FCM projects.\n */\n fcmFirebaseAppName?: string;\n\n /**\n * Notification config.\n */\n notificationConfig?: Android.NotificationConfig;\n };\n}\n\n/**\n * Enum of authorized Features.\n */\nexport enum Feature {\n InAppAutomation = 'in_app_automation',\n MessageCenter = 'message_center',\n Push = 'push',\n // No longer used\n Chat = 'chat',\n Analytics = 'analytics',\n TagsAndAttributes = 'tags_and_attributes',\n Contacts = 'contacts',\n // No longer used\n Location = 'location',\n}\n\n/**\n * All available features.\n */\nexport const FEATURES_ALL = Object.values(Feature);\n\n/**\n * Subscription Scope types.\n */\nexport enum SubscriptionScope {\n App = 'app',\n Web = 'web',\n Sms = 'sms',\n Email = 'email',\n}\n\nexport interface InboxMessage {\n /**\n * The message ID. Needed to display, mark as read, or delete the message.\n */\n id: string;\n /**\n * The message title.\n */\n title: string;\n /**\n * The message sent date in milliseconds.\n */\n sentDate: number;\n /**\n * Optional - The message expiration date in milliseconds.\n */\n expirationDate?: number;\n /**\n * Optional - The icon url for the message.\n */\n listIconUrl: string;\n /**\n * The unread / read status of the message.\n */\n isRead: boolean;\n /**\n * String to String map of any message extras.\n */\n extras: Record<string, string>;\n}\n\n// ---\n// See: https://github.com/urbanairship/web-push-sdk/blob/master/src/remote-data/preference-center.ts\n// ---\n\n/**\n * A preference center definition.\n *\n * @typedef {object} PreferenceCenter\n * @property {string} id the ID of the preference center\n * @property {Array<PreferenceCenter.CommonSection>} sections a list of sections\n * @property {?CommonDisplay} display display information\n */\nexport type PreferenceCenter = {\n id: string;\n sections: Section[];\n display?: CommonDisplay;\n};\n\n/**\n * Preference center display information.\n * @typedef {object} CommonDisplay\n * @property {string} name\n * @property {?string} description\n */\nexport type CommonDisplay = {\n name: string;\n description?: string;\n};\n\nexport type Icon = {\n icon: string;\n};\n\nexport type IconDisplay = CommonDisplay & Partial<Icon>;\n\nexport interface ItemBase {\n type: unknown;\n id: string;\n display: CommonDisplay;\n conditions?: Condition[];\n}\n\n/**\n * A channel subscription item.\n * @typedef {object} ChannelSubscriptionItem\n * @memberof PreferenceCenter\n * @property {\"channel_subscription\"} type\n * @property {string} id the item identifier\n * @property {?CommonDisplay} display display information\n * @property {string} subscription_id the subscription list id\n */\nexport interface ChannelSubscriptionItem extends ItemBase {\n type: 'channel_subscription';\n subscription_id: string;\n}\n\nexport interface ContactSubscriptionGroupItem extends ItemBase {\n type: 'contact_subscription_group';\n id: string;\n subscription_id: string;\n components: ContactSubscriptionGroupItemComponent[];\n}\n\nexport interface ContactSubscriptionGroupItemComponent {\n scopes: SubscriptionScope[];\n display: Omit<CommonDisplay, 'description'>;\n}\n\nexport interface ContactSubscriptionItem extends ItemBase {\n type: 'contact_subscription';\n scopes: SubscriptionScope[];\n subscription_id: string;\n}\n\nexport interface AlertItem extends ItemBase {\n type: 'alert';\n display: IconDisplay;\n button?: Button;\n}\n\nexport interface ConditionBase {\n type: unknown;\n}\n\nexport interface NotificationOptInCondition extends ConditionBase {\n type: 'notification_opt_in';\n when_status: 'opt_in' | 'opt_out';\n}\n\nexport type Condition = NotificationOptInCondition;\n\n// Changed from `unknown` in spec\nexport type Actions = {\n [key: string]: JsonValue;\n};\n\nexport interface Button {\n text: string;\n content_description?: string;\n actions: Actions;\n}\n\nexport interface SectionBase {\n type: unknown;\n id: string;\n display?: CommonDisplay;\n items: Item[];\n}\n\n/**\n * @typedef {object} CommonSection\n * @memberof PreferenceCenter\n * @property {\"section\"} type\n * @property {string} id the section identifier\n * @property {?CommonDisplay} display display information\n * @property {Array<PreferenceCenter.ChannelSubscriptionItem>} items list of\n * section items\n */\nexport interface CommonSection extends SectionBase {\n type: 'section';\n}\n\nexport interface LabeledSectionBreak extends SectionBase {\n type: 'labeled_section_break';\n items: never;\n}\n\nexport type Item =\n | ChannelSubscriptionItem\n | ContactSubscriptionGroupItem\n | ContactSubscriptionItem\n | AlertItem;\n\nexport type Section = CommonSection | LabeledSectionBreak;\n\n/**\n * An interface representing the eligibility status of a flag, and optional\n * variables associated with the flag.\n */\nexport interface FeatureFlag {\n /**\n * A boolean representing flag eligibility; will be `true` if the current\n * contact is eligible for the flag.\n */\n readonly isEligible: boolean;\n /**\n * A variables associated with the flag, if any. Will be `null` if no data\n * is associated with the flag, or if the flag does not exist.\n */\n readonly variables: unknown | null;\n /**\n * A boolean representing if the flag exists or not. For ease of use and\n * deployment, asking for a flag by any name will return a `FeatureFlag`\n * interface, even if the flag was not found to exist. However this property\n * may be checked to determine if the flag was actually resolved to a known\n * flag name.\n */\n readonly exists: boolean;\n\n /**\n * Reporting Metadata, the shape of which is private and not to be relied\n * upon. When not provided, an interaction cannot be tracked on the flag.\n * @ignore\n */\n readonly _internal: unknown;\n}\n\n\n/**\n * Live Activity info.\n */\nexport interface LiveActivity {\n /**\n * The activity ID.\n */\n id: string;\n /**\n * The attribute types.\n */\n attributeTypes: string;\n /**\n * The content.\n */\n content: LiveActivityContent;\n /**\n * The attributes.\n */\n attributes: JsonObject;\n}\n\n/**\n * Live Activity content.\n */\nexport interface LiveActivityContent {\n /**\n * The content state.\n */\n state: JsonObject;\n /**\n * Optional ISO 8601 date string that defines when the Live Activity will be stale.\n */\n staleDate?: string;\n /**\n * The relevance score.\n */\n relevanceScore: number;\n}\n\n/**\n * Base Live Activity request.\n */\nexport interface LiveActivityRequest {\n /**\n * Attributes types. This should match the Activity type of your Live Activity.\n */\n attributesType: string;\n}\n\n/**\n * Live Activity list request.\n */\nexport interface LiveActivityListRequest extends LiveActivityRequest {}\n\n/**\n * Live Activity start request.\n */\nexport interface LiveActivityStartRequest extends LiveActivityRequest {\n /**\n * Dynamic content.\n */\n content: LiveActivityContent;\n /**\n * Fixed attributes.\n */\n attributes: JsonObject;\n}\n\n/**\n * Live Activity update request.\n */\nexport interface LiveActivityUpdateRequest extends LiveActivityRequest {\n /**\n * The Live Activity ID to update.\n */\n activityId: string;\n /**\n * Dynamic content.\n */\n content: LiveActivityContent;\n}\n\n/**\n * Live Activity end request.\n */\nexport interface LiveActivityEndRequest extends LiveActivityRequest {\n /**\n * The Live Activity ID to update.\n */\n activityId: string;\n /**\n * Dynamic content.\n */\n content?: LiveActivityContent;\n\n /**\n * Dismissal policy. Defaults to `LiveActivityDismissalPolicyDefault`.\n */\n dismissalPolicy?: LiveActivityDismissalPolicy;\n}\n\nexport type LiveActivityDismissalPolicy =\n | LiveActivityDismissalPolicyImmediate\n | LiveActivityDismissalPolicyDefault\n | LiveActivityDismissalPolicyAfterDate;\n\n/**\n * Dismissal policy to immediately dismiss the Live Activity on end.\n */\nexport interface LiveActivityDismissalPolicyImmediate {\n type: 'immediate';\n}\n\n/**\n * Dismissal policy to dismiss the Live Activity after the expiration.\n */\nexport interface LiveActivityDismissalPolicyDefault {\n type: 'default';\n}\n\n/**\n * Dismissal policy to dismiss the Live Activity after a given date.\n */\nexport interface LiveActivityDismissalPolicyAfterDate {\n type: 'after';\n // ISO 8601 date string.\n date: string;\n}\n\n/**\n * Live Update info.\n */\nexport interface LiveUpdate {\n /**\n * The Live Update name.\n */\n name: string;\n\n /**\n * The Live Update type.\n */\n type: string;\n\n /**\n * Dynamic content.\n */\n content: JsonObject;\n\n /**\n * ISO 8601 date string of the last content update.\n */\n lastContentUpdateTimestamp: string;\n\n /**\n * ISO 8601 date string of the last state update.\n */\n lastStateChangeTimestamp: string;\n\n /**\n * Optional ISO 8601 date string that defines when to end this Live Update.\n */\n dismissTimestamp?: string;\n}\n\n\n/**\n * Live Update list request.\n */\nexport interface LiveUpdateListRequest {\n type: string;\n}\n\n/**\n * Live Update update request.\n */\nexport interface LiveUpdateUpdateRequest {\n /**\n * The Live Update name.\n */\n name: string;\n /**\n * Dynamic content.\n */\n content: JsonObject;\n\n /**\n * Optional ISO 8601 date string, used to filter out of order updates/\n */\n timestamp?: string;\n\n /**\n * Optional ISO 8601 date string that defines when to end this Live Update.\n */\n dismissTimestamp?: string;\n}\n\n/**\n * Live Update end request.\n */\nexport interface LiveUpdateEndRequest {\n /**\n * The Live Update name.\n */\n name: string;\n\n /**\n * Dynamic content.\n */\n content?: JsonObject;\n\n /**\n * Optional ISO 8601 date string, used to filter out of order updates/\n */\n timestamp?: string;\n\n /**\n * Optional ISO 8601 date string that defines when to end this Live Update.\n */\n dismissTimestamp?: string;\n}\n\n/**\n * Live Update start request.\n */\nexport interface LiveUpdateStartRequest {\n /**\n * The Live Update name.\n */\n name: string;\n\n /**\n * The Live Update type.\n */\n type: string;\n\n /**\n * Dynamic content.\n */\n content: JsonObject;\n\n /**\n * Optional ISO 8601 date string, used to filter out of order updates/\n */\n timestamp?: string;\n\n /**\n * Optional ISO 8601 date string that defines when to end this Live Update.\n */\n dismissTimestamp?: string;\n}"]}
@@ -150,6 +150,7 @@ var EventType;
150
150
  EventType["DisplayPreferenceCenter"] = "display_preference_center";
151
151
  EventType["PushTokenReceived"] = "push_token_received";
152
152
  EventType["IOSAuthorizedNotificationSettingsChanged"] = "ios_authorized_notification_settings_changed";
153
+ EventType["IOSLiveActivitiesUpdated"] = "ios_live_activities_updated";
153
154
  })(EventType || (EventType = {}));
154
155
 
155
156
  /* Copyright Airship and Contributors */
@@ -1052,6 +1053,116 @@ class AirshipPushAndroid {
1052
1053
  }
1053
1054
  }
1054
1055
 
1056
+ /**
1057
+ * Live Activity manager.
1058
+ */
1059
+ class AirshipLiveActivityManager {
1060
+ constructor(plugin) {
1061
+ this.plugin = plugin;
1062
+ }
1063
+ /**
1064
+ * Lists any Live Activities for the request.
1065
+ * @param request The request options.
1066
+ * @returns A promise with the result.
1067
+ */
1068
+ list(request) {
1069
+ return this.plugin.perform('liveActivityManager#list', request);
1070
+ }
1071
+ /**
1072
+ * Lists all Live Activities.
1073
+ * @param request The request options.
1074
+ * @returns A promise with the result.
1075
+ */
1076
+ listAll() {
1077
+ return this.plugin.perform('liveActivityManager#listAll');
1078
+ }
1079
+ /**
1080
+ * Starts a Live Activity.
1081
+ * @param request The request options.
1082
+ * @returns A promise with the result.
1083
+ */
1084
+ start(request) {
1085
+ return this.plugin.perform('liveActivityManager#start', request);
1086
+ }
1087
+ /**
1088
+ * Updates a Live Activity.
1089
+ * @param request The request options.
1090
+ * @returns A promise with the result.
1091
+ */
1092
+ update(request) {
1093
+ return this.plugin.perform('liveActivityManager#update', request);
1094
+ }
1095
+ /**
1096
+ * Ends a Live Activity.
1097
+ * @param request The request options.
1098
+ * @returns A promise with the result.
1099
+ */
1100
+ end(request) {
1101
+ return this.plugin.perform('liveActivityManager#end', request);
1102
+ }
1103
+ /**
1104
+ * Adds a Live Activity listener.
1105
+ */
1106
+ onLiveActivityUpdates(listener) {
1107
+ return this.plugin.addListener(EventType.IOSLiveActivitiesUpdated, listener);
1108
+ }
1109
+ }
1110
+
1111
+ /**
1112
+ * Live Update manager.
1113
+ */
1114
+ class AirshipLiveUpdateManager {
1115
+ constructor(plugin) {
1116
+ this.plugin = plugin;
1117
+ }
1118
+ /**
1119
+ * Lists any Live Updates for the request.
1120
+ * @param request The request options.
1121
+ * @returns A promise with the result.
1122
+ */
1123
+ list(request) {
1124
+ return this.plugin.perform('liveUpdateManager#list', request);
1125
+ }
1126
+ /**
1127
+ * Lists all Live Updates.
1128
+ * @returns A promise with the result.
1129
+ */
1130
+ listAll() {
1131
+ return this.plugin.perform('liveUpdateManager#listAll');
1132
+ }
1133
+ /**
1134
+ * Starts a Live Update.
1135
+ * @param request The request options.
1136
+ * @returns A promise with the result.
1137
+ */
1138
+ start(request) {
1139
+ return this.plugin.perform('liveUpdateManager#start', request);
1140
+ }
1141
+ /**
1142
+ * Updates a Live Update.
1143
+ * @param request The request options.
1144
+ * @returns A promise with the result.
1145
+ */
1146
+ update(request) {
1147
+ return this.plugin.perform('liveUpdateManager#update', request);
1148
+ }
1149
+ /**
1150
+ * Ends a Live Update.
1151
+ * @param request The request options.
1152
+ * @returns A promise with the result.
1153
+ */
1154
+ end(request) {
1155
+ return this.plugin.perform('liveUpdateManager#end', request);
1156
+ }
1157
+ /**
1158
+ * Clears all Live Updates.
1159
+ * @returns A promise with the result.
1160
+ */
1161
+ clearAll() {
1162
+ return this.plugin.perform('liveUpdateManager#clearAll');
1163
+ }
1164
+ }
1165
+
1055
1166
  /**
1056
1167
  * Airship
1057
1168
  */
@@ -1069,6 +1180,8 @@ class AirshipRoot {
1069
1180
  this.privacyManager = new AirshipPrivacyManager(plugin);
1070
1181
  this.push = new AirshipPush(plugin);
1071
1182
  this.featureFlagManager = new AirshipFeatureFlagManager(plugin);
1183
+ this.iOS = new AirshipRootIOS(plugin);
1184
+ this.android = new AirshipRootAndroid(plugin);
1072
1185
  }
1073
1186
  /**
1074
1187
  * Calls takeOff. If Airship is already configured for
@@ -1094,6 +1207,16 @@ class AirshipRoot {
1094
1207
  return this.plugin.addListener(EventType.DeepLink, listener);
1095
1208
  }
1096
1209
  }
1210
+ class AirshipRootIOS {
1211
+ constructor(plugin) {
1212
+ this.liveActivityManager = new AirshipLiveActivityManager(plugin);
1213
+ }
1214
+ }
1215
+ class AirshipRootAndroid {
1216
+ constructor(plugin) {
1217
+ this.liveUpdateManager = new AirshipLiveUpdateManager(plugin);
1218
+ }
1219
+ }
1097
1220
 
1098
1221
  /// <reference types="@capacitor/cli" />
1099
1222
  class AirshipPluginWrapper {
@@ -1301,6 +1424,8 @@ exports.AirshipChannel = AirshipChannel;
1301
1424
  exports.AirshipContact = AirshipContact;
1302
1425
  exports.AirshipFeatureFlagManager = AirshipFeatureFlagManager;
1303
1426
  exports.AirshipInApp = AirshipInApp;
1427
+ exports.AirshipLiveActivityManager = AirshipLiveActivityManager;
1428
+ exports.AirshipLiveUpdateManager = AirshipLiveUpdateManager;
1304
1429
  exports.AirshipLocale = AirshipLocale;
1305
1430
  exports.AirshipMessageCenter = AirshipMessageCenter;
1306
1431
  exports.AirshipPreferenceCenter = AirshipPreferenceCenter;