geoserver-node-client 0.0.7 → 1.2.0

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/demo/index.js DELETED
@@ -1,188 +0,0 @@
1
- import GeoServerRestClient from '../geoserver-rest-client.js';
2
-
3
- const url = 'http://localhost:8080/geoserver/rest/';
4
- const user = 'admin';
5
- const pw = 'geoserver';
6
- const grc = new GeoServerRestClient(url, user, pw);
7
-
8
- // const ws = 'test';
9
- // const sldBody = '<?xml version="1.0" encoding="UTF-8"?>\n<StyledLayerDescriptor version="1.0.0" \n xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" \n xmlns="http://www.opengis.net/sld" \n xmlns:ogc="http://www.opengis.net/ogc" \n xmlns:xlink="http://www.w3.org/1999/xlink" \n xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n <NamedLayer>\n <Name>default_line</Name>\n <UserStyle>\n <Title>Default Line</Title>\n <Abstract>A sample style that draws a line</Abstract>\n <FeatureTypeStyle>\n <Rule>\n <Name>rule1</Name>\n <Title>Blue Line</Title>\n <Abstract>A solid blue line with a 1 pixel width</Abstract>\n <LineSymbolizer>\n <Stroke>\n <CssParameter name="stroke">#0000FF</CssParameter>\n </Stroke>\n </LineSymbolizer>\n </Rule>\n </FeatureTypeStyle>\n </UserStyle>\n </NamedLayer>\n</StyledLayerDescriptor>\n';
10
- // const recursive = true;
11
-
12
- // GENERAL
13
-
14
- grc.exists().then(gsExists => {
15
- console.log('GeoServer REST exists', gsExists);
16
- });
17
- grc.getVersion().then(versionInfo => {
18
- console.log('GeoServer REST version info', prettyJson(versionInfo));
19
- });
20
-
21
- // NAMESPACES
22
-
23
- // const nsPrefix = 'example-namespace';
24
- // const nsUri = 'http://www.example.com'
25
- // grc.namespaces.create(nsPrefix, nsUri).then(retVal => {
26
- // console.log('Created GeoServer NS', prettyJson(retVal));
27
- // });
28
- // grc.namespaces.getAll().then(gsNamespaces => {
29
- // console.log('GeoServer All NS', prettyJson(gsNamespaces));
30
- // });
31
- // grc.namespaces.get(nsPrefix).then(gsNamespaces => {
32
- // console.log('GeoServer NS', prettyJson(gsNamespaces));
33
- // });
34
- // grc.namespaces.delete(nsPrefix).then(gsNamespaces => {
35
- // console.log('Deleted GeoServer NS', prettyJson(gsNamespaces));
36
- // });
37
-
38
- // WORKSPACES
39
-
40
- // grc.workspaces.getAll().then(gsWorkspaces => {
41
- // console.log('GeoServer All WS', prettyJson(gsWorkspaces));
42
- // });
43
- // grc.workspaces.create(ws).then(retVal => {
44
- // console.log('Created GeoServer WS', prettyJson(retVal));
45
- // });
46
- // grc.workspaces.delete(ws, recursive).then(retVal => {
47
- // console.log('Deleted GeoServer WS', prettyJson(retVal));
48
- // });
49
-
50
- // DATASTORES
51
-
52
- // grc.datastores.getDataStores(ws).then(gsDataStores => {
53
- // console.log('GeoServer data stores in WS', ws, prettyJson(gsDataStores));
54
- // });
55
- // grc.datastores.getCoverageStores(ws).then(gsCovStores => {
56
- // console.log('GeoServer coverage stores in WS', ws, prettyJson(gsCovStores));
57
- // });
58
- // grc.datastores.getWmsStores(ws).then(gsWmsStores => {
59
- // console.log('GeoServer WMS stores in WS', ws, prettyJson(gsWmsStores));
60
- // });
61
- // grc.datastores.getWmtsStores(ws).then(gsWmsStores => {
62
- // console.log('GeoServer WMTS stores in WS', ws, prettyJson(gsWmsStores));
63
- // });
64
- // grc.datastores.getDataStore(ws, 'foo').then(gsStore => {
65
- // console.log('GeoServer data store ', prettyJson(gsStore));
66
- // });
67
- // grc.datastores.getCoverageStore(ws, 'foo').then(gsStore => {
68
- // console.log('GeoServer coverage store ', prettyJson(gsStore));
69
- // });
70
- // grc.datastores.getWmsStore(ws, 'foo').then(gsStore => {
71
- // console.log('GeoServer wms store ', prettyJson(gsStore));
72
- // });
73
- // grc.datastores.getWmtsStore(ws, 'foo').then(gsStore => {
74
- // console.log('GeoServer wmts store ', prettyJson(gsStore));
75
- // });
76
- // const geotiff = '/opt/STK10_32354_5670_6_nwfarbe.tif';
77
- // grc.datastores.createGeotiffFromFile('test', 'testDs', 'HymptyLayer', 'DumptyTitle', geotiff).then(gsWmsStores => {
78
- // console.log('GeoServer create GeoTIFF', prettyJson(gsWmsStores));
79
- // });
80
- // grc.datastores.createImageMosaicStore('image_mosaics', 'myname', '/path/to/properties.zip').then(res => {
81
- // console.log('res', res);
82
- // });
83
- // grc.datastores.deleteCoverageStore('test', 'test', true).then(gsWmsStores => {
84
- // console.log('Deleted coverage store', prettyJson(gsWmsStores));
85
- // });
86
- // const wmsUrl = 'https://ows.terrestris.de/osm/service?';
87
- // grc.datastores.createWmsStore(ws, 'testWmsDs', wmsUrl).then(retVal => {
88
- // console.log('Created WMS data store', prettyJson(retVal));
89
- // });
90
- // const wfsCapsUrl = 'https://services.meggsimum.de/geoserver/ows?service=wfs&version=1.1.0&request=GetCapabilities';
91
- // const namespaceUrl = 'http://test';
92
- // grc.datastores.createWfsStore(ws, 'testWfsDs', wfsCapsUrl, namespaceUrl, false).then(retVal => {
93
- // console.log('Created WFS data store', prettyJson(retVal));
94
- // });
95
- // grc.datastores.deleteDataStore(ws, 'testWfsDs', false).then(gsWmsStores => {
96
- // console.log('Deleted data store', prettyJson(gsWmsStores));
97
- // });
98
- // const initZipArchivePath = '/home/meggs/workspace/meggsimum/sauber/sauber-sdi-docker/geoserver_publisher/gs-img-mosaic-tpl/init.zip';
99
- // grc.datastores.createImageMosaicStore('test-cm', 'testCovStore', initZipArchivePath).then(retVal => {
100
- // console.log('Created Image Mosaic Store', retVal);
101
- // });
102
- // const gpkgPath = 'natural_earth_vector.gpkg';
103
- // grc.datastores.createGpkgStore(ws, 'testGpkgStore', gpkgPath).then(retVal => {
104
- // console.log('Created GPKG Store', retVal);
105
- // });
106
-
107
- // LAYERS
108
-
109
- // grc.layers.get('fooWs:barLayer').then(layer => {
110
- // console.log('GeoServer layer by qualified name', prettyJson(layer));
111
- // });
112
- // grc.layers.getAll().then(allLayers => {
113
- // console.log('All GeoServer layers', prettyJson(allLayers));
114
- // });
115
- // grc.layers.publishFeatureTypeDefaultDataStore(ws, 'nativeFtName', 'aTestName', 'Test Title', 'EPSG:31468', false).then(retVal => {
116
- // console.log('Created Layer', prettyJson(retVal));
117
- // });
118
- // grc.layers.publishFeatureType(ws, 'testdataStore', 'nativeFtName', 'aTestName2', 'Test Title 2', 'EPSG:31468', true).then(retVal => {
119
- // console.log('Created Layer', prettyJson(retVal));
120
- // });
121
- // const nativeBoundingBox = {
122
- // minx: 8.15,
123
- // maxx: 8.16,
124
- // miny: 50.0,
125
- // maxy: 50.1,
126
- // crs: {
127
- // '@class': 'projected',
128
- // $: 'EPSG:4326'
129
- // }
130
- // };
131
- // grc.layers.publishFeatureType(ws, 'testdataStore', 'nativeFtName', 'aTestNameBbox', 'Test Title Bbox', 'EPSG:4326', true, null, nativeBoundingBox).then(retVal => {
132
- // console.log('Created FT with explicit native BBOX', prettyJson(retVal));
133
- // });
134
- // grc.layers.publishWmsLayer(ws, 'testWmsDs', 'OSM-Overlay-WMS', 'aTestName4Wms', 'Test Title WMS', 'EPSG:900913', true).then(retVal => {
135
- // console.log('Created WMS Layer', prettyJson(retVal));
136
- // });
137
- // grc.layers.publishDbRaster(ws, 'testdataStore', 'nativeRasterName', 'a-db-raster', 'Dummy DB Raster Title', null, true).then(retVal => {
138
- // console.log('Created DB Raster Layer', prettyJson(retVal))
139
- // });
140
- // grc.layers.deleteFeatureType(ws, 'testdataStore', 'aTestName2', true).then(retVal => {
141
- // console.log('Deleted Layer', prettyJson(retVal))
142
- // });
143
- // grc.layers.enableTimeCoverage(ws, 'testDs', 'HymptyLayer', 'DISCRETE_INTERVAL', 3600000, 'MAXIMUM').then(retVal => {
144
- // console.log('Enabled time for layer', prettyJson(retVal))
145
- // });
146
- // grc.layers.getCoverage(ws, 'testCovStore', 'testCoverage').then(cov => {
147
- // console.log(cov.coverage);
148
- // });
149
-
150
- // STYLES
151
-
152
- // grc.styles.getDefaults().then(gsWorkspaces => {
153
- // console.log('GeoServer default styles', prettyJson(gsWorkspaces));
154
- // });
155
- // grc.styles.getInWorkspace(ws).then(gsWorkspaces => {
156
- // console.log('GeoServer styles for WS', prettyJson(gsWorkspaces));
157
- // });
158
- // grc.styles.getAllWorkspaceStyles().then(allGsWsStyles => {
159
- // console.log('GeoServer all WS styles', prettyJson(allGsWsStyles));
160
- // });
161
- // grc.styles.getAll().then(allGsStyles => {
162
- // console.log('GeoServer all styles', prettyJson(allGsStyles));
163
- // });
164
- // grc.styles.publish(ws, 'testStyle3', sldBody).then(retVal => {
165
- // console.log('Publish GeoServer style', retVal);
166
- // });
167
-
168
- // IMAGEMOSAIC
169
-
170
- // grc.imagemosaics.getGranules('imagemosaic_test', 'testCovStore', 'testCov').then(retVal => {
171
- // console.log('Get Granules Image Mosaic', retVal);
172
- // });
173
- // const filePathCoverages = 'file:///opt/raster_data'
174
- // grc.imagemosaics.harvestGranules('imagemosaic_test', 'testCovStore', filePathCoverages).then(retVal => {
175
- // console.log('Harveset Granules Image Mosaic', retVal);
176
- // });
177
- // const coverageToAdd = 'file:///opt/raster_data/a.tif'
178
- // grc.imagemosaics.addGranuleByServerFile('imagemosaic_test', 'testCovStore', coverageToAdd).then(retVal => {
179
- // console.log('Add Granule by Server File', retVal);
180
- // });
181
- // const coverageToDelete = '/opt/raster_data/a.tif';
182
- // grc.imagemosaics.deleteSingleGranule('imagemosaic_test', 'testCovStore', 'testCov', coverageToDelete).then(retVal => {
183
- // console.log('Deleting Granule', retVal);
184
- // });
185
-
186
- function prettyJson (obj) {
187
- return JSON.stringify(obj, null, 2);
188
- }
package/release-it.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "hooks": {
3
- "before:init": ["npm run lint", "npm test"]
4
- },
5
- "github": {
6
- "release": true
7
- }
8
- }
Binary file
Binary file