jmapcloud-ng-core-types 1.1.35 → 1.1.37

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.d.ts CHANGED
@@ -1,8 +1,28 @@
1
+ /// <reference path="./public/global-aliases.d.ts" />
1
2
  import { Feature, FeatureCollection, LineString, MultiLineString, Point, Polygon } from "geojson"
2
- import { JForm as JFormJMC } from "jmapcloud-types"
3
+ import { JAttribute, JDataSource, JDataSourceType, JForm as JFormJMC } from "jmapcloud-types"
4
+ import type * as maplibregl from "maplibre-gl"
3
5
  import { Action, Store } from "redux"
6
+ import { JDataSourceData, JDataSourceDataParams, JDataSourcePermissions } from "./public/jmap/datasource.ts"
7
+ import type { JCoreState } from "./public/state.d.ts"
4
8
 
5
9
  export type { JCoreOptions } from "./public/jmap/startup-options.d.ts"
10
+ export type {
11
+ JCoreState,
12
+ JFormState,
13
+ JGeocodingState,
14
+ JGeolocationState,
15
+ JLanguageState,
16
+ JLayerState,
17
+ JMapContextState,
18
+ JMapState,
19
+ JProjectState,
20
+ JServerState,
21
+ JSimpleSearchState,
22
+ JTableState,
23
+ JUIState,
24
+ JUserState
25
+ } from "./public/state.d.ts"
6
26
 
7
27
  export interface JCoreService extends JCoreMainService {
8
28
  Project: JProjectService
@@ -28,6 +48,7 @@ export interface JCoreService extends JCoreMainService {
28
48
  MapContext: JMapContextService
29
49
  UI: JUIService
30
50
  SimpleSearch: JSimpleSearchService
51
+ DataSource: JDataSourceService
31
52
  Table: JTableService
32
53
  }
33
54
 
@@ -377,171 +398,6 @@ export interface JMapContextEventModule extends JEventModule {
377
398
  }
378
399
  }
379
400
 
