jmapcloud-ng-core-types 1.0.52 → 1.0.54

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/index.ts CHANGED
@@ -14,7 +14,6 @@ export interface JCoreService extends JCoreMainService {
14
14
  MouseOver: JMouseOverService
15
15
  Form: JFormService
16
16
  FormJMC: JFormJMCService
17
- Query: JQueryService
18
17
  Event: JEventService
19
18
  History: JHistoryService
20
19
  Extension: JExtensionService
@@ -184,17 +183,6 @@ export interface JGeolocationService {
184
183
  goToMyLocation(options?: JPanAndZoomOptions): Promise<JLocation>
185
184
  }
186
185
 
187
- export interface JQueryService {
188
- getAllGroups(): JQueryGroup[]
189
- groupExist(groupId: JId): boolean
190
- getQueriesByLayerId(layerId: JId): JQuery[]
191
- getQueryByLayerId(layerId: JId, queryId: string): JQuery
192
- getQueriesByGroupId(groupId: JId): JQuery[]
193
- getQueryByGroupId(groupId: JId, queryId: string): JQuery
194
- queryExist(groupId: JId, queryId: string): boolean
195
- fetchFeatures(layerId: JId, queryId: string, data: any): Promise<Feature[]>
196
- }
197
-
198
186
  export interface JAjaxService {
199
187
  get(config: JRequestConfig): Promise<any>
200
188
  post(config: JRequestConfig): Promise<any>
@@ -219,7 +207,6 @@ export interface JEventService {
219
207
  MouseOver: JMouseOverEventModule
220
208
  MapContext: JMapContextEventModule
221
209
  Server: JServerEventModule
222
- Query: JQueryEventModule
223
210
  }
224
211
 
225
212
  export type JEventFunction = (params?: any) => void | Promise<any>
@@ -245,15 +232,6 @@ export interface JEventModule {
245
232
  remove(listenerId: string): void
246
233
  }
247
234
 
248
- export interface JQueryEventModule extends JEventModule {
249
- on: {
250
- queryFormLoad(listenerId: string, fn: (params: JQueryQueryFormHasLoadedEventParams) => void): void
251
- beforeSubmit(listenerId: string, fn: (params: JQueryBeforeEventParams) => void): void
252
- success(listenerId: string, fn: (params: JQuerySuccessEventParams) => void): void
253
- error(listenerId: string, fn: (params: JQueryErrorEventParams) => void): void
254
- }
255
- }
256
-
257
235
  export interface JServerEventModule extends JEventModule {
258
236
  on: {
259
237
  infoReady(listenerId: string, fn: (params: JServerInfoReadyEventParams) => void): void
@@ -418,7 +396,6 @@ export interface JCoreState {
418
396
  user: JUserState
419
397
  language: JLanguageState
420
398
  photo: JPhotoState
421
- query: JQueryState
422
399
  geocoding: JGeocodingState
423
400
  simpleSearch: JSimpleSearchState
424
401
  geolocation: JGeolocationState
@@ -557,11 +534,6 @@ export interface JPhotoState {
557
534
  isDownloading: boolean
558
535
  }
559
536
 
560
- export interface JQueryState {
561
- groups: JQueryGroup[]
562
- queriesByLayerId: { [key in JId]: JQuery[] }
563
- }
564
-
565
537
  export interface JUserState extends JTokenInfo {
566
538
  isAnonymous: boolean
567
539
  anonymousOrganizationId: string
@@ -920,6 +892,7 @@ export interface JLayerService {
920
892
  deleteLayer(layerId: JId): void
921
893
  hasInformationReport(layerId: JId): boolean
922
894
  openInformationReportInNewTab(layerId: JId, featureIds: JId[]): Promise<string>
895
+ getDataSourceAttributes(dataSourceId: JId): Promise<JAttribute[]>
923
896
  }
924
897
 
925
898
  export interface JTableService {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.0.52",
3
+ "version": "1.0.54",
4
4
  "description": "JMap Cloud specific version of JMap Cloud NG Core types and interfaces",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/public/core.d.ts CHANGED
@@ -2417,6 +2417,22 @@ declare namespace JMap {
2417
2417
  * ```
2418
2418
  **/
2419
2419
  function openInformationReportInNewTab(layerId: JId, featureIds: JId[]): Promise<string>
2420
+
2421
+ /**
2422
+ * **JMap.Layer.getDataSourceAttributes**
2423
+ *
2424
+ * Returns attributes, for a given dataSource.
2425
+ *
2426
+ * @param dataSourceId the JMap dataSource id
2427
+ * @throws if dataSourceId not valid or dataSource not found
2428
+ * @example
2429
+ * ```ts
2430
+ * // Returns attributes, for dataSource id=3
2431
+ * JMap.Layer
2432
+ * .getDataSourceAttributes(3)
2433
+ * ```
2434
+ **/
2435
+ function getDataSourceAttributes(dataSourceId: JId): Promise<JAttribute[]>
2420
2436
  }
2421
2437
 
2422
2438
  /**
@@ -7114,170 +7130,6 @@ declare namespace JMap {
7114
7130
  function getInvalidQueryStringCharacters(): string
7115
7131
  }
7116
7132
 
7117
- /**
7118
- * **JMap.Query**
7119
- *
7120
- * A feature query mecanism has been set in JMap to get filtered features.
7121
- *
7122
- * By example we can get all features that have an attribute equals to a given value.
7123
- *
7124
- * A query concerns a single layer, and it set a data form that will be filled by users to make a search.
7125
- *
7126
- * For a given project, a JMap administrator can create query groups and put inside
7127
- * all queries he wants, not depending on a particular layers.
7128
- *
7129
- * You can get queries definitions (including the form definition) and process a query from this section.
7130
- */
7131
- namespace Query {
7132
- /**
7133
- * ***JMap.Query.initializeQueryFormById***
7134
- *
7135
- * By default attribute query forms are not fetched from server, because sometime it takes too much time.
7136
- *
7137
- * This method will fetch the query form.
7138
- *
7139
- * @param layerId the JMap layer id
7140
- * @param queryId the query id
7141
- * @example
7142
- * ```ts
7143
- * // initializes query id="layers/2/attribute-queries/3" form of layer id=2, then returns the filled query
7144
- * JMap.Query.initializeQueryFormById(2, "layers/2/attribute-queries/3")
7145
- * .then(query => console.log("Query form has been loaded", query))
7146
- * .catch(error => console.error("An error occured while loading query id='layers/2/attribute-queries/3'"))
7147
- * ```
7148
- */
7149
- function initializeQueryFormById(layerId: JId, queryId: string): Promise<JQuery>
7150
-
7151
- /**
7152
- * ***JMap.Query.getAllGroups***
7153
- *
7154
- * Returns all query groups defined by JMap administrator.
7155
- *
7156
- * @example
7157
- * ```ts
7158
- * // returns all query groups defined by JMap administrator
7159
- * JMap.Query.getAllGroups()
7160
- * ```
7161
- */
7162
- function getAllGroups(): JQueryGroup[]
7163
-
7164
- /**
7165
- * ***JMap.Query.groupExist***
7166
- *
7167
- * Returns true if group exists, else false, for the given group id.
7168
- *
7169
- * @throws if group id is not correct (invalid format or no resource exists)
7170
- * @param groupId The JMap query group id
7171
- * @example
7172
- * ```ts
7173
- * // returns true if group exists
7174
- * JMap.Query.groupExist(21)
7175
- * ```
7176
- */
7177
- function groupExist(groupId: JId): boolean
7178
-
7179
- /**
7180
- * ***JMap.Query.queryExist***
7181
- *
7182
- * Returns true if the query exists for a given query group and a given query id.
7183
- *
7184
- * @param groupId The JMap query group id
7185
- * @param queryId The JMap query id
7186
- * @example
7187
- * ```ts
7188
- * // returns true if query id=5 of group id=10 exists
7189
- * JMap.Query.queryExist(10, 5)
7190
- * ```
7191
- */
7192
- function queryExist(groupId: JId, queryId: string): boolean
7193
-
7194
- /**
7195
- * ***JMap.Query.getQueriesByLayerId***
7196
- *
7197
- * Returns all queries defined for a given layer id.
7198
- *
7199
- * @param layerId The JMap layer id
7200
- * @throws if layer id is not correct (invalid format or no resource exists)
7201
- * @example
7202
- * ```ts
7203
- * // returns all queries of layer id=12
7204
- * JMap.Query.getQueriesByLayerId(12)
7205
- * ```
7206
- */
7207
- function getQueriesByLayerId(layerId: JId): JQuery[]
7208
-
7209
- /**
7210
- * ***JMap.Query.getQueryByLayerId***
7211
- *
7212
- * Returns a query for a given query id, and a given layer id.
7213
- *
7214
- * @throws if layer or query ids are not correct (invalid format or no resource exists)
7215
- * @param layerId The JMap layer id
7216
- * @param queryId The JMap query id
7217
- * @example
7218
- * ```ts
7219
- * // returns query id=3 of layer id=12
7220
- * JMap.Query.getQueryByLayerId(12, 3)
7221
- * ```
7222
- */
7223
- function getQueryByLayerId(layerId: JId, queryId: string): JQuery
7224
-
7225
- /**
7226
- * ***JMap.Query.getQueriesByGroupId***
7227
- *
7228
- * Returns all queries for a given query group id.
7229
- *
7230
- * @throws if group id is not correct (invalid format or no resource exists)
7231
- * @param groupId The JMap query group id
7232
- * @example
7233
- * ```ts
7234
- * // returns all queries of group id=10
7235
- * JMap.Query.getQueriesByGroupId(10)
7236
- * ```
7237
- */
7238
- function getQueriesByGroupId(groupId: JId): JQuery[]
7239
-
7240
- /**
7241
- * ***JMap.Query.getQueryByGroupId***
7242
- *
7243
- * Returns the query for a given query group and a given query id.
7244
- *
7245
- * @throws if group or query ids are not correct (invalid format or no resource exists)
7246
- * @param groupId The JMap query group id
7247
- * @param queryId The JMap query id
7248
- * @example
7249
- * ```ts
7250
- * // returns the query id=5 of group id=10
7251
- * JMap.Query.getQueryByGroupId(10, 5)
7252
- * ```
7253
- */
7254
- function getQueryByGroupId(groupId: JId, queryId: string): JQuery
7255
-
7256
- /**
7257
- * ***JMap.Query.fetchFeatures***
7258
- *
7259
- * Process a query request to the JMap server, for given layer and query ids, and provided form data
7260
- *
7261
- * @throws if group or query ids are not correct (invalid format or no resource exists)
7262
- * @param layerId The JMap layer id
7263
- * @param queryId The JMap query id
7264
- * @param data The form data (values mapping the query form definition)
7265
- * @example
7266
- * ```ts
7267
- * // returns a promise that when resolved returns the result of the search,
7268
- * // an array of features, for layer id=3 and query id=5.
7269
- * JMap.Query
7270
- * .fetchFeatures(3, 5, {
7271
- * "$PARAM1": "test",
7272
- * "$PARAM2": 35
7273
- * })
7274
- * .then(features => console.info(`Found ${features.length} features.`))
7275
- * .catch(error => console.error("Error while processing query request.", error))
7276
- * ```
7277
- */
7278
- function fetchFeatures(layerId: JId, queryId: string, data: any): Promise<any[]> // features
7279
- }
7280
-
7281
7133
  /**
7282
7134
  * **JMap.Event**
7283
7135
  *
@@ -7423,150 +7275,6 @@ declare namespace JMap {
7423
7275
  function remove(listenerId: string): void
7424
7276
  }
7425
7277
 
7426
- /**
7427
- * ***JMap.Event.Query***
7428
- *
7429
- * Here you can manage all query event listeners.
7430
- *
7431
- * Click to see all events available: ***{@link JMap.Event.Query.on}***.
7432
- */
7433
- namespace Query {
7434
- /**
7435
- * ***JMap.Event.Query.on***
7436
- *
7437
- * Here you have all JMap Cloud NG Core query events on which you can attach a listener.
7438
- */
7439
- namespace on {
7440
- /**
7441
- * ***JMap.Event.Query.on.queryFormLoad***
7442
- *
7443
- * This event is triggered when a query form has been loaded.
7444
- *
7445
- * @param listenerId Your listener id (must be unique)
7446
- * @param fn Your listener function
7447
- * @example
7448
- * ```ts
7449
- * // log a message in the console once a query form has been fetched from server.
7450
- * JMap.Event.Query.on.queryFormLoad(
7451
- * "custom-query-form-load",
7452
- * params => console.log("A query form has been loaded from server", params.query)
7453
- * )
7454
- * ```
7455
- */
7456
- function queryFormLoad(listenerId: string, fn: (params: JQueryQueryFormHasLoadedEventParams) => void): void
7457
-
7458
- /**
7459
- * ***JMap.Event.Query.on.beforeSubmit***
7460
- *
7461
- * This event is triggered when a query is submitted, before the call to the server is made.
7462
- *
7463
- * @param listenerId Your listener id (must be unique)
7464
- * @param fn Your listener function
7465
- * @example
7466
- * ```ts
7467
- * // log a message in the console once the button submit is clicked.
7468
- * JMap.Event.Query.on.beforeSubmit(
7469
- * "custom-query-before-submit",
7470
- * params => console.log("A query to the server will be done", params)
7471
- * )
7472
- * ```
7473
- */
7474
- function beforeSubmit(listenerId: string, fn: (params: JQueryBeforeEventParams) => void): void
7475
-
7476
- /**
7477
- * ***JMap.Event.Query.on.success***
7478
- *
7479
- * This event is triggered when a query has been processed, after the call to the server has been made.
7480
- *
7481
- * @param listenerId Your listener id (must be unique)
7482
- * @param fn Your listener function
7483
- * @example
7484
- * ```ts
7485
- * // log a message in the console once the server has responded
7486
- * JMap.Event.Query.on.success(
7487
- * "custom-query-success",
7488
- * params => console.log("A query to the server has been done", params)
7489
- * )
7490
- * ```
7491
- */
7492
- function success(listenerId: string, fn: (params: JQuerySuccessEventParams) => void): void
7493
-
7494
- /**
7495
- * ***JMap.Event.Query.on.error***
7496
- *
7497
- * This event is triggered when a query has been processed, but an error occured.
7498
- *
7499
- * If the max result limit is reach, an error is thrown, and this event is triggered.
7500
- *
7501
- * @param listenerId Your listener id (must be unique)
7502
- * @param fn Your listener function
7503
- * @example
7504
- * ```ts
7505
- * // log a message in the console if a query error occured
7506
- * JMap.Event.Query.on.error(
7507
- * "custom-query-error",
7508
- * params => console.log("A query to the server has failed", params)
7509
- * )
7510
- * ```
7511
- */
7512
- function error(listenerId: string, fn: (params: JQueryErrorEventParams) => void): void
7513
- }
7514
-
7515
- /**
7516
- * ***JMap.Event.Query.activate***
7517
- *
7518
- * Activate the listener.
7519
- *
7520
- * If the listener is already active, do nothing.
7521
- *
7522
- * If the listener is inactive, it will be reactivated and will be called again ...
7523
- *
7524
- * @param listenerId The listener id
7525
- * @example
7526
- * ```ts
7527
- * // activate the listener "my-query-listener"
7528
- * JMap.Event.Query.activate("my-query-listener")
7529
- * ```
7530
- */
7531
- function activate(listenerId: string): void
7532
-
7533
- /**
7534
- * ***JMap.Event.Query.deactivate***
7535
- *
7536
- * Deactivate the listener.
7537
- *
7538
- * If the listener id doesn't exists or if the listener is already inactive, do nothing.
7539
- *
7540
- * If the listener is active, it will be deactivated and will be ignored ...
7541
- *
7542
- * @param listenerId The listener id
7543
- * @example
7544
- * ```ts
7545
- * // deactivate the listener "my-query-listener"
7546
- * JMap.Event.Query.deactivate("my-query-listener")
7547
- * ```
7548
- */
7549
- function deactivate(listenerId: string): void
7550
-
7551
- /**
7552
- * ***JMap.Event.Query.remove***
7553
- *
7554
- * Remove the listener.
7555
- *
7556
- * If the listener doesn't exist, do nothing.
7557
- *
7558
- * Remove the listener from JMap Cloud NG Core library. The listener is deleted and never called again after that.
7559
- *
7560
- * @param listenerId The listener id
7561
- * @example
7562
- * ```ts
7563
- * // remove the listener "my-query-listener"
7564
- * JMap.Event.Query.remove("my-query-listener")
7565
- * ```
7566
- */
7567
- function remove(listenerId: string): void
7568
- }
7569
-
7570
7278
  /**
7571
7279
  * ***JMap.Event.Geocoding***
7572
7280
  *
@@ -18,7 +18,7 @@ declare interface JFormSchemaPropertyJMC {
18
18
  default?: any
19
19
  minimum?: number
20
20
  maximum?: number
21
- enum?: any[]
21
+ oneOf?: Array<{ const: string; title: string }>
22
22
  }
23
23
 
24
24
  declare const enum FORMSCHEMA_TYPES {
@@ -104,6 +104,7 @@ declare interface FormNodeVertical extends FormNodeLayout {
104
104
  type: "VerticalLayout"
105
105
  designComponent: "VerticalLayout"
106
106
  isRoot?: boolean
107
+ translations?: JFormTranslations
107
108
  }
108
109
 
109
110
  declare interface FormNodeHorizontal extends FormNodeLayout {
@@ -131,3 +132,7 @@ declare type FormNodesControl = FormNodeText | FormNodeNumber | FormNodeBoolean
131
132
  declare type FormNodesLayout = FormNodeVertical | FormNodeHorizontal | FormNodeGroup | FormNodeTabs | FormNodeTab
132
133
 
133
134
  declare type FormNode = FormNodesControl | FormNodesLayout | FormNodeLabel
135
+
136
+ declare type JFormTranslations = {
137
+ [L in JLOCALES]: Record<string, string>
138
+ }
@@ -302,7 +302,6 @@ declare interface JLayer extends JLayerTreeElement {
302
302
  styleRules: JLayerStyleRule[]
303
303
  defaultStyleRule: JLayerStyleRule | undefined
304
304
  thematics: JLayerThematic[]
305
- queries: JQuery[]
306
305
  extent: JBoundaryBox | null
307
306
  permissions: JLayerPermissions
308
307
  hasAttributeForm: boolean
@@ -599,3 +598,38 @@ declare interface JLayerSetLayerGroupsExpansionParams {
599
598
  layerGroupId: JId
600
599
  open: boolean
601
600
  }
601
+
602
+ declare interface JAttribute {
603
+ id: string
604
+ name: string
605
+ type: ATTRIBUTE_TYPES
606
+ indexed: boolean
607
+ title: JLocaleTranslation
608
+ valueDomain?: JValueDomain[]
609
+ }
610
+
611
+ declare enum ATTRIBUTE_TYPES {
612
+ TINYINT = "TINYINT",
613
+ SMALLINT = "SMALLINT",
614
+ INTEGER = "INTEGER",
615
+ BIGINT = "BIGINT",
616
+ FLOAT = "FLOAT",
617
+ REAL = "REAL",
618
+ DOUBLE = "DOUBLE",
619
+ NUMERIC = "NUMERIC",
620
+ DECIMAL = "DECIMAL",
621
+ CHAR = "CHAR",
622
+ VARCHAR = "VARCHAR",
623
+ LONGVARCHAR = "LONGVARCHAR",
624
+ DATE = "DATE",
625
+ TIME = "TIME",
626
+ TIMESTAMP = "TIMESTAMP",
627
+ ARRAY = "ARRAY",
628
+ BOOLEAN = "BOOLEAN"
629
+ }
630
+
631
+ declare interface JValueDomain {
632
+ value?: any
633
+ nullValue?: boolean
634
+ title: JLocaleTranslation
635
+ }
@@ -42,7 +42,6 @@ declare interface JProject {
42
42
  bing: string | null
43
43
  mapBox: string | null
44
44
  }
45
- queryGroups: JQueryGroup[]
46
45
  defaultDistanceUnit: JMAP_DISTANCE_UNITS
47
46
  base64ImageThumbnail: string
48
47
  extensions: JProjectServerExtension[]
@@ -1,47 +0,0 @@
1
- /**
2
- * @deprecated
3
- */
4
- declare interface JQueryGroup {
5
- id: JId
6
- name: string
7
- queries: JQuery[]
8
- }
9
-
10
- /**
11
- * @deprecated
12
- */
13
- declare interface JQuery {
14
- id: string // unique id, set by NG
15
- jmapId: JId // non unique id, set by server, used to fetch query form (associate to layer id)
16
- groupId: JId
17
- name: string
18
- layerId: JId
19
- maxScale: number
20
- maxResults: number
21
- isInitialized: boolean
22
- isLoading: boolean
23
- hasLoadingError: boolean
24
- formMetaData: JFormMetaData
25
- }
26
-
27
- declare interface JQueryBeforeEventParams {
28
- id: string
29
- groupId: string
30
- name: string
31
- layerId: JId
32
- maxScale: number
33
- maxResults: number
34
- enteredData: any
35
- }
36
-
37
- declare interface JQuerySuccessEventParams extends JQueryBeforeEventParams {
38
- returnedFeatures: GeoJSON.Feature[]
39
- }
40
-
41
- declare interface JQueryErrorEventParams extends JQueryBeforeEventParams {
42
- error: string
43
- }
44
-
45
- declare interface JQueryQueryFormHasLoadedEventParams {
46
- query: JQuery
47
- }