jmapcloud-ng-core-types 1.1.36 → 1.1.39

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/README.md CHANGED
@@ -1,12 +1,7 @@
1
1
  # jmapcloud-ng-core-types
2
-
3
- Don't rename the NPM script named ***pub*** for ***publish***.
4
-
5
- If a NMP script called ***publish*** exists, NPM will launch it when we publish.
6
-
7
- As ***pub*** launch a command that publish the package on NMP, it would make a loop if it was named ***publish*** ... so don't.
2
+ JMap Cloud NG Core
8
3
 
9
4
  The latest version of the JMap Cloud NG Core Javascript API documentation is available <a href="https://k2geospatial.github.io/jmapcloud-frontend/jmapcloud-ng-core-types/latest" target="_blank">here</a>.
10
5
 
11
- Examples and user documentation is available <a href="https://docs.jmapcloud.io/en/jmap-ng/jmap-ng-developer-documentation" target="_blank">here</a>.
6
+ Examples and user documentation are available <a href="https://docs.jmapcloud.io/en/jmap-ng/jmap-ng-developer-documentation" target="_blank">here</a>.
12
7
 
package/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  /// <reference path="./public/global-aliases.d.ts" />
2
2
  import { Feature, FeatureCollection, LineString, MultiLineString, Point, Polygon } from "geojson"
3
- import { JForm as JFormJMC } from "jmapcloud-types"
3
+ import { JAttribute, JDataSource, JDataSourceType, JForm as JFormJMC, JRelationship } from "jmapcloud-types"
4
+ import type * as maplibregl from "maplibre-gl"
4
5
  import { Action, Store } from "redux"
6
+ import { JDataSourceData, JDataSourceDataParams, JDataSourcePermissions } from "./public/jmap/datasource.ts"
5
7
  import type { JCoreState } from "./public/state.d.ts"
6
8
 
7
9
  export type { JCoreOptions } from "./public/jmap/startup-options.d.ts"
@@ -46,6 +48,7 @@ export interface JCoreService extends JCoreMainService {
46
48
  MapContext: JMapContextService
47
49
  UI: JUIService
48
50
  SimpleSearch: JSimpleSearchService
51
+ DataSource: JDataSourceService
49
52
  Table: JTableService
50
53
  }
51
54
 
@@ -402,13 +405,22 @@ export interface JFormJMCService {
402
405
  }
403
406
 
404
407
  export interface JAttachmentService {
405
- getByItemId(dataSourceId: JId, itemId: JId): Promise<JAttachment[]>
406
- create(dataSourceId: string, params: JCreateAttachmentParams): Promise<string>
407
- remove(dataSourceId: string, attachmentId: string): Promise<string>
408
- update(dataSourceId: string, attachmentId: string, params: JUpdateAttachmentParams): Promise<string>
409
- download(dataSourceId: string, attachmentId: string): Promise<{ data: Blob; headers: any }>
410
- downloadToDevice(attachment: JAttachmentFile, dataSourceId: string): Promise<void>
411
- previewAttachments(attachment: JAttachmentFile, dataSourceId: string): Promise<void>
408
+ getByItemId(dataSourceId: JId, dataSourceOrganizationId: string, itemId: JId): Promise<JAttachment[]>
409
+ create(dataSourceId: string, dataSourceOrganizationId: string, params: JCreateAttachmentParams): Promise<string>
410
+ remove(dataSourceId: string, dataSourceOrganizationId: string, attachmentId: string): Promise<string>
411
+ update(
412
+ dataSourceId: string,
413
+ dataSourceOrganizationId: string,
414
+ attachmentId: string,
415
+ params: JUpdateAttachmentParams
416
+ ): Promise<string>
417
+ download(
418
+ dataSourceId: string,
419
+ dataSourceOrganizationId: string,
420
+ attachmentId: string
421
+ ): Promise<{ data: Blob; headers: any }>
422
+ downloadToDevice(attachment: JAttachmentFile, dataSourceId: string, dataSourceOrganizationId: string): Promise<void>
423
+ previewAttachments(attachment: JAttachmentFile, dataSourceId: string, dataSourceOrganizationId: string): Promise<void>
412
424
  }
413
425
 
