jmapcloud-ng-core-types 1.0.25 → 1.0.27

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
@@ -245,8 +245,6 @@ export const ALL_MAP_CONTEXT_SORT_BY_DIRECTIONS: JMAP_CONTEXT_SORT_BY_DIRECTIONS
245
245
  JMAP_CONTEXT_SORT_BY_DIRECTIONS.DESC
246
246
  ]
247
247
 
248
- export const ALL_MAP_CONTEXT_VERSIONS: JMAP_CONTEXT_VERSIONS[] = [JMAP_CONTEXT_VERSIONS.V0, JMAP_CONTEXT_VERSIONS.V1]
249
-
250
248
  export const ALL_MAP_MODIFICATION_TYPES: JMAP_MODIFICATION_TYPES[] = [
251
249
  JMAP_MODIFICATION_TYPES.NONE,
252
250
  JMAP_MODIFICATION_TYPES.CENTER,
package/index.ts CHANGED
@@ -439,7 +439,7 @@ export interface JMapContextState {
439
439
  isApplying: boolean
440
440
  activeTab: JMAP_CONTEXT_TABS
441
441
  contexts: JMapContext[]
442
- defaultContextId: JId | undefined
442
+ defaultContextId: string | undefined
443
443
  filter: string
444
444
  sortBy: JMAP_CONTEXT_SORT_BY_OPTIONS
445
445
  sortByDirection: JMAP_CONTEXT_SORT_BY_DIRECTIONS
@@ -928,6 +928,7 @@ export interface JUserService {
928
928
  getOrganization(): JOrganization
929
929
  getFullName(): string
930
930
  getUsername(): string
931
+ getEmail(): string
931
932
  getPreference(name: string): Promise<string | null>
932
933
  hasPreference(name: string): Promise<boolean>
933
934
  removePreference(name: string): Promise<string | null>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
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
@@ -6248,6 +6248,19 @@ declare namespace JMap {
6248
6248
  */
6249
6249
  function getUsername(): string
6250
6250
 
6251
+ /**
6252
+ * ***JMap.User.getEmail***
6253
+ *
6254
+ * Returns the user email.
6255
+ *
6256
+ * @example
6257
+ * ```ts
6258
+ * // returns the email
6259
+ * JMap.User.getEmail()
6260
+ * ```
6261
+ */
6262
+ function getEmail(): string
6263
+
6251
6264
  /**
6252
6265
  * **JMap.User.getPreference**
6253
6266
  *
@@ -23,14 +23,6 @@ declare const enum JMAP_CONTEXT_SORT_BY_DIRECTIONS {
23
23
  DESC = "desc"
24
24
  }
25
25
 
26
- // ALL_MAP_CONTEXT_VERSIONS in all-enum.ts
27
- declare const enum JMAP_CONTEXT_VERSIONS {
28
- V0 = 0,
29
- V1 = 1
30
- }
31
-
32
- declare type JMapContextVersions = JMapContext | JMapContextV0 | JMapContextV1
33
-
34
26
  declare interface JMapContextEditResponse {
35
27
  id: JId
36
28
  uuid: string
@@ -44,59 +36,7 @@ declare interface JMapContextMetaData {
44
36
  thumbnailUrl?: string
45
37
  }
46
38
 
47
- /**
48
- * Never change this interface !!!
49
- * This is the picture of a map-context in version 0
50
- * Use for mapcontext migrations
51
- */
52
- declare interface JMapContextDataV0 {
53
- layerElements: Array<{
54
- id: string | number
55
- isGroup: boolean
56
- isVisible: boolean
57
- }>
58
- mapCenter: { x: number; y: number }
59
- mapZoom: number
60
- mapPitch: number
61
- mapBearing: number
62
- baseMap: string | undefined
63
- selection: {
64
- [key in string | number]: GeoJSON.Feature[]
65
- }
66
- measures: Array<{
67
- id: string
68
- type: "polygon" | "line_string" | "circle"
69
- feature: GeoJSON.Feature<GeoJSON.LineString | GeoJSON.Polygon>
70
- totalEdges: number
71
- centroid: JPoint
72
- edges: Array<{
73
- popupLocation: JPoint
74
- distance: number
75
- }>
76
- area: number
77
- radius: number
78
- }>
79
- thumbnail: string
80
- annotations: Array<{
81
- id: string
82
- type: "point" | "polygon" | "line_string" | "rectangle" | "circle" | "text"
83
- feature: any
84
- }>
85
- annotationsTextMarkersProperties: Array<{
86
- id: string
87
- location: maplibregl.LngLatLike
88
- textSize: number
89
- textColor: string
90
- textRotation: number
91
- label: string
92
- zoomRef: number
93
- shapeType: string
94
- }>
95
- extensionData?: { [extensionId: string]: any }
96
- }
97
-
98
39
  declare interface JMapContextData {
99
- version: JMAP_CONTEXT_VERSIONS
100
40
  layerElements: JMapContextDataLayerElement[]
101
41
  mapCenter: JLocation
102
42
  mapZoom: number
@@ -129,36 +69,18 @@ declare interface JMapContextDataThematic {
129
69
  hiddenConditionIds?: string[]
130
70
  }
131
71
 
132
- declare interface JMapContext {
133
- id?: JId
72
+ declare interface JMapContextCreationParams {
134
73
  title: string
135
74
  description: string
136
75
  shared: boolean
137
- origin: "web-ng"
138
- uuid?: string
139
- author?: string
140
- creationDate?: string
141
- modificationDate?: string
142
- projectId?: string
76
+ author: string
77
+ creationDate: string
78
+ modificationDate: string
143
79
  data: JMapContextData
144
80
  }
145
81
 
146
- declare interface JMapContextV0 {
147
- id?: number | string
148
- title: string
149
- description: string
150
- shared: boolean
151
- origin: "web-ng"
152
- uuid?: string
153
- author?: string
154
- creationDate?: string
155
- modificationDate?: string
156
- projectId?: string
157
- data: JMapContextDataV0
158
- }
159
-
160
- declare interface JMapContextV1 extends JMapContext {
161
- // nothing to change here
82
+ declare interface JMapContext extends JMapContextCreationParams {
83
+ id: string
162
84
  }
163
85
 
164
86
  declare interface JMapContextEventParams {
@@ -91,3 +91,55 @@ declare interface JJMapPasswordPolicyCompliance {
91
91
  declare const enum JORGANIZATION_EXTERNAL_API_KEY_TYPES {
92
92
  MAPBOX_ACCESS_TOKEN = "MAPBOX_ACCESS_TOKEN"
93
93
  }
94
+
95
+ declare type JUserResourceType = "MAPS" | "EXTENSION" | "PREFERENCE_PORTAL" | "PREFERENCES_NG"
96
+ declare type JUserResourceExtensionType = Extract<JUserResourceType, "EXTENSION">
97
+ declare type JUserResourceMapsType = Extract<JUserResourceType, "MAPS">
98
+ declare type JUserResourcePreferencesType = Extract<JUserResourceType, "PREFERENCE_PORTAL" | "PREFERENCES_NG">
99
+
100
+ declare interface JUserResourceBase {
101
+ id: string
102
+ type: JUserResourceType
103
+ content: Record<string, any>
104
+ }
105
+
106
+ declare interface JUserResourceMaps extends JUserResourceBase {
107
+ type: JUserResourceMapsType
108
+ projectId: string
109
+ }
110
+
111
+ declare interface JUserResourceMapsUpdateParams extends JUserResourceMaps {}
112
+
113
+ declare type JUserResourceMapsCreateParams = Omit<JUserResourceMaps, "id">
114
+
115
+ declare interface JUserResourceExtension extends JUserResourceBase {
116
+ type: JUserResourceExtensionType
117
+ extensionId: string
118
+ projectId: string
119
+ }
120
+
121
+ declare interface JUserResourceExtensionUpdateParams extends JUserResourceExtension {}
122
+
123
+ declare type JUserResourceExtensionCreateParams = Omit<JUserResourceExtension, "id">
124
+
125
+ // Eventually, the NG and Portal preferences will have an optional projectId to include in the logic below
126
+ declare interface JUserResourcePreferences extends JUserResourceBase {
127
+ type: JUserResourcePreferencesType
128
+ }
129
+
130
+ declare interface JUserResourcePreferencesUpdateParams extends JUserResourcePreferences {}
131
+
132
+ declare type JUserResourcePreferencesCreateParams = Omit<JUserResourcePreferences, "id">
133
+
134
+ type JUserResourcePermissionType = "VIEW" | "MODIFY" | "OWNER"
135
+ type JUserViewPermissionType = Extract<JUserResourcePermissionType, "VIEW">
136
+
137
+ declare interface JUserResourcePermissionParams {
138
+ permission: JUserViewPermissionType
139
+ principal: string
140
+ }
141
+
142
+ declare interface JUserResourcePermissionsResponse {
143
+ permissions: JUserResourcePermissionType[]
144
+ principal: string
145
+ }