@defra/forms-model 3.0.100 → 3.0.101

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.
@@ -54,7 +54,7 @@ export const formMetadataStateSchema = Joi.object().keys({
54
54
  export const formMetadataSchema = formMetadataInputSchema.append({
55
55
  id: idSchema,
56
56
  slug: slugSchema,
57
- draft: formMetadataStateSchema.required(),
57
+ draft: formMetadataStateSchema,
58
58
  live: formMetadataStateSchema
59
59
  });
60
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","organisations","idSchema","string","hex","length","required","titleSchema","max","trim","slugSchema","pattern","name","organisationSchema","valid","teamNameSchema","teamEmailSchema","email","tlds","allow","authoredAtSchema","date","iso","authorIdSchema","uuid","authorDisplayNameSchema","formMetadataInputSchema","object","keys","title","organisation","teamName","teamEmail","formMetadataAuthorSchema","id","displayName","formMetadataStateSchema","createdAt","createdBy","updatedAt","updatedBy","formMetadataSchema","append","slug","draft","live"],"sources":["../../../../src/form/form-metadata/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type FormMetadata,\n type FormMetadataInput,\n type FormMetadataState,\n type FormMetadataAuthor\n} from '~/src/form/form-metadata/types.js'\n\nexport const organisations = [\n 'Animal and Plant Health Agency – APHA',\n 'Centre for Environment, Fisheries and Aquaculture Science – Cefas',\n 'Defra',\n 'Environment Agency',\n 'Forestry Commission',\n 'Marine Management Organisation – MMO',\n 'Natural England',\n 'Rural Payments Agency – RPA',\n 'Veterinary Medicines Directorate – VMD'\n]\n\nexport const idSchema = Joi.string().hex().length(24).required()\nexport const titleSchema = Joi.string().max(250).trim().required()\nexport const slugSchema = Joi.string()\n .pattern(/^[a-z0-9-]+$/, { name: 'letters, numbers and hyphens only' })\n .required()\n\nexport const organisationSchema = Joi.string()\n .valid(...organisations)\n .required()\n\nexport const teamNameSchema = Joi.string().max(100).trim().required()\nexport const teamEmailSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .required()\n\nexport const authoredAtSchema = Joi.date().iso().required()\nexport const authorIdSchema = Joi.string().uuid().trim().required()\nexport const authorDisplayNameSchema = Joi.string().trim().required()\n\n/**\n * Joi schema for `FormMetadataInput` interface\n * @see {@link FormMetadataInput}\n */\nexport const formMetadataInputSchema = Joi.object<FormMetadataInput>()\n .keys({\n title: titleSchema,\n organisation: organisationSchema,\n teamName: teamNameSchema,\n teamEmail: teamEmailSchema\n })\n .required()\n\n/**\n * Joi schema for `FormMetadataAuthor` interface\n * @see {@link FormMetadataAuthor}\n */\nexport const formMetadataAuthorSchema = Joi.object<FormMetadataAuthor>()\n .keys({\n id: authorIdSchema,\n displayName: authorDisplayNameSchema\n })\n .required()\n\n/**\n * Joi schema for `FormMetadataState` interface\n * @see {@link FormMetadataState}\n */\nexport const formMetadataStateSchema = Joi.object<FormMetadataState>().keys({\n createdAt: authoredAtSchema,\n createdBy: formMetadataAuthorSchema,\n updatedAt: authoredAtSchema,\n updatedBy: formMetadataAuthorSchema\n})\n\n/**\n * Joi schema for `FormMetadata` interface\n * @see {@link FormMetadata}\n */\nexport const formMetadataSchema = formMetadataInputSchema.append<FormMetadata>({\n id: idSchema,\n slug: slugSchema,\n draft: formMetadataStateSchema.required(),\n live: formMetadataStateSchema\n})\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AASrB,OAAO,MAAMC,aAAa,GAAG,CAC3B,uCAAuC,EACvC,mEAAmE,EACnE,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EACrB,sCAAsC,EACtC,iBAAiB,EACjB,6BAA6B,EAC7B,wCAAwC,CACzC;AAED,OAAO,MAAMC,QAAQ,GAAGF,GAAG,CAACG,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC;AAChE,OAAO,MAAMC,WAAW,GAAGP,GAAG,CAACG,MAAM,CAAC,CAAC,CAACK,G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B,YAAY,EAAEjB,kBAAkB;EAChCkB,QAAQ,EAAEhB,cAAc;EACxBiB,SAAS,EAAEhB;AACb,CAAC,CAAC,CACDV,QAAQ,CAAC,CAAC;;AAEb;AACA;AACA;AACA;AACA,OAAO,MAAM2B,wBAAwB,GAAGjC,GAAG,CAAC2B,MAAM,CAAqB,CAAC,CACrEC,IAAI,CAAC;EACJM,EAAE,EAAEX,cAAc;EAClBY,WAAW,EAAEV;AACf,CAAC,CAAC,CACDnB,QAAQ,CAAC,CAAC;;AAEb;AACA;AACA;AACA;AACA,OAAO,MAAM8B,uBAAuB,GAAGpC,GAAG,CAAC2B,MAAM,CAAoB,CAAC,CAACC,IAAI,CAAC;EAC1ES,SAAS,EAAEjB,gBAAgB;EAC3BkB,SAAS,EAAEL,wBAAwB;EACnCM,SAAS,EAAEnB,gBAAgB;EAC3BoB,SAAS,EAAEP;AACb,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA,OAAO,MAAMQ,kBAAkB,GAAGf,uBAAuB,CAACgB,MAAM,CAAe;EAC7ER,EAAE,EAAEhC,QAAQ;EACZyC,IAAI,EAAEjC,UAAU;EAChBkC,KAAK,EAAER,uBAAuB,CAAC9B,QAAQ,CAAC,CAAC;EACzCuC,IAAI,EAAET;AACR,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","organisations","idSchema","string","hex","length","required","titleSchema","max","trim","slugSchema","pattern","name","organisationSchema","valid","teamNameSchema","teamEmailSchema","email","tlds","allow","authoredAtSchema","date","iso","authorIdSchema","uuid","authorDisplayNameSchema","formMetadataInputSchema","object","keys","title","organisation","teamName","teamEmail","formMetadataAuthorSchema","id","displayName","formMetadataStateSchema","createdAt","createdBy","updatedAt","updatedBy","formMetadataSchema","append","slug","draft","live"],"sources":["../../../../src/form/form-metadata/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport {\n type FormMetadata,\n type FormMetadataInput,\n type FormMetadataState,\n type FormMetadataAuthor\n} from '~/src/form/form-metadata/types.js'\n\nexport const organisations = [\n 'Animal and Plant Health Agency – APHA',\n 'Centre for Environment, Fisheries and Aquaculture Science – Cefas',\n 'Defra',\n 'Environment Agency',\n 'Forestry Commission',\n 'Marine Management Organisation – MMO',\n 'Natural England',\n 'Rural Payments Agency – RPA',\n 'Veterinary Medicines Directorate – VMD'\n]\n\nexport const idSchema = Joi.string().hex().length(24).required()\nexport const titleSchema = Joi.string().max(250).trim().required()\nexport const slugSchema = Joi.string()\n .pattern(/^[a-z0-9-]+$/, { name: 'letters, numbers and hyphens only' })\n .required()\n\nexport const organisationSchema = Joi.string()\n .valid(...organisations)\n .required()\n\nexport const teamNameSchema = Joi.string().max(100).trim().required()\nexport const teamEmailSchema = Joi.string()\n .email({ tlds: { allow: ['uk'] } })\n .trim()\n .required()\n\nexport const authoredAtSchema = Joi.date().iso().required()\nexport const authorIdSchema = Joi.string().uuid().trim().required()\nexport const authorDisplayNameSchema = Joi.string().trim().required()\n\n/**\n * Joi schema for `FormMetadataInput` interface\n * @see {@link FormMetadataInput}\n */\nexport const formMetadataInputSchema = Joi.object<FormMetadataInput>()\n .keys({\n title: titleSchema,\n organisation: organisationSchema,\n teamName: teamNameSchema,\n teamEmail: teamEmailSchema\n })\n .required()\n\n/**\n * Joi schema for `FormMetadataAuthor` interface\n * @see {@link FormMetadataAuthor}\n */\nexport const formMetadataAuthorSchema = Joi.object<FormMetadataAuthor>()\n .keys({\n id: authorIdSchema,\n displayName: authorDisplayNameSchema\n })\n .required()\n\n/**\n * Joi schema for `FormMetadataState` interface\n * @see {@link FormMetadataState}\n */\nexport const formMetadataStateSchema = Joi.object<FormMetadataState>().keys({\n createdAt: authoredAtSchema,\n createdBy: formMetadataAuthorSchema,\n updatedAt: authoredAtSchema,\n updatedBy: formMetadataAuthorSchema\n})\n\n/**\n * Joi schema for `FormMetadata` interface\n * @see {@link FormMetadata}\n */\nexport const formMetadataSchema = formMetadataInputSchema.append<FormMetadata>({\n id: idSchema,\n slug: slugSchema,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ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-metadata/types.ts"],"sourcesContent":["import { formMetadataSchema } from '~/src/form/form-metadata/index.js'\n\n/**\n * Interface for author (createdBy and updatedBy)\n */\nexport interface FormMetadataAuthor {\n /**\n * The ID of the user\n */\n id: string\n\n /**\n * The display name of the user\n */\n displayName: string\n}\n\n/**\n * Interface for metadata state (draft & live)\n */\nexport interface FormMetadataState {\n /**\n * The date the form state was created\n */\n createdAt: Date\n\n /**\n * The author who created the state\n */\n createdBy: FormMetadataAuthor\n\n /**\n * The date the form state was last updated\n */\n updatedAt: Date\n\n /**\n * The author who last updated the state\n */\n updatedBy: FormMetadataAuthor\n}\n\n/**\n * Interface for `formMetadataSchema` Joi schema\n * @see {@link formMetadataSchema}\n */\nexport interface FormMetadata {\n /**\n * The id of the form\n */\n id: string\n\n /**\n * The human-readable slug id of the form\n */\n slug: string\n\n /**\n * The human-readable title of the form\n */\n title: string\n\n /**\n * The organisation this form belongs to\n */\n organisation: string\n\n /**\n * The name of the team who own this form\n */\n teamName: string\n\n /**\n * The email of the team who own this form\n */\n teamEmail: string\n\n /**\n * The draft state of the form\n */\n draft: FormMetadataState\n\n /**\n * The live state of the form\n */\n live?: FormMetadataState\n}\n\nexport type FormByIdInput = Pick<FormMetadata, 'id'>\nexport type FormBySlugInput = Pick<FormMetadata, 'slug'>\nexport type FormMetadataDocument = Omit<FormMetadata, 'id'>\nexport type FormMetadataInput = Omit<\n FormMetadata,\n 'id' | 'slug' | 'draft' | 'live'\n>\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-metadata/types.ts"],"sourcesContent":["import { formMetadataSchema } from '~/src/form/form-metadata/index.js'\n\n/**\n * Interface for author (createdBy and updatedBy)\n */\nexport interface FormMetadataAuthor {\n /**\n * The ID of the user\n */\n id: string\n\n /**\n * The display name of the user\n */\n displayName: string\n}\n\n/**\n * Interface for metadata state (draft & live)\n */\nexport interface FormMetadataState {\n /**\n * The date the form state was created\n */\n createdAt: Date\n\n /**\n * The author who created the state\n */\n createdBy: FormMetadataAuthor\n\n /**\n * The date the form state was last updated\n */\n updatedAt: Date\n\n /**\n * The author who last updated the state\n */\n updatedBy: FormMetadataAuthor\n}\n\n/**\n * Interface for `formMetadataSchema` Joi schema\n * @see {@link formMetadataSchema}\n */\nexport interface FormMetadata {\n /**\n * The id of the form\n */\n id: string\n\n /**\n * The human-readable slug id of the form\n */\n slug: string\n\n /**\n * The human-readable title of the form\n */\n title: string\n\n /**\n * The organisation this form belongs to\n */\n organisation: string\n\n /**\n * The name of the team who own this form\n */\n teamName: string\n\n /**\n * The email of the team who own this form\n */\n teamEmail: string\n\n /**\n * The draft state of the form\n */\n draft?: FormMetadataState\n\n /**\n * The live state of the form\n */\n live?: FormMetadataState\n}\n\nexport type FormByIdInput = Pick<FormMetadata, 'id'>\nexport type FormBySlugInput = Pick<FormMetadata, 'slug'>\nexport type FormMetadataDocument = Omit<FormMetadata, 'id'>\nexport type FormMetadataInput = Omit<\n FormMetadata,\n 'id' | 'slug' | 'draft' | 'live'\n>\n"],"mappings":"","ignoreList":[]}
@@ -64,7 +64,7 @@ export interface FormMetadata {
64
64
  /**
65
65
  * The draft state of the form
66
66
  */
67
- draft: FormMetadataState;
67
+ draft?: FormMetadataState;
68
68
  /**
69
69
  * The live state of the form
70
70
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-metadata/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,IAAI,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,kBAAkB,CAAA;IAE7B;;OAEG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C9B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAA;IAEzB;;OAEG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAA;CACzB;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AACpD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;AACxD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAC3D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,YAAY,EACZ,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CACjC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.100",
3
+ "version": "3.0.101",
4
4
  "description": "A hapi plugin providing the model for Defra forms",
5
5
  "homepage": "https://github.com/DEFRA/forms-designer/tree/main/model#readme",
6
6
  "repository": {
@@ -81,6 +81,6 @@ export const formMetadataStateSchema = Joi.object<FormMetadataState>().keys({
81
81
  export const formMetadataSchema = formMetadataInputSchema.append<FormMetadata>({
82
82
  id: idSchema,
83
83
  slug: slugSchema,
84
- draft: formMetadataStateSchema.required(),
84
+ draft: formMetadataStateSchema,
85
85
  live: formMetadataStateSchema
86
86
  })
@@ -78,7 +78,7 @@ export interface FormMetadata {
78
78
  /**
79
79
  * The draft state of the form
80
80
  */
81
- draft: FormMetadataState
81
+ draft?: FormMetadataState
82
82
 
83
83
  /**
84
84
  * The live state of the form