@veryfront/ext-content-mdx 0.1.1268 → 0.1.1269-rc.20781
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/esm/deno.js +1 -1
- package/esm/src/observability/tracing/executor-http-trace-scope.d.ts +15 -0
- package/esm/src/observability/tracing/executor-http-trace-scope.d.ts.map +1 -0
- package/esm/src/observability/tracing/executor-http-trace-scope.js +18 -0
- package/esm/src/observability/tracing/project-http-tracing.d.ts.map +1 -1
- package/esm/src/observability/tracing/project-http-tracing.js +21 -1
- package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
- package/esm/src/platform/compat/http/pinned-fetch.d.ts.map +1 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.d.ts.map +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +4 -4
package/esm/deno.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ProjectTraceProvider } from "../../extensions/observability/tracing-exporter.js";
|
|
2
|
+
type ExecutorHttpTraceScope = {
|
|
3
|
+
readonly projectId: string;
|
|
4
|
+
readonly environmentId: string;
|
|
5
|
+
readonly provider: ProjectTraceProvider | undefined;
|
|
6
|
+
};
|
|
7
|
+
/** Authenticated installation identity, entered only inside the credential-free recorder. */
|
|
8
|
+
export declare function runWithExecutorHttpTraceScope<T>(identity: {
|
|
9
|
+
projectId: string;
|
|
10
|
+
environmentId: string;
|
|
11
|
+
}, operation: () => T): T;
|
|
12
|
+
/** Internal request capability. Request headers and project settings cannot select it. */
|
|
13
|
+
export declare function getExecutorHttpTraceScope(): ExecutorHttpTraceScope | undefined;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=executor-http-trace-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor-http-trace-scope.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/tracing/executor-http-trace-scope.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAG/F,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,CAAC;CACrD,CAAC;AAOF,6FAA6F;AAC7F,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,QAAQ,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,EACtD,SAAS,EAAE,MAAM,CAAC,GACjB,CAAC,CAMH;AAED,0FAA0F;AAC1F,wBAAgB,yBAAyB,IAAI,sBAAsB,GAAG,SAAS,CAE9E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { getProjectTraceProvider } from "./project-trace-scope.js";
|
|
3
|
+
const storage = new AsyncLocalStorage();
|
|
4
|
+
const run = AsyncLocalStorage.prototype.run;
|
|
5
|
+
const getStore = AsyncLocalStorage.prototype.getStore;
|
|
6
|
+
const apply = Reflect.apply;
|
|
7
|
+
/** Authenticated installation identity, entered only inside the credential-free recorder. */
|
|
8
|
+
export function runWithExecutorHttpTraceScope(identity, operation) {
|
|
9
|
+
return apply(run, storage, [{
|
|
10
|
+
projectId: identity.projectId,
|
|
11
|
+
environmentId: identity.environmentId,
|
|
12
|
+
provider: getProjectTraceProvider(),
|
|
13
|
+
}, operation]);
|
|
14
|
+
}
|
|
15
|
+
/** Internal request capability. Request headers and project settings cannot select it. */
|
|
16
|
+
export function getExecutorHttpTraceScope() {
|
|
17
|
+
return apply(getStore, storage, []);
|
|
18
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-http-tracing.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/tracing/project-http-tracing.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"project-http-tracing.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/tracing/project-http-tracing.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAuC7F,qFAAqF;AACrF,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAG7D;AAED,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CAKhE;AAED,8EAA8E;AAC9E,wBAAsB,qBAAqB,CAAC,CAAC,SAAS,QAAQ,GAAG,SAAS,EACxE,QAAQ,EAAE,wBAAwB,EAClC,QAAQ,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,EACxD,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAC1B,OAAO,CAAC,CAAC,CAAC,CAwGZ"}
|
|
@@ -2,7 +2,8 @@ import { completeOnResponseBodyConsumption } from "../../platform/compat/http/re
|
|
|
2
2
|
import { tryResolve } from "../../extensions/contracts.js";
|
|
3
3
|
import { ProjectTraceRegistry } from "./project-trace-registry.js";
|
|
4
4
|
import { createProjectOtlpTransport } from "./project-otlp-transport.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getExecutorHttpTraceScope } from "./executor-http-trace-scope.js";
|
|
6
|
+
import { getProjectTraceProvider, runWithProjectTraceProvider } from "./project-trace-scope.js";
|
|
6
7
|
import { trace } from "./api-shim.js";
|
|
7
8
|
import { formatTraceparent } from "./traceparent.js";
|
|
8
9
|
let owner;
|
|
@@ -45,6 +46,25 @@ export async function shutdownProjectHttpTracing() {
|
|
|
45
46
|
}
|
|
46
47
|
/** Enter only after authenticated project configuration has been resolved. */
|
|
47
48
|
export async function runProjectHttpTracing(settings, identity, request, operation) {
|
|
49
|
+
const executorScope = getExecutorHttpTraceScope();
|
|
50
|
+
if (executorScope) {
|
|
51
|
+
// Export is owned by the broker. The executor only retains the recorder for
|
|
52
|
+
// its installed project/environment, including deferred response work.
|
|
53
|
+
const provider = !request.signal.aborted &&
|
|
54
|
+
identity.projectId === executorScope.projectId &&
|
|
55
|
+
identity.environmentId === executorScope.environmentId &&
|
|
56
|
+
getProjectTraceProvider() === executorScope.provider
|
|
57
|
+
? executorScope.provider
|
|
58
|
+
: undefined;
|
|
59
|
+
const run = (operation) => runWithProjectTraceProvider(provider, operation);
|
|
60
|
+
const response = await run(operation);
|
|
61
|
+
return response
|
|
62
|
+
? completeOnResponseBodyConsumption(response, () => { }, request.signal, { highWaterMark: 0 }, {
|
|
63
|
+
runDeferredOperation: run,
|
|
64
|
+
cancellationTimeoutMs: 1000,
|
|
65
|
+
})
|
|
66
|
+
: response;
|
|
67
|
+
}
|
|
48
68
|
const active = getRegistry();
|
|
49
69
|
if (settings.status !== "enabled" || !active || request.signal.aborted) {
|
|
50
70
|
if (active && (settings.status === "disabled" || settings.status === "invalid") &&
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Client identity for guarded egress, standing in for the runtime-supplied
|
|
8
8
|
* `user-agent` (`node`, `Deno/x.y.z`) that this transport cannot inherit.
|
|
9
9
|
*/
|
|
10
|
-
export declare const DEFAULT_OUTBOUND_USER_AGENT = "veryfront/0.1.
|
|
10
|
+
export declare const DEFAULT_OUTBOUND_USER_AGENT = "veryfront/0.1.1269-rc.20781";
|
|
11
11
|
export interface PinnedFetchTlsOptions {
|
|
12
12
|
/**
|
|
13
13
|
* Complete trusted CA set for this connection. Passing this replaces the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pinned-fetch.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/pinned-fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;;GAGG;AACH,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"pinned-fetch.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/pinned-fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;;GAGG;AACH,eAAO,MAAM,2BAA2B,gCAAyB,CAAC;AAElE,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpD;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAeT;AAED,iFAAiF;AACjF,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,QAAQ,GAAG,IAAI,EACrB,aAAa,SAAQ,GACpB,QAAQ,CASV;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,SAAS,MAAM,EAAE,GAC3B,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAUhC;AAED,6EAA6E;AAC7E,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAYjE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,CAOtE;AA4FD,8EAA8E;AAC9E,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,IAAI,EAAE,WAAW,EACjB,GAAG,GAAE,qBAA0B,GAC9B,OAAO,CAAC,QAAQ,CAAC,CAuInB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-constant.d.ts","sourceRoot":"","sources":["../../../src/src/utils/version-constant.ts"],"names":[],"mappings":"AAEA,4BAA4B;AAC5B,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version-constant.d.ts","sourceRoot":"","sources":["../../../src/src/utils/version-constant.ts"],"names":[],"mappings":"AAEA,4BAA4B;AAC5B,eAAO,MAAM,OAAO,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veryfront/ext-content-mdx",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1269-rc.20781",
|
|
4
4
|
"description": "Veryfront first-party extension package for ext-content-mdx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"veryfront",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@types/hast": "3.0.3",
|
|
54
54
|
"@types/mdast": "4.0.3",
|
|
55
55
|
"@types/unist": "3.0.2",
|
|
56
|
-
"@veryfront/ext-parser-babel": "0.1.
|
|
56
|
+
"@veryfront/ext-parser-babel": "0.1.1269-rc.20781",
|
|
57
57
|
"acorn": "8.17.0",
|
|
58
58
|
"acorn-jsx": "5.3.2",
|
|
59
59
|
"github-slugger": "2.0.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"vfile": "6.0.3"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
|
-
"veryfront": "^0.1.
|
|
85
|
+
"veryfront": "^0.1.1269-rc.20781"
|
|
86
86
|
},
|
|
87
87
|
"type": "module",
|
|
88
88
|
"types": "./esm/extensions/ext-content-mdx/src/index.d.ts",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"NOTICE",
|
|
93
93
|
"README.md"
|
|
94
94
|
],
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "d3dada3b5b5eb5d4a67684ffc2e9a0953a86db48"
|
|
96
96
|
}
|