@defra/forms-model 3.0.2 → 3.0.4

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.
Files changed (120) hide show
  1. package/dist/browser/components/enums.d.ts +27 -0
  2. package/dist/browser/components/enums.d.ts.map +1 -0
  3. package/dist/browser/components/enums.js +46 -0
  4. package/dist/browser/components/enums.js.map +1 -0
  5. package/dist/browser/components/index.d.ts +2 -1
  6. package/dist/browser/components/index.d.ts.map +1 -1
  7. package/dist/browser/components/index.js +10 -19
  8. package/dist/browser/components/index.js.map +1 -1
  9. package/dist/browser/components/types.d.ts +0 -29
  10. package/dist/browser/components/types.d.ts.map +1 -1
  11. package/dist/browser/components/types.js +4 -44
  12. package/dist/browser/components/types.js.map +1 -1
  13. package/dist/browser/conditions/condition-abstract.d.ts +1 -1
  14. package/dist/browser/conditions/condition-abstract.js +5 -5
  15. package/dist/browser/conditions/condition-abstract.js.map +1 -1
  16. package/dist/browser/conditions/condition-group.d.ts +2 -1
  17. package/dist/browser/conditions/condition-group.d.ts.map +1 -1
  18. package/dist/browser/conditions/condition-group.js.map +1 -1
  19. package/dist/browser/conditions/condition-model.d.ts.map +1 -1
  20. package/dist/browser/conditions/condition-model.js +6 -6
  21. package/dist/browser/conditions/condition-model.js.map +1 -1
  22. package/dist/browser/conditions/condition-ref.d.ts +1 -1
  23. package/dist/browser/conditions/condition-ref.js.map +1 -1
  24. package/dist/browser/conditions/condition.d.ts +1 -1
  25. package/dist/browser/conditions/condition.js.map +1 -1
  26. package/dist/browser/conditions/enums.d.ts +5 -0
  27. package/dist/browser/conditions/enums.d.ts.map +1 -0
  28. package/dist/browser/conditions/enums.js +24 -0
  29. package/dist/browser/conditions/enums.js.map +1 -0
  30. package/dist/browser/conditions/index.d.ts +1 -1
  31. package/dist/browser/conditions/index.js +5 -5
  32. package/dist/browser/conditions/index.js.map +1 -1
  33. package/dist/browser/conditions/types.d.ts +0 -4
  34. package/dist/browser/conditions/types.d.ts.map +1 -1
  35. package/dist/browser/conditions/types.js +4 -12
  36. package/dist/browser/conditions/types.js.map +1 -1
  37. package/dist/browser/data-model/enums.d.ts +6 -0
  38. package/dist/browser/data-model/enums.d.ts.map +1 -0
  39. package/dist/browser/data-model/enums.js +25 -0
  40. package/dist/browser/data-model/enums.js.map +1 -0
  41. package/dist/browser/data-model/index.d.ts +1 -0
  42. package/dist/browser/data-model/index.d.ts.map +1 -1
  43. package/dist/browser/data-model/index.js +10 -4
  44. package/dist/browser/data-model/index.js.map +1 -1
  45. package/dist/browser/data-model/types.d.ts +1 -5
  46. package/dist/browser/data-model/types.d.ts.map +1 -1
  47. package/dist/browser/data-model/types.js +0 -7
  48. package/dist/browser/data-model/types.js.map +1 -1
  49. package/dist/browser/index.d.ts +4 -5
  50. package/dist/browser/index.d.ts.map +1 -1
  51. package/dist/browser/index.js +19 -34
  52. package/dist/browser/index.js.map +1 -1
  53. package/dist/module/components/enums.d.ts +27 -0
  54. package/dist/module/components/enums.d.ts.map +1 -0
  55. package/dist/module/components/enums.js +32 -0
  56. package/dist/module/components/enums.js.map +1 -0
  57. package/dist/module/components/index.d.ts +2 -1
  58. package/dist/module/components/index.d.ts.map +1 -1
  59. package/dist/module/components/index.js +7 -16
  60. package/dist/module/components/index.js.map +1 -1
  61. package/dist/module/components/types.d.ts +0 -29
  62. package/dist/module/components/types.d.ts.map +1 -1
  63. package/dist/module/components/types.js +1 -42
  64. package/dist/module/components/types.js.map +1 -1
  65. package/dist/module/conditions/condition-abstract.d.ts +1 -1
  66. package/dist/module/conditions/condition-abstract.js +2 -2
  67. package/dist/module/conditions/condition-abstract.js.map +1 -1
  68. package/dist/module/conditions/condition-group.d.ts +2 -1
  69. package/dist/module/conditions/condition-group.d.ts.map +1 -1
  70. package/dist/module/conditions/condition-group.js.map +1 -1
  71. package/dist/module/conditions/condition-model.d.ts.map +1 -1
  72. package/dist/module/conditions/condition-model.js +3 -3
  73. package/dist/module/conditions/condition-model.js.map +1 -1
  74. package/dist/module/conditions/condition-ref.d.ts +1 -1
  75. package/dist/module/conditions/condition-ref.js.map +1 -1
  76. package/dist/module/conditions/condition.d.ts +1 -1
  77. package/dist/module/conditions/condition.js.map +1 -1
  78. package/dist/module/conditions/enums.d.ts +5 -0
  79. package/dist/module/conditions/enums.d.ts.map +1 -0
  80. package/dist/module/conditions/enums.js +10 -0
  81. package/dist/module/conditions/enums.js.map +1 -0
  82. package/dist/module/conditions/index.d.ts +1 -1
  83. package/dist/module/conditions/index.js +2 -2
  84. package/dist/module/conditions/index.js.map +1 -1
  85. package/dist/module/conditions/types.d.ts +0 -4
  86. package/dist/module/conditions/types.d.ts.map +1 -1
  87. package/dist/module/conditions/types.js +1 -10
  88. package/dist/module/conditions/types.js.map +1 -1
  89. package/dist/module/data-model/enums.d.ts +6 -0
  90. package/dist/module/data-model/enums.d.ts.map +1 -0
  91. package/dist/module/data-model/enums.js +11 -0
  92. package/dist/module/data-model/enums.js.map +1 -0
  93. package/dist/module/data-model/index.d.ts +1 -0
  94. package/dist/module/data-model/index.d.ts.map +1 -1
  95. package/dist/module/data-model/index.js +7 -0
  96. package/dist/module/data-model/index.js.map +1 -1
  97. package/dist/module/data-model/types.d.ts +1 -5
  98. package/dist/module/data-model/types.d.ts.map +1 -1
  99. package/dist/module/data-model/types.js +0 -7
  100. package/dist/module/data-model/types.js.map +1 -1
  101. package/dist/module/index.d.ts +4 -5
  102. package/dist/module/index.d.ts.map +1 -1
  103. package/dist/module/index.js +15 -33
  104. package/dist/module/index.js.map +1 -1
  105. package/package.json +5 -7
  106. package/src/components/enums.ts +26 -0
  107. package/src/components/index.ts +2 -1
  108. package/src/components/types.ts +0 -31
  109. package/src/conditions/condition-abstract.ts +1 -1
  110. package/src/conditions/condition-group.ts +2 -1
  111. package/src/conditions/condition-model.ts +2 -1
  112. package/src/conditions/condition-ref.ts +1 -1
  113. package/src/conditions/condition.ts +1 -1
  114. package/src/conditions/enums.ts +4 -0
  115. package/src/conditions/index.ts +1 -1
  116. package/src/conditions/types.ts +0 -5
  117. package/src/data-model/enums.ts +5 -0
  118. package/src/data-model/index.ts +1 -0
  119. package/src/data-model/types.ts +1 -6
  120. package/src/index.ts +8 -5
