@defra/forms-engine-plugin 4.0.41 → 4.0.43

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 (110) hide show
  1. package/.public/javascripts/application.min.js +1 -1
  2. package/.public/javascripts/application.min.js.map +1 -1
  3. package/.public/javascripts/shared.min.js +1 -1
  4. package/.public/javascripts/shared.min.js.map +1 -1
  5. package/.public/stylesheets/application.min.css +2 -2
  6. package/.public/stylesheets/application.min.css.map +1 -1
  7. package/.server/client/javascripts/location-map.d.ts +93 -0
  8. package/.server/client/javascripts/location-map.js +749 -0
  9. package/.server/client/javascripts/location-map.js.map +1 -0
  10. package/.server/client/javascripts/shared.d.ts +4 -0
  11. package/.server/client/javascripts/shared.js +5 -0
  12. package/.server/client/javascripts/shared.js.map +1 -1
  13. package/.server/client/stylesheets/_location-fields.scss +11 -0
  14. package/.server/client/stylesheets/application.scss +0 -1
  15. package/.server/client/stylesheets/shared.scss +1 -0
  16. package/.server/config/index.js +1 -1
  17. package/.server/config/index.js.map +1 -1
  18. package/.server/server/plugins/engine/configureEnginePlugin.d.ts +1 -1
  19. package/.server/server/plugins/engine/configureEnginePlugin.js +4 -2
  20. package/.server/server/plugins/engine/configureEnginePlugin.js.map +1 -1
  21. package/.server/server/plugins/engine/options.js +2 -1
  22. package/.server/server/plugins/engine/options.js.map +1 -1
  23. package/.server/server/plugins/engine/plugin.js +14 -1
  24. package/.server/server/plugins/engine/plugin.js.map +1 -1
  25. package/.server/server/plugins/engine/types.d.ts +1 -0
  26. package/.server/server/plugins/engine/types.js.map +1 -1
  27. package/.server/server/plugins/engine/views/components/_location-field-base.html +1 -1
  28. package/.server/server/plugins/engine/views/components/osgridreffield.html +4 -2
  29. package/.server/server/plugins/map/index.d.ts +7 -0
  30. package/.server/server/plugins/map/index.js +20 -0
  31. package/.server/server/plugins/map/index.js.map +1 -0
  32. package/.server/server/plugins/map/routes/get-os-token.d.ts +6 -0
  33. package/.server/server/plugins/map/routes/get-os-token.js +41 -0
  34. package/.server/server/plugins/map/routes/get-os-token.js.map +1 -0
  35. package/.server/server/plugins/map/routes/get-os-token.test.js +49 -0
  36. package/.server/server/plugins/map/routes/get-os-token.test.js.map +1 -0
  37. package/.server/server/plugins/map/routes/index.d.ts +10 -0
  38. package/.server/server/plugins/map/routes/index.js +172 -0
  39. package/.server/server/plugins/map/routes/index.js.map +1 -0
  40. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark.json +690 -0
  41. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark.png +0 -0
  42. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark@2x.json +690 -0
  43. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark@2x.png +0 -0
  44. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale.json +690 -0
  45. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale.png +0 -0
  46. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale@2x.json +690 -0
  47. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale@2x.png +0 -0
  48. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite.json +690 -0
  49. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite.png +0 -0
  50. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite@2x.json +690 -0
  51. package/.server/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite@2x.png +0 -0
  52. package/.server/server/plugins/map/routes/vts/OS_VTS_3857_Black_and_White.json +7858 -0
  53. package/.server/server/plugins/map/routes/vts/OS_VTS_3857_Dark.json +7669 -0
  54. package/.server/server/plugins/map/routes/vts/OS_VTS_3857_Outdoor.json +7653 -0
  55. package/.server/server/plugins/map/routes/vts/README.md +5 -0
  56. package/.server/server/plugins/map/service.d.ts +14 -0
  57. package/.server/server/plugins/map/service.js +76 -0
  58. package/.server/server/plugins/map/service.js.map +1 -0
  59. package/.server/server/plugins/map/service.test.js +120 -0
  60. package/.server/server/plugins/map/service.test.js.map +1 -0
  61. package/.server/server/plugins/map/test/__stubs__/find.d.ts +3 -0
  62. package/.server/server/plugins/map/test/__stubs__/find.js +216 -0
  63. package/.server/server/plugins/map/test/__stubs__/find.js.map +1 -0
  64. package/.server/server/plugins/map/test/__stubs__/nearest.d.ts +37 -0
  65. package/.server/server/plugins/map/test/__stubs__/nearest.js +38 -0
  66. package/.server/server/plugins/map/test/__stubs__/nearest.js.map +1 -0
  67. package/.server/server/plugins/map/types.d.ts +233 -0
  68. package/.server/server/plugins/map/types.js +121 -0
  69. package/.server/server/plugins/map/types.js.map +1 -0
  70. package/.server/server/types.d.ts +1 -0
  71. package/.server/server/types.js.map +1 -1
  72. package/package.json +3 -1
  73. package/src/client/javascripts/location-map.js +774 -0
  74. package/src/client/javascripts/shared.js +4 -0
  75. package/src/client/stylesheets/_location-fields.scss +11 -0
  76. package/src/client/stylesheets/application.scss +0 -1
  77. package/src/client/stylesheets/shared.scss +1 -0
  78. package/src/config/index.ts +1 -1
  79. package/src/server/plugins/engine/configureEnginePlugin.ts +4 -2
  80. package/src/server/plugins/engine/options.js +2 -1
  81. package/src/server/plugins/engine/plugin.ts +14 -1
  82. package/src/server/plugins/engine/types.ts +1 -0
  83. package/src/server/plugins/engine/views/components/_location-field-base.html +1 -1
  84. package/src/server/plugins/engine/views/components/osgridreffield.html +4 -2
  85. package/src/server/plugins/map/index.js +19 -0
  86. package/src/server/plugins/map/routes/get-os-token.js +41 -0
  87. package/src/server/plugins/map/routes/get-os-token.test.js +55 -0
  88. package/src/server/plugins/map/routes/index.js +192 -0
  89. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark.json +690 -0
  90. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark.png +0 -0
  91. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark@2x.json +690 -0
  92. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/dark@2x.png +0 -0
  93. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale.json +690 -0
  94. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale.png +0 -0
  95. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale@2x.json +690 -0
  96. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/greyscale@2x.png +0 -0
  97. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite.json +690 -0
  98. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite.png +0 -0
  99. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite@2x.json +690 -0
  100. package/src/server/plugins/map/routes/vts/OS_VTS_3857/resources/sprites/sprite@2x.png +0 -0
  101. package/src/server/plugins/map/routes/vts/OS_VTS_3857_Black_and_White.json +7858 -0
  102. package/src/server/plugins/map/routes/vts/OS_VTS_3857_Dark.json +7669 -0
  103. package/src/server/plugins/map/routes/vts/OS_VTS_3857_Outdoor.json +7653 -0
  104. package/src/server/plugins/map/routes/vts/README.md +5 -0
  105. package/src/server/plugins/map/service.js +84 -0
  106. package/src/server/plugins/map/service.test.js +144 -0
  107. package/src/server/plugins/map/test/__stubs__/find.js +271 -0
  108. package/src/server/plugins/map/test/__stubs__/nearest.js +46 -0
  109. package/src/server/plugins/map/types.js +120 -0
  110. package/src/server/types.ts +1 -0
