@ondc/automation-mock-runner 1.3.36 → 1.3.37

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.
@@ -257,7 +257,7 @@ async function buildConfigFromFlowConfig(payloads, flowConfig, domain, version,
257
257
  if (step.input && step.input.length > 0 && step.input[0].jsonSchema) {
258
258
  stepConfig.mock.inputs = step.input[0];
259
259
  }
260
- else {
260
+ else if (step.input && step.input.length > 0) {
261
261
  stepConfig.mock.inputs.oldInputs = step.input;
262
262
  stepConfig.mock.inputs.id = `old_inputs`;
263
263
  }
@@ -35,12 +35,13 @@ function validateGoodConfig(config) {
35
35
  continue;
36
36
  }
37
37
  if (step.mock.inputs !== undefined &&
38
+ step.mock.inputs.oldInputs === undefined &&
38
39
  Object.keys(step.mock.inputs).length > 0) {
39
40
  if (id === undefined || id === null) {
40
41
  errors.push(` • ${label}: inputs.id is required when inputs is defined`);
41
42
  }
42
43
  }
43
- if (id !== undefined) {
44
+ if (id !== undefined && step.mock.inputs.oldInputs === undefined) {
44
45
  if (sampleData === undefined || sampleData === null) {
45
46
  errors.push(` • ${label}: inputs.sampleData is required when inputs.id is set`);
46
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ondc/automation-mock-runner",
3
- "version": "1.3.36",
3
+ "version": "1.3.37",
4
4
  "description": "A TypeScript library for ONDC automation mock runner",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",