@defra/forms-model 3.0.12 → 3.0.14

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 (54) hide show
  1. package/dist/module/components/types.js.map +1 -1
  2. package/dist/module/conditions/condition-group.js.map +1 -1
  3. package/dist/module/conditions/condition-model.js +2 -2
  4. package/dist/module/conditions/condition-model.js.map +1 -1
  5. package/dist/module/conditions/condition-operators.js.map +1 -1
  6. package/dist/module/conditions/condition-ref.js.map +1 -1
  7. package/dist/module/conditions/condition.js +1 -1
  8. package/dist/module/conditions/condition.js.map +1 -1
  9. package/dist/module/conditions/types.js.map +1 -1
  10. package/dist/module/data-model/types.js.map +1 -1
  11. package/dist/module/migration/migration.1-2.js +2 -2
  12. package/dist/module/migration/migration.1-2.js.map +1 -1
  13. package/dist/module/migration/whichMigrations.js +0 -1
  14. package/dist/module/migration/whichMigrations.js.map +1 -1
  15. package/dist/module/schema/schema.js +1 -1
  16. package/dist/module/schema/schema.js.map +1 -1
  17. package/dist/module/utils/helpers.js.map +1 -1
  18. package/dist/types/components/types.d.ts +4 -4
  19. package/dist/types/components/types.d.ts.map +1 -1
  20. package/dist/types/conditions/condition-group-def.d.ts +1 -1
  21. package/dist/types/conditions/condition-group.d.ts +1 -1
  22. package/dist/types/conditions/condition-group.d.ts.map +1 -1
  23. package/dist/types/conditions/condition-model.d.ts +3 -3
  24. package/dist/types/conditions/condition-model.d.ts.map +1 -1
  25. package/dist/types/conditions/condition-operators.d.ts +1 -1
  26. package/dist/types/conditions/condition-operators.d.ts.map +1 -1
  27. package/dist/types/conditions/condition-ref.d.ts +1 -1
  28. package/dist/types/conditions/condition-ref.d.ts.map +1 -1
  29. package/dist/types/conditions/condition.d.ts +3 -3
  30. package/dist/types/conditions/condition.d.ts.map +1 -1
  31. package/dist/types/conditions/types.d.ts +6 -6
  32. package/dist/types/conditions/types.d.ts.map +1 -1
  33. package/dist/types/data-model/types.d.ts +28 -30
  34. package/dist/types/data-model/types.d.ts.map +1 -1
  35. package/dist/types/migration/migration.1-2.d.ts.map +1 -1
  36. package/dist/types/migration/whichMigrations.d.ts +0 -1
  37. package/dist/types/migration/whichMigrations.d.ts.map +1 -1
  38. package/dist/types/schema/schema.d.ts +1 -1
  39. package/dist/types/schema/schema.d.ts.map +1 -1
  40. package/dist/types/utils/helpers.d.ts +1 -3
  41. package/dist/types/utils/helpers.d.ts.map +1 -1
  42. package/package.json +1 -1
  43. package/src/components/types.ts +2 -2
  44. package/src/conditions/condition-group.ts +1 -1
  45. package/src/conditions/condition-model.ts +21 -22
  46. package/src/conditions/condition-operators.ts +1 -1
  47. package/src/conditions/condition-ref.ts +1 -1
  48. package/src/conditions/condition.ts +5 -5
  49. package/src/conditions/types.ts +4 -4
  50. package/src/data-model/types.ts +15 -17
  51. package/src/migration/migration.1-2.ts +6 -6
  52. package/src/migration/whichMigrations.ts +0 -1
  53. package/src/schema/schema.ts +1 -1
  54. package/src/utils/helpers.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"condition-group.d.ts","sourceRoot":"","sources":["../../../src/conditions/condition-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,qBAAa,cAAc;IACzB,UAAU,EAAE,eAAe,CAAA;gBAEf,UAAU,GAAE,eAAoB;IAQ5C,iBAAiB;IAIjB,eAAe;IAQf,mBAAmB;IAQnB,gBAAgB;IAKhB,cAAc;IAId,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS;IAInD,OAAO;IAIP,oBAAoB;IAIpB,KAAK;CAKN"}