@@ -0,0 +1,233 @@
1
+ export type MapConfiguration = {
2
+ ordnanceSurveyApiKey: string;
3
+ ordnanceSurveyApiSecret: string;
4
+ };
5
+ /**
6
+ * Map proxy query params
7
+ */
8
+ export type MapProxyQuery = {
9
+ /**
10
+ * - the proxied url
11
+ */
12
+ url: string;
13
+ };
14
+ /**
15
+ * Map geocode query params
16
+ */
17
+ export type MapGeocodeQuery = {
18
+ /**
19
+ * - name query
20
+ */
21
+ query: string;
22
+ };
23
+ /**
24
+ * Map reverse geocode query params
25
+ */
26
+ export type MapReverseGeocodeQuery = {
27
+ /**
28
+ * - the Easting point
29
+ */
30
+ easting: number;
31
+ /**
32
+ * - the Northing point
33
+ */
34
+ northing: number;
35
+ };
36
+ /**
37
+ * Map geocode get request
38
+ */
39
+ export type MapProxyGetRequestRefs = {
40
+ /**
41
+ * - Request query
42
+ */
43
+ Query: MapProxyQuery;
44
+ };
45
+ /**
46
+ * Map geocode get request
47
+ */
48
+ export type MapGeocodeGetRequestRefs = {
49
+ /**
50
+ * - Request query
51
+ */
52
+ Query: MapGeocodeQuery;
53
+ };
54
+ /**
55
+ * Map reverst geocode get request
56
+ */
57
+ export type MapReverseGeocodeGetRequestRefs = {
58
+ /**
59
+ * - Request query
60
+ */
61
+ Query: MapReverseGeocodeQuery;
62
+ };
63
+ export type MapProxyRequestRefs = MapProxyGetRequestRefs;
64
+ export type MapGeocodeRequestRefs = MapGeocodeGetRequestRefs;
65
+ export type MapReverseGeocodeRequestRefs = MapReverseGeocodeGetRequestRefs;
66
+ export type MapProxyGetRequest = Request<MapGeocodeGetRequestRefs>;
67
+ export type MapGeocodeGetRequest = Request<MapGeocodeGetRequestRefs>;
68
+ export type MapReverseGeocodeGetRequest = Request<MapReverseGeocodeGetRequestRefs>;
69
+ export type MapRequest = MapProxyGetRequest | MapGeocodeGetRequest | MapReverseGeocodeGetRequest;
70
+ export type OsNamesFindResponse = {
71
+ /**
72
+ * - Metadata about the search request and results.
73
+ */
74
+ header: OsNamesFindHeader;
75
+ /**
76
+ * - An array of matched place records from the search.
77
+ */
78
+ results: OsNamesFindResult[];
79
+ };
80
+ export type OsNamesFindHeader = {
81
+ /**
82
+ * - The query URI (usually same as search text).
83
+ */
84
+ uri: string;
85
+ /**
86
+ * - The original text query string passed to the API.
87
+ */
88
+ query: string;
89
+ /**
90
+ * - The response format returned (e.g., "JSON").
91
+ */
92
+ format: string;
93
+ /**
94
+ * - The maximum number of results requested.
95
+ */
96
+ maxresults: number;
97
+ /**
98
+ * - The offset used in the search results.
99
+ */
100
+ offset: number;
101
+ /**
102
+ * - The total number of results that matched the query.
103
+ */
104
+ totalresults: number;
105
+ /**
106
+ * - The original filter string passed to the API.
107
+ */
108
+ filter: string;
109
+ };
110
+ export type OsNamesFindGazetteerEntry = {
111
+ /**
112
+ * - Unique identifier for the place/feature.
113
+ */
114
+ ID: string;
115
+ /**
116
+ * - A URI (identifier) for this named feature.
117
+ */
118
+ NAMES_URI: string;
119
+ /**
120
+ * - Primary name of the feature.
121
+ */
122
+ NAME1: string;
123
+ /**
124
+ * - General type classification of the feature.
125
+ */
126
+ TYPE: string;
127
+ /**
128
+ * - Local or more specific type classification.
129
+ */
130
+ LOCAL_TYPE: string;
131
+ /**
132
+ * - Easting coordinate (British National Grid).
133
+ */
134
+ GEOMETRY_X: number;
135
+ /**
136
+ * - Northing coordinate (British National Grid).
137
+ */
138
+ GEOMETRY_Y: number;
139
+ /**
140
+ * - Most detailed resolution available.
141
+ */
142
+ MOST_DETAIL_VIEW_RES: number;
143
+ /**
144
+ * - Least detailed resolution available.
145
+ */
146
+ LEAST_DETAIL_VIEW_RES: number;
147
+ /**
148
+ * - Minimum bounding box X (easting).
149
+ */
150
+ MBR_XMIN?: number | undefined;
151
+ /**
152
+ * - Minimum bounding box Y (northing).
153
+ */
154
+ MBR_YMIN?: number | undefined;
155
+ /**
156
+ * - Maximum bounding box X (easting).
157
+ */
158
+ MBR_XMAX?: number | undefined;
159
+ /**
160
+ * - Maximum bounding box Y (northing).
161
+ */
162
+ MBR_YMAX?: number | undefined;
163
+ /**
164
+ * - (Optional) District borough.
165
+ */
166
+ DISTRICT_BOROUGH?: string | undefined;
167
+ /**
168
+ * - (Optional) URI for the district borough.
169
+ */
170
+ DISTRICT_BOROUGH_URI?: string | undefined;
171
+ /**
172
+ * - (Optional) Type of the district borough.
173
+ */
174
+ DISTRICT_BOROUGH_TYPE?: string | undefined;
175
+ /**
176
+ * - (Optional) Postcode district.
177
+ */
178
+ POSTCODE_DISTRICT?: string | undefined;
179
+ /**
180
+ * - (Optional) URI for the postcode district.
181
+ */
182
+ POSTCODE_DISTRICT_URI?: string | undefined;
183
+ /**
184
+ * - (Optional) Name of associated populated place.
185
+ */
186
+ POPULATED_PLACE?: string | undefined;
187
+ /**
188
+ * - (Optional) URI of populated place.
189
+ */
190
+ POPULATED_PLACE_URI?: string | undefined;
191
+ /**
192
+ * - (Optional) Type of populated place.
193
+ */
194
+ POPULATED_PLACE_TYPE?: string | undefined;
195
+ /**
196
+ * - (Optional) County or unitary authority name.
197
+ */
198
+ COUNTY_UNITARY?: string | undefined;
199
+ /**
200
+ * - (Optional) URI for county/unitary authority.
201
+ */
202
+ COUNTY_UNITARY_URI?: string | undefined;
203
+ /**
204
+ * - (Optional) Classification of county/unitary authority.
205
+ */
206
+ COUNTY_UNITARY_TYPE?: string | undefined;
207
+ /**
208
+ * - (Optional) Region name.
209
+ */
210
+ REGION?: string | undefined;
211
+ /**
212
+ * - (Optional) URI for region.
213
+ */
214
+ REGION_URI?: string | undefined;
215
+ /**
216
+ * - (Optional) Country name.
217
+ */
218
+ COUNTRY?: string | undefined;
219
+ /**
220
+ * - (Optional) URI for country.
221
+ */
222
+ COUNTRY_URI?: string | undefined;
223
+ };
224
+ /**
225
+ * OS names GAZETTEER_ENTRY response
226
+ */
227
+ export type OsNamesFindResult = {
228
+ /**
229
+ * - Gazetteer entry
230
+ */
231
+ GAZETTEER_ENTRY: OsNamesFindGazetteerEntry;
232
+ };
233
+ import type { Request } from '@hapi/hapi';
@@ -0,0 +1,121 @@
1
+ /**
2
+ * @typedef {{
3
+ * ordnanceSurveyApiKey: string
4
+ * ordnanceSurveyApiSecret: string
5
+ * }} MapConfiguration
6
+ */
7
+
8
+ //
9
+ // Route types
10
+ //
11
+
12
+ /**
13
+ * Map proxy query params
14
+ * @typedef {object} MapProxyQuery
15
+ * @property {string} url - the proxied url
16
+ */
17
+
18
+ /**
19
+ * Map geocode query params
20
+ * @typedef {object} MapGeocodeQuery
21
+ * @property {string} query - name query
22
+ */
23
+
24
+ /**
25
+ * Map reverse geocode query params
26
+ * @typedef {object} MapReverseGeocodeQuery
27
+ * @property {number} easting - the Easting point
28
+ * @property {number} northing - the Northing point
29
+ */
30
+
31
+ /**
32
+ * Map geocode get request
33
+ * @typedef {object} MapProxyGetRequestRefs
34
+ * @property {MapProxyQuery} Query - Request query
35
+ */
36
+
37
+ /**
38
+ * Map geocode get request
39
+ * @typedef {object} MapGeocodeGetRequestRefs
40
+ * @property {MapGeocodeQuery} Query - Request query
41
+ */
42
+
43
+ /**
44
+ * Map reverst geocode get request
45
+ * @typedef {object} MapReverseGeocodeGetRequestRefs
46
+ * @property {MapReverseGeocodeQuery} Query - Request query
47
+ */
48
+
49
+ /**
50
+ * @typedef {MapProxyGetRequestRefs} MapProxyRequestRefs
51
+ * @typedef {MapGeocodeGetRequestRefs} MapGeocodeRequestRefs
52
+ * @typedef {MapReverseGeocodeGetRequestRefs} MapReverseGeocodeRequestRefs
53
+ * @typedef {Request<MapGeocodeGetRequestRefs>} MapProxyGetRequest
54
+ * @typedef {Request<MapGeocodeGetRequestRefs>} MapGeocodeGetRequest
55
+ * @typedef {Request<MapReverseGeocodeGetRequestRefs>} MapReverseGeocodeGetRequest
56
+ * @typedef {MapProxyGetRequest | MapGeocodeGetRequest | MapReverseGeocodeGetRequest} MapRequest
57
+ */
58
+
59
+ //
60
+ // Service types
61
+ //
62
+
63
+ /**
64
+ * @typedef {object} OsNamesFindResponse
65
+ * @property {OsNamesFindHeader} header - Metadata about the search request and results.
66
+ * @property {OsNamesFindResult[]} results - An array of matched place records from the search.
67
+ */
68
+
69
+ /**
70
+ * @typedef {object} OsNamesFindHeader
71
+ * @property {string} uri - The query URI (usually same as search text).
72
+ * @property {string} query - The original text query string passed to the API.
73
+ * @property {string} format - The response format returned (e.g., "JSON").
74
+ * @property {number} maxresults - The maximum number of results requested.
75
+ * @property {number} offset - The offset used in the search results.
76
+ * @property {number} totalresults - The total number of results that matched the query.
77
+ * @property {string} filter - The original filter string passed to the API.
78
+ */
79
+
80
+ /**
81
+ * @typedef {object} OsNamesFindGazetteerEntry
82
+ * @property {string} ID - Unique identifier for the place/feature.
83
+ * @property {string} NAMES_URI - A URI (identifier) for this named feature.
84
+ * @property {string} NAME1 - Primary name of the feature.
85
+ * @property {string} TYPE - General type classification of the feature.
86
+ * @property {string} LOCAL_TYPE - Local or more specific type classification.
87
+ * @property {number} GEOMETRY_X - Easting coordinate (British National Grid).
88
+ * @property {number} GEOMETRY_Y - Northing coordinate (British National Grid).
89
+ * @property {number} MOST_DETAIL_VIEW_RES - Most detailed resolution available.
90
+ * @property {number} LEAST_DETAIL_VIEW_RES - Least detailed resolution available.
91
+ * @property {number} [MBR_XMIN] - Minimum bounding box X (easting).
92
+ * @property {number} [MBR_YMIN] - Minimum bounding box Y (northing).
93
+ * @property {number} [MBR_XMAX] - Maximum bounding box X (easting).
94
+ * @property {number} [MBR_YMAX] - Maximum bounding box Y (northing).
95
+ * @property {string} [DISTRICT_BOROUGH] - (Optional) District borough.
96
+ * @property {string} [DISTRICT_BOROUGH_URI] - (Optional) URI for the district borough.
97
+ * @property {string} [DISTRICT_BOROUGH_TYPE] - (Optional) Type of the district borough.
98
+ * @property {string} [POSTCODE_DISTRICT] - (Optional) Postcode district.
99
+ * @property {string} [POSTCODE_DISTRICT_URI] - (Optional) URI for the postcode district.
100
+ * @property {string} [POPULATED_PLACE] - (Optional) Name of associated populated place.
101
+ * @property {string} [POPULATED_PLACE_URI] - (Optional) URI of populated place.
102
+ * @property {string} [POPULATED_PLACE_TYPE] - (Optional) Type of populated place.
103
+ * @property {string} [COUNTY_UNITARY] - (Optional) County or unitary authority name.
104
+ * @property {string} [COUNTY_UNITARY_URI] - (Optional) URI for county/unitary authority.
105
+ * @property {string} [COUNTY_UNITARY_TYPE] - (Optional) Classification of county/unitary authority.
106
+ * @property {string} [REGION] - (Optional) Region name.
107
+ * @property {string} [REGION_URI] - (Optional) URI for region.
108
+ * @property {string} [COUNTRY] - (Optional) Country name.
109
+ * @property {string} [COUNTRY_URI] - (Optional) URI for country.
110
+ */
111
+
112
+ /**
113
+ * OS names GAZETTEER_ENTRY response
114
+ * @typedef {object} OsNamesFindResult
115
+ * @property {OsNamesFindGazetteerEntry} GAZETTEER_ENTRY - Gazetteer entry
116
+ */
117
+
118
+ /**
119
+ * @import { Request } from '@hapi/hapi'
120
+ */
121
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/server/plugins/map/types.js"],"sourcesContent":["/**\n * @typedef {{\n * ordnanceSurveyApiKey: string\n * ordnanceSurveyApiSecret: string\n * }} MapConfiguration\n */\n\n//\n// Route types\n//\n\n/**\n * Map proxy query params\n * @typedef {object} MapProxyQuery\n * @property {string} url - the proxied url\n */\n\n/**\n * Map geocode query params\n * @typedef {object} MapGeocodeQuery\n * @property {string} query - name query\n */\n\n/**\n * Map reverse geocode query params\n * @typedef {object} MapReverseGeocodeQuery\n * @property {number} easting - the Easting point\n * @property {number} northing - the Northing point\n */\n\n/**\n * Map geocode get request\n * @typedef {object} MapProxyGetRequestRefs\n * @property {MapProxyQuery} Query - Request query\n */\n\n/**\n * Map geocode get request\n * @typedef {object} MapGeocodeGetRequestRefs\n * @property {MapGeocodeQuery} Query - Request query\n */\n\n/**\n * Map reverst geocode get request\n * @typedef {object} MapReverseGeocodeGetRequestRefs\n * @property {MapReverseGeocodeQuery} Query - Request query\n */\n\n/**\n * @typedef {MapProxyGetRequestRefs} MapProxyRequestRefs\n * @typedef {MapGeocodeGetRequestRefs} MapGeocodeRequestRefs\n * @typedef {MapReverseGeocodeGetRequestRefs} MapReverseGeocodeRequestRefs\n * @typedef {Request<MapGeocodeGetRequestRefs>} MapProxyGetRequest\n * @typedef {Request<MapGeocodeGetRequestRefs>} MapGeocodeGetRequest\n * @typedef {Request<MapReverseGeocodeGetRequestRefs>} MapReverseGeocodeGetRequest\n * @typedef {MapProxyGetRequest | MapGeocodeGetRequest | MapReverseGeocodeGetRequest} MapRequest\n */\n\n//\n// Service types\n//\n\n/**\n * @typedef {object} OsNamesFindResponse\n * @property {OsNamesFindHeader} header - Metadata about the search request and results.\n * @property {OsNamesFindResult[]} results - An array of matched place records from the search.\n */\n\n/**\n * @typedef {object} OsNamesFindHeader\n * @property {string} uri - The query URI (usually same as search text).\n * @property {string} query - The original text query string passed to the API.\n * @property {string} format - The response format returned (e.g., \"JSON\").\n * @property {number} maxresults - The maximum number of results requested.\n * @property {number} offset - The offset used in the search results.\n * @property {number} totalresults - The total number of results that matched the query.\n * @property {string} filter - The original filter string passed to the API.\n */\n\n/**\n * @typedef {object} OsNamesFindGazetteerEntry\n * @property {string} ID - Unique identifier for the place/feature.\n * @property {string} NAMES_URI - A URI (identifier) for this named feature.\n * @property {string} NAME1 - Primary name of the feature.\n * @property {string} TYPE - General type classification of the feature.\n * @property {string} LOCAL_TYPE - Local or more specific type classification.\n * @property {number} GEOMETRY_X - Easting coordinate (British National Grid).\n * @property {number} GEOMETRY_Y - Northing coordinate (British National Grid).\n * @property {number} MOST_DETAIL_VIEW_RES - Most detailed resolution available.\n * @property {number} LEAST_DETAIL_VIEW_RES - Least detailed resolution available.\n * @property {number} [MBR_XMIN] - Minimum bounding box X (easting).\n * @property {number} [MBR_YMIN] - Minimum bounding box Y (northing).\n * @property {number} [MBR_XMAX] - Maximum bounding box X (easting).\n * @property {number} [MBR_YMAX] - Maximum bounding box Y (northing).\n * @property {string} [DISTRICT_BOROUGH] - (Optional) District borough.\n * @property {string} [DISTRICT_BOROUGH_URI] - (Optional) URI for the district borough.\n * @property {string} [DISTRICT_BOROUGH_TYPE] - (Optional) Type of the district borough.\n * @property {string} [POSTCODE_DISTRICT] - (Optional) Postcode district.\n * @property {string} [POSTCODE_DISTRICT_URI] - (Optional) URI for the postcode district.\n * @property {string} [POPULATED_PLACE] - (Optional) Name of associated populated place.\n * @property {string} [POPULATED_PLACE_URI] - (Optional) URI of populated place.\n * @property {string} [POPULATED_PLACE_TYPE] - (Optional) Type of populated place.\n * @property {string} [COUNTY_UNITARY] - (Optional) County or unitary authority name.\n * @property {string} [COUNTY_UNITARY_URI] - (Optional) URI for county/unitary authority.\n * @property {string} [COUNTY_UNITARY_TYPE] - (Optional) Classification of county/unitary authority.\n * @property {string} [REGION] - (Optional) Region name.\n * @property {string} [REGION_URI] - (Optional) URI for region.\n * @property {string} [COUNTRY] - (Optional) Country name.\n * @property {string} [COUNTRY_URI] - (Optional) URI for country.\n */\n\n/**\n * OS names GAZETTEER_ENTRY response\n * @typedef {object} OsNamesFindResult\n * @property {OsNamesFindGazetteerEntry} GAZETTEER_ENTRY - Gazetteer entry\n */\n\n/**\n * @import { Request } from '@hapi/hapi'\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA","ignoreList":[]}
@@ -34,6 +34,7 @@ export interface RouteConfig {
34
34
  saveAndExit?: PluginOptions['saveAndExit'];
35
35
  cacheServiceCreator?: (server: Server) => CacheService;
36
36
  ordnanceSurveyApiKey?: string;
37
+ ordnanceSurveyApiSecret?: string;
37
38
  }
