@defra/forms-model 3.0.549 → 3.0.550
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 { type FormStatus } from '~/src/common/enums.js'\nimport {\n type SecurityQuestionsEnum,\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 form: {\n id: string\n title: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n security: {\n question: SecurityQuestionsEnum\n answer: string\n }\n state: object\n}\n\nexport interface SaveAndExitMessage {\n schemaVersion: SubmissionEventMessageSchemaVersion\n source: SubmissionEventMessageSource\n createdAt: Date\n messageCreatedAt: Date\n category: SubmissionEventMessageCategory.RUNNER\n type: SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT\n data: SaveAndExitMessageData\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":[]}
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-submission/types.ts"],"sourcesContent":["import { type FormStatus } from '~/src/common/enums.js'\nimport {\n type SecurityQuestionsEnum,\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 form: {\n id: string\n title: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n security: {\n question: SecurityQuestionsEnum\n answer: string\n }\n state: object\n}\n\nexport interface SaveAndExitMessage {\n schemaVersion: SubmissionEventMessageSchemaVersion\n source: SubmissionEventMessageSource\n createdAt: Date\n messageCreatedAt: Date\n category: SubmissionEventMessageCategory.RUNNER\n type: SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT\n data: SaveAndExitMessageData\n}\n\nexport interface SaveAndExitRecord {\n magicLinkId: string\n form: {\n id: string\n status: FormStatus\n isPreview: boolean\n baseUrl: string\n }\n email: string\n security: {\n question: SecurityQuestionsEnum\n answer: string\n }\n state: object\n invalidPasswordAttempts: number\n createdAt: Date\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":[]}
|
@@ -94,6 +94,23 @@ export interface SaveAndExitMessage {
|
|
94
94
|
type: SubmissionEventMessageType.RUNNER_SAVE_AND_EXIT;
|
95
95
|
data: SaveAndExitMessageData;
|
96
96
|
}
|
97
|
+
export interface SaveAndExitRecord {
|
98
|
+
magicLinkId: string;
|
99
|
+
form: {
|
100
|
+
id: string;
|
101
|
+
status: FormStatus;
|
102
|
+
isPreview: boolean;
|
103
|
+
baseUrl: string;
|
104
|
+
};
|
105
|
+
email: string;
|
106
|
+
security: {
|
107
|
+
question: SecurityQuestionsEnum;
|
108
|
+
answer: string;
|
109
|
+
};
|
110
|
+
state: object;
|
111
|
+
invalidPasswordAttempts: number;
|
112
|
+
createdAt: Date;
|
113
|
+
}
|
97
114
|
export type RunnerMessage = SaveAndExitMessage;
|
98
115
|
export interface RunnerRecordBase {
|
99
116
|
messageId: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-submission/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EACL,KAAK,qBAAqB,EAC1B,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,EAAE,MAAM,CAAA;YACZ,SAAS,EAAE,MAAM,C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AM,CAAA;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,mCAAmC,CAAA;IAClD,MAAM,EAAE,4BAA4B,CAAA;IACpC,SAAS,EAAE,IAAI,CAAA;IACf,gBAAgB,EAAE,IAAI,CAAA;IACtB,QAAQ,EAAE,8BAA8B,CAAC,MAAM,CAAA;IAC/C,IAAI,EAAE,0BAA0B,CAAC,oBAAoB,CAAA;IACrD,IAAI,EAAE,sBAAsB,CAAA;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,MAAM,EAAE,UAAU,CAAA;QAClB,SAAS,EAAE,OAAO,CAAA;QAClB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE;QACR,QAAQ,EAAE,qBAAqB,CAAA;QAC/B,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IACD,KAAK,EAAE,MAAM,CAAA;IACb,uBAAuB,EAAE,MAAM,CAAA;IAC/B,SAAS,EAAE,IAAI,CAAA;CAChB;AAED,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAA;AAE9C,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,gBAAgB,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,qBAAqB,CAAA"}
|
package/package.json
CHANGED
@@ -119,6 +119,24 @@ export interface SaveAndExitMessage {
|
|
119
119
|
data: SaveAndExitMessageData
|
120
120
|
}
|
121
121
|
|
122
|
+
export interface SaveAndExitRecord {
|
123
|
+
magicLinkId: string
|
124
|
+
form: {
|
125
|
+
id: string
|
126
|
+
status: FormStatus
|
127
|
+
isPreview: boolean
|
128
|
+
baseUrl: string
|
129
|
+
}
|
130
|
+
email: string
|
131
|
+
security: {
|
132
|
+
question: SecurityQuestionsEnum
|
133
|
+
answer: string
|
134
|
+
}
|
135
|
+
state: object
|
136
|
+
invalidPasswordAttempts: number
|
137
|
+
createdAt: Date
|
138
|
+
}
|
139
|
+
|
122
140
|
export type RunnerMessage = SaveAndExitMessage
|
123
141
|
|
124
142
|
export interface RunnerRecordBase {
|