1{
2 "name": "ValidateOtp",
3 "entityCode": "0052",
4 "description": "Ability to capture and verify if the given input matches the response from an API or static value.",
5 "tag": [
6 {
7 "name": "usage",
8 "value": "Utility"
9 }
10 ],
11 "inputs": {
12 "type": "object",
13 "properties": {
14 "generationLogic": {
15 "title": "Logic for generation",
16 "description": "When do you want to generate the OTP.",
17 "type": "object",
18 "properties": {
19 "generateOnLoad": {
20 "title": "Generation on load",
21 "type": "boolean",
22 "description": "Generate OTP via FE device"
23 },
24 "api": {
25 "title": "API",
26 "type": "object",
27 "description": "Generation api",
28 "properties": {
29 "uri": {
30 "type": "string",
31 "title": "URI",
32 "description": "HTTP API url"
33 },
34 "timeout": {
35 "type": "number",
36 "title": "Timeout for API",
37 "description": "The time after which request will be canceled"
38 },
39 "httpMethod": {
40 "title": "HTTP Method",
41 "description": "HTTP Method",
42 "type": "string",
43 "enum": ["PUT", "POST", "GET"]
44 },
45 "headers": {
46 "type": "array",
47 "title": "Headers",
48 "description": "API headers",
49 "items": {
50 "type": "object",
51 "properties": {
52 "key": {
53 "type": "string",
54 "title": "Header key"
55 },
56 "value": {
57 "type": "string",
58 "title": "Header value"
59 }
60 }
61 }
62 },
63 "requestBody": {
64 "type": "object",
65 "title": "HTTP Request Body",
66 "description": "request body object"
67 },
68 "queryParams": {
69 "type": "array",
70 "title": "HTTP Query param",
71 "description": "Query param for request",
72 "items": {
73 "type": "object",
74 "properties": {
75 "key": {
76 "type": "string",
77 "title": "Query key"
78 },
79 "value": {
80 "type": "string",
81 "title": "Query value"
82 }
83 }
84 }
85 },
86 "pathParams": {
87 "type": "array",
88 "title": "HTTP Path param",
89 "description": "Path param for request",
90 "items": {
91 "type": "object",
92 "properties": {
93 "key": {
94 "type": "string",
95 "title": "Path key"
96 },
97 "value": {
98 "type": "string",
99 "title": "Path value"
100 }
101 }
102 }
103 },
104 "responseJsonLogic": {
105 "type": "object",
106 "title": "Response JSON logic",
107 "description": "Json path to extract the required output from API response"
108 },
109 "errorJsonLogic": {
110 "type": "object",
111 "title": "Error Json Logic",
112 "description": "Json path to extract the required error response"
113 }
114 },
115 "required": [
116 "uri",
117 "httpMethod",
118 "responseJsonLogic",
119 "errorJsonLogic"
120 ]
121 },
122 "enableRetry": {
123 "title": "Enable retry",
124 "type": "boolean",
125 "description": "Developers can use this attribute if they want to enable retries of the package delivery"
126 },
127 "retryConfig": {
128 "title": "Retry configuration",
129 "description": "Retry the OTP if enable retry is true.",
130 "type": "object",
131 "properties": {
132 "buttonTitle": {
133 "title": "Button Title",
134 "type": "string",
135 "description": "Button label"
136 },
137 "maxAttempt": {
138 "title": "Max retry attempts",
139 "type": "number",
140 "description": "Maximum retry attempts"
141 },
142 "delay": {
143 "title": "Delay for Retry (seconds)",
144 "type": "number",
145 "description": "Resend button enable delay in seconds"
146 }
147 },
148 "required": ["buttonTitle"]
149 }
150 },
151 "required": ["generateOnLoad", "api", "enableRetry"]
152 },
153 "captureInput": {
154 "title": "Capture Input",
155 "description": "Developers can use this attribute to validate the captured inputs",
156 "type": "object",
157 "properties": {
158 "inputType": {
159 "title": "Input Data type",
160 "description": "Developers can declare the input type by using this attribute.",
161 "type": "string",
162 "enum": ["string", "number"]
163 },
164 "length": {
165 "title": "Input length",
166 "type": "number",
167 "description": "Maximum length of the input type.",
168 "minimum": 1
169 },
170 "validationRegex": {
171 "title": "Validation Regex",
172 "type": "string",
173 "description": "Validation for the format of input data type."
174 }
175 },
176 "required": ["inputType", "length"]
177 },
178 "validation": {
179 "title": "Validation",
180 "type": "object",
181 "properties": {
182 "selectedIndex": {
183 "title": "Selection Validation Index",
184 "description": "Selected Validation Logic in anyOf",
185 "type": "number",
186 "minimum": 0,
187 "maximum": 1
188 },
189 "logic": {
190 "title": "Validation Logic",
191 "anyOf": [
192 {
193 "title": "Validation API",
194 "type": "object",
195 "properties": {
196 "api": {
197 "title": "API",
198 "type": "object",
199 "description": "Generation api",
200 "properties": {
201 "uri": {
202 "type": "string",
203 "title": "URI",
204 "description": "HTTP API url"
205 },
206 "timeout": {
207 "type": "number",
208 "title": "Timeout for API",
209 "description": "The time after which request will be canceled"
210 },
211 "httpMethod": {
212 "title": "HTTP Method",
213 "description": "HTTP Method",
214 "type": "string",
215 "enum": ["PUT", "POST", "GET"]
216 },
217 "headers": {
218 "type": "array",
219 "title": "Headers",
220 "description": "API headers",
221 "items": {
222 "type": "object",
223 "properties": {
224 "key": {
225 "type": "string",
226 "title": "Header key"
227 },
228 "value": {
229 "type": "string",
230 "title": "Header value"
231 }
232 }
233 }
234 },
235 "requestBody": {
236 "type": "object",
237 "title": "HTTP Request Body",
238 "description": "request body object"
239 },
240 "queryParams": {
241 "type": "array",
242 "title": "HTTP Query param",
243 "description": "Query param for request",
244 "items": {
245 "type": "object",
246 "properties": {
247 "key": {
248 "type": "string",
249 "title": "Query key"
250 },
251 "value": {
252 "type": "string",
253 "title": "Query value"
254 }
255 }
256 }
257 },
258 "pathParams": {
259 "type": "array",
260 "title": "HTTP Path param",
261 "description": "Path param for request",
262 "items": {
263 "type": "object",
264 "properties": {
265 "key": {
266 "type": "string",
267 "title": "Path key"
268 },
269 "value": {
270 "type": "string",
271 "title": "Path value"
272 }
273 }
274 }
275 },
276 "responseJsonLogic": {
277 "type": "object",
278 "title": "Response JSON logic",
279 "description": "Json path to extract the required output from API response"
280 },
281 "errorJsonLogic": {
282 "type": "object",
283 "title": "Error JSON logic",
284 "description": "Json path to extract the required error response"
285 }
286 },
287 "required": [
288 "uri",
289 "httpMethod",
290 "responseJsonLogic",
291 "errorJsonLogic"
292 ]
293 }
294 },
295 "required": ["api"]
296 },
297 {
298 "title": "Validation Value",
299 "type": "object",
300 "properties": {
301 "value": {
302 "title": "Value",
303 "type": "string",
304 "description": "Value to validate user entered input from"
305 }
306 },
307 "required": ["value"]
308 }
309 ]
310 }
311 },
312 "required": ["selectedIndex", "logic"]
313 },
314 "title": {
315 "title": "Title",
316 "type": "string",
317 "description": "Title for the message to be displayed to the FE"
318 },
319 "message": {
320 "title": "Message",
321 "type": "string",
322 "description": "Actual instruction message body for the FE."
323 },
324 "canGoBack": {
325 "title": "Can go back",
326 "type": "boolean",
327 "description": "This attribute enables the developers to revert back to any of the previous ETs."
328 },
329 "applicableReasons": {
330 "title": "Applicable reasons",
331 "description": "Developers can use this attribute to provide Applicable Reason code for moving from one ET to the next one.",
332 "type": "object"
333 }
334 },
335 "required": ["captureInput", "validation", "title", "applicableReasons"]
336 },
337 "output": {
338 "type": "object",
339 "properties": {
340 "success": {
341 "description": "Boolean to represent result of verification",
342 "type": "boolean"
343 },
344 "eventCode": {
345 "type": "string",
346 "description": "Event code"
347 },
348 "reasonCode": {
349 "type": "string",
350 "description": "Reason code"
351 },
352 "meta": {
353 "type": "object",
354 "description": "Meta data related to execution of task",
355 "properties": {
356 "startTime": {
357 "type": "number",
358 "description": "Epoch timestamp for the start of task"
359 },
360 "endTime": {
361 "type": "number",
362 "description": "Epoch timestamp for the end of task"
363 },
364 "location": {
365 "type": "object",
366 "description": "Location at start of task",
367 "properties": {
368 "latitude": {
369 "type": "string",
370 "description": "Latitude"
371 },
372 "longitude": {
373 "type": "string",
374 "description": "Longitude"
375 }
376 }
377 },
378 "userDetails": {
379 "type": "string",
380 "description": "Unique identifier of user performing the action"
381 }
382 }
383 }
384 },
385 "required": ["success"]
386 },
387 "canMerge": true,
388 "meta": {
389 "allowFailureFlow": true,
390 "allowGoBack": true
391 }
392}