@newrelic/browser-agent 1.318.0-rc.4 → 1.318.0-rc.5

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.
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.318.0-rc.4";
20
+ const VERSION = exports.VERSION = "1.318.0-rc.5";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.318.0-rc.4";
20
+ const VERSION = exports.VERSION = "1.318.0-rc.5";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -12,12 +12,92 @@ var _globalEvent = require("../dispatch/global-event");
12
12
 
13
13
  /* eslint no-console: ["error", { allow: ["debug"] }] */
14
14
 
15
+ /* GENERATED-WARNING-CODES:START -- run `npm run generate:warning-codes` after editing docs/warning-codes.md, do not hand-edit this block */
15
16
  /**
16
- * A helper method to warn to the console with New Relic: decoration
17
- * @param {string} message The primary message to warn
18
- * @param {*} [secondary] Secondary data to include, usually an error or object
17
+ * A helper method to warn to the console with New Relic: decoration.
18
+ *
19
+ * `code` corresponds to an entry in
20
+ * {@link https://github.com/newrelic/newrelic-browser-agent/blob/main/docs/warning-codes.md warning-codes.md}:
21
+ *
22
+ * | Code | Message |
23
+ * |------|---------|
24
+ * | 1 | An error occurred while setting a property of a Configurable |
25
+ * | 2 | An error occurred while setting a Configurable |
26
+ * | 3 | Setting a Configurable requires an object as input |
27
+ * | 4 | Setting a Configurable requires a model to set its initial properties |
28
+ * | 5 | An invalid session_replay.mask_selector was provided. \* will be used. |
29
+ * | 6 | An invalid session_replay.block_selector was provided and will not be used |
30
+ * | 7 | An invalid session_replay.mask_input_option was provided and will not be used |
31
+ * | 8 | Shared context requires an object as input |
32
+ * | 9 | An error occurred while setting SharedContext |
33
+ * | 10 | Failed to read from storage API |
34
+ * | 11 | Failed to write to the storage API |
35
+ * | 12 | An obfuscation replacement rule was detected missing a "regex" value. |
36
+ * | 13 | An obfuscation replacement rule contains a "regex" value with an invalid type (must be a string or RegExp) |
37
+ * | 14 | An obfuscation replacement rule contains a "replacement" value with an invalid type (must be a string) |
38
+ * | 15 | An error occurred while intercepting XHR |
39
+ * | 16 | Could not cast log message to string |
40
+ * | 17 | Could not calculate New Relic server time. Agent shutting down. |
41
+ * | 18 | RUM call failed. Agent shutting down. |
42
+ * | 19 | SPA scheduler is not initialized. Saved interaction is not sent! |
43
+ * | 20 | A problem occurred when starting up session manager. This page will not start or extend any session. |
44
+ * | 21 | Failed to initialize the agent. Could not determine the runtime environment. |
45
+ * | 22 | Failed to initialize all enabled instrument classes (agent aborted) - |
46
+ * | 23 | An unexpected issue occurred |
47
+ * | 24 | Something prevented the agent from instrumenting. |
48
+ * | 25 | Something prevented the agent from being downloaded. |
49
+ * | 26 | Failed to initialize instrument classes. |
50
+ * | 27 | Downloading runtime APIs failed... |
51
+ * | 28 | The Browser Agent is attempting to send a very large payload. This is usually tied to large amounts of custom attributes. Please check your configurations. |
52
+ * | 29 | Failed to wrap logger: invalid argument(s) |
53
+ * | 30 | Invalid log level |
54
+ * | 31 | Ignored log: Log is larger than maximum payload size |
55
+ * | 32 | Ignored log: Invalid message |
56
+ * | 33 | Session Replay Aborted |
57
+ * | 34 | Downloading and initializing a feature failed... |
58
+ * | 35 | Call to agent api failed. The API is not currently initialized. |
59
+ * | 36 | A feature is enabled but one or more dependent features have not been initialized. This may cause unintended consequences or missing data... |
60
+ * | 37 | Invalid feature name supplied. |
61
+ * | 38 | Call to api was made before agent fully initialized. |
62
+ * | 39 | Failed to execute setCustomAttribute. Name must be a string type. |
63
+ * | 40 | Failed to execute setCustomAttribute. Non-null value must be a string, number or boolean type. |
64
+ * | 41 | Failed to execute setUserId. Non-null value must be a string type. |
65
+ * | 42 | Failed to execute setApplicationVersion. Expected <String \| null> |
66
+ * | 43 | Agent not configured properly. |
67
+ * | 44 | Invalid object passed to generic event aggregate. Missing "eventType". |
68
+ * | 45 | An internal agent process failed to execute. |
69
+ * | 46 | A reserved eventType was provided to recordCustomEvent(...) -- The event was not recorded. |
70
+ * | 47 | We tried to access a stylesheet's contents but failed due to browser security. For best results, ensure that cross-domain CSS assets are decorated with "crossorigin='anonymous'" attribution or are otherwise publicly accessible. |
71
+ * | 48 | Supplied an invalid API target. Must be an <Object> that contains valid (string) id and name properties. |
72
+ * | 49 | Supplied API target is missing an entityGuid. Some APIs may not behave correctly without a valid entityGuid (ex. logs). |
73
+ * | 50 | Failed to connect. Cannot allow registered API. |
74
+ * | 51 | Container agent is not available to register with. Can not connect |
75
+ * | 52 | Unexpected problem encountered. There should be at least one app for harvest! |
76
+ * | 53 | Did not receive a valid entityGuid from connection response |
77
+ * | 54 | An experimental feature is being used. Support can not be offered for issues |
78
+ * | 55 | Register API has been disabled on the container agent |
79
+ * | 56 | Could not find a matching entity to store data |
80
+ * | 57 | Failed to execute measure. Arguments must have valid types. |
81
+ * | 58 | Failed to execute measure. Resulting duration must be non-negative. |
82
+ * | 59 | Session replay harvested before a session trace payload could be sent. This could be problematic for replays that rely on a trace |
83
+ * | 60 | Session trace aborted |
84
+ * | 61 | Timestamps must be non-negative and end time cannot be before start time. |
85
+ * | 62 | Timestamp must be a unix timestamp greater than the page origin time |
86
+ * | 63 | A single event was larger than the maximum allowed payload size |
87
+ * | 64 | Required globals have been mutated before being accessed by the browser agent. This can cause issues and should be avoided. |
88
+ * | 65 | Consent API argument must be boolean or undefined |
89
+ * | 66 | A new agent session has started |
90
+ * | 67 | The "spa" feature has been deprecated and disabled. Please use/import "soft_navigations" instead for tracking of BrowserInteraction data. |
91
+ * | 68 | API has been deregistered and can no longer be used. Call "register" API again with credentials to start over. |
92
+ * | 69 | More than one Browser agent is running on the page |
93
+ * | 70 | A session replay payload failed to send and is being retried. Recording is paused during the retry period, and will resume when a successful harvest is made. Some replay activity may be missed during retry phases. |
94
+ * | 71 | An invalid feature mode was detected and set to "off". |
95
+ *
96
+ * @param {number} code The warning code to emit, which will be used to link to the warning code documentation
97
+ * @param {*} [secondary] Secondary data to include, usually an extra message, error or object
19
98
  * @returns
20
99
  */
