@salesforce/telemetry 6.7.0 → 6.7.2
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/lib/o11yReporter.js +12 -4
- package/package.json +2 -2
package/lib/o11yReporter.js
CHANGED
|
@@ -16,10 +16,17 @@ exports.O11yReporter = void 0;
|
|
|
16
16
|
* See the License for the specific language governing permissions and
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
|
+
/* eslint-disable-next-line @typescript-eslint/triple-slash-reference -- needed so dynamic import('o11y_schema/sf_pdp') is typed when test tsconfig compiles */
|
|
20
|
+
/// <reference path="../types/o11y_schema_sf_pdp.d.ts" />
|
|
19
21
|
const o11y_reporter_1 = require("@salesforce/o11y-reporter");
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
// o11y_schema is ESM-only; load via dynamic import() so it works when telemetry is required as CJS
|
|
23
|
+
let pdpEventSchemaPromise = null;
|
|
24
|
+
async function getPdpEventSchema() {
|
|
25
|
+
if (!pdpEventSchemaPromise) {
|
|
26
|
+
pdpEventSchemaPromise = import('o11y_schema/sf_pdp').then((m) => m.pdpEventSchema);
|
|
27
|
+
}
|
|
28
|
+
return pdpEventSchemaPromise;
|
|
29
|
+
}
|
|
23
30
|
const baseReporter_1 = require("./baseReporter");
|
|
24
31
|
const utils_1 = require("./utils");
|
|
25
32
|
class O11yReporter extends baseReporter_1.BaseReporter {
|
|
@@ -119,7 +126,8 @@ class O11yReporter extends baseReporter_1.BaseReporter {
|
|
|
119
126
|
*/
|
|
120
127
|
async sendPdpEvent(event) {
|
|
121
128
|
await this.initialized;
|
|
122
|
-
|
|
129
|
+
const schema = await getPdpEventSchema();
|
|
130
|
+
this.service.logEventWithSchema(event, schema);
|
|
123
131
|
if (!this._batchingEnabled) {
|
|
124
132
|
await this.service.forceFlush();
|
|
125
133
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/telemetry",
|
|
3
|
-
"version": "6.7.
|
|
3
|
+
"version": "6.7.2",
|
|
4
4
|
"description": "Library for telemetry reporting to Application Insights and O11y",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"exports": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"!lib/**/*.map"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@salesforce/core": "^8.26.
|
|
44
|
+
"@salesforce/core": "^8.26.3",
|
|
45
45
|
"@salesforce/kit": "^3.2.4",
|
|
46
46
|
"@salesforce/o11y-reporter": "1.8.1",
|
|
47
47
|
"applicationinsights": "^2.9.8",
|