jmapcloud-ng-core-types 1.1.11 → 1.1.13

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
@@ -314,3 +314,12 @@ export const ALL_ROLES: ROLES[] = [
314
314
  ]
315
315
 
316
316
  export const ALL_MEMBER_ROLES: MEMBER_ROLES[] = [ROLES.ORG_ADMIN, ROLES.ORG_EDITOR, ROLES.ORG_VIEWER]
317
+
318
+ export const ALL_TABLE_ATTRIBUTE_TYPES: JTABLE_ATTRIBUTE_TYPES[] = [
319
+ JTABLE_ATTRIBUTE_TYPES.BINARY,
320
+ JTABLE_ATTRIBUTE_TYPES.BOOLEAN,
321
+ JTABLE_ATTRIBUTE_TYPES.DATE,
322
+ JTABLE_ATTRIBUTE_TYPES.DATETIME,
323
+ JTABLE_ATTRIBUTE_TYPES.NUMBER,
324
+ JTABLE_ATTRIBUTE_TYPES.STRING
325
+ ]
package/index.ts CHANGED
@@ -146,7 +146,7 @@ export interface JPhotoService {
146
146
  }
147
147
 
148
148
  export interface JFeatureService {
149
- getById(layerId: JId, featureId: JId): Promise<GeoJSON.Feature>
149
+ getById(layerId: JId, featureId: JId, includeAllAttributes?: boolean): Promise<GeoJSON.Feature>
150
150
  getByIds(layerId: JId, featureIds: JId[]): Promise<GeoJSON.Feature[]>
151
151
  getByLayerId(layerId: JId, bbox: JBoundaryBox): Promise<GeoJSON.Feature[]>
152
152
  geometryUpdateById(params: JFeatureGeometryUpdateParams): Promise<GeoJSON.Feature>
@@ -891,16 +891,17 @@ export interface JLayerService {
891
891
  deleteLayer(layerId: JId): void
892
892
  hasInformationReport(layerId: JId): boolean
893
893
  openInformationReportInNewTab(layerId: JId, featureIds: JId[]): Promise<string>
894
- getDataSourceAttributes(dataSourceId: JId): Promise<JAttribute[]>
894
+ getDataSourceAttributes(layerId: JId): Promise<JDataSourceAttribute[]>
895
895
  }
896
896
 
897
897
  export interface JTableService {
898
898
  getTables(): JTable[]
899
- getTableData(dataSourceId: JId, params: JTableDataParams): Promise<JTableData>
899
+ getTableData(tableId: JId, params: JTableDataParams): Promise<JTableData>
900
900
  getById(tableId: JId): JTable
901
- createRow(dataSourceId: JId, row: { [key: string]: any }): Promise<void>
902
- updateRow(dataSourceId: JId, rowId: number, row: { [key: string]: any }): Promise<void>
903
- deleteRow(dataSourceId: JId, rowId: number): Promise<void>
901
+ createRow(tableId: JId, row: { [key: string]: any }): Promise<void>
902
+ updateRow(tableId: JId, rowId: number, row: { [key: string]: any }): Promise<void>
903
+ deleteRow(tableId: JId, rowId: number): Promise<void>
904
+ getDataSourceAttributes(tableId: JId): Promise<JDataSourceAttribute[]>
904
905
  }
905
906
 
906
907
  export interface JLayerSearchService {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
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
@@ -443,6 +443,7 @@ declare namespace JMap {
443
443
  *
444
444
  * @param layerId the JMap layer id
445
445
  * @param featureId the JMap feature id
446
+ * @param includeAllAttributes true to include all the attributes even the one not bounded to the layer
446
447
  * @throws if layer or feature not found
447
448
  * @example
448
449
  * ```ts
@@ -453,7 +454,7 @@ declare namespace JMap {
453
454
  * .catch(error => console.error("An error occured", error))
454
455
  * ```
455
456
  */
456
- function getById(layerId: JId, featureId: JId): Promise<GeoJSON.Feature>
457
+ function getById(layerId: JId, featureId: JId, includeAllAttributes?: boolean): Promise<GeoJSON.Feature>
457
458
 
458
459
  /**
459
460
  * **JMap.Feature.getByLayerId**
@@ -2421,18 +2422,18 @@ declare namespace JMap {
2421
2422
  /**
2422
2423
  * **JMap.Layer.getDataSourceAttributes**
2423
2424
  *
2424
- * Returns attributes, for a given dataSource.
2425
+ * Returns the attributes of the associated datasource, for a given layer.
2425
2426
  *
2426
- * @param dataSourceId the JMap dataSource id
2427
- * @throws if dataSourceId not valid or dataSource not found
2427
+ * @param layerId the JMap layer id
2428
+ * @throws if layerId not valid or dataSource not found
2428
2429
  * @example
2429
2430
  * ```ts
2430
- * // Returns attributes, for dataSource id=3
2431
+ * // Returns datasource attributes, for layer id=3
2431
2432
  * JMap.Layer
2432
2433
  * .getDataSourceAttributes(3)
2433
2434
  * ```
2434
2435
  **/
2435
- function getDataSourceAttributes(dataSourceId: JId): Promise<JAttribute[]>
2436
+ function getDataSourceAttributes(layerId: JId): Promise<JDataSourceAttribute[]>
2436
2437
  }
2437
2438
 
2438
2439
  /**
@@ -5745,8 +5746,8 @@ declare namespace JMap {
5745
5746
  * .getAllProjects()
5746
5747
  * .then(projects => {
5747
5748
  * // Here you can start using the projects
5748
- * console.log(`Projects count = "${projects.length}"`
5749
- * }))
5749
+ * console.log(`Projects count = "${projects.length}"`)
5750
+ * })
5750
5751
  * ```
5751
5752
  */
5752
5753
  function getAllProjects(): Promise<JProject[]>
@@ -12472,11 +12473,11 @@ declare namespace JMap {
12472
12473
  /**
12473
12474
  * **JMap.Table.getTableData**
12474
12475
  *
12475
- * Asynchronously retrieves the JMap table data for a specified tabular data source ID.
12476
+ * Asynchronously retrieves the JMap table data for a specified ID.
12476
12477
  *
12477
12478
  * @throws {Error} If no data source is found for the given ID.
12478
12479
  *
12479
- * @param {JId} dataSourceId - The ID of the JMap data source.
12480
+ * @param {JId} tableId - The ID of the JMap Table.
12480
12481
  * @param {JTableDataParams} params - Includes the following optional parameters: startIndex, limit, filter, sort.
12481
12482
  * startIndex: The starting index for data retrieval (zero-based).
12482
12483
  * limit: The maximum number of records to retrieve.
@@ -12495,7 +12496,7 @@ declare namespace JMap {
12495
12496
  * });
12496
12497
  * ```
12497
12498
  */
12498
- function getTableData(dataSourceId: JId, params: JTableDataParams): Promise<JTableData>
12499
+ function getTableData(tableId: JId, params: JTableDataParams): Promise<JTableData>
12499
12500
 
12500
12501
  /**
12501
12502
  * **JMap.Table.getById**
@@ -12517,7 +12518,7 @@ declare namespace JMap {
12517
12518
  *
12518
12519
  * Create a row from a table
12519
12520
  *
12520
- * @param {JId} dataSourceId - The Id of the data source.
12521
+ * @param {JId} tableId - The Id of the table.
12521
12522
  * @param {{ [key: string]: any }} row - the data of the row to be updated.
12522
12523
  *
12523
12524
  * @returns {Promise<void>}
@@ -12528,14 +12529,14 @@ declare namespace JMap {
12528
12529
  * JMap.Table.createRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", {city: "Montreal", country: "Canada"});
12529
12530
  * ```
12530
12531
  */
12531
- function createRow(dataSourceId: JId, row: { [key: string]: any }): Promise<void>
12532
+ function createRow(tableId: JId, row: { [key: string]: any }): Promise<void>
12532
12533
 
12533
12534
  /**
12534
12535
  * **JMap.Table.updateRow**
12535
12536
  *
12536
12537
  * Update a row from a table
12537
12538
  *
12538
- * @param {JId} dataSourceId - The ID of the data source.
12539
+ * @param {JId} tableId - The ID of the table.
12539
12540
  * @param {number} rowId - Id of the row to be updated.
12540
12541
  * @param {{ [key: string]: any }} row - the data of the row to be updated.
12541
12542
  *
@@ -12547,15 +12548,15 @@ declare namespace JMap {
12547
12548
  * JMap.Table.updateRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 3086627, {city: "Montreal", country: "Canada"});
12548
12549
  * ```
12549
12550
  */
12550
- function updateRow(dataSourceId: JId, rowId: number, row: { [key: string]: any }): Promise<void>
12551
+ function updateRow(tableId: JId, rowId: number, row: { [key: string]: any }): Promise<void>
12551
12552
 
12552
12553
  /**
12553
12554
  * **JMap.Table.deleteRow**
12554
12555
  *
12555
12556
  * Delete a row from a table
12556
12557
  *
12557
- * @param {JId} dataSourceId - The ID of the JMap data source.
12558
- * @param {number} rowId - Id of the row to be updated.
12558
+ * @param {JId} tableId - The ID of the table.
12559
+ * @param {number} rowId - Id of the row to be deleted.
12559
12560
  *
12560
12561
  * @returns {Promise<void>}
12561
12562
  *
@@ -12565,6 +12566,21 @@ declare namespace JMap {
12565
12566
  * JMap.Table.deleteRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 3086627);
12566
12567
  * ```
12567
12568
  */
12568
- function deleteRow(dataSourceId: JId, rowId: number): Promise<void>
12569
+ function deleteRow(tableId: JId, rowId: number): Promise<void>
12570
+
12571
+ /**
12572
+ * **JMap.Table.getDataSourceAttributes**
12573
+ *
12574
+ * Returns the attributes of the associated datasource, for a given table.
12575
+ *
12576
+ * @param tableId the table
12577
+ * @throws if tableId not valid or dataSource not found
12578
+ * @example
12579
+ * ```ts
12580
+ * // Returns datasource attributes, for table id="be4552e1-d89d-48ec-a417-7b99d14b4d7b"
12581
+ * JMap.Table.getDataSourceAttributes("be4552e1-d89d-48ec-a417-7b99d14b4d7b")
12582
+ * ```
12583
+ **/
12584
+ function getDataSourceAttributes(tableId: JId): Promise<JDataSourceAttribute[]>
12569
12585
  }
12570
12586
  }
@@ -0,0 +1,8 @@
1
+ declare interface JDataSourceAttribute {
2
+ id: string
3
+ name: string
4
+ type: ATTRIBUTE_TYPES
5
+ indexed: boolean
6
+ title: JLocaleTranslation
7
+ valueDomain?: JValueDomain[]
8
+ }
@@ -18,7 +18,7 @@ declare interface JFormSchemaPropertyJMC {
18
18
  default?: any
19
19
  minimum?: number
20
20
  maximum?: number
21
- oneOf?: Array<{ const: string; title: string }>
21
+ oneOf?: Array<{ const: string; title: string | undefined }>
22
22
  }
23
23
 
24
24
  declare const enum FORMSCHEMA_TYPES {
@@ -314,6 +314,7 @@ declare interface JLayer extends JLayerTreeElement {
314
314
  hasInformationReport: boolean
315
315
  informationReports: JLayerInformationReport[]
316
316
  spatialDataSourceId: string
317
+ spatialDataSourceAttributes: JDataSourceAttribute[] | null
317
318
  selectionStyleId: string
318
319
  dynamicFilter: JDynamicFilter
319
320
  allowClientSideEditing: boolean
@@ -1,8 +1,24 @@
1
+ // ALL_TABLE_ATTRIBUTE_TYPES in all-enum.ts
2
+ declare const enum JTABLE_ATTRIBUTE_TYPES {
3
+ STRING = "string",
4
+ NUMBER = "number",
5
+ DATE = "date",
6
+ DATETIME = "datetime",
7
+ BOOLEAN = "boolean",
8
+ BINARY = "binary"
9
+ }
10
+
11
+ declare interface JServerTable extends Omit<JTable, "permissions"> {
12
+ permissions: keyof JTablePermissions
13
+ }
14
+
1
15
  declare interface JTable {
2
16
  id: string
3
17
  organizationId: string
4
18
  projectId: string
5
19
  name: string
20
+ attributes: JTableAttribute[]
21
+ dataSourceAttributes: JDataSourceAttribute[] | null
6
22
  listed: boolean
7
23
  description: JLocaleTranslation
8
24
  dataSourceId: string
@@ -10,6 +26,15 @@ declare interface JTable {
10
26
  permissions: JTablePermissions
11
27
  }
12
28
 
29
+ declare interface JTableAttribute {
30
+ id: string
31
+ name: string
32
+ title: string
33
+ label: string
34
+ type: JTABLE_ATTRIBUTE_TYPES
35
+ indexed: boolean
36
+ }
37
+
13
38
  declare interface JTableData {
14
39
  columns: string[]
15
40
  links: Array<{ href: string; rel: string; title: string; type: string }>