callman-core 1.3.0 → 1.5.0

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 (139) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/scenario-runner/adapters/connection-config.d.ts +34 -0
  6. package/dist/scenario-runner/adapters/connection-config.d.ts.map +1 -0
  7. package/dist/scenario-runner/adapters/connection-config.js +6 -0
  8. package/dist/scenario-runner/adapters/connection-config.js.map +1 -0
  9. package/dist/scenario-runner/adapters/db-executor.d.ts +4 -0
  10. package/dist/scenario-runner/adapters/db-executor.d.ts.map +1 -0
  11. package/dist/scenario-runner/adapters/db-executor.js +42 -0
  12. package/dist/scenario-runner/adapters/db-executor.js.map +1 -0
  13. package/dist/scenario-runner/adapters/helpers/abort.d.ts +4 -0
  14. package/dist/scenario-runner/adapters/helpers/abort.d.ts.map +1 -0
  15. package/dist/scenario-runner/adapters/helpers/abort.js +47 -0
  16. package/dist/scenario-runner/adapters/helpers/abort.js.map +1 -0
  17. package/dist/scenario-runner/adapters/helpers/failure-messages.d.ts +29 -0
  18. package/dist/scenario-runner/adapters/helpers/failure-messages.d.ts.map +1 -0
  19. package/dist/scenario-runner/adapters/helpers/failure-messages.js +64 -0
  20. package/dist/scenario-runner/adapters/helpers/failure-messages.js.map +1 -0
  21. package/dist/scenario-runner/adapters/helpers/mutations.d.ts +7 -0
  22. package/dist/scenario-runner/adapters/helpers/mutations.d.ts.map +1 -0
  23. package/dist/scenario-runner/adapters/helpers/mutations.js +28 -0
  24. package/dist/scenario-runner/adapters/helpers/mutations.js.map +1 -0
  25. package/dist/scenario-runner/adapters/helpers/request-helpers.d.ts +31 -0
  26. package/dist/scenario-runner/adapters/helpers/request-helpers.d.ts.map +1 -0
  27. package/dist/scenario-runner/adapters/helpers/request-helpers.js +247 -0
  28. package/dist/scenario-runner/adapters/helpers/request-helpers.js.map +1 -0
  29. package/dist/scenario-runner/adapters/helpers/response-shapes.d.ts +3 -0
  30. package/dist/scenario-runner/adapters/helpers/response-shapes.d.ts.map +1 -0
  31. package/dist/scenario-runner/adapters/helpers/response-shapes.js +32 -0
  32. package/dist/scenario-runner/adapters/helpers/response-shapes.js.map +1 -0
  33. package/dist/scenario-runner/adapters/helpers/templates.d.ts +2 -0
  34. package/dist/scenario-runner/adapters/helpers/templates.d.ts.map +1 -0
  35. package/dist/scenario-runner/adapters/helpers/templates.js +30 -0
  36. package/dist/scenario-runner/adapters/helpers/templates.js.map +1 -0
  37. package/dist/scenario-runner/adapters/index.d.ts +12 -0
  38. package/dist/scenario-runner/adapters/index.d.ts.map +1 -0
  39. package/dist/scenario-runner/adapters/index.js +30 -0
  40. package/dist/scenario-runner/adapters/index.js.map +1 -0
  41. package/dist/scenario-runner/adapters/kafka-executor.d.ts +4 -0
  42. package/dist/scenario-runner/adapters/kafka-executor.d.ts.map +1 -0
  43. package/dist/scenario-runner/adapters/kafka-executor.js +35 -0
  44. package/dist/scenario-runner/adapters/kafka-executor.js.map +1 -0
  45. package/dist/scenario-runner/adapters/notification-executor.d.ts +4 -0
  46. package/dist/scenario-runner/adapters/notification-executor.d.ts.map +1 -0
  47. package/dist/scenario-runner/adapters/notification-executor.js +67 -0
  48. package/dist/scenario-runner/adapters/notification-executor.js.map +1 -0
  49. package/dist/scenario-runner/adapters/redis-executor.d.ts +4 -0
  50. package/dist/scenario-runner/adapters/redis-executor.d.ts.map +1 -0
  51. package/dist/scenario-runner/adapters/redis-executor.js +78 -0
  52. package/dist/scenario-runner/adapters/redis-executor.js.map +1 -0
  53. package/dist/scenario-runner/adapters/request-executor.d.ts +4 -0
  54. package/dist/scenario-runner/adapters/request-executor.d.ts.map +1 -0
  55. package/dist/scenario-runner/adapters/request-executor.js +262 -0
  56. package/dist/scenario-runner/adapters/request-executor.js.map +1 -0
  57. package/dist/scenario-runner/adapters/script-executor.d.ts +4 -0
  58. package/dist/scenario-runner/adapters/script-executor.d.ts.map +1 -0
  59. package/dist/scenario-runner/adapters/script-executor.js +113 -0
  60. package/dist/scenario-runner/adapters/script-executor.js.map +1 -0
  61. package/dist/scenario-runner/adapters/types.d.ts +82 -0
  62. package/dist/scenario-runner/adapters/types.d.ts.map +1 -0
  63. package/dist/scenario-runner/adapters/types.js +9 -0
  64. package/dist/scenario-runner/adapters/types.js.map +1 -0
  65. package/dist/scenario-runner/index.d.ts +1 -0
  66. package/dist/scenario-runner/index.d.ts.map +1 -1
  67. package/dist/scenario-runner/index.js +1 -0
  68. package/dist/scenario-runner/index.js.map +1 -1
  69. package/dist/templating/counter-store.d.ts +7 -0
  70. package/dist/templating/counter-store.d.ts.map +1 -0
  71. package/dist/templating/counter-store.js +64 -0
  72. package/dist/templating/counter-store.js.map +1 -0
  73. package/dist/templating/generator-metadata.d.ts +5 -0
  74. package/dist/templating/generator-metadata.d.ts.map +1 -0
  75. package/dist/templating/generator-metadata.js +102 -0
  76. package/dist/templating/generator-metadata.js.map +1 -0
  77. package/dist/templating/index.d.ts +6 -0
  78. package/dist/templating/index.d.ts.map +1 -0
  79. package/dist/templating/index.js +11 -0
  80. package/dist/templating/index.js.map +1 -0
  81. package/dist/templating/random-generators.d.ts +10 -0
  82. package/dist/templating/random-generators.d.ts.map +1 -0
  83. package/dist/templating/random-generators.js +16 -0
  84. package/dist/templating/random-generators.js.map +1 -0
  85. package/dist/templating/template-engine.d.ts +14 -0
  86. package/dist/templating/template-engine.d.ts.map +1 -0
  87. package/dist/templating/template-engine.js +148 -0
  88. package/dist/templating/template-engine.js.map +1 -0
  89. package/dist/templating/types.d.ts +22 -0
  90. package/dist/templating/types.d.ts.map +1 -0
  91. package/dist/templating/types.js +10 -0
  92. package/dist/templating/types.js.map +1 -0
  93. package/dist-cjs/index.js +2 -4
  94. package/dist-cjs/index.js.map +1 -1
  95. package/dist-cjs/scenario-runner/adapters/connection-config.js +7 -0
  96. package/dist-cjs/scenario-runner/adapters/connection-config.js.map +1 -0
  97. package/dist-cjs/scenario-runner/adapters/db-executor.js +46 -0
  98. package/dist-cjs/scenario-runner/adapters/db-executor.js.map +1 -0
  99. package/dist-cjs/scenario-runner/adapters/helpers/abort.js +52 -0
  100. package/dist-cjs/scenario-runner/adapters/helpers/abort.js.map +1 -0
  101. package/dist-cjs/scenario-runner/adapters/helpers/failure-messages.js +69 -0
  102. package/dist-cjs/scenario-runner/adapters/helpers/failure-messages.js.map +1 -0
  103. package/dist-cjs/scenario-runner/adapters/helpers/mutations.js +32 -0
  104. package/dist-cjs/scenario-runner/adapters/helpers/mutations.js.map +1 -0
  105. package/dist-cjs/scenario-runner/adapters/helpers/request-helpers.js +263 -0
  106. package/dist-cjs/scenario-runner/adapters/helpers/request-helpers.js.map +1 -0
  107. package/dist-cjs/scenario-runner/adapters/helpers/response-shapes.js +36 -0
  108. package/dist-cjs/scenario-runner/adapters/helpers/response-shapes.js.map +1 -0
  109. package/dist-cjs/scenario-runner/adapters/helpers/templates.js +34 -0
  110. package/dist-cjs/scenario-runner/adapters/helpers/templates.js.map +1 -0
  111. package/dist-cjs/scenario-runner/adapters/index.js +40 -0
  112. package/dist-cjs/scenario-runner/adapters/index.js.map +1 -0
  113. package/dist-cjs/scenario-runner/adapters/kafka-executor.js +39 -0
  114. package/dist-cjs/scenario-runner/adapters/kafka-executor.js.map +1 -0
  115. package/dist-cjs/scenario-runner/adapters/notification-executor.js +71 -0
  116. package/dist-cjs/scenario-runner/adapters/notification-executor.js.map +1 -0
  117. package/dist-cjs/scenario-runner/adapters/redis-executor.js +82 -0
  118. package/dist-cjs/scenario-runner/adapters/redis-executor.js.map +1 -0
  119. package/dist-cjs/scenario-runner/adapters/request-executor.js +266 -0
  120. package/dist-cjs/scenario-runner/adapters/request-executor.js.map +1 -0
  121. package/dist-cjs/scenario-runner/adapters/script-executor.js +117 -0
  122. package/dist-cjs/scenario-runner/adapters/script-executor.js.map +1 -0
  123. package/dist-cjs/scenario-runner/adapters/types.js +10 -0
  124. package/dist-cjs/scenario-runner/adapters/types.js.map +1 -0
  125. package/dist-cjs/scenario-runner/index.js +1 -0
  126. package/dist-cjs/scenario-runner/index.js.map +1 -1
  127. package/dist-cjs/templating/counter-store.js +72 -0
  128. package/dist-cjs/templating/counter-store.js.map +1 -0
  129. package/dist-cjs/templating/generator-metadata.js +105 -0
  130. package/dist-cjs/templating/generator-metadata.js.map +1 -0
  131. package/dist-cjs/templating/index.js +35 -0
  132. package/dist-cjs/templating/index.js.map +1 -0
  133. package/dist-cjs/templating/random-generators.js +28 -0
  134. package/dist-cjs/templating/random-generators.js.map +1 -0
  135. package/dist-cjs/templating/template-engine.js +155 -0
  136. package/dist-cjs/templating/template-engine.js.map +1 -0
  137. package/dist-cjs/templating/types.js +11 -0
  138. package/dist-cjs/templating/types.js.map +1 -0
  139. package/package.json +1 -1
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ // Canonical Redis executor — orchestrates a single Redis scenario node.
3
+ // Loops the resolved command list through the host-supplied
4
+ // `redisExecutor` driver, aggregates per-command outcomes, and unwraps
5
+ // to a single scalar result when the node has only one command.
6
+ //
7
+ // Host driver responsibilities:
8
+ // - establish the Redis client (host owns ioredis or equivalent)
9
+ // - run each command, capture timing + raw result
10
+ // - propagate connection-level errors as throws
11
+ // - close the client when done
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.buildRedisExecutor = void 0;
14
+ const abort_js_1 = require("./helpers/abort.js");
15
+ const stringifyRedisValue = (value) => {
16
+ if (value === null || value === undefined) {
17
+ return "";
18
+ }
19
+ if (typeof value === "string") {
20
+ return value;
21
+ }
22
+ if (typeof value === "number" || typeof value === "boolean") {
23
+ return String(value);
24
+ }
25
+ try {
26
+ return JSON.stringify(value);
27
+ }
28
+ catch {
29
+ return String(value);
30
+ }
31
+ };
32
+ const buildRedisExecutor = (options) => async (input) => {
33
+ if (!input.resolvedCommands.length) {
34
+ return {
35
+ commandResults: [],
36
+ redisResult: null,
37
+ outputData: null,
38
+ failureMessage: "Redis node has no executable commands.",
39
+ };
40
+ }
41
+ const connection = await options.resolveConnection(input.node.data.config.connectionId);
42
+ const commandResults = [];
43
+ try {
44
+ const driverResults = await (0, abort_js_1.withAbortAndTimeout)(options.drivers.redisExecutor({
45
+ connection,
46
+ resolvedCommands: input.resolvedCommands,
47
+ }), options.nodeTimeoutMs, `Redis node ${input.stepId}`, input.signal);
48
+ for (const outcome of driverResults) {
49
+ commandResults.push({
50
+ success: true,
51
+ result: outcome.result,
52
+ resultText: stringifyRedisValue(outcome.result),
53
+ });
54
+ }
55
+ const redisResult = commandResults.length === 1
56
+ ? commandResults[0]?.result ?? null
57
+ : commandResults.map((entry) => entry.result);
58
+ return {
59
+ commandResults,
60
+ redisResult,
61
+ outputData: redisResult,
62
+ failureMessage: null,
63
+ };
64
+ }
65
+ catch (error) {
66
+ const message = error instanceof Error ? error.message : String(error);
67
+ commandResults.push({
68
+ success: false,
69
+ result: null,
70
+ resultText: "",
71
+ error: message,
72
+ });
73
+ return {
74
+ commandResults,
75
+ redisResult: null,
76
+ outputData: { commands: commandResults },
77
+ failureMessage: message || "Redis command failed.",
78
+ };
79
+ }
80
+ };
81
+ exports.buildRedisExecutor = buildRedisExecutor;
82
+ //# sourceMappingURL=redis-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis-executor.js","sourceRoot":"","sources":["../../../src/scenario-runner/adapters/redis-executor.ts"],"names":[],"mappings":";AAAA,wEAAwE;AACxE,4DAA4D;AAC5D,uEAAuE;AACvE,gEAAgE;AAChE,EAAE;AACF,gCAAgC;AAChC,mEAAmE;AACnE,oDAAoD;AACpD,kDAAkD;AAClD,iCAAiC;;;AAQjC,iDAAyD;AAGzD,MAAM,mBAAmB,GAAG,CAAC,KAAc,EAAU,EAAE;IACrD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,KAAK,KAAK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BAAmB,CAAC,OAAO,CAAC,MAAM,CAAC;aAChD,CAAC,CAAC;QACL,CAAC;QAED,MAAM,WAAW,GACf,cAAc,CAAC,MAAM,KAAK,CAAC;YACzB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,IAAI;YACnC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAElD,OAAO;YACL,cAAc;YACd,WAAW;YACX,UAAU,EAAE,WAAW;YACvB,cAAc,EAAE,IAAI;SACrB,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,cAAc,CAAC,IAAI,CAAC;YAClB,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,EAAE;YACd,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;QACH,OAAO;YACL,cAAc;YACd,WAAW,EAAE,IAAI;YACjB,UAAU,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE;YACxC,cAAc,EAAE,OAAO,IAAI,uBAAuB;SACnD,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AA7DS,QAAA,kBAAkB,sBA6D3B"}
@@ -0,0 +1,266 @@
1
+ "use strict";
2
+ // Canonical request executor — orchestrates a single Request scenario node:
3
+ // 1. (optional) pre-request script → mutate environment/globals/request
4
+ // 2. resolve auth + templates + body → executable shape
5
+ // 3. (optional) Kafka prefetch — start consumer, run HTTP, capture matched message
6
+ // 4. fall through to plain HTTP when no prefetch is configured
7
+ // 5. (optional) post-response script → mutate env/globals
8
+ // 6. (optional) tests script → collect test results, mutate env/globals
9
+ // 7. validate contract assertions
10
+ // 8. assemble failure message + return ScenarioRequestExecutionResult
11
+ //
12
+ // Driver injection point: `httpExecutor` and `kafkaExecutor`. Everything
13
+ // else (script execution, contract validation, template resolution) uses
14
+ // canonical core utilities.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.buildRequestExecutor = void 0;
17
+ const templateResolver_js_1 = require("../templateResolver.js");
18
+ const contractValidator_js_1 = require("../../contract/contractValidator.js");
19
+ const abort_js_1 = require("./helpers/abort.js");
20
+ const failure_messages_js_1 = require("./helpers/failure-messages.js");
21
+ const mutations_js_1 = require("./helpers/mutations.js");
22
+ const response_shapes_js_1 = require("./helpers/response-shapes.js");
23
+ const request_helpers_js_1 = require("./helpers/request-helpers.js");
24
+ const buildBodyResolverHelpers = () => ({
25
+ replaceScenarioTemplateTokensForJsonValidation: templateResolver_js_1.replaceScenarioTemplateTokensForJsonValidation,
26
+ resolveScenarioJsonTemplateString: templateResolver_js_1.resolveScenarioJsonTemplateString,
27
+ resolveScenarioTemplateString: templateResolver_js_1.resolveScenarioTemplateString,
28
+ });
29
+ const httpResultToExecuteRequestResult = (http) => ({
30
+ status: http.status,
31
+ data: http.data,
32
+ headers: http.headers,
33
+ duration: http.duration,
34
+ });
35
+ const buildRequestExecutor = (options) => async (input) => {
36
+ // We can't directly call the canonical scriptExecutor from here —
37
+ // it lives on the same factory result and may be the host's override.
38
+ // Instead, we receive it via closure when the factory wires up.
39
+ // For now, we depend on the host's `scriptExecutor` being supplied
40
+ // via options so request-stage scripts run through whatever sandbox
41
+ // the host configured.
42
+ //
43
+ // Note: the script executor in this orchestration path runs *request
44
+ // stage* scripts (pre-request / post-response / tests). The default
45
+ // implementation in script-executor.ts knows how to dispatch to the
46
+ // canonical sandbox; hosts that want to customize override it.
47
+ const requestState = (0, request_helpers_js_1.createRequestStateFromNode)(input.node);
48
+ const scopes = {
49
+ environment: { ...input.context.environment },
50
+ globals: { ...input.context.globals },
51
+ };
52
+ let currentRequestState = requestState;
53
+ const runRequestStageScript = async (stage, script, response) => {
54
+ // The host's scriptExecutor adapter handles request-stage scripts
55
+ // when it receives a payload with `stage !== "script"`. We delegate
56
+ // through the same adapter shape that runScenario uses so behavior
57
+ // matches the script-only flow exactly.
58
+ const scriptResult = await invokeRequestStageScript(options, {
59
+ stage,
60
+ script,
61
+ timeoutMs: options.scriptTimeoutMs,
62
+ request: currentRequestState,
63
+ response: response
64
+ ? (0, request_helpers_js_1.toRequestScriptResponse)(response)
65
+ : null,
66
+ environment: scopes.environment,
67
+ globals: scopes.globals,
68
+ workflowContext: input.context.workflowContext,
69
+ nodeMetaByLabel: input.context.nodeMetaByLabel,
70
+ });
71
+ if (scriptResult.request) {
72
+ currentRequestState = scriptResult.request;
73
+ }
74
+ (0, mutations_js_1.applyVariableMutations)(scopes, scriptResult.variableMutations);
75
+ return scriptResult;
76
+ };
77
+ // 1. Pre-request script ------------------------------------------------
78
+ if (input.node.data.config.preRequestScript?.trim()) {
79
+ const preResult = await runRequestStageScript("pre-request", input.node.data.config.preRequestScript, null);
80
+ if (preResult.error) {
81
+ const failureResponse = (0, request_helpers_js_1.toRequestResponse)((0, request_helpers_js_1.normalizeExecuteRequestFailure)(preResult.error.message));
82
+ return {
83
+ cancelled: false,
84
+ response: failureResponse,
85
+ responseRoot: null,
86
+ environment: scopes.environment,
87
+ globals: scopes.globals,
88
+ outputData: null,
89
+ testResults: preResult.testResults,
90
+ contractResults: [],
91
+ contractSummary: null,
92
+ contractValidationError: null,
93
+ dbAssertionResults: [],
94
+ redisAssertionResults: [],
95
+ prefetchedKafkaResults: [],
96
+ failureMessage: `Pre-request script failed: ${preResult.error.message}`,
97
+ };
98
+ }
99
+ }
100
+ // 2. Resolve templates + auth + body ----------------------------------
101
+ const templateValues = (0, templateResolver_js_1.buildScenarioTemplateValues)({
102
+ environment: scopes.environment,
103
+ globals: scopes.globals,
104
+ workflowContext: input.context.workflowContext,
105
+ nodeMetaByLabel: input.context.nodeMetaByLabel,
106
+ responseRoot: input.context.responseRoot,
107
+ dbResult: input.context.dbResult,
108
+ kafkaEvent: input.context.kafkaEvent,
109
+ redisResult: input.context.redisResult,
110
+ });
111
+ const runtimeRequest = (0, request_helpers_js_1.normalizeRequestForExecution)(currentRequestState, input.node.data.config.auth, buildBodyResolverHelpers(), templateValues);
112
+ // 3+4. Execute the HTTP call (with optional Kafka prefetch) -----------
113
+ const requestTimeoutMs = options.requestTimeoutMs;
114
+ const runHttp = async () => {
115
+ try {
116
+ const httpResult = await (0, abort_js_1.withAbortAndTimeout)(options.drivers.httpExecutor({
117
+ method: runtimeRequest.method,
118
+ url: runtimeRequest.url,
119
+ headers: runtimeRequest.headers,
120
+ query: runtimeRequest.query,
121
+ body: runtimeRequest.body,
122
+ timeoutMs: requestTimeoutMs,
123
+ }), requestTimeoutMs, `Request node ${input.stepId}`, input.signal);
124
+ return httpResultToExecuteRequestResult(httpResult);
125
+ }
126
+ catch (error) {
127
+ return (0, request_helpers_js_1.normalizeExecuteRequestFailure)(error);
128
+ }
129
+ };
130
+ let executionResult;
131
+ let prefetchedKafkaResults = [];
132
+ const transientCapture = input.kafkaCapturePlans.length === 1 ? input.kafkaCapturePlans[0] ?? null : null;
133
+ if (transientCapture?.connectionId && transientCapture.topic.trim()) {
134
+ try {
135
+ const kafkaConnection = await options.resolveConnection(transientCapture.connectionId);
136
+ const captureResult = await options.drivers.kafkaExecutor({
137
+ connection: kafkaConnection,
138
+ topic: transientCapture.topic.trim(),
139
+ matcher: null,
140
+ timeoutMs: options.nodeTimeoutMs,
141
+ operation: async () => {
142
+ const er = await runHttp();
143
+ return {
144
+ status: er.status,
145
+ headers: er.headers,
146
+ data: er.data,
147
+ duration: er.duration,
148
+ };
149
+ },
150
+ });
151
+ executionResult = captureResult.operationResult
152
+ ? httpResultToExecuteRequestResult(captureResult.operationResult)
153
+ : await runHttp();
154
+ prefetchedKafkaResults = input.kafkaCapturePlans.map((plan) => ({
155
+ stepId: plan.stepId,
156
+ result: captureResult.capture,
157
+ }));
158
+ }
159
+ catch {
160
+ // Kafka prefetch setup failed — fall through to plain HTTP.
161
+ // Backend's existing behavior is to silently degrade and rely
162
+ // on a separate kafka node (if any) to report the issue.
163
+ executionResult = await runHttp();
164
+ }
165
+ }
166
+ else {
167
+ executionResult = await runHttp();
168
+ }
169
+ const response = (0, request_helpers_js_1.toRequestResponse)(executionResult);
170
+ const combinedTestResults = [];
171
+ // 5. Post-response script ---------------------------------------------
172
+ let postResponseError = null;
173
+ if (input.node.data.config.postResponseScript?.trim()) {
174
+ const postResult = await runRequestStageScript("post-response", input.node.data.config.postResponseScript, response);
175
+ combinedTestResults.push(...postResult.testResults);
176
+ if (postResult.error) {
177
+ postResponseError = { message: postResult.error.message };
178
+ }
179
+ }
180
+ // 6. Tests script -----------------------------------------------------
181
+ let testsError = null;
182
+ if (input.node.data.config.testsScript?.trim()) {
183
+ const testsResult = await runRequestStageScript("tests", input.node.data.config.testsScript, response);
184
+ combinedTestResults.push(...testsResult.testResults);
185
+ if (testsResult.error) {
186
+ testsError = { message: testsResult.error.message };
187
+ }
188
+ }
189
+ // 7. Contract validation ----------------------------------------------
190
+ const contractResults = (0, contractValidator_js_1.validateContracts)(input.node.data.config.contractAssertions ?? [], {
191
+ status: executionResult.status,
192
+ data: executionResult.data,
193
+ headers: executionResult.headers,
194
+ duration: executionResult.duration,
195
+ });
196
+ const contractCounts = (0, failure_messages_js_1.summarizeContractResults)(contractResults);
197
+ const contractSummary = {
198
+ total: contractCounts.total,
199
+ passed: contractCounts.passed,
200
+ failed: contractCounts.failed,
201
+ };
202
+ // 8. Failure message + return -----------------------------------------
203
+ const failureMessage = (0, failure_messages_js_1.buildRequestFailureMessage)({
204
+ response,
205
+ postResponseError,
206
+ testsError,
207
+ testResults: combinedTestResults,
208
+ contractResults,
209
+ });
210
+ const responseRoot = (0, response_shapes_js_1.buildResponseRoot)(response);
211
+ return {
212
+ cancelled: Boolean(input.signal?.aborted),
213
+ response,
214
+ responseRoot,
215
+ environment: scopes.environment,
216
+ globals: scopes.globals,
217
+ outputData: responseRoot,
218
+ testResults: combinedTestResults,
219
+ contractResults,
220
+ contractSummary,
221
+ contractValidationError: null,
222
+ dbAssertionResults: [],
223
+ redisAssertionResults: [],
224
+ prefetchedKafkaResults,
225
+ failureMessage,
226
+ };
227
+ };
228
+ exports.buildRequestExecutor = buildRequestExecutor;
229
+ // ---------------------------------------------------------------------
230
+ // Request-stage script invocation. The host supplies a script executor
231
+ // either as `options.scriptExecutor` (which handles the standalone
232
+ // "script" stage from runScenario) or via the dedicated request-stage
233
+ // hook below. Default routes to the canonical executeScript with the
234
+ // "stage" capability set so pre/post/test scripts get the request +
235
+ // response surface they expect.
236
+ // ---------------------------------------------------------------------
237
+ const executor_js_1 = require("../../script/executor.js");
238
+ const invokeRequestStageScript = async (options, input) => {
239
+ // Hosts can swap the request-stage script behavior by overriding
240
+ // `scriptExecutor` and inspecting the input to dispatch to their own
241
+ // pre/post/tests handler. In this default path we go directly to the
242
+ // canonical sandbox.
243
+ const result = await (0, executor_js_1.executeScript)({
244
+ script: input.script,
245
+ timeoutMs: input.timeoutMs,
246
+ filename: "callman-request.script.js",
247
+ stage: input.stage,
248
+ capabilities: {
249
+ environment: { values: input.environment, emitMutations: true },
250
+ globals: { values: input.globals, emitMutations: true },
251
+ request: input.request,
252
+ response: input.response ?? undefined,
253
+ workflowContext: input.workflowContext,
254
+ nodeMetaByLabel: input.nodeMetaByLabel,
255
+ exposeLabelsAsGlobals: true,
256
+ extensions: { log: true, node: true },
257
+ },
258
+ });
259
+ return {
260
+ request: result.request,
261
+ variableMutations: result.variableMutations,
262
+ testResults: result.testResults,
263
+ error: result.error,
264
+ };
265
+ };
266
+ //# sourceMappingURL=request-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-executor.js","sourceRoot":"","sources":["../../../src/scenario-runner/adapters/request-executor.ts"],"names":[],"mappings":";AAAA,4EAA4E;AAC5E,0EAA0E;AAC1E,0DAA0D;AAC1D,qFAAqF;AACrF,iEAAiE;AACjE,4DAA4D;AAC5D,0EAA0E;AAC1E,oCAAoC;AACpC,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E,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;SACtC;KACF,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,WAAW,EAAE,MAAM,CAAC,WAAiC;QACrD,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ // Canonical script executor — orchestrates a standalone Script scenario
3
+ // node. Wraps callman-core's `executeScript` with scenario-specific
4
+ // input mapping + post-processing:
5
+ // - mutation values get template-resolved against the live runtime
6
+ // scope (so `pm.environment.set("token", "{{response.data.token}}")`
7
+ // works even though the script sandbox doesn't see the runtime
8
+ // scope directly)
9
+ // - return value gets deep template-resolved
10
+ // - failed pm.test entries surface in `failureMessage` for the runner
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.buildScriptExecutor = void 0;
13
+ const templateResolver_js_1 = require("../templateResolver.js");
14
+ const executor_js_1 = require("../../script/executor.js");
15
+ const abort_js_1 = require("./helpers/abort.js");
16
+ const templates_js_1 = require("./helpers/templates.js");
17
+ const toScenarioMutation = (mutation) => mutation.type === "set"
18
+ ? {
19
+ scope: mutation.scope,
20
+ type: "set",
21
+ key: mutation.key,
22
+ value: mutation.value,
23
+ }
24
+ : {
25
+ scope: mutation.scope,
26
+ type: "unset",
27
+ key: mutation.key,
28
+ };
29
+ const buildScriptExecutor = (options) => async (input) => {
30
+ const script = input.node.data.config.script;
31
+ const baseTimeoutMs = Math.min(options.nodeTimeoutMs, input.node.data.config.timeoutMs ?? options.scriptTimeoutMs);
32
+ if (!script.trim()) {
33
+ return {
34
+ variableMutations: [],
35
+ testResults: [],
36
+ logs: [],
37
+ error: {
38
+ stage: "script",
39
+ message: "Script node is empty.",
40
+ lineNumber: null,
41
+ column: null,
42
+ stack: null,
43
+ },
44
+ hasReturnValue: false,
45
+ returnValue: null,
46
+ outputData: null,
47
+ scriptSource: script,
48
+ timeoutMs: baseTimeoutMs,
49
+ failureMessage: "Script node is empty.",
50
+ };
51
+ }
52
+ const scriptResult = await (0, abort_js_1.withAbortAndTimeout)((0, executor_js_1.executeScript)({
53
+ script,
54
+ timeoutMs: baseTimeoutMs,
55
+ filename: "callman-scenario.script.js",
56
+ stage: "script",
57
+ capabilities: {
58
+ environment: { values: input.context.environment, emitMutations: true },
59
+ globals: { values: input.context.globals, emitMutations: true },
60
+ workflowContext: input.context.workflowContext,
61
+ nodeMetaByLabel: input.context.nodeMetaByLabel,
62
+ exposeLabelsAsGlobals: true,
63
+ extensions: { log: true, node: true },
64
+ },
65
+ }), baseTimeoutMs, `Script node ${input.stepId}`, input.signal);
66
+ // Templates may contain `{{...}}` tokens that reference live runtime
67
+ // values not available inside the sandbox (response.body, db.result,
68
+ // etc.). Resolve them against the current scenario runtime scope
69
+ // *after* the script returns so node consumers see substituted text.
70
+ const templateValues = (0, templateResolver_js_1.buildScenarioTemplateValues)({
71
+ environment: input.context.environment,
72
+ globals: input.context.globals,
73
+ workflowContext: input.context.workflowContext,
74
+ nodeMetaByLabel: input.context.nodeMetaByLabel,
75
+ responseRoot: input.context.responseRoot,
76
+ dbResult: input.context.dbResult,
77
+ kafkaEvent: input.context.kafkaEvent,
78
+ redisResult: input.context.redisResult,
79
+ });
80
+ const resolvedMutations = scriptResult.variableMutations.map((mutation) => mutation.type === "set" && typeof mutation.value === "string"
81
+ ? {
82
+ ...mutation,
83
+ value: (0, templateResolver_js_1.resolveScenarioTemplateString)(mutation.value, templateValues),
84
+ }
85
+ : mutation);
86
+ const resolvedReturnValue = scriptResult.hasReturnValue
87
+ ? (0, templates_js_1.resolveScenarioScriptTemplatesDeep)(scriptResult.returnValue, templateValues, templateResolver_js_1.resolveScenarioTemplateString)
88
+ : null;
89
+ const failedScriptTest = scriptResult.testResults.find((entry) => entry.status === "FAIL");
90
+ const failureMessage = scriptResult.error
91
+ ? scriptResult.error.message
92
+ : failedScriptTest
93
+ ? failedScriptTest.error
94
+ ? `Script test failed: ${failedScriptTest.name} (${failedScriptTest.error})`
95
+ : `Script test failed: ${failedScriptTest.name}`
96
+ : null;
97
+ return {
98
+ variableMutations: resolvedMutations.map(toScenarioMutation),
99
+ testResults: scriptResult.testResults,
100
+ logs: scriptResult.logs,
101
+ error: scriptResult.error,
102
+ hasReturnValue: scriptResult.hasReturnValue,
103
+ returnValue: resolvedReturnValue,
104
+ outputData: {
105
+ ...(scriptResult.hasReturnValue ? { returnValue: resolvedReturnValue } : {}),
106
+ testResults: scriptResult.testResults,
107
+ logs: scriptResult.logs,
108
+ variableMutations: resolvedMutations.map(toScenarioMutation),
109
+ error: scriptResult.error,
110
+ },
111
+ scriptSource: script,
112
+ timeoutMs: baseTimeoutMs,
113
+ failureMessage,
114
+ };
115
+ };
116
+ exports.buildScriptExecutor = buildScriptExecutor;
117
+ //# sourceMappingURL=script-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-executor.js","sourceRoot":"","sources":["../../../src/scenario-runner/adapters/script-executor.ts"],"names":[],"mappings":";AAAA,wEAAwE;AACxE,oEAAoE;AACpE,mCAAmC;AACnC,qEAAqE;AACrE,yEAAyE;AACzE,mEAAmE;AACnE,sBAAsB;AACtB,+CAA+C;AAC/C,wEAAwE;;;AAOxE,gEAAoG;AACpG,0DAAyD;AAGzD,iDAAyD;AACzD,yDAA4E;AAG5E,MAAM,kBAAkB,GAAG,CACzB,QAAgC,EACN,EAAE,CAC5B,QAAQ,CAAC,IAAI,KAAK,KAAK;IACrB,CAAC,CAAC;QACE,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,KAAK,EAAE,QAAQ,CAAC,KAAK;KACtB;IACH,CAAC,CAAC;QACE,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,QA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(host-injected I/O) and returns the canonical `ScenarioRuntimeAdapters`
4
+ // interface that `runScenario(...)` consumes.
5
+ //
6
+ // Connection shape (`ScenarioConnectionRuntime`) is intentionally generic
7
+ // — host-side types (Mongoose ObjectId, Postgres Pool, etc.) flatten into
8
+ // this shape at the resolver boundary so the core stays framework-agnostic.
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/scenario-runner/adapters/types.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,0EAA0E;AAC1E,8CAA8C;AAC9C,EAAE;AACF,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E"}
@@ -38,4 +38,5 @@ __exportStar(require("./waitNodeExecutor.js"), exports);
38
38
  __exportStar(require("./conditionTypes.js"), exports);
