@abgov/adsp-sdk-mcp-server 0.0.0

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.
Files changed (124) hide show
  1. package/README.md +51 -0
  2. package/assets/docs/architecture.md +79 -0
  3. package/assets/docs/getting-started.md +118 -0
  4. package/assets/docs/important-notes.md +47 -0
  5. package/assets/docs/index.md +9 -0
  6. package/assets/docs/platform/deployment.md +80 -0
  7. package/assets/docs/platform/getting-started.md +66 -0
  8. package/assets/docs/platform/operations.md +8 -0
  9. package/assets/docs/platform/platform-django-sdk.md +330 -0
  10. package/assets/docs/platform/platform-dotnet-sdk.md +457 -0
  11. package/assets/docs/platform/platform-flask-sdk.md +355 -0
  12. package/assets/docs/platform/platform-node-sdk.md +433 -0
  13. package/assets/docs/platform/platform-spring-sdk.md +344 -0
  14. package/assets/docs/platform/platform.md +8 -0
  15. package/assets/docs/services/access-service.md +75 -0
  16. package/assets/docs/services/agent-service.md +316 -0
  17. package/assets/docs/services/cache-service.md +61 -0
  18. package/assets/docs/services/calendar-service.md +86 -0
  19. package/assets/docs/services/comment-service.md +87 -0
  20. package/assets/docs/services/configuration-service.md +92 -0
  21. package/assets/docs/services/directory-service.md +57 -0
  22. package/assets/docs/services/event-service.md +122 -0
  23. package/assets/docs/services/feedback-service.md +152 -0
  24. package/assets/docs/services/file-service.md +164 -0
  25. package/assets/docs/services/form-service.md +149 -0
  26. package/assets/docs/services/notification-service.md +151 -0
  27. package/assets/docs/services/pdf-service.md +116 -0
  28. package/assets/docs/services/pii-service.md +45 -0
  29. package/assets/docs/services/push-service.md +106 -0
  30. package/assets/docs/services/services.md +6 -0
  31. package/assets/docs/services/status-service.md +29 -0
  32. package/assets/docs/services/task-service.md +139 -0
  33. package/assets/docs/services/tenant-service.md +18 -0
  34. package/assets/docs/services/token-handler.md +135 -0
  35. package/assets/docs/services/value-service.md +80 -0
  36. package/assets/docs/services/verify-service.md +61 -0
  37. package/assets/docs/tutorials/access-service/access-service.md +9 -0
  38. package/assets/docs/tutorials/access-service/adsp-clients.md +29 -0
  39. package/assets/docs/tutorials/access-service/application-clients.md +61 -0
  40. package/assets/docs/tutorials/access-service/front-end-access.md +53 -0
  41. package/assets/docs/tutorials/access-service/introduction.md +33 -0
  42. package/assets/docs/tutorials/access-service/tenants.md +68 -0
  43. package/assets/docs/tutorials/access-service/themes.md +43 -0
  44. package/assets/docs/tutorials/feedback-service/accessing-data.md +41 -0
  45. package/assets/docs/tutorials/feedback-service/feedback-service.md +9 -0
  46. package/assets/docs/tutorials/feedback-service/installation.md +142 -0
  47. package/assets/docs/tutorials/feedback-service/introduction.md +28 -0
  48. package/assets/docs/tutorials/feedback-service/security.md +40 -0
  49. package/assets/docs/tutorials/feedback-service/triggering.md +21 -0
  50. package/assets/docs/tutorials/file-service/file-service.md +9 -0
  51. package/assets/docs/tutorials/file-service/file-types.md +35 -0
  52. package/assets/docs/tutorials/file-service/introduction.md +34 -0
  53. package/assets/docs/tutorials/file-service/security.md +31 -0
  54. package/assets/docs/tutorials/file-service/working-with.md +65 -0
  55. package/assets/docs/tutorials/form-service/Integration.md +31 -0
  56. package/assets/docs/tutorials/form-service/ai-agent.md +450 -0
  57. package/assets/docs/tutorials/form-service/building-forms.md +264 -0
  58. package/assets/docs/tutorials/form-service/cheat-sheet.md +1461 -0
  59. package/assets/docs/tutorials/form-service/custom-error-messages.md +87 -0
  60. package/assets/docs/tutorials/form-service/data-registers.md +204 -0
  61. package/assets/docs/tutorials/form-service/file-uploader.md +81 -0
  62. package/assets/docs/tutorials/form-service/form-app.md +72 -0
  63. package/assets/docs/tutorials/form-service/form-editor.md +62 -0
  64. package/assets/docs/tutorials/form-service/form-service.md +9 -0
  65. package/assets/docs/tutorials/form-service/form-submissions.md +77 -0
  66. package/assets/docs/tutorials/form-service/instructions.md +173 -0
  67. package/assets/docs/tutorials/form-service/introduction.md +66 -0
  68. package/assets/docs/tutorials/form-service/repeated-items.md +87 -0
  69. package/assets/docs/tutorials/form-service/security.md +36 -0
  70. package/assets/docs/tutorials/form-service/steppers.md +237 -0
  71. package/assets/docs/tutorials/notification-service/emailAttachment.md +75 -0
  72. package/assets/docs/tutorials/notification-service/events.md +20 -0
  73. package/assets/docs/tutorials/notification-service/introduction.md +37 -0
  74. package/assets/docs/tutorials/notification-service/notification-service.md +9 -0
  75. package/assets/docs/tutorials/notification-service/notification-types.md +86 -0
  76. package/assets/docs/tutorials/notification-service/subscribers.md +33 -0
  77. package/assets/docs/tutorials/pdf-service/building-a-template.md +339 -0
  78. package/assets/docs/tutorials/pdf-service/generate-a-pdf.md +150 -0
  79. package/assets/docs/tutorials/pdf-service/handlebars.md +51 -0
  80. package/assets/docs/tutorials/pdf-service/introduction.md +26 -0
  81. package/assets/docs/tutorials/pdf-service/pdf-service.md +9 -0
  82. package/assets/docs/tutorials/pdf-service/puppeteer.md +25 -0
  83. package/assets/docs/tutorials/pdf-service/video.md +18 -0
  84. package/assets/docs/tutorials/status-service/Introduction.md +46 -0
  85. package/assets/docs/tutorials/status-service/health.md +51 -0
  86. package/assets/docs/tutorials/status-service/notices.md +34 -0
  87. package/assets/docs/tutorials/status-service/notifications.md +107 -0
  88. package/assets/docs/tutorials/status-service/status-service.md +9 -0
  89. package/assets/docs/tutorials/status-service/status.md +35 -0
  90. package/assets/docs/tutorials/status-service/webhooks.md +24 -0
  91. package/assets/docs/tutorials/task-service/introduction.md +23 -0
  92. package/assets/docs/tutorials/task-service/task-app.md +43 -0
  93. package/assets/docs/tutorials/task-service/task-definitions.md +49 -0
  94. package/assets/docs/tutorials/task-service/task-queues.md +67 -0
  95. package/assets/docs/tutorials/task-service/task-service.md +9 -0
  96. package/assets/docs/tutorials/tutorials.md +8 -0
  97. package/package.json +18 -0
  98. package/src/docs/docsRepository.d.ts +22 -0
  99. package/src/docs/docsRepository.js +110 -0
  100. package/src/docs/docsRepository.js.map +1 -0
  101. package/src/main.d.ts +2 -0
  102. package/src/main.js +16 -0
  103. package/src/main.js.map +1 -0
  104. package/src/sdk-reference/reference.d.ts +17 -0
  105. package/src/sdk-reference/reference.js +547 -0
  106. package/src/sdk-reference/reference.js.map +1 -0
  107. package/src/sdk-reference/search.d.ts +6 -0
  108. package/src/sdk-reference/search.js +41 -0
  109. package/src/sdk-reference/search.js.map +1 -0
  110. package/src/server.d.ts +6 -0
  111. package/src/server.js +30 -0
  112. package/src/server.js.map +1 -0
  113. package/src/tools/registerDocsTools.d.ts +3 -0
  114. package/src/tools/registerDocsTools.js +66 -0
  115. package/src/tools/registerDocsTools.js.map +1 -0
  116. package/src/tools/registerQuickstartTool.d.ts +2 -0
  117. package/src/tools/registerQuickstartTool.js +82 -0
  118. package/src/tools/registerQuickstartTool.js.map +1 -0
  119. package/src/tools/registerSdkTools.d.ts +2 -0
  120. package/src/tools/registerSdkTools.js +43 -0
  121. package/src/tools/registerSdkTools.js.map +1 -0
  122. package/src/tools/types.d.ts +12 -0
  123. package/src/tools/types.js +3 -0
  124. package/src/tools/types.js.map +1 -0
