@firebase/app 0.10.18-canary.5250e8006 → 0.10.18-canary.59ae45e48

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.
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
18
+ declare module '@firebase/component' {
19
+ interface NameServiceMapping {
20
+ 'test-shell': void;
21
+ }
22
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
@@ -17,7 +17,6 @@
17
17
  import { ComponentContainer } from '@firebase/component';
18
18
  import { FirebaseApp } from './public-types';
19
19
  import { HeartbeatsByUserAgent, HeartbeatService, HeartbeatsInIndexedDB, HeartbeatStorage, SingleDateHeartbeat } from './types';
20
- export declare const MAX_NUM_STORED_HEARTBEATS = 30;
21
20
  export declare class HeartbeatServiceImpl implements HeartbeatService {
22
21
  private readonly container;
23
22
  /**
@@ -82,8 +81,3 @@ export declare class HeartbeatStorageImpl implements HeartbeatStorage {
82
81
  * to base 64.
83
82
  */
84
83
  export declare function countBytes(heartbeatsCache: HeartbeatsByUserAgent[]): number;
85
- /**
86
- * Returns the index of the heartbeat with the earliest date.
87
- * If the heartbeats array is empty, -1 is returned.
88
- */
89
- export declare function getEarliestHeartbeatIdx(heartbeats: SingleDateHeartbeat[]): number;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
18
+ import { PlatformLoggerService } from './types';
19
+ declare module '@firebase/component' {
20
+ interface NameServiceMapping {
21
+ 'platform-logger': PlatformLoggerService;
22
+ }
23
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
18
+ import { TestService } from '../test/util';
19
+ declare module '@firebase/component' {
20
+ interface NameServiceMapping {
21
+ 'test': TestService;
22
+ }
23
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
18
+ import { VersionService } from './types';
19
+ declare module '@firebase/component' {
20
+ interface NameServiceMapping {
21
+ 'vs1': VersionService;
22
+ 'vs2': VersionService;
23
+ }
24
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
18
+ declare module '@firebase/component' {
19
+ interface NameServiceMapping {
20
+ 'test-shell': void;
21
+ }
22
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
@@ -17,7 +17,6 @@
17
17
  import { ComponentContainer } from '@firebase/component';
18
18
  import { FirebaseApp } from './public-types';
19
19
  import { HeartbeatsByUserAgent, HeartbeatService, HeartbeatsInIndexedDB, HeartbeatStorage, SingleDateHeartbeat } from './types';
20
- export declare const MAX_NUM_STORED_HEARTBEATS = 30;
21
20
  export declare class HeartbeatServiceImpl implements HeartbeatService {
22
21
  private readonly container;
23
22
  /**
@@ -82,8 +81,3 @@ export declare class HeartbeatStorageImpl implements HeartbeatStorage {
82
81
  * to base 64.
83
82
  */
84
83
  export declare function countBytes(heartbeatsCache: HeartbeatsByUserAgent[]): number;
85
- /**
86
- * Returns the index of the heartbeat with the earliest date.
87
- * If the heartbeats array is empty, -1 is returned.
88
- */
89
- export declare function getEarliestHeartbeatIdx(heartbeats: SingleDateHeartbeat[]): number;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
18
+ import { PlatformLoggerService } from './types';
19
+ declare module '@firebase/component' {
20
+ interface NameServiceMapping {
21
+ 'platform-logger': PlatformLoggerService;
22
+ }
23
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
18
+ import { TestService } from '../test/util';
19
+ declare module '@firebase/component' {
20
+ interface NameServiceMapping {
21
+ 'test': TestService;
22
+ }
23
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
18
+ import { VersionService } from './types';
19
+ declare module '@firebase/component' {
20
+ interface NameServiceMapping {
21
+ 'vs1': VersionService;
22
+ 'vs2': VersionService;
23
+ }
24
+ }
@@ -58,7 +58,7 @@ function isVersionServiceProvider(provider) {
58
58
  }
59
59
 
60
60
  const name$q = "@firebase/app";
61
- const version$1 = "0.10.18-canary.5250e8006";
61
+ const version$1 = "0.10.18-canary.59ae45e48";
62
62
 
63
63
  /**
64
64
  * @license
@@ -129,7 +129,7 @@ const name$2 = "@firebase/vertexai";
129
129
  const name$1 = "@firebase/firestore-compat";
130
130
 
131
131
  const name = "firebase";
132
- const version = "11.2.0-canary.5250e8006";
132
+ const version = "11.2.0-canary.59ae45e48";
133
133
 
134
134
  /**
135
135
  * @license
@@ -910,7 +910,8 @@ function computeKey(app) {
910
910
  * limitations under the License.
911
911
  */
912
912
  const MAX_HEADER_BYTES = 1024;
913
- const MAX_NUM_STORED_HEARTBEATS = 30;
913
+ // 30 days
914
+ const STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;
914
915
  class HeartbeatServiceImpl {
915
916
  constructor(container) {
916
917
  this.container = container;
@@ -964,13 +965,14 @@ class HeartbeatServiceImpl {
964
965
  else {
965
966
  // There is no entry for this date. Create one.
966
967
  this._heartbeatsCache.heartbeats.push({ date, agent });
967
- // If the number of stored heartbeats exceeds the maximum number of stored heartbeats, remove the heartbeat with the earliest date.
968
- // Since this is executed each time a heartbeat is pushed, the limit can only be exceeded by one, so only one needs to be removed.
969
- if (this._heartbeatsCache.heartbeats.length > MAX_NUM_STORED_HEARTBEATS) {
970
- const earliestHeartbeatIdx = getEarliestHeartbeatIdx(this._heartbeatsCache.heartbeats);
971
- this._heartbeatsCache.heartbeats.splice(earliestHeartbeatIdx, 1);
972
- }
973
968
  }
969
+ // Remove entries older than 30 days.
970
+ this._heartbeatsCache.heartbeats =
971
+ this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {
972
+ const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();
973
+ const now = Date.now();
974
+ return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;
975
+ });
974
976
  return this._storage.overwrite(this._heartbeatsCache);
975
977
  }
976
978
  catch (e) {
@@ -1145,24 +1147,6 @@ function countBytes(heartbeatsCache) {
1145
1147
  // heartbeatsCache wrapper properties
1146
1148
  JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;
1147
1149
  }
1148
- /**
1149
- * Returns the index of the heartbeat with the earliest date.
1150
- * If the heartbeats array is empty, -1 is returned.
1151
- */
1152
- function getEarliestHeartbeatIdx(heartbeats) {
1153
- if (heartbeats.length === 0) {
1154
- return -1;
1155
- }
1156
- let earliestHeartbeatIdx = 0;
1157
- let earliestHeartbeatDate = heartbeats[0].date;
1158
- for (let i = 1; i < heartbeats.length; i++) {
1159
- if (heartbeats[i].date < earliestHeartbeatDate) {
1160
- earliestHeartbeatDate = heartbeats[i].date;
1161
- earliestHeartbeatIdx = i;
1162
- }
1163
- }
1164
- return earliestHeartbeatIdx;
1165
- }
1166
1150
 
1167
1151
  /**
1168
1152
  * @license