38
39
  export interface OutputService {
39
40
  submit: (context: FormContext, request: FormRequestPayload, model: FormModel, emailAddress: string, items: DetailItem[], submitResponse: SubmitResponsePayload, formMetadata?: FormMetadata) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/server/types.ts"],"sourcesContent":["import {\n type FormDefinition,\n type FormMetadata,\n type SubmitPayload,\n type SubmitResponsePayload\n} from '@defra/forms-model'\nimport { type Server } from '@hapi/hapi'\n\nimport { type FormModel } from '~/src/server/plugins/engine/models/index.js'\nimport { type DetailItem } from '~/src/server/plugins/engine/models/types.js'\nimport { type PageController } from '~/src/server/plugins/engine/pageControllers/PageController.js'\nimport {\n type FormContext,\n type OnRequestCallback,\n type PluginOptions,\n type PreparePageEventRequestOptions\n} from '~/src/server/plugins/engine/types.js'\nimport {\n type FormRequestPayload,\n type FormStatus\n} from '~/src/server/routes/types.js'\nimport { type CacheService } from '~/src/server/services/cacheService.js'\n\nexport interface FormsService {\n getFormMetadata: (slug: string) => Promise<FormMetadata>\n getFormMetadataById: (id: string) => Promise<FormMetadata>\n getFormDefinition: (\n id: string,\n state: FormStatus\n ) => Promise<FormDefinition | undefined>\n}\n\nexport interface FormSubmissionService {\n persistFiles: (\n files: { fileId: string; initiatedRetrievalKey: string }[],\n persistedRetrievalKey: string\n ) => Promise<object>\n submit: (data: SubmitPayload) => Promise<SubmitResponsePayload | undefined>\n}\n\nexport interface Services {\n formsService: FormsService\n formSubmissionService: FormSubmissionService\n outputService: OutputService\n}\n\nexport interface RouteConfig {\n formFileName?: string\n formFilePath?: string\n enforceCsrf?: boolean\n services?: Services\n controllers?: Record<string, typeof PageController>\n preparePageEventRequestOptions?: PreparePageEventRequestOptions\n onRequest?: OnRequestCallback\n saveAndExit?: PluginOptions['saveAndExit']\n cacheServiceCreator?: (server: Server) => CacheService\n ordnanceSurveyApiKey?: string\n}\n\nexport interface OutputService {\n submit: (\n context: FormContext,\n request: FormRequestPayload,\n model: FormModel,\n emailAddress: string,\n items: DetailItem[],\n submitResponse: SubmitResponsePayload,\n formMetadata?: FormMetadata\n ) => Promise<void>\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/server/types.ts"],"sourcesContent":["import {\n type FormDefinition,\n type FormMetadata,\n type SubmitPayload,\n type SubmitResponsePayload\n} from '@defra/forms-model'\nimport { type Server } from '@hapi/hapi'\n\nimport { type FormModel } from '~/src/server/plugins/engine/models/index.js'\nimport { type DetailItem } from '~/src/server/plugins/engine/models/types.js'\nimport { type PageController } from '~/src/server/plugins/engine/pageControllers/PageController.js'\nimport {\n type FormContext,\n type OnRequestCallback,\n type PluginOptions,\n type PreparePageEventRequestOptions\n} from '~/src/server/plugins/engine/types.js'\nimport {\n type FormRequestPayload,\n type FormStatus\n} from '~/src/server/routes/types.js'\nimport { type CacheService } from '~/src/server/services/cacheService.js'\n\nexport interface FormsService {\n getFormMetadata: (slug: string) => Promise<FormMetadata>\n getFormMetadataById: (id: string) => Promise<FormMetadata>\n getFormDefinition: (\n id: string,\n state: FormStatus\n ) => Promise<FormDefinition | undefined>\n}\n\nexport interface FormSubmissionService {\n persistFiles: (\n files: { fileId: string; initiatedRetrievalKey: string }[],\n persistedRetrievalKey: string\n ) => Promise<object>\n submit: (data: SubmitPayload) => Promise<SubmitResponsePayload | undefined>\n}\n\nexport interface Services {\n formsService: FormsService\n formSubmissionService: FormSubmissionService\n outputService: OutputService\n}\n\nexport interface RouteConfig {\n formFileName?: string\n formFilePath?: string\n enforceCsrf?: boolean\n services?: Services\n controllers?: Record<string, typeof PageController>\n preparePageEventRequestOptions?: PreparePageEventRequestOptions\n onRequest?: OnRequestCallback\n saveAndExit?: PluginOptions['saveAndExit']\n cacheServiceCreator?: (server: Server) => CacheService\n ordnanceSurveyApiKey?: string\n ordnanceSurveyApiSecret?: string\n}\n\nexport interface OutputService {\n submit: (\n context: FormContext,\n request: FormRequestPayload,\n model: FormModel,\n emailAddress: string,\n items: DetailItem[],\n submitResponse: SubmitResponsePayload,\n formMetadata?: FormMetadata\n ) => Promise<void>\n}\n"],"mappings":"","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-engine-plugin",
3
- "version": "4.0.41",
3
+ "version": "4.0.43",
4
4
  "description": "Defra forms engine",
5
5
  "type": "module",
6
6
  "files": [
@@ -72,6 +72,7 @@
72
72
  "dependencies": {
73
73
  "@defra/forms-model": "^3.0.603",
74
74
  "@defra/hapi-tracing": "^1.29.0",
75
+ "@defra/interactive-map": "^0.0.3-alpha",
75
76
  "@elastic/ecs-pino-format": "^1.5.0",
76
77
  "@hapi/boom": "^10.0.1",
77
78
  "@hapi/catbox": "^12.1.1",
@@ -96,6 +97,7 @@
96
97
  "date-fns": "^4.1.0",
97
98
  "dotenv": "^17.2.3",
98
99
  "expr-eval-fork": "^3.0.0",
100
+ "geodesy": "^2.4.0",
99
101
  "govuk-frontend": "^5.13.0",
100
102
  "hapi-pino": "^13.0.0",
101
103
  "hapi-pulse": "^3.0.1",