@softprobe/softprobe-js 2.0.4 → 2.0.6

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 (130) 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-path.d.ts +16 -0
  16. package/dist/instrumentations/common/http/inbound-path.d.ts.map +1 -0
  17. package/dist/instrumentations/common/http/inbound-path.js +33 -0
  18. package/dist/instrumentations/common/http/inbound-path.js.map +1 -0
  19. package/dist/instrumentations/common/http/inbound-record.d.ts +4 -0
  20. package/dist/instrumentations/common/http/inbound-record.d.ts.map +1 -1
  21. package/dist/instrumentations/common/http/inbound-record.js +8 -4
  22. package/dist/instrumentations/common/http/inbound-record.js.map +1 -1
  23. package/dist/instrumentations/express/capture.d.ts +9 -6
  24. package/dist/instrumentations/express/capture.d.ts.map +1 -1
  25. package/dist/instrumentations/express/capture.js +4 -1
  26. package/dist/instrumentations/express/capture.js.map +1 -1
  27. package/dist/instrumentations/fastify/capture.d.ts.map +1 -1
  28. package/dist/instrumentations/fastify/capture.js +2 -1
  29. package/dist/instrumentations/fastify/capture.js.map +1 -1
  30. package/package.json +3 -2
  31. package/dist/bindings/http-span.d.ts +0 -6
  32. package/dist/bindings/http-span.d.ts.map +0 -1
  33. package/dist/bindings/http-span.js +0 -11
  34. package/dist/bindings/http-span.js.map +0 -1
  35. package/dist/bindings/postgres-span.d.ts +0 -6
  36. package/dist/bindings/postgres-span.d.ts.map +0 -1
  37. package/dist/bindings/postgres-span.js +0 -11
  38. package/dist/bindings/postgres-span.js.map +0 -1
  39. package/dist/bindings/redis-span.d.ts +0 -6
  40. package/dist/bindings/redis-span.d.ts.map +0 -1
  41. package/dist/bindings/redis-span.js +0 -11
  42. package/dist/bindings/redis-span.js.map +0 -1
  43. package/dist/bindings/test-span.d.ts +0 -6
  44. package/dist/bindings/test-span.d.ts.map +0 -1
  45. package/dist/bindings/test-span.js +0 -9
  46. package/dist/bindings/test-span.js.map +0 -1
  47. package/dist/capture/express.d.ts +0 -6
  48. package/dist/capture/express.d.ts.map +0 -1
  49. package/dist/capture/express.js +0 -11
  50. package/dist/capture/express.js.map +0 -1
  51. package/dist/capture/fastify.d.ts +0 -5
  52. package/dist/capture/fastify.d.ts.map +0 -1
  53. package/dist/capture/fastify.js +0 -9
  54. package/dist/capture/fastify.js.map +0 -1
  55. package/dist/capture/framework-mutator.d.ts +0 -20
  56. package/dist/capture/framework-mutator.d.ts.map +0 -1
  57. package/dist/capture/framework-mutator.js +0 -144
  58. package/dist/capture/framework-mutator.js.map +0 -1
  59. package/dist/capture/http-inbound.d.ts +0 -28
  60. package/dist/capture/http-inbound.d.ts.map +0 -1
  61. package/dist/capture/http-inbound.js +0 -40
  62. package/dist/capture/http-inbound.js.map +0 -1
  63. package/dist/capture/inject.d.ts +0 -17
  64. package/dist/capture/inject.d.ts.map +0 -1
  65. package/dist/capture/inject.js +0 -28
  66. package/dist/capture/inject.js.map +0 -1
  67. package/dist/capture/mutator.d.ts +0 -17
  68. package/dist/capture/mutator.d.ts.map +0 -1
  69. package/dist/capture/mutator.js +0 -51
  70. package/dist/capture/mutator.js.map +0 -1
  71. package/dist/capture/postgres.d.ts +0 -6
  72. package/dist/capture/postgres.d.ts.map +0 -1
  73. package/dist/capture/postgres.js +0 -11
  74. package/dist/capture/postgres.js.map +0 -1
  75. package/dist/capture/redis.d.ts +0 -5
  76. package/dist/capture/redis.d.ts.map +0 -1
  77. package/dist/capture/redis.js +0 -10
  78. package/dist/capture/redis.js.map +0 -1
  79. package/dist/capture/store-accessor.d.ts +0 -11
  80. package/dist/capture/store-accessor.d.ts.map +0 -1
  81. package/dist/capture/store-accessor.js +0 -19
  82. package/dist/capture/store-accessor.js.map +0 -1
  83. package/dist/capture/stream-tap.d.ts +0 -5
  84. package/dist/capture/stream-tap.d.ts.map +0 -1
  85. package/dist/capture/stream-tap.js +0 -9
  86. package/dist/capture/stream-tap.js.map +0 -1
  87. package/dist/identifier.d.ts +0 -5
  88. package/dist/identifier.d.ts.map +0 -1
  89. package/dist/identifier.js +0 -11
  90. package/dist/identifier.js.map +0 -1
  91. package/dist/replay/express.d.ts +0 -5
  92. package/dist/replay/express.d.ts.map +0 -1
  93. package/dist/replay/express.js +0 -9
  94. package/dist/replay/express.js.map +0 -1
  95. package/dist/replay/extract-key.d.ts +0 -41
  96. package/dist/replay/extract-key.d.ts.map +0 -1
  97. package/dist/replay/extract-key.js +0 -80
  98. package/dist/replay/extract-key.js.map +0 -1
  99. package/dist/replay/fastify.d.ts +0 -5
  100. package/dist/replay/fastify.d.ts.map +0 -1
  101. package/dist/replay/fastify.js +0 -9
  102. package/dist/replay/fastify.js.map +0 -1
  103. package/dist/replay/http.d.ts +0 -5
  104. package/dist/replay/http.d.ts.map +0 -1
  105. package/dist/replay/http.js +0 -10
  106. package/dist/replay/http.js.map +0 -1
  107. package/dist/replay/matcher.d.ts +0 -25
  108. package/dist/replay/matcher.d.ts.map +0 -1
  109. package/dist/replay/matcher.js +0 -83
  110. package/dist/replay/matcher.js.map +0 -1
  111. package/dist/replay/postgres.d.ts +0 -5
  112. package/dist/replay/postgres.d.ts.map +0 -1
  113. package/dist/replay/postgres.js +0 -10
  114. package/dist/replay/postgres.js.map +0 -1
  115. package/dist/replay/redis.d.ts +0 -5
  116. package/dist/replay/redis.d.ts.map +0 -1
  117. package/dist/replay/redis.js +0 -10
  118. package/dist/replay/redis.js.map +0 -1
  119. package/dist/replay/softprobe-matcher.d.ts +0 -41
  120. package/dist/replay/softprobe-matcher.d.ts.map +0 -1
  121. package/dist/replay/softprobe-matcher.js +0 -92
  122. package/dist/replay/softprobe-matcher.js.map +0 -1
  123. package/dist/replay/store-accessor.d.ts +0 -14
  124. package/dist/replay/store-accessor.d.ts.map +0 -1
  125. package/dist/replay/store-accessor.js +0 -26
  126. package/dist/replay/store-accessor.js.map +0 -1
  127. package/dist/replay/topology.d.ts +0 -37
  128. package/dist/replay/topology.d.ts.map +0 -1
  129. package/dist/replay/topology.js +0 -72
  130. package/dist/replay/topology.js.map +0 -1
