@dwp/govuk-casa 8.15.0 → 9.1.0

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 (201) hide show
  1. package/README.md +9 -9
  2. package/dist/assets/css/casa.css +2 -1
  3. package/dist/assets/css/casa.css.map +1 -0
  4. package/dist/casa.d.ts +122 -99
  5. package/dist/casa.js +120 -88
  6. package/dist/casa.js.map +1 -1
  7. package/dist/lib/CasaTemplateLoader.d.ts +4 -4
  8. package/dist/lib/CasaTemplateLoader.js +16 -16
  9. package/dist/lib/CasaTemplateLoader.js.map +1 -1
  10. package/dist/lib/JourneyContext.d.ts +38 -40
  11. package/dist/lib/JourneyContext.js +89 -75
  12. package/dist/lib/JourneyContext.js.map +1 -1
  13. package/dist/lib/MutableRouter.d.ts +40 -41
  14. package/dist/lib/MutableRouter.js +64 -71
  15. package/dist/lib/MutableRouter.js.map +1 -1
  16. package/dist/lib/Plan.d.ts +29 -26
  17. package/dist/lib/Plan.js +85 -71
  18. package/dist/lib/Plan.js.map +1 -1
  19. package/dist/lib/ValidationError.d.ts +16 -15
  20. package/dist/lib/ValidationError.js +21 -20
  21. package/dist/lib/ValidationError.js.map +1 -1
  22. package/dist/lib/ValidatorFactory.d.ts +15 -13
  23. package/dist/lib/ValidatorFactory.js +14 -12
  24. package/dist/lib/ValidatorFactory.js.map +1 -1
  25. package/dist/lib/configuration-ingestor.d.ts +37 -40
  26. package/dist/lib/configuration-ingestor.js +93 -93
  27. package/dist/lib/configuration-ingestor.js.map +1 -1
  28. package/dist/lib/configure.d.ts +6 -6
  29. package/dist/lib/configure.js +14 -12
  30. package/dist/lib/configure.js.map +1 -1
  31. package/dist/lib/constants.d.ts +1 -3
  32. package/dist/lib/constants.js +9 -11
  33. package/dist/lib/constants.js.map +1 -1
  34. package/dist/lib/context-id-generators.d.ts +3 -5
  35. package/dist/lib/context-id-generators.js +7 -6
  36. package/dist/lib/context-id-generators.js.map +1 -1
  37. package/dist/lib/end-session.d.ts +4 -4
  38. package/dist/lib/end-session.js +5 -5
  39. package/dist/lib/field.d.ts +24 -29
  40. package/dist/lib/field.js +41 -70
  41. package/dist/lib/field.js.map +1 -1
  42. package/dist/lib/index.d.ts +13 -13
  43. package/dist/lib/logger.d.ts +7 -6
  44. package/dist/lib/logger.js +7 -7
  45. package/dist/lib/logger.js.map +1 -1
  46. package/dist/lib/mount.d.ts +5 -5
  47. package/dist/lib/mount.js +12 -17
  48. package/dist/lib/mount.js.map +1 -1
  49. package/dist/lib/nunjucks-filters.d.ts +10 -12
  50. package/dist/lib/nunjucks-filters.js +35 -35
  51. package/dist/lib/nunjucks-filters.js.map +1 -1
  52. package/dist/lib/nunjucks.d.ts +7 -5
  53. package/dist/lib/nunjucks.js +10 -8
  54. package/dist/lib/nunjucks.js.map +1 -1
  55. package/dist/lib/utils.d.ts +19 -19
  56. package/dist/lib/utils.js +62 -55
  57. package/dist/lib/utils.js.map +1 -1
  58. package/dist/lib/validators/dateObject.d.ts +29 -22
  59. package/dist/lib/validators/dateObject.js +58 -49
  60. package/dist/lib/validators/dateObject.js.map +1 -1
  61. package/dist/lib/validators/email.d.ts +4 -4
  62. package/dist/lib/validators/email.js +4 -4
  63. package/dist/lib/validators/inArray.d.ts +4 -4
  64. package/dist/lib/validators/inArray.js +7 -8
  65. package/dist/lib/validators/inArray.js.map +1 -1
  66. package/dist/lib/validators/index.d.ts +10 -10
  67. package/dist/lib/validators/index.js +1 -3
  68. package/dist/lib/validators/index.js.map +1 -1
  69. package/dist/lib/validators/nino.d.ts +9 -8
  70. package/dist/lib/validators/nino.js +14 -10
  71. package/dist/lib/validators/nino.js.map +1 -1
  72. package/dist/lib/validators/postalAddressObject.d.ts +37 -24
  73. package/dist/lib/validators/postalAddressObject.js +65 -46
  74. package/dist/lib/validators/postalAddressObject.js.map +1 -1
  75. package/dist/lib/validators/range.d.ts +12 -8
  76. package/dist/lib/validators/range.js +11 -9
  77. package/dist/lib/validators/range.js.map +1 -1
  78. package/dist/lib/validators/regex.d.ts +4 -4
  79. package/dist/lib/validators/regex.js +5 -5
  80. package/dist/lib/validators/required.d.ts +6 -6
  81. package/dist/lib/validators/required.js +9 -11
  82. package/dist/lib/validators/required.js.map +1 -1
  83. package/dist/lib/validators/strlen.d.ts +12 -8
  84. package/dist/lib/validators/strlen.js +13 -11
  85. package/dist/lib/validators/strlen.js.map +1 -1
  86. package/dist/lib/validators/wordCount.d.ts +12 -8
  87. package/dist/lib/validators/wordCount.js +15 -11
  88. package/dist/lib/validators/wordCount.js.map +1 -1
  89. package/dist/lib/waypoint-url.d.ts +16 -13
  90. package/dist/lib/waypoint-url.js +39 -36
  91. package/dist/lib/waypoint-url.js.map +1 -1
  92. package/dist/middleware/body-parser.d.ts +1 -1
  93. package/dist/middleware/body-parser.js +6 -6
  94. package/dist/middleware/body-parser.js.map +1 -1
  95. package/dist/middleware/data.d.ts +1 -1
  96. package/dist/middleware/data.js +8 -7
  97. package/dist/middleware/data.js.map +1 -1
  98. package/dist/middleware/gather-fields.d.ts +2 -2
  99. package/dist/middleware/gather-fields.js +6 -4
  100. package/dist/middleware/gather-fields.js.map +1 -1
  101. package/dist/middleware/i18n.js +13 -15
  102. package/dist/middleware/i18n.js.map +1 -1
  103. package/dist/middleware/post.js +30 -18
  104. package/dist/middleware/post.js.map +1 -1
  105. package/dist/middleware/pre.d.ts +2 -2
  106. package/dist/middleware/pre.js +46 -26
  107. package/dist/middleware/pre.js.map +1 -1
  108. package/dist/middleware/progress-journey.d.ts +1 -1
  109. package/dist/middleware/progress-journey.js +5 -5
  110. package/dist/middleware/progress-journey.js.map +1 -1
  111. package/dist/middleware/sanitise-fields.d.ts +1 -1
  112. package/dist/middleware/sanitise-fields.js +13 -11
  113. package/dist/middleware/sanitise-fields.js.map +1 -1
  114. package/dist/middleware/serve-first-waypoint.d.ts +3 -3
  115. package/dist/middleware/serve-first-waypoint.js +8 -6
  116. package/dist/middleware/serve-first-waypoint.js.map +1 -1
  117. package/dist/middleware/session.js +14 -11
  118. package/dist/middleware/session.js.map +1 -1
  119. package/dist/middleware/skip-waypoint.d.ts +1 -1
  120. package/dist/middleware/skip-waypoint.js +3 -3
  121. package/dist/middleware/skip-waypoint.js.map +1 -1
  122. package/dist/middleware/steer-journey.d.ts +1 -1
  123. package/dist/middleware/steer-journey.js +16 -14
  124. package/dist/middleware/steer-journey.js.map +1 -1
  125. package/dist/middleware/strip-proxy-path.d.ts +1 -1
  126. package/dist/middleware/strip-proxy-path.js +3 -3
  127. package/dist/middleware/strip-proxy-path.js.map +1 -1
  128. package/dist/middleware/validate-fields.d.ts +1 -1
  129. package/dist/middleware/validate-fields.js +2 -5
  130. package/dist/middleware/validate-fields.js.map +1 -1
  131. package/dist/routes/ancillary.d.ts +3 -3
  132. package/dist/routes/ancillary.js +4 -4
  133. package/dist/routes/ancillary.js.map +1 -1
  134. package/dist/routes/journey.d.ts +2 -2
  135. package/dist/routes/journey.js +91 -39
  136. package/dist/routes/journey.js.map +1 -1
  137. package/dist/routes/static.d.ts +7 -5
  138. package/dist/routes/static.js +20 -20
  139. package/dist/routes/static.js.map +1 -1
  140. package/package.json +17 -16
  141. package/src/casa.js +134 -102
  142. package/src/lib/CasaTemplateLoader.js +24 -19
  143. package/src/lib/JourneyContext.js +147 -107
  144. package/src/lib/MutableRouter.js +72 -74
  145. package/src/lib/Plan.js +145 -97
  146. package/src/lib/ValidationError.js +25 -21
  147. package/src/lib/ValidatorFactory.js +17 -13
  148. package/src/lib/configuration-ingestor.js +147 -110
  149. package/src/lib/configure.js +34 -32
  150. package/src/lib/constants.js +9 -11
  151. package/src/lib/context-id-generators.js +40 -43
  152. package/src/lib/end-session.js +6 -6
  153. package/src/lib/field.js +74 -78
  154. package/src/lib/index.js +12 -12
  155. package/src/lib/logger.js +9 -9
  156. package/src/lib/mount.js +70 -80
  157. package/src/lib/nunjucks-filters.js +56 -59
  158. package/src/lib/nunjucks.js +23 -18
  159. package/src/lib/utils.js +78 -57
  160. package/src/lib/validators/dateObject.js +71 -60
  161. package/src/lib/validators/email.js +8 -8
  162. package/src/lib/validators/inArray.js +10 -11
  163. package/src/lib/validators/index.js +12 -14
  164. package/src/lib/validators/nino.js +29 -15
  165. package/src/lib/validators/postalAddressObject.js +87 -63
  166. package/src/lib/validators/range.js +14 -12
  167. package/src/lib/validators/regex.js +8 -8
  168. package/src/lib/validators/required.js +16 -16
  169. package/src/lib/validators/strlen.js +16 -14
  170. package/src/lib/validators/wordCount.js +22 -14
  171. package/src/lib/waypoint-url.js +64 -46
  172. package/src/middleware/body-parser.js +10 -10
  173. package/src/middleware/csrf.js +1 -1
  174. package/src/middleware/data.js +28 -24
  175. package/src/middleware/gather-fields.js +10 -9
  176. package/src/middleware/i18n.js +35 -37
  177. package/src/middleware/post.js +41 -21
  178. package/src/middleware/pre.js +62 -40
  179. package/src/middleware/progress-journey.js +32 -18
  180. package/src/middleware/sanitise-fields.js +43 -20
  181. package/src/middleware/serve-first-waypoint.js +14 -12
  182. package/src/middleware/session.js +74 -61
  183. package/src/middleware/skip-waypoint.js +7 -9
  184. package/src/middleware/steer-journey.js +40 -28
  185. package/src/middleware/strip-proxy-path.js +8 -7
  186. package/src/middleware/validate-fields.js +5 -12
  187. package/src/routes/ancillary.js +5 -7
  188. package/src/routes/journey.js +159 -85
  189. package/src/routes/static.js +62 -30
  190. package/views/casa/components/character-count/README.md +2 -2
  191. package/views/casa/components/checkboxes/README.md +6 -6
  192. package/views/casa/components/date-input/README.md +7 -7
  193. package/views/casa/components/input/README.md +2 -2
  194. package/views/casa/components/journey-form/README.md +33 -14
  195. package/views/casa/components/postal-address-object/README.md +4 -4
  196. package/views/casa/components/radios/README.md +6 -6
  197. package/views/casa/components/select/README.md +6 -6
  198. package/views/casa/components/textarea/README.md +2 -2
  199. package/views/casa/partials/scripts.njk +5 -3
  200. package/views/casa/partials/styles.njk +1 -4
  201. package/dist/assets/css/casa-ie8.css +0 -1
