@defra/forms-model 3.0.431 → 3.0.432

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 (48) hide show
  1. package/package.json +1 -1
  2. package/schemas/component-schema-v2.json +162 -0
  3. package/schemas/component-schema.json +162 -0
  4. package/schemas/date-sub-schema.json +11 -0
  5. package/schemas/form-definition-schema.json +1876 -0
  6. package/schemas/form-definition-v2-payload-schema.json +1459 -0
  7. package/schemas/form-editor-input-check-answers-setting-schema.json +18 -0
  8. package/schemas/form-editor-input-page-schema.json +41 -0
  9. package/schemas/form-editor-input-page-settings-schema.json +28 -0
  10. package/schemas/form-editor-input-question-schema.json +38 -0
  11. package/schemas/form-metadata-author-schema.json +24 -0
  12. package/schemas/form-metadata-contact-schema.json +61 -0
  13. package/schemas/form-metadata-email-schema.json +25 -0
  14. package/schemas/form-metadata-input-schema.json +127 -0
  15. package/schemas/form-metadata-online-schema.json +25 -0
  16. package/schemas/form-metadata-schema.json +340 -0
  17. package/schemas/form-metadata-state-schema.json +72 -0
  18. package/schemas/form-submit-payload-schema.json +124 -0
  19. package/schemas/form-submit-record-schema.json +30 -0
  20. package/schemas/form-submit-recordset-schema.json +62 -0
  21. package/schemas/list-schema-v2.json +486 -0
  22. package/schemas/list-schema.json +486 -0
  23. package/schemas/max-future-schema.json +8 -0
  24. package/schemas/max-length-schema.json +8 -0
  25. package/schemas/max-past-schema.json +8 -0
  26. package/schemas/max-schema.json +7 -0
  27. package/schemas/min-length-schema.json +8 -0
  28. package/schemas/min-schema.json +7 -0
  29. package/schemas/page-schema-payload-v2.json +400 -0
  30. package/schemas/page-schema-v2.json +400 -0
  31. package/schemas/page-schema.json +400 -0
  32. package/schemas/page-type-schema.json +11 -0
  33. package/schemas/pagination-options-schema.json +27 -0
  34. package/schemas/patch-page-schema.json +26 -0
  35. package/schemas/query-options-schema.json +94 -0
  36. package/schemas/question-schema.json +7 -0
  37. package/schemas/question-type-full-schema.json +22 -0
  38. package/schemas/question-type-schema.json +20 -0
  39. package/schemas/search-options-schema.json +59 -0
  40. package/schemas/sorting-options-schema.json +28 -0
  41. package/schemas/written-answer-sub-schema.json +12 -0
  42. package/scripts/generate-schemas.js +0 -238
  43. package/scripts/schema-modules/constants.js +0 -39
  44. package/scripts/schema-modules/schema-processors.js +0 -109
  45. package/scripts/schema-modules/schema-simplifiers.js +0 -351
  46. package/scripts/schema-modules/title-processors.js +0 -327
  47. package/scripts/schema-modules/types.js +0 -21
  48. package/scripts/schema-modules/utils.js +0 -41
