@ondc/automation-mock-runner 1.3.33 → 1.3.34

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.
@@ -258,6 +258,7 @@ async function buildConfigFromFlowConfig(payloads, flowConfig, domain, version,
258
258
  }
259
259
  else {
260
260
  stepConfig.mock.inputs.oldInputs = step.input;
261
+ stepConfig.mock.inputs.id = `old_inputs`;
261
262
  }
262
263
  }
263
264
  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.34",
4
4
  "description": "A TypeScript library for ONDC automation mock runner",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",