package/dist/casa.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type PageField = import('./lib/field').PageField;
1
+ export type PageField = import("./lib/field").PageField;
2
2
  export type ContextEventHandlerOptions = {
3
3
  /**
4
4
  * Context including changes
@@ -20,7 +20,8 @@ export type ContextEventHandlerOptions = {
20
20
  export type ContextEventHandler = (opts: ContextEventHandlerOptions) => void;
21
21
  export type ContextEventUserInfo = {
22
22
  /**
23
- * Request phase at which event is triggered
23
+ * Request phase at which event is
24
+ * triggered
24
25
  */
25
26
  casaRequestPhase?: symbol | undefined;
26
27
  };
@@ -39,7 +40,8 @@ export type ContextEvent = {
39
40
  handler: ContextEventHandler;
40
41
  };
41
42
  /**
42
- * Page configuration. A Page is the interactive representation of a waypoint
43
+ * Page configuration. A Page is the interactive
44
+ * representation of a waypoint
43
45
  */
44
46
  export type Page = {
45
47
  /**
@@ -51,11 +53,13 @@ export type Page = {
51
53
  */
52
54
  view: string;
53
55
  /**
54
- * Page-specific hooks (optional, default [])
56
+ * Page-specific hooks (optional, default []).
57
+ * Default is `[]`
55
58
  */
56
59
  hooks?: PageHook[] | undefined;
57
60
  /**
58
- * Fields to be managed on this page (optional, default [])
61
+ * Fields to be managed on this page
62
+ * (optional, default []). Default is `[]`
59
63
  */
60
64
  fields?: import("./lib/field.js").PageField[] | undefined;
61
65
  };
