@ondc/automation-mock-runner 1.3.7 → 1.3.8

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.
@@ -76,16 +76,40 @@ function convertToFlowConfig(config) {
76
76
  for (const step of config.steps) {
77
77
  const pair = config.steps.find((s) => s.responseFor === step.action_id)?.action_id ||
78
78
  null;
79
- const flowStep = {
80
- key: step.action_id,
81
- type: step.api,
82
- owner: step.owner,
83
- description: step.description || "",
84
- expect: index === 0 ? true : false,
85
- unsolicited: step.unsolicited,
86
- pair: pair,
87
- repeat: step.repeatCount || 1,
88
- };
79
+ let flowStep = {};
80
+ if (step.api === "dynamic_form") {
81
+ flowStep = {
82
+ key: step.action_id,
83
+ type: "DYNAMIC_FORM",
84
+ owner: step.owner,
85
+ description: step.description || "",
86
+ label: step.description || "FORM",
87
+ unsolicited: step.unsolicited,
88
+ pair: pair,
89
+ repeat: step.repeatCount || 1,
90
+ input: [
91
+ {
92
+ name: "form_submission_id",
93
+ label: "Enter form submission ID",
94
+ type: "DYNAMIC_FORM",
95
+ payloadField: "form_submission_id",
96
+ reference: `$.reference_data.${step.action_id}`,
97
+ },
98
+ ],
99
+ };
100
+ }
101
+ else {
102
+ flowStep = {
103
+ key: step.action_id,
104
+ type: step.api,
105
+ owner: step.owner,
106
+ description: step.description || "",
107
+ expect: index === 0 ? true : false,
108
+ unsolicited: step.unsolicited,
109
+ pair: pair,
110
+ repeat: step.repeatCount || 1,
111
+ };
112
+ }
89
113
  if (step.mock.inputs !== undefined &&
90
114
  step.mock.inputs !== null &&
91
115
  Object.keys(step.mock.inputs).length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ondc/automation-mock-runner",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "A TypeScript library for ONDC automation mock runner",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",