jmapcloud-ng-core-types 2.0.18-qa.6 → 2.0.18-qa.8

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.
package/all-enums.ts CHANGED
@@ -2,7 +2,6 @@ import {
2
2
  JFATAL_ERROR_CONTEXTS,
3
3
  JGEOMETRY_UNITS,
4
4
  JLAYER_ATTRIBUTE_TYPES,
5
- JLAYER_DYNAMIC_FILTER_OPERATORS,
6
5
  JLAYER_ELEMENT_TYPES,
7
6
  JLAYER_GEOMETRIES,
8
7
  JLAYER_LAYER_REQUEST_MODES,
@@ -103,25 +102,6 @@ export const ALL_LAYER_STYLE_RULE_CONDITION_EXPRESSION_OPERATORS: JLAYER_STYLE_R
103
102
  JLAYER_STYLE_RULE_CONDITION_EXPRESSION_OPERATORS.LOWER_OR_EQUALS_TO
104
103
  ]
105
104
 
106
- export const ALL_LAYER_DYNAMIC_FILTER_OPERATORS: JLAYER_DYNAMIC_FILTER_OPERATORS[] = [
107
- JLAYER_DYNAMIC_FILTER_OPERATORS.EQUALS,
108
- JLAYER_DYNAMIC_FILTER_OPERATORS.NOT_EQUALS,
109
- JLAYER_DYNAMIC_FILTER_OPERATORS.GREATER_THAN,
110
- JLAYER_DYNAMIC_FILTER_OPERATORS.GREATER_OR_EQUALS_TO,
111
- JLAYER_DYNAMIC_FILTER_OPERATORS.LESS_THAN,
112
- JLAYER_DYNAMIC_FILTER_OPERATORS.LESS_OR_EQUALS_TO,
113
- JLAYER_DYNAMIC_FILTER_OPERATORS.CONTAINS,
114
- JLAYER_DYNAMIC_FILTER_OPERATORS.NOT_CONTAINS,
115
- JLAYER_DYNAMIC_FILTER_OPERATORS.IS_EMPTY,
116
- JLAYER_DYNAMIC_FILTER_OPERATORS.IS_NOT_EMPTY,
117
- JLAYER_DYNAMIC_FILTER_OPERATORS.IS_NULL,
118
- JLAYER_DYNAMIC_FILTER_OPERATORS.IS_NOT_NULL,
119
- JLAYER_DYNAMIC_FILTER_OPERATORS.IS_IN_RANGE,
120
- JLAYER_DYNAMIC_FILTER_OPERATORS.IS_NOT_IN_RANGE,
121
- JLAYER_DYNAMIC_FILTER_OPERATORS.LAST,
122
- JLAYER_DYNAMIC_FILTER_OPERATORS.INTERVAL
123
- ]
124
-
125
105
  export const ALL_LAYER_STYLE_LINE_CAP: JLAYER_STYLE_LINE_CAP[] = [JLAYER_STYLE_LINE_CAP.BUTT, JLAYER_STYLE_LINE_CAP.ROUND, JLAYER_STYLE_LINE_CAP.SQUARE]
126
106
 
127
107
  export const ALL_LAYER_STYLE_LINE_JOIN: JLAYER_STYLE_LINE_JOIN[] = [JLAYER_STYLE_LINE_JOIN.MITER, JLAYER_STYLE_LINE_JOIN.ROUND, JLAYER_STYLE_LINE_JOIN.BEVEL]
package/enums.ts CHANGED
@@ -194,25 +194,6 @@ export enum JLAYER_STYLE_RULE_CONDITION_EXPRESSION_OPERATORS {
194
194
  NOT_IN = "NOT_IN"
195
195
  }
196
196
 