@@ -65,7 +69,8 @@ export type I18nOptions = {
65
69
  */
66
70
  dirs: string[];
67
71
  /**
68
- * Supported locales
72
+ * Supported locales. Default is
73
+ * `['en', 'cy']`
69
74
  */
70
75
  locales?: string[] | undefined;
71
76
  };
@@ -78,11 +83,13 @@ export type GlobalHook = {
78
83
  */
79
84
  hook: string;
80
85
  /**
81
- * Middleware function to insert at the hook point
86
+ * Middleware function to insert at the hook
87
+ * point
82
88
  */
83
89
  middleware: Function;
84
90
  /**
85
- * Only run if route path matches this string/regexp
91
+ * Only run if route path matches
92
+ * this string/regexp. Default is `undefined`
86
93
  */
87
94
  path?: string | RegExp | undefined;
88
95
  };
@@ -95,29 +102,32 @@ export type PageHook = {
95
102
  */
96
103
  hook: string;
97
104
  /**
98
- * Middleware function to insert at the hook point
105
+ * Middleware function to insert at the hook
106
+ * point
99
107
  */
100
108
  middleware: Function;
101
109
  };
102
110
  export type SessionOptions = {
103
111
  /**
104
- * Session name
112
+ * Session name. Default is `casasession`
105
113
  */
106
114
  name?: string | undefined;
107
115
  /**
108
- * Encryption secret
116
+ * Encryption secret. Default is `secret`
109
117
  */
110
118
  secret?: string | undefined;
111
119
  /**
112
- * Session ttl (seconds)
120
+ * Session ttl (seconds). Default is `3600`
113
121
  */
114
122
  ttl?: number | undefined;
115
123
  /**
116
- * Whether to use secure session cookies
124
+ * Whether to use secure session cookies.
125
+ * Default is `false`
117
126
  */
118
127
  secure?: boolean | undefined;
119
128
  /**
120
- * SameSite (true = Strict)
129
+ * SameSite (true = Strict).
130
+ * Default is `true`
121
131
  */
122
132
  cookieSameSite?: string | boolean | undefined;
123
133
  /**
@@ -125,8 +135,8 @@ export type SessionOptions = {
125
135
  */
126
136
  store?: object | undefined;
127
137
  /**
128
- * the URL path on which the session cookie
129
- * is valid (defaults to '/')
138
+ * The URL path on which the session cookie is
139
+ * valid (defaults to '/')
130
140
  */
131
141
  cookiePath?: string | undefined;
132
142
  };
