@defra/forms-model 3.0.374 → 3.0.375

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.
@@ -55,14 +55,6 @@ export function hasNext(page) {
55
55
  return !controller || controller === ControllerType.Start || controller === ControllerType.Page || controller === ControllerType.FileUpload;
56
56
  }
57
57
 
58
- /**
59
- * Check page supports questions
60
- */
61
- export function isQuestionPage(page) {
62
- const controller = controllerNameFromPath(page?.controller);
63
- return !controller || controller === ControllerType.Page || controller === ControllerType.FileUpload;
64
- }
65
-
66
58
  /**
67
59
  * Check and optionally replace legacy path with controller name
68
60
  * @param {string} [nameOrPath] - Controller name or legacy controller path
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["ControllerNames","ControllerTypes","ControllerType","PageTypes","getPageDefaults","page","nameOrPath","controller","Page","controllerNameFromPath","defaults","find","pageType","Error","structuredClone","hasComponents","hasNext","Array","isArray","components","hasFormComponents","Start","hasSection","section","isControllerName","map","String","includes","FileUpload","isQuestionPage","options","path","name"],"sources":["../../../src/pages/helpers.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport {\n type Link,\n type Page,\n type PageFileUpload,\n type PageQuestion,\n type PageStart,\n type RequiredField\n} from '~/src/form/form-definition/types.js'\nimport {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { PageTypes } from '~/src/pages/page-types.js'\n\n/**\n * Return component defaults by type\n */\nexport function getPageDefaults<PageType extends Page>(\n page?: Pick<PageType, 'controller'>\n) {\n const nameOrPath = page?.controller ?? ControllerType.Page\n const controller = controllerNameFromPath(nameOrPath)\n\n const defaults = PageTypes.find(\n (pageType) => pageType.controller === controller\n )\n\n if (!defaults) {\n throw new Error(`Defaults not found for page type '${nameOrPath}'`)\n }\n\n return structuredClone(defaults) as PageType\n}\n\n/**\n * Check page has components\n */\nexport function hasComponents(\n page?: Partial<Page>\n): page is Extract<Page, { components: ComponentDef[] }> {\n return hasNext(page) && Array.isArray(page.components)\n}\n\n/**\n * Check page has form components\n */\nexport function hasFormComponents(\n page?: Partial<Page>\n): page is PageQuestion | PageFileUpload {\n const controller = controllerNameFromPath(page?.controller)\n return hasComponents(page) && controller !== ControllerType.Start\n}\n\n/**\n * Check page has sections\n */\nexport function hasSection(\n page?: Partial<Page>\n): page is\n | RequiredField<PageStart, 'section'>\n | RequiredField<PageQuestion, 'section'>\n | RequiredField<PageFileUpload, 'section'> {\n return hasNext(page) && typeof page.section === 'string'\n}\n\n/**\n * Check for known page controller names\n */\nexport function isControllerName(\n nameOrPath?: ControllerType | string\n): nameOrPath is ControllerType {\n return !!nameOrPath && ControllerNames.map(String).includes(nameOrPath)\n}\n\n/**\n * Check page has next link\n */\nexport function hasNext(\n page?: Partial<Page>\n): page is Extract<Page, { next: Link[] }> {\n if (!page || !('next' in page)) {\n return false\n }\n\n const controller = controllerNameFromPath(page.controller)\n\n return (\n !controller ||\n controller === ControllerType.Start ||\n controller === ControllerType.Page ||\n controller === ControllerType.FileUpload\n )\n}\n\n/**\n * Check page supports questions\n */\nexport function isQuestionPage(page?: Partial<Page>): page is PageQuestion {\n const controller = controllerNameFromPath(page?.controller)\n\n return (\n !controller ||\n controller === ControllerType.Page ||\n controller === ControllerType.FileUpload\n )\n}\n\n/**\n * Check and optionally replace legacy path with controller name\n * @param {string} [nameOrPath] - Controller name or legacy controller path\n */\nexport function controllerNameFromPath(nameOrPath?: ControllerType | string) {\n if (isControllerName(nameOrPath)) {\n return nameOrPath\n }\n\n const options = ControllerTypes.find(({ path }) => path === nameOrPath)\n return options?.name\n}\n"],"mappings":"AASA,SACEA,eAAe,EACfC,eAAe;AAEjB,SAASC,cAAc;AACvB,SAASC,SAAS;;AAElB;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,IAAmC,EACnC;EACA,MAAMC,UAAU,GAAGD,IAAI,EAAEE,UAAU,IAAIL,cAAc,CAACM,IAAI;EAC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AE1D,OACE,CAACA,UAAU,IACXA,UAAU,KAAKL,cAAc,CAACmB,KAAK,IACnCd,UAAU,KAAKL,cAAc,CAACM,IAAI,IAClCD,UAAU,KAAKL,cAAc,CAAC0B,UAAU;AAE5C;;AAEA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACxB,IAAoB,EAAwB;EACzE,MAAME,UAAU,GAAGE,sBAAsB,CAACJ,IAAI,EAAEE,UAAU,CAAC;EAE3D,OACE,CAACA,UAAU,IACXA,UAAU,KAAKL,cAAc,CAACM,IAAI,IAClCD,UAAU,KAAKL,cAAc,CAAC0B,UAAU;AAE5C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASnB,sBAAsBA,CAACH,UAAoC,EAAE;EAC3E,IAAIkB,gBAAgB,CAAClB,UAAU,CAAC,EAAE;IAChC,OAAOA,UAAU;EACnB;EAEA,MAAMwB,OAAO,GAAG7B,eAAe,CAACU,IAAI,CAAC,CAAC;IAAEoB;EAAK,CAAC,KAAKA,IAAI,KAAKzB,UAAU,CAAC;EACvE,OAAOwB,OAAO,EAAEE,IAAI;AACtB","ignoreList":[]}
1
+ {"version":3,"file":"helpers.js","names":["ControllerNames","ControllerTypes","ControllerType","PageTypes","getPageDefaults","page","nameOrPath","controller","Page","controllerNameFromPath","defaults","find","pageType","Error","structuredClone","hasComponents","hasNext","Array","isArray","components","hasFormComponents","Start","hasSection","section","isControllerName","map","String","includes","FileUpload","options","path","name"],"sources":["../../../src/pages/helpers.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport {\n type Link,\n type Page,\n type PageFileUpload,\n type PageQuestion,\n type PageStart,\n type RequiredField\n} from '~/src/form/form-definition/types.js'\nimport {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\nimport { ControllerType } from '~/src/pages/enums.js'\nimport { PageTypes } from '~/src/pages/page-types.js'\n\n/**\n * Return component defaults by type\n */\nexport function getPageDefaults<PageType extends Page>(\n page?: Pick<PageType, 'controller'>\n) {\n const nameOrPath = page?.controller ?? ControllerType.Page\n const controller = controllerNameFromPath(nameOrPath)\n\n const defaults = PageTypes.find(\n (pageType) => pageType.controller === controller\n )\n\n if (!defaults) {\n throw new Error(`Defaults not found for page type '${nameOrPath}'`)\n }\n\n return structuredClone(defaults) as PageType\n}\n\n/**\n * Check page has components\n */\nexport function hasComponents(\n page?: Partial<Page>\n): page is Extract<Page, { components: ComponentDef[] }> {\n return hasNext(page) && Array.isArray(page.components)\n}\n\n/**\n * Check page has form components\n */\nexport function hasFormComponents(\n page?: Partial<Page>\n): page is PageQuestion | PageFileUpload {\n const controller = controllerNameFromPath(page?.controller)\n return hasComponents(page) && controller !== ControllerType.Start\n}\n\n/**\n * Check page has sections\n */\nexport function hasSection(\n page?: Partial<Page>\n): page is\n | RequiredField<PageStart, 'section'>\n | RequiredField<PageQuestion, 'section'>\n | RequiredField<PageFileUpload, 'section'> {\n return hasNext(page) && typeof page.section === 'string'\n}\n\n/**\n * Check for known page controller names\n */\nexport function isControllerName(\n nameOrPath?: ControllerType | string\n): nameOrPath is ControllerType {\n return !!nameOrPath && ControllerNames.map(String).includes(nameOrPath)\n}\n\n/**\n * Check page has next link\n */\nexport function hasNext(\n page?: Partial<Page>\n): page is Extract<Page, { next: Link[] }> {\n if (!page || !('next' in page)) {\n return false\n }\n\n const controller = controllerNameFromPath(page.controller)\n\n return (\n !controller ||\n controller === ControllerType.Start ||\n controller === ControllerType.Page ||\n controller === ControllerType.FileUpload\n )\n}\n\n/**\n * Check and optionally replace legacy path with controller name\n * @param {string} [nameOrPath] - Controller name or legacy controller path\n */\nexport function controllerNameFromPath(nameOrPath?: ControllerType | string) {\n if (isControllerName(nameOrPath)) {\n return nameOrPath\n }\n\n const options = ControllerTypes.find(({ path }) => path === nameOrPath)\n return options?.name\n}\n"],"mappings":"AASA,SACEA,eAAe,EACfC,eAAe;AAEjB,SAASC,cAAc;AACvB,SAASC,SAAS;;AAElB;AACA;AACA;AACA,OAAO,SAASC,eAAeA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EAAE;IAC9B,OAAO,KAAK;EACd;EAEA,MAAME,UAAU,GAAGE,sBAAsB,CAACJ,IAAI,CAACE,UAAU,CAAC;EAE1D,OACE,CAACA,UAAU,IACXA,UAAU,KAAKL,cAAc,CAACmB,KAAK,IACnCd,UAAU,KAAKL,cAAc,CAACM,IAAI,IAClCD,UAAU,KAAKL,cAAc,CAAC0B,UAAU;AAE5C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASnB,sBAAsBA,CAACH,UAAoC,EAAE;EAC3E,IAAIkB,gBAAgB,CAAClB,UAAU,CAAC,EAAE;IAChC,OAAOA,UAAU;EACnB;EAEA,MAAMuB,OAAO,GAAG5B,eAAe,CAACU,IAAI,CAAC,CAAC;IAAEmB;EAAK,CAAC,KAAKA,IAAI,KAAKxB,UAAU,CAAC;EACvE,OAAOuB,OAAO,EAAEE,IAAI;AACtB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  export { ControllerNames, ControllerTypes } from "./controller-types.js";
2
2
  export { PageTypes } from "./page-types.js";
3
- export { controllerNameFromPath, getPageDefaults, hasComponents, hasFormComponents, hasSection, hasNext, isControllerName, isQuestionPage } from "./helpers.js";
3
+ export { controllerNameFromPath, getPageDefaults, hasComponents, hasFormComponents, hasSection, hasNext, isControllerName } from "./helpers.js";
4
4
  export { ControllerPath, ControllerType } from "./enums.js";
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ControllerNames","ControllerTypes","PageTypes","controllerNameFromPath","getPageDefaults","hasComponents","hasFormComponents","hasSection","hasNext","isControllerName","isQuestionPage","ControllerPath","ControllerType"],"sources":["../../../src/pages/index.ts"],"sourcesContent":["export {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\n\nexport { PageTypes } from '~/src/pages/page-types.js'\n\nexport {\n controllerNameFromPath,\n getPageDefaults,\n hasComponents,\n hasFormComponents,\n hasSection,\n hasNext,\n isControllerName,\n isQuestionPage\n} from '~/src/pages/helpers.js'\n\nexport { ControllerPath, ControllerType } from '~/src/pages/enums.js'\n"],"mappings":"AAAA,SACEA,eAAe,EACfC,eAAe;AAGjB,SAASC,SAAS;AAElB,SACEC,sBAAsB,EACtBC,eAAe,EACfC,aAAa,EACbC,iBAAiB,EACjBC,UAAU,EACVC,OAAO,EACPC,gBAAgB,EAChBC,cAAc;AAGhB,SAASC,cAAc,EAAEC,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["ControllerNames","ControllerTypes","PageTypes","controllerNameFromPath","getPageDefaults","hasComponents","hasFormComponents","hasSection","hasNext","isControllerName","ControllerPath","ControllerType"],"sources":["../../../src/pages/index.ts"],"sourcesContent":["export {\n ControllerNames,\n ControllerTypes\n} from '~/src/pages/controller-types.js'\n\nexport { PageTypes } from '~/src/pages/page-types.js'\n\nexport {\n controllerNameFromPath,\n getPageDefaults,\n hasComponents,\n hasFormComponents,\n hasSection,\n hasNext,\n isControllerName\n} from '~/src/pages/helpers.js'\n\nexport { ControllerPath, ControllerType } from '~/src/pages/enums.js'\n"],"mappings":"AAAA,SACEA,eAAe,EACfC,eAAe;AAGjB,SAASC,SAAS;AAElB,SACEC,sBAAsB,EACtBC,eAAe,EACfC,aAAa,EACbC,iBAAiB,EACjBC,UAAU,EACVC,OAAO,EACPC,gBAAgB;AAGlB,SAASC,cAAc,EAAEC,cAAc","ignoreList":[]}
@@ -29,10 +29,6 @@ export declare function isControllerName(nameOrPath?: ControllerType | string):
29
29
  export declare function hasNext(page?: Partial<Page>): page is Extract<Page, {
30
30
  next: Link[];
31
31
  }>;
32
- /**
33
- * Check page supports questions
34
- */
35
- export declare function isQuestionPage(page?: Partial<Page>): page is PageQuestion;
36
32
  /**
37
33
  * Check and optionally replace legacy path with controller name
38
34
  * @param {string} [nameOrPath] - Controller name or legacy controller path
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/pages/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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UAAU,IAAI,cAAc,CAE9B;AAED;;GAEG;AACH,wBAAgB,OAAO,CACrB,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GACnB,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,IAAI,EAAE,CAAA;CAAE,CAAC,CAazC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,CAAC,EAAE,cAAc,GAAG,MAAM,8BAO1E"}
@@ -1,5 +1,5 @@
1
1
  export { ControllerNames, ControllerTypes } from '../pages/controller-types.js';
2
2
  export { PageTypes } from '../pages/page-types.js';
3
- export { controllerNameFromPath, getPageDefaults, hasComponents, hasFormComponents, hasSection, hasNext, isControllerName, isQuestionPage } from '../pages/helpers.js';
3
+ export { controllerNameFromPath, getPageDefaults, hasComponents, hasFormComponents, hasSection, hasNext, isControllerName } from '../pages/helpers.js';
4
4
  export { ControllerPath, ControllerType } from '../pages/enums.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EAChB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,cAAc,EACf,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EAChB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,OAAO,EACP,gBAAgB,EACjB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.374",
3
+ "version": "3.0.375",
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": {
@@ -94,19 +94,6 @@ export function hasNext(
94
94
  )
95
95
  }
96
96
 
97
- /**
98
- * Check page supports questions
99
- */
100
- export function isQuestionPage(page?: Partial<Page>): page is PageQuestion {
101
- const controller = controllerNameFromPath(page?.controller)
102
-
103
- return (
104
- !controller ||
105
- controller === ControllerType.Page ||
106
- controller === ControllerType.FileUpload
107
- )
108
- }
109
-
110
97
  /**
111
98
  * Check and optionally replace legacy path with controller name
112
99
  * @param {string} [nameOrPath] - Controller name or legacy controller path
@@ -12,8 +12,7 @@ export {
12
12
  hasFormComponents,
13
13
  hasSection,
14
14
  hasNext,
15
- isControllerName,
16
- isQuestionPage
15
+ isControllerName
17
16
  } from '~/src/pages/helpers.js'
18
17
 
19
18
  export { ControllerPath, ControllerType } from '~/src/pages/enums.js'