197
- export enum JLAYER_DYNAMIC_FILTER_OPERATORS {
198
- EQUALS = "EQUALS",
199
- NOT_EQUALS = "NOT_EQUALS",
200
- GREATER_THAN = "GREATER_THAN",
201
- GREATER_OR_EQUALS_TO = "GREATER_OR_EQUALS_TO",
202
- LESS_THAN = "LESS_THAN",
203
- LESS_OR_EQUALS_TO = "LESS_OR_EQUALS_TO",
204
- CONTAINS = "CONTAINS",
205
- NOT_CONTAINS = "NOT_CONTAINS",
206
- IS_EMPTY = "IS_EMPTY",
207
- IS_NOT_EMPTY = "IS_NOT_EMPTY",
208
- IS_NULL = "IS_NULL",
209
- IS_NOT_NULL = "IS_NOT_NULL",
210
- IS_IN_RANGE = "IS_IN_RANGE",
211
- IS_NOT_IN_RANGE = "IS_NOT_IN_RANGE",
212
- LAST = "LAST",
213
- INTERVAL = "INTERVAL"
214
- }
215
-
216
197
  export enum JLAYER_STYLE_LINE_CAP {
217
198
  BUTT = "BUTT",
218
199
  ROUND = "ROUND",
package/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  /// <reference path="./public/global-aliases.d.ts" />
2
+ import type { JLocalDynamicFilter, JLocalDynamicFilterCreateParams, JLocalDynamicFilterUpdateParams } from "./public/jmap/dynamic-filter.d.ts"
2
3
  import { Feature, FeatureCollection, LineString, MultiLineString, Point, Polygon } from "geojson"
3
4
  import { JAttribute, JDataSource, JDataSourceType, JForm, JRelationship } from "jmapcloud-types"
4
5
  import type * as maplibregl from "maplibre-gl"
@@ -7,6 +8,8 @@ import { JDataSourceData, JDataSourceDataParams, JDataSourcePermissions } from "
7
8
  import type { JDrawEventModule, JDrawService } from "./public/jmap/draw.d.ts"
8
9
  import type { JCoreState, JMapLegendMode } from "./public/state.d.ts"
9
10
 
11
+ export type { JLocalDynamicFilter, JLocalDynamicFilterCreateParams, JLocalDynamicFilterUpdateParams } from "./public/jmap/dynamic-filter.d.ts"
12
+ export type { JMapContextDynamicFilters } from "./public/jmap/map-context.d.ts"
10
13
  export type { JCoreOptions } from "./public/jmap/startup-options.d.ts"
11
14
  export type {
12
15
  JCoreState,
@@ -343,11 +346,8 @@ export interface JLayerEventModule extends JEventModule {
343
346
  thematicAddition(listenerId: string, fn: (params: JAddMapThematicEventParams) => void): void
344
347
  thematicDeletion(listenerId: string, fn: (params: JLayerThematicEventParams) => void): void
345
348
  initialSearchApplied(listenerId: string, fn: (params: JLayerInitialSearchEventParams) => void): void
346
- dynamicFilterSet(listenerId: string, fn: (params: JLayerDynamicFilterSetParams) => void): void
349
+ dynamicFiltersChange(listenerId: string, fn: (params: JLayerEventParams) => void): void
347
350
  dynamicFilterActivationChange(listenerId: string, fn: (params: JLayerDynamicFilterActivationParams) => void): void
348
- dynamicFilterConditionCreated(listenerId: string, fn: (params: JLayerDynamicFilterConditionCreated) => void): void
349
- dynamicFilterConditionUpdated(listenerId: string, fn: (params: JLayerDynamicFilterConditionUpdated) => void): void
350
- dynamicFilterConditionsRemoved(listenerId: string, fn: (params: JLayerDynamicFilterConditionsRemoved) => void): void
351
351
  }
352
352
  }
353
353
 
@@ -727,6 +727,7 @@ export interface JDataSourceService {
727
727
  }
728
728
 
729
729
  export interface JTableService {
730
+ DynamicFilter: JDynamicFilterService
730
731
  getTables(): JTable[]
731
732
  getTableData(tableId: JId, params: JTableDataParams): Promise<JTableData>
732
733
  getById(tableId: JId): JTable
@@ -734,6 +735,7 @@ export interface JTableService {
734
735
  updateRow(tableId: JId, rowId: number, row: { [key: string]: any }): Promise<void>
735
736
  deleteRow(tableId: JId, rowId: number): Promise<void>
736
737
  getDataSourceAttributes(tableId: JId): Promise<JAttribute[]>
738
+ /** @deprecated Use DynamicFilter.setIsActive instead. */
737
739
  setDynamicFilterActive(tableId: JId, filterId: string, isActive: boolean): void
738
740
  }
739
741
 
@@ -833,49 +835,13 @@ export interface JServerService {
833
835
  getAllIdentityProvidersById(): JServerIdentityProviderById
834
836
  }
835
837
 
836
- export interface JDynamicLayerFilterService {
837
- // TODO JMAP8-3266 : create new service
838
- }
839
- export interface JDynamicTableFilterService {
840
- // TODO JMAP8-3266 : create new service
841
- }
842
-
843
- // TODO JMAP8-3266 : refactor this
844
838
  export interface JDynamicFilterService {
845
- // isAvailable(layerId: JId): boolean
846
- // isActive(layerId: JId): boolean
847
- setIsActive(layerId: JId, filterId: string, isActive: boolean): void
848
- // setIsActive(layerId: JId, isActive: boolean): void
849
- // getByLayerId(layerId: JId): JDynamicFilter
850
- // getAllOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
851
- // getAllMultipleValuesOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
852
- // getAllTwoValuesOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
853
- // getOperatorsForAttributeType(attributeType: JLAYER_ATTRIBUTE_TYPES): JLAYER_DYNAMIC_FILTER_OPERATORS[]
854
- // getConditionError(condition: JDynamicFilterCondition): string | undefined
855
- // isConditionValid(condition: JDynamicFilterCondition): boolean
856
- // existSimilarCondition(condition: JDynamicFilterCondition, isUpdate?: boolean): boolean
857
- // set(params: JDynamicFilterSetParams[]): void
858
- // createCondition(condition: JDynamicFilterCondition): number
859
- // updateCondition(condition: JDynamicFilterCondition): void
860
- // removeConditions(layerId: JId, conditionsIds: number[]): void
861
- // isNoValueOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
862
- // isMultipleValuesOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
863
- // isTwoValuesOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
864
- // getConditionValueError(
865
- // operator: JLAYER_DYNAMIC_FILTER_OPERATORS,
866
- // attributeType: JLAYER_ATTRIBUTE_TYPES,
867
- // value?: any
868
- // ): string | undefined
869
- // isConditionValueValid(
870
- // operator: JLAYER_DYNAMIC_FILTER_OPERATORS,
871
- // attributeType: JLAYER_ATTRIBUTE_TYPES,
872
- // value?: any
873
- // ): boolean
874
- // canAttributeTypeAcceptMultipleValuesOperators(attributeType: JLAYER_ATTRIBUTE_TYPES): boolean
875
- // canAttributeTypeAcceptTwoValuesOperators(attributeType: JLAYER_ATTRIBUTE_TYPES): boolean
876
- // getIsBetweenValuesError(attributeType: JLAYER_ATTRIBUTE_TYPES, value1: any, value2: any): string | undefined
877
- // getNowValue(): string
878
- // getAllLastOperatorUnits(): string[]
839
+ create(resourceId: JId, params: JLocalDynamicFilterCreateParams): string
840
+ getAll(resourceId: JId): JLocalDynamicFilter[]
841
+ getById(resourceId: JId, filterId: string): JLocalDynamicFilter
842
+ update(resourceId: JId, filterId: string, update: JLocalDynamicFilterUpdateParams): void
843
+ remove(resourceId: JId, filterId: string): void
844
+ setIsActive(resourceId: JId, filterId: string, isActive: boolean): void
879
845
  }
880
846
 
881
847
  // MISC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "2.0.18-qa.6",
3
+ "version": "2.0.18-qa.8",
4
4
  "description": "JMap Cloud specific version of JMap Cloud NG Core types and interfaces",
5
5
  "main": "index.js",
6
6
  "types": "ambient.d.ts",
package/public/core.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { JLocalDynamicFilter, JLocalDynamicFilterCreateParams, JLocalDynamicFilterUpdateParams } from "./jmap/dynamic-filter.d.ts"
1
2
  import { JAttribute, JDataSource, JRelationship } from "jmapcloud-types"
2
3
  import type { Action, Store } from "redux"
3
4
  import type { JRequestConfig } from "./jmap/ajax.d.ts"
@@ -39,10 +40,6 @@ import type {
39
40
  JLayerAddThematicParams,
40
41
  JLayerAttribute,
41
42
  JLayerDynamicFilterActivationParams,
42
- JLayerDynamicFilterConditionCreated,
43
- JLayerDynamicFilterConditionUpdated,
44
- JLayerDynamicFilterConditionsRemoved,
45
- JLayerDynamicFilterSetParams,
46
43
  JLayerEventChangeParams,
47
44
  JLayerEventParams,
48
45
  JLayerEventSelectabilityParams,
@@ -1394,522 +1391,106 @@ export namespace JMap {
1394
1391
  /**
1395
1392
  * **JMap.Layer.DynamicFilter**
1396
1393
  *
1397
- * Methods used to manage dynamic filters for a layer.
1394
+ * Manages dynamic filters for a layer in the current session. Changes are held locally and
1395
+ * are included when a map context is saved; they do not update server filter definitions.
1396
+ * These methods support vector layers with attributes, not group layers.
1398
1397
  */
1399
1398
  namespace DynamicFilter {
1400
- // TODO JMAP8-3266 : remove this
1401
- // /**
1402
- // * **JMap.Layer.DynamicFilter.isAvailable**
1403
- // *
1404
- // * Returns true if the layer support dynamic filter.
1405
- // *
1406
- // * For example raster layers don't support dynamic filter.
1407
- // *
1408
- // * @param layerId The JMap layer id
1409
- // * @example
1410
- // * ```ts
1411
- // * // returns true if layer id=5 support dynamic filter, else false
1412
- // * JMap.Layer.DynamicFilter.isAvailable(5)
1413
- // * ```
1414
- // */
1415
- // function isAvailable(layerId: JId): boolean
1416
- // /**
1417
- // * **JMap.Layer.DynamicFilter.isActive**
1418
- // *
1419
- // * Returns true if the layer has a dynamic filter, and its filter is active.
1420
- // *
1421
- // * Doesn't throw if the given layer doesn't support dynamic filter.
1422
- // *
1423
- // * @param layerId The JMap layer id
1424
- // * @example
1425
- // * ```ts
1426
- // * // returns true if layer has dynamic filter, and filter is active
1427
- // * JMap.Layer.DynamicFilter.isActive(5)
1428
- // * ```
1429
- // */
1430
- // function isActive(layerId: JId): boolean
1431
- // /**
1432
- /* **JMap.Layer.DynamicFilter.setIsActive**
1433
- *
1434
- * Activate or deactivate a dynamic layer filter for a given JMap layer id
1435
- *
1436
- * @throws Error if layer is not found
1437
- * @param layerId The JMap layer id
1438
- * @param filterId The JMap dynamic layer filter id
1439
- * @param isActive The new status of the filter
1399
+ /**
1400
+ * **JMap.Layer.DynamicFilter.create**
1401
+ *
1402
+ * Creates a session filter. It is active by default unless `params.active` is false.
1403
+ *
1404
+ * @param layerId The layer ID
1405
+ * @param params A non-empty name and a parsed filter condition, with optional activation
1406
+ * @returns The new filter's UUID v4
1407
+ * @throws If the layer is missing or unsupported, or the filter parameters are invalid
1408
+ * @example
1409
+ * ```ts
1410
+ * const filterId = JMap.Layer.DynamicFilter.create(layerId, {
1411
+ * name: "Large cities",
1412
+ * filter: { id: "condition-1", op: ">", args: [{ property: "population" }, 5000] }
1413
+ * })
1414
+ * ```
1415
+ */
1416
+ function create(layerId: JId, params: JLocalDynamicFilterCreateParams): string
1417
+ /**
1418
+ * **JMap.Layer.DynamicFilter.getAll**
1419
+ *
1420
+ * Returns copies of all filters for the layer, including loaded and session-created filters.
1421
+ * Changing a returned object does not change the session filter.
1422
+ *
1423
+ * @param layerId The layer ID
1424
+ * @returns The layer's session filters
1425
+ * @throws If the layer is missing or unsupported
1426
+ * @example
1427
+ * ```ts
1428
+ * const filters = JMap.Layer.DynamicFilter.getAll(layerId)
1429
+ * ```
1430
+ */
1431
+ function getAll(layerId: JId): JLocalDynamicFilter[]
1432
+ /**
1433
+ * **JMap.Layer.DynamicFilter.getById**
1434
+ *
1435
+ * Returns a copy of one session filter. Changing the returned object does not change the filter.
1436
+ *
1437
+ * @param layerId The layer ID
1438
+ * @param filterId The filter ID
1439
+ * @returns The session filter
1440
+ * @throws If the layer is missing or unsupported, or the filter is not found
1441
+ * @example
1442
+ * ```ts
1443
+ * const filter = JMap.Layer.DynamicFilter.getById(layerId, filterId)
1444
+ * ```
1445
+ */
1446
+ function getById(layerId: JId, filterId: string): JLocalDynamicFilter
1447
+ /**
1448
+ * **JMap.Layer.DynamicFilter.update**
1449
+ *
1450
+ * Changes a filter's localized name, parsed condition, or activation in this session.
1451
+ * The filter ID and owning layer cannot be changed. Updated conditions immediately refresh
1452
+ * map filtering.
1453
+ *
1454
+ * @param layerId The layer ID
1455
+ * @param filterId The filter ID
1456
+ * @param update The fields to change: `name`, `filter`, or `active`
1457
+ * @throws If the layer or filter is missing, the layer is unsupported, or the update is invalid
1458
+ * @example
1459
+ * ```ts
1460
+ * JMap.Layer.DynamicFilter.update(layerId, filterId, { name: "Very large cities" })
1461
+ * ```
1462
+ */
1463
+ function update(layerId: JId, filterId: string, update: JLocalDynamicFilterUpdateParams): void
1464
+ /**
1465
+ * **JMap.Layer.DynamicFilter.remove**
1466
+ *
1467
+ * Removes a filter from this session and refreshes map filtering. This also works for a
1468
+ * definition loaded from the server, but does not delete that server definition.
1469
+ *
1470
+ * @param layerId The layer ID
1471
+ * @param filterId The filter ID
1472
+ * @throws If the layer or filter is missing, or the layer is unsupported
1440
1473
  * @example
1441
1474
  * ```ts
1442
- * // activate the dynamic filter for layer id=layer-guid and filter id=filter-guid
1443
- * JMap.Layer.DynamicFilter.setIsActive("layer-guid", "filter-guid", true)
1475
+ * JMap.Layer.DynamicFilter.remove(layerId, filterId)
1476
+ * ```
1477
+ */
1478
+ function remove(layerId: JId, filterId: string): void
1479
+ /**
1480
+ * **JMap.Layer.DynamicFilter.setIsActive**
1481
+ *
1482
+ * Activates or deactivates a session filter and refreshes map filtering.
1483
+ *
1484
+ * @param layerId The layer ID
1485
+ * @param filterId The filter ID
1486
+ * @param isActive Whether the filter should be active
1487
+ * @throws If the layer or filter is missing, the layer is unsupported, or `isActive` is invalid
1488
+ * @example
1489
+ * ```ts
1490
+ * JMap.Layer.DynamicFilter.setIsActive(layerId, filterId, false)
1444
1491
  * ```
1445
1492
  */
1446
1493
  function setIsActive(layerId: JId, filterId: string, isActive: boolean): void
1447
- // /**
1448
- // * **JMap.Layer.DynamicFilter.getByLayerId**
1449
- // *
1450
- // * Returns the dynamic filter of a given layer id
1451
- // *
1452
- // * @throws Error if layer is not found
1453
- // * @param layerId The JMap layer id
1454
- // * @example
1455
- // * ```ts
1456
- // * // returns the filter of layer id=3
1457
- // * const filter = JMap.Layer.DynamicFilter.getByLayerId(3)
1458
- // * console.log(filter)
1459
- // * ```
1460
- // */
1461
- // function getByLayerId(layerId: JId): JDynamicFilter
1462
- // /**
1463
- // * **JMap.Layer.DynamicFilter.getAllOperators**
1464
- // *
1465
- // * Returns the list of all availables operators
1466
- // *
1467
- // * @example
1468
- // * ```ts
1469
- // * // returns the list of all available operators
1470
- // * const allOperators = JMap.Layer.DynamicFilter.getAllOperators()
1471
- // * console.log(allOperators)
1472
- // * ```
1473
- // */
1474
- // function getAllOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1475
- // /**
1476
- // * **JMap.Layer.DynamicFilter.getAllMultipleValuesOperators**
1477
- // *
1478
- // * Returns the list of all operators that require an array values.
1479
- // *
1480
- // * Warning: EQUALS, NOT_EQUALS are operators that takes an array of values, they act like "IN" or "NOT IN".
1481
- // *
1482
- // * @example
1483
- // * ```ts
1484
- // * // returns the list of all operators that require two values
1485
- // * const allMultipleValuesOperators = JMap.Layer.DynamicFilter.getAllMultipleValuesOperators()
1486
- // * console.log(allMultipleValuesOperators)
1487
- // * ```
1488
- // */
1489
- // function getAllMultipleValuesOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1490
- // /**
1491
- // * **JMap.Layer.DynamicFilter.getAllTwoValuesOperators**
1492
- // *
1493
- // * Returns the list of all operators that require two values (ex: IS_IN_RANGE, IS_NOT_IN_RANGE)
1494
- // *
1495
- // * @example
1496
- // * ```ts
1497
- // * // returns the list of all operators that require two values
1498
- // * const allTwoValuesOperators = JMap.Layer.DynamicFilter.getAllTwoValuesOperators()
1499
- // * console.log(allTwoValuesOperators)
1500
- // * ```
1501
- // */
1502
- // function getAllTwoValuesOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1503
- // /**
1504
- // * **JMap.Layer.DynamicFilter.getOperatorsForAttributeType**
1505
- // *
1506
- // * Returns list of all operators available for a given attribute type.
1507
- // *
1508
- // * @example
1509
- // * ```ts
1510
- // * // returns the list of all operators that require two values
1511
- // * const operators = JMap.Layer.DynamicFilter.getOperatorsForAttributeType("number")
1512
- // * console.log("Available operators for attribute type:", operators)
1513
- // * ```
1514
- // */
1515
- // function getOperatorsForAttributeType(attributeType: JLAYER_ATTRIBUTE_TYPES): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1516
- // /**
1517
- // * **JMap.Layer.DynamicFilter.getConditionError**
1518
- // *
1519
- // * Returns a string error (human readable) if the condition is not correct.
1520
- // *
1521
- // * If correct returns undefined.
1522
- // *
1523
- // * It doesn't check the id of the condition.
1524
- // *
1525
- // * @param condition The condition to verify
1526
- // * @example
1527
- // * ```ts
1528
- // * // returns a string error if the condition is not correct
1529
- // * const error = JMap.Layer.DynamicFilter.getConditionError({
1530
- // * layerId: 3,
1531
- // * attributeName: "City",
1532
- // * filterOperator: "EQUALS",
1533
- // * value: "Montreal"
1534
- // * })
1535
- // * console.log("Error:", error)
1536
- // * ```
1537
- // */
1538
- // function getConditionError(condition: JDynamicFilterCondition): string | undefined
1539
- // /**
1540
- // * **JMap.Layer.DynamicFilter.existSimilarCondition**
1541
- // *
1542
- // * Returns true if the condition already exist for the layer.
1543
- // *
1544
- // * It doesn't check the id of the condition, only the values.
1545
- // *
1546
- // * @throws if condition is not correct
1547
- // * @param condition The condition to verify
1548
- // * @param isUpdate tell if the check is for a creation or an update
1549
- // * @example
1550
- // * ```ts
1551
- // * // log in console a message if this condition already exist
1552
- // * if (!JMap.Layer.DynamicFilter.existSimilarCondition(myCondition)) {
1553
- // * console.log("Same condition values already exist")
1554
- // * }
1555
- // * ```
1556
- // */
1557
- // function existSimilarCondition(condition: JDynamicFilterCondition, isUpdate?: boolean): boolean
1558
- // /**
1559
- // * **JMap.Layer.DynamicFilter.isConditionValid**
1560
- // *
1561
- // * Returns a string error (human readable) if the condition is not correct.
1562
- // *
1563
- // * If correct returns undefined.
1564
- // *
1565
- // * It doesn't check the id of the condition.
1566
- // *
1567
- // * @param condition The condition to verify
1568
- // * @example
1569
- // * ```ts
1570
- // * // log in console a message if the condition is not valid
1571
- // * if (!JMap.Layer.DynamicFilter.isConditionValid(myCondition)) {
1572
- // * console.log("Condition is not valid")
1573
- // * }
1574
- // * ```
1575
- // */
1576
- // function isConditionValid(condition: JDynamicFilterCondition): boolean
1577
- // /**
1578
- // * **JMap.Layer.DynamicFilter.set**
1579
- // *
1580
- // * Set multiple layer's dynamic filters at once.
1581
- // *
1582
- // * If some conditions where already set, will destroy them and replace it with the new given conditions.
1583
- // *
1584
- // * @param params the parameters
1585
- // * @throws if invalid params
1586
- // * @example
1587
- // * ```ts
1588
- // * // set layer's id=3 dynamic filter
1589
- // * JMap.Layer.DynamicFilter.set([{
1590
- // * layerId: 3,
1591
- // * conditions: [{
1592
- // * layerId: 3,
1593
- // * attributeName: "name",
1594
- // * filterOperator: "EQUALS",
1595
- // * value: ["Ottawa"]
1596
- // * }]
1597
- // * }])
1598
- // * ```
1599
- // */
1600
- // function set(params: JDynamicFilterSetParams[]): void
1601
- // /**
1602
- // * **JMap.Layer.DynamicFilter.createCondition**
1603
- // *
1604
- // * Add a new condition for a JMap Layer dynamic filter.
1605
- // *
1606
- // * Returns the new conditon id, and set the id in the object passed in parameter
1607
- // *
1608
- // * @throws Error if invalid condition
1609
- // * @param condition The dynamic filter condition to create
1610
- // * @example
1611
- // * ```ts
1612
- // * const newCondition = {
1613
- // * layerId: 3,
1614
- // * attributeName: "city"
1615
- // * filterOperator: "EQUALS"
1616
- // * value: ["Paris", "Ottawa"]
1617
- // * }
1618
- // * JMap.Layer.DynamicFilter.createCondition(newCondition)
1619
- // * console.log(`New condition id="${newCondition.id}" created`)
1620
- // * ```
1621
- // */
1622
- // function createCondition(condition: JDynamicFilterCondition): number
1623
- // /**
1624
- // * **JMap.Layer.DynamicFilter.updateCondition**
1625
- // *
1626
- // * Update an existing condition, for a JMap Layer dynamic filter.
1627
- // *
1628
- // * @throws Error if invalid or not found condition
1629
- // * @param condition The dynamic filter condition to update
1630
- // * @example
1631
- // * ```ts
1632
- // * const condition = getCondition()
1633
- // * condition.value = 3
1634
- // * JMap.Layer.DynamicFilter.updateCondition(condition)
1635
- // * console.log(`Condition new value is 3`)
1636
- // * ```
1637
- // */
1638
- // function updateCondition(condition: JDynamicFilterCondition): void
1639
- // /**
1640
- // * **JMap.Layer.DynamicFilter.removeConditions**
1641
- // *
1642
- // * Remove conditions for a given layer id and condition ids.
1643
- // *
1644
- // * @throws Error if JMap layer not found, if invalid array of id
1645
- // * @param layerId The JMap layer id
1646
- // * @param conditionsIds The dynamic filter condition ids
1647
- // * @example
1648
- // * ```ts
1649
- // * // for layer id=3, remove 2 conditions (id 2 and 12)
1650
- // * JMap.Layer.DynamicFilter.removeConditions(3, [2, 12])
1651
- // * ```
1652
- // */
1653
- // function removeConditions(layerId: JId, conditionsIds: number[]): void
1654
- // /**
1655
- // * **JMap.Layer.DynamicFilter.isNoValueOperator**
1656
- // *
1657
- // * Returns true if the operator doesn't require any value.
1658
- // *
1659
- // * This function is safe, it throws nothing.
1660
- // *
1661
- // * @param operator The operator to check
1662
- // * @example
1663
- // * ```ts
1664
- // * // returns false
1665
- // * JMap.Layer.DynamicFilter.isNoValueOperator("IS_IN_RANGE")
1666
- // *
1667
- // * // returns false
1668
- // * JMap.Layer.DynamicFilter.isNoValueOperator("EQUALS")
1669
- // *
1670
- // * // returns true
1671
- // * JMap.Layer.DynamicFilter.isNoValueOperator("IS_EMPTY")
1672
- // *
1673
- // * // returns true
1674
- // * JMap.Layer.DynamicFilter.isNoValueOperator("IS_NOT_NULL")
1675
- // * ```
1676
- // */
1677
- // function isNoValueOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
1678
- // /**
1679
- // * **JMap.Layer.DynamicFilter.isMultipleValuesOperator**
1680
- // *
1681
- // * Returns true if the operator requires a value that is an array.
1682
- // *
1683
- // * This function is safe, it throws nothing.
1684
- // *
1685
- // * @param operator The operator to check
1686
- // * @example
1687
- // * ```ts
1688
- // * // returns true
1689
- // * JMap.Layer.DynamicFilter.isMultipleValuesOperator("EQUALS")
1690
- // *
1691
- // * // returns true
1692
- // * JMap.Layer.DynamicFilter.isMultipleValuesOperator("NOT_EQUALS")
1693
- // *
1694
- // * // returns false
1695
- // * JMap.Layer.DynamicFilter.isMultipleValuesOperator("CONTAINS")
1696
- // *
1697
- // * // returns false
1698
- // * JMap.Layer.DynamicFilter.isMultipleValuesOperator("IS_IN_RANGE")
1699
- // * ```
1700
- // */
1701
- // function isMultipleValuesOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
1702
- // /**
1703
- // * **JMap.Layer.DynamicFilter.isTwoValuesOperator**
1704
- // *
1705
- // * Returns true if the operator require two values.
1706
- // *
1707
- // * This function is safe, it throws nothing.
1708
- // *
1709
- // * @param operator The operator to check
1710
- // * @example
1711
- // * ```ts
1712
- // * // returns true
1713
- // * JMap.Layer.DynamicFilter.isTwoValuesOperator("IS_IN_RANGE")
1714
- // *
1715
- // * // returns false
1716
- // * JMap.Layer.DynamicFilter.isTwoValuesOperator("EQUALS")
1717
- // * ```
1718
- // */
1719
- // function isTwoValuesOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
1720
- // /**
1721
- // * **JMap.Layer.DynamicFilter.getConditionValueError**
1722
- // *
1723
- // * Returns an error if value is not correct.
1724
- // *
1725
- // * This function is safe, it throws nothing.
1726
- // *
1727
- // * @param operator The operator to check
1728
- // * @param attributeType The attribute type
1729
- // * @param value the value, an array of value for IS_IN_RANGE operator
1730
- // * @example
1731
- // * ```ts
1732
- // * // returns an error
1733
- // * const error = JMap.Layer.DynamicFilter.getConditionValueError("IS_IN_RANGE", "date", date1)
1734
- // *
1735
- // * // if date1 and date2 are not date objects, or date1 >= date2, returns an error
1736
- // * const error = JMap.Layer.DynamicFilter.getConditionValueError("IS_IN_RANGE", "date", [date1, date2])
1737
- // *
1738
- // * // returns an error value must be an array for EQUALS operator
1739
- // * const error = JMap.Layer.DynamicFilter.getConditionValueError("EQUALS", "string", ["Montreal"])
1740
- // *
1741
- // * // no error, returns undefined
1742
- // * const error = JMap.Layer.DynamicFilter.getConditionValueError("EQUALS", "string", ["Montreal"])
1743
- // *
1744
- // * // no error, returns undefined
1745
- // * const error = JMap.Layer.DynamicFilter.getConditionValueError("EQUALS", "string", [""])
1746
- // *
1747
- // * // returns an error
1748
- // * const error = JMap.Layer.DynamicFilter.getConditionValueError("EQUALS", "string", undefined)
1749
- // *
1750
- // * // returns an error
1751
- // * const error = JMap.Layer.DynamicFilter.getConditionValueError("IS_EMPTY", "string")
1752
- // *
1753
- // * // no error, returns undefined
1754
- // * const error = JMap.Layer.DynamicFilter.getConditionValueError("EQUALS", "number", "test")
1755
- // *
1756
- // * // no error, returns undefined
1757
- // * const error = JMap.Layer.DynamicFilter.getConditionValueError("EQUALS", "number", 22)
1758
- // * ```
1759
- // */
1760
- // function getConditionValueError(
1761
- // operator: JLAYER_DYNAMIC_FILTER_OPERATORS,
1762
- // attributeType: JLAYER_ATTRIBUTE_TYPES,
1763
- // value?: any
1764
- // ): string | undefined
1765
- // /**
1766
- // * **JMap.Layer.DynamicFilter.isConditionValueValid**
1767
- // *
1768
- // * Returns true if the condition value is valid.
1769
- // *
1770
- // * This function is safe, it throws nothing.
1771
- // *
1772
- // * @param operator The operator to check
1773
- // * @param attributeType The attribute type
1774
- // * @param value the value, an array of value for IS_IN_RANGE operator
1775
- // * @example
1776
- // * ```ts
1777
- // * // if date1 is Date object, returns false
1778
- // * JMap.Layer.DynamicFilter.isConditionValueValid("IS_IN_RANGE", "date", date1)
1779
- // *
1780
- // * // if date1 and date2 are Date objects, returns true
1781
- // * JMap.Layer.DynamicFilter.isConditionValueValid("IS_IN_RANGE", "date", [date1, date2])
1782
- // *
1783
- // * // returns true
1784
- // * JMap.Layer.DynamicFilter.isConditionValueValid("EQUALS", "string", "Montreal")
1785
- // *
1786
- // * // returns true
1787
- // * JMap.Layer.DynamicFilter.isConditionValueValid("EQUALS", "string", "")
1788
- // *
1789
- // * // returns false
1790
- // * JMap.Layer.DynamicFilter.isConditionValueValid("EQUALS", "string", undefined)
1791
- // *
1792
- // * // returns true
1793
- // * JMap.Layer.DynamicFilter.isConditionValueValid("IS_EMPTY", "string")
1794
- // *
1795
- // * // returns false
1796
- // * JMap.Layer.DynamicFilter.isConditionValueValid("EQUALS", "number", "test")
1797
- // *
1798
- // * // returns true
1799
- // * JMap.Layer.DynamicFilter.isConditionValueValid("EQUALS", "number", 22)
1800
- // * ```
1801
- // */
1802
- // function isConditionValueValid(
1803
- // operator: JLAYER_DYNAMIC_FILTER_OPERATORS,
1804
- // attributeType: JLAYER_ATTRIBUTE_TYPES,
1805
- // value?: any
1806
- // ): boolean
1807
- // /**
1808
- // * **JMap.Layer.DynamicFilter.canAttributeTypeAcceptMultipleValuesOperators**
1809
- // *
1810
- // * Returns true if the attribute type accept multiple value operator ("EQUALS" or "NOT_EQUALS" for example).
1811
- // *
1812
- // * This function is safe, it throws nothing.
1813
- // *
1814
- // * @param attributeType The attribute type
1815
- // * @example
1816
- // * ```ts
1817
- // * // returns true
1818
- // * JMap.Layer.DynamicFilter.canAttributeTypeAcceptMultipleValuesOperators("string")
1819
- // *
1820
- // * // returns true
1821
- // * JMap.Layer.DynamicFilter.canAttributeTypeAcceptMultipleValuesOperators("number")
1822
- // *
1823
- // * // returns false
1824
- // * JMap.Layer.DynamicFilter.canAttributeTypeAcceptMultipleValuesOperators("date")
1825
- // *
1826
- // * // returns false
1827
- // * JMap.Layer.DynamicFilter.canAttributeTypeAcceptMultipleValuesOperators("datetime")
1828
- // *
1829
- // * // returns false
1830
- // * JMap.Layer.DynamicFilter.canAttributeTypeAcceptMultipleValuesOperators("boolean")
1831
- // * ```
1832
- // */
1833
- // function canAttributeTypeAcceptMultipleValuesOperators(attributeType: JLAYER_ATTRIBUTE_TYPES): boolean
1834
- // /**
1835
- // * **JMap.Layer.DynamicFilter.canAttributeTypeAcceptTwoValuesOperators**
1836
- // *
1837
- // * Returns true if the attribute type accept two value operator ("IS_IN_RANGE").
1838
- // *
1839
- // * This function is safe, it throws nothing.
1840
- // *
1841
- // * @param attributeType The attribute type
1842
- // * @example
1843
- // * ```ts
1844
- // * // returns false
1845
- // * JMap.Layer.DynamicFilter.canAttributeTypeAcceptTwoValuesOperators("string")
1846
- // *
1847
- // * // returns true
1848
- // * JMap.Layer.DynamicFilter.canAttributeTypeAcceptTwoValuesOperators("date")
1849
- // *
1850
- // * // returns true
1851
- // * JMap.Layer.DynamicFilter.canAttributeTypeAcceptTwoValuesOperators("datetime")
1852
- // *
1853
- // * // returns true
1854
- // * JMap.Layer.DynamicFilter.canAttributeTypeAcceptTwoValuesOperators("number")
1855
- // *
1856
- // * // returns false
1857
- // * JMap.Layer.DynamicFilter.canAttributeTypeAcceptTwoValuesOperators("boolean")
1858
- // * ```
1859
- // */
1860
- // function canAttributeTypeAcceptTwoValuesOperators(attributeType: JLAYER_ATTRIBUTE_TYPES): boolean
1861
- // /**
1862
- // * **JMap.Layer.DynamicFilter.getIsBetweenValuesError**
1863
- // *
1864
- // * Returns true if the attribute type accept two value operator ("IS_IN_RANGE").
1865
- // *
1866
- // * This function is safe, it throws nothing.
1867
- // *
1868
- // * @param attributeType The attribute type
1869
- // * @example
1870
- // * ```ts
1871
- // * // returns an error
1872
- // * const error = JMap.Layer.DynamicFilter.getIsBetweenValuesError("number", 4, 2)
1873
- // *
1874
- // * // returns no error
1875
- // * const error = JMap.Layer.DynamicFilter.getIsBetweenValuesError("number", 2, 4)
1876
- // * ```
1877
- // */
1878
- // function getIsBetweenValuesError(
1879
- // attributeType: JLAYER_ATTRIBUTE_TYPES,
1880
- // value1: any,
1881
- // value2: any
1882
- // ): string | undefined
1883
- // /**
1884
- // * **JMap.Layer.DynamicFilter.getNowValue**
1885
- // *
1886
- // * Returns the now value, used for date.
1887
- // *
1888
- // * @example
1889
- // * ```ts
1890
- // * const nowValue = JMap.Layer.DynamicFilter.getNowValue()
1891
- // * console.log(`Now value is '${nowValue}'`) // display "Now value is 'Now'"
1892
- // * ```
1893
- // */
1894
- // function getNowValue(): string
1895
- // /**
1896
- // * **JMap.Layer.DynamicFilter.getAllLastOperatorUnits**
1897
- // *
1898
- // * Returns list of all "LAST" operator available units:
1899
- // * - "mi": minutes
1900
- // * - "h": hours
1901
- // * - "d": days
1902
- // * - "w": weeks
1903
- // * - "mo": months
1904
- // * - "y": years
1905
- // *
1906
- // * @example
1907
- // * ```ts
1908
- // * const allUnits = JMap.Layer.DynamicFilter.getAllLastOperatorUnits()
1909
- // * console.log(`All unit for 'LAST' operator are: ${allUnits.join(", ")}`)
1910
- // * ```
1911
- // */
1912
- // function getAllLastOperatorUnits(): string[]
1913
1494
  }
1914
1495
  /**
1915
1496
  * **JMap.Layer.getLayerTree**
@@ -8616,25 +8197,8 @@ export namespace JMap {
8616
8197
  * ```
8617
8198
  */
8618
8199
  function initialSearchApplied(listenerId: string, fn: (params: JLayerInitialSearchEventParams) => void): void
8619
- /**
8620
- * ***JMap.Event.Layer.on.dynamicFilterSet***
8621
- *
8622
- * This event is triggered when some dynamic filters are set.
8623
- *
8624
- * Could happen when a map context is applied, or when layer dynamic filters are set via the API.
8625
- *
8626
- * @param listenerId Your listener id (must be unique for all layer events)
8627
- * @param fn Your listener function
8628
- * @example
8629
- * ```ts
8630
- * // Each time some layer dynamic filters have been set
8631
- * JMap.Event.Layer.on.dynamicFilterSet(
8632
- * "custom-layer-dynamic-filter-set",
8633
- * params => console.info("Some dynamic filters have been set", params)
8634
- * )
8635
- * ```
8636
- */
8637
- function dynamicFilterSet(listenerId: string, fn: (params: JLayerDynamicFilterSetParams) => void): void
8200
+ /** Fires after local filter creation, updates, deletion or activation. */
8201
+ function dynamicFiltersChange(listenerId: string, fn: (params: JLayerEventParams) => void): void
8638
8202
  /**
8639
8203
  * ***JMap.Event.Layer.on.dynamicFilterActivationChange***
8640
8204
  *
@@ -8654,63 +8218,6 @@ export namespace JMap {
8654
8218
  * ```
8655
8219
  */
8656
8220
  function dynamicFilterActivationChange(listenerId: string, fn: (params: JLayerDynamicFilterActivationParams) => void): void
8657
- /**
8658
- * ***JMap.Event.Layer.on.dynamicFilterConditionCreated***
8659
- *
8660
- * This event is triggered when a condition is created on a layer dynamic filter.
8661
- *
8662
- * @param listenerId Your listener id (must be unique for all layer events)
8663
- * @param fn Your listener function
8664
- * @example
8665
- * ```ts
8666
- * // Each time a condition is created on a layer dynamic filter, will display a message in the console
8667
- * JMap.Event.Layer.on.dynamicFilterConditionCreated(
8668
- * "custom-layer-dynamic-filter-condition-created",
8669
- * params => {
8670
- * console.info(`Condition added on layer id=${params.layerId}'s dynamic filter`, params.filter, params.condition)
8671
- * }
8672
- * )
8673
- * ```
8674
- */
8675
- function dynamicFilterConditionCreated(listenerId: string, fn: (params: JLayerDynamicFilterConditionCreated) => void): void
8676
- /**
8677
- * ***JMap.Event.Layer.on.dynamicFilterConditionUpdated***
8678
- *
8679
- * This event is triggered when a condition is updated on a layer dynamic filter.
8680
- *
8681
- * @param listenerId Your listener id (must be unique for all layer events)
8682
- * @param fn Your listener function
8683
- * @example
8684
- * ```ts
8685
- * // Each time a condition is updated on a layer dynamic filter, will display a message in the console
8686
- * JMap.Event.Layer.on.dynamicFilterConditionUpdated(
8687
- * "custom-layer-dynamic-filter-condition-updated",
8688
- * params => {
8689
- * console.info(`Condition updated on layer id=${params.layerId}'s dynamic filter`, params.filter, params.condition)
8690
- * }
8691
- * )
8692
- * ```
8693
- */
8694
- function dynamicFilterConditionUpdated(listenerId: string, fn: (params: JLayerDynamicFilterConditionUpdated) => void): void
8695
- /**
8696
- * ***JMap.Event.Layer.on.dynamicFilterConditionsRemoved***
8697
- *
8698
- * This event is triggered when a condition is removed on a layer dynamic filter.
8699
- *
8700
- * @param listenerId Your listener id (must be unique for all layer events)
8701
- * @param fn Your listener function
8702
- * @example
8703
- * ```ts
8704
- * // Each time one or more conditions are removed for a layer dynamic filter, will display a message in the console
8705
- * JMap.Event.Layer.on.dynamicFilterConditionsRemoved(
8706
- * "custom-layer-dynamic-filter-conditions-removed",
8707
- * params => {
8708
- * console.info(`Condition(s) removed on layer id=${params.layerId}'s dynamic filter`, params.filter, params.conditionIds)
8709
- * }
8710
- * )
8711
- * ```
8712
- */
8713
- function dynamicFilterConditionsRemoved(listenerId: string, fn: (params: JLayerDynamicFilterConditionsRemoved) => void): void
8714
8221
  }
8715
8222
  /**
8716
8223
  * ***JMap.Event.Layer.activate***
@@ -11798,21 +11305,121 @@ export namespace JMap {
11798
11305
  * ```
11799
11306
  **/
11800
11307
  function getDataSourceAttributes(tableId: JId): Promise<JAttribute[]>
11308
+ /**
11309
+ * **JMap.Table.DynamicFilter**
11310
+ *
11311
+ * Manages table dynamic filters in the current session. Changes are included when a map
11312
+ * context is saved; they do not update server filter definitions.
11313
+ */
11314
+ namespace DynamicFilter {
11315
+ /**
11316
+ * **JMap.Table.DynamicFilter.create**
11317
+ *
11318
+ * Creates a table filter in the current session. It is active by default unless
11319
+ * `params.active` is false. The server filter definition is not changed.
11320
+ *
11321
+ * @param tableId The table ID
11322
+ * @param params A non-empty name and a parsed filter condition, with optional activation
11323
+ * @returns The new filter's UUID v4
11324
+ * @throws If the table is missing or the filter parameters are invalid
11325
+ * @example
11326
+ * ```ts
11327
+ * const filterId = JMap.Table.DynamicFilter.create(tableId, {
11328
+ * name: "Large cities",
11329
+ * filter: { id: "condition-1", op: ">", args: [{ property: "population" }, 5000] }
11330
+ * })
11331
+ * ```
11332
+ */
11333
+ function create(tableId: JId, params: JLocalDynamicFilterCreateParams): string
11334
+ /**
11335
+ * **JMap.Table.DynamicFilter.getAll**
11336
+ *
11337
+ * Returns copies of all filters for the table, including loaded and session-created filters.
11338
+ * Changing a returned object does not change the session filter.
11339
+ *
11340
+ * @param tableId The table ID
11341
+ * @returns The table's session filters
11342
+ * @throws If the table is missing
11343
+ * @example
11344
+ * ```ts
11345
+ * const filters = JMap.Table.DynamicFilter.getAll(tableId)
11346
+ * ```
11347
+ */
11348
+ function getAll(tableId: JId): JLocalDynamicFilter[]
11349
+ /**
11350
+ * **JMap.Table.DynamicFilter.getById**
11351
+ *
11352
+ * Returns a copy of one session filter. Changing the returned object does not change the filter.
11353
+ *
11354
+ * @param tableId The table ID
11355
+ * @param filterId The filter ID
11356
+ * @returns The session filter
11357
+ * @throws If the table or filter is missing
11358
+ * @example
11359
+ * ```ts
11360
+ * const filter = JMap.Table.DynamicFilter.getById(tableId, filterId)
11361
+ * ```
11362
+ */
11363
+ function getById(tableId: JId, filterId: string): JLocalDynamicFilter
11364
+ /**
11365
+ * **JMap.Table.DynamicFilter.update**
11366
+ *
11367
+ * Changes a filter's localized name, parsed condition, or activation in this session.
11368
+ * The filter ID and owning table cannot be changed. Active filters are applied to table
11369
+ * data requests.
11370
+ *
11371
+ * @param tableId The table ID
11372
+ * @param filterId The filter ID
11373
+ * @param update The fields to change: `name`, `filter`, or `active`
11374
+ * @throws If the table or filter is missing, or the update is invalid
11375
+ * @example
11376
+ * ```ts
11377
+ * JMap.Table.DynamicFilter.update(tableId, filterId, { name: "Very large cities" })
11378
+ * ```
11379
+ */
11380
+ function update(tableId: JId, filterId: string, update: JLocalDynamicFilterUpdateParams): void
11381
+ /**
11382
+ * **JMap.Table.DynamicFilter.remove**
11383
+ *
11384
+ * Removes a filter from this session. This also works for a definition loaded from the
11385
+ * server, but does not delete that server definition.
11386
+ *
11387
+ * @param tableId The table ID
11388
+ * @param filterId The filter ID
11389
+ * @throws If the table or filter is missing
11390
+ * @example
11391
+ * ```ts
11392
+ * JMap.Table.DynamicFilter.remove(tableId, filterId)
11393
+ * ```
11394
+ */
11395
+ function remove(tableId: JId, filterId: string): void
11396
+ /**
11397
+ * **JMap.Table.DynamicFilter.setIsActive**
11398
+ *
11399
+ * Activates or deactivates a session filter for table data requests.
11400
+ *
11401
+ * @param tableId The table ID
11402
+ * @param filterId The filter ID
11403
+ * @param isActive Whether the filter should be active
11404
+ * @throws If the table or filter is missing, or `isActive` is invalid
11405
+ * @example
11406
+ * ```ts
11407
+ * JMap.Table.DynamicFilter.setIsActive(tableId, filterId, false)
11408
+ * ```
11409
+ */
11410
+ function setIsActive(tableId: JId, filterId: string, isActive: boolean): void
11411
+ }
11801
11412
  /**
11802
11413
  * **JMap.Table.setDynamicFilterActive**
11803
11414
  *
11804
- * Set a particular dynamic filter active property, for a given table.
11415
+ * Activates or deactivates a session filter for table data requests.
11805
11416
  *
11806
- * @param tableId the table id
11807
- * @param filterId the filter id
11808
- * @param isActive active or not
11809
- * @throws if tableId not valid or dataSource not found
11810
- * @example
11811
- * ```ts
11812
- * // Returns datasource attributes, for table id="be4552e1-d89d-48ec-a417-7b99d14b4d7b" and filter id="dec4ae45-2274-419e-8b2f-bd6bd6a1d6d3"
11813
- * JMap.Table.setDynamicFilterActive("be4552e1-d89d-48ec-a417-7b99d14b4d7b", "dec4ae45-2274-419e-8b2f-bd6bd6a1d6d3", true)
11814
- * ```
11815
- **/
11417
+ * @deprecated Use {@link JMap.Table.DynamicFilter.setIsActive} instead. This method logs a deprecation warning.
11418
+ * @param tableId The table ID
11419
+ * @param filterId The filter ID
11420
+ * @param isActive Whether the filter should be active
11421
+ * @throws If the table or filter is missing, or `isActive` is invalid
11422
+ */
11816
11423
  function setDynamicFilterActive(tableId: JId, filterId: string, isActive: boolean): void
11817
11424
  }
11818
11425
  }
@@ -6,6 +6,7 @@ import type * as ajax from "./jmap/ajax"
6
6
  import type * as attachment from "./jmap/attachment"
7
7
  import type * as datasource from "./jmap/datasource"
8
8
  import type * as date from "./jmap/date"
9
+ import type * as dynamicfilter from "./jmap/dynamic-filter"
9
10
  import type * as extension from "./jmap/extension"
10
11
  import type * as features from "./jmap/features"
11
12
  import type * as form from "./jmap/form"
@@ -46,6 +47,9 @@ declare global {
46
47
  /** @internal */ type JTIME_UNITS = date.JTIME_UNITS
47
48
  /** @internal */ const JTIME_UNITS: typeof date.JTIME_UNITS
48
49
  /** @internal */ type JDateFormatParams = date.JDateFormatParams
50
+ /** @internal */ type JLocalDynamicFilter = dynamicfilter.JLocalDynamicFilter
51
+ /** @internal */ type JLocalDynamicFilterCreateParams = dynamicfilter.JLocalDynamicFilterCreateParams
52
+ /** @internal */ type JLocalDynamicFilterUpdateParams = dynamicfilter.JLocalDynamicFilterUpdateParams
49
53
  /** @internal */ type JExtensionEventParams = extension.JExtensionEventParams
50
54
  /** @internal */ type JExtensionServerOverride = extension.JExtensionServerOverride
51
55
  /** @internal */ type JCoreServerExtensionInfo = extension.JCoreServerExtensionInfo
@@ -127,8 +131,6 @@ declare global {
127
131
  /** @internal */ const JLAYER_STYLE_ARROW_TYPES: typeof layer.JLAYER_STYLE_ARROW_TYPES
128
132
  /** @internal */ type JLAYER_STYLE_RULE_CONDITION_EXPRESSION_OPERATORS = layer.JLAYER_STYLE_RULE_CONDITION_EXPRESSION_OPERATORS
129
133
  /** @internal */ const JLAYER_STYLE_RULE_CONDITION_EXPRESSION_OPERATORS: typeof layer.JLAYER_STYLE_RULE_CONDITION_EXPRESSION_OPERATORS
130
- /** @internal */ type JLAYER_DYNAMIC_FILTER_OPERATORS = layer.JLAYER_DYNAMIC_FILTER_OPERATORS
131
- /** @internal */ const JLAYER_DYNAMIC_FILTER_OPERATORS: typeof layer.JLAYER_DYNAMIC_FILTER_OPERATORS
132
134
  /** @internal */ type JLAYER_STYLE_LINE_CAP = layer.JLAYER_STYLE_LINE_CAP
133
135
  /** @internal */ const JLAYER_STYLE_LINE_CAP: typeof layer.JLAYER_STYLE_LINE_CAP
134
136
  /** @internal */ type JLAYER_STYLE_LINE_JOIN = layer.JLAYER_STYLE_LINE_JOIN
@@ -154,19 +156,12 @@ declare global {
154
156
  /** @internal */ type JLayerThematicEventParams = layer.JLayerThematicEventParams
155
157
  /** @internal */ type JAddMapThematicEventParams = layer.JAddMapThematicEventParams
156
158
  /** @internal */ type JLayerInitialSearchEventParams = layer.JLayerInitialSearchEventParams
157
- /** @internal */ type JLayerDynamicFilterSetParams = layer.JLayerDynamicFilterSetParams
158
159
  /** @internal */ type JLayerDynamicFilterActivationParams = layer.JLayerDynamicFilterActivationParams
159
- /** @internal */ type JLayerDynamicFilterConditionCreated = layer.JLayerDynamicFilterConditionCreated
160
- /** @internal */ type JLayerDynamicFilterConditionUpdated = layer.JLayerDynamicFilterConditionUpdated
161
- /** @internal */ type JLayerDynamicFilterConditionsRemoved = layer.JLayerDynamicFilterConditionsRemoved
162
160
  /** @internal */ type JMapEventLoadedParams = layer.JMapEventLoadedParams
163
161
  /** @internal */ type JLayerGeometry = layer.JLayerGeometry
164
162
  /** @internal */ type JLayerPermissions = layer.JLayerPermissions
165
163
  /** @internal */ type JLayerGroup = layer.JLayerGroup
166
164
  /** @internal */ type JLayer = layer.JLayer
167
- /** @internal */ type JDynamicFilter = layer.JDynamicFilter
168
- /** @internal */ type JDynamicFilterCondition = layer.JDynamicFilterCondition
169
- /** @internal */ type JDynamicFilterSetParams = layer.JDynamicFilterSetParams
170
165
  /** @internal */ type JLayerForm = layer.JLayerForm
171
166
  /** @internal */ type JLayerAttribute = layer.JLayerAttribute
172
167
  /** @internal */ type JLayerTreeElement = layer.JLayerTreeElement
@@ -219,6 +214,7 @@ declare global {
219
214
  /** @internal */ const JMAP_CONTEXT_SORT_BY_DIRECTIONS: typeof mapcontext.JMAP_CONTEXT_SORT_BY_DIRECTIONS
220
215
  /** @internal */ type JMapContextEditResponse = mapcontext.JMapContextEditResponse
221
216
  /** @internal */ type JMapContextMetaData = mapcontext.JMapContextMetaData
217
+ /** @internal */ type JMapContextDynamicFilters = mapcontext.JMapContextDynamicFilters
222
218
  /** @internal */ type JMapContextData = mapcontext.JMapContextData
223
219
  /** @internal */ type JMapContextDataLayerElement = mapcontext.JMapContextDataLayerElement
224
220
  /** @internal */ type JMapContextDataLayer = mapcontext.JMapContextDataLayer
@@ -0,0 +1,21 @@
1
+ import type { JAnyFilterCondition } from "jmapcloud-types"
2
+
3
+ /** A browser-session filter. Loaded definitions and user-created filters have the same local CRUD semantics. */
4
+ export interface JLocalDynamicFilter {
5
+ id: string
6
+ resourceId: string
7
+ /** The localized name displayed in this NG session. */
8
+ name: string
9
+ filter: JAnyFilterCondition
10
+ active: boolean
11
+ }
12
+
13
+ export interface JLocalDynamicFilterCreateParams {
14
+ name: string
15
+ filter: JAnyFilterCondition
16
+ /** Defaults to true. */
17
+ active?: boolean
18
+ }
19
+
20
+ /** Identity and resource ownership cannot be updated. */
21
+ export type JLocalDynamicFilterUpdateParams = Partial<Pick<JLocalDynamicFilter, "name" | "filter" | "active">>
@@ -1,4 +1,5 @@
1
- import type { JAnyFilterCondition, JAttribute, JDynamicFilterGraphQL, UserMetadata } from "jmapcloud-types"
1
+ import type { JLocalDynamicFilter } from "./dynamic-filter.d.ts"
2
+ import type { JAnyFilterCondition, JAttribute, UserMetadata } from "jmapcloud-types"
2
3
  import type { JBoundaryBox } from "./geometry.d.ts"
3
4
  import type { JId } from "./main.d.ts"
4
5
  import type { JMapMouseOver } from "./mouseover.d.ts"
@@ -101,26 +102,6 @@ export enum JLAYER_STYLE_RULE_CONDITION_EXPRESSION_OPERATORS {
101
102
  NOT_IN = "NOT_IN" // This operator does not yet exist in JMC
102
103
  }
103
104
 
104
- // ALL_LAYER_DYNAMIC_FILTER_OPERATORS in all-enum.ts
105
- export enum JLAYER_DYNAMIC_FILTER_OPERATORS {
106
- EQUALS = "EQUALS",
107
- NOT_EQUALS = "NOT_EQUALS",
108
- GREATER_THAN = "GREATER_THAN",
109
- GREATER_OR_EQUALS_TO = "GREATER_OR_EQUALS_TO",
110
- LESS_THAN = "LESS_THAN",
111
- LESS_OR_EQUALS_TO = "LESS_OR_EQUALS_TO",
112
- CONTAINS = "CONTAINS",
113
- NOT_CONTAINS = "NOT_CONTAINS",
114
- IS_EMPTY = "IS_EMPTY",
115
- IS_NOT_EMPTY = "IS_NOT_EMPTY",
116
- IS_NULL = "IS_NULL",
117
- IS_NOT_NULL = "IS_NOT_NULL",
118
- IS_IN_RANGE = "IS_IN_RANGE",
119
- IS_NOT_IN_RANGE = "IS_NOT_IN_RANGE",
120
- LAST = "LAST",
121
- INTERVAL = "INTERVAL"
122
- }
123
-
124
105
  // ALL_LAYER_STYLE_LINE_CAP in all-enum.ts
125
106
  export enum JLAYER_STYLE_LINE_CAP {
126
107
  BUTT = "BUTT",
@@ -239,25 +220,8 @@ export interface JLayerInitialSearchEventParams extends JLayerEventParams {
239
220
  features: GeoJSON.Feature[]
240
221
  }
241
222
 
242
- export interface JLayerDynamicFilterSetParams {
243
- filters: JDynamicFilter[]
244
- }
245
-
246
- export interface JLayerDynamicFilterActivationParams extends JLayerEventParams {}
247
-
248
- export interface JLayerDynamicFilterConditionCreated extends JLayerEventParams {
249
- filter: JDynamicFilter
250
- condition: JDynamicFilterCondition
251
- }
252
-
253
- export interface JLayerDynamicFilterConditionUpdated extends JLayerEventParams {
254
- filter: JDynamicFilter
255
- condition: JDynamicFilterCondition
256
- }
257
-
258
- export interface JLayerDynamicFilterConditionsRemoved extends JLayerEventParams {
259
- filter: JDynamicFilter
260
- conditionIds: number[]
223
+ export interface JLayerDynamicFilterActivationParams extends JLayerEventParams {
224
+ isActivation: boolean
261
225
  }
262
226
 
263
227
  export interface JMapEventLoadedParams {
@@ -298,7 +262,6 @@ export interface JLayer extends JLayerTreeElement {
298
262
  minimumZoom: number | undefined
299
263
  maximumZoom: number | undefined
300
264
  styleRules: JLayerStyleRule[]
301
- defaultStyleRule: JLayerStyleRule | undefined
302
265
  thematics: JLayerThematic[]
303
266
  extent: JBoundaryBox | null
304
267
  permissions: JLayerPermissions
@@ -313,38 +276,12 @@ export interface JLayer extends JLayerTreeElement {
313
276
  spatialDataSourceOrganizationId: string
314
277
  spatialDataSourceAttributes: JAttribute[] | null
315
278
  selectionStyleId: string
316
- // dynamicFilter: JDynamicFilter
317
- // TODO JMAP8-3266 : use a localized type instad of a graphQL one
318
- dynamicFilters: JDynamicFilterGraphQL[]
279
+ dynamicFilters: JLocalDynamicFilter[]
319
280
  allowClientSideEditing: boolean
320
281
  includeInLegend: boolean
321
282
  baseFilter?: JAnyFilterCondition
322
283
  }
323
284
 
324
- // TODO JMAP8-3266 : remove this and children
325
- export interface JDynamicFilter {
326
- layerId: JId
327
- isAvailable: boolean // false means no dynamic filter for layer, ex: IMAGE layers
328
- isActive: boolean
329
- intervalOperatorDisabled: boolean // true if layer has less than 2 date attributes
330
- conditions: JDynamicFilterCondition[]
331
- }
332
-
333
- export interface JDynamicFilterCondition {
334
- layerId: JId
335
- id: number
336
- attributeName: string
337
- endAttributeName?: string // used for INTERVAL operator
338
- filterOperator: JLAYER_DYNAMIC_FILTER_OPERATORS
339
- value: any | any[] // 2 items array for between
340
- }
341
-
342
- export interface JDynamicFilterSetParams {
343
- layerId: JId
344
- conditions: JDynamicFilterCondition[]
345
- isActive?: boolean
346
- }
347
-
348
285
  export interface JLayerForm {
349
286
  id: JId
350
287
  name: string
@@ -441,7 +378,6 @@ export interface JLayerStyleRule {
441
378
  id: string
442
379
  layerId: string
443
380
  active: boolean
444
- defaultRule: boolean
445
381
  name: string
446
382
  conditions: JLayerStyleRuleCondition[]
447
383
  }
@@ -541,7 +477,7 @@ export interface JLayerTextStyle extends JLayerBaseStyle {
541
477
  italic: boolean
542
478
  }
543
479
 
544
- export type JLayerUserStyleRule = Omit<JLayerStyleRule, "defaultRule">
480
+ export type JLayerUserStyleRule = JLayerStyleRule
545
481
 
546
482
  export type JLayerAddThematicParams = {
547
483
  layerId: JId
@@ -1,5 +1,5 @@
1
1
  import type { JLocation } from "./geometry.d.ts"
2
- import type { JDynamicFilterCondition } from "./layer.d.ts"
2
+ import type { JLocalDynamicFilter } from "./dynamic-filter.d.ts"
3
3
  import type { JId } from "./main.d.ts"
4
4
  import type { JMapSelection } from "./map.d.ts"
5
5
  export {}
@@ -41,7 +41,14 @@ export interface JMapContextMetaData {
41
41
  thumbnailUrl?: string
42
42
  }
43
43
 
44
+ /** Complete local filter lists, keyed by layer/table ID. Empty lists preserve deletions. */
45
+ export interface JMapContextDynamicFilters {
46
+ layers: Record<string, JLocalDynamicFilter[]>
47
+ tables: Record<string, JLocalDynamicFilter[]>
48
+ }
49
+
44
50
  export interface JMapContextData {
51
+ dynamicFilters: JMapContextDynamicFilters
45
52
  layerElements: JMapContextDataLayerElement[]
46
53
  mapCenter: JLocation
47
54
  mapZoom: number
@@ -64,9 +71,6 @@ export interface JMapContextDataLayerElement {
64
71
  export interface JMapContextDataLayer extends JMapContextDataLayerElement {
65
72
  selectable: boolean
66
73
  thematics: JMapContextDataThematic[]
67
- // TODO JMAP8-3266 : replace this with new dynamic filters
68
- dynamicFilterConditions: JDynamicFilterCondition[]
69
- dynamicFilterIsActive: boolean
70
74
  // Defined only when layer transparency has been explicitly overridden
71
75
  transparency?: number
72
76
  }
@@ -1,4 +1,5 @@
1
- import type { JAnyFilterCondition, JAttribute, AttributeType, JDynamicFilterGraphQL } from "jmapcloud-types"
1
+ import type { JLocalDynamicFilter } from "./dynamic-filter.d.ts"
2
+ import type { JAnyFilterCondition, JAttribute, AttributeType } from "jmapcloud-types"
2
3
  import type { JLocaleTranslation } from "./language.d.ts"
3
4
  export {}
4
5
  // ALL_TABLE_ATTRIBUTE_TYPES in all-enum.ts
@@ -28,8 +29,7 @@ export interface JTable {
28
29
  allowClientSideEditing: boolean
29
30
  permissions: JTablePermissions
30
31
  baseFilter?: JAnyFilterCondition
31
- // TODO JMAP8-3266 : use a localized type instad of a graphQL one
32
- dynamicFilters: JDynamicFilterGraphQL[]
32
+ dynamicFilters: JLocalDynamicFilter[]
33
33
  }
34
34
 
35
35
  export interface JTableAttribute {