@disy/cadenza.js 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 (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/apidoc/classes/AbortError.html +3 -3
  3. package/apidoc/classes/CadenzaClient.html +114 -34
  4. package/apidoc/classes/CadenzaError.html +5 -5
  5. package/apidoc/functions/cadenza.html +3 -3
  6. package/apidoc/index.html +2 -2
  7. package/apidoc/interfaces/CadenzaClientOptions.html +5 -5
  8. package/apidoc/interfaces/CadenzaEvent.html +4 -4
  9. package/apidoc/interfaces/Distance.html +2 -2
  10. package/apidoc/interfaces/ExternalLinkKey.html +4 -4
  11. package/apidoc/interfaces/Feature.html +7 -7
  12. package/apidoc/interfaces/FeatureCollection.html +3 -3
  13. package/apidoc/interfaces/Geometry.html +3 -3
  14. package/apidoc/interfaces/GeometryExtentStrategy.html +4 -4
  15. package/apidoc/interfaces/PageSource.html +3 -3
  16. package/apidoc/modules.html +2 -2
  17. package/apidoc/types/CadenzaActionEvent.html +2 -2
  18. package/apidoc/types/CadenzaChangeSelectionEvent.html +2 -2
  19. package/apidoc/types/CadenzaDrillThroughEvent.html +2 -2
  20. package/apidoc/types/CadenzaEditGeometryCancelEvent.html +2 -2
  21. package/apidoc/types/CadenzaEditGeometryOkEvent.html +2 -2
  22. package/apidoc/types/CadenzaEditGeometryUpdateEvent.html +2 -2
  23. package/apidoc/types/CadenzaErrorEvent.html +2 -2
  24. package/apidoc/types/CadenzaEventByType.html +1 -1
  25. package/apidoc/types/CadenzaEventType.html +2 -2
  26. package/apidoc/types/CadenzaObjectInfoEvent.html +2 -2
  27. package/apidoc/types/CadenzaReloadEvent.html +2 -2
  28. package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -2
  29. package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -2
  30. package/apidoc/types/CustomValidityType.html +2 -2
  31. package/apidoc/types/DataType.html +2 -2
  32. package/apidoc/types/EmbeddingTargetId.html +2 -2
  33. package/apidoc/types/Extent.html +2 -2
  34. package/apidoc/types/ExtentStrategy.html +2 -2
  35. package/apidoc/types/FilterVariables.html +2 -2
  36. package/apidoc/types/GeometryType.html +2 -2
  37. package/apidoc/types/GlobalId.html +2 -2
  38. package/apidoc/types/LengthUnit.html +1 -1
  39. package/apidoc/types/OpaqueString.html +2 -2
  40. package/apidoc/types/OperationMode.html +2 -2
  41. package/apidoc/types/TablePart.html +2 -2
  42. package/apidoc/types/UiFeature.html +2 -2
  43. package/apidoc/types/WorkbookLayerPath.html +2 -2
  44. package/cadenza.d.ts +80 -71
  45. package/cadenza.js +122 -73
  46. package/package.json +1 -1
package/cadenza.d.ts CHANGED
@@ -36,7 +36,7 @@ export class CadenzaClient {
36
36
  /**
37
37
  *
38
38
  * @hidden
39
- * @param {CadenzaClientOptions} [options]
39
+ * @param {CadenzaClientOptions} [__namedParameters]
40
40
  */
41
41
  constructor({ baseUrl, debug, iframe, webApplication }?: CadenzaClientOptions | undefined);
42
42
  /** The base URL of the Cadenza server this client is requesting */
@@ -47,18 +47,18 @@ export class CadenzaClient {
47
47
  * Show a page, workbook, worksheet or workbook view in an iframe.
48
48
  *
49
49
  * @param {PageSource | EmbeddingTargetId} source - The source to show
50
- * @param {object} [options]
51
- * @param {DataType} [options.dataType] - Set to 'pdf' for views of type "JasperReports report"
50
+ * @param {object} [__namedParameters]
51
+ * @param {DataType} [__namedParameters.dataType] - Set to 'pdf' for views of type "JasperReports report"
52
52
  * to show the report PDF directly, without any Cadenza headers or footers.
53
- * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
54
- * @param {boolean} [options.expandNavigator] - Indicates if the navigator should be expanded.
55
- * @param {FilterVariables} [options.filter] - Filter variables
56
- * @param {boolean} [options.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
57
- * @param {boolean} [options.hideWorkbookToolBar] - Whether to hide the workbook toolbar
58
- * @param {GlobalId} [options.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
59
- * @param {String} [options.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
60
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
61
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
53
+ * @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
54
+ * @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
55
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
56
+ * @param {boolean} [__namedParameters.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
57
+ * @param {boolean} [__namedParameters.hideWorkbookToolBar] - Whether to hide the workbook toolbar
58
+ * @param {GlobalId} [__namedParameters.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
59
+ * @param {String} [__namedParameters.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
60
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
61
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
62
62
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
63
63
  * @throws For invalid arguments
64
64
  * @fires
@@ -80,14 +80,15 @@ export class CadenzaClient {
80
80
  } | undefined, ...args: any[]): Promise<void>;
81
81
  /**
82
82
  * Reload the views of a worksheet.
83
- * @param {object} [options] - Options
84
- * @param {boolean} [options.invalidateCaches] - When true, caches will be invalidated for objecttypes used
83
+ * @param {object} [__namedParameters] - Options
84
+ * @param {boolean} [__namedParameters.invalidateCaches] - When true, caches will be invalidated for objecttypes used
85
85
  * in the worksheet
86
+ * @return {Promise<void>} A `Promise` which resolves when the views of the worksheet have finished reloading
86
87
  * @postMessage
87
88
  */
88
89
  reload({ invalidateCaches }?: {
89
90
  invalidateCaches?: boolean | undefined;
90
- } | undefined, ...args: any[]): void;
91
+ } | undefined, ...args: any[]): Promise<void>;
91
92
  /**
92
93
  * Sends a message to parent Cadenza window to close the window containing this application
93
94
  * @postMessageParent
@@ -97,20 +98,24 @@ export class CadenzaClient {
97
98
  * Show a workbook map view in an iframe.
98
99
  *
99
100
  * @param {EmbeddingTargetId} mapView - The workbook map view to show
100
- * @param {object} [options] - Options
101
- * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
102
- * @param {boolean} [options.expandNavigator] - Indicates if the navigator should be expanded.
103
- * @param {FilterVariables} [options.filter] - Filter variables
104
- * @param {Geometry} [options.geometry] - A geometry to show on the map
105
- * @param {boolean} [options.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
106
- * @param {boolean} [options.hideWorkbookToolBar] - Whether to hide the workbook toolbar
107
- * @param {GlobalId} [options.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
108
- * @param {string} [options.locationFinder] - A search query for the location finder
109
- * @param {Extent} [options.mapExtent] - A map extent to set
110
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
111
- * @param {boolean} [options.useMapSrs] - Whether the geometry and the extent are in the map's SRS (otherwise EPSG:4326 is assumed)
112
- * @param {ExtentStrategy} [options.extentStrategy] - Strategy to define the new map extent
113
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
101
+ * @param {object} [__namedParameters] - Options
102
+ * @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
103
+ * @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
104
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
105
+ * @param {Geometry} [__namedParameters.geometry] - A geometry to show on the map
106
+ * @param {boolean} [__namedParameters.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
107
+ * @param {boolean} [__namedParameters.hideWorkbookToolBar] - Whether to hide the workbook toolbar
108
+ * @param {GlobalId} [__namedParameters.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
109
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
110
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
111
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
112
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry and the extent are in the map's SRS (otherwise EPSG:4326 is assumed)
113
+ * @param {ExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the initial map extent. A given extentStrategy
114
+ * trumps zooming to a specified mapExtent
115
+ * which trumps zooming to a locationFinder result
116
+ * which trumps zooming to the initial extent of the opened mapView.
117
+ * If a specified {@link GeometryExtentStrategy} doesn't contain a 'geometry', the 'geometry' of this API call is used.
118
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
114
119
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
115
120
  * @throws For invalid arguments
116
121
  * @fires
@@ -225,14 +230,14 @@ export class CadenzaClient {
225
230
  *
226
231
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
227
232
  * @param {GeometryType} geometryType - The geometry type
228
- * @param {object} [options] - Options
229
- * @param {FilterVariables} [options.filter] - Filter variables
230
- * @param {string} [options.locationFinder] - A search query for the location finder
231
- * @param {Extent} [options.mapExtent] - A map extent to set
232
- * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
233
- * @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
234
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
235
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
233
+ * @param {object} [__namedParameters] - Options
234
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
235
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
236
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
237
+ * @param {number} [__namedParameters.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
238
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
239
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
240
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
236
241
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
237
242
  * @throws For invalid arguments
238
243
  * @fires
@@ -255,15 +260,19 @@ export class CadenzaClient {
255
260
  *
256
261
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
257
262
  * @param {Geometry} geometry - The geometry
258
- * @param {object} [options] - Options
259
- * @param {FilterVariables} [options.filter] - Filter variables
260
- * @param {string} [options.locationFinder] - A search query for the location finder
261
- * @param {Extent} [options.mapExtent] - A map extent to set
262
- * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
263
- * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
264
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
265
- * @param {ExtentStrategy} [options.extentStrategy] - Strategy to define the new map extent
266
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
263
+ * @param {object} [__namedParameters] - Options
264
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
265
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
266
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
267
+ * @param {number} [__namedParameters.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
268
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
269
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
270
+ * @param {ExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the initial map extent. A given extentStrategy
271
+ * trumps zooming to a specified mapExtent
272
+ * which trumps zooming to a locationFinder result
273
+ * which trumps zooming to the initial extent of the opened mapView.
274
+ * If a specified {@link GeometryExtentStrategy} doesn't contain a 'geometry', the 'geometry' of this API call is used.
275
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
267
276
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
268
277
  * @throws For invalid arguments
269
278
  * @fires
@@ -296,15 +305,15 @@ export class CadenzaClient {
296
305
  * Select objects in a workbook map.
297
306
  *
298
307
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view
299
- * @param {object} [options] - Options
300
- * @param {FilterVariables} [options.filter] - Filter variables
301
- * @param {(WorkbookLayerPath | string)[]} [options.layers] - Layers to restrict the selection to
308
+ * @param {object} [__namedParameters] - Options
309
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
310
+ * @param {(WorkbookLayerPath | string)[]} [__namedParameters.layers] - Layers to restrict the selection to
302
311
  * (identified using layer paths or print names)
303
- * @param {string} [options.locationFinder] - A search query for the location finder
304
- * @param {Extent} [options.mapExtent] - A map extent to set
305
- * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
306
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
307
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
312
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
313
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
314
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
315
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
316
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
308
317
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
309
318
  * @throws For invalid arguments
310
319
  * @fires
@@ -345,10 +354,10 @@ export class CadenzaClient {
345
354
  * @param {DataType} dataType - The data type you want to get back from the server.
346
355
  * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
347
356
  * and `"pdf"` for views of type "JasperReports report".
348
- * @param {object} [options] - Options
349
- * @param {FilterVariables} [options.filter] - Filter variables
350
- * @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
351
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
357
+ * @param {object} [__namedParameters] - Options
358
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
359
+ * @param {TablePart[]} [__namedParameters.parts] - Table parts to export; If not specified, all parts are exported.
360
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
352
361
  * @return {Promise<Response>} A `Promise` for the fetch response
353
362
  * @throws For invalid arguments
354
363
  * @server
@@ -365,11 +374,11 @@ export class CadenzaClient {
365
374
  * @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
366
375
  * (identified using layer paths or print names)
367
376
  * @param {unknown[][]} objectIds - The IDs of the objects to select
368
- * @param {object} [options] - Options
369
- * @param {FilterVariables} [options.filter] - Filter variables
370
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
371
- * @param {Boolean} [options.useMapSrs] - Use the map SRS instead of WGS84
372
- * @param {Boolean} [options.fullGeometries] - Return non-simplified geometries
377
+ * @param {object} [__namedParameters] - Options
378
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
379
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
380
+ * @param {Boolean} [__namedParameters.useMapSrs] - Use the map SRS instead of WGS84
381
+ * @param {Boolean} [__namedParameters.fullGeometries] - Return non-simplified geometries
373
382
  * @return {Promise<FeatureCollection>} A `Promise` for the fetch response
374
383
  * @throws For invalid arguments
375
384
  */
@@ -386,10 +395,10 @@ export class CadenzaClient {
386
395
  * @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
387
396
  * (identified using layer paths or print names)
388
397
  * @param {Geometry} geometry - The intersection geometry
389
- * @param {object} [options] - Options
390
- * @param {boolean} [options.useMapSrs] - The intersection geometry and the result geometries are in the map's SRS (otherwise EPSG:4326 is assumed)
391
- * @param {Distance} [options.buffer] - Buffer size for geometry of the transition
392
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
398
+ * @param {object} [__namedParameters] - Options
399
+ * @param {boolean} [__namedParameters.useMapSrs] - The intersection geometry and the result geometries are in the map's SRS (otherwise EPSG:4326 is assumed)
400
+ * @param {Distance} [__namedParameters.buffer] - Buffer size for geometry of the transition
401
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
393
402
  * @return {Promise<FeatureCollection>} A `Promise` for the fetch response
394
403
  * @server
395
404
  */
@@ -407,10 +416,10 @@ export class CadenzaClient {
407
416
  * @param {DataType} dataType - The data type you want to get back from the server.
408
417
  * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
409
418
  * and `"pdf"` for views of type "JasperReports report".
410
- * @param {object} [options] - Options
411
- * @param {string} [options.fileName] - The file name to use; The file extension is appended by Cadenza.
412
- * @param {FilterVariables} [options.filter] - Filter variables
413
- * @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
419
+ * @param {object} [__namedParameters] - Options
420
+ * @param {string} [__namedParameters.fileName] - The file name to use; The file extension is appended by Cadenza.
421
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
422
+ * @param {TablePart[]} [__namedParameters.parts] - Table parts to export; If not specified, all parts are exported.
414
423
  * @throws For invalid arguments
415
424
  * @server
416
425
  */
package/cadenza.js CHANGED
@@ -184,7 +184,7 @@ export class CadenzaClient {
184
184
  /**
185
185
  *
186
186
  * @hidden
187
- * @param {CadenzaClientOptions} [options]
187
+ * @param {CadenzaClientOptions} [__namedParameters]
188
188
  */
189
189
  constructor({ baseUrl, debug = false, iframe, webApplication } = {}) {
190
190
  if (webApplication) {
@@ -241,18 +241,18 @@ export class CadenzaClient {
241
241
  * Show a page, workbook, worksheet or workbook view in an iframe.
242
242
  *
243
243
  * @param {PageSource | EmbeddingTargetId} source - The source to show
244
- * @param {object} [options]
245
- * @param {DataType} [options.dataType] - Set to 'pdf' for views of type "JasperReports report"
244
+ * @param {object} [__namedParameters]
245
+ * @param {DataType} [__namedParameters.dataType] - Set to 'pdf' for views of type "JasperReports report"
246
246
  * to show the report PDF directly, without any Cadenza headers or footers.
247
- * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
248
- * @param {boolean} [options.expandNavigator] - Indicates if the navigator should be expanded.
249
- * @param {FilterVariables} [options.filter] - Filter variables
250
- * @param {boolean} [options.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
251
- * @param {boolean} [options.hideWorkbookToolBar] - Whether to hide the workbook toolbar
252
- * @param {GlobalId} [options.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
253
- * @param {String} [options.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
254
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
255
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
247
+ * @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
248
+ * @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
249
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
250
+ * @param {boolean} [__namedParameters.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
251
+ * @param {boolean} [__namedParameters.hideWorkbookToolBar] - Whether to hide the workbook toolbar
252
+ * @param {GlobalId} [__namedParameters.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
253
+ * @param {String} [__namedParameters.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
254
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
255
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
256
256
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
257
257
  * @throws For invalid arguments
258
258
  * @fires
@@ -285,14 +285,15 @@ export class CadenzaClient {
285
285
  }
286
286
  /**
287
287
  * Reload the views of a worksheet.
288
- * @param {object} [options] - Options
289
- * @param {boolean} [options.invalidateCaches] - When true, caches will be invalidated for objecttypes used
288
+ * @param {object} [__namedParameters] - Options
289
+ * @param {boolean} [__namedParameters.invalidateCaches] - When true, caches will be invalidated for objecttypes used
290
290
  * in the worksheet
291
+ * @return {Promise<void>} A `Promise` which resolves when the views of the worksheet have finished reloading
291
292
  * @postMessage
292
293
  */
293
294
  reload({ invalidateCaches = false } = {}) {
294
295
  this.#log('CadenzaClient#reload', ...arguments);
295
- this.#postEvent('reload', { invalidateCaches });
296
+ return this.#postRequest('reload', { invalidateCaches });
296
297
  }
297
298
  /**
298
299
  * Sends a message to parent Cadenza window to close the window containing this application
@@ -307,20 +308,24 @@ export class CadenzaClient {
307
308
  * Show a workbook map view in an iframe.
308
309
  *
309
310
  * @param {EmbeddingTargetId} mapView - The workbook map view to show
310
- * @param {object} [options] - Options
311
- * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
312
- * @param {boolean} [options.expandNavigator] - Indicates if the navigator should be expanded.
313
- * @param {FilterVariables} [options.filter] - Filter variables
314
- * @param {Geometry} [options.geometry] - A geometry to show on the map
315
- * @param {boolean} [options.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
316
- * @param {boolean} [options.hideWorkbookToolBar] - Whether to hide the workbook toolbar
317
- * @param {GlobalId} [options.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
318
- * @param {string} [options.locationFinder] - A search query for the location finder
319
- * @param {Extent} [options.mapExtent] - A map extent to set
320
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
321
- * @param {boolean} [options.useMapSrs] - Whether the geometry and the extent are in the map's SRS (otherwise EPSG:4326 is assumed)
322
- * @param {ExtentStrategy} [options.extentStrategy] - Strategy to define the new map extent
323
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
311
+ * @param {object} [__namedParameters] - Options
312
+ * @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
313
+ * @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
314
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
315
+ * @param {Geometry} [__namedParameters.geometry] - A geometry to show on the map
316
+ * @param {boolean} [__namedParameters.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
317
+ * @param {boolean} [__namedParameters.hideWorkbookToolBar] - Whether to hide the workbook toolbar
318
+ * @param {GlobalId} [__namedParameters.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
319
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
320
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
321
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
322
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry and the extent are in the map's SRS (otherwise EPSG:4326 is assumed)
323
+ * @param {ExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the initial map extent. A given extentStrategy
324
+ * trumps zooming to a specified mapExtent
325
+ * which trumps zooming to a locationFinder result
326
+ * which trumps zooming to the initial extent of the opened mapView.
327
+ * If a specified {@link GeometryExtentStrategy} doesn't contain a 'geometry', the 'geometry' of this API call is used.
328
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
324
329
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
325
330
  * @throws For invalid arguments
326
331
  * @fires
@@ -333,7 +338,12 @@ export class CadenzaClient {
333
338
  if (geometry) {
334
339
  assertValidGeometryType(geometry.type);
335
340
  }
336
- const zoomToGeometry = geometry && extentStrategy?.type === 'geometry';
341
+ const validExtentStrategy = sanitizeExtentStrategy({
342
+ geometry,
343
+ extentStrategy,
344
+ });
345
+ const zoomToGeometry = validExtentStrategy?.type === 'geometry' &&
346
+ validExtentStrategy?.geometry === geometry;
337
347
  const params = createParams({
338
348
  disabledUiFeatures,
339
349
  expandNavigator,
@@ -356,6 +366,9 @@ export class CadenzaClient {
356
366
  zoomToGeometry,
357
367
  });
358
368
  }
369
+ if (!zoomToGeometry && validExtentStrategy) {
370
+ this.#setExtentStrategy(validExtentStrategy);
371
+ }
359
372
  }
360
373
  /**
361
374
  * Expand/collapse the navigator.
@@ -494,14 +507,14 @@ export class CadenzaClient {
494
507
  *
495
508
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
496
509
  * @param {GeometryType} geometryType - The geometry type
497
- * @param {object} [options] - Options
498
- * @param {FilterVariables} [options.filter] - Filter variables
499
- * @param {string} [options.locationFinder] - A search query for the location finder
500
- * @param {Extent} [options.mapExtent] - A map extent to set
501
- * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
502
- * @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
503
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
504
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
510
+ * @param {object} [__namedParameters] - Options
511
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
512
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
513
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
514
+ * @param {number} [__namedParameters.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
515
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
516
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
517
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
505
518
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
506
519
  * @throws For invalid arguments
507
520
  * @fires
@@ -529,15 +542,19 @@ export class CadenzaClient {
529
542
  *
530
543
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
531
544
  * @param {Geometry} geometry - The geometry
532
- * @param {object} [options] - Options
533
- * @param {FilterVariables} [options.filter] - Filter variables
534
- * @param {string} [options.locationFinder] - A search query for the location finder
535
- * @param {Extent} [options.mapExtent] - A map extent to set
536
- * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
537
- * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
538
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
539
- * @param {ExtentStrategy} [options.extentStrategy] - Strategy to define the new map extent
540
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
545
+ * @param {object} [__namedParameters] - Options
546
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
547
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
548
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
549
+ * @param {number} [__namedParameters.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
550
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
551
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
552
+ * @param {ExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the initial map extent. A given extentStrategy
553
+ * trumps zooming to a specified mapExtent
554
+ * which trumps zooming to a locationFinder result
555
+ * which trumps zooming to the initial extent of the opened mapView.
556
+ * If a specified {@link GeometryExtentStrategy} doesn't contain a 'geometry', the 'geometry' of this API call is used.
557
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
541
558
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
542
559
  * @throws For invalid arguments
543
560
  * @fires
@@ -549,7 +566,12 @@ export class CadenzaClient {
549
566
  async editGeometry(backgroundMapView, geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, extentStrategy, operationMode, signal, } = {}) {
550
567
  this.#log('CadenzaClient#editGeometry', ...arguments);
551
568
  assertValidGeometryType(geometry.type);
552
- const zoomToGeometry = geometry && extentStrategy?.type === 'geometry';
569
+ const validExtentStrategy = sanitizeExtentStrategy({
570
+ geometry,
571
+ extentStrategy,
572
+ });
573
+ const zoomToGeometry = validExtentStrategy?.type === 'geometry' &&
574
+ validExtentStrategy?.geometry === geometry;
553
575
  const params = createParams({
554
576
  action: 'editGeometry',
555
577
  filter,
@@ -568,6 +590,9 @@ export class CadenzaClient {
568
590
  zoomToGeometry,
569
591
  });
570
592
  }
593
+ if (!zoomToGeometry && validExtentStrategy) {
594
+ this.#setExtentStrategy(validExtentStrategy);
595
+ }
571
596
  }
572
597
  /**
573
598
  * Set custom validity state of the geometry editor in addition to the default validation state (including errors and
@@ -586,15 +611,15 @@ export class CadenzaClient {
586
611
  * Select objects in a workbook map.
587
612
  *
588
613
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view
589
- * @param {object} [options] - Options
590
- * @param {FilterVariables} [options.filter] - Filter variables
591
- * @param {(WorkbookLayerPath | string)[]} [options.layers] - Layers to restrict the selection to
614
+ * @param {object} [__namedParameters] - Options
615
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
616
+ * @param {(WorkbookLayerPath | string)[]} [__namedParameters.layers] - Layers to restrict the selection to
592
617
  * (identified using layer paths or print names)
593
- * @param {string} [options.locationFinder] - A search query for the location finder
594
- * @param {Extent} [options.mapExtent] - A map extent to set
595
- * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
596
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
597
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
618
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
619
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
620
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
621
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
622
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
598
623
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
599
624
  * @throws For invalid arguments
600
625
  * @fires
@@ -800,10 +825,10 @@ export class CadenzaClient {
800
825
  * @param {DataType} dataType - The data type you want to get back from the server.
801
826
  * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
802
827
  * and `"pdf"` for views of type "JasperReports report".
803
- * @param {object} [options] - Options
804
- * @param {FilterVariables} [options.filter] - Filter variables
805
- * @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
806
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
828
+ * @param {object} [__namedParameters] - Options
829
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
830
+ * @param {TablePart[]} [__namedParameters.parts] - Table parts to export; If not specified, all parts are exported.
831
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
807
832
  * @return {Promise<Response>} A `Promise` for the fetch response
808
833
  * @throws For invalid arguments
809
834
  * @server
@@ -821,11 +846,11 @@ export class CadenzaClient {
821
846
  * @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
822
847
  * (identified using layer paths or print names)
823
848
  * @param {unknown[][]} objectIds - The IDs of the objects to select
824
- * @param {object} [options] - Options
825
- * @param {FilterVariables} [options.filter] - Filter variables
826
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
827
- * @param {Boolean} [options.useMapSrs] - Use the map SRS instead of WGS84
828
- * @param {Boolean} [options.fullGeometries] - Return non-simplified geometries
849
+ * @param {object} [__namedParameters] - Options
850
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
851
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
852
+ * @param {Boolean} [__namedParameters.useMapSrs] - Use the map SRS instead of WGS84
853
+ * @param {Boolean} [__namedParameters.fullGeometries] - Return non-simplified geometries
829
854
  * @return {Promise<FeatureCollection>} A `Promise` for the fetch response
830
855
  * @throws For invalid arguments
831
856
  */
@@ -848,10 +873,10 @@ export class CadenzaClient {
848
873
  * @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
849
874
  * (identified using layer paths or print names)
850
875
  * @param {Geometry} geometry - The intersection geometry
851
- * @param {object} [options] - Options
852
- * @param {boolean} [options.useMapSrs] - The intersection geometry and the result geometries are in the map's SRS (otherwise EPSG:4326 is assumed)
853
- * @param {Distance} [options.buffer] - Buffer size for geometry of the transition
854
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
876
+ * @param {object} [__namedParameters] - Options
877
+ * @param {boolean} [__namedParameters.useMapSrs] - The intersection geometry and the result geometries are in the map's SRS (otherwise EPSG:4326 is assumed)
878
+ * @param {Distance} [__namedParameters.buffer] - Buffer size for geometry of the transition
879
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
855
880
  * @return {Promise<FeatureCollection>} A `Promise` for the fetch response
856
881
  * @server
857
882
  */
@@ -903,10 +928,10 @@ export class CadenzaClient {
903
928
  * @param {DataType} dataType - The data type you want to get back from the server.
904
929
  * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
905
930
  * and `"pdf"` for views of type "JasperReports report".
906
- * @param {object} [options] - Options
907
- * @param {string} [options.fileName] - The file name to use; The file extension is appended by Cadenza.
908
- * @param {FilterVariables} [options.filter] - Filter variables
909
- * @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
931
+ * @param {object} [__namedParameters] - Options
932
+ * @param {string} [__namedParameters.fileName] - The file name to use; The file extension is appended by Cadenza.
933
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
934
+ * @param {TablePart[]} [__namedParameters.parts] - Table parts to export; If not specified, all parts are exported.
910
935
  * @throws For invalid arguments
911
936
  * @server
912
937
  */
@@ -1105,6 +1130,30 @@ function createParams({ action, dataType, disabledUiFeatures, expandNavigator, f
1105
1130
  function array(/** @type unknown */ value) {
1106
1131
  return Array.isArray(value) ? value : [value];
1107
1132
  }
1133
+ /**
1134
+ * Creates a valid extent strategy
1135
+ *
1136
+ * If the result is not a valid extent strategy, the return value is undefined.
1137
+ *
1138
+ * @param {object} __namedParameters
1139
+ * @param {Geometry} [__namedParameters.geometry]
1140
+ * @param {ExtentStrategy} [__namedParameters.extentStrategy]
1141
+ * @return {ExtentStrategy | undefined}
1142
+ */
1143
+ function sanitizeExtentStrategy({ extentStrategy, geometry } = {}) {
1144
+ if (extentStrategy) {
1145
+ switch (extentStrategy.type) {
1146
+ case 'geometry':
1147
+ geometry = extentStrategy.geometry ?? geometry;
1148
+ if (geometry) {
1149
+ return { type: 'geometry', geometry };
1150
+ }
1151
+ break;
1152
+ default:
1153
+ return extentStrategy;
1154
+ }
1155
+ }
1156
+ }
1108
1157
  // Please do not add internal event types like 'ready' here.
1109
1158
  /**
1110
1159
  * @typedef {'action'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@disy/cadenza.js",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "license": "Apache-2.0",
5
5
  "repository": "github:DisyInformationssysteme/cadenza.js",
6
6
  "type": "module",