@@ -139,7 +149,8 @@ export type IPlugin = {
139
149
  */
140
150
  configure?: PluginConfigureFunction | undefined;
141
151
  /**
142
- * Modify post-configuration artifacts
152
+ * Modify post-configuration
153
+ * artifacts
143
154
  */
144
155
  bootstrap?: PluginBootstrapFunction | undefined;
145
156
  };
@@ -149,15 +160,15 @@ export type HelmetConfigurator = (config: object) => object;
149
160
  /**
150
161
  * Mounting function.
151
162
  *
152
- * This will mount all of the routes and middleware in the correct order on
153
- * the given ExpressJS app.
163
+ * This will mount all of the routes and middleware in the correct order on the
164
+ * given ExpressJS app.
154
165
  *
155
166
  * Once this is called, you will not be able to modify any of the routers as
156
167
  * they will be "sealed".
157
168
  */
158
- export type Mounter = (app: import('express').Express, opts: {
169
+ export type Mounter = (app: import("express").Express, opts: {
159
170
  route?: string | undefined;
160
- }) => import('express').Express;
171
+ }) => import("express").Express;
161
172
  /**
162
173
  * Configuration options
163
174
  */
@@ -167,7 +178,7 @@ export type ConfigurationOptions = {
167
178
  */
168
179
  mountUrl?: string | undefined;
169
180
  /**
170
- * Template directories
181
+ * Template directories. Default is `[]`
171
182
  */
172
183
  views?: string[] | undefined;
173
184
  /**
@@ -175,15 +186,15 @@ export type ConfigurationOptions = {
175
186
  */
176
187
  session?: SessionOptions | undefined;
177
188
  /**
178
- * Pages the represent waypoints
189
+ * Pages the represent waypoints. Default is `[]`
179
190
  */
180
191
  pages?: Page[] | undefined;
181
192
  /**
182
- * Hooks to apply
193
+ * Hooks to apply. Default is `[]`
183
194
  */
184
195
  hooks?: GlobalHook[] | undefined;
185
196
  /**
186
- * Plugins
197
+ * Plugins. Default is `[]`
187
198
  */
188
199
  plugins?: IPlugin[] | undefined;
189
200
  /**
@@ -195,27 +206,33 @@ export type ConfigurationOptions = {
195
206
  */
196
207
  plan?: Plan | undefined;
197
208
  /**
198
- * Handlers for JourneyContext events
209
+ * Handlers for JourneyContext events.
210
+ * Default is `[]`
199
211
  */
200
212
  events?: ContextEvent[] | undefined;
201
213
  /**
202
- * Helmet configuration manipulator function
214
+ * Helmet configuration
215
+ * manipulator function
203
216
  */
204
217
  helmetConfigurator?: HelmetConfigurator | undefined;
205
218
  /**
206
- * Max number of form parameters to ingest
219
+ * Max number of form parameters to
220
+ * ingest. Default is `25`
207
221
  */
208
222
  formMaxParams?: number | undefined;
209
223
  /**
210
- * Max total form payload size to ingest
224
+ * Max total form payload size
225
+ * to ingest. Default is `"50KB"`
211
226
  */
212
227
  formMaxBytes?: string | number | undefined;
213
228
  /**
214
- * Custom context ID generator
229
+ * Custom context ID
230
+ * generator
215
231
  */
216
232
  contextIdGenerator?: ContextIdGenerator | undefined;
217
233
  /**
218
- * option to keep page errors active on GET request
234
+ * Option to keep page errors
235
+ * active on GET request
219
236
  */
220
237
  errorVisibility?: symbol | Function | undefined;
221
238
  };
