@opengis/gis 0.2.22 → 0.2.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/gis",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "type": "module",
5
5
  "author": "Softpro",
6
6
  "main": "./dist/index.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@opengis/core": "^0.0.23",
49
- "@opengis/fastify-table": "^2.0.114",
49
+ "@opengis/fastify-table": "^2.0.116",
50
50
  "@opengis/filter": "^0.1.25",
51
51
  "@opengis/form": "^0.0.91",
52
52
  "@opengis/table": "^0.0.27",
@@ -30,32 +30,35 @@ const mapInfoPointSchema = {
30
30
  },
31
31
  };
32
32
 
33
+ const params = { config: { package: 'gis' } };
34
+ const publicParams = { config: { policy: 'L0', package: 'gis' } };
35
+
33
36
  async function route(app) {
34
- app.put('/insert-columns/:token', insertColumns);
35
- app.put('/insert-filters/:token', insertFilters);
36
- app.get('/gis-registry/:slug', { config: { policy: ['public'] } }, gisRegistry);
37
- app.get('/gis-registry/:slug/:objectId', { config: { policy: ['public'] } }, gisRegistry);
38
- app.get('/gis-registry', { config: { policy: ['public'] } }, gisRegistryList);
39
- app.post('/gis-registry', { config: { policy: ['public'] } }, addGisRegistry);
40
- app.put('/gis-registry/:slug', { config: { policy: ['public'] } }, addGisRegistry);
41
- app.delete('/gis-registry/:slug', { config: { policy: ['public'] } }, deleteGisRegistry);
42
- app.get('/map-registry/:slug/:id', { config: { policy: ['public'] } }, mapRegistry);
37
+ app.put('/insert-columns/:token', params, insertColumns);
38
+ app.put('/insert-filters/:token', params, insertFilters);
39
+ app.get('/gis-registry/:slug', publicParams, gisRegistry);
40
+ app.get('/gis-registry/:slug/:objectId', publicParams, gisRegistry);
41
+ app.get('/gis-registry', publicParams, gisRegistryList);
42
+ app.post('/gis-registry', publicParams, addGisRegistry);
43
+ app.put('/gis-registry/:slug', publicParams, addGisRegistry);
44
+ app.delete('/gis-registry/:slug', publicParams, deleteGisRegistry);
45
+ app.get('/map-registry/:slug/:id', publicParams, mapRegistry);
43
46
 
44
- app.get('/xml/:id', { config: { policy: ['public'] } }, metadataXML);
47
+ app.get('/xml/:id', publicParams, metadataXML);
45
48
 
46
- app.get('/get-layer-geom/:id', { config: { policy: ['public'] } }, getLayerGeom);
49
+ app.get('/get-layer-geom/:id', publicParams, getLayerGeom);
47
50
 
48
- app.get('/gis-export/:type/:slug', { config: { policy: ['public'] } }, gisExport);
51
+ app.get('/gis-export/:type/:slug', publicParams, gisExport);
49
52
 
50
- app.get('/gis-service/:id?', { config: { policy: ['public'] } }, getServices);
51
- app.get('/gis-service/:id/:col', { config: { policy: ['public'] } }, getServicesCol);
52
- app.post('/gis-service/:id?', { config: { policy: ['public'] } }, addService);
53
- app.put('/gis-service/:id', { config: { policy: ['public'] } }, addService);
54
- app.delete('/gis-service/:id', { config: { policy: ['public'] } }, deleteService);
55
- app.get('/legend-auto/:id', { config: { policy: ['public'] } }, legendAuto);
53
+ app.get('/gis-service/:id?', publicParams, getServices);
54
+ app.get('/gis-service/:id/:col', publicParams, getServicesCol);
55
+ app.post('/gis-service/:id?', publicParams, addService);
56
+ app.put('/gis-service/:id', publicParams, addService);
57
+ app.delete('/gis-service/:id', publicParams, deleteService);
58
+ app.get('/legend-auto/:id', publicParams, legendAuto);
56
59
 
57
- app.get('/map-info-point', { config: { policy: ['public'] }, schema: mapInfoPointSchema }, mapInfoPoint);
60
+ app.get('/map-info-point', { ...publicParams, schema: mapInfoPointSchema }, mapInfoPoint);
58
61
 
59
- app.get('/dashboard', { config: { policy: ['public'] } }, getDashboard);
62
+ app.get('/dashboard', publicParams, getDashboard);
60
63
  }
61
64
  export default route;
@@ -47,8 +47,8 @@ const schemaInfo = {
47
47
  },
48
48
  };
49
49
 
50
- const publicParams = { config: { policy: 'L0' }, schema: schemaInfo }; // * L0 === public
51
- const privilegedParams = { config: { policy: 'L1', role: 'admin' }, schema: schemaInfo }; // ? just auth or admin
50
+ const publicParams = { config: { policy: 'L0' }, schema: schemaInfo, package: 'gis' }; // * L0 === public
51
+ const privilegedParams = { config: { policy: 'L1', role: 'admin' }, schema: schemaInfo, package: 'gis' }; // ? just auth or admin
52
52
 
53
53
  export default async function route(app) {
54
54
  if (!app.hasRoute({ method: 'GET', url: '/gis-map/:id?' })) {