380
- export interface JCoreState {
381
- map: JMapState
382
- project: JProjectState
383
- layer: JLayerState
384
- table: JTableState
385
- user: JUserState
386
- language: JLanguageState
387
- geocoding: JGeocodingState
388
- simpleSearch: JSimpleSearchState
389
- geolocation: JGeolocationState
390
- form: JFormState
391
- server: JServerState
392
- mapContext: JMapContextState
393
- ui: JUIState
394
- external?: any
395
- }
396
-
397
- export interface JUIState {
398
- isMainLayoutVisible: boolean
399
- iframePopup: JIFramePopup
400
- }
401
-
402
- export interface JMapContextState {
403
- isInitialized: boolean
404
- isActive: boolean
405
- isLoading: boolean
406
- hasLoadingError: boolean
407
- isApplying: boolean
408
- activeTab: JMAP_CONTEXT_TABS
409
- contexts: JMapContext[]
410
- defaultContextId: string | undefined
411
- filter: string
412
- sortBy: JMAP_CONTEXT_SORT_BY_OPTIONS
413
- sortByDirection: JMAP_CONTEXT_SORT_BY_DIRECTIONS
414
- createTitle: string
415
- createDescription: string
416
- createTitleError: boolean
417
- }
418
-
419
- export interface JFormState {
420
- layerId: JId // set as "" when no layer is set
421
- formMetaDataById: JFormMetaDataById
422
- isLoadingLayer: boolean
423
- hasLoadingLayerError: boolean
424
- isSubmitting: boolean
425
- submitErrors: string[]
426
- activeTabIndex: number
427
- attributeForm: JForm | undefined
428
- externalForms: JForm[]
429
- subForms: JForm[]
430
- }
431
-
432
- export interface JGeocodingState {
433
- isAvailable: boolean
434
- isLoadPending: boolean
435
- isLoading: boolean
436
- hasLoadingError: boolean
437
- searchString: string
438
- results: JGeocodingResult[]
439
- }
440
-
441
- export interface JSimpleSearchState {
442
- isLoadPending: boolean
443
- isLoading: boolean
444
- hasLoadingError: boolean
445
- queryString: string
446
- results: JSimpleSearchResult[]
447
- }
448
-
449
- export interface JGeolocationState {
450
- isLocationDisplayed: boolean
451
- isEnabled: boolean
452
- isSupported: boolean
453
- currentLocation: JLocation | undefined
454
- }
455
-
456
- export interface JMapState {
457
- pitch: number
458
- rotation: number
459
- bearing: number
460
- isLoaded: boolean
461
- hasFirstLoaded: boolean
462
- hasLoadingError: boolean
463
- navigationHistory: JMapNavigationStep[]
464
- center: JLocation
465
- zoom: number
466
- scale: number
467
- boundaryBox: JBoundaryBox
468
- activeBasemapId: string | undefined
469
- basemaps: JBasemap[]
470
- selection: JMapSelection
471
- jmapLayerIdsSupportedByMaplibre: JId[]
472
- scaleControlPosition: JMAP_POSITIONS
473
- distanceUnit: JMAP_DISTANCE_UNITS
474
- isNavigationHistoryControlVisible: boolean
475
- isTerrainAvailable: boolean
476
- isTerrainActive: boolean
477
- isScaleControlVisible: boolean
478
- isMapRotationControlVisible: boolean
479
- isTerrainControlVisible: boolean
480
- isMapInfoControlVisible: boolean
481
- isInfoControlExpanded: boolean
482
- defaultZoomOptions: JZoomOptions
483
- containerWidth: number
484
- containerHeight: number
485
- modificationType: JMAP_MODIFICATION_TYPES
486
- attributions: JMapAttribution[]
487
- rasterOpacityByLayerId: { [id: JId]: number }
488
- projection: JProjection
489
- }
490
-
491
- export interface JProjectState {
492
- isLoading: boolean
493
- hasLoadingError: boolean
494
- allProjects: JProject[]
495
- selectedProject: JProject
496
- disableProjectChange: boolean
497
- }
498
-
499
- export interface JLayerState {
500
- isLoading: boolean
501
- hasLoadingError: boolean
502
- metadataSchema: JLayerMetadataSchemaItem[]
503
- tree: JLayerTree
504
- styleSamplesById: JLayerStyleSamplesById
505
- allById: { [treeElementId: string]: JLayerTreeElement }
506
- orderedLayerIds: JId[]
507
- vectorLayerIds: JId[]
508
- }
509
-
510
- export interface JTableState {
511
- isLoading: boolean
512
- hasLoadingError: boolean
513
- tables: JTable[]
514
- }
515
-
516
- export interface JUserState extends JTokenInfo {
517
- isAnonymous: boolean
518
- anonymousOrganizationId: string
519
- anonymousProjectId: JId
520
- isLoggingIn: boolean
521
- isLoggingIntoOrganization: boolean
522
- isReloadingSession: boolean
523
- identity: JUser
524
- currentOrganization: JOrganization // the organization in which the user is currently logged in
525
- organizationInfos: JOrganizationInfo[] // the info about all organizations the user belongs to
526
- informations: JUserInfo[]
527
- changePasswordAllowed: boolean
528
- identityProviderType: JSERVER_IDENTITY_PROVIDER_TYPES
529
- // from portal
530
- loginStatus: LOGIN_STATUS
531
- loginStatusDetailTranslationKey: string
532
- callbackAtTokenRefresh: (() => void) | null
533
- }
534
-
535
- export interface JLanguageState {
536
- locale: JLOCALES
537
- }
538
-
539
- export interface JServerState extends JServerInfo {
540
- isReady: boolean
541
- isLoading: boolean
542
- hasLoadingError: boolean
543
- }
544
-
545
401
  export type JHistoryListener = (oldValue: string | undefined, newValue: string | undefined) => void
546
402
 
