|
22 | 22 |
|
23 | 23 | /* tslint:disable:max-line-length */ |
24 | 24 | import { AnalyticsEvent } from '../../src/providers/analytics'; |
| 25 | +import { Event } from '../../src/cloud-functions'; |
25 | 26 |
|
26 | 27 | // A payload, as it might arrive over the wire. Every possible field is filled out at least once. |
27 | 28 | export const fullPayload = JSON.parse(`{ |
@@ -124,70 +125,77 @@ export const fullPayload = JSON.parse(`{ |
124 | 125 | }`); |
125 | 126 |
|
126 | 127 | // The event data that we expect would be constructed if the payload above were to arrive. |
127 | | -export const fullEventData: AnalyticsEvent = { |
128 | | - reportingDate: '20170202', |
129 | | - name: 'Loaded_In_Background', |
130 | | - params: { |
131 | | - build: '1350', |
132 | | - calls_remaining: 10, |
133 | | - fraction_calls_dropped: 0.0123456, |
134 | | - average_call_rating: 4.5, |
135 | | - }, |
136 | | - logTime: '2017-02-02T23:06:26.124Z', |
137 | | - previousLogTime: '2017-02-02T23:01:19.797Z', |
138 | | - valueInUSD: 1234.5, |
139 | | - user: { |
140 | | - userId: 'abcdefghijklmnop!', |
141 | | - appInfo: { |
142 | | - appId: 'com.mobileday.MobileDay', |
143 | | - appInstanceId: 'E3C9939401814B9B954725A740B8C7BC', |
144 | | - appPlatform: 'IOS', |
145 | | - appStore: 'iTunes', |
146 | | - appVersion: '5.2.0', |
147 | | - }, |
148 | | - trafficSource: { |
149 | | - userAcquiredSource: 'Pizza Everywhere', |
150 | | - userAcquiredCampaign: 'Functions launch party', |
151 | | - userAcquiredMedium: 'Free food', |
152 | | - }, |
153 | | - bundleInfo: { |
154 | | - bundleSequenceId: 6034, |
155 | | - serverTimestampOffset: 371, |
| 128 | +export const fullEvent: Event<AnalyticsEvent> = { |
| 129 | + eventId: '1486080145623867projects/analytics-integration-fd82a/events/i_made_this_upproviders/google.firebase.analytics/eventTypes/event.sendprojects/f949d1bb9ef782579-tp/topics/cloud-functions-u54ejabpzs4prfjh7433eklhae', |
| 130 | + eventType: 'providers/google.firebase.analytics/eventTypes/event.send', |
| 131 | + resource: 'projects/analytics-integration-fd82a/events/i_made_this_up', |
| 132 | + timestamp: '2017-02-02T23:06:26.124Z', |
| 133 | + params: {}, |
| 134 | + data: { |
| 135 | + reportingDate: '20170202', |
| 136 | + name: 'Loaded_In_Background', |
| 137 | + params: { |
| 138 | + build: '1350', |
| 139 | + calls_remaining: 10, |
| 140 | + fraction_calls_dropped: 0.0123456, |
| 141 | + average_call_rating: 4.5, |
156 | 142 | }, |
157 | | - deviceInfo: { |
158 | | - deviceCategory: 'mobile', |
159 | | - deviceModel: 'iPhone7,2', |
160 | | - deviceTimeZoneOffsetSeconds: -21600, |
161 | | - mobileBrandName: 'Apple', |
162 | | - mobileMarketingName: 'iPhone 6', |
163 | | - mobileModelName: 'iPhone 6', |
164 | | - platformVersion: '10.2.1', |
165 | | - userDefaultLanguage: 'en-us', |
166 | | - deviceId: '599F9C00-92DC-4B5C-9464-7971F01F8370', |
167 | | - resettableDeviceId: '599F9C00-92DC-4B5C-9464-7971F01F8370', |
168 | | - limitedAdTracking: true, |
169 | | - }, |
170 | | - firstOpenTime: '2016-04-28T15:00:35.819Z', |
171 | | - geoInfo: { |
172 | | - city: 'Plano', |
173 | | - continent: '021', |
174 | | - country: 'United States', |
175 | | - region: 'Texas', |
176 | | - }, |
177 | | - userProperties: { |
178 | | - build: { |
179 | | - setTime: '2017-02-02T23:06:26.090Z', |
180 | | - value: '1350', |
| 143 | + logTime: '2017-02-02T23:06:26.124Z', |
| 144 | + previousLogTime: '2017-02-02T23:01:19.797Z', |
| 145 | + valueInUSD: 1234.5, |
| 146 | + user: { |
| 147 | + userId: 'abcdefghijklmnop!', |
| 148 | + appInfo: { |
| 149 | + appId: 'com.mobileday.MobileDay', |
| 150 | + appInstanceId: 'E3C9939401814B9B954725A740B8C7BC', |
| 151 | + appPlatform: 'IOS', |
| 152 | + appStore: 'iTunes', |
| 153 | + appVersion: '5.2.0', |
| 154 | + }, |
| 155 | + trafficSource: { |
| 156 | + userAcquiredSource: 'Pizza Everywhere', |
| 157 | + userAcquiredCampaign: 'Functions launch party', |
| 158 | + userAcquiredMedium: 'Free food', |
181 | 159 | }, |
182 | | - calls_remaining: { |
183 | | - setTime: '2017-02-02T23:06:26.094Z', |
184 | | - value: '10', |
| 160 | + bundleInfo: { |
| 161 | + bundleSequenceId: 6034, |
| 162 | + serverTimestampOffset: 371, |
185 | 163 | }, |
186 | | - version: { |
187 | | - setTime: '2017-02-02T23:06:26.085Z', |
188 | | - value: '5.2.0', |
| 164 | + deviceInfo: { |
| 165 | + deviceCategory: 'mobile', |
| 166 | + deviceModel: 'iPhone7,2', |
| 167 | + deviceTimeZoneOffsetSeconds: -21600, |
| 168 | + mobileBrandName: 'Apple', |
| 169 | + mobileMarketingName: 'iPhone 6', |
| 170 | + mobileModelName: 'iPhone 6', |
| 171 | + platformVersion: '10.2.1', |
| 172 | + userDefaultLanguage: 'en-us', |
| 173 | + deviceId: '599F9C00-92DC-4B5C-9464-7971F01F8370', |
| 174 | + resettableDeviceId: '599F9C00-92DC-4B5C-9464-7971F01F8370', |
| 175 | + limitedAdTracking: true, |
| 176 | + }, |
| 177 | + firstOpenTime: '2016-04-28T15:00:35.819Z', |
| 178 | + geoInfo: { |
| 179 | + city: 'Plano', |
| 180 | + continent: '021', |
| 181 | + country: 'United States', |
| 182 | + region: 'Texas', |
| 183 | + }, |
| 184 | + userProperties: { |
| 185 | + build: { |
| 186 | + setTime: '2017-02-02T23:06:26.090Z', |
| 187 | + value: '1350', |
| 188 | + }, |
| 189 | + calls_remaining: { |
| 190 | + setTime: '2017-02-02T23:06:26.094Z', |
| 191 | + value: '10', |
| 192 | + }, |
| 193 | + version: { |
| 194 | + setTime: '2017-02-02T23:06:26.085Z', |
| 195 | + value: '5.2.0', |
| 196 | + }, |
189 | 197 | }, |
| 198 | + ltvInUSD: 133.7, |
190 | 199 | }, |
191 | | - ltvInUSD: 133.7, |
192 | 200 | }, |
193 | 201 | }; |
0 commit comments