@firebase/performance 0.5.2 → 0.5.3-2021102231614

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 (45) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{index.esm.js → esm/index.esm.js} +1 -1
  3. package/dist/esm/index.esm.js.map +1 -0
  4. package/dist/{index.esm2017.js → esm/index.esm2017.js} +1 -1
  5. package/dist/esm/index.esm2017.js.map +1 -0
  6. package/dist/esm/package.json +1 -0
  7. package/dist/esm/src/constants.d.ts +32 -0
  8. package/dist/esm/src/controllers/perf.d.ts +39 -0
  9. package/dist/esm/src/controllers/perf.test.d.ts +17 -0
  10. package/dist/esm/src/index.d.ts +45 -0
  11. package/dist/esm/src/index.test.d.ts +17 -0
  12. package/dist/esm/src/public_types.d.ts +136 -0
  13. package/dist/esm/src/resources/network_request.d.ts +43 -0
  14. package/dist/esm/src/resources/network_request.test.d.ts +17 -0
  15. package/dist/esm/src/resources/trace.d.ts +119 -0
  16. package/dist/esm/src/resources/trace.test.d.ts +17 -0
  17. package/dist/esm/src/services/api_service.d.ts +51 -0
  18. package/dist/esm/src/services/api_service.test.d.ts +17 -0
  19. package/dist/esm/src/services/iid_service.d.ts +21 -0
  20. package/dist/esm/src/services/iid_service.test.d.ts +17 -0
  21. package/dist/esm/src/services/initialization_service.d.ts +19 -0
  22. package/dist/esm/src/services/initialization_service.test.d.ts +17 -0
  23. package/dist/esm/src/services/oob_resources_service.d.ts +18 -0
  24. package/dist/esm/src/services/oob_resources_service.test.d.ts +17 -0
  25. package/dist/esm/src/services/perf_logger.d.ts +20 -0
  26. package/dist/esm/src/services/perf_logger.test.d.ts +17 -0
  27. package/dist/esm/src/services/remote_config_service.d.ts +18 -0
  28. package/dist/esm/src/services/remote_config_service.test.d.ts +17 -0
  29. package/dist/esm/src/services/settings_service.d.ts +32 -0
  30. package/dist/esm/src/services/transport_service.d.ts +23 -0
  31. package/dist/esm/src/services/transport_service.test.d.ts +17 -0
  32. package/dist/esm/src/utils/app_utils.d.ts +20 -0
  33. package/dist/esm/src/utils/attribute_utils.test.d.ts +17 -0
  34. package/dist/esm/src/utils/attributes_utils.d.ts +40 -0
  35. package/dist/esm/src/utils/console_logger.d.ts +18 -0
  36. package/dist/esm/src/utils/errors.d.ts +60 -0
  37. package/dist/esm/src/utils/metric_utils.d.ts +28 -0
  38. package/dist/esm/src/utils/metric_utils.test.d.ts +17 -0
  39. package/dist/esm/src/utils/string_merger.d.ts +17 -0
  40. package/dist/esm/src/utils/string_merger.test.d.ts +17 -0
  41. package/dist/esm/test/setup.d.ts +17 -0
  42. package/dist/index.cjs.js +1 -1
  43. package/package.json +18 -11
  44. package/dist/index.esm.js.map +0 -1
  45. package/dist/index.esm2017.js.map +0 -1
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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,18 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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 { PerformanceController } from '../controllers/perf';
18
+ export declare function getConfig(performanceController: PerformanceController, iid: string): Promise<void>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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,32 @@
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
+ export declare class SettingsService {
18
+ instrumentationEnabled: boolean;
19
+ dataCollectionEnabled: boolean;
20
+ loggingEnabled: boolean;
21
+ tracesSamplingRate: number;
22
+ networkRequestsSamplingRate: number;
23
+ logEndPointUrl: string;
24
+ flTransportEndpointUrl: string;
25
+ transportKey: string;
26
+ logSource: number;
27
+ logTraceAfterSampling: boolean;
28
+ logNetworkAfterSampling: boolean;
29
+ configTimeToLive: number;
30
+ getFlTransportFullUrl(): string;
31
+ static getInstance(): SettingsService;
32
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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
+ export declare function setupTransportService(): void;
18
+ /**
19
+ * Utilized by testing to clean up message queue and un-initialize transport service.
20
+ */
21
+ export declare function resetTransportService(): void;
22
+ /** Log handler for cc service to send the performance logs to the server. */
23
+ export declare function transportHandler(serializer: (...args: any[]) => string): (...args: unknown[]) => void;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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
+ export {};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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 { FirebaseApp } from '@firebase/app';
18
+ export declare function getAppId(firebaseApp: FirebaseApp): string;
19
+ export declare function getProjectId(firebaseApp: FirebaseApp): string;
20
+ export declare function getApiKey(firebaseApp: FirebaseApp): string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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 unknown 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,40 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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
+ declare const enum ServiceWorkerStatus {
18
+ UNKNOWN = 0,
19
+ UNSUPPORTED = 1,
20
+ CONTROLLED = 2,
21
+ UNCONTROLLED = 3
22
+ }
23
+ export declare enum VisibilityState {
24
+ UNKNOWN = 0,
25
+ VISIBLE = 1,
26
+ HIDDEN = 2
27
+ }
28
+ declare const enum EffectiveConnectionType {
29
+ UNKNOWN = 0,
30
+ CONNECTION_SLOW_2G = 1,
31
+ CONNECTION_2G = 2,
32
+ CONNECTION_3G = 3,
33
+ CONNECTION_4G = 4
34
+ }
35
+ export declare function getServiceWorkerStatus(): ServiceWorkerStatus;
36
+ export declare function getVisibilityState(): VisibilityState;
37
+ export declare function getEffectiveConnectionType(): EffectiveConnectionType;
38
+ export declare function isValidCustomAttributeName(name: string): boolean;
39
+ export declare function isValidCustomAttributeValue(value: string): boolean;
40
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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 { Logger } from '@firebase/logger';
18
+ export declare const consoleLogger: Logger;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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 { ErrorFactory } from '@firebase/util';
18
+ export declare const enum ErrorCode {
19
+ TRACE_STARTED_BEFORE = "trace started",
20
+ TRACE_STOPPED_BEFORE = "trace stopped",
21
+ NONPOSITIVE_TRACE_START_TIME = "nonpositive trace startTime",
22
+ NONPOSITIVE_TRACE_DURATION = "nonpositive trace duration",
23
+ NO_WINDOW = "no window",
24
+ NO_APP_ID = "no app id",
25
+ NO_PROJECT_ID = "no project id",
26
+ NO_API_KEY = "no api key",
27
+ INVALID_CC_LOG = "invalid cc log",
28
+ FB_NOT_DEFAULT = "FB not default",
29
+ RC_NOT_OK = "RC response not ok",
30
+ INVALID_ATTRIBUTE_NAME = "invalid attribute name",
31
+ INVALID_ATTRIBUTE_VALUE = "invalid attribute value",
32
+ INVALID_CUSTOM_METRIC_NAME = "invalid custom metric name",
33
+ INVALID_STRING_MERGER_PARAMETER = "invalid String merger input",
34
+ ALREADY_INITIALIZED = "already initialized"
35
+ }
36
+ interface ErrorParams {
37
+ [ErrorCode.TRACE_STARTED_BEFORE]: {
38
+ traceName: string;
39
+ };
40
+ [ErrorCode.TRACE_STOPPED_BEFORE]: {
41
+ traceName: string;
42
+ };
43
+ [ErrorCode.NONPOSITIVE_TRACE_START_TIME]: {
44
+ traceName: string;
45
+ };
46
+ [ErrorCode.NONPOSITIVE_TRACE_DURATION]: {
47
+ traceName: string;
48
+ };
49
+ [ErrorCode.INVALID_ATTRIBUTE_NAME]: {
50
+ attributeName: string;
51
+ };
52
+ [ErrorCode.INVALID_ATTRIBUTE_VALUE]: {
53
+ attributeValue: string;
54
+ };
55
+ [ErrorCode.INVALID_CUSTOM_METRIC_NAME]: {
56
+ customMetricName: string;
57
+ };
58
+ }
59
+ export declare const ERROR_FACTORY: ErrorFactory<ErrorCode, ErrorParams>;
60
+ export {};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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
+ /**
18
+ * Returns true if the metric is custom and does not start with reserved prefix, or if
19
+ * the metric is one of out of the box page load trace metrics.
20
+ */
21
+ export declare function isValidMetricName(name: string, traceName?: string): boolean;
22
+ /**
23
+ * Converts the provided value to an integer value to be used in case of a metric.
24
+ * @param providedValue Provided number value of the metric that needs to be converted to an integer.
25
+ *
26
+ * @returns Converted integer number to be set for the metric.
27
+ */
28
+ export declare function convertMetricValueToInteger(providedValue: number): number;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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 unknown 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 2020 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
+ export declare function mergeStrings(part1: string, part2: string): string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 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 unknown 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 2020 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
+ export {};
package/dist/index.cjs.js CHANGED
@@ -10,7 +10,7 @@ var component = require('@firebase/component');
10
10
  require('@firebase/installations');
11
11
 
12
12
  var name = "@firebase/performance";
13
- var version = "0.5.2";
13
+ var version = "0.5.3-2021102231614";
14
14
 
15
15
  /**
16
16
  * @license
package/package.json CHANGED
@@ -1,11 +1,19 @@
1
1
  {
2
2
  "name": "@firebase/performance",
3
- "version": "0.5.2",
3
+ "version": "0.5.3-2021102231614",
4
4
  "description": "Firebase performance for web",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.cjs.js",
7
- "browser": "dist/index.esm2017.js",
8
- "module": "dist/index.esm2017.js",
7
+ "browser": "dist/esm/index.esm2017.js",
8
+ "module": "dist/esm/index.esm2017.js",
9
+ "esm5": "dist/esm/index.esm.js",
10
+ "exports": {
11
+ ".": {
12
+ "require": "./dist/index.cjs.js",
13
+ "default": "./dist/esm/index.esm2017.js"
14
+ },
15
+ "./package.json": "./package.json"
16
+ },
9
17
  "files": [
10
18
  "dist"
11
19
  ],
@@ -26,18 +34,18 @@
26
34
  "build:doc": "yarn build && yarn doc"
27
35
  },
28
36
  "peerDependencies": {
29
- "@firebase/app": "0.x"
37
+ "@firebase/app": "0.7.6-2021102231614"
30
38
  },
31
39
  "dependencies": {
32
- "@firebase/logger": "0.3.0",
33
- "@firebase/installations": "0.5.2",
34
- "@firebase/util": "1.4.0",
35
- "@firebase/component": "0.5.7",
40
+ "@firebase/logger": "0.3.1-2021102231614",
41
+ "@firebase/installations": "0.5.3-2021102231614",
42
+ "@firebase/util": "1.4.1-2021102231614",
43
+ "@firebase/component": "0.5.8-2021102231614",
36
44
  "tslib": "^2.1.0"
37
45
  },
38
46
  "license": "Apache-2.0",
39
47
  "devDependencies": {
40
- "@firebase/app": "0.7.4",
48
+ "@firebase/app": "0.7.6-2021102231614",
41
49
  "rollup": "2.57.0",
42
50
  "@rollup/plugin-json": "4.1.0",
43
51
  "rollup-plugin-typescript2": "0.30.0",
@@ -57,6 +65,5 @@
57
65
  ".ts"
58
66
  ],
59
67
  "reportDir": "./coverage/node"
60
- },
61
- "esm5": "dist/index.esm.js"
68
+ }
62
69
  }