@firebase/app 0.10.13 → 0.10.14
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/dist/esm/index.esm2017.js +4 -4
- package/dist/esm/index.esm2017.js.map +1 -1
- package/dist/index.cjs.js +424 -628
- package/dist/index.cjs.js.map +1 -1
- package/package.json +7 -6
- package/dist/esm/index.esm5.js +0 -1359
- package/dist/esm/index.esm5.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var component = require('@firebase/component');
|
|
6
|
-
var tslib = require('tslib');
|
|
7
6
|
var logger$1 = require('@firebase/logger');
|
|
8
7
|
var util = require('@firebase/util');
|
|
9
8
|
var idb = require('idb');
|
|
@@ -24,31 +23,30 @@ var idb = require('idb');
|
|
|
24
23
|
* See the License for the specific language governing permissions and
|
|
25
24
|
* limitations under the License.
|
|
26
25
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
class PlatformLoggerServiceImpl {
|
|
27
|
+
constructor(container) {
|
|
29
28
|
this.container = container;
|
|
30
29
|
}
|
|
31
30
|
// In initial implementation, this will be called by installations on
|
|
32
31
|
// auth token refresh, and installations will send this string.
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
getPlatformInfoString() {
|
|
33
|
+
const providers = this.container.getProviders();
|
|
35
34
|
// Loop through providers and get library/version pairs from any that are
|
|
36
35
|
// version components.
|
|
37
36
|
return providers
|
|
38
|
-
.map(
|
|
37
|
+
.map(provider => {
|
|
39
38
|
if (isVersionServiceProvider(provider)) {
|
|
40
|
-
|
|
41
|
-
return
|
|
39
|
+
const service = provider.getImmediate();
|
|
40
|
+
return `${service.library}/${service.version}`;
|
|
42
41
|
}
|
|
43
42
|
else {
|
|
44
43
|
return null;
|
|
45
44
|
}
|
|
46
45
|
})
|
|
47
|
-
.filter(
|
|
46
|
+
.filter(logString => logString)
|
|
48
47
|
.join(' ');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}());
|
|
48
|
+
}
|
|
49
|
+
}
|
|
52
50
|
/**
|
|
53
51
|
*
|
|
54
52
|
* @param provider check if this provider provides a VersionService
|
|
@@ -58,12 +56,12 @@ var PlatformLoggerServiceImpl = /** @class */ (function () {
|
|
|
58
56
|
* provider.
|
|
59
57
|
*/
|
|
60
58
|
function isVersionServiceProvider(provider) {
|
|
61
|
-
|
|
59
|
+
const component = provider.getComponent();
|
|
62
60
|
return (component === null || component === void 0 ? void 0 : component.type) === "VERSION" /* ComponentType.VERSION */;
|
|
63
61
|
}
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const name$q = "@firebase/app";
|
|
64
|
+
const version$1 = "0.10.14";
|
|
67
65
|
|
|
68
66
|
/**
|
|
69
67
|
* @license
|
|
@@ -81,60 +79,60 @@ var version$1 = "0.10.13";
|
|
|
81
79
|
* See the License for the specific language governing permissions and
|
|
82
80
|
* limitations under the License.
|
|
83
81
|
*/
|
|
84
|
-
|
|
82
|
+
const logger = new logger$1.Logger('@firebase/app');
|
|
85
83
|
|
|
86
|
-
|
|
84
|
+
const name$p = "@firebase/app-compat";
|
|
87
85
|
|
|
88
|
-
|
|
86
|
+
const name$o = "@firebase/analytics-compat";
|
|
89
87
|
|
|
90
|
-
|
|
88
|
+
const name$n = "@firebase/analytics";
|
|
91
89
|
|
|
92
|
-
|
|
90
|
+
const name$m = "@firebase/app-check-compat";
|
|
93
91
|
|
|
94
|
-
|
|
92
|
+
const name$l = "@firebase/app-check";
|
|
95
93
|
|
|
96
|
-
|
|
94
|
+
const name$k = "@firebase/auth";
|
|
97
95
|
|
|
98
|
-
|
|
96
|
+
const name$j = "@firebase/auth-compat";
|
|
99
97
|
|
|
100
|
-
|
|
98
|
+
const name$i = "@firebase/database";
|
|
101
99
|
|
|
102
|
-
|
|
100
|
+
const name$h = "@firebase/data-connect";
|
|
103
101
|
|
|
104
|
-
|
|
102
|
+
const name$g = "@firebase/database-compat";
|
|
105
103
|
|
|
106
|
-
|
|
104
|
+
const name$f = "@firebase/functions";
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
const name$e = "@firebase/functions-compat";
|
|
109
107
|
|
|
110
|
-
|
|
108
|
+
const name$d = "@firebase/installations";
|
|
111
109
|
|
|
112
|
-
|
|
110
|
+
const name$c = "@firebase/installations-compat";
|
|
113
111
|
|
|
114
|
-
|
|
112
|
+
const name$b = "@firebase/messaging";
|
|
115
113
|
|
|
116
|
-
|
|
114
|
+
const name$a = "@firebase/messaging-compat";
|
|
117
115
|
|
|
118
|
-
|
|
116
|
+
const name$9 = "@firebase/performance";
|
|
119
117
|
|
|
120
|
-
|
|
118
|
+
const name$8 = "@firebase/performance-compat";
|
|
121
119
|
|
|
122
|
-
|
|
120
|
+
const name$7 = "@firebase/remote-config";
|
|
123
121
|
|
|
124
|
-
|
|
122
|
+
const name$6 = "@firebase/remote-config-compat";
|
|
125
123
|
|
|
126
|
-
|
|
124
|
+
const name$5 = "@firebase/storage";
|
|
127
125
|
|
|
128
|
-
|
|
126
|
+
const name$4 = "@firebase/storage-compat";
|
|
129
127
|
|
|
130
|
-
|
|
128
|
+
const name$3 = "@firebase/firestore";
|
|
131
129
|
|
|
132
|
-
|
|
130
|
+
const name$2 = "@firebase/vertexai";
|
|
133
131
|
|
|
134
|
-
|
|
132
|
+
const name$1 = "@firebase/firestore-compat";
|
|
135
133
|
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
const name = "firebase";
|
|
135
|
+
const version = "11.0.0";
|
|
138
136
|
|
|
139
137
|
/**
|
|
140
138
|
* @license
|
|
@@ -152,43 +150,42 @@ var version = "10.14.1";
|
|
|
152
150
|
* See the License for the specific language governing permissions and
|
|
153
151
|
* limitations under the License.
|
|
154
152
|
*/
|
|
155
|
-
var _a$1;
|
|
156
153
|
/**
|
|
157
154
|
* The default app name
|
|
158
155
|
*
|
|
159
156
|
* @internal
|
|
160
157
|
*/
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
158
|
+
const DEFAULT_ENTRY_NAME = '[DEFAULT]';
|
|
159
|
+
const PLATFORM_LOG_STRING = {
|
|
160
|
+
[name$q]: 'fire-core',
|
|
161
|
+
[name$p]: 'fire-core-compat',
|
|
162
|
+
[name$n]: 'fire-analytics',
|
|
163
|
+
[name$o]: 'fire-analytics-compat',
|
|
164
|
+
[name$l]: 'fire-app-check',
|
|
165
|
+
[name$m]: 'fire-app-check-compat',
|
|
166
|
+
[name$k]: 'fire-auth',
|
|
167
|
+
[name$j]: 'fire-auth-compat',
|
|
168
|
+
[name$i]: 'fire-rtdb',
|
|
169
|
+
[name$h]: 'fire-data-connect',
|
|
170
|
+
[name$g]: 'fire-rtdb-compat',
|
|
171
|
+
[name$f]: 'fire-fn',
|
|
172
|
+
[name$e]: 'fire-fn-compat',
|
|
173
|
+
[name$d]: 'fire-iid',
|
|
174
|
+
[name$c]: 'fire-iid-compat',
|
|
175
|
+
[name$b]: 'fire-fcm',
|
|
176
|
+
[name$a]: 'fire-fcm-compat',
|
|
177
|
+
[name$9]: 'fire-perf',
|
|
178
|
+
[name$8]: 'fire-perf-compat',
|
|
179
|
+
[name$7]: 'fire-rc',
|
|
180
|
+
[name$6]: 'fire-rc-compat',
|
|
181
|
+
[name$5]: 'fire-gcs',
|
|
182
|
+
[name$4]: 'fire-gcs-compat',
|
|
183
|
+
[name$3]: 'fire-fst',
|
|
184
|
+
[name$1]: 'fire-fst-compat',
|
|
185
|
+
[name$2]: 'fire-vertex',
|
|
186
|
+
'fire-js': 'fire-js',
|
|
187
|
+
[name]: 'fire-js-all'
|
|
188
|
+
};
|
|
192
189
|
|
|
193
190
|
/**
|
|
194
191
|
* @license
|
|
@@ -209,18 +206,18 @@ var PLATFORM_LOG_STRING = (_a$1 = {},
|
|
|
209
206
|
/**
|
|
210
207
|
* @internal
|
|
211
208
|
*/
|
|
212
|
-
|
|
209
|
+
const _apps = new Map();
|
|
213
210
|
/**
|
|
214
211
|
* @internal
|
|
215
212
|
*/
|
|
216
|
-
|
|
213
|
+
const _serverApps = new Map();
|
|
217
214
|
/**
|
|
218
215
|
* Registered components.
|
|
219
216
|
*
|
|
220
217
|
* @internal
|
|
221
218
|
*/
|
|
222
219
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
223
|
-
|
|
220
|
+
const _components = new Map();
|
|
224
221
|
/**
|
|
225
222
|
* @param component - the component being added to this app's container
|
|
226
223
|
*
|
|
@@ -231,7 +228,7 @@ function _addComponent(app, component) {
|
|
|
231
228
|
app.container.addComponent(component);
|
|
232
229
|
}
|
|
233
230
|
catch (e) {
|
|
234
|
-
logger.debug(
|
|
231
|
+
logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);
|
|
235
232
|
}
|
|
236
233
|
}
|
|
237
234
|
/**
|
|
@@ -249,39 +246,18 @@ function _addOrOverwriteComponent(app, component) {
|
|
|
249
246
|
* @internal
|
|
250
247
|
*/
|
|
251
248
|
function _registerComponent(component) {
|
|
252
|
-
|
|
253
|
-
var componentName = component.name;
|
|
249
|
+
const componentName = component.name;
|
|
254
250
|
if (_components.has(componentName)) {
|
|
255
|
-
logger.debug(
|
|
251
|
+
logger.debug(`There were multiple attempts to register component ${componentName}.`);
|
|
256
252
|
return false;
|
|
257
253
|
}
|
|
258
254
|
_components.set(componentName, component);
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
var app = _d.value;
|
|
263
|
-
_addComponent(app, component);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
267
|
-
finally {
|
|
268
|
-
try {
|
|
269
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
270
|
-
}
|
|
271
|
-
finally { if (e_1) throw e_1.error; }
|
|
272
|
-
}
|
|
273
|
-
try {
|
|
274
|
-
for (var _e = tslib.__values(_serverApps.values()), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
275
|
-
var serverApp = _f.value;
|
|
276
|
-
_addComponent(serverApp, component);
|
|
277
|
-
}
|
|
255
|
+
// add the component to existing app instances
|
|
256
|
+
for (const app of _apps.values()) {
|
|
257
|
+
_addComponent(app, component);
|
|
278
258
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
try {
|
|
282
|
-
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
283
|
-
}
|
|
284
|
-
finally { if (e_2) throw e_2.error; }
|
|
259
|
+
for (const serverApp of _serverApps.values()) {
|
|
260
|
+
_addComponent(serverApp, component);
|
|
285
261
|
}
|
|
286
262
|
return true;
|
|
287
263
|
}
|
|
@@ -295,7 +271,7 @@ function _registerComponent(component) {
|
|
|
295
271
|
* @internal
|
|
296
272
|
*/
|
|
297
273
|
function _getProvider(app, name) {
|
|
298
|
-
|
|
274
|
+
const heartbeatController = app.container
|
|
299
275
|
.getProvider('heartbeat')
|
|
300
276
|
.getImmediate({ optional: true });
|
|
301
277
|
if (heartbeatController) {
|
|
@@ -311,8 +287,7 @@ function _getProvider(app, name) {
|
|
|
311
287
|
*
|
|
312
288
|
* @internal
|
|
313
289
|
*/
|
|
314
|
-
function _removeServiceInstance(app, name, instanceIdentifier) {
|
|
315
|
-
if (instanceIdentifier === void 0) { instanceIdentifier = DEFAULT_ENTRY_NAME; }
|
|
290
|
+
function _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {
|
|
316
291
|
_getProvider(app, name).clearInstance(instanceIdentifier);
|
|
317
292
|
}
|
|
318
293
|
/**
|
|
@@ -362,26 +337,25 @@ function _clearComponents() {
|
|
|
362
337
|
* See the License for the specific language governing permissions and
|
|
363
338
|
* limitations under the License.
|
|
364
339
|
*/
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
_a["no-app" /* AppError.NO_APP */] = "No Firebase App '{$appName}' has been created - " +
|
|
340
|
+
const ERRORS = {
|
|
341
|
+
["no-app" /* AppError.NO_APP */]: "No Firebase App '{$appName}' has been created - " +
|
|
368
342
|
'call initializeApp() first',
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
343
|
+
["bad-app-name" /* AppError.BAD_APP_NAME */]: "Illegal App name: '{$appName}'",
|
|
344
|
+
["duplicate-app" /* AppError.DUPLICATE_APP */]: "Firebase App named '{$appName}' already exists with different options or config",
|
|
345
|
+
["app-deleted" /* AppError.APP_DELETED */]: "Firebase App named '{$appName}' already deleted",
|
|
346
|
+
["server-app-deleted" /* AppError.SERVER_APP_DELETED */]: 'Firebase Server App has been deleted',
|
|
347
|
+
["no-options" /* AppError.NO_OPTIONS */]: 'Need to provide options, when not being deployed to hosting via source.',
|
|
348
|
+
["invalid-app-argument" /* AppError.INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +
|
|
375
349
|
'Firebase App instance.',
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
350
|
+
["invalid-log-argument" /* AppError.INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',
|
|
351
|
+
["idb-open" /* AppError.IDB_OPEN */]: 'Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.',
|
|
352
|
+
["idb-get" /* AppError.IDB_GET */]: 'Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.',
|
|
353
|
+
["idb-set" /* AppError.IDB_WRITE */]: 'Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.',
|
|
354
|
+
["idb-delete" /* AppError.IDB_DELETE */]: 'Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.',
|
|
355
|
+
["finalization-registry-not-supported" /* AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED */]: 'FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.',
|
|
356
|
+
["invalid-server-app-environment" /* AppError.INVALID_SERVER_APP_ENVIRONMENT */]: 'FirebaseServerApp is not for use in browser environments.'
|
|
357
|
+
};
|
|
358
|
+
const ERROR_FACTORY = new util.ErrorFactory('app', 'Firebase', ERRORS);
|
|
385
359
|
|
|
386
360
|
/**
|
|
387
361
|
* @license
|
|
@@ -399,82 +373,56 @@ var ERROR_FACTORY = new util.ErrorFactory('app', 'Firebase', ERRORS);
|
|
|
399
373
|
* See the License for the specific language governing permissions and
|
|
400
374
|
* limitations under the License.
|
|
401
375
|
*/
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
var _this = this;
|
|
376
|
+
class FirebaseAppImpl {
|
|
377
|
+
constructor(options, config, container) {
|
|
405
378
|
this._isDeleted = false;
|
|
406
|
-
this._options =
|
|
407
|
-
this._config =
|
|
379
|
+
this._options = Object.assign({}, options);
|
|
380
|
+
this._config = Object.assign({}, config);
|
|
408
381
|
this._name = config.name;
|
|
409
382
|
this._automaticDataCollectionEnabled =
|
|
410
383
|
config.automaticDataCollectionEnabled;
|
|
411
384
|
this._container = container;
|
|
412
|
-
this.container.addComponent(new component.Component('app',
|
|
385
|
+
this.container.addComponent(new component.Component('app', () => this, "PUBLIC" /* ComponentType.PUBLIC */));
|
|
386
|
+
}
|
|
387
|
+
get automaticDataCollectionEnabled() {
|
|
388
|
+
this.checkDestroyed();
|
|
389
|
+
return this._automaticDataCollectionEnabled;
|
|
390
|
+
}
|
|
391
|
+
set automaticDataCollectionEnabled(val) {
|
|
392
|
+
this.checkDestroyed();
|
|
393
|
+
this._automaticDataCollectionEnabled = val;
|
|
394
|
+
}
|
|
395
|
+
get name() {
|
|
396
|
+
this.checkDestroyed();
|
|
397
|
+
return this._name;
|
|
398
|
+
}
|
|
399
|
+
get options() {
|
|
400
|
+
this.checkDestroyed();
|
|
401
|
+
return this._options;
|
|
402
|
+
}
|
|
403
|
+
get config() {
|
|
404
|
+
this.checkDestroyed();
|
|
405
|
+
return this._config;
|
|
406
|
+
}
|
|
407
|
+
get container() {
|
|
408
|
+
return this._container;
|
|
409
|
+
}
|
|
410
|
+
get isDeleted() {
|
|
411
|
+
return this._isDeleted;
|
|
412
|
+
}
|
|
413
|
+
set isDeleted(val) {
|
|
414
|
+
this._isDeleted = val;
|
|
413
415
|
}
|
|
414
|
-
Object.defineProperty(FirebaseAppImpl.prototype, "automaticDataCollectionEnabled", {
|
|
415
|
-
get: function () {
|
|
416
|
-
this.checkDestroyed();
|
|
417
|
-
return this._automaticDataCollectionEnabled;
|
|
418
|
-
},
|
|
419
|
-
set: function (val) {
|
|
420
|
-
this.checkDestroyed();
|
|
421
|
-
this._automaticDataCollectionEnabled = val;
|
|
422
|
-
},
|
|
423
|
-
enumerable: false,
|
|
424
|
-
configurable: true
|
|
425
|
-
});
|
|
426
|
-
Object.defineProperty(FirebaseAppImpl.prototype, "name", {
|
|
427
|
-
get: function () {
|
|
428
|
-
this.checkDestroyed();
|
|
429
|
-
return this._name;
|
|
430
|
-
},
|
|
431
|
-
enumerable: false,
|
|
432
|
-
configurable: true
|
|
433
|
-
});
|
|
434
|
-
Object.defineProperty(FirebaseAppImpl.prototype, "options", {
|
|
435
|
-
get: function () {
|
|
436
|
-
this.checkDestroyed();
|
|
437
|
-
return this._options;
|
|
438
|
-
},
|
|
439
|
-
enumerable: false,
|
|
440
|
-
configurable: true
|
|
441
|
-
});
|
|
442
|
-
Object.defineProperty(FirebaseAppImpl.prototype, "config", {
|
|
443
|
-
get: function () {
|
|
444
|
-
this.checkDestroyed();
|
|
445
|
-
return this._config;
|
|
446
|
-
},
|
|
447
|
-
enumerable: false,
|
|
448
|
-
configurable: true
|
|
449
|
-
});
|
|
450
|
-
Object.defineProperty(FirebaseAppImpl.prototype, "container", {
|
|
451
|
-
get: function () {
|
|
452
|
-
return this._container;
|
|
453
|
-
},
|
|
454
|
-
enumerable: false,
|
|
455
|
-
configurable: true
|
|
456
|
-
});
|
|
457
|
-
Object.defineProperty(FirebaseAppImpl.prototype, "isDeleted", {
|
|
458
|
-
get: function () {
|
|
459
|
-
return this._isDeleted;
|
|
460
|
-
},
|
|
461
|
-
set: function (val) {
|
|
462
|
-
this._isDeleted = val;
|
|
463
|
-
},
|
|
464
|
-
enumerable: false,
|
|
465
|
-
configurable: true
|
|
466
|
-
});
|
|
467
416
|
/**
|
|
468
417
|
* This function will throw an Error if the App has already been deleted -
|
|
469
418
|
* use before performing API actions on the App.
|
|
470
419
|
*/
|
|
471
|
-
|
|
420
|
+
checkDestroyed() {
|
|
472
421
|
if (this.isDeleted) {
|
|
473
422
|
throw ERROR_FACTORY.create("app-deleted" /* AppError.APP_DELETED */, { appName: this._name });
|
|
474
423
|
}
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
}());
|
|
424
|
+
}
|
|
425
|
+
}
|
|
478
426
|
|
|
479
427
|
/**
|
|
480
428
|
* @license
|
|
@@ -492,57 +440,50 @@ var FirebaseAppImpl = /** @class */ (function () {
|
|
|
492
440
|
* See the License for the specific language governing permissions and
|
|
493
441
|
* limitations under the License.
|
|
494
442
|
*/
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
function FirebaseServerAppImpl(options, serverConfig, name, container) {
|
|
498
|
-
var _this = this;
|
|
443
|
+
class FirebaseServerAppImpl extends FirebaseAppImpl {
|
|
444
|
+
constructor(options, serverConfig, name, container) {
|
|
499
445
|
// Build configuration parameters for the FirebaseAppImpl base class.
|
|
500
|
-
|
|
446
|
+
const automaticDataCollectionEnabled = serverConfig.automaticDataCollectionEnabled !== undefined
|
|
501
447
|
? serverConfig.automaticDataCollectionEnabled
|
|
502
448
|
: false;
|
|
503
449
|
// Create the FirebaseAppSettings object for the FirebaseAppImp constructor.
|
|
504
|
-
|
|
505
|
-
name
|
|
506
|
-
automaticDataCollectionEnabled
|
|
450
|
+
const config = {
|
|
451
|
+
name,
|
|
452
|
+
automaticDataCollectionEnabled
|
|
507
453
|
};
|
|
508
454
|
if (options.apiKey !== undefined) {
|
|
509
455
|
// Construct the parent FirebaseAppImp object.
|
|
510
|
-
|
|
456
|
+
super(options, config, container);
|
|
511
457
|
}
|
|
512
458
|
else {
|
|
513
|
-
|
|
514
|
-
|
|
459
|
+
const appImpl = options;
|
|
460
|
+
super(appImpl.options, config, container);
|
|
515
461
|
}
|
|
516
462
|
// Now construct the data for the FirebaseServerAppImpl.
|
|
517
|
-
|
|
518
|
-
|
|
463
|
+
this._serverConfig = Object.assign({ automaticDataCollectionEnabled }, serverConfig);
|
|
464
|
+
this._finalizationRegistry = null;
|
|
519
465
|
if (typeof FinalizationRegistry !== 'undefined') {
|
|
520
|
-
|
|
521
|
-
|
|
466
|
+
this._finalizationRegistry = new FinalizationRegistry(() => {
|
|
467
|
+
this.automaticCleanup();
|
|
522
468
|
});
|
|
523
469
|
}
|
|
524
|
-
|
|
525
|
-
|
|
470
|
+
this._refCount = 0;
|
|
471
|
+
this.incRefCount(this._serverConfig.releaseOnDeref);
|
|
526
472
|
// Do not retain a hard reference to the dref object, otherwise the FinalizationRegistry
|
|
527
473
|
// will never trigger.
|
|
528
|
-
|
|
474
|
+
this._serverConfig.releaseOnDeref = undefined;
|
|
529
475
|
serverConfig.releaseOnDeref = undefined;
|
|
530
476
|
registerVersion(name$q, version$1, 'serverapp');
|
|
531
|
-
return _this;
|
|
532
477
|
}
|
|
533
|
-
|
|
478
|
+
toJSON() {
|
|
534
479
|
return undefined;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
},
|
|
540
|
-
enumerable: false,
|
|
541
|
-
configurable: true
|
|
542
|
-
});
|
|
480
|
+
}
|
|
481
|
+
get refCount() {
|
|
482
|
+
return this._refCount;
|
|
483
|
+
}
|
|
543
484
|
// Increment the reference count of this server app. If an object is provided, register it
|
|
544
485
|
// with the finalization registry.
|
|
545
|
-
|
|
486
|
+
incRefCount(obj) {
|
|
546
487
|
if (this.isDeleted) {
|
|
547
488
|
return;
|
|
548
489
|
}
|
|
@@ -550,39 +491,34 @@ var FirebaseServerAppImpl = /** @class */ (function (_super) {
|
|
|
550
491
|
if (obj !== undefined && this._finalizationRegistry !== null) {
|
|
551
492
|
this._finalizationRegistry.register(obj, this);
|
|
552
493
|
}
|
|
553
|
-
}
|
|
494
|
+
}
|
|
554
495
|
// Decrement the reference count.
|
|
555
|
-
|
|
496
|
+
decRefCount() {
|
|
556
497
|
if (this.isDeleted) {
|
|
557
498
|
return 0;
|
|
558
499
|
}
|
|
559
500
|
return --this._refCount;
|
|
560
|
-
}
|
|
501
|
+
}
|
|
561
502
|
// Invoked by the FinalizationRegistry callback to note that this app should go through its
|
|
562
503
|
// reference counts and delete itself if no reference count remain. The coordinating logic that
|
|
563
504
|
// handles this is in deleteApp(...).
|
|
564
|
-
|
|
505
|
+
automaticCleanup() {
|
|
565
506
|
void deleteApp(this);
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
},
|
|
572
|
-
enumerable: false,
|
|
573
|
-
configurable: true
|
|
574
|
-
});
|
|
507
|
+
}
|
|
508
|
+
get settings() {
|
|
509
|
+
this.checkDestroyed();
|
|
510
|
+
return this._serverConfig;
|
|
511
|
+
}
|
|
575
512
|
/**
|
|
576
513
|
* This function will throw an Error if the App has already been deleted -
|
|
577
514
|
* use before performing API actions on the App.
|
|
578
515
|
*/
|
|
579
|
-
|
|
516
|
+
checkDestroyed() {
|
|
580
517
|
if (this.isDeleted) {
|
|
581
518
|
throw ERROR_FACTORY.create("server-app-deleted" /* AppError.SERVER_APP_DELETED */);
|
|
582
519
|
}
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
}(FirebaseAppImpl));
|
|
520
|
+
}
|
|
521
|
+
}
|
|
586
522
|
|
|
587
523
|
/**
|
|
588
524
|
* @license
|
|
@@ -605,17 +541,15 @@ var FirebaseServerAppImpl = /** @class */ (function (_super) {
|
|
|
605
541
|
*
|
|
606
542
|
* @public
|
|
607
543
|
*/
|
|
608
|
-
|
|
609
|
-
function initializeApp(_options, rawConfig) {
|
|
610
|
-
|
|
611
|
-
if (rawConfig === void 0) { rawConfig = {}; }
|
|
612
|
-
var options = _options;
|
|
544
|
+
const SDK_VERSION = version;
|
|
545
|
+
function initializeApp(_options, rawConfig = {}) {
|
|
546
|
+
let options = _options;
|
|
613
547
|
if (typeof rawConfig !== 'object') {
|
|
614
|
-
|
|
615
|
-
rawConfig = { name
|
|
548
|
+
const name = rawConfig;
|
|
549
|
+
rawConfig = { name };
|
|
616
550
|
}
|
|
617
|
-
|
|
618
|
-
|
|
551
|
+
const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);
|
|
552
|
+
const name = config.name;
|
|
619
553
|
if (typeof name !== 'string' || !name) {
|
|
620
554
|
throw ERROR_FACTORY.create("bad-app-name" /* AppError.BAD_APP_NAME */, {
|
|
621
555
|
appName: String(name)
|
|
@@ -625,7 +559,7 @@ function initializeApp(_options, rawConfig) {
|
|
|
625
559
|
if (!options) {
|
|
626
560
|
throw ERROR_FACTORY.create("no-options" /* AppError.NO_OPTIONS */);
|
|
627
561
|
}
|
|
628
|
-
|
|
562
|
+
const existingApp = _apps.get(name);
|
|
629
563
|
if (existingApp) {
|
|
630
564
|
// return the existing app if options and config deep equal the ones in the existing app.
|
|
631
565
|
if (util.deepEqual(options, existingApp.options) &&
|
|
@@ -636,26 +570,15 @@ function initializeApp(_options, rawConfig) {
|
|
|
636
570
|
throw ERROR_FACTORY.create("duplicate-app" /* AppError.DUPLICATE_APP */, { appName: name });
|
|
637
571
|
}
|
|
638
572
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
var component$1 = _c.value;
|
|
643
|
-
container.addComponent(component$1);
|
|
644
|
-
}
|
|
573
|
+
const container = new component.ComponentContainer(name);
|
|
574
|
+
for (const component of _components.values()) {
|
|
575
|
+
container.addComponent(component);
|
|
645
576
|
}
|
|
646
|
-
|
|
647
|
-
finally {
|
|
648
|
-
try {
|
|
649
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
650
|
-
}
|
|
651
|
-
finally { if (e_1) throw e_1.error; }
|
|
652
|
-
}
|
|
653
|
-
var newApp = new FirebaseAppImpl(options, config, container);
|
|
577
|
+
const newApp = new FirebaseAppImpl(options, config, container);
|
|
654
578
|
_apps.set(name, newApp);
|
|
655
579
|
return newApp;
|
|
656
580
|
}
|
|
657
581
|
function initializeServerApp(_options, _serverAppConfig) {
|
|
658
|
-
var e_2, _a;
|
|
659
582
|
if (util.isBrowser() && !util.isWebWorker()) {
|
|
660
583
|
// FirebaseServerApp isn't designed to be run in browsers.
|
|
661
584
|
throw ERROR_FACTORY.create("invalid-server-app-environment" /* AppError.INVALID_SERVER_APP_ENVIRONMENT */);
|
|
@@ -663,7 +586,7 @@ function initializeServerApp(_options, _serverAppConfig) {
|
|
|
663
586
|
if (_serverAppConfig.automaticDataCollectionEnabled === undefined) {
|
|
664
587
|
_serverAppConfig.automaticDataCollectionEnabled = false;
|
|
665
588
|
}
|
|
666
|
-
|
|
589
|
+
let appOptions;
|
|
667
590
|
if (_isFirebaseApp(_options)) {
|
|
668
591
|
appOptions = _options.options;
|
|
669
592
|
}
|
|
@@ -671,41 +594,31 @@ function initializeServerApp(_options, _serverAppConfig) {
|
|
|
671
594
|
appOptions = _options;
|
|
672
595
|
}
|
|
673
596
|
// Build an app name based on a hash of the configuration options.
|
|
674
|
-
|
|
597
|
+
const nameObj = Object.assign(Object.assign({}, _serverAppConfig), appOptions);
|
|
675
598
|
// However, Do not mangle the name based on releaseOnDeref, since it will vary between the
|
|
676
599
|
// construction of FirebaseServerApp instances. For example, if the object is the request headers.
|
|
677
600
|
if (nameObj.releaseOnDeref !== undefined) {
|
|
678
601
|
delete nameObj.releaseOnDeref;
|
|
679
602
|
}
|
|
680
|
-
|
|
681
|
-
return
|
|
603
|
+
const hashCode = (s) => {
|
|
604
|
+
return [...s].reduce((hash, c) => (Math.imul(31, hash) + c.charCodeAt(0)) | 0, 0);
|
|
682
605
|
};
|
|
683
606
|
if (_serverAppConfig.releaseOnDeref !== undefined) {
|
|
684
607
|
if (typeof FinalizationRegistry === 'undefined') {
|
|
685
608
|
throw ERROR_FACTORY.create("finalization-registry-not-supported" /* AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED */, {});
|
|
686
609
|
}
|
|
687
610
|
}
|
|
688
|
-
|
|
689
|
-
|
|
611
|
+
const nameString = '' + hashCode(JSON.stringify(nameObj));
|
|
612
|
+
const existingApp = _serverApps.get(nameString);
|
|
690
613
|
if (existingApp) {
|
|
691
614
|
existingApp.incRefCount(_serverAppConfig.releaseOnDeref);
|
|
692
615
|
return existingApp;
|
|
693
616
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
var component$1 = _c.value;
|
|
698
|
-
container.addComponent(component$1);
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
702
|
-
finally {
|
|
703
|
-
try {
|
|
704
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
705
|
-
}
|
|
706
|
-
finally { if (e_2) throw e_2.error; }
|
|
617
|
+
const container = new component.ComponentContainer(nameString);
|
|
618
|
+
for (const component of _components.values()) {
|
|
619
|
+
container.addComponent(component);
|
|
707
620
|
}
|
|
708
|
-
|
|
621
|
+
const newApp = new FirebaseServerAppImpl(appOptions, _serverAppConfig, nameString, container);
|
|
709
622
|
_serverApps.set(nameString, newApp);
|
|
710
623
|
return newApp;
|
|
711
624
|
}
|
|
@@ -738,9 +651,8 @@ function initializeServerApp(_options, _serverAppConfig) {
|
|
|
738
651
|
*
|
|
739
652
|
* @public
|
|
740
653
|
*/
|
|
741
|
-
function getApp(name) {
|
|
742
|
-
|
|
743
|
-
var app = _apps.get(name);
|
|
654
|
+
function getApp(name = DEFAULT_ENTRY_NAME) {
|
|
655
|
+
const app = _apps.get(name);
|
|
744
656
|
if (!app && name === DEFAULT_ENTRY_NAME && util.getDefaultAppConfig()) {
|
|
745
657
|
return initializeApp();
|
|
746
658
|
}
|
|
@@ -773,37 +685,26 @@ function getApps() {
|
|
|
773
685
|
*
|
|
774
686
|
* @public
|
|
775
687
|
*/
|
|
776
|
-
function deleteApp(app) {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
return [4 /*yield*/, Promise.all(app.container
|
|
797
|
-
.getProviders()
|
|
798
|
-
.map(function (provider) { return provider.delete(); }))];
|
|
799
|
-
case 1:
|
|
800
|
-
_a.sent();
|
|
801
|
-
app.isDeleted = true;
|
|
802
|
-
_a.label = 2;
|
|
803
|
-
case 2: return [2 /*return*/];
|
|
804
|
-
}
|
|
805
|
-
});
|
|
806
|
-
});
|
|
688
|
+
async function deleteApp(app) {
|
|
689
|
+
let cleanupProviders = false;
|
|
690
|
+
const name = app.name;
|
|
691
|
+
if (_apps.has(name)) {
|
|
692
|
+
cleanupProviders = true;
|
|
693
|
+
_apps.delete(name);
|
|
694
|
+
}
|
|
695
|
+
else if (_serverApps.has(name)) {
|
|
696
|
+
const firebaseServerApp = app;
|
|
697
|
+
if (firebaseServerApp.decRefCount() <= 0) {
|
|
698
|
+
_serverApps.delete(name);
|
|
699
|
+
cleanupProviders = true;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
if (cleanupProviders) {
|
|
703
|
+
await Promise.all(app.container
|
|
704
|
+
.getProviders()
|
|
705
|
+
.map(provider => provider.delete()));
|
|
706
|
+
app.isDeleted = true;
|
|
707
|
+
}
|
|
807
708
|
}
|
|
808
709
|
/**
|
|
809
710
|
* Registers a library's name and version for platform logging purposes.
|
|
@@ -817,29 +718,29 @@ function registerVersion(libraryKeyOrName, version, variant) {
|
|
|
817
718
|
var _a;
|
|
818
719
|
// TODO: We can use this check to whitelist strings when/if we set up
|
|
819
720
|
// a good whitelist system.
|
|
820
|
-
|
|
721
|
+
let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;
|
|
821
722
|
if (variant) {
|
|
822
|
-
library +=
|
|
723
|
+
library += `-${variant}`;
|
|
823
724
|
}
|
|
824
|
-
|
|
825
|
-
|
|
725
|
+
const libraryMismatch = library.match(/\s|\//);
|
|
726
|
+
const versionMismatch = version.match(/\s|\//);
|
|
826
727
|
if (libraryMismatch || versionMismatch) {
|
|
827
|
-
|
|
828
|
-
|
|
728
|
+
const warning = [
|
|
729
|
+
`Unable to register library "${library}" with version "${version}":`
|
|
829
730
|
];
|
|
830
731
|
if (libraryMismatch) {
|
|
831
|
-
warning.push(
|
|
732
|
+
warning.push(`library name "${library}" contains illegal characters (whitespace or "/")`);
|
|
832
733
|
}
|
|
833
734
|
if (libraryMismatch && versionMismatch) {
|
|
834
735
|
warning.push('and');
|
|
835
736
|
}
|
|
836
737
|
if (versionMismatch) {
|
|
837
|
-
warning.push(
|
|
738
|
+
warning.push(`version name "${version}" contains illegal characters (whitespace or "/")`);
|
|
838
739
|
}
|
|
839
740
|
logger.warn(warning.join(' '));
|
|
840
741
|
return;
|
|
841
742
|
}
|
|
842
|
-
_registerComponent(new component.Component(
|
|
743
|
+
_registerComponent(new component.Component(`${library}-version`, () => ({ library, version }), "VERSION" /* ComponentType.VERSION */));
|
|
843
744
|
}
|
|
844
745
|
/**
|
|
845
746
|
* Sets log handler for all Firebase SDKs.
|
|
@@ -883,14 +784,14 @@ function setLogLevel(logLevel) {
|
|
|
883
784
|
* See the License for the specific language governing permissions and
|
|
884
785
|
* limitations under the License.
|
|
885
786
|
*/
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
787
|
+
const DB_NAME = 'firebase-heartbeat-database';
|
|
788
|
+
const DB_VERSION = 1;
|
|
789
|
+
const STORE_NAME = 'firebase-heartbeat-store';
|
|
790
|
+
let dbPromise = null;
|
|
890
791
|
function getDbPromise() {
|
|
891
792
|
if (!dbPromise) {
|
|
892
793
|
dbPromise = idb.openDB(DB_NAME, DB_VERSION, {
|
|
893
|
-
upgrade:
|
|
794
|
+
upgrade: (db, oldVersion) => {
|
|
894
795
|
// We don't use 'break' in this switch statement, the fall-through
|
|
895
796
|
// behavior is what we want, because if there are multiple versions between
|
|
896
797
|
// the old version and the current version, we want ALL the migrations
|
|
@@ -909,7 +810,7 @@ function getDbPromise() {
|
|
|
909
810
|
}
|
|
910
811
|
}
|
|
911
812
|
}
|
|
912
|
-
}).catch(
|
|
813
|
+
}).catch(e => {
|
|
913
814
|
throw ERROR_FACTORY.create("idb-open" /* AppError.IDB_OPEN */, {
|
|
914
815
|
originalErrorMessage: e.message
|
|
915
816
|
});
|
|
@@ -917,83 +818,50 @@ function getDbPromise() {
|
|
|
917
818
|
}
|
|
918
819
|
return dbPromise;
|
|
919
820
|
}
|
|
920
|
-
function readHeartbeatsFromIndexedDB(app) {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
return [2 /*return*/, result];
|
|
942
|
-
case 4:
|
|
943
|
-
e_1 = _a.sent();
|
|
944
|
-
if (e_1 instanceof util.FirebaseError) {
|
|
945
|
-
logger.warn(e_1.message);
|
|
946
|
-
}
|
|
947
|
-
else {
|
|
948
|
-
idbGetError = ERROR_FACTORY.create("idb-get" /* AppError.IDB_GET */, {
|
|
949
|
-
originalErrorMessage: e_1 === null || e_1 === void 0 ? void 0 : e_1.message
|
|
950
|
-
});
|
|
951
|
-
logger.warn(idbGetError.message);
|
|
952
|
-
}
|
|
953
|
-
return [3 /*break*/, 5];
|
|
954
|
-
case 5: return [2 /*return*/];
|
|
955
|
-
}
|
|
956
|
-
});
|
|
957
|
-
});
|
|
821
|
+
async function readHeartbeatsFromIndexedDB(app) {
|
|
822
|
+
try {
|
|
823
|
+
const db = await getDbPromise();
|
|
824
|
+
const tx = db.transaction(STORE_NAME);
|
|
825
|
+
const result = await tx.objectStore(STORE_NAME).get(computeKey(app));
|
|
826
|
+
// We already have the value but tx.done can throw,
|
|
827
|
+
// so we need to await it here to catch errors
|
|
828
|
+
await tx.done;
|
|
829
|
+
return result;
|
|
830
|
+
}
|
|
831
|
+
catch (e) {
|
|
832
|
+
if (e instanceof util.FirebaseError) {
|
|
833
|
+
logger.warn(e.message);
|
|
834
|
+
}
|
|
835
|
+
else {
|
|
836
|
+
const idbGetError = ERROR_FACTORY.create("idb-get" /* AppError.IDB_GET */, {
|
|
837
|
+
originalErrorMessage: e === null || e === void 0 ? void 0 : e.message
|
|
838
|
+
});
|
|
839
|
+
logger.warn(idbGetError.message);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
958
842
|
}
|
|
959
|
-
function writeHeartbeatsToIndexedDB(app, heartbeatObject) {
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
case 4:
|
|
979
|
-
e_2 = _a.sent();
|
|
980
|
-
if (e_2 instanceof util.FirebaseError) {
|
|
981
|
-
logger.warn(e_2.message);
|
|
982
|
-
}
|
|
983
|
-
else {
|
|
984
|
-
idbGetError = ERROR_FACTORY.create("idb-set" /* AppError.IDB_WRITE */, {
|
|
985
|
-
originalErrorMessage: e_2 === null || e_2 === void 0 ? void 0 : e_2.message
|
|
986
|
-
});
|
|
987
|
-
logger.warn(idbGetError.message);
|
|
988
|
-
}
|
|
989
|
-
return [3 /*break*/, 5];
|
|
990
|
-
case 5: return [2 /*return*/];
|
|
991
|
-
}
|
|
992
|
-
});
|
|
993
|
-
});
|
|
843
|
+
async function writeHeartbeatsToIndexedDB(app, heartbeatObject) {
|
|
844
|
+
try {
|
|
845
|
+
const db = await getDbPromise();
|
|
846
|
+
const tx = db.transaction(STORE_NAME, 'readwrite');
|
|
847
|
+
const objectStore = tx.objectStore(STORE_NAME);
|
|
848
|
+
await objectStore.put(heartbeatObject, computeKey(app));
|
|
849
|
+
await tx.done;
|
|
850
|
+
}
|
|
851
|
+
catch (e) {
|
|
852
|
+
if (e instanceof util.FirebaseError) {
|
|
853
|
+
logger.warn(e.message);
|
|
854
|
+
}
|
|
855
|
+
else {
|
|
856
|
+
const idbGetError = ERROR_FACTORY.create("idb-set" /* AppError.IDB_WRITE */, {
|
|
857
|
+
originalErrorMessage: e === null || e === void 0 ? void 0 : e.message
|
|
858
|
+
});
|
|
859
|
+
logger.warn(idbGetError.message);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
994
862
|
}
|
|
995
863
|
function computeKey(app) {
|
|
996
|
-
return
|
|
864
|
+
return `${app.name}!${app.options.appId}`;
|
|
997
865
|
}
|
|
998
866
|
|
|
999
867
|
/**
|
|
@@ -1012,12 +880,11 @@ function computeKey(app) {
|
|
|
1012
880
|
* See the License for the specific language governing permissions and
|
|
1013
881
|
* limitations under the License.
|
|
1014
882
|
*/
|
|
1015
|
-
|
|
883
|
+
const MAX_HEADER_BYTES = 1024;
|
|
1016
884
|
// 30 days
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
var _this = this;
|
|
885
|
+
const STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;
|
|
886
|
+
class HeartbeatServiceImpl {
|
|
887
|
+
constructor(container) {
|
|
1021
888
|
this.container = container;
|
|
1022
889
|
/**
|
|
1023
890
|
* In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate
|
|
@@ -1029,10 +896,10 @@ var HeartbeatServiceImpl = /** @class */ (function () {
|
|
|
1029
896
|
* Leave public for easier testing.
|
|
1030
897
|
*/
|
|
1031
898
|
this._heartbeatsCache = null;
|
|
1032
|
-
|
|
899
|
+
const app = this.container.getProvider('app').getImmediate();
|
|
1033
900
|
this._storage = new HeartbeatStorageImpl(app);
|
|
1034
|
-
this._heartbeatsCachePromise = this._storage.read().then(
|
|
1035
|
-
|
|
901
|
+
this._heartbeatsCachePromise = this._storage.read().then(result => {
|
|
902
|
+
this._heartbeatsCache = result;
|
|
1036
903
|
return result;
|
|
1037
904
|
});
|
|
1038
905
|
}
|
|
@@ -1043,57 +910,46 @@ var HeartbeatServiceImpl = /** @class */ (function () {
|
|
|
1043
910
|
* Note that we only store one heartbeat per day. So if a heartbeat for today is
|
|
1044
911
|
* already logged, subsequent calls to this function in the same day will be ignored.
|
|
1045
912
|
*/
|
|
1046
|
-
|
|
913
|
+
async triggerHeartbeat() {
|
|
1047
914
|
var _a, _b;
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
return [4 /*yield*/, this._heartbeatsCachePromise];
|
|
1062
|
-
case 1:
|
|
1063
|
-
_c._heartbeatsCache = _d.sent();
|
|
1064
|
-
// If we failed to construct a heartbeats cache, then return immediately.
|
|
1065
|
-
if (((_b = this._heartbeatsCache) === null || _b === void 0 ? void 0 : _b.heartbeats) == null) {
|
|
1066
|
-
return [2 /*return*/];
|
|
1067
|
-
}
|
|
1068
|
-
_d.label = 2;
|
|
1069
|
-
case 2:
|
|
1070
|
-
// Do not store a heartbeat if one is already stored for this day
|
|
1071
|
-
// or if a header has already been sent today.
|
|
1072
|
-
if (this._heartbeatsCache.lastSentHeartbeatDate === date_1 ||
|
|
1073
|
-
this._heartbeatsCache.heartbeats.some(function (singleDateHeartbeat) { return singleDateHeartbeat.date === date_1; })) {
|
|
1074
|
-
return [2 /*return*/];
|
|
1075
|
-
}
|
|
1076
|
-
else {
|
|
1077
|
-
// There is no entry for this date. Create one.
|
|
1078
|
-
this._heartbeatsCache.heartbeats.push({ date: date_1, agent: agent });
|
|
1079
|
-
}
|
|
1080
|
-
// Remove entries older than 30 days.
|
|
1081
|
-
this._heartbeatsCache.heartbeats =
|
|
1082
|
-
this._heartbeatsCache.heartbeats.filter(function (singleDateHeartbeat) {
|
|
1083
|
-
var hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();
|
|
1084
|
-
var now = Date.now();
|
|
1085
|
-
return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;
|
|
1086
|
-
});
|
|
1087
|
-
return [2 /*return*/, this._storage.overwrite(this._heartbeatsCache)];
|
|
1088
|
-
case 3:
|
|
1089
|
-
e_1 = _d.sent();
|
|
1090
|
-
logger.warn(e_1);
|
|
1091
|
-
return [3 /*break*/, 4];
|
|
1092
|
-
case 4: return [2 /*return*/];
|
|
915
|
+
try {
|
|
916
|
+
const platformLogger = this.container
|
|
917
|
+
.getProvider('platform-logger')
|
|
918
|
+
.getImmediate();
|
|
919
|
+
// This is the "Firebase user agent" string from the platform logger
|
|
920
|
+
// service, not the browser user agent.
|
|
921
|
+
const agent = platformLogger.getPlatformInfoString();
|
|
922
|
+
const date = getUTCDateString();
|
|
923
|
+
if (((_a = this._heartbeatsCache) === null || _a === void 0 ? void 0 : _a.heartbeats) == null) {
|
|
924
|
+
this._heartbeatsCache = await this._heartbeatsCachePromise;
|
|
925
|
+
// If we failed to construct a heartbeats cache, then return immediately.
|
|
926
|
+
if (((_b = this._heartbeatsCache) === null || _b === void 0 ? void 0 : _b.heartbeats) == null) {
|
|
927
|
+
return;
|
|
1093
928
|
}
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
|
|
929
|
+
}
|
|
930
|
+
// Do not store a heartbeat if one is already stored for this day
|
|
931
|
+
// or if a header has already been sent today.
|
|
932
|
+
if (this._heartbeatsCache.lastSentHeartbeatDate === date ||
|
|
933
|
+
this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
else {
|
|
937
|
+
// There is no entry for this date. Create one.
|
|
938
|
+
this._heartbeatsCache.heartbeats.push({ date, agent });
|
|
939
|
+
}
|
|
940
|
+
// Remove entries older than 30 days.
|
|
941
|
+
this._heartbeatsCache.heartbeats =
|
|
942
|
+
this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {
|
|
943
|
+
const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();
|
|
944
|
+
const now = Date.now();
|
|
945
|
+
return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;
|
|
946
|
+
});
|
|
947
|
+
return this._storage.overwrite(this._heartbeatsCache);
|
|
948
|
+
}
|
|
949
|
+
catch (e) {
|
|
950
|
+
logger.warn(e);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
1097
953
|
/**
|
|
1098
954
|
* Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.
|
|
1099
955
|
* It also clears all heartbeats from memory as well as in IndexedDB.
|
|
@@ -1101,76 +957,58 @@ var HeartbeatServiceImpl = /** @class */ (function () {
|
|
|
1101
957
|
* NOTE: Consuming product SDKs should not send the header if this method
|
|
1102
958
|
* returns an empty string.
|
|
1103
959
|
*/
|
|
1104
|
-
|
|
960
|
+
async getHeartbeatsHeader() {
|
|
1105
961
|
var _a;
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
this._heartbeatsCache.heartbeats = [];
|
|
1143
|
-
// Do not wait for this, to reduce latency.
|
|
1144
|
-
void this._storage.overwrite(this._heartbeatsCache);
|
|
1145
|
-
_c.label = 5;
|
|
1146
|
-
case 5: return [2 /*return*/, headerString];
|
|
1147
|
-
case 6:
|
|
1148
|
-
e_2 = _c.sent();
|
|
1149
|
-
logger.warn(e_2);
|
|
1150
|
-
return [2 /*return*/, ''];
|
|
1151
|
-
case 7: return [2 /*return*/];
|
|
1152
|
-
}
|
|
1153
|
-
});
|
|
1154
|
-
});
|
|
1155
|
-
};
|
|
1156
|
-
return HeartbeatServiceImpl;
|
|
1157
|
-
}());
|
|
962
|
+
try {
|
|
963
|
+
if (this._heartbeatsCache === null) {
|
|
964
|
+
await this._heartbeatsCachePromise;
|
|
965
|
+
}
|
|
966
|
+
// If it's still null or the array is empty, there is no data to send.
|
|
967
|
+
if (((_a = this._heartbeatsCache) === null || _a === void 0 ? void 0 : _a.heartbeats) == null ||
|
|
968
|
+
this._heartbeatsCache.heartbeats.length === 0) {
|
|
969
|
+
return '';
|
|
970
|
+
}
|
|
971
|
+
const date = getUTCDateString();
|
|
972
|
+
// Extract as many heartbeats from the cache as will fit under the size limit.
|
|
973
|
+
const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);
|
|
974
|
+
const headerString = util.base64urlEncodeWithoutPadding(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));
|
|
975
|
+
// Store last sent date to prevent another being logged/sent for the same day.
|
|
976
|
+
this._heartbeatsCache.lastSentHeartbeatDate = date;
|
|
977
|
+
if (unsentEntries.length > 0) {
|
|
978
|
+
// Store any unsent entries if they exist.
|
|
979
|
+
this._heartbeatsCache.heartbeats = unsentEntries;
|
|
980
|
+
// This seems more likely than emptying the array (below) to lead to some odd state
|
|
981
|
+
// since the cache isn't empty and this will be called again on the next request,
|
|
982
|
+
// and is probably safest if we await it.
|
|
983
|
+
await this._storage.overwrite(this._heartbeatsCache);
|
|
984
|
+
}
|
|
985
|
+
else {
|
|
986
|
+
this._heartbeatsCache.heartbeats = [];
|
|
987
|
+
// Do not wait for this, to reduce latency.
|
|
988
|
+
void this._storage.overwrite(this._heartbeatsCache);
|
|
989
|
+
}
|
|
990
|
+
return headerString;
|
|
991
|
+
}
|
|
992
|
+
catch (e) {
|
|
993
|
+
logger.warn(e);
|
|
994
|
+
return '';
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
1158
998
|
function getUTCDateString() {
|
|
1159
|
-
|
|
999
|
+
const today = new Date();
|
|
1160
1000
|
// Returns date format 'YYYY-MM-DD'
|
|
1161
1001
|
return today.toISOString().substring(0, 10);
|
|
1162
1002
|
}
|
|
1163
|
-
function extractHeartbeatsForHeader(heartbeatsCache, maxSize) {
|
|
1164
|
-
var e_3, _a;
|
|
1165
|
-
if (maxSize === void 0) { maxSize = MAX_HEADER_BYTES; }
|
|
1003
|
+
function extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {
|
|
1166
1004
|
// Heartbeats grouped by user agent in the standard format to be sent in
|
|
1167
1005
|
// the header.
|
|
1168
|
-
|
|
1006
|
+
const heartbeatsToSend = [];
|
|
1169
1007
|
// Single date format heartbeats that are not sent.
|
|
1170
|
-
|
|
1171
|
-
|
|
1008
|
+
let unsentEntries = heartbeatsCache.slice();
|
|
1009
|
+
for (const singleDateHeartbeat of heartbeatsCache) {
|
|
1172
1010
|
// Look for an existing entry with the same user agent.
|
|
1173
|
-
|
|
1011
|
+
const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);
|
|
1174
1012
|
if (!heartbeatEntry) {
|
|
1175
1013
|
// If no entry for this user agent exists, create one.
|
|
1176
1014
|
heartbeatsToSend.push({
|
|
@@ -1181,7 +1019,7 @@ function extractHeartbeatsForHeader(heartbeatsCache, maxSize) {
|
|
|
1181
1019
|
// If the header would exceed max size, remove the added heartbeat
|
|
1182
1020
|
// entry and stop adding to the header.
|
|
1183
1021
|
heartbeatsToSend.pop();
|
|
1184
|
-
|
|
1022
|
+
break;
|
|
1185
1023
|
}
|
|
1186
1024
|
}
|
|
1187
1025
|
else {
|
|
@@ -1190,127 +1028,85 @@ function extractHeartbeatsForHeader(heartbeatsCache, maxSize) {
|
|
|
1190
1028
|
// and stop adding to the header.
|
|
1191
1029
|
if (countBytes(heartbeatsToSend) > maxSize) {
|
|
1192
1030
|
heartbeatEntry.dates.pop();
|
|
1193
|
-
|
|
1031
|
+
break;
|
|
1194
1032
|
}
|
|
1195
1033
|
}
|
|
1196
1034
|
// Pop unsent entry from queue. (Skipped if adding the entry exceeded
|
|
1197
1035
|
// quota and the loop breaks early.)
|
|
1198
1036
|
unsentEntries = unsentEntries.slice(1);
|
|
1199
|
-
};
|
|
1200
|
-
try {
|
|
1201
|
-
for (var heartbeatsCache_1 = tslib.__values(heartbeatsCache), heartbeatsCache_1_1 = heartbeatsCache_1.next(); !heartbeatsCache_1_1.done; heartbeatsCache_1_1 = heartbeatsCache_1.next()) {
|
|
1202
|
-
var singleDateHeartbeat = heartbeatsCache_1_1.value;
|
|
1203
|
-
var state_1 = _loop_1(singleDateHeartbeat);
|
|
1204
|
-
if (state_1 === "break")
|
|
1205
|
-
break;
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1209
|
-
finally {
|
|
1210
|
-
try {
|
|
1211
|
-
if (heartbeatsCache_1_1 && !heartbeatsCache_1_1.done && (_a = heartbeatsCache_1.return)) _a.call(heartbeatsCache_1);
|
|
1212
|
-
}
|
|
1213
|
-
finally { if (e_3) throw e_3.error; }
|
|
1214
1037
|
}
|
|
1215
1038
|
return {
|
|
1216
|
-
heartbeatsToSend
|
|
1217
|
-
unsentEntries
|
|
1039
|
+
heartbeatsToSend,
|
|
1040
|
+
unsentEntries
|
|
1218
1041
|
};
|
|
1219
1042
|
}
|
|
1220
|
-
|
|
1221
|
-
|
|
1043
|
+
class HeartbeatStorageImpl {
|
|
1044
|
+
constructor(app) {
|
|
1222
1045
|
this.app = app;
|
|
1223
1046
|
this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
|
|
1224
1047
|
}
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
return
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
}
|
|
1236
|
-
});
|
|
1237
|
-
});
|
|
1238
|
-
};
|
|
1048
|
+
async runIndexedDBEnvironmentCheck() {
|
|
1049
|
+
if (!util.isIndexedDBAvailable()) {
|
|
1050
|
+
return false;
|
|
1051
|
+
}
|
|
1052
|
+
else {
|
|
1053
|
+
return util.validateIndexedDBOpenable()
|
|
1054
|
+
.then(() => true)
|
|
1055
|
+
.catch(() => false);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1239
1058
|
/**
|
|
1240
1059
|
* Read all heartbeats.
|
|
1241
1060
|
*/
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
return
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
}
|
|
1258
|
-
else {
|
|
1259
|
-
return [2 /*return*/, { heartbeats: [] }];
|
|
1260
|
-
}
|
|
1261
|
-
case 4: return [2 /*return*/];
|
|
1262
|
-
}
|
|
1263
|
-
});
|
|
1264
|
-
});
|
|
1265
|
-
};
|
|
1061
|
+
async read() {
|
|
1062
|
+
const canUseIndexedDB = await this._canUseIndexedDBPromise;
|
|
1063
|
+
if (!canUseIndexedDB) {
|
|
1064
|
+
return { heartbeats: [] };
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);
|
|
1068
|
+
if (idbHeartbeatObject === null || idbHeartbeatObject === void 0 ? void 0 : idbHeartbeatObject.heartbeats) {
|
|
1069
|
+
return idbHeartbeatObject;
|
|
1070
|
+
}
|
|
1071
|
+
else {
|
|
1072
|
+
return { heartbeats: [] };
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1266
1076
|
// overwrite the storage with the provided heartbeats
|
|
1267
|
-
|
|
1077
|
+
async overwrite(heartbeatsObject) {
|
|
1268
1078
|
var _a;
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
return
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
case 2: return [4 /*yield*/, this.read()];
|
|
1279
|
-
case 3:
|
|
1280
|
-
existingHeartbeatsObject = _b.sent();
|
|
1281
|
-
return [2 /*return*/, writeHeartbeatsToIndexedDB(this.app, {
|
|
1282
|
-
lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,
|
|
1283
|
-
heartbeats: heartbeatsObject.heartbeats
|
|
1284
|
-
})];
|
|
1285
|
-
}
|
|
1079
|
+
const canUseIndexedDB = await this._canUseIndexedDBPromise;
|
|
1080
|
+
if (!canUseIndexedDB) {
|
|
1081
|
+
return;
|
|
1082
|
+
}
|
|
1083
|
+
else {
|
|
1084
|
+
const existingHeartbeatsObject = await this.read();
|
|
1085
|
+
return writeHeartbeatsToIndexedDB(this.app, {
|
|
1086
|
+
lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,
|
|
1087
|
+
heartbeats: heartbeatsObject.heartbeats
|
|
1286
1088
|
});
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1289
1091
|
// add heartbeats
|
|
1290
|
-
|
|
1092
|
+
async add(heartbeatsObject) {
|
|
1291
1093
|
var _a;
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
return
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
return [2 /*return*/, writeHeartbeatsToIndexedDB(this.app, {
|
|
1305
|
-
lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,
|
|
1306
|
-
heartbeats: tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(existingHeartbeatsObject.heartbeats), false), tslib.__read(heartbeatsObject.heartbeats), false)
|
|
1307
|
-
})];
|
|
1308
|
-
}
|
|
1094
|
+
const canUseIndexedDB = await this._canUseIndexedDBPromise;
|
|
1095
|
+
if (!canUseIndexedDB) {
|
|
1096
|
+
return;
|
|
1097
|
+
}
|
|
1098
|
+
else {
|
|
1099
|
+
const existingHeartbeatsObject = await this.read();
|
|
1100
|
+
return writeHeartbeatsToIndexedDB(this.app, {
|
|
1101
|
+
lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,
|
|
1102
|
+
heartbeats: [
|
|
1103
|
+
...existingHeartbeatsObject.heartbeats,
|
|
1104
|
+
...heartbeatsObject.heartbeats
|
|
1105
|
+
]
|
|
1309
1106
|
});
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
}());
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1314
1110
|
/**
|
|
1315
1111
|
* Calculate bytes of a HeartbeatsByUserAgent array after being wrapped
|
|
1316
1112
|
* in a platform logging header JSON object, stringified, and converted
|
|
@@ -1340,12 +1136,12 @@ function countBytes(heartbeatsCache) {
|
|
|
1340
1136
|
* limitations under the License.
|
|
1341
1137
|
*/
|
|
1342
1138
|
function registerCoreComponents(variant) {
|
|
1343
|
-
_registerComponent(new component.Component('platform-logger',
|
|
1344
|
-
_registerComponent(new component.Component('heartbeat',
|
|
1139
|
+
_registerComponent(new component.Component('platform-logger', container => new PlatformLoggerServiceImpl(container), "PRIVATE" /* ComponentType.PRIVATE */));
|
|
1140
|
+
_registerComponent(new component.Component('heartbeat', container => new HeartbeatServiceImpl(container), "PRIVATE" /* ComponentType.PRIVATE */));
|
|
1345
1141
|
// Register `app` package.
|
|
1346
1142
|
registerVersion(name$q, version$1, variant);
|
|
1347
|
-
// BUILD_TARGET will be replaced by values like
|
|
1348
|
-
registerVersion(name$q, version$1, '
|
|
1143
|
+
// BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation
|
|
1144
|
+
registerVersion(name$q, version$1, 'cjs2017');
|
|
1349
1145
|
// Register platform SDK identifier (no version).
|
|
1350
1146
|
registerVersion('fire-js', '');
|
|
1351
1147
|
}
|