100
+ /* GENERATED-WARNING-CODES:END */
21
101
  function warn(code, secondary) {
22
102
  if (typeof console.debug !== 'function') return;
23
103
  console.debug("New Relic Warning: https://github.com/newrelic/newrelic-browser-agent/blob/main/docs/warning-codes.md#".concat(code), secondary);
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.318.0-rc.4";
14
+ export const VERSION = "1.318.0-rc.5";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.318.0-rc.4";
14
+ export const VERSION = "1.318.0-rc.5";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -7,12 +7,92 @@ import { dispatchGlobalEvent } from '../dispatch/global-event';
7
7
 
8
8
  /* eslint no-console: ["error", { allow: ["debug"] }] */
9
9
 
10
+ /* GENERATED-WARNING-CODES:START -- run `npm run generate:warning-codes` after editing docs/warning-codes.md, do not hand-edit this block */
10
11
  /**
11
- * A helper method to warn to the console with New Relic: decoration
12
- * @param {string} message The primary message to warn
13
- * @param {*} [secondary] Secondary data to include, usually an error or object
12
+ * A helper method to warn to the console with New Relic: decoration.
13
+ *
14
+ * `code` corresponds to an entry in
15
+ * {@link https://github.com/newrelic/newrelic-browser-agent/blob/main/docs/warning-codes.md warning-codes.md}:
16
+ *
17
+ * | Code | Message |
18
+ * |------|---------|
19
+ * | 1 | An error occurred while setting a property of a Configurable |
20
+ * | 2 | An error occurred while setting a Configurable |
21
+ * | 3 | Setting a Configurable requires an object as input |
22
+ * | 4 | Setting a Configurable requires a model to set its initial properties |
23
+ * | 5 | An invalid session_replay.mask_selector was provided. \* will be used. |
24
+ * | 6 | An invalid session_replay.block_selector was provided and will not be used |
25
+ * | 7 | An invalid session_replay.mask_input_option was provided and will not be used |
26
+ * | 8 | Shared context requires an object as input |
27
+ * | 9 | An error occurred while setting SharedContext |
28
+ * | 10 | Failed to read from storage API |
29
+ * | 11 | Failed to write to the storage API |
30
+ * | 12 | An obfuscation replacement rule was detected missing a "regex" value. |
31
+ * | 13 | An obfuscation replacement rule contains a "regex" value with an invalid type (must be a string or RegExp) |
32
+ * | 14 | An obfuscation replacement rule contains a "replacement" value with an invalid type (must be a string) |
33
+ * | 15 | An error occurred while intercepting XHR |
34
+ * | 16 | Could not cast log message to string |
35
+ * | 17 | Could not calculate New Relic server time. Agent shutting down. |
36
+ * | 18 | RUM call failed. Agent shutting down. |
37
+ * | 19 | SPA scheduler is not initialized. Saved interaction is not sent! |
38
+ * | 20 | A problem occurred when starting up session manager. This page will not start or extend any session. |
39
+ * | 21 | Failed to initialize the agent. Could not determine the runtime environment. |
40
+ * | 22 | Failed to initialize all enabled instrument classes (agent aborted) - |
41
+ * | 23 | An unexpected issue occurred |
42
+ * | 24 | Something prevented the agent from instrumenting. |
43
+ * | 25 | Something prevented the agent from being downloaded. |
44
+ * | 26 | Failed to initialize instrument classes. |
45
+ * | 27 | Downloading runtime APIs failed... |
46
+ * | 28 | The Browser Agent is attempting to send a very large payload. This is usually tied to large amounts of custom attributes. Please check your configurations. |
47
+ * | 29 | Failed to wrap logger: invalid argument(s) |
48
+ * | 30 | Invalid log level |
49
+ * | 31 | Ignored log: Log is larger than maximum payload size |
50
+ * | 32 | Ignored log: Invalid message |
51
+ * | 33 | Session Replay Aborted |
52
+ * | 34 | Downloading and initializing a feature failed... |
53
+ * | 35 | Call to agent api failed. The API is not currently initialized. |
54
+ * | 36 | A feature is enabled but one or more dependent features have not been initialized. This may cause unintended consequences or missing data... |
55
+ * | 37 | Invalid feature name supplied. |
56
+ * | 38 | Call to api was made before agent fully initialized. |
57
+ * | 39 | Failed to execute setCustomAttribute. Name must be a string type. |
58
+ * | 40 | Failed to execute setCustomAttribute. Non-null value must be a string, number or boolean type. |
59
+ * | 41 | Failed to execute setUserId. Non-null value must be a string type. |
60
+ * | 42 | Failed to execute setApplicationVersion. Expected <String \| null> |
61
+ * | 43 | Agent not configured properly. |
62
+ * | 44 | Invalid object passed to generic event aggregate. Missing "eventType". |
63
+ * | 45 | An internal agent process failed to execute. |
64
+ * | 46 | A reserved eventType was provided to recordCustomEvent(...) -- The event was not recorded. |
65
+ * | 47 | We tried to access a stylesheet's contents but failed due to browser security. For best results, ensure that cross-domain CSS assets are decorated with "crossorigin='anonymous'" attribution or are otherwise publicly accessible. |
66
+ * | 48 | Supplied an invalid API target. Must be an <Object> that contains valid (string) id and name properties. |
67
+ * | 49 | Supplied API target is missing an entityGuid. Some APIs may not behave correctly without a valid entityGuid (ex. logs). |
68
+ * | 50 | Failed to connect. Cannot allow registered API. |
69
+ * | 51 | Container agent is not available to register with. Can not connect |
70
+ * | 52 | Unexpected problem encountered. There should be at least one app for harvest! |
71
+ * | 53 | Did not receive a valid entityGuid from connection response |
72
+ * | 54 | An experimental feature is being used. Support can not be offered for issues |
73
+ * | 55 | Register API has been disabled on the container agent |
74
+ * | 56 | Could not find a matching entity to store data |
75
+ * | 57 | Failed to execute measure. Arguments must have valid types. |
76
+ * | 58 | Failed to execute measure. Resulting duration must be non-negative. |
77
+ * | 59 | Session replay harvested before a session trace payload could be sent. This could be problematic for replays that rely on a trace |
78
+ * | 60 | Session trace aborted |
79
+ * | 61 | Timestamps must be non-negative and end time cannot be before start time. |
80
+ * | 62 | Timestamp must be a unix timestamp greater than the page origin time |
81
+ * | 63 | A single event was larger than the maximum allowed payload size |
82
+ * | 64 | Required globals have been mutated before being accessed by the browser agent. This can cause issues and should be avoided. |
83
+ * | 65 | Consent API argument must be boolean or undefined |
84
+ * | 66 | A new agent session has started |
85
+ * | 67 | The "spa" feature has been deprecated and disabled. Please use/import "soft_navigations" instead for tracking of BrowserInteraction data. |
86
+ * | 68 | API has been deregistered and can no longer be used. Call "register" API again with credentials to start over. |
87
+ * | 69 | More than one Browser agent is running on the page |
88
+ * | 70 | A session replay payload failed to send and is being retried. Recording is paused during the retry period, and will resume when a successful harvest is made. Some replay activity may be missed during retry phases. |
89
+ * | 71 | An invalid feature mode was detected and set to "off". |
90
+ *
91
+ * @param {number} code The warning code to emit, which will be used to link to the warning code documentation
92
+ * @param {*} [secondary] Secondary data to include, usually an extra message, error or object
14
93
  * @returns
15
94
  */
95
+ /* GENERATED-WARNING-CODES:END */
16
96
  export function warn(code, secondary) {
17
97
  if (typeof console.debug !== 'function') return;
18
98
  console.debug("New Relic Warning: https://github.com/newrelic/newrelic-browser-agent/blob/main/docs/warning-codes.md#".concat(code), secondary);
@@ -1,8 +1,86 @@
1
1
  /**
2
- * A helper method to warn to the console with New Relic: decoration
3
- * @param {string} message The primary message to warn
4
- * @param {*} [secondary] Secondary data to include, usually an error or object
2
+ * A helper method to warn to the console with New Relic: decoration.
3
+ *
4
+ * `code` corresponds to an entry in
5
+ * {@link https://github.com/newrelic/newrelic-browser-agent/blob/main/docs/warning-codes.md warning-codes.md}:
6
+ *
7
+ * | Code | Message |
8
+ * |------|---------|
9
+ * | 1 | An error occurred while setting a property of a Configurable |
10
+ * | 2 | An error occurred while setting a Configurable |
11
+ * | 3 | Setting a Configurable requires an object as input |
12
+ * | 4 | Setting a Configurable requires a model to set its initial properties |
13
+ * | 5 | An invalid session_replay.mask_selector was provided. \* will be used. |
14
+ * | 6 | An invalid session_replay.block_selector was provided and will not be used |
15
+ * | 7 | An invalid session_replay.mask_input_option was provided and will not be used |
16
+ * | 8 | Shared context requires an object as input |
17
+ * | 9 | An error occurred while setting SharedContext |
18
+ * | 10 | Failed to read from storage API |
19
+ * | 11 | Failed to write to the storage API |
20
+ * | 12 | An obfuscation replacement rule was detected missing a "regex" value. |
21
+ * | 13 | An obfuscation replacement rule contains a "regex" value with an invalid type (must be a string or RegExp) |
22
+ * | 14 | An obfuscation replacement rule contains a "replacement" value with an invalid type (must be a string) |
23
+ * | 15 | An error occurred while intercepting XHR |
24
+ * | 16 | Could not cast log message to string |
25
+ * | 17 | Could not calculate New Relic server time. Agent shutting down. |
26
+ * | 18 | RUM call failed. Agent shutting down. |
27
+ * | 19 | SPA scheduler is not initialized. Saved interaction is not sent! |
28
+ * | 20 | A problem occurred when starting up session manager. This page will not start or extend any session. |
29
+ * | 21 | Failed to initialize the agent. Could not determine the runtime environment. |
30
+ * | 22 | Failed to initialize all enabled instrument classes (agent aborted) - |
31
+ * | 23 | An unexpected issue occurred |
32
+ * | 24 | Something prevented the agent from instrumenting. |
33
+ * | 25 | Something prevented the agent from being downloaded. |
34
+ * | 26 | Failed to initialize instrument classes. |
35
+ * | 27 | Downloading runtime APIs failed... |
36
+ * | 28 | The Browser Agent is attempting to send a very large payload. This is usually tied to large amounts of custom attributes. Please check your configurations. |
37
+ * | 29 | Failed to wrap logger: invalid argument(s) |
38
+ * | 30 | Invalid log level |
39
+ * | 31 | Ignored log: Log is larger than maximum payload size |
40
+ * | 32 | Ignored log: Invalid message |
41
+ * | 33 | Session Replay Aborted |
42
+ * | 34 | Downloading and initializing a feature failed... |
43
+ * | 35 | Call to agent api failed. The API is not currently initialized. |
44
+ * | 36 | A feature is enabled but one or more dependent features have not been initialized. This may cause unintended consequences or missing data... |
45
+ * | 37 | Invalid feature name supplied. |
46
+ * | 38 | Call to api was made before agent fully initialized. |
47
+ * | 39 | Failed to execute setCustomAttribute. Name must be a string type. |
48
+ * | 40 | Failed to execute setCustomAttribute. Non-null value must be a string, number or boolean type. |
49
+ * | 41 | Failed to execute setUserId. Non-null value must be a string type. |
50
+ * | 42 | Failed to execute setApplicationVersion. Expected <String \| null> |
51
+ * | 43 | Agent not configured properly. |
52
+ * | 44 | Invalid object passed to generic event aggregate. Missing "eventType". |
53
+ * | 45 | An internal agent process failed to execute. |
54
+ * | 46 | A reserved eventType was provided to recordCustomEvent(...) -- The event was not recorded. |
55
+ * | 47 | We tried to access a stylesheet's contents but failed due to browser security. For best results, ensure that cross-domain CSS assets are decorated with "crossorigin='anonymous'" attribution or are otherwise publicly accessible. |
56
+ * | 48 | Supplied an invalid API target. Must be an <Object> that contains valid (string) id and name properties. |
57
+ * | 49 | Supplied API target is missing an entityGuid. Some APIs may not behave correctly without a valid entityGuid (ex. logs). |
58
+ * | 50 | Failed to connect. Cannot allow registered API. |
59
+ * | 51 | Container agent is not available to register with. Can not connect |
60
+ * | 52 | Unexpected problem encountered. There should be at least one app for harvest! |
61
+ * | 53 | Did not receive a valid entityGuid from connection response |
62
+ * | 54 | An experimental feature is being used. Support can not be offered for issues |
63
+ * | 55 | Register API has been disabled on the container agent |
64
+ * | 56 | Could not find a matching entity to store data |
65
+ * | 57 | Failed to execute measure. Arguments must have valid types. |
66
+ * | 58 | Failed to execute measure. Resulting duration must be non-negative. |
67
+ * | 59 | Session replay harvested before a session trace payload could be sent. This could be problematic for replays that rely on a trace |
68
+ * | 60 | Session trace aborted |
69
+ * | 61 | Timestamps must be non-negative and end time cannot be before start time. |
70
+ * | 62 | Timestamp must be a unix timestamp greater than the page origin time |
71
+ * | 63 | A single event was larger than the maximum allowed payload size |
72
+ * | 64 | Required globals have been mutated before being accessed by the browser agent. This can cause issues and should be avoided. |
73
+ * | 65 | Consent API argument must be boolean or undefined |
74
+ * | 66 | A new agent session has started |
75
+ * | 67 | The "spa" feature has been deprecated and disabled. Please use/import "soft_navigations" instead for tracking of BrowserInteraction data. |
76
+ * | 68 | API has been deregistered and can no longer be used. Call "register" API again with credentials to start over. |
77
+ * | 69 | More than one Browser agent is running on the page |
78
+ * | 70 | A session replay payload failed to send and is being retried. Recording is paused during the retry period, and will resume when a successful harvest is made. Some replay activity may be missed during retry phases. |
79
+ * | 71 | An invalid feature mode was detected and set to "off". |
80
+ *
81
+ * @param {number} code The warning code to emit, which will be used to link to the warning code documentation
82
+ * @param {*} [secondary] Secondary data to include, usually an extra message, error or object
5
83
  * @returns
6
84
  */
7
- export function warn(code: any, secondary?: any): void;
85
+ export function warn(code: number, secondary?: any): void;
8
86
  //# sourceMappingURL=console.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../src/common/util/console.js"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,4CAHW,GAAC,QAgBX"}
1
+ {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../src/common/util/console.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAEH,2BALW,MAAM,cACN,GAAC,QAiBX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.318.0-rc.4",
3
+ "version": "1.318.0-rc.5",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -176,6 +176,8 @@
176
176
  "start": "npm-run-all --parallel cdn:watch test-server",
177
177
  "lint": "eslint -c .eslintrc.js --ext .js,.cjs,.mjs .",
178
178
  "lint:fix": "npm run lint -- --fix",
179
+ "generate:warning-codes": "node tools/warning-codes/generate-jsdoc.js",
180
+ "check:warning-codes": "node tools/warning-codes/check-usage.js",
179
181
  "test": " NODE_OPTIONS=--max-old-space-size=8192 jest",
180
182
  "test:unit": "jest --selectProjects unit",
181
183
  "test:component": "jest --selectProjects component",
@@ -7,12 +7,92 @@ import { dispatchGlobalEvent } from '../dispatch/global-event'
7
7
 
8
8
  /* eslint no-console: ["error", { allow: ["debug"] }] */
9
9
 
10
+ /* GENERATED-WARNING-CODES:START -- run `npm run generate:warning-codes` after editing docs/warning-codes.md, do not hand-edit this block */
10
11
  /**
11
- * A helper method to warn to the console with New Relic: decoration
12
- * @param {string} message The primary message to warn
13
- * @param {*} [secondary] Secondary data to include, usually an error or object
12
+ * A helper method to warn to the console with New Relic: decoration.
13
+ *
14
+ * `code` corresponds to an entry in
15
+ * {@link https://github.com/newrelic/newrelic-browser-agent/blob/main/docs/warning-codes.md warning-codes.md}:
16
+ *
17
+ * | Code | Message |
18
+ * |------|---------|
19
+ * | 1 | An error occurred while setting a property of a Configurable |
20
+ * | 2 | An error occurred while setting a Configurable |
21
+ * | 3 | Setting a Configurable requires an object as input |
22
+ * | 4 | Setting a Configurable requires a model to set its initial properties |
23
+ * | 5 | An invalid session_replay.mask_selector was provided. \* will be used. |
24
+ * | 6 | An invalid session_replay.block_selector was provided and will not be used |
25
+ * | 7 | An invalid session_replay.mask_input_option was provided and will not be used |
26
+ * | 8 | Shared context requires an object as input |
27
+ * | 9 | An error occurred while setting SharedContext |
28
+ * | 10 | Failed to read from storage API |
29
+ * | 11 | Failed to write to the storage API |
30
+ * | 12 | An obfuscation replacement rule was detected missing a "regex" value. |
31
+ * | 13 | An obfuscation replacement rule contains a "regex" value with an invalid type (must be a string or RegExp) |
32
+ * | 14 | An obfuscation replacement rule contains a "replacement" value with an invalid type (must be a string) |
33
+ * | 15 | An error occurred while intercepting XHR |
34
+ * | 16 | Could not cast log message to string |
35
+ * | 17 | Could not calculate New Relic server time. Agent shutting down. |
36
+ * | 18 | RUM call failed. Agent shutting down. |
37
+ * | 19 | SPA scheduler is not initialized. Saved interaction is not sent! |
38
+ * | 20 | A problem occurred when starting up session manager. This page will not start or extend any session. |
39
+ * | 21 | Failed to initialize the agent. Could not determine the runtime environment. |
40
+ * | 22 | Failed to initialize all enabled instrument classes (agent aborted) - |
41
+ * | 23 | An unexpected issue occurred |
42
+ * | 24 | Something prevented the agent from instrumenting. |
43
+ * | 25 | Something prevented the agent from being downloaded. |
44
+ * | 26 | Failed to initialize instrument classes. |
45
+ * | 27 | Downloading runtime APIs failed... |
46
+ * | 28 | The Browser Agent is attempting to send a very large payload. This is usually tied to large amounts of custom attributes. Please check your configurations. |
47
+ * | 29 | Failed to wrap logger: invalid argument(s) |
48
+ * | 30 | Invalid log level |
49
+ * | 31 | Ignored log: Log is larger than maximum payload size |
50
+ * | 32 | Ignored log: Invalid message |
51
+ * | 33 | Session Replay Aborted |
52
+ * | 34 | Downloading and initializing a feature failed... |
53
+ * | 35 | Call to agent api failed. The API is not currently initialized. |
54
+ * | 36 | A feature is enabled but one or more dependent features have not been initialized. This may cause unintended consequences or missing data... |
55
+ * | 37 | Invalid feature name supplied. |
56
+ * | 38 | Call to api was made before agent fully initialized. |
57
+ * | 39 | Failed to execute setCustomAttribute. Name must be a string type. |
58
+ * | 40 | Failed to execute setCustomAttribute. Non-null value must be a string, number or boolean type. |
59
+ * | 41 | Failed to execute setUserId. Non-null value must be a string type. |
60
+ * | 42 | Failed to execute setApplicationVersion. Expected <String \| null> |
61
+ * | 43 | Agent not configured properly. |
62
+ * | 44 | Invalid object passed to generic event aggregate. Missing "eventType". |
63
+ * | 45 | An internal agent process failed to execute. |
64
+ * | 46 | A reserved eventType was provided to recordCustomEvent(...) -- The event was not recorded. |
65
+ * | 47 | We tried to access a stylesheet's contents but failed due to browser security. For best results, ensure that cross-domain CSS assets are decorated with "crossorigin='anonymous'" attribution or are otherwise publicly accessible. |
66
+ * | 48 | Supplied an invalid API target. Must be an <Object> that contains valid (string) id and name properties. |
67
+ * | 49 | Supplied API target is missing an entityGuid. Some APIs may not behave correctly without a valid entityGuid (ex. logs). |
68
+ * | 50 | Failed to connect. Cannot allow registered API. |
69
+ * | 51 | Container agent is not available to register with. Can not connect |
70
+ * | 52 | Unexpected problem encountered. There should be at least one app for harvest! |
71
+ * | 53 | Did not receive a valid entityGuid from connection response |
72
+ * | 54 | An experimental feature is being used. Support can not be offered for issues |
73
+ * | 55 | Register API has been disabled on the container agent |
74
+ * | 56 | Could not find a matching entity to store data |
75
+ * | 57 | Failed to execute measure. Arguments must have valid types. |
76
+ * | 58 | Failed to execute measure. Resulting duration must be non-negative. |
77
+ * | 59 | Session replay harvested before a session trace payload could be sent. This could be problematic for replays that rely on a trace |
78
+ * | 60 | Session trace aborted |
79
+ * | 61 | Timestamps must be non-negative and end time cannot be before start time. |
80
+ * | 62 | Timestamp must be a unix timestamp greater than the page origin time |
81
+ * | 63 | A single event was larger than the maximum allowed payload size |
82
+ * | 64 | Required globals have been mutated before being accessed by the browser agent. This can cause issues and should be avoided. |
83
+ * | 65 | Consent API argument must be boolean or undefined |
84
+ * | 66 | A new agent session has started |
85
+ * | 67 | The "spa" feature has been deprecated and disabled. Please use/import "soft_navigations" instead for tracking of BrowserInteraction data. |
86
+ * | 68 | API has been deregistered and can no longer be used. Call "register" API again with credentials to start over. |
87
+ * | 69 | More than one Browser agent is running on the page |
88
+ * | 70 | A session replay payload failed to send and is being retried. Recording is paused during the retry period, and will resume when a successful harvest is made. Some replay activity may be missed during retry phases. |
89
+ * | 71 | An invalid feature mode was detected and set to "off". |
90
+ *
91
+ * @param {number} code The warning code to emit, which will be used to link to the warning code documentation
92
+ * @param {*} [secondary] Secondary data to include, usually an extra message, error or object
14
93
  * @returns
15
94
  */
95
+ /* GENERATED-WARNING-CODES:END */
16
96
  export function warn (code, secondary) {
17
97
  if (typeof console.debug !== 'function') return
18
98
  console.debug(`New Relic Warning: https://github.com/newrelic/newrelic-browser-agent/blob/main/docs/warning-codes.md#${code}`, secondary)