@@ -1,72 +0,0 @@
1
- "use strict";
2
- /**
3
- * Topology-aware matching helpers (design §7.4).
4
- * Read live parent name; build bySpanId index; filter candidates; createTopologyMatcher.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getLiveParentName = getLiveParentName;
8
- exports.buildBySpanIdIndex = buildBySpanIdIndex;
9
- exports.filterCandidatesByKey = filterCandidatesByKey;
10
- exports.selectLineagePool = selectLineagePool;
11
- exports.createTopologyMatcher = createTopologyMatcher;
12
- const extract_key_1 = require("./extract-key");
13
- /**
14
- * Returns the live parent span name for topology matching.
15
- * If the span has _parentSpanName (set by instrumentation or tests), returns it; otherwise "root".
16
- */
17
- function getLiveParentName(span) {
18
- return span?._parentSpanName ?? 'root';
19
- }
20
- /**
21
- * Builds a map from spanId to record for lineage lookup (design §7.4).
22
- * Enables looking up a record's parent via bySpanId.get(record.parentSpanId).
23
- */
24
- function buildBySpanIdIndex(records) {
25
- return new Map(records.map((r) => [r.spanId, r]));
26
- }
27
- /**
28
- * Filters records to outbound candidates matching protocol+identifier (design §7.4).
29
- * Same semantics as flat matcher's filterOutboundCandidates.
30
- */
31
- function filterCandidatesByKey(records, key) {
32
- return (0, extract_key_1.filterOutboundCandidates)(records, key);
33
- }
34
- /**
35
- * Prefers candidates whose recorded parent spanName matches live parent (design §7.4).
36
- * Returns lineageMatches when non-empty, otherwise returns all candidates (fallback pool).
37
- */
38
- function selectLineagePool(candidates, bySpanId, liveParentName) {
39
- const lineageMatches = candidates.filter((c) => {
40
- if (!c.parentSpanId)
41
- return liveParentName === 'root';
42
- const parent = bySpanId.get(c.parentSpanId);
43
- return (parent?.spanName ?? 'root') === liveParentName;
44
- });
45
- return lineageMatches.length > 0 ? lineageMatches : candidates;
46
- }
47
- /**
48
- * Returns a MatcherFn that prefers candidates whose recorded parent spanName matches
49
- * the live parent, with per-(protocol, identifier, liveParentName) call sequencing (design §7.4).
50
- */
51
- function createTopologyMatcher() {
52
- const callSeq = new Map();
53
- return (span, records) => {
54
- const key = (0, extract_key_1.extractKeyFromSpan)(span);
55
- if (!key)
56
- return { action: 'CONTINUE' };
57
- const liveParentName = getLiveParentName(span);
58
- const candidates = filterCandidatesByKey(records, key);
59
- if (candidates.length === 0)
60
- return { action: 'CONTINUE' };
61
- const bySpanId = buildBySpanIdIndex(records);
62
- const pool = selectLineagePool(candidates, bySpanId, liveParentName);
63
- const seqKey = `${key.protocol}::${key.identifier}::${liveParentName}`;
64
- const n = callSeq.get(seqKey) ?? 0;
65
- const picked = pool[n];
66
- callSeq.set(seqKey, n + 1);
67
- if (!picked)
68
- return { action: 'CONTINUE' };
69
- return { action: 'MOCK', payload: picked.responsePayload };
70
- };
71
- }
72
- //# sourceMappingURL=topology.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"topology.js","sourceRoot":"","sources":["../../src/replay/topology.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAgBH,8CAEC;AAMD,gDAIC;AAMD,sDAKC;AAMD,8CAWC;AAMD,sDAsBC;AAjFD,+CAIuB;AAKvB;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,IAAoB;IACpD,OAAQ,IAAY,EAAE,eAAe,IAAI,MAAM,CAAC;AAClD,C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