547
403
  export interface JFormJMCService {
@@ -880,7 +736,25 @@ export interface JLayerService {
880
736
  deleteLayer(layerId: JId): void
881
737
  hasInformationReport(layerId: JId): boolean
882
738
  openInformationReportInNewTab(layerId: JId, featureIds: JId[]): Promise<string>
883
- getDataSourceAttributes(layerId: JId): Promise<JDataSourceAttribute[]>
739
+ getDataSourceAttributes(layerId: JId): Promise<JAttribute[]>
740
+ }
741
+
742
+ export interface JDataSourceService {
743
+ getAttributes(dataSourceId: JId): Promise<JAttribute[]>
744
+ getById(dataSourceId: JId): Promise<JDataSource>
745
+ getData(dataSourceId: JId, params: JDataSourceDataParams, dataSourceType?: JDataSourceType): Promise<JDataSourceData>
746
+ getPermissions(dataSourceId: JId): Promise<JDataSourcePermissions>
747
+ createRow(dataSourceId: JId, row: { [key: string]: any }): Promise<{ id: JId; links: any[] }>
748
+ updateRow(dataSourceId: JId, rowId: JId, row: { [key: string]: any }): Promise<void>
749
+ deleteRow(dataSourceId: JId, rowId: JId): Promise<void>
750
+ updateFeatureProperties(
751
+ dataSourceId: JId,
752
+ featureId: JId,
753
+ properties: { [key: string]: any }
754
+ ): Promise<GeoJSON.Feature>
755
+ deleteFeature(dataSourceId: JId, featureId: JId): Promise<JId>
756
+ getFeature(dataSourceId: string, featureId: number): Promise<GeoJSON.Feature>
757
+ getRow(dataSourceId: string, rowId: number): Promise<{ [key: string]: any }>
884
758
  }
885
759
 
886
760
  export interface JTableService {
@@ -890,7 +764,7 @@ export interface JTableService {
890
764
  createRow(tableId: JId, row: { [key: string]: any }): Promise<{ id: JId; links: Array<any> }>
891
765
  updateRow(tableId: JId, rowId: number, row: { [key: string]: any }): Promise<void>
892
766
  deleteRow(tableId: JId, rowId: number): Promise<void>
893
- getDataSourceAttributes(tableId: JId): Promise<JDataSourceAttribute[]>
767
+ getDataSourceAttributes(tableId: JId): Promise<JAttribute[]>
894
768
  setDynamicFilterActive(tableId: JId, filterId: string, isActive: boolean): void
895
769
  }
896
770
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.1.35",
3
+ "version": "1.1.37",
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,5 +1,4 @@
1
- /// <reference path="./global-aliases.d.ts" />
2
-
1
+ import { JAttribute } from "jmapcloud-types"
3
2
  import type { Action, Store } from "redux"
4
3
  import type { JRequestConfig } from "./jmap/ajax.d.ts"
5
4
  import type {
@@ -8,7 +7,7 @@ import type {
8
7
  JCreateAttachmentParams,
9
8
  JUpdateAttachmentParams
10
9
  } from "./jmap/attachment.d.ts"
11
- import type { JDataSourceAttribute } from "./jmap/datasource.ts"
10
+ import type { JDataSourceData, JDataSourceDataParams, JDataSourcePermissions } from "./jmap/datasource.ts"
12
11
  import type { JDateFormatParams, JDateLike, JTIME_UNITS } from "./jmap/date.d.ts"
13
12
  import type { JCoreExtension, JExtensionEventParams, JExtensionMouseOver } from "./jmap/extension.d.ts"
14
13
  import type {
@@ -159,7 +158,6 @@ import type {
159
158
  JProjectEventParams,
160
159
  JProjectLoadThumbnailsParams
161
160
  } from "./jmap/project.d.ts"
162
- import type { JCoreState } from "../index"
163
161
  import type { JMapSelectionParams, JSelectionSetLayersSelectionParams } from "./jmap/selection.d.ts"
164
162
  import type {
165
163
  JServerAnyIdentityProvider,
@@ -178,6 +176,7 @@ import type {
178
176
  JUserEventSessionChangedParams,
179
177
  JUserInfo
180
178
  } from "./jmap/user.d.ts"
179
+ import type { JCoreState } from "./state.d.ts"
181
180
  export {}
182
181
  /**
183
182
  * This is the JMap Cloud NG Core library API documentation.
@@ -2444,7 +2443,7 @@ export namespace JMap {
2444
2443
  * .getDataSourceAttributes(3)
2445
2444
  * ```
2446
2445
  **/
2447
- function getDataSourceAttributes(layerId: JId): Promise<JDataSourceAttribute[]>
2446
+ function getDataSourceAttributes(layerId: JId): Promise<JAttribute[]>
2448
2447
  }
2449
2448
  /**
2450
2449
  * **JMap.Geometry**
@@ -9822,6 +9821,194 @@ export namespace JMap {
9822
9821
  */
9823
9822
  function previewAttachments(attachment: JAttachmentFile, dataSourceId: string): Promise<void>
9824
9823
  }
9824
+ /**
9825
+ * **JMap.DataSource**
9826
+ *
9827
+ * Here you'll find all dataSource related methods
9828
+ */
9829
+ namespace DataSource {
9830
+ /**
9831
+ * **JMap.DataSource.getAttributes**
9832
+ *
9833
+ * Returns the attributes for a given datasource.
9834
+ *
9835
+ * @param dataSourceId the datasource id
9836
+ * @throws if dataSourceId not valid or dataSource not found
9837
+ * @example
9838
+ * ```ts
9839
+ * // Returns attributes, for dataSource id="be4552e1-d89d-48ec-a417-7b99d14b4d7b"
9840
+ * JMap.DataSource.getAttributes("be4552e1-d89d-48ec-a417-7b99d14b4d7b")
9841
+ * ```
9842
+ **/
9843
+ function getAttributes(dataSourceId: JId): Promise<JAttribute[]>
9844
+
9845
+ /**
9846
+ * **JMap.DataSource.getById**
9847
+ *
9848
+ * Returns the datasource, for a given id.
9849
+ *
9850
+ * @param dataSourceId
9851
+ * @throws if dataSourceId not valid
9852
+ * @example
9853
+ * ```ts
9854
+ * // Returns dataSource, with id="be4552e1-d89d-48ec-a417-7b99d14b4d7b"
9855
+ * JMap.DataSource.getById("be4552e1-d89d-48ec-a417-7b99d14b4d7b")
9856
+ * ```
9857
+ **/
9858
+ function getById(dataSourceId: JId): Promise<any>
9859
+
9860
+ /**
9861
+ * **JMap.DataSource.getData**
9862
+ *
9863
+ * Asynchronously retrieves data for a datasource.
9864
+ *
9865
+ * @throws {Error} If no data source is found for the given ID.
9866
+ *
9867
+ * @param {JId} dataSourceId - The datasource id.
9868
+ * @param {JDataSourceDataParams} params - Includes the following optional parameters: startIndex, limit, filter, sort.
9869
+ * startIndex: The starting index for data retrieval (zero-based).
9870
+ * limit: The maximum number of records to retrieve.
9871
+ * filter: A CQL filter.
9872
+ * sort: A sort model.
9873
+ *
9874
+ * @returns {Promise<JDataSourceData>} A promise that resolves to a `JDataSourceData` object representing the dataSource data.
9875
+ *
9876
+ * @example
9877
+ * ```ts
9878
+ * // Retrieves up to 50 rows from data source ID 3, starting at index 0, sorted in ascending order based on the "ATTRIBUTE_A" attribute
9879
+ * JMap.DataSource.getData(3, {startIndex: 0, limit: 50, sort:"ATTRIBUTE_A ASC"}).then(dataSourceData => {
9880
+ * console.log(dataSourceData);
9881
+ * }).catch(error => {
9882
+ * console.error("Failed to fetch dataSource data:", error);
9883
+ * });
9884
+ * ```
9885
+ */
9886
+ function getData(dataSourceId: JId, params: JDataSourceDataParams, dataSourceType?: any): Promise<JDataSourceData>
9887
+
9888
+ /**
9889
+ * **JMap.DataSource.getPermissions**
9890
+ *
9891
+ * Returns the permissions, for a given dataSource id.
9892
+ *
9893
+ * @param dataSourceId
9894
+ * @throws if dataSourceId not valid
9895
+ * @example
9896
+ * ```ts
9897
+ * // Returns permissions for dataSource with id="be4552e1-d89d-48ec-a417-7b99d14b4d7b"
9898
+ * JMap.DataSource.getPermissions("be4552e1-d89d-48ec-a417-7b99d14b4d7b")
9899
+ * ```
9900
+ **/
9901
+ function getPermissions(dataSourceId: JId): Promise<JDataSourcePermissions>
9902
+
9903
+ /**
9904
+ * **JMap.DataSource.createRow**
9905
+ *
9906
+ * Creates a new row in a tabular datasource.
9907
+ *
9908
+ * @param dataSourceId
9909
+ * @param row
9910
+ * @example
9911
+ * ```ts
9912
+ * JMap.DataSource.createRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", { NAME: "New row" })
9913
+ * ```
9914
+ **/
9915
+ function createRow(dataSourceId: JId, row: { [key: string]: any }): Promise<{ id: JId; links: any[] }>
9916
+
9917
+ /**
9918
+ * **JMap.DataSource.updateRow**
9919
+ *
9920
+ * Updates a row in a tabular datasource.
9921
+ *
9922
+ * @param dataSourceId
9923
+ * @param rowId
9924
+ * @param row
9925
+ * @example
9926
+ * ```ts
9927
+ * JMap.DataSource.updateRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 12, { NAME: "Updated" })
9928
+ * ```
9929
+ **/
9930
+ function updateRow(dataSourceId: JId, rowId: JId, row: { [key: string]: any }): Promise<void>
9931
+
9932
+ /**
9933
+ * **JMap.DataSource.deleteRow**
9934
+ *
9935
+ * Deletes a row from a tabular datasource.
9936
+ *
9937
+ * @param dataSourceId
9938
+ * @param rowId
9939
+ * @example
9940
+ * ```ts
9941
+ * JMap.DataSource.deleteRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 12)
9942
+ * ```
9943
+ **/
9944
+ function deleteRow(dataSourceId: JId, rowId: JId): Promise<void>
9945
+
9946
+ /**
9947
+ * **JMap.DataSource.updateFeatureProperties**
9948
+ *
9949
+ * Updates properties for a feature in a spatial datasource.
9950
+ *
9951
+ * @param dataSourceId
9952
+ * @param featureId
9953
+ * @param properties
9954
+ * @example
9955
+ * ```ts
9956
+ * JMap.DataSource.updateFeatureProperties(
9957
+ * "be4552e1-d89d-48ec-a417-7b99d14b4d7b",
9958
+ * 42,
9959
+ * { NAME: "Updated" }
9960
+ * )
9961
+ * ```
9962
+ **/
9963
+ function updateFeatureProperties(
9964
+ dataSourceId: JId,
9965
+ featureId: JId,
9966
+ properties: { [key: string]: any }
9967
+ ): Promise<GeoJSON.Feature>
9968
+
9969
+ /**
9970
+ * **JMap.DataSource.deleteFeature**
9971
+ *
9972
+ * Deletes a spatial feature from a spatial datasource.
9973
+ *
9974
+ * @param dataSourceId
9975
+ * @param featureId
9976
+ * @example
9977
+ * ```ts
9978
+ * JMap.DataSource.deleteFeature("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 42)
9979
+ * ```
9980
+ **/
9981
+ function deleteFeature(dataSourceId: JId, featureId: JId): Promise<JId>
9982
+
9983
+ /**
9984
+ * **JMap.DataSource.getFeature**
9985
+ *
9986
+ * Returns a spatial feature for a datasource.
9987
+ *
9988
+ * @param dataSourceId
9989
+ * @param featureId
9990
+ * @example
9991
+ * ```ts
9992
+ * JMap.DataSource.getFeature("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 42)
9993
+ * ```
9994
+ **/
9995
+ function getFeature(dataSourceId: string, featureId: number): Promise<GeoJSON.Feature>
9996
+
9997
+ /**
9998
+ * **JMap.DataSource.getRow**
9999
+ *
10000
+ * Returns a row for a tabular datasource.
10001
+ *
10002
+ * @param dataSourceId
10003
+ * @param rowId
10004
+ * @example
10005
+ * ```ts
10006
+ * JMap.DataSource.getRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 12)
10007
+ * ```
10008
+ **/
10009
+ function getRow(dataSourceId: string, rowId: number): Promise<{ [key: string]: any }>
10010
+ }
10011
+
9825
10012
  /**
9826
10013
  * **JMap.Form**
9827
10014
  *
@@ -12169,12 +12356,13 @@ export namespace JMap {
12169
12356
  *
12170
12357
  * @throws {Error} If no data source is found for the given ID.
12171
12358
  *
12172
- * @param {JId} tableId - The ID of the JMap Table.
12359
+ * @param {JId} tableId - The ID of the JMap Table's dataSource.
12173
12360
  * @param {JTableDataParams} params - Includes the following optional parameters: startIndex, limit, filter, sort.
12174
12361
  * startIndex: The starting index for data retrieval (zero-based).
12175
12362
  * limit: The maximum number of records to retrieve.
12176
12363
  * filter: A CQL filter.
12177
12364
  * sort: A sort model.
12365
+ * columns: the name of the columns to include.
12178
12366
  *
12179
12367
  * @returns {Promise<JTableData>} A promise that resolves to a `JTableData` object representing the table data.
12180
12368
  *
@@ -12282,7 +12470,7 @@ export namespace JMap {
12282
12470
  * JMap.Table.getDataSourceAttributes("be4552e1-d89d-48ec-a417-7b99d14b4d7b")
12283
12471
  * ```
12284
12472
  **/
12285
- function getDataSourceAttributes(tableId: JId): Promise<JDataSourceAttribute[]>
12473
+ function getDataSourceAttributes(tableId: JId): Promise<JAttribute[]>
12286
12474
  /**
12287
12475
  * **JMap.Table.setDynamicFilterActive**
12288
12476
  *
@@ -39,7 +39,10 @@ declare global {
39
39
  /** @internal */ type JCreateAttachmentFileParams = attachment.JCreateAttachmentFileParams
40
40
  /** @internal */ type JCreateAttachmentParams = attachment.JCreateAttachmentParams
41
41
  /** @internal */ type JUpdateAttachmentParams = attachment.JUpdateAttachmentParams
42
- /** @internal */ type JDataSourceAttribute = datasource.JDataSourceAttribute
42
+ /** @internal */ type JDataSourceData = datasource.JDataSourceData
43
+ /** @internal */ type JDataSourceDataParams = datasource.JDataSourceDataParams
44
+ /** @internal */ type JDataSourcePermissions = datasource.JDataSourcePermissions
45
+ /** @internal */ type JDataSourcePermission = datasource.JDataSourcePermission
43
46
  /** @internal */ type JDateLike = date.JDateLike
44
47
  /** @internal */ type JTIME_UNITS = date.JTIME_UNITS
45
48
  /** @internal */ const JTIME_UNITS: typeof date.JTIME_UNITS
@@ -283,10 +286,8 @@ declare global {
283
286
  /** @internal */ type JLayerThematicSetCategoryVisibilityParams = layer.JLayerThematicSetCategoryVisibilityParams
284
287
  /** @internal */ type JLayerThematicSetConditionVisibilityParams = layer.JLayerThematicSetConditionVisibilityParams
285
288
  /** @internal */ type JLayerSetLayerGroupsExpansionParams = layer.JLayerSetLayerGroupsExpansionParams
286
- /** @internal */ type JAttribute = layer.JAttribute
287
289
  /** @internal */ type ATTRIBUTE_TYPES = layer.ATTRIBUTE_TYPES
288
290
  /** @internal */ const ATTRIBUTE_TYPES: typeof layer.ATTRIBUTE_TYPES
289
- /** @internal */ type JValueDomain = layer.JValueDomain
290
291
  /** @internal */ type JOPERATING_SYSTEMS = main.JOPERATING_SYSTEMS
291
292
  /** @internal */ const JOPERATING_SYSTEMS: typeof main.JOPERATING_SYSTEMS
292
293
  /** @internal */ type JFATAL_ERROR_CONTEXTS = main.JFATAL_ERROR_CONTEXTS
@@ -1,11 +1,31 @@
1
- import type { JLocaleTranslation } from "./language.d.ts"
2
- import type { ATTRIBUTE_TYPES, JValueDomain } from "./layer.d.ts"
3
1
  export {}
4
- export interface JDataSourceAttribute {
5
- id: string
6
- name: string
7
- type: ATTRIBUTE_TYPES
8
- indexed: boolean
9
- title: JLocaleTranslation
10
- valueDomain?: JValueDomain[]
2
+ export interface JDataSourceData {
3
+ features: GeoJSON.Feature[]
4
+ links: Array<{ href: string; rel: string; title: string; type: string }>
5
+ numberReturned: number
11
6
  }
7
+
8
+ export interface JDataSourceDataParams {
9
+ startIndex?: number
10
+ limit?: number
11
+ filter?: string
12
+ sort?: string
13
+ attributes?: string[]
14
+ }
15
+
16
+ export type JDataSourcePermissions = Array<JDataSourcePermission>
17
+
18
+ export type JDataSourcePermission =
19
+ | "OWNER"
20
+ | "VIEW"
21
+ | "MODIFY"
22
+ | "CREATE_FEATURE"
23
+ | "EXTRACT_FEATURE"
24
+ | "EDIT_FEATURE_GEOMETRY"
25
+ | "EDIT_FEATURE_ATTRIBUTES"
26
+ | "DELETE_FEATURE"
27
+ | "EXTRACT_RASTER"
28
+ | "EXTRACT_ROW"
29
+ | "CREATE_ROW"
30
+ | "EDIT_ROW"
31
+ | "DELETE_ROW"
@@ -1,8 +1,6 @@
1
- import type { JAnyFilterCondition, JDynamicFilterGraphQL } from "jmapcloud-types"
2
- import type { JDataSourceAttribute } from "./datasource.ts"
1
+ import type { JAnyFilterCondition, JAttribute, JDynamicFilterGraphQL } from "jmapcloud-types"
3
2
  import type { JFORM_TYPES } from "./form.d.ts"
4
3
  import type { JBoundaryBox } from "./geometry.d.ts"
5
- import type { JLocaleTranslation } from "./language.d.ts"
6
4
  import type { JId } from "./main.d.ts"
7
5
  import type { JMapMouseOver } from "./mouseover.d.ts"
8
6
  import type { JTable } from "./table.d.ts"
@@ -323,7 +321,7 @@ export interface JLayer extends JLayerTreeElement {
323
321
  hasInformationReport: boolean
324
322
  informationReports: JLayerInformationReport[]
325
323
  spatialDataSourceId: string
326
- spatialDataSourceAttributes: JDataSourceAttribute[] | null
324
+ spatialDataSourceAttributes: JAttribute[] | null
327
325
  selectionStyleId: string
328
326
  // dynamicFilter: JDynamicFilter
329
327
  // TODO JMAP8-3266 : use a localized type instad of a graphQL one
@@ -612,15 +610,6 @@ export interface JLayerSetLayerGroupsExpansionParams {
612
610
  open: boolean
613
611
  }
614
612
 
615
- export interface JAttribute {
616
- id: string
617
- name: string
618
- type: ATTRIBUTE_TYPES
619
- indexed: boolean
620
- title: JLocaleTranslation
621
- valueDomain?: JValueDomain[]
622
- }
623
-
624
613
  export enum ATTRIBUTE_TYPES {
625
614
  TINYINT = "TINYINT",
626
615
  SMALLINT = "SMALLINT",
@@ -640,13 +629,3 @@ export enum ATTRIBUTE_TYPES {
640
629
  ARRAY = "ARRAY",
641
630
  BOOLEAN = "BOOLEAN"
642
631
  }
643
-
644
- export type JValueDomain =
645
- | {
646
- value: string | number
647
- title: JLocaleTranslation
648
- }
649
- | {
650
- nullValue: true
651
- title: JLocaleTranslation
652
- }
@@ -1,5 +1,4 @@
1
- import type { JAnyFilterCondition, JDynamicFilterGraphQL } from "jmapcloud-types"
2
- import type { JDataSourceAttribute } from "./datasource.ts"
1
+ import type { JAnyFilterCondition, JAttribute, JAttributeType, JDynamicFilterGraphQL } from "jmapcloud-types"
3
2
  import type { JLocaleTranslation } from "./language.d.ts"
4
3
  export {}
5
4
  // ALL_TABLE_ATTRIBUTE_TYPES in all-enum.ts
@@ -21,8 +20,8 @@ export interface JTable {
21
20
  organizationId: string
22
21
  projectId: string
23
22
  name: string
24
- attributes: JTableAttribute[]
25
- dataSourceAttributes: JDataSourceAttribute[] | null
23
+ attributes: JAttribute[]
24
+ dataSourceAttributes: JAttribute[] | null
26
25
  listed: boolean
27
26
  description: JLocaleTranslation
28
27
  dataSourceId: string
@@ -38,7 +37,7 @@ export interface JTableAttribute {
38
37
  name: string
39
38
  title: string
40
39
  label: string
41
- type: JTABLE_ATTRIBUTE_TYPES
40
+ type: JAttributeType
42
41
  indexed: boolean
43
42
  }
44
43
 
@@ -59,6 +58,7 @@ export interface JTableDataParams {
59
58
  limit?: number
60
59
  filter?: JAnyFilterCondition
61
60
  sort?: string
61
+ columns?: string[]
62
62
  }
63
63
 
64
64
  export interface JTablePermissions {
@@ -0,0 +1,194 @@
1
+ import type { JForm, JFormMetaDataById } from "./jmap/form.d.ts"
2
+ import type { JGeocodingResult } from "./jmap/geocoding.d.ts"
3
+ import type { JBoundaryBox, JLocation } from "./jmap/geometry.d.ts"
4
+ import type { JLOCALES } from "./jmap/language.d.ts"
5
+ import type { JLayerMetadataSchemaItem, JLayerStyleSamplesById, JLayerTree, JLayerTreeElement } from "./jmap/layer.d.ts"
6
+ import type { JId } from "./jmap/main.d.ts"
7
+ import type {
8
+ JMAP_CONTEXT_SORT_BY_DIRECTIONS,
9
+ JMAP_CONTEXT_SORT_BY_OPTIONS,
10
+ JMAP_CONTEXT_TABS,
11
+ JMapContext
12
+ } from "./jmap/map-context.d.ts"
13
+ import type {
14
+ JBasemap,
15
+ JMAP_DISTANCE_UNITS,
16
+ JMAP_MODIFICATION_TYPES,
17
+ JMAP_POSITIONS,
18
+ JMapAttribution,
19
+ JMapNavigationStep,
20
+ JMapSelection,
21
+ JProjection,
22
+ JZoomOptions
23
+ } from "./jmap/map.d.ts"
24
+ import type { JProject } from "./jmap/project.d.ts"
25
+ import type { JSERVER_IDENTITY_PROVIDER_TYPES, JServerInfo } from "./jmap/server.d.ts"
26
+ import type { JSimpleSearchResult } from "./jmap/simple-search.d.ts"
27
+ import type { JTable } from "./jmap/table.d.ts"
28
+ import type { JIFramePopup } from "./jmap/ui.d.ts"
29
+ import type { JOrganization, JOrganizationInfo, JTokenInfo, JUser, JUserInfo, LOGIN_STATUS } from "./jmap/user.d.ts"
30
+ export {}
31
+
32
+ export interface JCoreState {
33
+ map: JMapState
34
+ project: JProjectState
35
+ layer: JLayerState
36
+ table: JTableState
37
+ user: JUserState
38
+ language: JLanguageState
39
+ geocoding: JGeocodingState
40
+ simpleSearch: JSimpleSearchState
41
+ geolocation: JGeolocationState
42
+ form: JFormState
43
+ server: JServerState
44
+ mapContext: JMapContextState
45
+ ui: JUIState
46
+ external?: any
47
+ }
48
+
49
+ export interface JUIState {
50
+ isMainLayoutVisible: boolean
51
+ iframePopup: JIFramePopup
52
+ }
53
+
54
+ export interface JMapContextState {
55
+ isInitialized: boolean
56
+ isActive: boolean
57
+ isLoading: boolean
58
+ hasLoadingError: boolean
59
+ isApplying: boolean
60
+ activeTab: JMAP_CONTEXT_TABS
61
+ contexts: JMapContext[]
62
+ defaultContextId: string | undefined
63
+ filter: string
64
+ sortBy: JMAP_CONTEXT_SORT_BY_OPTIONS
65
+ sortByDirection: JMAP_CONTEXT_SORT_BY_DIRECTIONS
66
+ createTitle: string
67
+ createDescription: string
68
+ createTitleError: boolean
69
+ }
70
+
71
+ export interface JFormState {
72
+ layerId: JId // set as "" when no layer is set
73
+ formMetaDataById: JFormMetaDataById
74
+ isLoadingLayer: boolean
75
+ hasLoadingLayerError: boolean
76
+ isSubmitting: boolean
77
+ submitErrors: string[]
78
+ activeTabIndex: number
79
+ attributeForm: JForm | undefined
80
+ externalForms: JForm[]
81
+ subForms: JForm[]
82
+ }
83
+
84
+ export interface JGeocodingState {
85
+ isAvailable: boolean
86
+ isLoadPending: boolean
87
+ isLoading: boolean
88
+ hasLoadingError: boolean
89
+ searchString: string
90
+ results: JGeocodingResult[]
91
+ }
92
+
93
+ export interface JSimpleSearchState {
94
+ isLoadPending: boolean
95
+ isLoading: boolean
96
+ hasLoadingError: boolean
97
+ queryString: string
98
+ results: JSimpleSearchResult[]
99
+ }
100
+
101
+ export interface JGeolocationState {
102
+ isLocationDisplayed: boolean
103
+ isEnabled: boolean
104
+ isSupported: boolean
105
+ currentLocation: JLocation | undefined
106
+ }
107
+
108
+ export interface JMapState {
109
+ pitch: number
110
+ rotation: number
111
+ bearing: number
112
+ isLoaded: boolean
113
+ hasFirstLoaded: boolean
114
+ hasLoadingError: boolean
115
+ navigationHistory: JMapNavigationStep[]
116
+ center: JLocation
117
+ zoom: number
118
+ scale: number
119
+ boundaryBox: JBoundaryBox
120
+ activeBasemapId: string | undefined
121
+ basemaps: JBasemap[]
122
+ selection: JMapSelection
123
+ jmapLayerIdsSupportedByMaplibre: JId[]
124
+ scaleControlPosition: JMAP_POSITIONS
125
+ distanceUnit: JMAP_DISTANCE_UNITS
126
+ isNavigationHistoryControlVisible: boolean
127
+ isTerrainAvailable: boolean
128
+ isTerrainActive: boolean
129
+ isScaleControlVisible: boolean
130
+ isMapRotationControlVisible: boolean
131
+ isTerrainControlVisible: boolean
132
+ isMapInfoControlVisible: boolean
133
+ isInfoControlExpanded: boolean
134
+ defaultZoomOptions: JZoomOptions
135
+ containerWidth: number
136
+ containerHeight: number
137
+ modificationType: JMAP_MODIFICATION_TYPES
138
+ attributions: JMapAttribution[]
139
+ rasterOpacityByLayerId: { [id: JId]: number }
140
+ projection: JProjection
141
+ }
142
+
143
+ export interface JProjectState {
144
+ isLoading: boolean
145
+ hasLoadingError: boolean
146
+ allProjects: JProject[]
147
+ selectedProject: JProject
148
+ disableProjectChange: boolean
149
+ }
150
+
151
+ export interface JLayerState {
152
+ isLoading: boolean
153
+ hasLoadingError: boolean
154
+ metadataSchema: JLayerMetadataSchemaItem[]
155
+ tree: JLayerTree
156
+ styleSamplesById: JLayerStyleSamplesById
157
+ allById: { [treeElementId: string]: JLayerTreeElement }
158
+ orderedLayerIds: JId[]
159
+ vectorLayerIds: JId[]
160
+ }
161
+
162
+ export interface JTableState {
163
+ isLoading: boolean
164
+ hasLoadingError: boolean
165
+ tables: JTable[]
166
+ }
167
+
168
+ export interface JUserState extends JTokenInfo {
169
+ isAnonymous: boolean
170
+ anonymousOrganizationId: string
171
+ anonymousProjectId: JId
172
+ isLoggingIn: boolean
173
+ isLoggingIntoOrganization: boolean
174
+ isReloadingSession: boolean
175
+ identity: JUser
176
+ currentOrganization: JOrganization
177
+ organizationInfos: JOrganizationInfo[]
178
+ informations: JUserInfo[]
179
+ changePasswordAllowed: boolean
180
+ identityProviderType: JSERVER_IDENTITY_PROVIDER_TYPES
181
+ loginStatus: LOGIN_STATUS
182
+ loginStatusDetailTranslationKey: string
183
+ callbackAtTokenRefresh: (() => void) | null
184
+ }
185
+
186
+ export interface JLanguageState {
187
+ locale: JLOCALES
188
+ }
189
+
190
+ export interface JServerState extends JServerInfo {
191
+ isReady: boolean
192
+ isLoading: boolean
193
+ hasLoadingError: boolean
194
+ }