@ondc/automation-mock-runner 1.3.33 → 1.3.35

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.
@@ -241,6 +241,7 @@ async function buildConfigFromFlowConfig(payloads, flowConfig, domain, version,
241
241
  // HTML_FORM is not yet fully implemented — fall back to dynamic_form default
242
242
  stepConfig = mockRunner.getDefaultStep(step.type, step.key, "dynamic_form");
243
243
  stepConfig.mock.inputs.oldInputs = step.input;
244
+ stepConfig.owner = step.owner;
244
245
  }
245
246
  else {
246
247
  stepConfig = mockRunner.getDefaultStep(step.type, step.key);
@@ -258,6 +259,7 @@ async function buildConfigFromFlowConfig(payloads, flowConfig, domain, version,
258
259
  }
259
260
  else {
260
261
  stepConfig.mock.inputs.oldInputs = step.input;
262
+ stepConfig.mock.inputs.id = `old_inputs`;
261
263
  }
262
264
  }
263
265
  const stepPayloadIndex = payloads.findIndex((p) => p.context.action === step.type);
@@ -27,9 +27,13 @@ function validateGoodConfig(config) {
27
27
  const errors = [];
28
28
  // 2. inputs validation
29
29
  const ajv = new ajv_1.default();
30
- config.steps.forEach((step, index) => {
30
+ for (let index = 0; index < config.steps.length; index++) {
31
+ const step = config.steps[index];
31
32
  const { id, sampleData, jsonSchema } = step.mock.inputs;
32
33
  const label = `steps[${index}] (action_id: "${step.action_id}")`;
34
+ if (step.mock.inputs.oldInputs) {
35
+ continue;
36
+ }
33
37
  if (step.mock.inputs !== undefined &&
34
38
  Object.keys(step.mock.inputs).length > 0) {
35
39
  if (id === undefined || id === null) {
@@ -52,7 +56,7 @@ function validateGoodConfig(config) {
52
56
  });
53
57
  }
54
58
  }
55
- });
59
+ }
56
60
  if (errors.length > 0) {
57
61
  throw new errors_1.ValidationError(`Config validation failed — ${errors.length} error(s):\n\n${errors.join("\n")}\n`, errors, { flowId: config.meta.flowId });
58
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ondc/automation-mock-runner",
3
- "version": "1.3.33",
3
+ "version": "1.3.35",
4
4
  "description": "A TypeScript library for ONDC automation mock runner",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",