@softprobe/softprobe-js 2.0.4 → 2.0.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.
Files changed (122) hide show
  1. package/README.md +6 -1
  2. package/dist/cli/diff.d.ts.map +1 -1
  3. package/dist/cli/diff.js +6 -1
  4. package/dist/cli/diff.js.map +1 -1
  5. package/dist/core/runtime/architecture-guard.js +13 -13
  6. package/dist/core/runtime/architecture-guard.js.map +1 -1
  7. package/dist/core/runtime/http-body.d.ts +5 -0
  8. package/dist/core/runtime/http-body.d.ts.map +1 -0
  9. package/dist/core/runtime/http-body.js +20 -0
  10. package/dist/core/runtime/http-body.js.map +1 -0
  11. package/dist/instrumentations/common/http/inbound-capture.d.ts +4 -0
  12. package/dist/instrumentations/common/http/inbound-capture.d.ts.map +1 -1
  13. package/dist/instrumentations/common/http/inbound-capture.js +5 -2
  14. package/dist/instrumentations/common/http/inbound-capture.js.map +1 -1
  15. package/dist/instrumentations/common/http/inbound-record.d.ts +4 -0
  16. package/dist/instrumentations/common/http/inbound-record.d.ts.map +1 -1
  17. package/dist/instrumentations/common/http/inbound-record.js +8 -4
  18. package/dist/instrumentations/common/http/inbound-record.js.map +1 -1
  19. package/dist/instrumentations/express/capture.d.ts.map +1 -1
  20. package/dist/instrumentations/express/capture.js +2 -0
  21. package/dist/instrumentations/express/capture.js.map +1 -1
  22. package/package.json +3 -2
  23. package/dist/bindings/http-span.d.ts +0 -6
  24. package/dist/bindings/http-span.d.ts.map +0 -1
  25. package/dist/bindings/http-span.js +0 -11
  26. package/dist/bindings/http-span.js.map +0 -1
  27. package/dist/bindings/postgres-span.d.ts +0 -6
  28. package/dist/bindings/postgres-span.d.ts.map +0 -1
  29. package/dist/bindings/postgres-span.js +0 -11
  30. package/dist/bindings/postgres-span.js.map +0 -1
  31. package/dist/bindings/redis-span.d.ts +0 -6
  32. package/dist/bindings/redis-span.d.ts.map +0 -1
  33. package/dist/bindings/redis-span.js +0 -11
  34. package/dist/bindings/redis-span.js.map +0 -1
  35. package/dist/bindings/test-span.d.ts +0 -6
  36. package/dist/bindings/test-span.d.ts.map +0 -1
  37. package/dist/bindings/test-span.js +0 -9
  38. package/dist/bindings/test-span.js.map +0 -1
  39. package/dist/capture/express.d.ts +0 -6
  40. package/dist/capture/express.d.ts.map +0 -1
  41. package/dist/capture/express.js +0 -11
  42. package/dist/capture/express.js.map +0 -1
  43. package/dist/capture/fastify.d.ts +0 -5
  44. package/dist/capture/fastify.d.ts.map +0 -1
  45. package/dist/capture/fastify.js +0 -9
  46. package/dist/capture/fastify.js.map +0 -1
  47. package/dist/capture/framework-mutator.d.ts +0 -20
  48. package/dist/capture/framework-mutator.d.ts.map +0 -1
  49. package/dist/capture/framework-mutator.js +0 -144
  50. package/dist/capture/framework-mutator.js.map +0 -1
  51. package/dist/capture/http-inbound.d.ts +0 -28
  52. package/dist/capture/http-inbound.d.ts.map +0 -1
  53. package/dist/capture/http-inbound.js +0 -40
  54. package/dist/capture/http-inbound.js.map +0 -1
  55. package/dist/capture/inject.d.ts +0 -17
  56. package/dist/capture/inject.d.ts.map +0 -1
  57. package/dist/capture/inject.js +0 -28
  58. package/dist/capture/inject.js.map +0 -1
  59. package/dist/capture/mutator.d.ts +0 -17
  60. package/dist/capture/mutator.d.ts.map +0 -1
  61. package/dist/capture/mutator.js +0 -51
  62. package/dist/capture/mutator.js.map +0 -1
  63. package/dist/capture/postgres.d.ts +0 -6
  64. package/dist/capture/postgres.d.ts.map +0 -1
  65. package/dist/capture/postgres.js +0 -11
  66. package/dist/capture/postgres.js.map +0 -1
  67. package/dist/capture/redis.d.ts +0 -5
  68. package/dist/capture/redis.d.ts.map +0 -1
  69. package/dist/capture/redis.js +0 -10
  70. package/dist/capture/redis.js.map +0 -1
  71. package/dist/capture/store-accessor.d.ts +0 -11
  72. package/dist/capture/store-accessor.d.ts.map +0 -1
  73. package/dist/capture/store-accessor.js +0 -19
  74. package/dist/capture/store-accessor.js.map +0 -1
  75. package/dist/capture/stream-tap.d.ts +0 -5
  76. package/dist/capture/stream-tap.d.ts.map +0 -1
  77. package/dist/capture/stream-tap.js +0 -9
  78. package/dist/capture/stream-tap.js.map +0 -1
  79. package/dist/identifier.d.ts +0 -5
  80. package/dist/identifier.d.ts.map +0 -1
  81. package/dist/identifier.js +0 -11
  82. package/dist/identifier.js.map +0 -1
  83. package/dist/replay/express.d.ts +0 -5
  84. package/dist/replay/express.d.ts.map +0 -1
  85. package/dist/replay/express.js +0 -9
  86. package/dist/replay/express.js.map +0 -1
  87. package/dist/replay/extract-key.d.ts +0 -41
  88. package/dist/replay/extract-key.d.ts.map +0 -1
  89. package/dist/replay/extract-key.js +0 -80
  90. package/dist/replay/extract-key.js.map +0 -1
  91. package/dist/replay/fastify.d.ts +0 -5
  92. package/dist/replay/fastify.d.ts.map +0 -1
  93. package/dist/replay/fastify.js +0 -9
  94. package/dist/replay/fastify.js.map +0 -1
  95. package/dist/replay/http.d.ts +0 -5
  96. package/dist/replay/http.d.ts.map +0 -1
  97. package/dist/replay/http.js +0 -10
  98. package/dist/replay/http.js.map +0 -1
  99. package/dist/replay/matcher.d.ts +0 -25
  100. package/dist/replay/matcher.d.ts.map +0 -1
  101. package/dist/replay/matcher.js +0 -83
  102. package/dist/replay/matcher.js.map +0 -1
  103. package/dist/replay/postgres.d.ts +0 -5
  104. package/dist/replay/postgres.d.ts.map +0 -1
  105. package/dist/replay/postgres.js +0 -10
  106. package/dist/replay/postgres.js.map +0 -1
  107. package/dist/replay/redis.d.ts +0 -5
  108. package/dist/replay/redis.d.ts.map +0 -1
  109. package/dist/replay/redis.js +0 -10
  110. package/dist/replay/redis.js.map +0 -1
  111. package/dist/replay/softprobe-matcher.d.ts +0 -41
  112. package/dist/replay/softprobe-matcher.d.ts.map +0 -1
  113. package/dist/replay/softprobe-matcher.js +0 -92
  114. package/dist/replay/softprobe-matcher.js.map +0 -1
  115. package/dist/replay/store-accessor.d.ts +0 -14
  116. package/dist/replay/store-accessor.d.ts.map +0 -1
  117. package/dist/replay/store-accessor.js +0 -26
  118. package/dist/replay/store-accessor.js.map +0 -1
  119. package/dist/replay/topology.d.ts +0 -37
  120. package/dist/replay/topology.d.ts.map +0 -1
  121. package/dist/replay/topology.js +0 -72
  122. package/dist/replay/topology.js.map +0 -1
