ondc-code-generator 0.9.0 → 1.0.1
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.
- package/alpha/docs/rag-docs/confirm.md +301 -0
- package/alpha/docs/rag-docs/init.md +422 -0
- package/alpha/docs/rag-docs/on_confirm.md +921 -0
- package/alpha/docs/rag-docs/on_init.md +823 -0
- package/alpha/docs/rag-docs/on_search.md +897 -0
- package/alpha/docs/rag-docs/on_select.md +522 -0
- package/alpha/docs/rag-docs/on_status.md +854 -0
- package/alpha/docs/rag-docs/on_update.md +921 -0
- package/alpha/docs/rag-docs/search.md +678 -0
- package/alpha/docs/rag-docs/select.md +344 -0
- package/alpha/docs/rag-docs/status.md +178 -0
- package/alpha/docs/rag-docs/update.md +229 -0
- package/alpha/docs/rag-table-docs/confirm.md +63 -0
- package/alpha/docs/rag-table-docs/init.md +81 -0
- package/alpha/docs/rag-table-docs/on_confirm.md +164 -0
- package/alpha/docs/rag-table-docs/on_init.md +146 -0
- package/alpha/docs/rag-table-docs/on_search.md +163 -0
- package/alpha/docs/rag-table-docs/on_select.md +99 -0
- package/alpha/docs/rag-table-docs/on_status.md +153 -0
- package/alpha/docs/rag-table-docs/on_update.md +164 -0
- package/alpha/docs/rag-table-docs/raw_table.json +11198 -0
- package/alpha/docs/rag-table-docs/search.md +128 -0
- package/alpha/docs/rag-table-docs/select.md +70 -0
- package/alpha/docs/rag-table-docs/status.md +44 -0
- package/alpha/docs/rag-table-docs/update.md +51 -0
- package/alpha/docs/validPaths.json +34134 -0
- package/alpha/possible-json-paths.json +34134 -0
- package/alpha/table/rag-table-docs/confirm.md +3 -0
- package/alpha/table/rag-table-docs/init.md +3 -0
- package/alpha/table/rag-table-docs/on_confirm.md +3 -0
- package/alpha/table/rag-table-docs/on_init.md +3 -0
- package/alpha/table/rag-table-docs/on_search.md +3 -0
- package/alpha/table/rag-table-docs/on_select.md +3 -0
- package/alpha/table/rag-table-docs/on_status.md +3 -0
- package/alpha/table/rag-table-docs/on_update.md +3 -0
- package/alpha/table/rag-table-docs/search.md +3 -0
- package/alpha/table/rag-table-docs/select.md +3 -0
- package/alpha/table/rag-table-docs/status.md +3 -0
- package/alpha/table/rag-table-docs/update.md +3 -0
- package/dist/generator/config-compiler.d.ts +16 -2
- package/dist/generator/config-compiler.js +45 -19
- package/dist/generator/generators/classes/abstract-generator.d.ts +2 -0
- package/dist/generator/generators/documentation/markdown-message-generator.js +4 -1
- package/dist/generator/generators/documentation/md-generator.d.ts +2 -1
- package/dist/generator/generators/documentation/md-generator.js +3 -2
- package/dist/generator/generators/go/go-generator.js +1 -1
- package/dist/generator/generators/javascript/js-generator.js +1 -1
- package/dist/generator/generators/python/py-generator.js +1 -1
- package/dist/generator/generators/rag/rag-generator.d.ts +39 -28
- package/dist/generator/generators/rag/rag-generator.js +149 -103
- package/dist/generator/generators/rag/rag-table-generator.d.ts +7 -1
- package/dist/generator/generators/rag/rag-table-generator.js +24 -8
- package/dist/generator/generators/typescript/ts-generator.js +1 -1
- package/dist/index.test.js +12 -3
- package/dist/types/build.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
---
|
|
2
|
+
action: confirm
|
|
3
|
+
codeName: L1validations
|
|
4
|
+
numTests: 36
|
|
5
|
+
generated: 2026-03-10
|
|
6
|
+
domain: ONDC:FIS12
|
|
7
|
+
version: 2.3.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# L1validations — `confirm` Validations
|
|
11
|
+
|
|
12
|
+
These are the validation rules applied when processing the `confirm` API call in the L1validations flow.
|
|
13
|
+
There are **36** validation rules organized into **6** top-level group(s).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
## CONFIRM_CONTEXT
|
|
17
|
+
|
|
18
|
+
This group contains **3** sub-group(s)/validation(s): CONTEXT_REQUIRED, CONTEXT_ENUM, and CONTEXT_REGEX.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
### CONTEXT_REQUIRED
|
|
23
|
+
|
|
24
|
+
This is a group of **12** sub-validation(s) that all must pass: REQUIRED_CONTEXT_LOCATION_COUNTRY_CODE, REQUIRED_CONTEXT_LOCATION_CITY_CODE, REQUIRED_CONTEXT_DOMAIN, REQUIRED_CONTEXT_TIMESTAMP, REQUIRED_CONTEXT_BAP_ID, REQUIRED_CONTEXT_BAP_URI, REQUIRED_CONTEXT_TRANSACTION_ID, REQUIRED_CONTEXT_MESSAGE_ID, REQUIRED_CONTEXT_VERSION, REQUIRED_CONTEXT_TTL, REQUIRED_CONTEXT_BPP_ID, and REQUIRED_CONTEXT_BPP_URI.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
**REQUIRED_CONTEXT_LOCATION_COUNTRY_CODE**
|
|
29
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
30
|
+
|
|
31
|
+
- $.context.location.country.code must be present in the payload
|
|
32
|
+
|
|
33
|
+
**REQUIRED_CONTEXT_LOCATION_CITY_CODE**
|
|
34
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
35
|
+
|
|
36
|
+
- $.context.location.city.code must be present in the payload
|
|
37
|
+
|
|
38
|
+
**REQUIRED_CONTEXT_DOMAIN**
|
|
39
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
40
|
+
|
|
41
|
+
- $.context.domain must be present in the payload
|
|
42
|
+
|
|
43
|
+
**REQUIRED_CONTEXT_TIMESTAMP**
|
|
44
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
45
|
+
|
|
46
|
+
- $.context.timestamp must be present in the payload
|
|
47
|
+
|
|
48
|
+
**REQUIRED_CONTEXT_BAP_ID**
|
|
49
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
50
|
+
|
|
51
|
+
- $.context.bap_id must be present in the payload
|
|
52
|
+
|
|
53
|
+
**REQUIRED_CONTEXT_BAP_URI**
|
|
54
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
55
|
+
|
|
56
|
+
- $.context.bap_uri must be present in the payload
|
|
57
|
+
|
|
58
|
+
**REQUIRED_CONTEXT_TRANSACTION_ID**
|
|
59
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
60
|
+
|
|
61
|
+
- $.context.transaction_id must be present in the payload
|
|
62
|
+
|
|
63
|
+
**REQUIRED_CONTEXT_MESSAGE_ID**
|
|
64
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
65
|
+
|
|
66
|
+
- $.context.message_id must be present in the payload
|
|
67
|
+
|
|
68
|
+
**REQUIRED_CONTEXT_VERSION**
|
|
69
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
70
|
+
|
|
71
|
+
- $.context.version must be present in the payload
|
|
72
|
+
|
|
73
|
+
**REQUIRED_CONTEXT_TTL**
|
|
74
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
75
|
+
|
|
76
|
+
- $.context.ttl must be present in the payload
|
|
77
|
+
|
|
78
|
+
**REQUIRED_CONTEXT_BPP_ID**
|
|
79
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
80
|
+
|
|
81
|
+
- $.context.bpp_id must be present in the payload
|
|
82
|
+
|
|
83
|
+
**REQUIRED_CONTEXT_BPP_URI**
|
|
84
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REQUIRED | type: leaf`
|
|
85
|
+
|
|
86
|
+
- $.context.bpp_uri must be present in the payload
|
|
87
|
+
|
|
88
|
+
### CONTEXT_ENUM
|
|
89
|
+
|
|
90
|
+
This is a group of **2** sub-validation(s) that all must pass: VALID_CONTEXT_LOCATION_COUNTRY_CODE and VALID_CONTEXT_DOMAIN.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
**VALID_CONTEXT_LOCATION_COUNTRY_CODE**
|
|
95
|
+
`group: CONFIRM_CONTEXT > CONTEXT_ENUM | type: leaf`
|
|
96
|
+
|
|
97
|
+
- All elements of $.context.location.country.code must be in ["IND"]
|
|
98
|
+
|
|
99
|
+
> **Skip if:**
|
|
100
|
+
> - $.context.location.country.code is not in the payload
|
|
101
|
+
|
|
102
|
+
**VALID_CONTEXT_DOMAIN**
|
|
103
|
+
`group: CONFIRM_CONTEXT > CONTEXT_ENUM | type: leaf`
|
|
104
|
+
|
|
105
|
+
- All elements of $.context.domain must be in ["ONDC:FIS12"]
|
|
106
|
+
|
|
107
|
+
> **Skip if:**
|
|
108
|
+
> - $.context.domain is not in the payload
|
|
109
|
+
|
|
110
|
+
### CONTEXT_REGEX
|
|
111
|
+
|
|
112
|
+
This is a group of **7** sub-validation(s) that all must pass: REGEX_CONTEXT_LOCATION_CITY_CODE, REGEX_CONTEXT_TIMESTAMP_1, REGEX_CONTEXT_BAP_ID, REGEX_CONTEXT_BAP_URI, REQUIRED_CONTEXT_TTL, REGEX_CONTEXT_BPP_ID, and REGEX_CONTEXT_BPP_URI.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
**REGEX_CONTEXT_LOCATION_CITY_CODE**
|
|
117
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REGEX | type: leaf`
|
|
118
|
+
|
|
119
|
+
- All elements of $.context.location.city.code must follow every regex in ["(\\*)|(^std\\:[0-9]{2,4}$)"]
|
|
120
|
+
|
|
121
|
+
> **Skip if:**
|
|
122
|
+
> - $.context.location.city.code is not in the payload
|
|
123
|
+
|
|
124
|
+
**REGEX_CONTEXT_TIMESTAMP_1**
|
|
125
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REGEX | type: leaf`
|
|
126
|
+
|
|
127
|
+
- All elements of $.context.timestamp must follow every regex in ["^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$"]
|
|
128
|
+
|
|
129
|
+
> **Skip if:**
|
|
130
|
+
> - $.context.timestamp is not in the payload
|
|
131
|
+
|
|
132
|
+
**REGEX_CONTEXT_BAP_ID**
|
|
133
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REGEX | type: leaf`
|
|
134
|
+
|
|
135
|
+
- All elements of $.context.bap_id must follow every regex in ["^(?!.*\b(?:http|https|www)\b)[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$"]
|
|
136
|
+
|
|
137
|
+
> **Skip if:**
|
|
138
|
+
> - $.context.bap_id is not in the payload
|
|
139
|
+
|
|
140
|
+
**REGEX_CONTEXT_BAP_URI**
|
|
141
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REGEX | type: leaf`
|
|
142
|
+
|
|
143
|
+
- All elements of $.context.bap_uri must follow every regex in ["^https:\/\/(www\.)?[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+(/)?$"]
|
|
144
|
+
|
|
145
|
+
> **Skip if:**
|
|
146
|
+
> - $.context.bap_uri is not in the payload
|
|
147
|
+
|
|
148
|
+
**REQUIRED_CONTEXT_TTL**
|
|
149
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REGEX | type: leaf`
|
|
150
|
+
|
|
151
|
+
- All elements of $.context.ttl must follow every regex in ["^P(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+S)?)?$"]
|
|
152
|
+
|
|
153
|
+
> **Skip if:**
|
|
154
|
+
> - $.context.ttl is not in the payload
|
|
155
|
+
|
|
156
|
+
**REGEX_CONTEXT_BPP_ID**
|
|
157
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REGEX | type: leaf`
|
|
158
|
+
|
|
159
|
+
- All elements of $.context.bpp_id must follow every regex in ["^(?!.*\b(?:http|https|www)\b)[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$"]
|
|
160
|
+
|
|
161
|
+
> **Skip if:**
|
|
162
|
+
> - $.context.bpp_id is not in the payload
|
|
163
|
+
|
|
164
|
+
**REGEX_CONTEXT_BPP_URI**
|
|
165
|
+
`group: CONFIRM_CONTEXT > CONTEXT_REGEX | type: leaf`
|
|
166
|
+
|
|
167
|
+
- All elements of $.context.bpp_uri must follow every regex in ["^https:\/\/(www\.)?[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+(/)?$"]
|
|
168
|
+
|
|
169
|
+
> **Skip if:**
|
|
170
|
+
> - $.context.bpp_uri is not in the payload
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## REQUIRED_PROVIDER_ID
|
|
175
|
+
|
|
176
|
+
`group: top-level | type: leaf`
|
|
177
|
+
|
|
178
|
+
- $.message.order.provider.id must be present in the payload
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## REQUIRED_ITEM_FIELDS
|
|
183
|
+
|
|
184
|
+
This is a group of **2** sub-validation(s) that all must pass: REQUIRED_ITEM_ID and REQUIRED_PARENT_ITEM_ID.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
**REQUIRED_ITEM_ID**
|
|
189
|
+
`group: REQUIRED_ITEM_FIELDS | type: leaf`
|
|
190
|
+
|
|
191
|
+
- $.message.order.items[*].id must be present in the payload
|
|
192
|
+
|
|
193
|
+
**REQUIRED_PARENT_ITEM_ID**
|
|
194
|
+
`group: REQUIRED_ITEM_FIELDS | type: leaf`
|
|
195
|
+
|
|
196
|
+
- $.message.order.items[*].parent_item_id must be present in the payload
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## CONFIRM_PAYMENTS
|
|
201
|
+
|
|
202
|
+
This group contains **1** sub-group(s)/validation(s): REQUIRED_PAYMENT_ITEMS.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### REQUIRED_PAYMENT_ITEMS
|
|
207
|
+
|
|
208
|
+
This is a group of **7** sub-validation(s) that all must pass: REQUIRED_PAYMENT_ITEMS, REQUIRED_PAYMENT_ID, REQUIRED_PAYMENT_STATUS, REQUIRED_PAYMENT_COLLECTED_BY, REQUIRED_PAYMENT_BANK_ACCOUNT_NUMBER, REQUIRED_PAYMENT_BANK_CODE, and REQUIRED_PAYMENT_LABEL.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
**REQUIRED_PAYMENT_ITEMS**
|
|
213
|
+
`group: CONFIRM_PAYMENTS > REQUIRED_PAYMENT_ITEMS | type: leaf`
|
|
214
|
+
|
|
215
|
+
- $.message.order.payments[*].type must be present in the payload
|
|
216
|
+
|
|
217
|
+
**REQUIRED_PAYMENT_ID**
|
|
218
|
+
`group: CONFIRM_PAYMENTS > REQUIRED_PAYMENT_ITEMS | type: leaf`
|
|
219
|
+
|
|
220
|
+
- $.message.order.payments[*].id must be present in the payload
|
|
221
|
+
|
|
222
|
+
**REQUIRED_PAYMENT_STATUS**
|
|
223
|
+
`group: CONFIRM_PAYMENTS > REQUIRED_PAYMENT_ITEMS | type: leaf`
|
|
224
|
+
|
|
225
|
+
- $.message.order.payments[*].status must be present in the payload
|
|
226
|
+
|
|
227
|
+
**REQUIRED_PAYMENT_COLLECTED_BY**
|
|
228
|
+
`group: CONFIRM_PAYMENTS > REQUIRED_PAYMENT_ITEMS | type: leaf`
|
|
229
|
+
|
|
230
|
+
- $.message.order.payments[*].collected_by must be present in the payload
|
|
231
|
+
|
|
232
|
+
> **Skip if:**
|
|
233
|
+
> - not all elements of $.message.order.payments[*].time.label are in ["LOAN_DISBURSMENT"]
|
|
234
|
+
|
|
235
|
+
**REQUIRED_PAYMENT_BANK_ACCOUNT_NUMBER**
|
|
236
|
+
`group: CONFIRM_PAYMENTS > REQUIRED_PAYMENT_ITEMS | type: leaf`
|
|
237
|
+
|
|
238
|
+
- $.message.order.payments[*].params.bank_account_number must be present in the payload
|
|
239
|
+
|
|
240
|
+
> **Skip if:**
|
|
241
|
+
> - not all elements of $.message.order.payments[*].time.label are in ["LOAN_DISBURSMENT"]
|
|
242
|
+
|
|
243
|
+
**REQUIRED_PAYMENT_BANK_CODE**
|
|
244
|
+
`group: CONFIRM_PAYMENTS > REQUIRED_PAYMENT_ITEMS | type: leaf`
|
|
245
|
+
|
|
246
|
+
- $.message.order.payments[*].params.bank_code must be present in the payload
|
|
247
|
+
|
|
248
|
+
> **Skip if:**
|
|
249
|
+
> - not all elements of $.message.order.payments[*].time.label are in ["LOAN_DISBURSMENT"]
|
|
250
|
+
|
|
251
|
+
**REQUIRED_PAYMENT_LABEL**
|
|
252
|
+
`group: CONFIRM_PAYMENTS > REQUIRED_PAYMENT_ITEMS | type: leaf`
|
|
253
|
+
|
|
254
|
+
- $.message.order.payments[*].time.label must be present in the payload
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## CONFIRM_PAYMENT_TAGS
|
|
259
|
+
|
|
260
|
+
This is a group of **2** sub-validation(s) that all must pass: VALID_PAYMENT_TAGS and REQUIRED_ACCOUNT_DETAILS.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
**VALID_PAYMENT_TAGS**
|
|
265
|
+
`group: CONFIRM_PAYMENT_TAGS | type: leaf`
|
|
266
|
+
|
|
267
|
+
- All elements of $.message.order.payments[*].tags[*].descriptor.code must be in ["ACCOUNT_DETAILS", "BREAKUP"]
|
|
268
|
+
|
|
269
|
+
> **Skip if:**
|
|
270
|
+
> - $.message.order.payments[*].tags[*].descriptor.code is not in the payload
|
|
271
|
+
|
|
272
|
+
**REQUIRED_ACCOUNT_DETAILS**
|
|
273
|
+
`group: CONFIRM_PAYMENT_TAGS | type: leaf | scope: $.message.order.payments[*].tags[?(@.descriptor.code == ACCOUNT_DETAILS)]`
|
|
274
|
+
|
|
275
|
+
- All elements of $.message.order.payments[*].tags[?(@.descriptor.code == ACCOUNT_DETAILS)].list[*].descriptor.code must be in ["ACCOUNT_TYPE", "ACCOUNT_HOLDER_NAME"]
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## CONFIRM_TAGS
|
|
280
|
+
|
|
281
|
+
This is a group of **3** sub-validation(s) that all must pass: REQUIRED_PAYMENT_TAGS, REQUIRED_BAP_TERMS, and REQUIRED_BPP_TERMS.
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
**REQUIRED_PAYMENT_TAGS**
|
|
286
|
+
`group: CONFIRM_TAGS | type: leaf`
|
|
287
|
+
|
|
288
|
+
- All elements of $.message.order.tags[*].descriptor.code must be in ["BAP_TERMS", "BPP_TERMS"]
|
|
289
|
+
|
|
290
|
+
> **Skip if:**
|
|
291
|
+
> - $.message.order.tags[*].descriptor.code is not in the payload
|
|
292
|
+
|
|
293
|
+
**REQUIRED_BAP_TERMS**
|
|
294
|
+
`group: CONFIRM_TAGS | type: leaf | scope: $.message.order.tags[?(@.descriptor.code == BAP_TERMS)]`
|
|
295
|
+
|
|
296
|
+
- All elements of $.message.order.tags[?(@.descriptor.code == BAP_TERMS)].list[*].descriptor.code must be in ["STATIC_TERMS", "OFFLINE_CONTRACT"]
|
|
297
|
+
|
|
298
|
+
**REQUIRED_BPP_TERMS**
|
|
299
|
+
`group: CONFIRM_TAGS | type: leaf | scope: $.message.order.tags[?(@.descriptor.code == BPP_TERMS)]`
|
|
300
|
+
|
|
301
|
+
- All elements of $.message.order.tags[?(@.descriptor.code == BPP_TERMS)].list[*].descriptor.code must be in ["STATIC_TERMS", "OFFLINE_CONTRACT"]
|