@@ -31,3 +31,143 @@ export interface Notification {
3131 /** URL of an image to include in the notification. */
3232 image ?: string ;
3333}
34+
35+
36+ // -----------------------------------------------------------------------------
37+ // FM Delivery Data Interfaces
38+ // -----------------------------------------------------------------------------
39+
40+ /**
41+ * Additional information about [proxy notification] delivery.
42+ * All percentages are calculated with 'countNotificationsAccepted' as the denominator.
43+ */
44+ export interface ProxyNotificationInsightPercents {
45+ /** The percentage of accepted notifications that were successfully proxied. */
46+ proxied ?: number ;
47+ /** The percentage of accepted notifications that failed to be proxied. */
48+ failed ?: number ;
49+ /** The percentage of accepted notifications that were skipped because proxy notification is unsupported for the recipient. */
50+ skippedUnsupported : number ;
51+ /** The percentage of accepted notifications that were skipped because the messages were not throttled. */
52+ skippedNotThrottled : number ;
53+ /** The percentage of accepted notifications that were skipped because configurations required for notifications to be proxied were missing. */
54+ skippedUnconfigured : number ;
55+ /** The percentage of accepted notifications that were skipped because the app disallowed these messages to be proxied. */
56+ skippedOptedOut : number ;
57+ }
58+
59+ /**
60+ * Additional information about message delivery. All percentages are calculated
61+ * with 'countMessagesAccepted' as the denominator.
62+ */
63+ export interface MessageInsightPercents {
64+ /** The percentage of accepted messages that had their priority lowered from high to normal. */
65+ priorityLowered : number ;
66+ }
67+
68+ /**
69+ * Overview of delivery performance for messages that were successfully delivered.
70+ * All percentages are calculated with 'countMessagesAccepted' as the denominator.
71+ */
72+ export interface DeliveryPerformancePercents {
73+ /** The percentage of accepted messages that were delivered to the device without delay from the FCM system. */
74+ deliveredNoDelay : number ;
75+ /** The percentage of accepted messages that were delayed because the target device was not connected at the time of sending. */
76+ delayedDeviceOffline : number ;
77+ /** The percentage of accepted messages that were delayed because the device was in doze mode. */
78+ delayedDeviceDoze : number ;
79+ /** The percentage of accepted messages that were delayed due to message throttling. */
80+ delayedMessageThrottled : number ;
81+ /** The percentage of accepted messages that were delayed because the intended device user-profile was stopped. */
82+ delayedUserStopped : number ;
83+ }
84+
85+ /**
86+ * Percentage breakdown of message delivery outcomes. These categories are mutually exclusive.
87+ * All percentages are calculated with 'countMessagesAccepted' as the denominator.
88+ */
89+ export interface MessageOutcomePercents {
90+ /** The percentage of all accepted messages that were successfully delivered to the device. */
91+ delivered : number ;
92+ /** The percentage of messages accepted that were not dropped and not delivered, due to the device being disconnected. */
93+ pending : number ;
94+ /** The percentage of accepted messages that were collapsed by another message. */
95+ collapsed : number ;
96+ /** The percentage of accepted messages that were dropped due to too many undelivered non-collapsible messages. */
97+ droppedTooManyPendingMessages : number ;
98+ /** The percentage of accepted messages that were dropped because the application was force stopped. */
99+ droppedAppForceStopped : number ;
100+ /** The percentage of accepted messages that were dropped because the target device is inactive. */
101+ droppedDeviceInactive : number ;
102+ /** The percentage of accepted messages that expired because Time To Live (TTL) elapsed. */
103+ droppedTtlExpired : number ;
104+ }
105+
106+ /**
107+ * Data detailing messaging delivery
108+ */
109+ export interface Data {
110+ /** Count of messages accepted by FCM intended for Android devices. */
111+ countMessagesAccepted : string ; // Use string for int64 to prevent potential precision issues
112+ /** Count of notifications accepted by FCM intended for Android devices. */
113+ countNotificationsAccepted : string ; // Use string for int64
114+ /** Mutually exclusive breakdown of message delivery outcomes. */
115+ messageOutcomePercents : MessageOutcomePercents ;
116+ /** Additional information about delivery performance for messages that were successfully delivered. */
117+ deliveryPerformancePercents : DeliveryPerformancePercents ;
118+ /** Additional general insights about message delivery. */
119+ messageInsightPercents : MessageInsightPercents ;
120+ /** Additional insights about proxy notification delivery. */
121+ proxyNotificationInsightPercents : ProxyNotificationInsightPercents ;
122+ }
123+
124+ // -----------------------------------------------------------------------------
125+ // Core API Interfaces
126+ // -----------------------------------------------------------------------------
127+
128+ /**
129+ * Message delivery data for a given date, app, and analytics label combination.
130+ */
131+ export interface AndroidDeliveryData {
132+ /** The app ID to which the messages were sent. */
133+ appId : string ;
134+ /** The date represented by this entry. */
135+ // TODO: where to get the date type from
136+ // date: string;
137+ /** The analytics label associated with the messages sent. */
138+ analyticsLabel : string ;
139+ /** The data for the specified combination. */
140+ data : Data ;
141+ }
142+
143+ /**
144+ * Request message for ListAndroidDeliveryData.
145+ */
146+ export interface ListAndroidDeliveryDataRequest {
147+ /**
148+ * The maximum number of entries to return.
149+ * If unspecified, at most 1,000 entries will be returned.
150+ */
151+ pageSize ?: number ;
152+ /**
153+ * A page token, received from a previous `ListAndroidDeliveryDataRequest` call.
154+ * Provide this to retrieve the subsequent page.
155+ */
156+ pageToken ?: string ;
157+ }
158+
159+ /**
160+ * Response message for ListAndroidDeliveryData.
161+ */
162+ export interface ListAndroidDeliveryDataResponse {
163+ /**
164+ * The delivery data for the provided app.
165+ * There will be one entry per combination of app, date, and analytics label.
166+ */
167+ androidDeliveryData : AndroidDeliveryData [ ] ;
168+ /**
169+ * A token, which can be sent as `page_token` to retrieve the next page.
170+ * If this field is omitted, there are no subsequent pages.
171+ */
172+ nextPageToken ?: string ;
173+ }
0 commit comments