jmapcloud-ng-core-types 1.0.17 → 1.0.20

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
@@ -13,6 +13,7 @@ export interface JCoreService extends JCoreMainService {
13
13
  Geometry: JGeometryService
14
14
  MouseOver: JMouseOverService
15
15
  Form: JFormService
16
+ FormJMC: JFormJMCService
16
17
  Query: JQueryService
17
18
  Event: JEventService
18
19
  History: JHistoryService
@@ -154,6 +155,7 @@ export interface JFeatureService {
154
155
  // TODO: see if the future endpoint will return detail about individual deleted features success or failure
155
156
  // https://k2geospatial.atlassian.net/browse/JMAP8-1589
156
157
  deleteByIds(layerId: JId, featureIds: JId[]): Promise<JId[]>
158
+ geometryCreate(params: JFeatureGeometryCreateParams): Promise<GeoJSON.Feature>
157
159
  }
158
160
 
159
161
  export interface JCoreMainService {
@@ -574,6 +576,10 @@ export interface JServerState extends JServerInfo {
574
576
 
575
577
  export type JHistoryListener = (oldValue: string | undefined, newValue: string | undefined) => void
576
578
 
579
+ export interface JFormJMCService {
580
+ getJsonForm(layerId: string): JJsonFormSchemas
581
+ }
582
+
577
583
  export interface JFormService {
578
584
  // REPO METHODS
579
585
  getFormsMetaDataByLayerId(layerId: JId): Promise<JFormMetaData[]>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.0.17",
3
+ "version": "1.0.20",
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
@@ -506,7 +506,7 @@ declare namespace JMap {
506
506
  *
507
507
  * Change the feature geometry for the given layer id, feature id and geometry (projection EPSG:4326).
508
508
  *
509
- * @param params contains the JMap layer id, the JMap feature id, and the geojson geometry
509
+ * @param params contains the JMap layer id, the JMap feature id, the geojson geometry, and optionally its attributes
510
510
  * @throws if layer or feature not found, or if feature is invalid (undefined, wrong geometry type, etc ...)
511
511
  * @example
512
512
  * ```ts
@@ -565,6 +565,46 @@ declare namespace JMap {
565
565
  // TODO: see if the future endpoint will return detail about individual deleted features success or failure
566
566
  // https://k2geospatial.atlassian.net/browse/JMAP8-1589
567
567
  function deleteByIds(layerId: JId, featureIds: JId[]): Promise<JId[]>
568
+
569
+ /**
570
+ * **JMap.Feature.geometryCreate**
571
+ *
572
+ * Creates a new Geometry
573
+ *
574
+ * @param params An object containing the parameters for geometry creation.
575
+ * params.layerId: The JMap layer id (string).
576
+ * params.geometry: The GeoJSON geometry object.
577
+ * params.properties: The values of the feature's attributes.
578
+ * params.crs: An object representing the coordinate reference system of the geometry.
579
+ * @throws Will throw an error if the layerId is not found.
580
+ * @returns A promise that resolves with the created GeoJSON feature.
581
+ *
582
+ * @example
583
+ * ```ts
584
+ * // Create a feature
585
+ * JMap.Feature
586
+ * .geometryCreate({
587
+ * layerId: "123e4567-e89b-12d3-a456-426614174000",
588
+ * crs: {
589
+ * type: "EPSG",
590
+ * properties: {
591
+ * code: 4326
592
+ * }
593
+ * },
594
+ * geometry: {
595
+ * type: "Point",
596
+ * coordinates: [-73.56, 45.51]
597
+ * },
598
+ * properties: {
599
+ * property1: "value1",
600
+ * property2: "value2"
601
+ * }
602
+ * })
603
+ * .then(() => console.info("Feature has been created"))
604
+ * .catch(error => console.error("An error occurred", error));
605
+ * ```
606
+ */
607
+ function geometryCreate(params: JFeatureGeometryCreateParams): Promise<GeoJSON.Feature>
568
608
  }
569
609
 
570
610
  /**
@@ -889,8 +929,8 @@ declare namespace JMap {
889
929
  * styleMapScales: [
890
930
  * {
891
931
  * id: "a9ba5215-0511-4aa3-a724-6f14f10ab315",
892
- * maximumVisibleZoom: 23,
893
- * minimumVisibleZoom: 0,
932
+ * maximumZoom: 23,
933
+ * minimumZoom: 0,
894
934
  * styleId: condition1StyleId
895
935
  * }
896
936
  * ]
@@ -909,8 +949,8 @@ declare namespace JMap {
909
949
  * styleMapScales: [
910
950
  * {
911
951
  * id: "8fb646bb-afee-4a3c-9545-e9716049d307",
912
- * maximumVisibleZoom: 23,
913
- * minimumVisibleZoom: 0,
952
+ * maximumZoom: 23,
953
+ * minimumZoom: 0,
914
954
  * styleId: condition2StyleId
915
955
  * }
916
956
  * ]
@@ -929,8 +969,8 @@ declare namespace JMap {
929
969
  * styleMapScales: [
930
970
  * {
931
971
  * id: "d0ad4bf4-f6a7-46f1-866b-74f97a5e7775",
932
- * maximumVisibleZoom: 23,
933
- * minimumVisibleZoom: 0,
972
+ * maximumZoom: 23,
973
+ * minimumZoom: 0,
934
974
  * styleId: condition3StyleId
935
975
  * }
936
976
  * ]
@@ -949,8 +989,8 @@ declare namespace JMap {
949
989
  * styleMapScales: [
950
990
  * {
951
991
  * id: "94331295-86b3-455c-8946-d45f79b8bd21",
952
- * maximumVisibleZoom: 23,
953
- * minimumVisibleZoom: 0,
992
+ * maximumZoom: 23,
993
+ * minimumZoom: 0,
954
994
  * styleId: condition4StyleId
955
995
  * }
956
996
  * ]
@@ -10183,6 +10223,33 @@ declare namespace JMap {
10183
10223
  function renderMouseOver(layer: JLayer, feature: GeoJSON.Feature): Array<JExtensionMouseOver | undefined>
10184
10224
  }
10185
10225
 
10226
+ /**
10227
+ * **JMap.FormJMC**
10228
+ *
10229
+ * Here you'll find all form related methods
10230
+ */
10231
+ namespace FormJMC {
10232
+ /**
10233
+ * ***JMap.FormJMC.getJsonForm***
10234
+ *
10235
+ * Returns the jsonForm schema and uiSchema for a layer.
10236
+ *
10237
+ * fetch the attributes of a layer and then builds and returns the schema and uiSchema required for jsonForms. The schemas will be null if there is no attributes on the layer
10238
+ *
10239
+ * @param layerId the JMap layer id
10240
+ * @example
10241
+ * ```ts
10242
+ * // returns the schema and uiSchema for layer id=f47ac10b-58cc-4372-a567-0e02b2c3d479
10243
+
10244
+
10245
+ * JMap.FormJMC
10246
+ * .getJsonForm("f47ac10b-58cc-4372-a567-0e02b2c3d479")
10247
+ * .then(schemas => console.log("jsonForms schemas of layer f47ac10b-58cc-4372-a567-0e02b2c3d479", schemas))
10248
+ * .catch(error => console.error("An error occurred when getting jsonForm schema", error))
10249
+ * ```
10250
+ */
10251
+ function getJsonForm(layerId: JId): JJsonFormSchemas
10252
+ }
10186
10253
  /**
10187
10254
  * **JMap.Form**
10188
10255
  *
@@ -6,6 +6,7 @@ declare interface JFeatureGeometryUpdateParams {
6
6
  layerId: JId
7
7
  featureId: JId
8
8
  geometry: GeoJSON.Geometry
9
+ properties?: JAttributeValueByName
9
10
  }
10
11
 
11
12
  declare interface JFeatureEventGeometryUpdateParams {
@@ -30,3 +31,15 @@ declare interface JFeatureEventCreateParams {
30
31
  featureGeometry: GeoJSON.Geometry
31
32
  featureProperties: JAttributeValueByName
32
33
  }
34
+
35
+ declare interface JFeatureGeometryCreateParams {
36
+ layerId: JId
37
+ geometry: GeoJSON.Geometry
38
+ properties?: JAttributeValueByName
39
+ crs: {
40
+ type: string
41
+ property: {
42
+ code: number
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,28 @@
1
+ declare interface JJsonFormSchemas {
2
+ schema: JJsonFormSchema | null
3
+ uiSchema: JJsonFormUISchema | null
4
+ }
5
+
6
+ declare interface JJsonFormSchema {
7
+ type: "object"
8
+ properties: {
9
+ [key: string]: {
10
+ type: string
11
+ format?: string
12
+ }
13
+ }
14
+ required: string[]
15
+ }
16
+ declare interface JJsonFormControlElement {
17
+ type: "Control"
18
+ scope: string
19
+ label: string
20
+ options?: {
21
+ [key: string]: any
22
+ }
23
+ }
24
+
25
+ declare interface JJsonFormUISchema {
26
+ type: "VerticalLayout"
27
+ elements: JJsonFormControlElement[]
28
+ }
@@ -271,11 +271,11 @@ declare interface JLayerGeometry {
271
271
  }
272
272
 
273
273
  declare interface JLayerPermissions {
274
- ADD: boolean
275
- DELETE: boolean
276
- DUPLICATE: boolean
277
- EDIT_ATTRIBUTE_VALUES: boolean
278
- EDIT_GEOMETRY: boolean
274
+ ADD_FEATURE: boolean
275
+ DELETE_FEATURE: boolean
276
+ EXTRACT_FEATURE: boolean
277
+ EDIT_FEATURE_ATTRIBUTES: boolean
278
+ EDIT_FEATURE_GEOMETRY: boolean
279
279
  EDIT_ONLY_OWN: boolean
280
280
  }
281
281
 
@@ -294,15 +294,14 @@ declare interface JLayer extends JLayerTreeElement {
294
294
  metadataSections: JLayerMetadataSection[]
295
295
  attributes: JLayerAttribute[]
296
296
  mouseOver: JMapMouseOver
297
- minimumVisibleZoom: number | undefined
298
- maximumVisibleZoom: number | undefined
297
+ minimumZoom: number | undefined
298
+ maximumZoom: number | undefined
299
299
  styleRules: JLayerStyleRule[]
300
300
  defaultStyleRule: JLayerStyleRule | undefined
301
301
  thematics: JLayerThematic[]
302
302
  queries: JQuery[]
303
303
  extent: JBoundaryBox | null
304
304
  permissions: JLayerPermissions
305
- canEditGeometry: boolean
306
305
  hasAttributeForm: boolean
307
306
  hasExternalForms: boolean
308
307
  selectable: boolean
@@ -459,8 +458,8 @@ declare interface JLayerStyleRuleCondition {
459
458
  declare interface JLayerStyleScaled {
460
459
  id: string
461
460
  styleId: string
462
- minimumVisibleZoom: number
463
- maximumVisibleZoom: number
461
+ minimumZoom: number
462
+ maximumZoom: number
464
463
  }
465
464
 
466
465
  declare interface JLayerStyleSample {
@@ -2,8 +2,8 @@ declare interface JMapMouseOver {
2
2
  text: string
3
3
  preventTextDuplication: boolean
4
4
  backgroundColor: string
5
- maximumVisibleZoom: number
6
- minimumVisibleZoom: number
5
+ maximumZoom: number
6
+ minimumZoom: number
7
7
  }
8
8
 
9
9
  declare interface JMouseOverContent {
@@ -36,8 +36,6 @@ declare interface JProject {
36
36
  colorBackground: string
37
37
  terrain?: JTerrainSpecification
38
38
  initialExtent: JBounds | null
39
- minimumVisibleZoom: number
40
- maximumVisibleZoom: number
41
39
  mapUnit: JMAP_DISTANCE_UNITS
42
40
  apiKey: {
43
41
  google: string | null
@@ -1,9 +1,15 @@
1
+ /**
2
+ * @deprecated
3
+ */
1
4
  declare interface JQueryGroup {
2
5
  id: JId
3
6
  name: string
4
7
  queries: JQuery[]
5
8
  }
6
9
 
10
+ /**
11
+ * @deprecated
12
+ */
7
13
  declare interface JQuery {
8
14
  id: string // unique id, set by NG
9
15
  jmapId: JId // non unique id, set by server, used to fetch query form (associate to layer id)
@@ -11,7 +17,7 @@ declare interface JQuery {
11
17
  name: string
12
18
  layerId: JId
13
19
  maxScale: number
14
- maxResults: number,
20
+ maxResults: number
15
21
  isInitialized: boolean
16
22
  isLoading: boolean
17
23
  hasLoadingError: boolean