414
426
  export interface JFormService {
@@ -733,7 +745,40 @@ export interface JLayerService {
733
745
  deleteLayer(layerId: JId): void
734
746
  hasInformationReport(layerId: JId): boolean
735
747
  openInformationReportInNewTab(layerId: JId, featureIds: JId[]): Promise<string>
736
- getDataSourceAttributes(layerId: JId): Promise<JDataSourceAttribute[]>
748
+ getDataSourceAttributes(layerId: JId): Promise<JAttribute[]>
749
+ }
750
+
751
+ export interface JDataSourceService {
752
+ getAttributes(dataSourceId: JId, dataSourceOrganizationId: string): Promise<JAttribute[]>
753
+ getById(dataSourceId: JId, dataSourceOrganizationId: string): Promise<JDataSource>
754
+ getData(
755
+ dataSourceId: JId,
756
+ dataSourceOrganizationId: string,
757
+ params: JDataSourceDataParams,
758
+ dataSourceType?: JDataSourceType
759
+ ): Promise<JDataSourceData>
760
+ getPermissions(dataSourceId: JId, dataSourceOrganizationId: string): Promise<JDataSourcePermissions>
761
+ createRow(
762
+ dataSourceId: JId,
763
+ dataSourceOrganizationId: string,
764
+ row: { [key: string]: any }
765
+ ): Promise<{ id: JId; links: any[] }>
766
+ updateRow(dataSourceId: JId, dataSourceOrganizationId: string, rowId: JId, row: { [key: string]: any }): Promise<void>
767
+ deleteRow(dataSourceId: JId, dataSourceOrganizationId: string, rowId: JId): Promise<void>
768
+ updateFeatureProperties(
769
+ dataSourceId: JId,
770
+ dataSourceOrganizationId: string,
771
+ featureId: JId,
772
+ properties: { [key: string]: any }
773
+ ): Promise<GeoJSON.Feature>
774
+ deleteFeature(dataSourceId: JId, dataSourceOrganizationId: string, featureId: JId): Promise<JId>
775
+ getFeature(dataSourceId: string, dataSourceOrganizationId: string, featureId: number): Promise<GeoJSON.Feature>
776
+ getRow(dataSourceId: string, dataSourceOrganizationId: string, rowId: number): Promise<{ [key: string]: any }>
777
+ getRelationship(
778
+ dataSourceId: string,
779
+ dataSourceOrganizationId: string,
780
+ relationshipId: string
781
+ ): Promise<JRelationship>
737
782
  }
738
783
 
739
784
  export interface JTableService {
@@ -743,7 +788,7 @@ export interface JTableService {
743
788
  createRow(tableId: JId, row: { [key: string]: any }): Promise<{ id: JId; links: Array<any> }>
744
789
  updateRow(tableId: JId, rowId: number, row: { [key: string]: any }): Promise<void>
745
790
  deleteRow(tableId: JId, rowId: number): Promise<void>
746
- getDataSourceAttributes(tableId: JId): Promise<JDataSourceAttribute[]>
791
+ getDataSourceAttributes(tableId: JId): Promise<JAttribute[]>
747
792
  setDynamicFilterActive(tableId: JId, filterId: string, isActive: boolean): void
748
793
  }
749
794
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.1.36",
3
+ "version": "1.1.39",
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,7 +1,5 @@
1
- /// <reference path="./global-aliases.d.ts" />
2
-
1
+ import { JAttribute, JDataSource, JRelationship } from "jmapcloud-types"
3
2
  import type { Action, Store } from "redux"
4
- import type { JCoreState } from "./state.d.ts"
5
3
  import type { JRequestConfig } from "./jmap/ajax.d.ts"
6
4
  import type {
7
5
  JAttachment,
@@ -9,7 +7,7 @@ import type {
9
7
  JCreateAttachmentParams,
10
8
  JUpdateAttachmentParams
11
9
  } from "./jmap/attachment.d.ts"
12
- import type { JDataSourceAttribute } from "./jmap/datasource.ts"
10
+ import type { JDataSourceData, JDataSourceDataParams, JDataSourcePermissions } from "./jmap/datasource.ts"
13
11
  import type { JDateFormatParams, JDateLike, JTIME_UNITS } from "./jmap/date.d.ts"
14
12
  import type { JCoreExtension, JExtensionEventParams, JExtensionMouseOver } from "./jmap/extension.d.ts"
15
13
  import type {
@@ -178,11 +176,12 @@ 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.
184
183
  *
185
- * Examples are availables <a href="https://doc.k2geospatial.com/jmap/doc/ng_dev/examples.html" target="_blank">here</a>.
184
+ * Examples are availables <a href="https://docs.jmapcloud.io/en/jmap-ng/jmap-ng-developer-documentation/examples" target="_blank">here</a>.
186
185
  *
187
186
  * You can customize JMap Cloud NG Core library by providing startup options ({@link JCoreOptions}).
188
187
  *
@@ -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**
@@ -5352,15 +5351,15 @@ export namespace JMap {
5352
5351
  * @example
5353
5352
  * ```ts
5354
5353
  * // Add a link attribution on the map.
5355
- * JMap.Map.Attribution.addSingle({ id: "link-test", text: "© HelloWorld", href:"https://k2geospatial.com/jmap-en/"})
5354
+ * JMap.Map.Attribution.addSingle({ id: "link-test", text: "© HelloWorld", href:"https://www.k2geospatial.com/fr/jmap#jmap-cloud"})
5356
5355
  *
5357
5356
  * // Add a text attribution on the map
5358
5357
  * JMap.Map.Attribution.addSingle({ id: "text-test", text: "© HelloWorld"})
5359
5358
  *
5360
5359
  * // Add a image attribution on the map.
5361
5360
  * JMap.Map.Attribution.addSingle({id: "test-image",
5362
- * imageUrl: "https://k2geospatial.com/wp-content/themes/k2-theme/assets/images/k2-logo.png",
5363
- * href: "https://k2geospatial.com/jmap-en/"})
5361
+ * imageUrl: "https://cdn.prod.website-files.com/6329d1de889a14271e633a0e/6329e0ef8ada6a3fecd3e61f_K2%20LOGOTYPE%20BLANC.svg",
5362
+ * href: "https://www.k2geospatial.com/fr/jmap#jmap-cloud"})
5364
5363
  * ```
5365
5364
  */
5366
5365
  function addSingle(attribution: JMapAttribution): void
@@ -5376,7 +5375,7 @@ export namespace JMap {
5376
5375
  * // Add two custom attributions on the map.
5377
5376
  * JMap.Map.Attribution.addMultiple([{ id: "custom-attribution-0",
5378
5377
  * text: "© K2Geospatial",
5379
- * href: "https://k2geospatial.com/jmap-en/" },
5378
+ * href: "https://www.k2geospatial.com/fr/jmap#jmap-cloud" },
5380
5379
  * { id: "custom-attribution-1",
5381
5380
  * text: "© StackOverflow",
5382
5381
  * href: "https://stackoverflow.com/" }])
@@ -9664,6 +9663,7 @@ export namespace JMap {
9664
9663
  * Fetches every attachment linked to a specific **item** (row) of a data source.
9665
9664
  *
9666
9665
  * @param dataSourceId the data source identifier that contains the item
9666
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9667
9667
  * @param itemId the identifier of the item whose attachments you want
9668
9668
  * @example
9669
9669
  * ```ts
@@ -9673,13 +9673,14 @@ export namespace JMap {
9673
9673
  * .catch(error => console.error("An error occurred while fetching attachments", error))
9674
9674
  * ```
9675
9675
  */
9676
- function getByItemId(dataSourceId: JId, itemId: JId): Promise<JAttachment[]>
9676
+ function getByItemId(dataSourceId: JId, dataSourceOrganizationId: string, itemId: JId): Promise<JAttachment[]>
9677
9677
  /**
9678
9678
  * ***JMap.Attachment.create***
9679
9679
  *
9680
9680
  * Creates a new attachment for a data source item. The payload can represent either a file upload (`file`) or a URL attachment (`url`).
9681
9681
  *
9682
9682
  * @param dataSourceId the data source identifier that will receive the attachment
9683
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9683
9684
  * @param params see {@link JCreateAttachmentParams} (includes the `itemId`)
9684
9685
  * @example
9685
9686
  * ```ts
@@ -9705,13 +9706,18 @@ export namespace JMap {
9705
9706
  * .catch(error => console.error("Attachment creation failed", error))
9706
9707
  * ```
9707
9708
  */
9708
- function create(dataSourceId: string, params: JCreateAttachmentParams): Promise<string>
9709
+ function create(
9710
+ dataSourceId: string,
9711
+ dataSourceOrganizationId: string,
9712
+ params: JCreateAttachmentParams
9713
+ ): Promise<string>
9709
9714
  /**
9710
9715
  * ***JMap.Attachment.remove***
9711
9716
  *
9712
9717
  * Deletes an attachment previously created on a data source.
9713
9718
  *
9714
9719
  * @param dataSourceId the JMap data source id
9720
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9715
9721
  * @param attachmentId the attachment identifier to remove
9716
9722
  * @example
9717
9723
  * ```ts
@@ -9721,13 +9727,14 @@ export namespace JMap {
9721
9727
  * .catch(error => console.error("Failed to remove attachment", error))
9722
9728
  * ```
9723
9729
  */
9724
- function remove(dataSourceId: string, attachmentId: string): Promise<string>
9730
+ function remove(dataSourceId: string, dataSourceOrganizationId: string, attachmentId: string): Promise<string>
9725
9731
  /**
9726
9732
  * ***JMap.Attachment.update***
9727
9733
  *
9728
9734
  * Updates the metadata (subject, description, URL) of an existing attachment.
9729
9735
  *
9730
9736
  * @param dataSourceId the JMap data source id
9737
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9731
9738
  * @param attachmentId the attachment identifier to update
9732
9739
  * @param params partial attachment payload containing the new values
9733
9740
  * @example
@@ -9742,13 +9749,19 @@ export namespace JMap {
9742
9749
  * .catch(error => console.error("Failed to update attachment", error))
9743
9750
  * ```
9744
9751
  */
9745
- function update(dataSourceId: string, attachmentId: string, params: JUpdateAttachmentParams): Promise<string>
9752
+ function update(
9753
+ dataSourceId: string,
9754
+ dataSourceOrganizationId: string,
9755
+ attachmentId: string,
9756
+ params: JUpdateAttachmentParams
9757
+ ): Promise<string>
9746
9758
  /**
9747
9759
  * ***JMap.Attachment.download***
9748
9760
  *
9749
9761
  * Downloads an attachment and returns the raw binary data plus the HTTP headers sent by the server.
9750
9762
  *
9751
9763
  * @param dataSourceId the JMap data source id
9764
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9752
9765
  * @param attachmentId the attachment to download
9753
9766
  * @example
9754
9767
  * ```ts
@@ -9760,6 +9773,7 @@ export namespace JMap {
9760
9773
  */
9761
9774
  function download(
9762
9775
  dataSourceId: string,
9776
+ dataSourceOrganizationId: string,
9763
9777
  attachmentId: string
9764
9778
  ): Promise<{
9765
9779
  data: Blob
@@ -9772,6 +9786,7 @@ export namespace JMap {
9772
9786
  *
9773
9787
  * @param attachment the attachment to download
9774
9788
  * @param dataSourceId the JMap data source id
9789
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9775
9790
  * @example
9776
9791
  * ```ts
9777
9792
  * JMap.Attachment
@@ -9791,7 +9806,11 @@ export namespace JMap {
9791
9806
  * .catch(error => console.error("Download failed", error))
9792
9807
  * ```
9793
9808
  */
9794
- function downloadToDevice(attachment: JAttachmentFile, dataSourceId: string): Promise<void>
9809
+ function downloadToDevice(
9810
+ attachment: JAttachmentFile,
9811
+ dataSourceId: string,
9812
+ dataSourceOrganizationId: string
9813
+ ): Promise<void>
9795
9814
  /**
9796
9815
  * ***JMap.Attachment.previewAttachments***
9797
9816
  *
@@ -9801,6 +9820,7 @@ export namespace JMap {
9801
9820
  *
9802
9821
  * @param attachment the attachment to download
9803
9822
  * @param dataSourceId the JMap data source id
9823
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9804
9824
  * @example
9805
9825
  * ```ts
9806
9826
  * JMap.Attachment
@@ -9820,8 +9840,253 @@ export namespace JMap {
9820
9840
  * .catch(error => console.error("Preview failed", error))
9821
9841
  * ```
9822
9842
  */
9823
- function previewAttachments(attachment: JAttachmentFile, dataSourceId: string): Promise<void>
9843
+ function previewAttachments(
9844
+ attachment: JAttachmentFile,
9845
+ dataSourceId: string,
9846
+ dataSourceOrganizationId: string
9847
+ ): Promise<void>
9848
+ }
9849
+ /**
9850
+ * **JMap.DataSource**
9851
+ *
9852
+ * Here you'll find all dataSource related methods
9853
+ */
9854
+ namespace DataSource {
9855
+ /**
9856
+ * **JMap.DataSource.getAttributes**
9857
+ *
9858
+ * Returns the attributes for a given datasource.
9859
+ *
9860
+ * @param dataSourceId the datasource id
9861
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9862
+ * @throws if dataSourceId not valid or dataSource not found
9863
+ * @example
9864
+ * ```ts
9865
+ * // Returns attributes, for dataSource id="be4552e1-d89d-48ec-a417-7b99d14b4d7b"
9866
+ * JMap.DataSource.getAttributes("be4552e1-d89d-48ec-a417-7b99d14b4d7b")
9867
+ * ```
9868
+ **/
9869
+ function getAttributes(dataSourceId: JId, dataSourceOrganizationId: string): Promise<JAttribute[]>
9870
+
9871
+ /**
9872
+ * **JMap.DataSource.getById**
9873
+ *
9874
+ * Returns the datasource, for a given id.
9875
+ *
9876
+ * @param dataSourceId the id of the data source
9877
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9878
+ * @throws if dataSourceId not valid or not found
9879
+ * @example
9880
+ * ```ts
9881
+ * // Returns dataSource, with id="be4552e1-d89d-48ec-a417-7b99d14b4d7b"
9882
+ * JMap.DataSource.getById("be4552e1-d89d-48ec-a417-7b99d14b4d7b")
9883
+ * ```
9884
+ **/
9885
+ function getById(dataSourceId: JId, dataSourceOrganizationId: string): Promise<JDataSource>
9886
+
9887
+ /**
9888
+ * **JMap.DataSource.getData**
9889
+ *
9890
+ * Asynchronously retrieves data for a datasource.
9891
+ *
9892
+ * @throws {Error} If no data source is found for the given ID.
9893
+ *
9894
+ * @param {JId} dataSourceId - The datasource id.
9895
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9896
+ * @param {JDataSourceDataParams} params - Includes the following optional parameters: startIndex, limit, filter, sort.
9897
+ * startIndex: The starting index for data retrieval (zero-based).
9898
+ * limit: The maximum number of records to retrieve.
9899
+ * filter: A CQL filter.
9900
+ * sort: A sort model.
9901
+ *
9902
+ * @returns {Promise<JDataSourceData>} A promise that resolves to a `JDataSourceData` object representing the dataSource data.
9903
+ *
9904
+ * @example
9905
+ * ```ts
9906
+ * // Retrieves up to 50 rows from data source ID 3, starting at index 0, sorted in ascending order based on the "ATTRIBUTE_A" attribute
9907
+ * JMap.DataSource.getData(3, {startIndex: 0, limit: 50, sort:"ATTRIBUTE_A ASC"}).then(dataSourceData => {
9908
+ * console.log(dataSourceData);
9909
+ * }).catch(error => {
9910
+ * console.error("Failed to fetch dataSource data:", error);
9911
+ * });
9912
+ * ```
9913
+ */
9914
+ function getData(
9915
+ dataSourceId: JId,
9916
+ dataSourceOrganizationId: string,
9917
+ params: JDataSourceDataParams,
9918
+ dataSourceType?: any
9919
+ ): Promise<JDataSourceData>
9920
+
9921
+ /**
9922
+ * **JMap.DataSource.getPermissions**
9923
+ *
9924
+ * Returns the permissions, for a given dataSource id.
9925
+ *
9926
+ * @param dataSourceId
9927
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9928
+ * @throws if dataSourceId not valid
9929
+ * @example
9930
+ * ```ts
9931
+ * // Returns permissions for dataSource with id="be4552e1-d89d-48ec-a417-7b99d14b4d7b"
9932
+ * JMap.DataSource.getPermissions("be4552e1-d89d-48ec-a417-7b99d14b4d7b")
9933
+ * ```
9934
+ **/
9935
+ function getPermissions(dataSourceId: JId, dataSourceOrganizationId: string): Promise<JDataSourcePermissions>
9936
+
9937
+ /**
9938
+ * **JMap.DataSource.createRow**
9939
+ *
9940
+ * Creates a new row in a tabular datasource.
9941
+ *
9942
+ * @param dataSourceId
9943
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9944
+ * @param row
9945
+ * @example
9946
+ * ```ts
9947
+ * JMap.DataSource.createRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", { NAME: "New row" })
9948
+ * ```
9949
+ **/
9950
+ function createRow(
9951
+ dataSourceId: JId,
9952
+ dataSourceOrganizationId: string,
9953
+ row: { [key: string]: any }
9954
+ ): Promise<{ id: JId; links: any[] }>
9955
+
9956
+ /**
9957
+ * **JMap.DataSource.updateRow**
9958
+ *
9959
+ * Updates a row in a tabular datasource.
9960
+ *
9961
+ * @param dataSourceId
9962
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9963
+ * @param rowId
9964
+ * @param row
9965
+ * @example
9966
+ * ```ts
9967
+ * JMap.DataSource.updateRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 12, { NAME: "Updated" })
9968
+ * ```
9969
+ **/
9970
+ function updateRow(
9971
+ dataSourceId: JId,
9972
+ dataSourceOrganizationId: string,
9973
+ rowId: JId,
9974
+ row: { [key: string]: any }
9975
+ ): Promise<void>
9976
+
9977
+ /**
9978
+ * **JMap.DataSource.deleteRow**
9979
+ *
9980
+ * Deletes a row from a tabular datasource.
9981
+ *
9982
+ * @param dataSourceId
9983
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9984
+ * @param rowId
9985
+ * @example
9986
+ * ```ts
9987
+ * JMap.DataSource.deleteRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 12)
9988
+ * ```
9989
+ **/
9990
+ function deleteRow(dataSourceId: JId, dataSourceOrganizationId: string, rowId: JId): Promise<void>
9991
+
9992
+ /**
9993
+ * **JMap.DataSource.updateFeatureProperties**
9994
+ *
9995
+ * Updates properties for a feature in a spatial datasource.
9996
+ *
9997
+ * @param dataSourceId
9998
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
9999
+ * @param featureId
10000
+ * @param properties
10001
+ * @example
10002
+ * ```ts
10003
+ * JMap.DataSource.updateFeatureProperties(
10004
+ * "be4552e1-d89d-48ec-a417-7b99d14b4d7b",
10005
+ * 42,
10006
+ * { NAME: "Updated" }
10007
+ * )
10008
+ * ```
10009
+ **/
10010
+ function updateFeatureProperties(
10011
+ dataSourceId: JId,
10012
+ dataSourceOrganizationId: string,
10013
+ featureId: JId,
10014
+ properties: { [key: string]: any }
10015
+ ): Promise<GeoJSON.Feature>
10016
+
10017
+ /**
10018
+ * **JMap.DataSource.deleteFeature**
10019
+ *
10020
+ * Deletes a spatial feature from a spatial datasource.
10021
+ *
10022
+ * @param dataSourceId
10023
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
10024
+ * @param featureId
10025
+ * @example
10026
+ * ```ts
10027
+ * JMap.DataSource.deleteFeature("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 42)
10028
+ * ```
10029
+ **/
10030
+ function deleteFeature(dataSourceId: JId, dataSourceOrganizationId: string, featureId: JId): Promise<JId>
10031
+
10032
+ /**
10033
+ * **JMap.DataSource.getFeature**
10034
+ *
10035
+ * Returns a spatial feature for a datasource.
10036
+ *
10037
+ * @param dataSourceId
10038
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
10039
+ * @param featureId
10040
+ * @example
10041
+ * ```ts
10042
+ * JMap.DataSource.getFeature("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 42)
10043
+ * ```
10044
+ **/
10045
+ function getFeature(
10046
+ dataSourceId: string,
10047
+ dataSourceOrganizationId: string,
10048
+ featureId: number
10049
+ ): Promise<GeoJSON.Feature>
10050
+
10051
+ /**
10052
+ * **JMap.DataSource.getRow**
10053
+ *
10054
+ * Returns a row for a tabular datasource.
10055
+ *
10056
+ * @param dataSourceId
10057
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
10058
+ * @param rowId
10059
+ * @example
10060
+ * ```ts
10061
+ * JMap.DataSource.getRow("be4552e1-d89d-48ec-a417-7b99d14b4d7b", 12)
10062
+ * ```
10063
+ **/
10064
+ function getRow(
10065
+ dataSourceId: string,
10066
+ dataSourceOrganizationId: string,
10067
+ rowId: number
10068
+ ): Promise<{ [key: string]: any }>
10069
+
10070
+ /**
10071
+ * **JMap.DataSource.getRelationship**
10072
+ *
10073
+ * Returns a relationship for a given data source.
10074
+ *
10075
+ * @param dataSourceId the id of the data source
10076
+ * @param dataSourceOrganizationId the id of the organization to which the data source belongs
10077
+ * @param relationshipId the id of the relationship to fetch
10078
+ * @example
10079
+ * ```ts
10080
+ * JMap.DataSource.getRelationship("be4552e1-d89d-48ec-a417-7b99d14b4d7b", "ja49j9e1-d89d-48ec-a417-7b99d14b4d7b", "ke4759e1-d89d-48ec-a417-7b99d14b4d7b")
10081
+ * ```
10082
+ **/
10083
+ function getRelationship(
10084
+ dataSourceId: string,
10085
+ dataSourceOrganizationId: string,
10086
+ relationshipId: string
10087
+ ): Promise<JRelationship>
9824
10088
  }
10089
+
9825
10090
  /**
9826
10091
  * **JMap.Form**
9827
10092
  *
@@ -12169,12 +12434,13 @@ export namespace JMap {
12169
12434
  *
12170
12435
  * @throws {Error} If no data source is found for the given ID.
12171
12436
  *
12172
- * @param {JId} tableId - The ID of the JMap Table.
12437
+ * @param {JId} tableId - The ID of the JMap Table's dataSource.
12173
12438
  * @param {JTableDataParams} params - Includes the following optional parameters: startIndex, limit, filter, sort.
12174
12439
  * startIndex: The starting index for data retrieval (zero-based).
12175
12440
  * limit: The maximum number of records to retrieve.
12176
12441
  * filter: A CQL filter.
12177
12442
  * sort: A sort model.
12443
+ * columns: the name of the columns to include.
12178
12444
  *
12179
12445
  * @returns {Promise<JTableData>} A promise that resolves to a `JTableData` object representing the table data.
12180
12446
  *
@@ -12282,7 +12548,7 @@ export namespace JMap {
12282
12548
  * JMap.Table.getDataSourceAttributes("be4552e1-d89d-48ec-a417-7b99d14b4d7b")
12283
12549
  * ```
12284
12550
  **/
12285
- function getDataSourceAttributes(tableId: JId): Promise<JDataSourceAttribute[]>
12551
+ function getDataSourceAttributes(tableId: JId): Promise<JAttribute[]>
12286
12552
  /**
12287
12553
  * **JMap.Table.setDynamicFilterActive**
12288
12554
  *
@@ -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
@@ -2,6 +2,7 @@ export {}
2
2
  export interface JAttachmentBase {
3
3
  id: string
4
4
  organizationId: string
5
+ dataSourceId: string
5
6
  subject?: string
6
7
  description?: string
7
8
  thumbnail: string
@@ -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"
@@ -117,7 +117,7 @@ export interface JCoreExtension {
117
117
  startBeforeMapIsReady?: boolean
118
118
  /**
119
119
  * You can provide a translation bundle for your extesion. All translations will be handled by the JMap Cloud NG
120
- * translation engine. See [JMap.Language.addBundle](../functions/JMap_Cloud_NG_Core_API.JMap.Language.addBundle.html) for more details on bundles
120
+ * translation engine. See [JMap.Language.addBundle](../functions/JMap_Cloud_NG_Core___API.JMap.Language.addBundle.html) for more details on bundles
121
121
  */
122
122
  translationBundle?: JTranslationBundle
123
123
  /**
@@ -151,7 +151,7 @@ export interface JCoreExtension {
151
151
  *
152
152
  * Like that you can develop UI component that react to the redux state changes.
153
153
  *
154
- * You can get the data store using this function : [JMap.getDataStore](../functions/JMap_Cloud_NG_Core_API.JMap.getDataStore.html), and then dispatch
154
+ * You can get the data store using this function: [JMap.getDataStore](../functions/JMap_Cloud_NG_Core___API.JMap.getDataStore.html), and then dispatch
155
155
  * your own actions.
156
156
  *
157
157
  * A redux reducer is a pure JS function that take the current reducer state (can be undefined first time)
@@ -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"
@@ -305,6 +303,7 @@ export interface JLayer extends JLayerTreeElement {
305
303
  defaultMetadatas: JLayerMetadata[]
306
304
  metadataSections: JLayerMetadataSection[]
307
305
  attributes: JLayerAttribute[]
306
+ JMCAttributes: JAttribute[]
308
307
  mouseOver: JMapMouseOver
309
308
  minimumZoom: number | undefined
310
309
  maximumZoom: number | undefined
@@ -323,7 +322,8 @@ export interface JLayer extends JLayerTreeElement {
323
322
  hasInformationReport: boolean
324
323
  informationReports: JLayerInformationReport[]
325
324
  spatialDataSourceId: string
326
- spatialDataSourceAttributes: JDataSourceAttribute[] | null
325
+ spatialDataSourceOrganizationId: string
326
+ spatialDataSourceAttributes: JAttribute[] | null
327
327
  selectionStyleId: string
328
328
  // dynamicFilter: JDynamicFilter
329
329
  // TODO JMAP8-3266 : use a localized type instad of a graphQL one
@@ -612,15 +612,6 @@ export interface JLayerSetLayerGroupsExpansionParams {
612
612
  open: boolean
613
613
  }
614
614
 
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
615
  export enum ATTRIBUTE_TYPES {
625
616
  TINYINT = "TINYINT",
626
617
  SMALLINT = "SMALLINT",
@@ -640,13 +631,3 @@ export enum ATTRIBUTE_TYPES {
640
631
  ARRAY = "ARRAY",
641
632
  BOOLEAN = "BOOLEAN"
642
633
  }
643
-
644
- export type JValueDomain =
645
- | {
646
- value: string | number
647
- title: JLocaleTranslation
648
- }
649
- | {
650
- nullValue: true
651
- title: JLocaleTranslation
652
- }
@@ -621,7 +621,7 @@ export interface JCoreMapOptions {
621
621
  * ...
622
622
  * map: {
623
623
  * search: {
624
- * layerId: 2,
624
+ * layerId: "e0df4724-913d-4ce4-9c37-15217df1f167",
625
625
  * attributeName: "PEC",
626
626
  * attributeValue: "RT 2012",
627
627
  * showMapPopup: true
@@ -316,7 +316,7 @@ export interface JCoreOptions {
316
316
  * Specifying ***token*** will automatically activate {@link JCoreOptions.legacyAuthentication}
317
317
  *
318
318
  * To get a refresh token, you can use the JMap Rest API on your JMap Cloud Server.
319
- * See [JMap.User.setToken](modules/JMap.User.html#settoken) for detailed examples on how to fetch a token through JMap's REST API.
319
+ * See [JMap.User.setToken](../functions/JMap_Cloud_NG_Core___API.JMap.User.setToken.html) for detailed examples on how to fetch a token through JMap's REST API.
320
320
  *
321
321
  * So to start the library using the fetched token you can configure your startup options like this :
322
322
  * ```html
@@ -458,7 +458,7 @@ export interface JCoreOptions {
458
458
  /**
459
459
  * If set to any of the locales supported by JMap, will define the default locale, bypassing browser or user-defined locale.
460
460
  *
461
- * Supported locales can be retrieved by calling [JMap.Language.getLocales](modules/JMap.Language.html#getlocales)
461
+ * Supported locales can be retrieved by calling [JMap.Language.getLocales](../functions/JMap_Cloud_NG_Core___API.JMap.Language.getLocales.html)
462
462
  */
463
463
  locale?: string
464
464
  /**
@@ -516,7 +516,7 @@ export interface JCoreOptions {
516
516
  *
517
517
  * If provided, will use the corresponding basemap as the default basemap.
518
518
  *
519
- * If the id is unknown, will do nothing. To get all basemaps ids in the project, use [JMap.Map.Basemap.getAllIds](modules/JMap.Map.Basemap.html#getallids)
519
+ * If the id is unknown, will do nothing. To get all basemaps ids in the project, use [JMap.Map.Basemap.getAllIds](../functions/JMap_Cloud_NG_Core___API.JMap.Map.Basemap.getAllIds.html)
520
520
  *
521
521
  * Using the id "none" will use no basemap at startup.
522
522
  *
@@ -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
@@ -18,14 +17,14 @@ export interface JServerTable extends Omit<JTable, "permissions"> {
18
17
 
19
18
  export interface JTable {
20
19
  id: string
21
- organizationId: string
22
20
  projectId: string
23
21
  name: string
24
- attributes: JTableAttribute[]
25
- dataSourceAttributes: JDataSourceAttribute[] | null
22
+ attributes: JAttribute[]
23
+ dataSourceAttributes: JAttribute[] | null
26
24
  listed: boolean
27
25
  description: JLocaleTranslation
28
26
  dataSourceId: string
27
+ dataSourceOrganizationId: string
29
28
  allowClientSideEditing: boolean
30
29
  permissions: JTablePermissions
31
30
  baseFilter?: JAnyFilterCondition
@@ -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 {