@mark1russell7/otel-ts 0.7.6 → 0.7.7
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/faro.d.ts.map +1 -1
- package/dist/faro.js.map +1 -1
- package/package.json +1 -1
- package/src/faro.ts +15 -1
package/dist/faro.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faro.d.ts","sourceRoot":"","sources":["../src/faro.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"faro.d.ts","sourceRoot":"","sources":["../src/faro.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAsBnE"}
|
package/dist/faro.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faro.js","sourceRoot":"","sources":["../src/faro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACL,cAAc,EACd,sBAAsB,GAEvB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,MAAsB,EAAE,GAAW;IAC3D,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC;IAChC,MAAM,IAAI,GAAG,cAAc,CAAC;QAC1B,GAAG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AAK,MAAM;QAAE,OAAO;IAClD,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU;QAAE,OAAO;IACpD,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU;QAAE,OAAO;IACnD,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AACvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@mark1russell7/otel-ts",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.7",
|
|
5
5
|
"description": "Frontend observability in one init() call — OpenTelemetry + Grafana Faro for any TypeScript web app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Mark Russell (https://github.com/mark1russell7)",
|
package/src/faro.ts
CHANGED
|
@@ -31,12 +31,26 @@ export function setupFaro(config: ResolvedConfig, url: string): Faro {
|
|
|
31
31
|
}),
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
faro.api.initOTEL(
|
|
34
|
+
faro.api.initOTEL(
|
|
35
|
+
trace as unknown as FaroOtel[0],
|
|
36
|
+
context as unknown as FaroOtel[1],
|
|
37
|
+
);
|
|
35
38
|
keepFetchOriginal(before);
|
|
36
39
|
|
|
37
40
|
return faro;
|
|
38
41
|
}
|
|
39
42
|
|
|
43
|
+
/**
|
|
44
|
+
* The trace and context APIs as the types of Faro declare them. Faro ships
|
|
45
|
+
* CommonJS types only, so in its types `@opentelemetry/api` (1.10 and later)
|
|
46
|
+
* resolves to the CommonJS declarations (`.d.cts`). This module gets the ES
|
|
47
|
+
* module declarations (`.d.mts`). The classes have private fields, so
|
|
48
|
+
* TypeScript sees two different types. At run time they are one API: each
|
|
49
|
+
* copy reads the same global of `@opentelemetry/api`. Remove the casts when
|
|
50
|
+
* Faro ships ES module types.
|
|
51
|
+
*/
|
|
52
|
+
type FaroOtel = Parameters<Faro["api"]["initOTEL"]>;
|
|
53
|
+
|
|
40
54
|
type WrappedFetch = typeof fetch & { __original?: typeof fetch };
|
|
41
55
|
|
|
42
56
|
/**
|