@@ -226,7 +243,7 @@ export type ConfigureResult = {
226
243
  /**
227
244
  * Nunjucks environment
228
245
  */
229
- nunjucksEnv: import('nunjucks').Environment;
246
+ nunjucksEnv: import("nunjucks").Environment;
230
247
  /**
231
248
  * Router handling all static assets
232
249
  */
@@ -240,71 +257,71 @@ export type ConfigureResult = {
240
257
  */
241
258
  journeyRouter: MutableRouter;
242
259
  /**
243
- * Middleware mounted before everything
260
+ * Middleware
261
+ * mounted before everything
244
262
  */
245
- preMiddleware: import('express').RequestHandler[];
263
+ preMiddleware: import("express").RequestHandler[];
246
264
  /**
247
- * Middleware mounted after everything
265
+ * Middleware
266
+ * mounted after everything
248
267
  */
249
- postMiddleware: import('express').RequestHandler[];
268
+ postMiddleware: import("express").RequestHandler[];
250
269
  /**
251
- * CSRF get/set form middleware
270
+ * CSRF get/set
271
+ * form middleware
252
272
  */
253
- csrfMiddleware: import('express').RequestHandler[];
273
+ csrfMiddleware: import("express").RequestHandler[];
254
274
  /**
255
- * Session middleware
275
+ * Session
276
+ * middleware
256
277
  */
257
- sessionMiddleware: import('express').RequestHandler;
278
+ sessionMiddleware: import("express").RequestHandler;
258
279
  /**
259
- * Cookie-parsing middleware
280
+ * Cookie-parsing middleware
260
281
  */
261
- cookieParserMiddleware: import('express').RequestHandler[];
282
+ cookieParserMiddleware: import("express").RequestHandler[];
262
283
  /**
263
- * I18n preparation middleware
284
+ * I18n
285
+ * preparation middleware
264
286
  */
265
- i18nMiddleware: import('express').RequestHandler[];
287
+ i18nMiddleware: import("express").RequestHandler[];
266
288
  /**
267
- * Body parsing middleware
289
+ * Body
290
+ * parsing middleware
268
291
  */
269
- bodyParserMiddleware: import('express').RequestHandler;
292
+ bodyParserMiddleware: import("express").RequestHandler;
270
293
  /**
271
- * Function used to mount all CASA artifacts onto an ExpressJS app
294
+ * Function used to mount all CASA artifacts onto an
295
+ * ExpressJS app
272
296
  */
273
297
  mount: Mounter;
274
298
  /**
275
- * Ingested config supplied to `configure()`
299
+ * Ingested config supplied to
300
+ * `configure()`
276
301
  */
277
302
  config: ConfigurationOptions;
278
303
  };
279
304
  /**
280
- * Configuration for generating a ValidationError.
281
- * i.e. `new ValidationError(configObject)`
282
- * <br/><br/>
305
+ * Configuration for generating a ValidationError. i.e. `new
306
+ * ValidationError(configObject)` <br/><br/>
283
307
  *
284
- * The `fieldKeySuffix` is used to differentiate errors attached to
285
- * the same field name. For example, given these fields inputs ...
308
+ * The `fieldKeySuffix` is used to differentiate errors attached to the same
309
+ * field name. For example, given these fields inputs ...<pre> <input
310
+ * name="dateOfBirth[dd]" /> <input name="dateOfBirth[mm]" /> <input
311
+ * name="dateOfBirth[yyyy]" /> </pre>
286
312
  *
287
- * <pre>
288
- * &lt;input name="dateOfBirth[dd]" /&gt;
289
- * &lt;input name="dateOfBirth[mm]" /&gt;
290
- * &lt;input name="dateOfBirth[yyyy]" /&gt;
291
- * </pre>
313
+ * If we wanted to generate an error specifically for the `dd` element, then
314
+ * we'd include `{ fieldKeySuffix: '[dd]' }` in this config. <br/><br/>
292
315
  *
293
- * If we wanted to generate an error specifically for the `dd`
294
- * element, then we'd include `{ fieldKeySuffix: '[dd]' }` in this
295
- * config.
296
- * <br/><br/>
316
+ * We can also use `focusSuffix` to control which properties of an object field
317
+ * should be highlighted with a red border when in error. Looking again at the
318
+ * `dateOfBirth` example above, if we did not specify any `focusSuffix`, then
319
+ * all three inputs would be highlighted. However, if we use `{ focusSuffix:
320
+ * ['[dd]', '[yyyy]'] }` then only the `[dd]` and `[yyyy]` inputs would be
321
+ * highlighted. <br/><br/>
297
322
  *
298
- * We can also use `focusSuffix` to control which properties of an
299
- * object field should be highlighted with a red border when in error. Looking
300
- * again at the `dateOfBirth` example above, if we did not specify
301
- * any `focusSuffix`, then all three inputs would be highlighted.
302
- * However, if we use `{ focusSuffix: ['[dd]', '[yyyy]'] }` then only
303
- * the `[dd]` and `[yyyy]` inputs would be highlighted.
304
- * <br/><br/>
305
- *
306
- * The `fieldHref` and `field` properties are strictly for
307
- * internal use only and public access may be removed at any point.
323
+ * The `fieldHref` and `field` properties are strictly for internal use only and
324
+ * public access may be removed at any point.
308
325
  */
309
326
  export type ErrorMessageConfigObject = {
310
327
  /**
@@ -312,15 +329,18 @@ export type ErrorMessageConfigObject = {
312
329
  */
313
330
  summary: string;
314
331
  /**
315
- * Inline message (@deprecated now uses summary everywhere)
332
+ * Inline message (@deprecated now uses summary
333
+ * everywhere)
316
334
  */
317
335
  inline?: string | undefined;
318
336
  /**
319
- * String(s) to append to URL hash for focusing inputs
337
+ * String(s) to append to URL hash
338
+ * for focusing inputs
320
339
  */
321
340
  focusSuffix?: string | string[] | undefined;
322
341
  /**
323
- * Object fields may use this to show errors per sub-property
342
+ * Object fields may use this to show errors
343
+ * per sub-property
324
344
  */
325
345
  fieldKeySuffix?: string | undefined;
326
346
  /**
@@ -332,7 +352,8 @@ export type ErrorMessageConfigObject = {
332
352
  */
333
353
  validator?: string | undefined;
334
354
  /**
335
- * (internal) URL hash to link to field in UI, i.e `#f-..`
355
+ * (internal) URL hash to link to field in UI,
356
+ * i.e `#f-..`
336
357
  */
337
358
  fieldHref?: string | undefined;
338
359
  /**
@@ -380,7 +401,8 @@ export type Validator = {
380
401
  */
381
402
  validate: ValidateFunction;
382
403
  /**
383
- * Sanitise a given value prior to validation
404
+ * Sanitise a given value prior to
405
+ * validation
384
406
  */
385
407
  sanitise: FieldProcessorFunction;
386
408
  /**
@@ -405,10 +427,6 @@ export type ValidatorConditionFunctionParams = {
405
427
  * Waypoint
406
428
  */
407
429
  waypoint: string;
408
- /**
409
- * [DEPRECATED] Waypoint (for backwards compatibility with v7)
410
- */
411
- waypointId: string;
412
430
  /**
413
431
  * Journey Context
414
432
  */
@@ -439,7 +457,8 @@ export type PlanRoute = {
439
457
  export type PlanRouteCondition = (route: PlanRoute, context: JourneyContext) => boolean;
440
458
  export type PlanTraverseOptions = {
441
459
  /**
442
- * Waypoint from which to start (defaults to first in list)
460
+ * Waypoint from which to start (defaults to
461
+ * first in list)
443
462
  */
444
463
  startWaypoint?: string | undefined;
445
464
  /**
@@ -451,11 +470,13 @@ export type PlanTraverseOptions = {
451
470
  */
452
471
  history: Map<any, any>;
453
472
  /**
454
- * If true, traversal will be stopped (useful for performance)
473
+ * If true, traversal will be stopped
474
+ * (useful for performance)
455
475
  */
456
476
  stopCondition?: Function | undefined;
457
477
  /**
458
- * Multiple target routes found, this decides which to use
478
+ * Multiple target routes found, this
479
+ * decides which to use
459
480
  */
460
481
  arbiter?: string | PlanArbiter | undefined;
461
482
  };
@@ -469,7 +490,8 @@ export type PlanArbiterParams = {
469
490
  */
470
491
  journeyContext: JourneyContext;
471
492
  /**
472
- * Original traverse options passed to `traverse()`
493
+ * Original traverse options
494
+ * passed to `traverse()`
473
495
  */
474
496
  traverseOptions: PlanTraverseOptions;
475
497
  };
@@ -500,7 +522,7 @@ export type ContextIdGeneratorParams = {
500
522
  * Arguments
501
523
  */
502
524
  args: {
503
- req: import('express').Request;
525
+ req: import("express").Request;
504
526
  reservedIds: [string];
505
527
  };
506
528
  };
@@ -509,22 +531,23 @@ export type ContextIdGeneratorParams = {
509
531
  * any other context IDs in the given session.
510
532
  *
511
533
  * The resulting ID must match these criteria:
534
+ *
512
535
  * - A string
513
536
  * - Between 1 and 64 characters
514
537
  * - Contain only the characters a-z, 0-9, -
515
538
  */
516
539
  export type ContextIdGenerator = (params: ContextIdGeneratorParams) => string;
517
- import configure from './lib/configure.js';
518
- import validators from './lib/validators/index.js';
519
- import field from './lib/field.js';
520
- import Plan from './lib/Plan.js';
521
- import JourneyContext from './lib/JourneyContext.js';
522
- import ValidatorFactory from './lib/ValidatorFactory.js';
523
- import ValidationError from './lib/ValidationError.js';
524
- import MutableRouter from './lib/MutableRouter.js';
525
- import waypointUrl from './lib/waypoint-url.js';
526
- import endSession from './lib/end-session.js';
527
- import * as nunjucksFilters from './lib/nunjucks-filters.js';
528
- import * as constants from './lib/constants.js';
529
- import * as contextIdGenerators from './lib/context-id-generators.js';
540
+ import configure from "./lib/configure.js";
541
+ import validators from "./lib/validators/index.js";
542
+ import field from "./lib/field.js";
543
+ import Plan from "./lib/Plan.js";
544
+ import JourneyContext from "./lib/JourneyContext.js";
545
+ import ValidatorFactory from "./lib/ValidatorFactory.js";
546
+ import ValidationError from "./lib/ValidationError.js";
547
+ import MutableRouter from "./lib/MutableRouter.js";
548
+ import waypointUrl from "./lib/waypoint-url.js";
549
+ import endSession from "./lib/end-session.js";
550
+ import * as nunjucksFilters from "./lib/nunjucks-filters.js";
551
+ import * as constants from "./lib/constants.js";
552
+ import * as contextIdGenerators from "./lib/context-id-generators.js";
530
553
  export { configure, validators, field, Plan, JourneyContext, ValidatorFactory, ValidationError, MutableRouter, waypointUrl, endSession, nunjucksFilters, constants, contextIdGenerators };