@@ -0,0 +1,264 @@
1
+ ---
2
+ title: Building Forms
3
+ layout: page
4
+ nav_order: 2
5
+ parent: Form Service
6
+ grand_parent: Tutorials
7
+ ---
8
+
9
+ ## Building Forms
10
+
11
+ The _Form Service_ can be used to build some very sophisticated forms and includes directives that allow you to add:
12
+
13
+ - input controls
14
+ - control groups
15
+ - steppers
16
+ - inline instructions
17
+ - input validators
18
+ - element lists
19
+ - rules controlling the visibility of form elements
20
+
21
+ Jsonforms itself has [moderately good documentation](https://jsonforms.io/examples/basic/) on how this all works; please read through their information to get a better sense of how the schemas need to be set up. If you wish to dive right in, however, here's how you can easily [build and preview](/adsp-monorepo/tutorials/form-service/form-editor.html) your forms through ADSP's Form Editor.
22
+
23
+ ### Steppers
24
+
25
+ Many forms at the GoA can be rather large and complex, and could be divided into a number of smaller steps for ease of use. This is where [form steppers](/adsp-monorepo/tutorials/form-service/steppers.html) become useful.
26
+
27
+ ### Form Rules
28
+
29
+ Sometimes a specific answer to a question will influence the flow of the form. A yes answer, for example, may uncover further questions, or a particular income value may disable followup questions. Jsonforms uses [rules](https://jsonforms.io/docs/uischema/rules/) to handle the dynamic aspects of form intake.
30
+
31
+ ### Input Validation
32
+
33
+ Jsonforms automatically handles basic input validation, such as ensuring required fields are filled in, dates are formatted correctly, or that numbers are, indeed, numbers. More sophisticated validation is also possible; you can add [custom error messages](https://jsonforms.io/docs/validation/) or even [integrate a custom AJV validator](https://jsonforms.io/docs/validation/) to [harness the full power of AJV](https://ajv.js.org/), which gives you complete control over validation.
34
+
35
+ #### Required Fields
36
+
37
+ There is a known issue in jsonforms that allows an empty string to satisfy the required validation rule. To work around this, you should also add a minimum length of 1 to required string fields, e.g.
38
+
39
+ ```json
40
+ {
41
+ "firstName": {
42
+ "type": "string",
43
+ "minLength": 1
44
+ },
45
+ "required": ["firstName"]
46
+ }
47
+ ```
48
+
49
+ #### Conditional Validation
50
+
51
+ Form validation can be conditional; something that is especially important when working with hidden fields. For example, suppose a form has a boolean field called _hasChildren_. When a use checks it some hidden fields appear, like _childsFirstName_ and _childsLastName_. If the latter are marked as required and hasChildren remains false, the form validation would fail because the user couldn't enter any values for the hidden names. Even worse, there really wouldn't be any clues as to why the form was failing.
52
+
53
+ To help manage these situations the form service has implemented _conditional validations_ for JSON Schemas, based on the if-then-else construct introduce in [json schema draft 7](https://json-schema.org/draft-07). With this we can specify such things as "if hasChildren is true then make _childsFirstName_ and _childsLastName_ required, otherwise they are not". The syntax in the JSON Schema would look like this:
54
+
55
+ ```json
56
+ "if": {
57
+ "properties": {
58
+ "hasChildren": {
59
+ "const": true
60
+ }
61
+ }
62
+ },
63
+ "then": {
64
+ "required": [
65
+ "childsFirstName",
66
+ "childsLastName"
67
+ ]
68
+ }
69
+ ```
70
+
71
+ "if" and "then" are treated as attributes of the schema, and can appear anywhere at the top level (same level as "required" or "properties"). However, since they are _properties_ there can only be one "if" or "else" at that level, which limits their usefulness. If you have more than one dependent validation though, you can wrap them in an "allOf" property, like so:
72
+
73
+ ```json
74
+ "allOf": [
75
+ {
76
+ "if": {
77
+ "properties": {
78
+ "hasChildren": {
79
+ "const": true
80
+ }
81
+ }
82
+ },
83
+ "then": {
84
+ "required": [
85
+ "childsFirstName",
86
+ "childsLastName"
87
+ ]
88
+ }
89
+ },
90
+ {
91
+ "if": {
92
+ "properties": {
93
+ "category": {
94
+ "const": "Highway Issues"
95
+ }
96
+ }
97
+ },
98
+ "then": {
99
+ "required": [
100
+ "highwayIssues"
101
+ ]
102
+ }
103
+ }
104
+ ]
105
+ ```
106
+
107
+ This says that if _hasChildren_ is checked then child names are required, and if _category_ has the value _Highway Issues_ then the subcategory _highwayIssues_ is required. You can add as many dependencies of this type as needed.
108
+
109
+ You can conditionally specify pretty much any validation that is part of the JSON schema, such as patterns, length, or even format.
110
+
111
+ ### Repeating Items
112
+
113
+ You will sometimes need to capture [lists of information](/adsp-monorepo/tutorials/form-service/repeated-items.html) in a form. Lists contain a variable number of items, each containing the necessary details. For example, an application for a Farmers Market License may require list of vendors, each with contact information, a classification, and their expected yearly revenue. Users are able to add one item at a time and fill in the details as needed.
114
+
115
+ ### Calculated Fields
116
+
117
+ The form service includes a calculation control for fields whose values should be derived from other answers instead of entered directly by the user. This is useful for totals, capped amounts, and other values that depend on one or more numeric inputs.
118
+
119
+ To use the calculation control:
120
+
121
+ 1. Add a destination field to the JSON schema.
122
+ 2. Set the field to <code>"format": "computed"</code>.
123
+ 3. Put the calculation expression in the field's <code>description</code>.
124
+ 4. Add a normal <code>Control</code> in the UI schema that points to the computed field.
125
+
126
+ The rendered control is read-only. The library evaluates the expression against the current form data and writes the computed numeric result back to the field automatically.
127
+
128
+ #### Basic Arithmetic
129
+
130
+ For simple arithmetic, reference other fields using JSON pointer-style paths like <code>#/properties/x</code>.
131
+
132
+ ```json
133
+ {
134
+ "type": "object",
135
+ "properties": {
136
+ "x": {
137
+ "type": "number"
138
+ },
139
+ "y": {
140
+ "type": "number"
141
+ },
142
+ "z": {
143
+ "type": "number"
144
+ },
145
+ "total": {
146
+ "type": "string",
147
+ "format": "computed",
148
+ "description": "#/properties/x * #/properties/y + #/properties/z"
149
+ }
150
+ }
151
+ }
152
+ ```
153
+
154
+ ```json
155
+ {
156
+ "type": "VerticalLayout",
157
+ "elements": [
158
+ {
159
+ "type": "Control",
160
+ "scope": "#/properties/x"
161
+ },
162
+ {
163
+ "type": "Control",
164
+ "scope": "#/properties/y"
165
+ },
166
+ {
167
+ "type": "Control",
168
+ "scope": "#/properties/z"
169
+ },
170
+ {
171
+ "type": "Control",
172
+ "scope": "#/properties/total",
173
+ "label": "Total"
174
+ }
175
+ ]
176
+ }
177
+ ```
178
+
179
+ #### Summing Repeating Items
180
+
181
+ You can also sum a numeric property across a repeating item list by using <code>SUM(...)</code>. The argument must point to the array property followed by the numeric child property to sum.
182
+
183
+ ```json
184
+ {
185
+ "type": "object",
186
+ "properties": {
187
+ "items": {
188
+ "type": "array",
189
+ "items": {
190
+ "type": "object",
191
+ "properties": {
192
+ "amount": {
193
+ "type": "number"
194
+ }
195
+ }
196
+ }
197
+ },
198
+ "totalAmount": {
199
+ "type": "string",
200
+ "format": "computed",
201
+ "description": "SUM(#/properties/items/amount)"
202
+ }
203
+ }
204
+ }
205
+ ```
206
+
207
+ ```json
208
+ {
209
+ "type": "VerticalLayout",
210
+ "elements": [
211
+ {
212
+ "type": "ListWithDetail",
213
+ "scope": "#/properties/items",
214
+ "options": {
215
+ "detail": {
216
+ "type": "VerticalLayout",
217
+ "elements": [
218
+ {
219
+ "type": "Control",
220
+ "scope": "#/properties/amount",
221
+ "label": "Amount"
222
+ }
223
+ ]
224
+ }
225
+ }
226
+ },
227
+ {
228
+ "type": "Control",
229
+ "scope": "#/properties/totalAmount",
230
+ "label": "Total amount"
231
+ }
232
+ ]
233
+ }
234
+ ```
235
+
236
+ #### Minimum and Maximum Expressions
237
+
238
+ The calculation engine also supports expressions such as <code>min(...)</code> and <code>max(...)</code>. These can combine scope references and numeric literals.
239
+
240
+ ```json
241
+ {
242
+ "approved": {
243
+ "type": "string",
244
+ "format": "computed",
245
+ "description": "min(#/properties/requested, 1000)"
246
+ }
247
+ }
248
+ ```
249
+
250
+ This example caps the approved value at <code>1000</code> even if the requested amount is higher.
251
+
252
+ For additional examples and option reference material, see the [cheat sheet](/adsp-monorepo/tutorials/form-service/cheat-sheet.html).
253
+
254
+ ### ADSP Enhancements
255
+
256
+ ADSP has added several enhancements to the form builder in order to help designers and developers create professional looking forms. These include:
257
+
258
+ - Adding [text, images, and links](/adsp-monorepo/tutorials/form-service/instructions.html) to forms in order to help clarify the information that is needed from end-users when filling them out.
259
+ - A [file upload widget](/adsp-monorepo/tutorials/form-service/file-uploader.md)
260
+ - Data registries
261
+
262
+ ## Learn More
263
+
264
+ - Learn how to [use jsonforms](https://jsonforms.io/) to declaratively build and render your forms.