@defra/forms-model 3.0.543 → 3.0.544
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.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-submission/types.ts"],"sourcesContent":["import {\n type SubmissionEventMessageCategory,\n type SubmissionEventMessageSchemaVersion,\n type SubmissionEventMessageSource,\n type SubmissionEventMessageType\n} from '~/src/form/form-submission/enums.js'\nimport {\n formSubmitPayloadSchema,\n formSubmitRecordSchema,\n formSubmitRecordsetSchema\n} from '~/src/form/form-submission/index.js'\n\n/**\n * Interface for an individual submit record\n * @see {@link formSubmitRecordSchema}\n */\nexport interface SubmitRecord {\n /**\n * The field name\n */\n name: string\n\n /**\n * The field title\n */\n title: string\n\n /**\n * The field display value\n */\n value: string\n}\n\n/**\n * Interface for an individual submit recordset (e.g. a repeater question set)\n * @see {@link formSubmitRecordsetSchema}\n */\nexport interface SubmitRecordset {\n /**\n * The name of the recordset\n */\n name: string\n\n /**\n * The title of the recordset\n */\n title: string\n\n /**\n * The record items\n */\n value: SubmitRecord[][]\n}\n\n/**\n * Interface for the submission-api `/submit` payload\n * @see {@link formSubmitPayloadSchema}\n */\nexport interface SubmitPayload {\n /**\n * The retrieval key for files created in the submission\n */\n retrievalKey: string\n\n /**\n * The id of the user session\n */\n sessionId: string\n\n /**\n * The main form anwsers\n */\n main: SubmitRecord[]\n\n /**\n * The repeaters form answers\n */\n repeaters: SubmitRecordset[]\n}\n\n/**\n * Interface for the submission-api `/submit` response payload\n */\nexport interface SubmitResponsePayload {\n message: string\n result: {\n files: {\n main: string\n repeaters: Record<string, string>\n }\n }\n}\n\nexport interface SaveAndExitMessageData {\n formId: string\n email: string\n security: {\n question: string\n answer: string\n }\n state: object\n}\n\nexport type SubmissionMessageData = SaveAndExitMessageData\n\nexport interface SubmissionMessage {\n schemaVersion: SubmissionEventMessageSchemaVersion\n category: SubmissionEventMessageCategory\n source: SubmissionEventMessageSource\n type: SubmissionEventMessageType\n entityId: string\n traceId?: string\n createdAt: Date\n messageCreatedAt: Date\n data: SubmissionMessageData\n}\n\nexport interface SaveAndExitMessage extends SubmissionMessage {\n category: SubmissionEventMessageCategory.RUNNER\n type: SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT\n}\n\nexport type RunnerMessage = SaveAndExitMessage\n"],"mappings":"","ignoreList":[]}
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-submission/types.ts"],"sourcesContent":["import {\n type SubmissionEventMessageCategory,\n type SubmissionEventMessageSchemaVersion,\n type SubmissionEventMessageSource,\n type SubmissionEventMessageType\n} from '~/src/form/form-submission/enums.js'\nimport {\n formSubmitPayloadSchema,\n formSubmitRecordSchema,\n formSubmitRecordsetSchema\n} from '~/src/form/form-submission/index.js'\n\n/**\n * Interface for an individual submit record\n * @see {@link formSubmitRecordSchema}\n */\nexport interface SubmitRecord {\n /**\n * The field name\n */\n name: string\n\n /**\n * The field title\n */\n title: string\n\n /**\n * The field display value\n */\n value: string\n}\n\n/**\n * Interface for an individual submit recordset (e.g. a repeater question set)\n * @see {@link formSubmitRecordsetSchema}\n */\nexport interface SubmitRecordset {\n /**\n * The name of the recordset\n */\n name: string\n\n /**\n * The title of the recordset\n */\n title: string\n\n /**\n * The record items\n */\n value: SubmitRecord[][]\n}\n\n/**\n * Interface for the submission-api `/submit` payload\n * @see {@link formSubmitPayloadSchema}\n */\nexport interface SubmitPayload {\n /**\n * The retrieval key for files created in the submission\n */\n retrievalKey: string\n\n /**\n * The id of the user session\n */\n sessionId: string\n\n /**\n * The main form anwsers\n */\n main: SubmitRecord[]\n\n /**\n * The repeaters form answers\n */\n repeaters: SubmitRecordset[]\n}\n\n/**\n * Interface for the submission-api `/submit` response payload\n */\nexport interface SubmitResponsePayload {\n message: string\n result: {\n files: {\n main: string\n repeaters: Record<string, string>\n }\n }\n}\n\nexport interface SaveAndExitMessageData {\n formId: string\n email: string\n security: {\n question: string\n answer: string\n }\n state: object\n}\n\nexport type SubmissionMessageData = SaveAndExitMessageData\n\nexport interface SubmissionMessage {\n schemaVersion: SubmissionEventMessageSchemaVersion\n category: SubmissionEventMessageCategory\n source: SubmissionEventMessageSource\n type: SubmissionEventMessageType\n entityId: string\n traceId?: string\n createdAt: Date\n messageCreatedAt: Date\n data: SubmissionMessageData\n}\n\nexport interface SaveAndExitMessage extends SubmissionMessage {\n category: SubmissionEventMessageCategory.RUNNER\n type: SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT\n}\n\nexport type RunnerMessage = SaveAndExitMessage\n\nexport interface RunnerRecordBase {\n messageId: string\n recordCreatedAt: Date\n}\n\nexport interface RunnerRecordInputMeta extends RunnerRecordBase {\n id: string\n}\n\nexport type RunnerRecordInput = RunnerMessage & RunnerRecordBase\n\nexport type RunnerRecord = RunnerMessage & RunnerRecordInputMeta\n"],"mappings":"","ignoreList":[]}
|
@@ -95,4 +95,13 @@ export interface SaveAndExitMessage extends SubmissionMessage {
|
|
95
95
|
type: SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT;
|
96
96
|
}
|
97
97
|
export type RunnerMessage = SaveAndExitMessage;
|
98
|
+
export interface RunnerRecordBase {
|
99
|
+
messageId: string;
|
100
|
+
recordCreatedAt: Date;
|
101
|
+
}
|
102
|
+
export interface RunnerRecordInputMeta extends RunnerRecordBase {
|
103
|
+
id: string;
|
104
|
+
}
|
105
|
+
export type RunnerRecordInput = RunnerMessage & RunnerRecordBase;
|
106
|
+
export type RunnerRecord = RunnerMessage & RunnerRecordInputMeta;
|
98
107
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-submission/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAChC,MAAM,qCAAqC,CAAA;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MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,IAAI,CAAA;IACf,gBAAgB,EAAE,IAAI,CAAA;IACtB,IAAI,EAAE,qBAAqB,CAAA;CAC5B;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,QAAQ,EAAE,8BAA8B,CAAC,MAAM,CAAA;IAC/C,IAAI,EAAE,0BAA0B,CAAC,oBAAoB,CAAA;CACtD;AAED,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAA"}
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-submission/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAChC,MAAM,qCAAqC,CAAA;AAO5C;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,EAAE,YAAY,EAAE,EAAE,CAAA;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,IAAI,EAAE,YAAY,EAAE,CAAA;IAEpB;;OAEG;IACH,SAAS,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE;QACN,KAAK,EAAE;YACL,IAAI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
121
121
|
}
|
122
122
|
|
123
123
|
export type RunnerMessage = SaveAndExitMessage
|
124
|
+
|
125
|
+
export interface RunnerRecordBase {
|
126
|
+
messageId: string
|
127
|
+
recordCreatedAt: Date
|
128
|
+
}
|
129
|
+
|
130
|
+
export interface RunnerRecordInputMeta extends RunnerRecordBase {
|
131
|
+
id: string
|
132
|
+
}
|
133
|
+
|
134
|
+
export type RunnerRecordInput = RunnerMessage & RunnerRecordBase
|
135
|
+
|
136
|
+
export type RunnerRecord = RunnerMessage & RunnerRecordInputMeta
|