jmapcloud-ng-core-types 1.1.16 → 1.1.19

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.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ /// <reference path="./public/global-aliases.d.ts" />
2
+ export {}
package/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Feature, FeatureCollection, LineString, MultiLineString, Point, Polygon } from "geojson"
2
+ import { JForm as JFormJMC } from "jmapcloud-types"
2
3
  import { Store } from "redux"
3
4
 
4
5
  export interface JCoreService extends JCoreMainService {
@@ -12,13 +13,13 @@ export interface JCoreService extends JCoreMainService {
12
13
  Geolocation: JGeolocationService
13
14
  Geometry: JGeometryService
14
15
  MouseOver: JMouseOverService
16
+ Attachment: JAttachmentService
15
17
  Form: JFormService
16
18
  FormJMC: JFormJMCService
17
19
  Event: JEventService
18
20
  History: JHistoryService
19
21
  Extension: JExtensionService
20
22
  Server: JServerService
21
- Photo: JPhotoService
22
23
  Util: JUtilService
23
24
  Library: JLibraryService
24
25
  Projection: JProjectionService
@@ -138,13 +139,6 @@ export interface JLocalStorageService {
138
139
  remove(key: string): void
139
140
  }
140
141
 
141
- export interface JPhotoService {
142
- displayFeaturePhotosPopup(layerId: JId, featureId: JId): Promise<void>
143
- displayPhotosPopup(photos: JPhoto[], params?: JPhotoOpenPopupParams): void
144
- downloadById(photoId: JId): Promise<void>
145
- closePhotoPopup(): void
146
- }
147
-
148
142
  export interface JFeatureService {
149
143
  getById(layerId: JId, featureId: JId, includeAllAttributes?: boolean): Promise<GeoJSON.Feature>
150
144
  getByIds(layerId: JId, featureIds: JId[]): Promise<GeoJSON.Feature[]>
@@ -198,7 +192,6 @@ export interface JEventService {
198
192
  Map: JMapEventModule
199
193
  Geocoding: JGeocodingEventModule
200
194
  SimpleSearch: JSimpleSearchEventModule
201
- Photo: JPhotoEventModule
202
195
  Project: JProjectEventModule
203
196
  User: JUserEventModule
204
197
  Feature: JFeatureEventModule
@@ -350,12 +343,6 @@ export interface JMapEventModule extends JEventModule {
350
343
  }
351
344
  }
352
345
 
353
- export interface JPhotoEventModule extends JEventModule {
354
- on: {
355
- containerCreated(listenerId: string, fn: (params: JPhotoEventContainerCreatedParams) => void): void
356
- }
357
- }
358
-
359
346
  export interface JFeatureEventModule extends JEventModule {
360
347
  on: {
361
348
  deletion(listenerId: string, fn: (params: JFeatureEventDeleteParams) => void): void
@@ -395,7 +382,6 @@ export interface JCoreState {
395
382
  table: JTableState
396
383
  user: JUserState
397
384
  language: JLanguageState
398
- photo: JPhotoState
399
385
  geocoding: JGeocodingState
400
386
  simpleSearch: JSimpleSearchState
401
387
  geolocation: JGeolocationState
@@ -525,15 +511,6 @@ export interface JTableState {
525
511
  tables: JTable[]
526
512
  }
527
513
 
528
- export interface JPhotoState {
529
- selectedPhotoId: JId | undefined
530
- photos: JPhoto[]
531
- isPopupOpened: boolean
532
- isLoading: boolean
533
- hasLoadingError: boolean
534
- isDownloading: boolean
535
- }
536
-
537
514
  export interface JUserState extends JTokenInfo {
538
515
  isAnonymous: boolean
539
516
  anonymousOrganizationId: string
@@ -569,6 +546,16 @@ export interface JFormJMCService {
569
546
  getForm(dataSourceId: string): Promise<JFormJMC | null>
570
547
  }
571
548
 
549
+ export interface JAttachmentService {
550
+ getByItemId(dataSourceId: JId, itemId: JId): Promise<JAttachment[]>
551
+ create(dataSourceId: string, params: JCreateAttachmentParams): Promise<string>
552
+ remove(dataSourceId: string, attachmentId: string): Promise<string>
553
+ update(dataSourceId: string, attachmentId: string, params: JUpdateAttachmentParams): Promise<string>
554
+ download(dataSourceId: string, attachmentId: string): Promise<{ data: Blob; headers: any }>
555
+ downloadToDevice(attachment: JAttachmentFile, dataSourceId: string): Promise<void>
556
+ previewAttachments(attachment: JAttachmentFile, dataSourceId: string): Promise<void>
557
+ }
558
+
572
559
  export interface JFormService {
573
560
  // REPO METHODS
574
561
  getFormsMetaDataByLayerId(layerId: JId): Promise<JFormMetaData[]>
@@ -898,10 +885,11 @@ export interface JTableService {
898
885
  getTables(): JTable[]
899
886
  getTableData(tableId: JId, params: JTableDataParams): Promise<JTableData>
900
887
  getById(tableId: JId): JTable
901
- createRow(tableId: JId, row: { [key: string]: any }): Promise<void>
888
+ createRow(tableId: JId, row: { [key: string]: any }): Promise<{ id: JId; links: Array<any> }>
902
889
  updateRow(tableId: JId, rowId: number, row: { [key: string]: any }): Promise<void>
903
890
  deleteRow(tableId: JId, rowId: number): Promise<void>
904
891
  getDataSourceAttributes(tableId: JId): Promise<JDataSourceAttribute[]>
892
+ setDynamicFilterActive(tableId: JId, filterId: string, isActive: boolean): void
905
893
  }
906
894
 
907
895
  export interface JLayerSearchService {
@@ -1001,40 +989,49 @@ export interface JServerService {
1001
989
  getAllIdentityProvidersById(): JServerIdentityProviderById
1002
990
  }
1003
991
 
992
+ export interface JDynamicLayerFilterService {
993
+ // TODO JMAP8-3266 : create new service
994
+ }
995
+ export interface JDynamicTableFilterService {
996
+ // TODO JMAP8-3266 : create new service
997
+ }
998
+
999
+ // TODO JMAP8-3266 : refactor this
1004
1000
  export interface JDynamicFilterService {
1005
- isAvailable(layerId: JId): boolean
1006
- isActive(layerId: JId): boolean
1007
- setIsActive(layerId: JId, isActive: boolean): void
1008
- getByLayerId(layerId: JId): JDynamicFilter
1009
- getAllOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1010
- getAllMultipleValuesOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1011
- getAllTwoValuesOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1012
- getOperatorsForAttributeType(attributeType: JLAYER_ATTRIBUTE_TYPES): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1013
- getConditionError(condition: JDynamicFilterCondition): string | undefined
1014
- isConditionValid(condition: JDynamicFilterCondition): boolean
1015
- existSimilarCondition(condition: JDynamicFilterCondition, isUpdate?: boolean): boolean
1016
- set(params: JDynamicFilterSetParams[]): void
1017
- createCondition(condition: JDynamicFilterCondition): number
1018
- updateCondition(condition: JDynamicFilterCondition): void
1019
- removeConditions(layerId: JId, conditionsIds: number[]): void
1020
- isNoValueOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
1021
- isMultipleValuesOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
1022
- isTwoValuesOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
1023
- getConditionValueError(
1024
- operator: JLAYER_DYNAMIC_FILTER_OPERATORS,
1025
- attributeType: JLAYER_ATTRIBUTE_TYPES,
1026
- value?: any
1027
- ): string | undefined
1028
- isConditionValueValid(
1029
- operator: JLAYER_DYNAMIC_FILTER_OPERATORS,
1030
- attributeType: JLAYER_ATTRIBUTE_TYPES,
1031
- value?: any
1032
- ): boolean
1033
- canAttributeTypeAcceptMultipleValuesOperators(attributeType: JLAYER_ATTRIBUTE_TYPES): boolean
1034
- canAttributeTypeAcceptTwoValuesOperators(attributeType: JLAYER_ATTRIBUTE_TYPES): boolean
1035
- getIsBetweenValuesError(attributeType: JLAYER_ATTRIBUTE_TYPES, value1: any, value2: any): string | undefined
1036
- getNowValue(): string
1037
- getAllLastOperatorUnits(): string[]
1001
+ // isAvailable(layerId: JId): boolean
1002
+ // isActive(layerId: JId): boolean
1003
+ setIsActive(layerId: JId, filterId: string, isActive: boolean): void
1004
+ // setIsActive(layerId: JId, isActive: boolean): void
1005
+ // getByLayerId(layerId: JId): JDynamicFilter
1006
+ // getAllOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1007
+ // getAllMultipleValuesOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1008
+ // getAllTwoValuesOperators(): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1009
+ // getOperatorsForAttributeType(attributeType: JLAYER_ATTRIBUTE_TYPES): JLAYER_DYNAMIC_FILTER_OPERATORS[]
1010
+ // getConditionError(condition: JDynamicFilterCondition): string | undefined
1011
+ // isConditionValid(condition: JDynamicFilterCondition): boolean
1012
+ // existSimilarCondition(condition: JDynamicFilterCondition, isUpdate?: boolean): boolean
1013
+ // set(params: JDynamicFilterSetParams[]): void
1014
+ // createCondition(condition: JDynamicFilterCondition): number
1015
+ // updateCondition(condition: JDynamicFilterCondition): void
1016
+ // removeConditions(layerId: JId, conditionsIds: number[]): void
1017
+ // isNoValueOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
1018
+ // isMultipleValuesOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
1019
+ // isTwoValuesOperator(operator: JLAYER_DYNAMIC_FILTER_OPERATORS): boolean
1020
+ // getConditionValueError(
1021
+ // operator: JLAYER_DYNAMIC_FILTER_OPERATORS,
1022
+ // attributeType: JLAYER_ATTRIBUTE_TYPES,
1023
+ // value?: any
1024
+ // ): string | undefined
1025
+ // isConditionValueValid(
1026
+ // operator: JLAYER_DYNAMIC_FILTER_OPERATORS,
1027
+ // attributeType: JLAYER_ATTRIBUTE_TYPES,
1028
+ // value?: any
1029
+ // ): boolean
1030
+ // canAttributeTypeAcceptMultipleValuesOperators(attributeType: JLAYER_ATTRIBUTE_TYPES): boolean
1031
+ // canAttributeTypeAcceptTwoValuesOperators(attributeType: JLAYER_ATTRIBUTE_TYPES): boolean
1032
+ // getIsBetweenValuesError(attributeType: JLAYER_ATTRIBUTE_TYPES, value1: any, value2: any): string | undefined
1033
+ // getNowValue(): string
1034
+ // getAllLastOperatorUnits(): string[]
1038
1035
  }
1039
1036
 
1040
1037
  // MISC
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.1.16",
3
+ "version": "1.1.19",
4
4
  "description": "JMap Cloud specific version of JMap Cloud NG Core types and interfaces",
5
5
  "main": "index.js",
6
+ "types": "index.d.ts",
6
7
  "scripts": {
7
8
  "test": "echo \"Error: no test specified\" && exit 1",
8
- "pub-github": "node build/buildfile.js publish-github;",
9
- "doc-test": "node build/buildfile.js doc-test;"
9
+ "update-types-bridge": "node build/codemod-export-globals.js && node build/auto-add-imports.js",
10
+ "pub-github": "npm run update-types-bridge && node build/buildfile.js publish-github;",
11
+ "doc-test": "npm run update-types-bridge && node build/buildfile.js doc-test;"
10
12
  },
11
13
  "repository": {
12
14
  "type": "git",
@@ -31,6 +33,7 @@
31
33
  "@auth0/auth0-spa-js": "^2.1.3",
32
34
  "@types/geojson": "^7946.0.14",
33
35
  "geojson": "^0.5.0",
36
+ "jmapcloud-types": "../../../packages/jmapcloud-types",
34
37
  "maplibre-gl": "^4.7.1",
35
38
  "redux": "^5.0.1"
36
39
  }