39
39
  __exportStar(require("./graphTraversal.js"), exports);
40
40
  __exportStar(require("./types.js"), exports);
41
+ __exportStar(require("./adapters/index.js"), exports);
41
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scenario-runner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAA+C;AAAtC,6GAAA,WAAW,OAAA;AACpB,6DAQ+B;AAP7B,kIAAA,2BAA2B,OAAA;AAC3B,kIAAA,2BAA2B,OAAA;AAC3B,oIAAA,6BAA6B,OAAA;AAC7B,iIAAA,0BAA0B,OAAA;AAC1B,qJAAA,8CAA8C,OAAA;AAC9C,wIAAA,iCAAiC,OAAA;AACjC,oIAAA,6BAA6B,OAAA;AAE/B,iEAAiE;AACjE,qEAAqE;AACrE,uEAAuE;AACvE,uEAAuE;AACvE,iCAAiC;AACjC,iDAA+B;AAC/B,oDAGiC;AAF/B,4HAAA,gCAAgC,OAAA;AAChC,sHAAA,0BAA0B,OAAA;AAE5B,wDAAsC;AACtC,sDAAoC;AACpC,sDAAoC;AACpC,6CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scenario-runner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAA+C;AAAtC,6GAAA,WAAW,OAAA;AACpB,6DAQ+B;AAP7B,kIAAA,2BAA2B,OAAA;AAC3B,kIAAA,2BAA2B,OAAA;AAC3B,oIAAA,6BAA6B,OAAA;AAC7B,iIAAA,0BAA0B,OAAA;AAC1B,qJAAA,8CAA8C,OAAA;AAC9C,wIAAA,iCAAiC,OAAA;AACjC,oIAAA,6BAA6B,OAAA;AAE/B,iEAAiE;AACjE,qEAAqE;AACrE,uEAAuE;AACvE,uEAAuE;AACvE,iCAAiC;AACjC,iDAA+B;AAC/B,oDAGiC;AAF/B,4HAAA,gCAAgC,OAAA;AAChC,sHAAA,0BAA0B,OAAA;AAE5B,wDAAsC;AACtC,sDAAoC;AACpC,sDAAoC;AACpC,6CAA2B;AAC3B,sDAAoC"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ // Counter store for the Postman-style template engine.
3
+ //
4
+ // Two access modes:
5
+ // 1. `createCounterStore()` — fresh instance with snapshot/hydrate API.
6
+ // Hosts that need explicit lifecycle control (electron Node singleton
7
+ // with IPC snapshot transfer to renderer) construct their own.
8
+ // 2. Module-level default singleton via `getNextCounterValue` /
9
+ // `getCounterSnapshot` / `hydrateCounterStore` — convenient default
10
+ // shared across calls in the same process.
11
+ //
12
+ // Both modes use identical advance semantics: `counter` and
13
+ // `counter.start:N` are independent keys; missing key returns the
14
+ // requested startAt; subsequent calls increment.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.hydrateCounterStore = exports.getCounterSnapshot = exports.resetCounterValue = exports.getNextCounterValue = exports.createCounterStore = void 0;
17
+ const advance = (store, key, startAt) => {
18
+ const normalizedStartAt = Number.isFinite(startAt) ? Math.trunc(startAt) : 1;
19
+ if (!store.has(key)) {
20
+ store.set(key, normalizedStartAt);
21
+ return normalizedStartAt;
22
+ }
23
+ const next = (store.get(key) ?? normalizedStartAt) + 1;
24
+ store.set(key, next);
25
+ return next;
26
+ };
27
+ const hydrateStore = (store, snapshot) => {
28
+ store.clear();
29
+ for (const entry of snapshot) {
30
+ if (!Array.isArray(entry) || entry.length !== 2) {
31
+ continue;
32
+ }
33
+ const [key, value] = entry;
34
+ const normalizedKey = String(key ?? "").trim();
35
+ const normalizedValue = Number(value);
36
+ if (!normalizedKey || !Number.isFinite(normalizedValue)) {
37
+ continue;
38
+ }
39
+ store.set(normalizedKey, Math.trunc(normalizedValue));
40
+ }
41
+ };
42
+ const createCounterStore = (initialSnapshot = []) => {
43
+ const store = new Map();
44
+ hydrateStore(store, initialSnapshot);
45
+ return {
46
+ getNextValue: (key, startAt = 1) => advance(store, key, startAt),
47
+ snapshot: () => Array.from(store.entries()),
48
+ hydrate: (snapshot) => hydrateStore(store, snapshot),
49
+ reset: (key) => {
50
+ if (key === undefined) {
51
+ store.clear();
52
+ return;
53
+ }
54
+ store.delete(key);
55
+ },
56
+ };
57
+ };
58
+ exports.createCounterStore = createCounterStore;
59
+ const defaultStore = (0, exports.createCounterStore)();
60
+ const getNextCounterValue = (key, startAt = 1) => defaultStore.getNextValue(key, startAt);
61
+ exports.getNextCounterValue = getNextCounterValue;
62
+ const resetCounterValue = (key) => {
63
+ defaultStore.reset(key);
64
+ };
65
+ exports.resetCounterValue = resetCounterValue;
66
+ const getCounterSnapshot = () => defaultStore.snapshot();
67
+ exports.getCounterSnapshot = getCounterSnapshot;
68
+ const hydrateCounterStore = (snapshot) => {
69
+ defaultStore.hydrate(snapshot);
70
+ };
71
+ exports.hydrateCounterStore = hydrateCounterStore;
72
+ //# sourceMappingURL=counter-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counter-store.js","sourceRoot":"","sources":["../../src/templating/counter-store.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,EAAE;AACF,oBAAoB;AACpB,0EAA0E;AAC1E,2EAA2E;AAC3E,oEAAoE;AACpE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