@defra/forms-model 3.0.553 → 3.0.554
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.
@@ -9,7 +9,7 @@ export const formSubmitRecordSchema = Joi.object({
|
|
9
9
|
name: Joi.string().required().description('Field identifier matching the component name'),
|
10
10
|
title: Joi.string().required().description('Human-readable label for the field'),
|
11
11
|
value: Joi.string().required().allow('').description('User-submitted value for the field, may be empty')
|
12
|
-
}).description('Individual field value in a form submission');
|
12
|
+
}).label('FormSubmitRecord').description('Individual field value in a form submission');
|
13
13
|
|
14
14
|
/**
|
15
15
|
* Joi schema for `SubmitRecordset` interface
|
@@ -18,8 +18,8 @@ export const formSubmitRecordSchema = Joi.object({
|
|
18
18
|
export const formSubmitRecordsetSchema = Joi.object({
|
19
19
|
name: Joi.string().required().description('Identifier for the repeatable section'),
|
20
20
|
title: Joi.string().required().description('Human-readable title for the repeatable section'),
|
21
|
-
value: Joi.array().items(Joi.array().items(formSubmitRecordSchema).required()).required().description('Array of record arrays, each representing a repeated instance')
|
22
|
-
}).description('Collection of repeated field values from a repeatable section');
|
21
|
+
value: Joi.array().items(Joi.array().items(formSubmitRecordSchema).required().label('FormSubmitRecordGroup')).required().description('Array of record arrays, each representing a repeated instance')
|
22
|
+
}).label('FormSubmitRecordset').description('Collection of repeated field values from a repeatable section');
|
23
23
|
|
24
24
|
/**
|
25
25
|
* Joi schema for `SubmitPayload` interface
|
@@ -30,22 +30,22 @@ export const formSubmitPayloadSchema = Joi.object().keys({
|
|
30
30
|
sessionId: Joi.string().required().description('User session identifier for tracking and security'),
|
31
31
|
main: Joi.array().items(formSubmitRecordSchema).required().description('Main (non-repeating) field values from the form'),
|
32
32
|
repeaters: Joi.array().items(formSubmitRecordsetSchema).required().description('Repeatable section values from the form')
|
33
|
-
}).required().description('Complete form submission payload structure with all form data');
|
33
|
+
}).required().label('FormSubmitPayload').description('Complete form submission payload structure with all form data');
|
34
34
|
export const saveAndExitMessageData = Joi.object().keys({
|
35
|
-
form: {
|
35
|
+
form: Joi.object({
|
36
36
|
id: Joi.string().required(),
|
37
37
|
title: Joi.string().required(),
|
38
38
|
status: Joi.string().valid(FormStatus.Draft, FormStatus.Live).required(),
|
39
39
|
isPreview: Joi.boolean().required(),
|
40
40
|
baseUrl: Joi.string().required()
|
41
|
-
},
|
41
|
+
}).label('SaveAndExitForm'),
|
42
42
|
email: Joi.string().required(),
|
43
|
-
security: {
|
43
|
+
security: Joi.object({
|
44
44
|
question: Joi.string().valid(...Object.values(SecurityQuestionsEnum).map(value => value.toString())).required(),
|
45
45
|
answer: Joi.string().required()
|
46
|
-
},
|
46
|
+
}).label('SaveAndExitSecurity'),
|
47
47
|
state: Joi.object().required()
|
48
|
-
});
|
48
|
+
}).label('SaveAndExitMessageData');
|
49
49
|
export const submissionMessageSchema = Joi.object().keys({
|
50
50
|
schemaVersion: Joi.string().valid(...Object.values(SubmissionEventMessageSchemaVersion)).required().description('The version of the SubmissionMessage - bumped with breaking changes'),
|
51
51
|
category: Joi.string().valid(...Object.values(SubmissionEventMessageCategory)).required().description('The message category - what does the entityId represent?'),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":["Joi","FormStatus","SecurityQuestionsEnum","SubmissionEventMessageCategory","SubmissionEventMessageSchemaVersion","SubmissionEventMessageSource","SubmissionEventMessageType","formSubmitRecordSchema","object","name","string","required","description","title","value","allow","formSubmitRecordsetSchema","array","items","formSubmitPayloadSchema","keys","retrievalKey","sessionId","main","repeaters","saveAndExitMessageData","form","id","status","valid","Draft","Live","isPreview","boolean","baseUrl","email","security","question","Object","values","map","toString","answer","state","submissionMessageSchema","schemaVersion","category","source","type","createdAt","date","messageCreatedAt","data"],"sources":["../../../../src/form/form-submission/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { FormStatus } from '~/src/common/enums.js'\nimport {\n SecurityQuestionsEnum,\n SubmissionEventMessageCategory,\n SubmissionEventMessageSchemaVersion,\n SubmissionEventMessageSource,\n SubmissionEventMessageType\n} from '~/src/form/form-submission/enums.js'\nimport {\n type SaveAndExitMessage,\n type SaveAndExitMessageData,\n type SubmitPayload,\n type SubmitRecord,\n type SubmitRecordset\n} from '~/src/form/form-submission/types.js'\n\n/**\n * Joi schema for `SubmitRecord` interface\n * @see {@link SubmitRecord}\n */\nexport const formSubmitRecordSchema = Joi.object<SubmitRecord>({\n name: Joi.string()\n .required()\n .description('Field identifier matching the component name'),\n title: Joi.string()\n .required()\n .description('Human-readable label for the field'),\n value: Joi.string()\n .required()\n .allow('')\n .description('User-submitted value for the field, may be empty')\n}).description('Individual field value in a form submission')\n\n/**\n * Joi schema for `SubmitRecordset` interface\n * @see {@link SubmitRecordset}\n */\nexport const formSubmitRecordsetSchema = Joi.object<SubmitRecordset>({\n name: Joi.string()\n .required()\n .description('Identifier for the repeatable section'),\n title: Joi.string()\n .required()\n .description('Human-readable title for the repeatable section'),\n value: Joi.array<SubmitRecord[]>()\n .items(Joi.array<SubmitRecord>().items(formSubmitRecordSchema).required())\n .required()\n .description(\n 'Array of record arrays, each representing a repeated instance'\n )\n}).description('Collection of repeated field values from a repeatable section')\n\n/**\n * Joi schema for `SubmitPayload` interface\n * @see {@link SubmitPayload}\n */\nexport const formSubmitPayloadSchema = Joi.object<SubmitPayload>()\n .keys({\n retrievalKey: Joi.string()\n .required()\n .description('Unique key to retrieve this submission later'),\n sessionId: Joi.string()\n .required()\n .description('User session identifier for tracking and security'),\n main: Joi.array<SubmitRecord>()\n .items(formSubmitRecordSchema)\n .required()\n .description('Main (non-repeating) field values from the form'),\n repeaters: Joi.array<SubmitRecordset>()\n .items(formSubmitRecordsetSchema)\n .required()\n .description('Repeatable section values from the form')\n })\n .required()\n .description('Complete form submission payload structure with all form data')\n\nexport const saveAndExitMessageData = Joi.object<SaveAndExitMessageData>().keys(
|
1
|
+
{"version":3,"file":"index.js","names":["Joi","FormStatus","SecurityQuestionsEnum","SubmissionEventMessageCategory","SubmissionEventMessageSchemaVersion","SubmissionEventMessageSource","SubmissionEventMessageType","formSubmitRecordSchema","object","name","string","required","description","title","value","allow","label","formSubmitRecordsetSchema","array","items","formSubmitPayloadSchema","keys","retrievalKey","sessionId","main","repeaters","saveAndExitMessageData","form","id","status","valid","Draft","Live","isPreview","boolean","baseUrl","email","security","question","Object","values","map","toString","answer","state","submissionMessageSchema","schemaVersion","category","source","type","createdAt","date","messageCreatedAt","data"],"sources":["../../../../src/form/form-submission/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { FormStatus } from '~/src/common/enums.js'\nimport {\n SecurityQuestionsEnum,\n SubmissionEventMessageCategory,\n SubmissionEventMessageSchemaVersion,\n SubmissionEventMessageSource,\n SubmissionEventMessageType\n} from '~/src/form/form-submission/enums.js'\nimport {\n type SaveAndExitMessage,\n type SaveAndExitMessageData,\n type SubmitPayload,\n type SubmitRecord,\n type SubmitRecordset\n} from '~/src/form/form-submission/types.js'\n\n/**\n * Joi schema for `SubmitRecord` interface\n * @see {@link SubmitRecord}\n */\nexport const formSubmitRecordSchema = Joi.object<SubmitRecord>({\n name: Joi.string()\n .required()\n .description('Field identifier matching the component name'),\n title: Joi.string()\n .required()\n .description('Human-readable label for the field'),\n value: Joi.string()\n .required()\n .allow('')\n .description('User-submitted value for the field, may be empty')\n})\n .label('FormSubmitRecord')\n .description('Individual field value in a form submission')\n\n/**\n * Joi schema for `SubmitRecordset` interface\n * @see {@link SubmitRecordset}\n */\nexport const formSubmitRecordsetSchema = Joi.object<SubmitRecordset>({\n name: Joi.string()\n .required()\n .description('Identifier for the repeatable section'),\n title: Joi.string()\n .required()\n .description('Human-readable title for the repeatable section'),\n value: Joi.array<SubmitRecord[]>()\n .items(\n Joi.array<SubmitRecord>()\n .items(formSubmitRecordSchema)\n .required()\n .label('FormSubmitRecordGroup')\n )\n .required()\n .description(\n 'Array of record arrays, each representing a repeated instance'\n )\n})\n .label('FormSubmitRecordset')\n .description('Collection of repeated field values from a repeatable section')\n\n/**\n * Joi schema for `SubmitPayload` interface\n * @see {@link SubmitPayload}\n */\nexport const formSubmitPayloadSchema = Joi.object<SubmitPayload>()\n .keys({\n retrievalKey: Joi.string()\n .required()\n .description('Unique key to retrieve this submission later'),\n sessionId: Joi.string()\n .required()\n .description('User session identifier for tracking and security'),\n main: Joi.array<SubmitRecord>()\n .items(formSubmitRecordSchema)\n .required()\n .description('Main (non-repeating) field values from the form'),\n repeaters: Joi.array<SubmitRecordset>()\n .items(formSubmitRecordsetSchema)\n .required()\n .description('Repeatable section values from the form')\n })\n .required()\n .label('FormSubmitPayload')\n .description('Complete form submission payload structure with all form data')\n\nexport const saveAndExitMessageData = Joi.object<SaveAndExitMessageData>()\n .keys({\n form: Joi.object({\n id: Joi.string().required(),\n title: Joi.string().required(),\n status: Joi.string().valid(FormStatus.Draft, FormStatus.Live).required(),\n isPreview: Joi.boolean().required(),\n baseUrl: Joi.string().required()\n }).label('SaveAndExitForm'),\n email: Joi.string().required(),\n security: Joi.object({\n question: Joi.string()\n .valid(\n ...Object.values(SecurityQuestionsEnum).map((value) =>\n value.toString()\n )\n )\n .required(),\n answer: Joi.string().required()\n }).label('SaveAndExitSecurity'),\n state: Joi.object().required()\n })\n .label('SaveAndExitMessageData')\n\nexport const submissionMessageSchema = Joi.object<SaveAndExitMessage>().keys({\n schemaVersion: Joi.string()\n .valid(...Object.values(SubmissionEventMessageSchemaVersion))\n .required()\n .description(\n 'The version of the SubmissionMessage - bumped with breaking changes'\n ),\n category: Joi.string()\n .valid(...Object.values(SubmissionEventMessageCategory))\n .required()\n .description('The message category - what does the entityId represent?'),\n source: Joi.string()\n .valid(...Object.values(SubmissionEventMessageSource))\n .required()\n .description('Source of the message - which service?'),\n type: Joi.string()\n .valid(...Object.values(SubmissionEventMessageType))\n .description('Event type'),\n createdAt: Joi.date()\n .required()\n .description(\n 'The ISO timestamp where the action took place - should be the same as updated_at field in DB'\n ),\n messageCreatedAt: Joi.date()\n .required()\n .description('ISO timestamp when the message was published'),\n data: saveAndExitMessageData\n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CACvDQ,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,0DAA0D,CAAC;EAC1EoC,MAAM,EAAEhD,GAAG,CAACU,MAAM,CAAC,CAAC,CACjBoB,KAAK,CAAC,GAAGS,MAAM,CAACC,MAAM,CAACnC,4BAA4B,CAAC,CAAC,CACrDM,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,wCAAwC,CAAC;EACxDqC,IAAI,EAAEjD,GAAG,CAACU,MAAM,CAAC,CAAC,CACfoB,KAAK,CAAC,GAAGS,MAAM,CAACC,MAAM,CAAClC,0BAA0B,CAAC,CAAC,CACnDM,WAAW,CAAC,YAAY,CAAC;EAC5BsC,SAAS,EAAElD,GAAG,CAACmD,IAAI,CAAC,CAAC,CAClBxC,QAAQ,CAAC,CAAC,CACVC,WAAW,CACV,8FACF,CAAC;EACHwC,gBAAgB,EAAEpD,GAAG,CAACmD,IAAI,CAAC,CAAC,CACzBxC,QAAQ,CAAC,CAAC,CACVC,WAAW,CAAC,8CAA8C,CAAC;EAC9DyC,IAAI,EAAE3B;AACR,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-submission/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAUrB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,qCAAqC,CAAA;AAE5C;;;GAGG;AACH,eAAO,MAAM,sBAAsB,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/form-submission/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAUrB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,qCAAqC,CAAA;AAE5C;;;GAGG;AACH,eAAO,MAAM,sBAAsB,gCAa0B,CAAA;AAE7D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,mCAoByC,CAAA;AAE/E;;;GAGG;AACH,eAAO,MAAM,uBAAuB,iCAmB2C,CAAA;AAE/E,eAAO,MAAM,sBAAsB,0CAsBD,CAAA;AAElC,eAAO,MAAM,uBAAuB,sCA2BlC,CAAA"}
|
package/package.json
CHANGED
@@ -31,7 +31,9 @@ export const formSubmitRecordSchema = Joi.object<SubmitRecord>({
|
|
31
31
|
.required()
|
32
32
|
.allow('')
|
33
33
|
.description('User-submitted value for the field, may be empty')
|
34
|
-
})
|
34
|
+
})
|
35
|
+
.label('FormSubmitRecord')
|
36
|
+
.description('Individual field value in a form submission')
|
35
37
|
|
36
38
|
/**
|
37
39
|
* Joi schema for `SubmitRecordset` interface
|
@@ -45,12 +47,19 @@ export const formSubmitRecordsetSchema = Joi.object<SubmitRecordset>({
|
|
45
47
|
.required()
|
46
48
|
.description('Human-readable title for the repeatable section'),
|
47
49
|
value: Joi.array<SubmitRecord[]>()
|
48
|
-
.items(
|
50
|
+
.items(
|
51
|
+
Joi.array<SubmitRecord>()
|
52
|
+
.items(formSubmitRecordSchema)
|
53
|
+
.required()
|
54
|
+
.label('FormSubmitRecordGroup')
|
55
|
+
)
|
49
56
|
.required()
|
50
57
|
.description(
|
51
58
|
'Array of record arrays, each representing a repeated instance'
|
52
59
|
)
|
53
|
-
})
|
60
|
+
})
|
61
|
+
.label('FormSubmitRecordset')
|
62
|
+
.description('Collection of repeated field values from a repeatable section')
|
54
63
|
|
55
64
|
/**
|
56
65
|
* Joi schema for `SubmitPayload` interface
|
@@ -74,19 +83,20 @@ export const formSubmitPayloadSchema = Joi.object<SubmitPayload>()
|
|
74
83
|
.description('Repeatable section values from the form')
|
75
84
|
})
|
76
85
|
.required()
|
86
|
+
.label('FormSubmitPayload')
|
77
87
|
.description('Complete form submission payload structure with all form data')
|
78
88
|
|
79
|
-
export const saveAndExitMessageData = Joi.object<SaveAndExitMessageData>()
|
80
|
-
{
|
81
|
-
form: {
|
89
|
+
export const saveAndExitMessageData = Joi.object<SaveAndExitMessageData>()
|
90
|
+
.keys({
|
91
|
+
form: Joi.object({
|
82
92
|
id: Joi.string().required(),
|
83
93
|
title: Joi.string().required(),
|
84
94
|
status: Joi.string().valid(FormStatus.Draft, FormStatus.Live).required(),
|
85
95
|
isPreview: Joi.boolean().required(),
|
86
96
|
baseUrl: Joi.string().required()
|
87
|
-
},
|
97
|
+
}).label('SaveAndExitForm'),
|
88
98
|
email: Joi.string().required(),
|
89
|
-
security: {
|
99
|
+
security: Joi.object({
|
90
100
|
question: Joi.string()
|
91
101
|
.valid(
|
92
102
|
...Object.values(SecurityQuestionsEnum).map((value) =>
|
@@ -95,10 +105,10 @@ export const saveAndExitMessageData = Joi.object<SaveAndExitMessageData>().keys(
|
|
95
105
|
)
|
96
106
|
.required(),
|
97
107
|
answer: Joi.string().required()
|
98
|
-
},
|
108
|
+
}).label('SaveAndExitSecurity'),
|
99
109
|
state: Joi.object().required()
|
100
|
-
}
|
101
|
-
)
|
110
|
+
})
|
111
|
+
.label('SaveAndExitMessageData')
|
102
112
|
|
103
113
|
export const submissionMessageSchema = Joi.object<SaveAndExitMessage>().keys({
|
104
114
|
schemaVersion: Joi.string()
|