1
+ {"version":3,"file":"condition-group.d.ts","sourceRoot":"","sources":["../../../src/conditions/condition-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAE5D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,qBAAa,cAAc;IACzB,UAAU,EAAE,eAAe,CAAA;gBAEf,UAAU,GAAE,eAAoB;IAQ5C,iBAAiB;IAIjB,eAAe;IAQf,mBAAmB;IAQnB,gBAAgB;IAKhB,cAAc;IAId,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS;IAInD,OAAO;IAIP,oBAAoB;IAIpB,KAAK;CAKN"}
@@ -1,7 +1,7 @@
1
1
  import { ConditionGroupDef } from '../conditions/condition-group-def.js';
2
- import { Condition } from '../conditions/condition.js';
3
- import { ConditionRef } from '../conditions/condition-ref.js';
4
2
  import { ConditionGroup } from '../conditions/condition-group.js';
3
+ import { ConditionRef } from '../conditions/condition-ref.js';
4
+ import { Condition } from '../conditions/condition.js';
5
5
  import { type ConditionsArray } from '../conditions/types.js';
6
6
  type ConditionRawObject = ConditionsModel | {
7
7
  name: string;
@@ -22,7 +22,7 @@ export declare class ConditionsModel {
22
22
  moveEarlier(index: number): this;
23
23
  moveLater(index: number): this;
24
24
  switchCoordinators(): void;
25
- get asPerUserGroupings(): (ConditionRef | ConditionGroup | Condition)[];
25
+ get asPerUserGroupings(): (ConditionGroup | Condition | ConditionRef)[];
26
26
  get hasConditions(): boolean;
27
27
  get lastIndex(): number;
28
28
  toPresentationString(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"condition-model.d.ts","sourceRoot":"","sources":["../../../src/conditions/condition-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AAIpE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,KAAK,kBAAkB,GACnB,eAAe,GACf;IACE,IAAI,EAAE,MAAM,CAA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AAA;AAGzD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,KAAK,kBAAkB,GACnB,eAAe,GACf;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB,CAAA;AAEL,qBAAa,eAAe;;gBAKd,iBAAiB,CAAC,EAAE,kBAAkB;IAElD,KAAK;IAYL,KAAK;IAOL,IAAI,IAAI,CAAC,IAAI,oBAAA,EAEZ;IAED,IAAI,IAAI,uBAEP;IAED,GAAG,CAAC,SAAS,EAAE,SAAS;IAexB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS;IAmB3C,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;IAWxB,SAAS,CAAC,SAAS,EAAE,iBAAiB,EAAE;IASxC,UAAU,CAAC,KAAK,EAAE,MAAM;IASxB,WAAW,CAAC,KAAK,EAAE,MAAM;IAezB,SAAS,CAAC,KAAK,EAAE,MAAM;IAevB,kBAAkB;IAOlB,IAAI,kBAAkB,kDAErB;IAED,IAAI,aAAa,YAEhB;IAED,IAAI,SAAS,WAEZ;IAED,oBAAoB;IAMpB,YAAY;IAMZ,YAAY,CACV,qBAAqB,EAAE,CAAC,SAAS,GAAG,cAAc,GAAG,YAAY,CAAC,EAAE;IAmBtE,MAAM,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,iBAAiB,EAAE;IAoBlE,QAAQ,CAAC,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM;IAaxD,cAAc,CAAC,UAAU,EAAE,eAAe;IAkC1C,MAAM;;;;IAUN,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,GAAG,eAAe;CActD"}
@@ -1,5 +1,5 @@
1
1
  import { type ComponentType, type ComponentDef } from '../components/types.js';
2
- import { ConditionValueAbstract } from '../conditions/condition-value-abstract.js';
2
+ import { type ConditionValueAbstract } from '../conditions/condition-value-abstract.js';
3
3
  export decl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AAZ,YAAY;;;gCAAZ,YAAY;;;;;gCAYZ,YAAY;;;;gCAAZ,YAAY;;;;gCAAZ,YAAY;;;;gCAAZ,YAAY;;;;;gCAZZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;;;gCAYZ,YAAY;;;;gCAAZ,YAAY;;;;gCAAZ,YAAY;;;;gCAAZ,YAAY;;;;;gCAZZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;;;gCAYZ,YAAY;;;;gCAAZ,YAAY;;;;gCAAZ,YAAY;;;;gCAAZ,YAAY;;;;;gCA/CZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;;gCAPZ,YAAY;;;gCAAZ,YAAY;;;;;gCAOZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;;gCAPZ,YAAY;;;gCAAZ,YAAY;;;;;gCAOZ,YAAY;;;gCAAZ,YAAY;;;gCAAZ,YAAY;;;;gCAPZ,YAAY;;;gCAAZ,YAAY;;;CA5BnC,CAAA;AAED,wBAAgB,gBAAgB,CAAC,SAAS,KAAA,YAEzC;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,sBAAsB,OAM9B;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,KAAA,OAEnE;AAyCD,eAAO,MAAM,+BAA+B,UAE3C,CAAA;AACD,eAAO,MAAM,+BAA+B,UAE3C,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { ConditionAbstract } from '../conditions/condition-abstract.js';
2
- import { Coordinator } from '../conditions/enums.js';
2
+ import { type Coordinator } from '../conditions/enums.js';
3
3
  export declare class ConditionRef extends ConditionAbstract {
4
4
  conditionName: string;
5
5
  conditionDisplayName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"condition-ref.d.ts","sourceRoot":"","sources":["../../../src/conditions/condition-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,qBAAa,YAAa,SAAQ,iBAAiB;IACjD,aAAa,EAAE,MAAM,CAAA;IACrB,oBAAoB,EAAE,MAAM,CAAA;gBAG1B,aAAa,EAAE,MAAM,EACrB,oBAAoB,EAAE,MAAM,EAC5B,WAAW,EAAE,WAAW,GAAG,SAAS;IAgBtC,gBAAgB;IAKhB,eAAe;IAIf,mBAAmB;IAInB,KAAK;CAON"}
1
+ {"version":3,"file":"condition-ref.d.ts","sourceRoot":"","sources":["../../../src/conditions/condition-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAE5D,qBAAa,YAAa,SAAQ,iBAAiB;IACjD,aAAa,EAAE,MAAM,CAAA;IACrB,oBAAoB,EAAE,MAAM,CAAA;gBAG1B,aAAa,EAAE,MAAM,EACrB,oBAAoB,EAAE,MAAM,EAC5B,WAAW,EAAE,WAAW,GAAG,SAAS;IAgBtC,gBAAgB;IAKhB,eAAe;IAIf,mBAAmB;IAInB,KAAK;CAON"}
@@ -1,7 +1,7 @@
1
- import { ConditionField } from '../conditions/condition-field.js';
2
1
  import { ConditionAbstract } from '../conditions/condition-abstract.js';
3
- import { ConditionValue, RelativeTimeValue } from '../conditions/condition-values.js';
4
- import { Coordinator } from '../conditions/enums.js';
2
+ import { ConditionField } from '../conditions/condition-field.js';
3
+ import { type ConditionValue, type RelativeTimeValue } from '../conditions/condition-values.js';
4
+ import { type Coordinator } from '../conditions/enums.js';
5
5
  export declare class Condition extends ConditionAbstract {
6
6
  field: ConditionField;
7
7
  operator: string;
@@ -1 +1 @@
1
- {"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../src/conditions/condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAE1E,OAAO,EACL,cAAc,EACd,iBAAiB,EAClB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,qBAAa,SAAU,SAAQ,iBAAiB;IAC9C,KAAK,EAAE,cAAc,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,cAAc,GAAG,iBAAiB,CAAA;gBAGvC,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,cAAc,GAAG,iBAAiB,EACzC,WAAW,CAAC,EAAE,WAAW;IAmB3B,gBAAgB;IAKhB,eAAe;IAMf,mBAAmB;IASnB,KAAK;CAQN"}
1
+ {"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../src/conditions/condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AAGpE,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACvB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAE5D,qBAAa,SAAU,SAAQ,iBAAiB;IAC9C,KAAK,EAAE,cAAc,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,cAAc,GAAG,iBAAiB,CAAA;gBAGvC,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,cAAc,GAAG,iBAAiB,EACzC,WAAW,CAAC,EAAE,WAAW;IAmB3B,gBAAgB;IAKhB,eAAe;IAMf,mBAAmB;IASnB,KAAK;CAQN"}
@@ -1,9 +1,9 @@
1
- import { type Condition } from '../conditions/condition.js';
2
- import { type ConditionRef } from '../conditions/condition-ref.js';
3
1
  import { type ConditionGroup } from '../conditions/condition-group.js';
2
+ import { type ConditionRef } from '../conditions/condition-ref.js';
3
+ import { type Condition } from '../conditions/condition.js';
4
4
  export type ConditionsArray = (Condition | ConditionGroup | ConditionRef)[];
5
5
  export type DateTimeUnitValues = 'years' | 'months' | 'days' | 'hours' | 'minutes' | 'seconds';
6
- export type DateUnits = {
6
+ export interface DateUnits {
7
7
  YEARS: {
8
8
  display: 'year(s)';
9
9
  value: 'years';
@@ -16,8 +16,8 @@ export type DateUnits = {
16
16
  display: 'day(s)';
17
17
  value: 'days';
18
18
  };
19
- };
20
- export type TimeUnits = {
19
+ }
20
+ export interface TimeUnits {
21
21
  HOURS: {
22
22
  display: 'hour(s)';
23
23
  value: 'hours';
@@ -30,5 +30,5 @@ export type TimeUnits = {
30
30
  display: 'second(s)';
31
31
  value: 'seconds';
32
32
  };
33
- };
33
+ }
34
34
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/conditions/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qCAAqC,CAAA;AAEzE,MAAM,MAAM,eAAe,GAAG,CAAC,SAAS,GAAG,cAAc,GAAG,YAAY,CAAC,EAAE,CAAA;AAE3E,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACP,QAAQ,GACR,MAAM,GACN,OAAO,GACP,SAAS,GACT,SAAS,CAAA;AAEb,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;IAC7C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A;CAC3C;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;IAC7C,OAAO,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,CAAA;IACnD,OAAO,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,CAAA;CACpD"}
@@ -53,90 +53,88 @@ export interface Feedback {
53
53
  url?: string;
54
54
  emailAddress?: string;
55
55
  }
56
- export type PhaseBanner = {
56
+ export interface PhaseBanner {
57
57
  phase?: 'alpha' | 'beta';
58
58
  feedbackUrl?: string;
59
- };
60
- export type MultipleApiKeys = {
59
+ }
60
+ export interface MultipleApiKeys {
61
61
  test?: string;
62
62
  production?: string;
63
- };
64
- export type EmailOutputConfiguration = {
63
+ }
64
+ export interface EmailOutputConfiguration {
65
65
  emailAddress: string;
66
- };
67
- export type NotifyOutputConfiguration = {
66
+ }
67
+ export interface NotifyOutputConfiguration {
68
68
  apiKey: string;
69
69
  templateId: string;
70
70
  emailField: string;
71
71
  personalisation: string[];
72
- personalisationFieldCustomisation?: {
73
- [personalisationName: string]: string[];
74
- };
72
+ personalisationFieldCustomisation?: Record<string, string[]>;
75
73
  addReferencesToPersonalisation?: boolean;
76
74
  emailReplyToIdConfiguration?: {
77
75
  emailReplyToId: string;
78
76
  condition?: string | undefined;
79
77
  }[];
80
- };
81
- export type WebhookOutputConfiguration = {
78
+ }
79
+ export interface WebhookOutputConfiguration {
82
80
  url: string;
83
- };
81
+ }
84
82
  export type OutputConfiguration = EmailOutputConfiguration | NotifyOutputConfiguration | WebhookOutputConfiguration;
85
- export type Output = {
83
+ export interface Output {
86
84
  name: string;
87
85
  title: string;
88
86
  type: OutputType;
89
87
  outputConfiguration: OutputConfiguration;
90
- };
91
- export type ConfirmationPage = {
88
+ }
89
+ export interface ConfirmationPage {
92
90
  customText: {
93
91
  title: string;
94
92
  paymentSkipped: Toggleable<string>;
95
93
  nextSteps: Toggleable<string>;
96
94
  };
97
95
  components: ComponentDef[];
98
- };
99
- export type PaymentSkippedWarningPage = {
96
+ }
97
+ export interface PaymentSkippedWarningPage {
100
98
  customText: {
101
99
  title: string;
102
100
  caption: string;
103
101
  body: string;
104
102
  };
105
- };
106
- export type SpecialPages = {
103
+ }
104
+ export interface SpecialPages {
107
105
  confirmationPage?: ConfirmationPage;
108
106
  paymentSkippedWarningPage?: PaymentSkippedWarningPage;
109
- };
107
+ }
110
108
  export declare function isMultipleApiKey(payApiKey: string | MultipleApiKeys | undefined): payApiKey is MultipleApiKeys;
111
- export type Fee = {
109
+ export interface Fee {
112
110
  description: string;
113
111
  amount: number;
114
112
  multiplier?: string;
115
113
  condition?: string;
116
114
  prefix?: string;
117
- };
118
- export type FeeOptions = {
115
+ }
116
+ export interface FeeOptions {
119
117
  paymentReferenceFormat?: string;
120
118
  payReturnUrl?: string;
121
119
  allowSubmissionWithoutPayment: boolean;
122
120
  maxAttempts: number;
123
121
  customPayErrorMessage?: string;
124
122
  showPaymentSkippedWarningPage: boolean;
125
- };
123
+ }
126
124
  export type ConditionWrapperValue = string | {
127
125
  name: string;
128
126
  conditions: Condition[];
129
127
  };
130
- export type ConditionRawData = {
128
+ export interface ConditionRawData {
131
129
  name: string;
132
130
  displayName: string;
133
131
  value: ConditionWrapperValue;
134
- };
132
+ }
135
133
  /**
136
134
  * `FormDefinition` is a typescript representation of `Schema`
137
135
  */
138
- export type FormDefinition = {
139
- pages: Array<Page | RepeatingFieldPage>;
136
+ export interface FormDefinition {
137
+ pages: (Page | RepeatingFieldPage)[];
140
138
  conditions: ConditionRawData[];
141
139
  lists: List[];
142
140
  sections: Section[];
@@ -153,6 +151,6 @@ export type FormDefinition = {
153
151
  specialPages?: SpecialPages;
154
152
  paymentReferenceFormat?: string;
155
153
  feeOptions: FeeOptions;
156
- };
154
+ }
157
155
  export {};
158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B,OAAO,CAAC,IAAI,KAAA,GAAG,eAAe,CAuB7C"}
1
+ {"version":3,"file":"migration.1-2.d.ts","sourceRoot":"","sources":["../../../src/migration/migration.1-2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAiF/D,wBAAgB,OAAO,CAAC,IAAI,KAAA,GAAG,eAAe,CAuB7C"}
@@ -1,7 +1,6 @@
1
1
  import { type MigrationScript } from '../migration/types.js';
2
2
  /**
3
3
  * Returns which migrations that should be run against your Object with the given version
4
- * @param version
5
4
  */
6
5
  export declare function whichMigrations(version: number): Set<MigrationScript>;
7
6
  //# sourceMappingURL=whichMigrations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"whichMigrations.d.ts","sourceRoot":"","sources":["../../../src/migration/whichMigrations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE/D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,wBAc9C"}
1
+ {"version":3,"file":"whichMigrations.d.ts","sourceRoot":"","sources":["../../../src/migration/whichMigrations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE/D;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,wBAc9C"}
@@ -16,5 +16,5 @@ export declare const Schema: joi.ObjectSchema<any>;
16
16
  * 2 - 2023-05-04 `feeOptions` has been introduced. paymentReferenceFormat and payApiKey can be configured in top level or feeOptions. feeOptions will take precedent.
17
17
  * if feeOptions are empty, it will pull values from the top level keys.
18
18
  * WARN: Fee/GOV.UK pay configurations (apart from fees) should no longer be stored in the top level, always within feeOptions.
19
- **/
19
+ */
20
20
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB;;;GAGG;AACH,eAAO,MAAM,eAAe,IAAI,CAAA;AA2EhC,eAAO,MAAM,eAAe,uBAcZ,CAAA;AA0KhB,eAAO,MAAM,MAAM,uBAsBf,CAAA;AAEJ;;;;;;;;;;IAUI"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB;;;GAGG;AACH,eAAO,MAAM,eAAe,IAAI,CAAA;AA2EhC,eAAO,MAAM,eAAe,uBAcZ,CAAA;AA0KhB,eAAO,MAAM,MAAM,uBAsBf,CAAA;AAEJ;;;;;;;;;;GAUG"}
@@ -2,8 +2,6 @@ export declare const serialiseAndDeserialise: <T>(obj: T) => T;
2
2
  export declare const clone: <T>(obj: T & {
3
3
  clone?: () => T;
4
4
  }) => T;
5
- export declare function filter<T extends {
6
- [key: string]: unknown;
7
- }>(obj: T, predicate: (value: any) => boolean): Partial<T>;
5
+ export declare function filter<T extends Record<string, unknown>>(obj: T, predicate: (value: any) => boolean): Partial<T>;
8
6
  export declare const nanoid: (size?: number | undefined) => string;
9
7
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,WAAY,CAAC,KAAG,CAMnD,CAAA;AAED,eAAO,MAAM,KAAK,WAAY,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAA;CAAE,KAAG,CASvD,CAAA;AAED,wBAAgB,MAAM,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EACzD,GAAG,EAAE,CAAC,EACN,SAAS,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,GACjC,OAAO,CAAC,CAAC,CAAC,CAUZ;AAED,eAAO,MAAM,MAAM,uCAA6D,CAAA"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,WAAY,CAAC,KAAG,CAMnD,CAAA;AAED,eAAO,MAAM,KAAK,WAAY,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAA;CAAE,KAAG,CASvD,CAAA;AAED,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtD,GAAG,EAAE,CAAC,EACN,SAAS,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,GACjC,OAAO,CAAC,CAAC,CAAC,CAUZ;AAED,eAAO,MAAM,MAAM,uCAA6D,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.12",
3
+ "version": "3.0.14",
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": {
@@ -27,13 +27,13 @@ export type ComponentType =
27
27
 
28
28
  export type ComponentSubType = 'field' | 'content'
29
29
 
30
- export type ConditionalComponent = {
30
+ export interface ConditionalComponent {
31
31
  name: 'TextField' | 'NumberField'
32
32
  title: string
33
33
  subType: 'field'
34
34
  }
35
35
 
36
- export type ContentOptions = {
36
+ export interface ContentOptions {
37
37
  condition?: string
38
38
  }
39
39
 
@@ -1,4 +1,4 @@
1
- import { Coordinator } from '~/src/conditions/enums.js'
1
+ import { type Coordinator } from '~/src/conditions/enums.js'
2
2
  import { toPresentationString, toExpression } from '~/src/conditions/helpers.js'
3
3
  import { type ConditionsArray } from '~/src/conditions/types.js'
4
4
 
@@ -1,9 +1,9 @@
1
1
  import { ConditionField } from '~/src/conditions/condition-field.js'
2
2
  import { ConditionGroupDef } from '~/src/conditions/condition-group-def.js'
3
- import { Condition } from '~/src/conditions/condition.js'
4
- import { ConditionRef } from '~/src/conditions/condition-ref.js'
5
3
  import { ConditionGroup } from '~/src/conditions/condition-group.js'
4
+ import { ConditionRef } from '~/src/conditions/condition-ref.js'
6
5
  import { conditionValueFrom } from '~/src/conditions/condition-values.js'
6
+ import { Condition } from '~/src/conditions/condition.js'
7
7
  import { Coordinator } from '~/src/conditions/enums.js'
8
8
  import { toPresentationString, toExpression } from '~/src/conditions/helpers.js'
9
9
  import { type ConditionsArray } from '~/src/conditions/types.js'
@@ -194,20 +194,23 @@ export class ConditionsModel {
194
194
  }
195
195
 
196
196
  _group(conditions: ConditionsArray, groupDefs: ConditionGroupDef[]) {
197
- return conditions.reduce((groups, condition, index, conditions) => {
198
- const groupDef = groupDefs.find((groupDef) => groupDef.contains(index))
199
-
200
- if (groupDef) {
201
- if (groupDef.startsWith(index)) {
202
- const groupConditions = groupDef.applyTo(conditions)
203
- groups.push(new ConditionGroup(groupConditions))
197
+ return conditions.reduce<ConditionsArray>(
198
+ (groups, condition, index, conditions) => {
199
+ const groupDef = groupDefs.find((groupDef) => groupDef.contains(index))
200
+
201
+ if (groupDef) {
202
+ if (groupDef.startsWith(index)) {
203
+ const groupConditions = groupDef.applyTo(conditions)
204
+ groups.push(new ConditionGroup(groupConditions))
205
+ }
206
+ } else {
207
+ groups.push(condition)
204
208
  }
205
- } else {
206
- groups.push(condition)
207
- }
208
209
 
209
- return groups
210
- }, [] as ConditionsArray)
210
+ return groups
211
+ },
212
+ []
213
+ )
211
214
  }
212
215
 
213
216
  _ungroup(conditions: ConditionsArray, splitIndex: number) {
@@ -283,18 +286,14 @@ export class ConditionsModel {
283
286
  }
284
287
  }
285
288
 
286
- interface ConditionFrom {
287
- (
288
- it: Condition | ConditionRef | ConditionGroup
289
- ): Condition | ConditionRef | ConditionGroup
290
- }
289
+ type ConditionFrom = (
290
+ it: Condition | ConditionRef | ConditionGroup
291
+ ) => Condition | ConditionRef | ConditionGroup
291
292
 
292
293
  const conditionFrom: ConditionFrom = function (it) {
293
294
  if ('conditions' in it) {
294
295
  return new ConditionGroup(
295
- (it as ConditionGroup).conditions.map((condition) =>
296
- conditionFrom(condition)
297
- )
296
+ it.conditions.map((condition) => conditionFrom(condition))
298
297
  )
299
298
  }
300
299
 
@@ -2,7 +2,7 @@ import {
2
2
  type ComponentType,
3
3
  type ComponentDef
4
4
  } from '~/src/components/types.js'
5
- import { ConditionValueAbstract } from '~/src/conditions/condition-value-abstract.js'
5
+ import { type ConditionValueAbstract } from '~/src/conditions/condition-value-abstract.js'
6
6
  import {
7
7
  timeUnits,
8
8
  dateUnits,
@@ -1,5 +1,5 @@
1
1
  import { ConditionAbstract } from '~/src/conditions/condition-abstract.js'
2
- import { Coordinator } from '~/src/conditions/enums.js'
2
+ import { type Coordinator } from '~/src/conditions/enums.js'
3
3
 
4
4
  export class ConditionRef extends ConditionAbstract {
5
5
  conditionName: string
@@ -1,12 +1,12 @@
1
- import { ConditionField } from '~/src/conditions/condition-field.js'
2
1
  import { ConditionAbstract } from '~/src/conditions/condition-abstract.js'
2
+ import { ConditionField } from '~/src/conditions/condition-field.js'
3
3
  import { getExpression } from '~/src/conditions/condition-operators.js'
4
+ import { ConditionValueAbstract } from '~/src/conditions/condition-value-abstract.js'
4
5
  import {
5
- ConditionValue,
6
- RelativeTimeValue
6
+ type ConditionValue,
7
+ type RelativeTimeValue
7
8
  } from '~/src/conditions/condition-values.js'
8
- import { ConditionValueAbstract } from '~/src/conditions/condition-value-abstract.js'
9
- import { Coordinator } from '~/src/conditions/enums.js'
9
+ import { type Coordinator } from '~/src/conditions/enums.js'
10
10
 
11
11
  export class Condition extends ConditionAbstract {
12
12
  field: ConditionField
@@ -1,6 +1,6 @@
1
- import { type Condition } from '~/src/conditions/condition.js'
2
- import { type ConditionRef } from '~/src/conditions/condition-ref.js'
3
1
  import { type ConditionGroup } from '~/src/conditions/condition-group.js'
2
+ import { type ConditionRef } from '~/src/conditions/condition-ref.js'
3
+ import { type Condition } from '~/src/conditions/condition.js'
4
4
 
5
5
  export type ConditionsArray = (Condition | ConditionGroup | ConditionRef)[]
6
6
 
@@ -12,13 +12,13 @@ export type DateTimeUnitValues =
12
12
  | 'minutes'
13
13
  | 'seconds'
14
14
 
15
- export type DateUnits = {
15
+ export interface DateUnits {
16
16
  YEARS: { display: 'year(s)'; value: 'years' }
17
17
  MONTHS: { display: 'month(s)'; value: 'months' }
18
18
  DAYS: { display: 'day(s)'; value: 'days' }
19
19
  }
20
20
 
21
- export type TimeUnits = {
21
+ export interface TimeUnits {
22
22
  HOURS: { display: 'hour(s)'; value: 'hours' }
23
23
  MINUTES: { display: 'minute(s)'; value: 'minutes' }
24
24
  SECONDS: { display: 'second(s)'; value: 'seconds' }
@@ -59,28 +59,26 @@ export interface Feedback {
59
59
  emailAddress?: string
60
60
  }
61
61
 
62
- export type PhaseBanner = {
62
+ export interface PhaseBanner {
63
63
  phase?: 'alpha' | 'beta'
64
64
  feedbackUrl?: string
65
65
  }
66
66
 
67
- export type MultipleApiKeys = {
67
+ export interface MultipleApiKeys {
68
68
  test?: string
69
69
  production?: string
70
70
  }
71
71
 
72
- export type EmailOutputConfiguration = {
72
+ export interface EmailOutputConfiguration {
73
73
  emailAddress: string
74
74
  }
75
75
 
76
- export type NotifyOutputConfiguration = {
76
+ export interface NotifyOutputConfiguration {
77
77
  apiKey: string
78
78
  templateId: string
79
79
  emailField: string
80
80
  personalisation: string[]
81
- personalisationFieldCustomisation?: {
82
- [personalisationName: string]: string[]
83
- }
81
+ personalisationFieldCustomisation?: Record<string, string[]>
84
82
  addReferencesToPersonalisation?: boolean
85
83
  emailReplyToIdConfiguration?: {
86
84
  emailReplyToId: string
@@ -88,7 +86,7 @@ export type NotifyOutputConfiguration = {
88
86
  }[]
89
87
  }
90
88
 
91
- export type WebhookOutputConfiguration = {
89
+ export interface WebhookOutputConfiguration {
92
90
  url: string
93
91
  }
94
92
 
@@ -97,14 +95,14 @@ export type OutputConfiguration =
97
95
  | NotifyOutputConfiguration
98
96
  | WebhookOutputConfiguration
99
97
 
100
- export type Output = {
98
+ export interface Output {
101
99
  name: string
102
100
  title: string
103
101
  type: OutputType
104
102
  outputConfiguration: OutputConfiguration
105
103
  }
106
104
 
107
- export type ConfirmationPage = {
105
+ export interface ConfirmationPage {
108
106
  customText: {
109
107
  title: string
110
108
  paymentSkipped: Toggleable<string>
@@ -113,7 +111,7 @@ export type ConfirmationPage = {
113
111
  components: ComponentDef[]
114
112
  }
115
113
 
116
- export type PaymentSkippedWarningPage = {
114
+ export interface PaymentSkippedWarningPage {
117
115
  customText: {
118
116
  title: string
119
117
  caption: string
@@ -121,7 +119,7 @@ export type PaymentSkippedWarningPage = {
121
119
  }
122
120
  }
123
121
 
124
- export type SpecialPages = {
122
+ export interface SpecialPages {
125
123
  confirmationPage?: ConfirmationPage
126
124
  paymentSkippedWarningPage?: PaymentSkippedWarningPage
127
125
  }
@@ -133,7 +131,7 @@ export function isMultipleApiKey(
133
131
  return obj.test !== undefined || obj.production !== undefined
134
132
  }
135
133
 
136
- export type Fee = {
134
+ export interface Fee {
137
135
  description: string
138
136
  amount: number
139
137
  multiplier?: string
@@ -141,7 +139,7 @@ export type Fee = {
141
139
  prefix?: string
142
140
  }
143
141
 
144
- export type FeeOptions = {
142
+ export interface FeeOptions {
145
143
  paymentReferenceFormat?: string
146
144
  payReturnUrl?: string
147
145
  allowSubmissionWithoutPayment: boolean
@@ -157,7 +155,7 @@ export type ConditionWrapperValue =
157
155
  conditions: Condition[]
158
156
  }
159
157
 
160
- export type ConditionRawData = {
158
+ export interface ConditionRawData {
161
159
  name: string
162
160
  displayName: string
163
161
  value: ConditionWrapperValue
@@ -166,8 +164,8 @@ export type ConditionRawData = {
166
164
  /**
167
165
  * `FormDefinition` is a typescript representation of `Schema`
168
166
  */
169
- export type FormDefinition = {
170
- pages: Array<Page | RepeatingFieldPage>
167
+ export interface FormDefinition {
168
+ pages: (Page | RepeatingFieldPage)[]
171
169
  conditions: ConditionRawData[]
172
170
  lists: List[]
173
171
  sections: Section[]