jmapcloud-ng-core-types 1.0.33 → 1.0.36

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
@@ -26,6 +26,7 @@ export interface JCoreService extends JCoreMainService {
26
26
  MapContext: JMapContextService
27
27
  UI: JUIService
28
28
  SimpleSearch: JSimpleSearchService
29
+ Table: JTableService
29
30
  }
30
31
 
31
32
  export interface JUIService {
@@ -412,6 +413,7 @@ export interface JCoreState {
412
413
  map: JMapState
413
414
  project: JProjectState
414
415
  layer: JLayerState
416
+ table: JTableState
415
417
  user: JUserState
416
418
  language: JLanguageState
417
419
  photo: JPhotoState
@@ -538,6 +540,12 @@ export interface JLayerState {
538
540
  vectorLayerIds: JId[]
539
541
  }
540
542
 
543
+ export interface JTableState {
544
+ isLoading: boolean
545
+ hasLoadingError: boolean
546
+ tables: JTable[]
547
+ }
548
+
541
549
  export interface JPhotoState {
542
550
  selectedPhotoId: JId | undefined
543
551
  photos: JPhoto[]
@@ -577,7 +585,8 @@ export interface JServerState extends JServerInfo {
577
585
  export type JHistoryListener = (oldValue: string | undefined, newValue: string | undefined) => void
578
586
 
579
587
  export interface JFormJMCService {
580
- getJsonForm(layerId: string): JJsonFormSchemas
588
+ getJsonForm(layerId: string): any
589
+ getForm(layerId: string): any
581
590
  }
582
591
 
583
592
  export interface JFormService {
@@ -902,6 +911,11 @@ export interface JLayerService {
902
911
  openInformationReportInNewTab(layerId: JId, featureIds: JId[]): Promise<string>
903
912
  }
904
913
 
914
+ export interface JTableService {
915
+ getTables(): JTable[]
916
+ getTableData(dataSourceId: JId, params: JTableDataParams): Promise<JTableData>
917
+ }
918
+
905
919
  export interface JLayerSearchService {
906
920
  byAttribute(params: JLayerSearchByAttributesParams): Promise<Feature[]>
907
921
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.0.33",
3
+ "version": "1.0.36",
4
4
  "description": "JMap Cloud specific version of JMap Cloud NG Core types and interfaces",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -36,4 +36,4 @@
36
36
  "maplibre-gl": "^4.3.1",
37
37
  "redux": "^5.0.1"
38
38
  }
39
- }
39
+ }
package/public/core.d.ts CHANGED
@@ -10262,7 +10262,26 @@ declare namespace JMap {
10262
10262
  * .catch(error => console.error("An error occurred when getting jsonForm schema", error))
10263
10263
  * ```
10264
10264
  */
10265
- function getJsonForm(layerId: JId): JJsonFormSchemas
10265
+ function getJsonForm(layerId: JId): any
10266
+
10267
+ /**
10268
+ * ***JMap.FormJMC.getForm***
10269
+ *
10270
+ * Returns the form for a layer.
10271
+ *
10272
+ * @param layerId the JMap layer id
10273
+ * @example
10274
+ * ```ts
10275
+ * // returns the form for layer id=f47ac10b-58cc-4372-a567-0e02b2c3d479
10276
+
10277
+
10278
+ * JMap.FormJMC
10279
+ * .getForm("f47ac10b-58cc-4372-a567-0e02b2c3d479")
10280
+ * .then(form => console.log("form of layer f47ac10b-58cc-4372-a567-0e02b2c3d479", form))
10281
+ * .catch(error => console.error("An error occurred when getting the form for layer f47ac10b-58cc-4372-a567-0e02b2c3d479", error))
10282
+ * ```
10283
+ */
10284
+ function getForm(layerId: JId): any
10266
10285
  }
10267
10286
  /**
10268
10287
  * **JMap.Form**
@@ -12706,4 +12725,50 @@ declare namespace JMap {
12706
12725
  */
12707
12726
  function getContainerHeight(): number
12708
12727
  }
12728
+ namespace Table {
12729
+ /**
12730
+ * **JMap.Layer.getTables**
12731
+ *
12732
+ * Returns an array of JMap tables available in the current project.
12733
+ *
12734
+ * If no project is loaded, it returns an empty array.
12735
+ *
12736
+ * @returns {JTable[]} An array of `JTable` objects representing the tables in the current project.
12737
+ *
12738
+ * @example
12739
+ * ```ts
12740
+ * // Retrieves all JMap tables
12741
+ * JMap.Layer.getTables();
12742
+ * ```
12743
+ */
12744
+ function getTables(): JTable[]
12745
+
12746
+ /**
12747
+ * **JMap.Table.getTableData**
12748
+ *
12749
+ * Asynchronously retrieves the JMap table data for a specified tabular data source ID.
12750
+ *
12751
+ * @throws {Error} If no data source is found for the given ID.
12752
+ *
12753
+ * @param {JId} dataSourceId - The ID of the JMap data source.
12754
+ * @param {JTableDataParams} params - Includes the following optional parameters: startIndex, limit, filter, sort.
12755
+ * startIndex: The starting index for data retrieval (zero-based).
12756
+ * limit: The maximum number of records to retrieve.
12757
+ * filter: A CQL filter.
12758
+ * sort: A sort model.
12759
+ *
12760
+ * @returns {Promise<JTableData>} A promise that resolves to a `JTableData` object representing the table data.
12761
+ *
12762
+ * @example
12763
+ * ```ts
12764
+ * // Retrieves up to 50 rows from data source ID 3, starting at index 0, sorted in ascending order based on the "ATTRIBUTE_A" attribute
12765
+ * JMap.Table.getTableData(3, {startIndex: 0, limit: 50, sort:"ATTRIBUTE_A ASC"}).then(tableData => {
12766
+ * console.log(tableData);
12767
+ * }).catch(error => {
12768
+ * console.error("Failed to fetch table data:", error);
12769
+ * });
12770
+ * ```
12771
+ */
12772
+ function getTableData(dataSourceId: JId, params: JTableDataParams): Promise<JTableData>
12773
+ }
12709
12774
  }
@@ -22,7 +22,110 @@ declare interface JJsonFormControlElement {
22
22
  }
23
23
  }
24
24
 
25
+ declare interface JFormJMC {
26
+ id: string
27
+ name: any
28
+ createdBy: string
29
+ creationDate: Date
30
+ lastModifiedBy: string
31
+ lastModificationDate: Date
32
+ organizationId: string
33
+ uiSchema: FormNodeVertical
34
+ formSchema: any
35
+ tags: any[]
36
+ dataSourceId: string
37
+ }
38
+
25
39
  declare interface JJsonFormUISchema {
26
40
  type: "VerticalLayout"
27
41
  elements: JJsonFormControlElement[]
28
42
  }
43
+
44
+ interface FormNodeBase {
45
+ type: string
46
+ designComponent: string
47
+ id: string
48
+ icon: any
49
+ }
50
+
51
+ export interface FormNodeControl extends FormNodeBase {
52
+ type: "Control"
53
+ title?: string
54
+ scope: string
55
+ options: {
56
+ readonly: boolean
57
+ }
58
+ }
59
+ export interface FormNodeLabel extends FormNodeBase {
60
+ designComponent: "Label"
61
+ type: "Label"
62
+ text?: string
63
+ }
64
+
65
+ export interface FormNodeText extends FormNodeControl {
66
+ designComponent: "Text"
67
+ options: FormNodeControl["options"] & {
68
+ multi: boolean
69
+ }
70
+ }
71
+ export interface FormNodeNumber extends FormNodeControl {
72
+ designComponent: "Number"
73
+ options: FormNodeControl["options"] & {
74
+ slider: boolean
75
+ }
76
+ }
77
+ export interface FormNodeBoolean extends FormNodeControl {
78
+ designComponent: "Boolean"
79
+ options: FormNodeControl["options"] & {
80
+ toggle: boolean
81
+ asBoolean: boolean
82
+ checkedValue: string | number
83
+ uncheckedValue: string | number
84
+ }
85
+ }
86
+ export interface FormNodeDate extends FormNodeControl {
87
+ designComponent: "Date"
88
+ }
89
+ export interface FormNodeList extends FormNodeControl {
90
+ designComponent: "List"
91
+ options: FormNodeControl["options"] & {
92
+ format?: string
93
+ }
94
+ }
95
+
96
+ export interface FormNodeLayout extends FormNodeBase {
97
+ type: string
98
+ elements: FormNode[]
99
+ }
100
+
101
+ export interface FormNodeVertical extends FormNodeLayout {
102
+ type: "VerticalLayout"
103
+ designComponent: "VerticalLayout"
104
+ isRoot?: boolean
105
+ }
106
+
107
+ export interface FormNodeHorizontal extends FormNodeLayout {
108
+ type: "HorizontalLayout"
109
+ designComponent: "HorizontalLayout"
110
+ }
111
+ export interface FormNodeGroup extends FormNodeLayout {
112
+ type: "Group"
113
+ designComponent: "Group"
114
+ label?: string
115
+ }
116
+
117
+ export interface FormNodeTabs extends FormNodeLayout {
118
+ type: "Categorization"
119
+ designComponent: "Tabs"
120
+ }
121
+
122
+ export interface FormNodeTab extends FormNodeLayout {
123
+ type: "Category"
124
+ designComponent: "Category"
125
+ label?: string
126
+ }
127
+
128
+ export type FormNodesControl = FormNodeText | FormNodeNumber | FormNodeBoolean | FormNodeDate | FormNodeList
129
+ export type FormNodesLayout = FormNodeVertical | FormNodeHorizontal | FormNodeGroup | FormNodeTabs | FormNodeTab
130
+
131
+ export type FormNode = FormNodesControl | FormNodesLayout | FormNodeLabel
@@ -0,0 +1,23 @@
1
+ declare interface JTable {
2
+ id: string
3
+ organizationId: string
4
+ projectId: string
5
+ name: JLocaleTranslation
6
+ description: JLocaleTranslation
7
+ dataSourceId: string
8
+ allowClientSideEditing: boolean
9
+ }
10
+
11
+ declare interface JTableData {
12
+ columns: string[]
13
+ links: Array<{ href: string; rel: string; title: string; type: string }>
14
+ numberReturned: number
15
+ rows: []
16
+ }
17
+
18
+ declare interface JTableDataParams {
19
+ startIndex?: number
20
+ limit?: number
21
+ filter?: string
22
+ sort?: string
23
+ }