@@ -1,144 +0,0 @@
1
- "use strict";
2
- /**
3
- * Framework mutators: patch Express and Fastify so Softprobe middleware/hooks
4
- * are applied without user intervention. Design §16: patch Express app.use so
5
- * first middleware/route addition triggers our middleware; patch Fastify factory
6
- * so new instances get the plugin registered.
7
- */
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.patchExpress = patchExpress;
13
- exports.applyFrameworkMutators = applyFrameworkMutators;
14
- const shimmer_1 = __importDefault(require("shimmer"));
15
- const capture_1 = require("../instrumentations/express/capture");
16
- const capture_2 = require("../instrumentations/fastify/capture");
17
- const nodeRequire = (typeof require !== 'undefined' ? require : undefined);
18
- /**
19
- * Patch Express so the first time a route is added (e.g. app.get), we call
20
- * app.use(softprobeExpressMiddleware) so Softprobe middleware is injected.
21
- * Express 5 uses app.route() for app.get/post/etc., and mixin(app, proto) copies
22
- * proto onto each app, so we must patch the shared proto (express.application).
23
- */
24
- function patchExpress(express) {
25
- if (typeof express !== 'function')
26
- return;
27
- const exp = express;
28
- const proto = exp.application ?? Object.getPrototypeOf(express());
29
- if (!proto || typeof proto.route !== 'function')
30
- return;
31
- if (proto._softprobeRoutePatched)
32
- return;
33
- proto._softprobeRoutePatched = true;
34
- shimmer_1.default.wrap(proto, 'route', (original) => {
35
- return function route(...args) {
36
- if (!this._softprobeMiddlewareAdded) {
37
- this._softprobeMiddlewareAdded = true;
38
- this.use(capture_1.softprobeExpressMiddleware);
39
- }
40
- return original.apply(this, args);
41
- };
42
- });
43
- }
44
- /**
45
- * Patches Node's require so that when 'express' or 'fastify' is required,
46
- * the framework is patched to inject Softprobe middleware/hooks. Call from init
47
- * so that user require('express') or require('fastify') gets the patched version.
48
- */
49
- function applyFrameworkMutators() {
50
- if (!nodeRequire)
51
- return;
52
- const Mod = (typeof module !== 'undefined' && module.constructor);
53
- if (!Mod?.prototype?.require)
54
- return;
55
- const req = nodeRequire;
56
- const originalRequire = Mod.prototype.require;
57
- Mod.prototype.require = function (id) {
58
- const result = originalRequire.apply(this, arguments);
59
- try {
60
- if (id === 'express')
61
- patchExpress(result);
62
- if (id === 'fastify') {
63
- const ModLoad = nodeRequire('module');
64
- const path = ModLoad._resolveFilename(id, this);
65
- const mod = req.cache?.[path];
66
- if (mod) {
67
- const orig = mod.exports;
68
- const origFactory = (typeof orig === 'function' ? orig : orig.fastify ?? orig.default);
69
- if (typeof origFactory !== 'function')
70
- return result;
71
- const wrapped = fastifyWrapper(origFactory);
72
- wrapped.fastify = wrapped;
73
- wrapped.default = wrapped;
74
- if (typeof orig === 'object' && orig !== null) {
75
- const o = orig;
76
- for (const k of Object.keys(o)) {
77
- if (k !== 'fastify' && k !== 'default' && Object.prototype.hasOwnProperty.call(o, k)) {
78
- wrapped[k] = o[k];
79
- }
80
- }
81
- }
82
- mod.exports = typeof orig === 'object' && orig !== null
83
- ? Object.assign({}, orig, { fastify: wrapped, default: wrapped })
84
- : wrapped;
85
- return mod.exports;
86
- }
87
- }
88
- }
89
- catch (_) {
90
- // ignore patch errors
91
- }
92
- return result;
93
- };
94
- // Patch already-cached express if present (so test can require after mutator runs)
95
- const cache = (typeof require !== 'undefined' && require.cache) || {};
96
- for (const key of Object.keys(cache)) {
97
- if (key.endsWith('node_modules/express/index.js') || key.endsWith('node_modules/express/lib/express.js')) {
98
- try {
99
- const mod = cache[key];
100
- if (mod?.exports)
101
- patchExpress(mod.exports);
102
- }
103
- catch (_) { }
104
- break;
105
- }
106
- }
107
- for (const key of Object.keys(cache)) {
108
- if (key.endsWith('node_modules/fastify/fastify.js') || key.endsWith('node_modules/fastify/build/fastify.js')) {
109
- try {
110
- const mod = cache[key];
111
- const ex = mod?.exports;
112
- const F = (typeof ex === 'function' ? ex : ex?.fastify ?? ex?.default);
113
- if (typeof F === 'function') {
114
- const wrapped = fastifyWrapper(F);
115
- wrapped.fastify = wrapped;
116
- wrapped.default = wrapped;
117
- if (typeof ex === 'object' && ex !== null) {
118
- const o = ex;
119
- for (const k of Object.keys(o)) {
120
- if (k !== 'fastify' && k !== 'default' && Object.prototype.hasOwnProperty.call(o, k)) {
121
- wrapped[k] = o[k];
122
- }
123
- }
124
- }
125
- mod.exports = typeof ex === 'object' && ex !== null
126
- ? Object.assign({}, ex, { fastify: wrapped, default: wrapped })
127
- : wrapped;
128
- }
129
- }
130
- catch (_) { }
131
- break;
132
- }
133
- }
134
- }
135
- function fastifyWrapper(original) {
136
- return function (options) {
137
- return Promise.resolve(original.call(this, options)).then((app) => {
138
- const fp = nodeRequire?.('fastify-plugin');
139
- const plugin = typeof fp === 'function' ? fp(capture_2.softprobeFastifyPlugin) : capture_2.softprobeFastifyPlugin;
140
- return app.register(plugin).then(() => app);
141
- });
142
- };
143
- }
144
- //# sourceMappingURL=framework-mutator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-mutator.js","sourceRoot":"","sources":["../../src/capture/framework-mutator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAeH,oCAiBC;AAOD,wDAgFC;AApHD,sDAA8B;AAC9B,iEAAiF;AACjF,iEAA6E;AAE7E,MAAM,WAAW,GAAG,CAAC,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAA4B,CAAC;AAEtG;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,OAAmC;IAC9D,IAAI,OAAO,OAAO,KAAK,UAAU;QAAE,OAAO;IAC1C,MAAM,GAAG,GAAG,OAA0G,CAAC;IACvH,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,IAAI,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE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AC,gBAAgB,CAAC,CAAC;YAC3C,MAAM,MAAM,GAAG,OAAO,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,gCAAsB,CAAC,CAAC,CAAC,CAAC,gCAAsB,CAAC;YAC9F,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -1,28 +0,0 @@
1
- /**
2
- * HTTP inbound capture: write one NDJSON record per inbound request/response.
3
- * Design §10.4: Inbound HTTP — request body + response status/body.
4
- * Single record embeds both requestPayload and responsePayload when available.
5
- * Task 14.3.1: requestPayload.body is populated from req.body when Express
6
- * middleware is placed after body-parser (via queueInboundResponse.requestBody).
7
- */
8
- import type { CassetteStore } from '../store/cassette-store';
9
- export type WriteInboundHttpOptions = {
10
- traceId: string;
11
- spanId: string;
12
- parentSpanId?: string;
13
- spanName?: string;
14
- method: string;
15
- url: string;
16
- /** Request body (optional). */
17
- requestBody?: unknown;
18
- /** Response status code (optional). */
19
- statusCode?: number;
20
- /** Response body (optional). */
21
- responseBody?: unknown;
22
- };
23
- /**
24
- * Writes one inbound HTTP cassette record. Include requestBody for request capture,
25
- * and statusCode/responseBody when the response is available (same record).
26
- */
27
- export declare function writeInboundHttpRecord(store: CassetteStore, options: WriteInboundHttpOptions): void;
28
- //# sourceMappingURL=http-inbound.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-inbound.d.ts","sourceRoot":"","sources":["../../src/capture/http-inbound.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAI7D,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,+BAA+B;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,uBAAuB,GAC/B,IAAI,CAoCN"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- /**
3
- * HTTP inbound capture: write one NDJSON record per inbound request/response.
4
- * Design §10.4: Inbound HTTP — request body + response status/body.
5
- * Single record embeds both requestPayload and responsePayload when available.
6
- * Task 14.3.1: requestPayload.body is populated from req.body when Express
7
- * middleware is placed after body-parser (via queueInboundResponse.requestBody).
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.writeInboundHttpRecord = writeInboundHttpRecord;
11
- const identifier_1 = require("../identifier");
12
- /**
13
- * Writes one inbound HTTP cassette record. Include requestBody for request capture,
14
- * and statusCode/responseBody when the response is available (same record).
15
- */
16
- function writeInboundHttpRecord(store, options) {
17
- const { traceId, spanId, parentSpanId, spanName, method, url, requestBody, statusCode, responseBody, } = options;
18
- const record = {
19
- version: '4.1',
20
- traceId,
21
- spanId,
22
- parentSpanId,
23
- spanName,
24
- timestamp: new Date().toISOString(),
25
- type: 'inbound',
26
- protocol: 'http',
27
- identifier: (0, identifier_1.httpIdentifier)(method, url),
28
- };
29
- if (requestBody !== undefined) {
30
- record.requestPayload = { body: requestBody };
31
- }
32
- if (statusCode !== undefined) {
33
- record.responsePayload = {
34
- statusCode,
35
- body: responseBody,
36
- };
37
- }
38
- store.saveRecord(record);
39
- }
40
- //# sourceMappingURL=http-inbound.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-inbound.js","sourceRoot":"","sources":["../../src/capture/http-inbound.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAyBH,wDAuCC;AA5DD,8CAA+C;AAiB/C;;;GAGG;AACH,SAAgB,sBAAsB,CACpC,KAAoB,EACpB,OAAgC;IAEhC,MAAM,EACJ,OAAO,EACP,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,GAAG,EACH,WAAW,EACX,UAAU,EACV,YAAY,GACb,GAAG,OAAO,CAAC;IAEZ,MAAM,MAAM,GAA4B;QACtC,OAAO,EAAE,KAAK;QACd,OAAO;QACP,MAAM;QACN,YAAY;QACZ,QAAQ;QACR,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,MAAM;QAChB,UAAU,EAAE,IAAA,2BAAc,EAAC,MAAM,EAAE,GAAG,CAAC;KACxC,CAAC;IAEF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,CAAC,cAAc,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAChD,CAAC;IACD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,CAAC,eAAe,GAAG;YACvB,UAAU;YACV,IAAI,EAAE,YAAY;SACnB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Shared helpers to inject hooks into the instrumentation config array
3
- * returned by getNodeAutoInstrumentations. Used by mutator to apply each protocol's hook.
4
- * Design §5.3: keeps injection logic DRY across capture/postgres, undici, redis.
5
- */
6
- export type InstrumentationEntry = {
7
- instrumentationName?: string;
8
- [hookName: string]: unknown;
9
- };
10
- /**
11
- * Finds the entry in the config array whose instrumentationName matches, and sets
12
- * the named hook property. Mutates the array in place and returns it.
13
- */
14
- export declare function injectHook(result: unknown[], instrumentationName: string, hookName: string, hookFn: (...args: unknown[]) => void): unknown[];
15
- /** Convenience wrapper: injects a responseHook. */
16
- export declare function injectResponseHook(result: unknown[], instrumentationName: string, responseHook: (span: unknown, result: unknown) => void): unknown[];
17
- //# sourceMappingURL=inject.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../src/capture/inject.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,oBAAoB,GAAG;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,OAAO,EAAE,EACjB,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,GACnC,OAAO,EAAE,CASX;AAED,mDAAmD;AACnD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,EAAE,EACjB,mBAAmB,EAAE,MAAM,EAC3B,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,GACrD,OAAO,EAAE,CAEX"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- /**
3
- * Shared helpers to inject hooks into the instrumentation config array
4
- * returned by getNodeAutoInstrumentations. Used by mutator to apply each protocol's hook.
5
- * Design §5.3: keeps injection logic DRY across capture/postgres, undici, redis.
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.injectHook = injectHook;
9
- exports.injectResponseHook = injectResponseHook;
10
- /**
11
- * Finds the entry in the config array whose instrumentationName matches, and sets
12
- * the named hook property. Mutates the array in place and returns it.
13
- */
14
- function injectHook(result, instrumentationName, hookName, hookFn) {
15
- for (const item of result) {
16
- const entry = item;
17
- if (entry.instrumentationName === instrumentationName) {
18
- entry[hookName] = hookFn;
19
- break;
20
- }
21
- }
22
- return result;
23
- }
24
- /** Convenience wrapper: injects a responseHook. */
25
- function injectResponseHook(result, instrumentationName, responseHook) {
26
- return injectHook(result, instrumentationName, 'responseHook', responseHook);
27
- }
28
- //# sourceMappingURL=inject.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inject.js","sourceRoot":"","sources":["../../src/capture/inject.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAWH,gCAcC;AAGD,gDAMC;AA3BD;;;GAGG;AACH,SAAgB,UAAU,CACxB,MAAiB,EACjB,mBAA2B,EAC3B,QAAgB,EAChB,MAAoC;IAEpC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,IAA4B,CAAC;QAC3C,IAAI,KAAK,CAAC,mBAAmB,KAAK,mBAAmB,EAAE,CAAC;YACtD,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;YACzB,MAAM;QACR,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,mDAAmD;AACnD,SAAgB,kBAAkB,CAChC,MAAiB,EACjB,mBAA2B,EAC3B,YAAsD;IAEtD,OAAO,UAAU,CAAC,MAAM,EAAE,mBAAmB,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;AAC/E,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Auto-instrumentation mutator: wraps getNodeAutoInstrumentations to inject
3
- * Softprobe responseHooks per protocol (postgres, redis). HTTP capture/replay
4
- * is done solely via the MSW interceptor (replay/http.ts), not undici instrumentation.
5
- * Design §5.2, §5.3.
6
- */
7
- /** Module-like object that exposes getNodeAutoInstrumentations (for real use or tests). */
8
- export interface AutoInstrumentationsModule {
9
- getNodeAutoInstrumentations: (options?: unknown) => unknown[];
10
- }
11
- /**
12
- * Wraps getNodeAutoInstrumentations so that the returned config includes our
13
- * custom responseHook for each protocol. Pass a module object to mutate (e.g. for tests);
14
- * if omitted, the real @opentelemetry/auto-instrumentations-node module is used.
15
- */
16
- export declare function applyAutoInstrumentationMutator(target?: AutoInstrumentationsModule): void;
17
- //# sourceMappingURL=mutator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutator.d.ts","sourceRoot":"","sources":["../../src/capture/mutator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,2FAA2F;AAC3F,MAAM,WAAW,0BAA0B;IACzC,2BAA2B,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,EAAE,CAAC;CAC/D;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,CAAC,EAAE,0BAA0B,GAClC,IAAI,CAuCN"}
@@ -1,51 +0,0 @@
1
- "use strict";
2
- /**
3
- * Auto-instrumentation mutator: wraps getNodeAutoInstrumentations to inject
4
- * Softprobe responseHooks per protocol (postgres, redis). HTTP capture/replay
5
- * is done solely via the MSW interceptor (replay/http.ts), not undici instrumentation.
6
- * Design §5.2, §5.3.
7
- */
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.applyAutoInstrumentationMutator = applyAutoInstrumentationMutator;
13
- const shimmer_1 = __importDefault(require("shimmer"));
14
- const inject_1 = require("./inject");
15
- const capture_1 = require("../instrumentations/postgres/capture");
16
- const capture_2 = require("../instrumentations/redis/capture");
17
- /**
18
- * Wraps getNodeAutoInstrumentations so that the returned config includes our
19
- * custom responseHook for each protocol. Pass a module object to mutate (e.g. for tests);
20
- * if omitted, the real @opentelemetry/auto-instrumentations-node module is used.
21
- */
22
- function applyAutoInstrumentationMutator(target) {
23
- const moduleExport = target ?? require('@opentelemetry/auto-instrumentations-node');
24
- shimmer_1.default.wrap(moduleExport, 'getNodeAutoInstrumentations', ((original) => {
25
- return function wrappedGetNodeAutoInstrumentations(options) {
26
- // Real getNodeAutoInstrumentations(inputConfigs) creates instances from config;
27
- // merge our responseHooks into the input so instances get them (E2E).
28
- const input = options != null && typeof options === 'object' && !Array.isArray(options)
29
- ? options
30
- : {};
31
- const merged = { ...input };
32
- merged[capture_1.PG_INSTRUMENTATION_NAME] = {
33
- ...(input[capture_1.PG_INSTRUMENTATION_NAME] ?? {}),
34
- requestHook: (0, capture_1.buildPostgresRequestHook)(),
35
- responseHook: (0, capture_1.buildPostgresResponseHook)(),
36
- };
37
- merged[capture_2.REDIS_INSTRUMENTATION_NAME] = {
38
- ...(input[capture_2.REDIS_INSTRUMENTATION_NAME] ?? {}),
39
- responseHook: (0, capture_2.buildRedisResponseHook)(),
40
- };
41
- const result = original.call(this, merged);
42
- // Also mutate return value for mocks that return config-like entries (unit tests).
43
- const arr = Array.isArray(result) ? result : [];
44
- (0, inject_1.injectHook)(arr, capture_1.PG_INSTRUMENTATION_NAME, 'requestHook', (0, capture_1.buildPostgresRequestHook)());
45
- (0, inject_1.injectResponseHook)(arr, capture_1.PG_INSTRUMENTATION_NAME, (0, capture_1.buildPostgresResponseHook)());
46
- (0, inject_1.injectResponseHook)(arr, capture_2.REDIS_INSTRUMENTATION_NAME, (0, capture_2.buildRedisResponseHook)());
47
- return arr;
48
- };
49
- }));
50
- }
51
- //# sourceMappingURL=mutator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutator.js","sourceRoot":"","sources":["../../src/capture/mutator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAwBH,0EAyCC;AA/DD,sDAA8B;AAC9B,qCAA0D;AAC1D,kEAI8C;AAC9C,+DAG2C;AAO3C;;;;GAIG;AACH,SAAgB,+BAA+B,CAC7C,MAAmC;IAEnC,MAAM,YAAY,GAChB,MAAM,IAAI,OAAO,CAAC,2CAA2C,CAAC,CAAC;IAEjE,iBAAO,CAAC,IAAI,CACV,YAAY,EACZ,6BAA6B,EAC7B,CAAC,CAAC,QAA0C,EAAE,EAAE;QAC9C,OAAO,SAAS,kCAAkC,CAEhD,OAAiB;YAEjB,gFAAgF;YAChF,sEAAsE;YACtE,MAA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ildPostgresRequestHook, buildPostgresResponseHook, } from '../instrumentations/postgres/capture';
5
- export type { PgQueryInfo, PgResultInfo } from '../instrumentations/postgres/capture';
6
- //# sourceMappingURL=postgres.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/capture/postgres.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildPostgresResponseHook = exports.buildPostgresRequestHook = exports.PG_INSTRUMENTATION_NAME = void 0;
4
- /**
5
- * Legacy compatibility re-export for Postgres capture instrumentation.
6
- */
7
- var capture_1 = require("../instrumentations/postgres/capture");
8
- Object.defineProperty(exports, "PG_INSTRUMENTATION_NAME", { enumerable: true, get: function () { return capture_1.PG_INSTRUMENTATION_NAME; } });
9
- Object.defineProperty(exports, "buildPostgresRequestHook", { enumerable: true, get: function () { return capture_1.buildPostgresRequestHook; } });
10
- Object.defineProperty(exports, "buildPostgresResponseHook", { enumerable: true, get: function () { return capture_1.buildPostgresResponseHook; } });
11
- //# sourceMappingURL=postgres.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"postgres.js","sourceRoot":"","sources":["../../src/capture/postgres.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,gEAI8C;AAH5C,kHAAA,uBAAuB,OAAA;AACvB,mHAAA,wBAAwB,OAAA;AACxB,oHAAA,yBAAyB,OAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Legacy compatibility re-export for Redis capture instrumentation.
3
- */
4
- export { REDIS_INSTRUMENTATION_NAME, buildRedisResponseHook } from '../instrumentations/redis/capture';
5
- //# sourceMappingURL=redis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/capture/redis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildRedisResponseHook = exports.REDIS_INSTRUMENTATION_NAME = void 0;
4
- /**
5
- * Legacy compatibility re-export for Redis capture instrumentation.
6
- */
7
- var capture_1 = require("../instrumentations/redis/capture");
8
- Object.defineProperty(exports, "REDIS_INSTRUMENTATION_NAME", { enumerable: true, get: function () { return capture_1.REDIS_INSTRUMENTATION_NAME; } });
9
- Object.defineProperty(exports, "buildRedisResponseHook", { enumerable: true, get: function () { return capture_1.buildRedisResponseHook; } });
10
- //# sourceMappingURL=redis.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis.js","sourceRoot":"","sources":["../../src/capture/redis.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,6DAAuG;AAA9F,qHAAA,0BAA0B,OAAA;AAAE,iHAAA,sBAAsB,OAAA"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Capture-mode cassette store accessor. Allows hooks to write NDJSON records
3
- * without coupling them to init. Design §10: payloads written via single-threaded queue.
4
- * HTTP outbound capture is done solely via the MSW interceptor (replay/http.ts).
5
- */
6
- import type { CassetteStore } from '../store/cassette-store';
7
- /** Returns the current capture cassette store, if set (e.g. by init in capture mode). */
8
- export declare function getCaptureStore(): CassetteStore | undefined;
9
- /** Sets the capture cassette store (used by init or tests). */
10
- export declare function setCaptureStore(store: CassetteStore | undefined): void;
11
- //# sourceMappingURL=store-accessor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-accessor.d.ts","sourceRoot":"","sources":["../../src/capture/store-accessor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAI7D,yFAAyF;AACzF,wBAAgB,eAAe,IAAI,aAAa,GAAG,SAAS,CAE3D;AAED,+DAA+D;AAC/D,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAEtE"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- /**
3
- * Capture-mode cassette store accessor. Allows hooks to write NDJSON records
4
- * without coupling them to init. Design §10: payloads written via single-threaded queue.
5
- * HTTP outbound capture is done solely via the MSW interceptor (replay/http.ts).
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.getCaptureStore = getCaptureStore;
9
- exports.setCaptureStore = setCaptureStore;
10
- let captureStore;
11
- /** Returns the current capture cassette store, if set (e.g. by init in capture mode). */
12
- function getCaptureStore() {
13
- return captureStore;
14
- }
15
- /** Sets the capture cassette store (used by init or tests). */
16
- function setCaptureStore(store) {
17
- captureStore = store;
18
- }
19
- //# sourceMappingURL=store-accessor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-accessor.js","sourceRoot":"","sources":["../../src/capture/store-accessor.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAOH,0CAEC;AAGD,0CAEC;AAVD,IAAI,YAAuC,CAAC;AAE5C,yFAAyF;AACzF,SAAgB,eAAe;IAC7B,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,+DAA+D;AAC/D,SAAgB,eAAe,CAAC,KAAgC;IAC9D,YAAY,GAAG,KAAK,CAAC;AACvB,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Legacy compatibility re-export for HTTP stream tap helper.
3
- */
4
- export { tapReadableStream, type TapCaptured, type TapReadableStreamOptions, } from '../instrumentations/common/http/stream-tap';
5
- //# sourceMappingURL=stream-tap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-tap.d.ts","sourceRoot":"","sources":["../../src/capture/stream-tap.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,wBAAwB,GAC9B,MAAM,4CAA4C,CAAC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tapReadableStream = void 0;
4
- /**
5
- * Legacy compatibility re-export for HTTP stream tap helper.
6
- */
7
- var stream_tap_1 = require("../instrumentations/common/http/stream-tap");
8
- Object.defineProperty(exports, "tapReadableStream", { enumerable: true, get: function () { return stream_tap_1.tapReadableStream; } });
9
- //# sourceMappingURL=stream-tap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-tap.js","sourceRoot":"","sources":["../../src/capture/stream-tap.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yEAIoD;AAHlD,+GAAA,iBAAiB,OAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Legacy compatibility re-export for identifier helpers.
3
- */
4
- export { httpIdentifier, redisIdentifier, pgIdentifier } from './core/identifier';
5
- //# sourceMappingURL=identifier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../src/identifier.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pgIdentifier = exports.redisIdentifier = exports.httpIdentifier = void 0;
4
- /**
5
- * Legacy compatibility re-export for identifier helpers.
6
- */
7
- var identifier_1 = require("./core/identifier");
8
- Object.defineProperty(exports, "httpIdentifier", { enumerable: true, get: function () { return identifier_1.httpIdentifier; } });
9
- Object.defineProperty(exports, "redisIdentifier", { enumerable: true, get: function () { return identifier_1.redisIdentifier; } });
10
- Object.defineProperty(exports, "pgIdentifier", { enumerable: true, get: function () { return identifier_1.pgIdentifier; } });
11
- //# sourceMappingURL=identifier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identifier.js","sourceRoot":"","sources":["../src/identifier.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,gDAAkF;AAAzE,4GAAA,cAAc,OAAA;AAAE,6GAAA,eAAe,OAAA;AAAE,0GAAA,YAAY,OAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Legacy compatibility re-export for Express replay instrumentation.
3
- */
4
- export { activateReplayForContext } from '../instrumentations/express/replay';
5
- //# sourceMappingURL=express.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/replay/express.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.activateReplayForContext = void 0;
4
- /**
5
- * Legacy compatibility re-export for Express replay instrumentation.
6
- */
7
- var replay_1 = require("../instrumentations/express/replay");
8
- Object.defineProperty(exports, "activateReplayForContext", { enumerable: true, get: function () { return replay_1.activateReplayForContext; } });
9
- //# sourceMappingURL=express.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"express.js","sourceRoot":"","sources":["../../src/replay/express.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,6DAA8E;AAArE,kHAAA,wBAAwB,OAAA"}
@@ -1,41 +0,0 @@
1
- /**
2
- * Key extraction and candidate filtering for default matcher (design §7.3).
3
- * Derives { protocol, identifier } from a span; filters outbound records by key.
4
- */
5
- import type { MatcherFn, SoftprobeCassetteRecord } from '../types/schema';
6
- /** Key used for flat matching: protocol + identifier. */
7
- export type SpanKey = {
8
- protocol: 'postgres' | 'redis' | 'http';
9
- identifier: string;
10
- };
11
- /** Span-like with readable attributes (OTel Span or test span). */
12
- type ReadableSpan = {
13
- attributes?: Record<string, unknown>;
14
- } | undefined;
15
- /**
16
- * Extracts matching key from a span using PostgresSpan, RedisSpan, and HttpSpan.
17
- * Returns the first non-null fromSpan result as { protocol, identifier }; unknown span yields null.
18
- */
19
- export declare function extractKeyFromSpan(span: ReadableSpan): SpanKey | null;
20
- /**
21
- * Returns only outbound records whose protocol and identifier match the key.
22
- */
23
- export declare function filterOutboundCandidates(records: SoftprobeCassetteRecord[], key: SpanKey): SoftprobeCassetteRecord[];
24
- /**
25
- * Per-key call sequence for default matcher: tracks the next candidate index
26
- * per (protocol, identifier). getAndIncrement returns the current index and advances.
27
- */
28
- export declare class CallSeq {
29
- private next;
30
- /**
31
- * Returns the current index for this key and increments for the next call.
32
- */
33
- getAndIncrement(key: SpanKey): number;
34
- }
35
- /**
36
- * Returns a MatcherFn that uses extractKeyFromSpan, filterOutboundCandidates,
37
- * and CallSeq to pick an outbound record and return MOCK with its responsePayload.
38
- */
39
- export declare function createDefaultMatcher(): MatcherFn;
40
- export {};
41
- //# sourceMappingURL=extract-key.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract-key.d.ts","sourceRoot":"","sources":["../../src/replay/extract-key.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAEV,SAAS,EACT,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAKzB,yDAAyD;AACzD,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,mEAAmE;AACnE,KAAK,YAAY,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,SAAS,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,GAAG,IAAI,CAWrE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,uBAAuB,EAAE,EAClC,GAAG,EAAE,OAAO,GACX,uBAAuB,EAAE,CAO3B;AAMD;;;GAGG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,IAAI,CAA6B;IAEzC;;OAEG;IACH,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;CAMtC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,SAAS,CAYhD"}