@@ -0,0 +1,18 @@
1
+ {
2
+ "type": "object",
3
+ "description": "Configuration for the check-answers page",
4
+ "properties": {
5
+ "declarationText": {
6
+ "type": "string",
7
+ "description": "Brief description of the question for internal use",
8
+ "title": "Declaration Text"
9
+ }
10
+ },
11
+ "required": [
12
+ "declarationText"
13
+ ],
14
+ "additionalProperties": false,
15
+ "$schema": "http://json-schema.org/draft-07/schema#",
16
+ "title": "Form Editor Input Check Answers Setting Schema",
17
+ "$id": "@defra/forms-model/schemas/form-editor-input-check-answers-setting-schema.json"
18
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "type": "object",
3
+ "description": "Input schema for creating a new page in the form editor",
4
+ "properties": {
5
+ "pageType": {
6
+ "type": "string",
7
+ "description": "Type of page - either a question page or guidance page",
8
+ "enum": [
9
+ "question",
10
+ "guidance"
11
+ ],
12
+ "title": "Page Type"
13
+ },
14
+ "questionType": {
15
+ "type": "string",
16
+ "description": "The high-level type of question, including grouped types",
17
+ "enum": [
18
+ "writtenAnswerSub",
19
+ "dateSub",
20
+ "UkAddressField",
21
+ "TelephoneNumberField",
22
+ "FileUploadField",
23
+ "EmailAddressField",
24
+ "listSub",
25
+ "YesNoField",
26
+ "CheckboxesField",
27
+ "RadiosField",
28
+ "AutocompleteField"
29
+ ],
30
+ "title": "Question Type"
31
+ }
32
+ },
33
+ "required": [
34
+ "pageType",
35
+ "questionType"
36
+ ],
37
+ "additionalProperties": false,
38
+ "$schema": "http://json-schema.org/draft-07/schema#",
39
+ "title": "Form Editor Input Page Schema",
40
+ "$id": "@defra/forms-model/schemas/form-editor-input-page-schema.json"
41
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "type": "object",
3
+ "description": "Settings for page content and display in the form editor",
4
+ "properties": {
5
+ "pageHeadingAndGuidance": {
6
+ "type": "string",
7
+ "description": "Combined heading and guidance for the page",
8
+ "title": "Page Heading And Guidance"
9
+ },
10
+ "pageHeading": {
11
+ "type": "string",
12
+ "description": "Main heading displayed at the top of the page",
13
+ "title": "Page Heading"
14
+ },
15
+ "guidanceText": {
16
+ "type": "string",
17
+ "description": "Guidance text to assist users in completing the page",
18
+ "title": "Guidance Text"
19
+ }
20
+ },
21
+ "required": [
22
+ "pageHeading"
23
+ ],
24
+ "additionalProperties": false,
25
+ "$schema": "http://json-schema.org/draft-07/schema#",
26
+ "title": "Form Editor Input Page Settings Schema",
27
+ "$id": "@defra/forms-model/schemas/form-editor-input-page-settings-schema.json"
28
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "type": "object",
3
+ "description": "Input schema for creating or updating a question in the form editor",
4
+ "properties": {
5
+ "question": {
6
+ "type": "string",
7
+ "description": "The question text displayed to the user",
8
+ "title": "Question"
9
+ },
10
+ "shortDescription": {
11
+ "type": "string",
12
+ "description": "Brief description of the question for internal use",
13
+ "title": "Short Description"
14
+ },
15
+ "hintText": {
16
+ "type": "string",
17
+ "description": "Optional guidance text displayed below the question",
18
+ "title": "Hint Text"
19
+ },
20
+ "questionOptional": {
21
+ "type": "string",
22
+ "description": "Indicates whether a question is optional. Empty string or \"true\" values are accepted.",
23
+ "enum": [
24
+ "",
25
+ "true"
26
+ ],
27
+ "title": "Question Optional"
28
+ }
29
+ },
30
+ "required": [
31
+ "question",
32
+ "shortDescription"
33
+ ],
34
+ "additionalProperties": false,
35
+ "$schema": "http://json-schema.org/draft-07/schema#",
36
+ "title": "Form Editor Input Question Schema",
37
+ "$id": "@defra/forms-model/schemas/form-editor-input-question-schema.json"
38
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "type": "object",
3
+ "description": "Information about the author of a form or form change",
4
+ "properties": {
5
+ "id": {
6
+ "type": "string",
7
+ "description": "Unique identifier for the author",
8
+ "title": "Id"
9
+ },
10
+ "displayName": {
11
+ "type": "string",
12
+ "description": "Human-readable name of the author",
13
+ "title": "Display Name"
14
+ }
15
+ },
16
+ "required": [
17
+ "id",
18
+ "displayName"
19
+ ],
20
+ "additionalProperties": false,
21
+ "$schema": "http://json-schema.org/draft-07/schema#",
22
+ "title": "Form Metadata Author Schema",
23
+ "$id": "@defra/forms-model/schemas/form-metadata-author-schema.json"
24
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "type": "object",
3
+ "description": "Complete contact information for form-related inquiries",
4
+ "properties": {
5
+ "phone": {
6
+ "type": "string",
7
+ "description": "Phone number for form-related inquiries",
8
+ "title": "Phone"
9
+ },
10
+ "email": {
11
+ "type": "object",
12
+ "description": "Email contact details including response expectations",
13
+ "properties": {
14
+ "address": {
15
+ "type": "string",
16
+ "description": "Email address for form-related inquiries",
17
+ "format": "email",
18
+ "title": "Address"
19
+ },
20
+ "responseTime": {
21
+ "type": "string",
22
+ "description": "Expected response time for email inquiries",
23
+ "title": "Response Time"
24
+ }
25
+ },
26
+ "required": [
27
+ "address",
28
+ "responseTime"
29
+ ],
30
+ "additionalProperties": false,
31
+ "title": "Email"
32
+ },
33
+ "online": {
34
+ "type": "object",
35
+ "description": "Online contact details with URL and descriptive text",
36
+ "properties": {
37
+ "url": {
38
+ "type": "string",
39
+ "description": "URL for online contact method",
40
+ "format": "uri",
41
+ "title": "Url"
42
+ },
43
+ "text": {
44
+ "type": "string",
45
+ "description": "Descriptive text for the online contact link",
46
+ "title": "Text"
47
+ }
48
+ },
49
+ "required": [
50
+ "url",
51
+ "text"
52
+ ],
53
+ "additionalProperties": false,
54
+ "title": "Online"
55
+ }
56
+ },
57
+ "additionalProperties": false,
58
+ "$schema": "http://json-schema.org/draft-07/schema#",
59
+ "title": "Form Metadata Contact Schema",
60
+ "$id": "@defra/forms-model/schemas/form-metadata-contact-schema.json"
61
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "type": "object",
3
+ "description": "Email contact details including response expectations",
4
+ "properties": {
5
+ "address": {
6
+ "type": "string",
7
+ "description": "Email address for form-related inquiries",
8
+ "format": "email",
9
+ "title": "Address"
10
+ },
11
+ "responseTime": {
12
+ "type": "string",
13
+ "description": "Expected response time for email inquiries",
14
+ "title": "Response Time"
15
+ }
16
+ },
17
+ "required": [
18
+ "address",
19
+ "responseTime"
20
+ ],
21
+ "additionalProperties": false,
22
+ "$schema": "http://json-schema.org/draft-07/schema#",
23
+ "title": "Form Metadata Email Schema",
24
+ "$id": "@defra/forms-model/schemas/form-metadata-email-schema.json"
25
+ }
@@ -0,0 +1,127 @@
1
+ {
2
+ "type": "object",
3
+ "description": "Input data for creating or updating form metadata",
4
+ "properties": {
5
+ "title": {
6
+ "type": "string",
7
+ "description": "Title of the form, displayed to users",
8
+ "maxLength": 250,
9
+ "title": "Title"
10
+ },
11
+ "organisation": {
12
+ "type": "string",
13
+ "description": "Defra organisation responsible for the form",
14
+ "enum": [
15
+ "Animal and Plant Health Agency – APHA",
16
+ "Centre for Environment, Fisheries and Aquaculture Science – Cefas",
17
+ "Defra",
18
+ "Environment Agency",
19
+ "Forestry Commission",
20
+ "Marine Management Organisation – MMO",
21
+ "Natural England",
22
+ "Rural Payments Agency – RPA",
23
+ "Veterinary Medicines Directorate – VMD"
24
+ ],
25
+ "title": "Organisation"
26
+ },
27
+ "teamName": {
28
+ "type": "string",
29
+ "description": "Name of the team responsible for the form",
30
+ "maxLength": 100,
31
+ "title": "Team Name"
32
+ },
33
+ "teamEmail": {
34
+ "type": "string",
35
+ "description": "Contact email for the team responsible for the form",
36
+ "format": "email",
37
+ "title": "Team Email"
38
+ },
39
+ "contact": {
40
+ "type": "object",
41
+ "description": "Complete contact information for form-related inquiries",
42
+ "properties": {
43
+ "phone": {
44
+ "type": "string",
45
+ "description": "Phone number for form-related inquiries",
46
+ "title": "Phone"
47
+ },
48
+ "email": {
49
+ "type": "object",
50
+ "description": "Email contact details including response expectations",
51
+ "properties": {
52
+ "address": {
53
+ "type": "string",
54
+ "description": "Email address for form-related inquiries",
55
+ "format": "email",
56
+ "title": "Address"
57
+ },
58
+ "responseTime": {
59
+ "type": "string",
60
+ "description": "Expected response time for email inquiries",
61
+ "title": "Response Time"
62
+ }
63
+ },
64
+ "required": [
65
+ "address",
66
+ "responseTime"
67
+ ],
68
+ "additionalProperties": false,
69
+ "title": "Email"
70
+ },
71
+ "online": {
72
+ "type": "object",
73
+ "description": "Online contact details with URL and descriptive text",
74
+ "properties": {
75
+ "url": {
76
+ "type": "string",
77
+ "description": "URL for online contact method",
78
+ "format": "uri",
79
+ "title": "Url"
80
+ },
81
+ "text": {
82
+ "type": "string",
83
+ "description": "Descriptive text for the online contact link",
84
+ "title": "Text"
85
+ }
86
+ },
87
+ "required": [
88
+ "url",
89
+ "text"
90
+ ],
91
+ "additionalProperties": false,
92
+ "title": "Online"
93
+ }
94
+ },
95
+ "additionalProperties": false,
96
+ "title": "Contact"
97
+ },
98
+ "submissionGuidance": {
99
+ "type": "string",
100
+ "description": "Guidance text shown to users when submitting the form",
101
+ "title": "Submission Guidance"
102
+ },
103
+ "privacyNoticeUrl": {
104
+ "type": "string",
105
+ "description": "URL to the privacy notice for this form",
106
+ "format": "uri",
107
+ "title": "Privacy Notice Url"
108
+ },
109
+ "notificationEmail": {
110
+ "type": "string",
111
+ "description": "Email address to receive form submission notifications, must be a .gov.uk or .org.uk address",
112
+ "format": "email",
113
+ "pattern": "\\.gov\\.uk$|\\.org\\.uk$",
114
+ "title": "Notification Email"
115
+ }
116
+ },
117
+ "required": [
118
+ "title",
119
+ "organisation",
120
+ "teamName",
121
+ "teamEmail"
122
+ ],
123
+ "additionalProperties": false,
124
+ "$schema": "http://json-schema.org/draft-07/schema#",
125
+ "title": "Form Metadata Input Schema",
126
+ "$id": "@defra/forms-model/schemas/form-metadata-input-schema.json"
127
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "type": "object",
3
+ "description": "Online contact details with URL and descriptive text",
4
+ "properties": {
5
+ "url": {
6
+ "type": "string",
7
+ "description": "URL for online contact method",
8
+ "format": "uri",
9
+ "title": "Url"
10
+ },
11
+ "text": {
12
+ "type": "string",
13
+ "description": "Descriptive text for the online contact link",
14
+ "title": "Text"
15
+ }
16
+ },
17
+ "required": [
18
+ "url",
19
+ "text"
20
+ ],
21
+ "additionalProperties": false,
22
+ "$schema": "http://json-schema.org/draft-07/schema#",
23
+ "title": "Form Metadata Online Schema",
24
+ "$id": "@defra/forms-model/schemas/form-metadata-online-schema.json"
25
+ }