@@ -1,5 +1,6 @@
1
1
  import { ConditionRawData } from '.';
2
2
  import { ComponentDef } from '../components/types';
3
+ import { OutputType } from './enums';
3
4
  type Toggleable<T> = boolean | T;
4
5
  export interface Next {
5
6
  path: string;
@@ -60,11 +61,6 @@ export type MultipleApiKeys = {
60
61
  test?: string;
61
62
  production?: string;
62
63
  };
63
- export declare enum OutputType {
64
- Email = "email",
65
- Notify = "notify",
66
- Webhook = "webhook"
67
- }
68
64
  export type EmailOutputConfiguration = {
69
65
  emailAddress: string;
70
66
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data-model/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,KAAK,UAAU,CAAC,CAAC,IAAI,OAAO,GAAG,CAAC,CAAA;AAEhC,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AACD,MAAM,MAAM,IAAI,GAAG,IAAI,CAAA;AAEvB,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,YAAY,EAAE,CAAA;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC9C;AAED,MAAM,WAAW,kBAAmB,SAAQ,IAAI;IAC9C,UAAU,EAAE,8BAA8B,CAAA;IAC1C,OAAO,EAAE;QACP,k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6
- let OutputType = exports.OutputType = /*#__PURE__*/function (OutputType) {
7
- OutputType["Email"] = "email";
8
- OutputType["Notify"] = "notify";
9
- OutputType["Webhook"] = "webhook";
10
- return OutputType;
11
- }({});
12
5
  function isMultipleApiKey(payApiKey) {
13
6
  const obj = payApiKey;
14
7
  return obj.test !== undefined || obj.production !== undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["OutputType","exports","isMultipleApiKey","payApiKey","obj","test","undefined","production"],"sources":["../../../src/data-model/types.ts"],"sourcesContent":["import { ConditionRawData } from '.'\nimport { ComponentDef } from '../components/types'\n\ntype Toggleable<T> = boolean | T\n\nexport interface Next {\n path: string\n condition?: string\n}\nexport type Link = Next\n\nexport interface Page {\n title: string\n path: string\n controller: string\n components?: ComponentDef[]\n section: string // the section ID\n next?: { path: string; condition?: string }[]\n}\n\nexport interface RepeatingFieldPage extends Page {\n controller: 'RepeatingFieldPageController'\n options: {\n summaryDisplayMode?: {\n samePage?: boolean\n separatePage?: boolean\n hideRowTitles?: boolean\n }\n customText?: {\n separatePageTitle?: string\n }\n }\n}\n\nexport interface Section {\n name: string\n title: string\n hideTitle: boolean\n}\n\nexport interface Item {\n text: string\n value: string | number | boolean\n description?: string\n condition?: string\n}\n\nexport interface List {\n name: string\n title: string\n type: 'string' | 'number' | 'boolean'\n items: Item[]\n}\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport type PhaseBanner = {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport type MultipleApiKeys = {\n test?: string\n production?: string\n}\n\nexport enum OutputType {\n Email = 'email',\n Notify = 'notify',\n Webhook = 'webhook'\n}\n\nexport type EmailOutputConfiguration = {\n emailAddress: string\n}\n\nexport type NotifyOutputConfiguration = {\n apiKey: string\n templateId: string\n emailField: string\n personalisation: string[]\n personalisationFieldCustomisation?: {\n [personalisationName: string]: string[]\n }\n addReferencesToPersonalisation?: boolean\n emailReplyToIdConfiguration?: {\n emailReplyToId: string\n condition?: string | undefined\n }[]\n}\n\nexport type WebhookOutputConfiguration = {\n url: string\n}\n\nexport type OutputConfiguration =\n | EmailOutputConfiguration\n | NotifyOutputConfiguration\n | WebhookOutputConfiguration\n\nexport type Output = {\n name: string\n title: string\n type: OutputType\n outputConfiguration: OutputConfiguration\n}\n\nexport type ConfirmationPage = {\n customText: {\n title: string\n paymentSkipped: Toggleable<string>\n nextSteps: Toggleable<string>\n }\n components: ComponentDef[]\n}\n\nexport type PaymentSkippedWarningPage = {\n customText: {\n title: string\n caption: string\n body: string\n }\n}\n\nexport type SpecialPages = {\n confirmationPage?: ConfirmationPage\n paymentSkippedWarningPage?: PaymentSkippedWarningPage\n}\n\nexport function isMultipleApiKey(\n payApiKey: string | MultipleApiKeys | undefined\n): payApiKey is MultipleApiKeys {\n const obj = payApiKey as MultipleApiKeys\n return obj.test !== undefined || obj.production !== undefined\n}\n\nexport type Fee = {\n description: string\n amount: number\n multiplier?: string\n condition?: string\n prefix?: string\n}\n\nexport type FeeOptions = {\n paymentReferenceFormat?: string\n payReturnUrl?: string\n allowSubmissionWithoutPayment: boolean\n maxAttempts: number\n customPayErrorMessage?: string\n showPaymentSkippedWarningPage: boolean\n}\n\n/**\n * `FormDefinition` is a typescript representation of `Schema`\n */\nexport type FormDefinition = {\n pages: Array<Page | RepeatingFieldPage>\n conditions: ConditionRawData[]\n lists: List[]\n sections: Section[]\n startPage?: Page['path'] | undefined\n name?: string | undefined\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n fees: Fee[]\n skipSummary?: boolean | undefined\n outputs: Output[]\n declaration?: string | undefined\n metadata?: Record<string, any>\n payApiKey?: string | MultipleApiKeys | undefined\n specialPages?: SpecialPages\n paymentReferenceFormat?: string\n feeOptions: FeeOptions\n}\n"],"mappings":";;;;;IAsEYA,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AA+Df,SAASE,gBAAgBA,CAC9BC,SAA+C,EACjB;EAC9B,MAAMC,GAAG,GAAGD,SAA4B;EACxC,OAAOC,GAAG,CAACC,IAAI,KAAKC,SAAS,IAAIF,GAAG,CAACG,UAAU,KAAKD,SAAS;AAC/D;;AAmBA;AACA;AACA"}
1
+ {"version":3,"file":"types.js","names":["isMultipleApiKey","payApiKey","obj","test","undefined","production"],"sources":["../../../src/data-model/types.ts"],"sourcesContent":["import { ConditionRawData } from '.'\nimport { ComponentDef } from '../components/types'\nimport { OutputType } from './enums'\n\ntype Toggleable<T> = boolean | T\n\nexport interface Next {\n path: string\n condition?: string\n}\nexport type Link = Next\n\nexport interface Page {\n title: string\n path: string\n controller: string\n components?: ComponentDef[]\n section: string // the section ID\n next?: { path: string; condition?: string }[]\n}\n\nexport interface RepeatingFieldPage extends Page {\n controller: 'RepeatingFieldPageController'\n options: {\n summaryDisplayMode?: {\n samePage?: boolean\n separatePage?: boolean\n hideRowTitles?: boolean\n }\n customText?: {\n separatePageTitle?: string\n }\n }\n}\n\nexport interface Section {\n name: string\n title: string\n hideTitle: boolean\n}\n\nexport interface Item {\n text: string\n value: string | number | boolean\n description?: string\n condition?: string\n}\n\nexport interface List {\n name: string\n title: string\n type: 'string' | 'number' | 'boolean'\n items: Item[]\n}\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport type PhaseBanner = {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport type MultipleApiKeys = {\n test?: string\n production?: string\n}\n\nexport type EmailOutputConfiguration = {\n emailAddress: string\n}\n\nexport type NotifyOutputConfiguration = {\n apiKey: string\n templateId: string\n emailField: string\n personalisation: string[]\n personalisationFieldCustomisation?: {\n [personalisationName: string]: string[]\n }\n addReferencesToPersonalisation?: boolean\n emailReplyToIdConfiguration?: {\n emailReplyToId: string\n condition?: string | undefined\n }[]\n}\n\nexport type WebhookOutputConfiguration = {\n url: string\n}\n\nexport type OutputConfiguration =\n | EmailOutputConfiguration\n | NotifyOutputConfiguration\n | WebhookOutputConfiguration\n\nexport type Output = {\n name: string\n title: string\n type: OutputType\n outputConfiguration: OutputConfiguration\n}\n\nexport type ConfirmationPage = {\n customText: {\n title: string\n paymentSkipped: Toggleable<string>\n nextSteps: Toggleable<string>\n }\n components: ComponentDef[]\n}\n\nexport type PaymentSkippedWarningPage = {\n customText: {\n title: string\n caption: string\n body: string\n }\n}\n\nexport type SpecialPages = {\n confirmationPage?: ConfirmationPage\n paymentSkippedWarningPage?: PaymentSkippedWarningPage\n}\n\nexport function isMultipleApiKey(\n payApiKey: string | MultipleApiKeys | undefined\n): payApiKey is MultipleApiKeys {\n const obj = payApiKey as MultipleApiKeys\n return obj.test !== undefined || obj.production !== undefined\n}\n\nexport type Fee = {\n description: string\n amount: number\n multiplier?: string\n condition?: string\n prefix?: string\n}\n\nexport type FeeOptions = {\n paymentReferenceFormat?: string\n payReturnUrl?: string\n allowSubmissionWithoutPayment: boolean\n maxAttempts: number\n customPayErrorMessage?: string\n showPaymentSkippedWarningPage: boolean\n}\n\n/**\n * `FormDefinition` is a typescript representation of `Schema`\n */\nexport type FormDefinition = {\n pages: Array<Page | RepeatingFieldPage>\n conditions: ConditionRawData[]\n lists: List[]\n sections: Section[]\n startPage?: Page['path'] | undefined\n name?: string | undefined\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n fees: Fee[]\n skipSummary?: boolean | undefined\n outputs: Output[]\n declaration?: string | undefined\n metadata?: Record<string, any>\n payApiKey?: string | MultipleApiKeys | undefined\n specialPages?: SpecialPages\n paymentReferenceFormat?: string\n feeOptions: FeeOptions\n}\n"],"mappings":";;;;AAgIO,SAASA,gBAAgBA,CAC9BC,SAA+C,EACjB;EAC9B,MAAMC,GAAG,GAAGD,SAA4B;EACxC,OAAOC,GAAG,CAACC,IAAI,KAAKC,SAAS,IAAIF,GAAG,CAACG,UAAU,KAAKD,SAAS;AAC/D;;AAmBA;AACA;AACA"}
@@ -1,12 +1,11 @@
1
1
  export { Schema, componentSchema } from './schema';
2
- export { ConditionRawData, ConditionsWrapper } from './data-model';
2
+ export { ConditionRawData, ConditionsWrapper, OutputType } from './data-model';
3
3
  export { Logger } from './utils/logger';
4
4
  export { FormConfiguration } from './form';
5
- export { ComponentTypes, ConditionalComponentTypes } from './components';
6
- export * from './components/types';
5
+ export { ComponentTypeEnum, ComponentTypes, ConditionalComponentTypes } from './components';
7
6
  export * from './conditions';
8
7
  export * from './utils/helpers';
9
8
  export * from './migration';
10
- export * from './data-model/types';
11
- export { whichMigrations } from './migration/whichMigrations';
9
+ export type * from './components/types';
10
+ export type * from './data-model/types';
12
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxE,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,yBAAyB,EAC1B,MAAM,cAAc,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,oBAAoB,CAAA"}
@@ -6,12 +6,19 @@ var _exportNames = {
6
6
  componentSchema: true,
7
7
  ConditionRawData: true,
8
8
  ConditionsWrapper: true,
9
+ OutputType: true,
9
10
  Logger: true,
10
11
  FormConfiguration: true,
12
+ ComponentTypeEnum: true,
11
13
  ComponentTypes: true,
12
- ConditionalComponentTypes: true,
13
- whichMigrations: true
14
+ ConditionalComponentTypes: true
14
15
  };
16
+ Object.defineProperty(exports, "ComponentTypeEnum", {
17
+ enumerable: true,
18
+ get: function () {
19
+ return _components.ComponentTypeEnum;
20
+ }
21
+ });
15
22
  Object.defineProperty(exports, "ComponentTypes", {
16
23
  enumerable: true,
17
24
  get: function () {
@@ -48,22 +55,22 @@ Object.defineProperty(exports, "Logger", {
48
55
  return _logger.Logger;
49
56
  }
50
57
  });
51
- Object.defineProperty(exports, "Schema", {
58
+ Object.defineProperty(exports, "OutputType", {
52
59
  enumerable: true,
53
60
  get: function () {
54
- return _schema.Schema;
61
+ return _dataModel.OutputType;
55
62
  }
56
63
  });
57
- Object.defineProperty(exports, "componentSchema", {
64
+ Object.defineProperty(exports, "Schema", {
58
65
  enumerable: true,
59
66
  get: function () {
60
- return _schema.componentSchema;
67
+ return _schema.Schema;
61
68
  }
62
69
  });
63
- Object.defineProperty(exports, "whichMigrations", {
70
+ Object.defineProperty(exports, "componentSchema", {
64
71
  enumerable: true,
65
72
  get: function () {
66
- return _whichMigrations.whichMigrations;
73
+ return _schema.componentSchema;
67
74
  }
68
75
  });
69
76
  var _schema = require("./schema");
@@ -71,18 +78,6 @@ var _dataModel = require("./data-model");
71
78
  var _logger = require("./utils/logger");
72
79
  var _form = require("./form");
73
80
  var _components = require("./components");
74
- var _types = require("./components/types");
75
- Object.keys(_types).forEach(function (key) {
76
- if (key === "default" || key === "__esModule") return;
77
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
78
- if (key in exports && exports[key] === _types[key]) return;
79
- Object.defineProperty(exports, key, {
80
- enumerable: true,
81
- get: function () {
82
- return _types[key];
83
- }
84
- });
85
- });
86
81
  var _conditions = require("./conditions");
87
82
  Object.keys(_conditions).forEach(function (key) {
88
83
  if (key === "default" || key === "__esModule") return;
@@ -119,17 +114,4 @@ Object.keys(_migration).forEach(function (key) {
119
114
  }
120
115
  });
121
116
  });
122
- var _types2 = require("./data-model/types");
123
- Object.keys(_types2).forEach(function (key) {
124
- if (key === "default" || key === "__esModule") return;
125
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
126
- if (key in exports && exports[key] === _types2[key]) return;
127
- Object.defineProperty(exports, key, {
128
- enumerable: true,
129
- get: function () {
130
- return _types2[key];
131
- }
132
- });
133
- });
134
- var _whichMigrations = require("./migration/whichMigrations");
135
117
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_schema","require","_dataModel","_logger","_form","_components","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_conditions","_helpers","_migration","_types2","_whichMigrations"],"sources":["../../src/index.ts"],"sourcesContent":["export { Schema, componentSchema } from './schema'\nexport { ConditionRawData, ConditionsWrapper } from './data-model'\nexport { Logger } from './utils/logger'\nexport { FormConfiguration } from './form'\nexport { ComponentTypes, ConditionalComponentTypes } from './components'\nexport * from './components/types'\nexport * from './conditions'\nexport * from './utils/helpers'\nexport * from './migration'\nexport * from './data-model/types'\nexport { whichMigrations } from './migration/whichMigrations'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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js","names":["_schema","require","_dataModel","_logger","_form","_components","_conditions","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_helpers","_migration"],"sources":["../../src/index.ts"],"sourcesContent":["export { Schema, componentSchema } from './schema'\nexport { ConditionRawData, ConditionsWrapper, OutputType } from './data-model'\nexport { Logger } from './utils/logger'\nexport { FormConfiguration } from './form'\nexport {\n ComponentTypeEnum,\n ComponentTypes,\n ConditionalComponentTypes\n} from './components'\nexport * from './conditions'\nexport * from './utils/helpers'\nexport * from './migration'\nexport type * from './components/types'\nexport type * from './data-model/types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AAAAM,MAAA,CAAAC,IAAA,CAAAF,WAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,WAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,WAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAlB,OAAA;AAAAM,MAAA,CAAAC,IAAA,CAAAW,QAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,QAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,UAAA,GAAAnB,OAAA;AAAAM,MAAA,CAAAC,IAAA,CAAAY,UAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,UAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,UAAA,CAAAV,GAAA;IAAA;EAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
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": {
@@ -14,15 +14,13 @@
14
14
  "types": "dist/module/index.d.ts",
15
15
  "scripts": {
16
16
  "build": "npm run build:types && npm run build:node && npm run build:browser",
17
- "build:browser": "BABEL_ENV=javascripts babel --extensions \".ts\" --ignore \"**/*.(jt)est.*\" src --out-dir dist/browser",
18
- "build:node": "BABEL_ENV=node babel --extensions \".ts\" --ignore \"**/*.(jt)est.*\" src --out-dir dist/module",
17
+ "build:browser": "BABEL_ENV=javascripts babel --extensions \".ts\" --ignore \"**/*.test.*\" src --out-dir dist/browser",
18
+ "build:node": "BABEL_ENV=node babel --extensions \".ts\" --ignore \"**/*.test.*\" src --out-dir dist/module",
19
19
  "build:types": "npm run build:types:node && npm run build:types:browser",
20
20
  "build:types:browser": "tsc --emitDeclarationOnly --declarationDir dist/browser ",
21
21
  "build:types:node": "tsc --emitDeclarationOnly --declarationDir ./dist/module ",
22
- "generate-docs": "typedoc src --tsconfig tsconfig.json --out ../docs/model/typedoc --exclude \"**/*+(index|.test|.jest).ts\"",
23
- "test": "npm run test-cov",
24
- "test-cov": "jest --coverage",
25
- "test:dev": "jest --watch"
22
+ "test": "jest --color --coverage --verbose",
23
+ "test:watch": "jest --color --watch"
26
24
  },
27
25
  "dependencies": {
28
26
  "joi": "17.2.1",
@@ -0,0 +1,26 @@
1
+ export enum ComponentTypeEnum {
2
+ TextField = 'TextField',
3
+ MultilineTextField = 'MultilineTextField',
4
+ YesNoField = 'YesNoField',
5
+ DateField = 'DateField',
6
+ TimeField = 'TimeField',
7
+ DateTimeField = 'DateTimeField',
8
+ DatePartsField = 'DatePartsField',
9
+ MonthYearField = 'MonthYearField',
10
+ DateTimePartsField = 'DateTimePartsField',
11
+ SelectField = 'SelectField',
12
+ AutocompleteField = 'AutocompleteField',
13
+ RadiosField = 'RadiosField',
14
+ CheckboxesField = 'CheckboxesField',
15
+ NumberField = 'NumberField',
16
+ UkAddressField = 'UkAddressField',
17
+ TelephoneNumberField = 'TelephoneNumberField',
18
+ EmailAddressField = 'EmailAddressField',
19
+ FileUploadField = 'FileUploadField',
20
+ Para = 'Para',
21
+ Html = 'Html',
22
+ InsetText = 'InsetText',
23
+ Details = 'Details',
24
+ FlashCard = 'FlashCard',
25
+ List = 'List'
26
+ }
@@ -1,3 +1,4 @@
1
1
  export { ComponentTypes } from './component-types'
2
2
  export { ConditionalComponentTypes } from './conditional-component-types'
3
- export * from './types'
3
+ export { ComponentTypeEnum } from './enums'
4
+ export type * from './types'
@@ -1,30 +1,3 @@
1
- export enum ComponentTypeEnum {
2
- TextField = 'TextField',
3
- MultilineTextField = 'MultilineTextField',
4
- YesNoField = 'YesNoField',
5
- DateField = 'DateField',
6
- TimeField = 'TimeField',
7
- DateTimeField = 'DateTimeField',
8
- DatePartsField = 'DatePartsField',
9
- MonthYearField = 'MonthYearField',
10
- DateTimePartsField = 'DateTimePartsField',
11
- SelectField = 'SelectField',
12
- AutocompleteField = 'AutocompleteField',
13
- RadiosField = 'RadiosField',
14
- CheckboxesField = 'CheckboxesField',
15
- NumberField = 'NumberField',
16
- UkAddressField = 'UkAddressField',
17
- TelephoneNumberField = 'TelephoneNumberField',
18
- EmailAddressField = 'EmailAddressField',
19
- FileUploadField = 'FileUploadField',
20
- Para = 'Para',
21
- Html = 'Html',
22
- InsetText = 'InsetText',
23
- Details = 'Details',
24
- FlashCard = 'FlashCard',
25
- List = 'List'
26
- }
27
-
28
1
  export type ComponentType =
29
2
  | 'TextField'
30
3
  | 'MultilineTextField'
@@ -178,10 +151,6 @@ export interface WebsiteFieldComponent extends TextFieldBase {
178
151
  }
179
152
  }
180
153
 
181
- export interface MultilineTextFieldComponent {
182
- type: 'MultilineTextField'
183
- }
184
-
185
154
  export interface TelephoneNumberFieldComponent extends TextFieldBase {
186
155
  type: 'TelephoneNumberField'
187
156
  options: TextFieldBase['options'] & {
@@ -1,4 +1,4 @@
1
- import { Coordinator } from './types'
1
+ import { Coordinator } from './enums'
2
2
 
3
3
  export class ConditionAbstract {
4
4
  coordinator: Coordinator | undefined
@@ -1,5 +1,6 @@
1
+ import { Coordinator } from './enums'
1
2
  import { toPresentationString, toExpression } from './helpers'
2
- import { Coordinator, ConditionsArray } from './types'
3
+ import { ConditionsArray } from './types'
3
4
 
4
5
  export class ConditionGroup {
5
6
  conditions: ConditionsArray
@@ -4,8 +4,9 @@ import { Condition } from './condition'
4
4
  import { ConditionRef } from './condition-ref'
5
5
  import { ConditionGroup } from './condition-group'
6
6
  import { conditionValueFrom } from './condition-values'
7
+ import { Coordinator } from './enums'
7
8
  import { toPresentationString, toExpression } from './helpers'
8
- import { Coordinator, ConditionsArray } from './types'
9
+ import { ConditionsArray } from './types'
9
10
 
10
11
  type ConditionRawObject =
11
12
  | ConditionsModel
@@ -1,5 +1,5 @@
1
1
  import { ConditionAbstract } from './condition-abstract'
2
- import { Coordinator } from './types'
2
+ import { Coordinator } from './enums'
3
3
 
4
4
  export class ConditionRef extends ConditionAbstract {
5
5
  conditionName: string
@@ -3,7 +3,7 @@ import { ConditionAbstract } from './condition-abstract'
3
3
  import { getExpression } from './condition-operators'
4
4
  import { ConditionValue, RelativeTimeValue } from './condition-values'
5
5
  import { ConditionValueAbstract } from './condition-value-abstract'
6
- import { Coordinator } from './types'
6
+ import { Coordinator } from './enums'
7
7
 
8
8
  export class Condition extends ConditionAbstract {
9
9
  field: ConditionField
@@ -0,0 +1,4 @@
1
+ export enum Coordinator {
2
+ AND = 'and',
3
+ OR = 'or'
4
+ }
@@ -24,4 +24,4 @@ export { ConditionsModel } from './condition-model'
24
24
  export { ConditionGroupDef } from './condition-group-def'
25
25
  export { toExpression, toPresentationString } from './helpers'
26
26
 
27
- export { Coordinator } from './types'
27
+ export { Coordinator } from './enums'
@@ -4,11 +4,6 @@ import { ConditionGroup } from './condition-group'
4
4
 
5
5
  export type ConditionsArray = (Condition | ConditionGroup | ConditionRef)[]
6
6
 
7
- export enum Coordinator {
8
- AND = 'and',
9
- OR = 'or'
10
- }
11
-
12
7
  export type DateTimeUnitValues =
13
8
  | 'years'
14
9
  | 'months'
@@ -0,0 +1,5 @@
1
+ export enum OutputType {
2
+ Email = 'email',
3
+ Notify = 'notify',
4
+ Webhook = 'webhook'
5
+ }
@@ -1,3 +1,4 @@
1
1
  export { InputWrapper } from './input-wrapper'
2
2
  export { ConditionsWrapper, ConditionRawData } from './conditions-wrapper'
3
3
  export { Page, Item, Section, List, ConfirmationPage } from './types'
4
+ export { OutputType } from './enums'
@@ -1,5 +1,6 @@
1
1
  import { ConditionRawData } from '.'
2
2
  import { ComponentDef } from '../components/types'
3
+ import { OutputType } from './enums'
3
4
 
4
5
  type Toggleable<T> = boolean | T
5
6
 
@@ -68,12 +69,6 @@ export type MultipleApiKeys = {
68
69
  production?: string
69
70
  }
70
71
 
71
- export enum OutputType {
72
- Email = 'email',
73
- Notify = 'notify',
74
- Webhook = 'webhook'
75
- }
76
-
77
72
  export type EmailOutputConfiguration = {
78
73
  emailAddress: string
79
74
  }
package/src/index.ts CHANGED
@@ -1,11 +1,14 @@
1
1
  export { Schema, componentSchema } from './schema'
2
- export { ConditionRawData, ConditionsWrapper } from './data-model'
2
+ export { ConditionRawData, ConditionsWrapper, OutputType } from './data-model'
3
3
  export { Logger } from './utils/logger'
4
4
  export { FormConfiguration } from './form'
5
- export { ComponentTypes, ConditionalComponentTypes } from './components'
6
- export * from './components/types'
5
+ export {
6
+ ComponentTypeEnum,
7
+ ComponentTypes,
8
+ ConditionalComponentTypes
9
+ } from './components'
7
10
  export * from './conditions'
8
11
  export * from './utils/helpers'
9
12
  export * from './migration'
10
- export * from './data-model/types'
11
- export { whichMigrations } from './migration/whichMigrations'
13
+ export type * from './components/types'
14
+ export type * from './data-model/types'