geoserver-node-client 1.6.1 → 2.0.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/README.md +23 -22
- package/dist/geoserver-rest-client.js +38 -39
- package/dist/package.json +17 -10
- package/dist/src/about.js +35 -86
- package/dist/src/datastore.js +524 -950
- package/dist/src/imagemosaic.js +103 -211
- package/dist/src/layer.js +718 -1287
- package/dist/src/layergroup.js +128 -226
- package/dist/src/namespace.js +110 -222
- package/dist/src/reset-reload.js +41 -96
- package/dist/src/security.js +279 -567
- package/dist/src/settings.js +127 -255
- package/dist/src/style.js +228 -448
- package/dist/src/util/geoserver.js +17 -44
- package/dist/src/workspace.js +116 -229
- package/dist/types/geoserver-rest-client.d.ts +53 -0
- package/dist/types/src/about.d.ts +30 -0
- package/dist/types/src/datastore.d.ts +241 -0
- package/dist/types/src/imagemosaic.d.ts +61 -0
- package/dist/types/src/layer.d.ts +265 -0
- package/dist/types/src/layergroup.d.ts +60 -0
- package/dist/types/src/namespace.d.ts +53 -0
- package/dist/types/src/reset-reload.d.ts +36 -0
- package/dist/types/src/security.d.ts +110 -0
- package/dist/types/src/settings.d.ts +62 -0
- package/dist/types/src/style.d.ts +91 -0
- package/dist/types/src/util/geoserver.d.ts +22 -0
- package/dist/types/src/workspace.d.ts +55 -0
- package/package.json +17 -10
- package/src/datastore.js +1 -1
- package/src/layer.js +25 -25
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for GeoServer data stores
|
|
3
|
+
*
|
|
4
|
+
* @module DatastoreClient
|
|
5
|
+
*/
|
|
6
|
+
export default class DatastoreClient {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a GeoServer REST DatastoreClient instance.
|
|
9
|
+
*
|
|
10
|
+
* @param {String} url The URL of the GeoServer REST API endpoint
|
|
11
|
+
* @param {String} auth The Basic Authentication string
|
|
12
|
+
*/
|
|
13
|
+
constructor(url: string, auth: string);
|
|
14
|
+
url: string;
|
|
15
|
+
auth: string;
|
|
16
|
+
/**
|
|
17
|
+
* Get all DataStores in a workspace.
|
|
18
|
+
*
|
|
19
|
+
* @param {String} workspace The workspace to get DataStores for
|
|
20
|
+
*
|
|
21
|
+
* @returns {Object} An object containing store details
|
|
22
|
+
*/
|
|
23
|
+
getDataStores(workspace: string): Object;
|
|
24
|
+
/**
|
|
25
|
+
* Get all CoverageStores in a workspace.
|
|
26
|
+
*
|
|
27
|
+
* @param {String} workspace The workspace to get CoverageStores for
|
|
28
|
+
*
|
|
29
|
+
* @returns {Object} An object containing store details
|
|
30
|
+
*/
|
|
31
|
+
getCoverageStores(workspace: string): Object;
|
|
32
|
+
/**
|
|
33
|
+
* Get all WmsStores in a workspace.
|
|
34
|
+
*
|
|
35
|
+
* @param {String} workspace The workspace to get WmsStores for
|
|
36
|
+
*
|
|
37
|
+
* @returns {Object} An object containing store details
|
|
38
|
+
*/
|
|
39
|
+
getWmsStores(workspace: string): Object;
|
|
40
|
+
/**
|
|
41
|
+
* Get all WmtsStores in a workspace.
|
|
42
|
+
*
|
|
43
|
+
* @param {String} workspace The workspace to get WmtsStores for
|
|
44
|
+
*
|
|
45
|
+
* @returns {Object} An object containing store details
|
|
46
|
+
*/
|
|
47
|
+
getWmtsStores(workspace: string): Object;
|
|
48
|
+
/**
|
|
49
|
+
* Get information about various store types in a workspace.
|
|
50
|
+
*
|
|
51
|
+
* @param {String} workspace The workspace name
|
|
52
|
+
* @param {String} storeType The type of store
|
|
53
|
+
*
|
|
54
|
+
* @throws Error if request fails
|
|
55
|
+
*
|
|
56
|
+
* @returns {Object} An object containing store details or undefined if it cannot be found
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
private getStores;
|
|
60
|
+
/**
|
|
61
|
+
* Get specific DataStore by name in a workspace.
|
|
62
|
+
*
|
|
63
|
+
* @param {String} workspace The workspace to search DataStore in
|
|
64
|
+
* @param {String} dataStore DataStore name
|
|
65
|
+
*
|
|
66
|
+
* @returns {Object} An object containing store details or undefined if it cannot be found
|
|
67
|
+
*/
|
|
68
|
+
getDataStore(workspace: string, dataStore: string): Object;
|
|
69
|
+
/**
|
|
70
|
+
* Get specific CoverageStore by name in a workspace.
|
|
71
|
+
*
|
|
72
|
+
* @param {String} workspace The workspace to search CoverageStore in
|
|
73
|
+
* @param {String} covStore CoverageStore name
|
|
74
|
+
*
|
|
75
|
+
* @returns {Object} An object containing store details or undefined if it cannot be found
|
|
76
|
+
*/
|
|
77
|
+
getCoverageStore(workspace: string, covStore: string): Object;
|
|
78
|
+
/**
|
|
79
|
+
* Get specific WmsStore by name in a workspace.
|
|
80
|
+
*
|
|
81
|
+
* @param {String} workspace The workspace to search WmsStore in
|
|
82
|
+
* @param {String} wmsStore WmsStore name
|
|
83
|
+
*
|
|
84
|
+
* @returns {Object} An object containing store details or undefined if it cannot be found
|
|
85
|
+
*
|
|
86
|
+
*/
|
|
87
|
+
getWmsStore(workspace: string, wmsStore: string): Object;
|
|
88
|
+
/**
|
|
89
|
+
* Get specific WmtsStore by name in a workspace.
|
|
90
|
+
*
|
|
91
|
+
* @param {String} workspace The workspace to search WmtsStore in
|
|
92
|
+
* @param {String} wmtsStore WmtsStore name
|
|
93
|
+
*
|
|
94
|
+
* @returns {Object} An object containing store details or undefined if it cannot be found
|
|
95
|
+
*/
|
|
96
|
+
getWmtsStore(workspace: string, wmtsStore: string): Object;
|
|
97
|
+
/**
|
|
98
|
+
* Get GeoServer store by type
|
|
99
|
+
*
|
|
100
|
+
* @param {String} workspace The name of the workspace
|
|
101
|
+
* @param {String} storeName The name of the store
|
|
102
|
+
* @param {String} storeType The type of the store
|
|
103
|
+
*
|
|
104
|
+
* @throws Error if request fails
|
|
105
|
+
*
|
|
106
|
+
* @returns {Object} An object containing store details or undefined if it cannot be found
|
|
107
|
+
* @private
|
|
108
|
+
*/
|
|
109
|
+
private getStore;
|
|
110
|
+
/**
|
|
111
|
+
* Creates a GeoTIFF store from a file by path and publishes it as layer.
|
|
112
|
+
* The GeoTIFF file has to be placed on the server, where your GeoServer
|
|
113
|
+
* is running.
|
|
114
|
+
*
|
|
115
|
+
* @param {String} workspace The workspace to create GeoTIFF store in
|
|
116
|
+
* @param {String} coverageStore The name of the new GeoTIFF store
|
|
117
|
+
* @param {String} layerName The published name of the new layer
|
|
118
|
+
* @param {String} layerTitle The published title of the new layer
|
|
119
|
+
* @param {String} filePath The path to the GeoTIFF file on the server
|
|
120
|
+
*
|
|
121
|
+
* @throws Error if request fails
|
|
122
|
+
*
|
|
123
|
+
* @returns {String} The successful response text
|
|
124
|
+
*/
|
|
125
|
+
createGeotiffFromFile(workspace: string, coverageStore: string, layerName: string, layerTitle: string, filePath: string): string;
|
|
126
|
+
/**
|
|
127
|
+
* Creates a GeoTIFF store from a file by stream and publishes it as layer.
|
|
128
|
+
* The GeoTIFF file is placed on the server, where your GeoServer
|
|
129
|
+
* is running.
|
|
130
|
+
*
|
|
131
|
+
* @param {String} workspace The workspace to create GeoTIFF store in
|
|
132
|
+
* @param {String} coverageStore The name of the new GeoTIFF store
|
|
133
|
+
* @param {String} layerName The published name of the new layer
|
|
134
|
+
* @param {String} layerTitle The published title of the new layer
|
|
135
|
+
* @param {fs.ReadStream} readStream The stream of the GeoTIFF file
|
|
136
|
+
* @param {Number} fileSizeInBytes The number of bytes of the stream
|
|
137
|
+
*
|
|
138
|
+
* @throws Error if request fails
|
|
139
|
+
*
|
|
140
|
+
* @returns {String} The successful response text
|
|
141
|
+
*/
|
|
142
|
+
createGeotiffFromStream(workspace: string, coverageStore: string, layerName: string, layerTitle: string, readStream: fs.ReadStream, fileSizeInBytes: number): string;
|
|
143
|
+
/**
|
|
144
|
+
* Creates a PostGIS based data store.
|
|
145
|
+
*
|
|
146
|
+
* @param {String} workspace The WS to create the data store in
|
|
147
|
+
* @param {String} namespaceUri The namespace URI of the workspace
|
|
148
|
+
* @param {String} dataStore The data store name to be created
|
|
149
|
+
* @param {String} pgHost The PostGIS DB host
|
|
150
|
+
* @param {Number} pgPort The PostGIS DB port
|
|
151
|
+
* @param {String} pgUser The PostGIS DB user
|
|
152
|
+
* @param {String} pgPassword The PostGIS DB password
|
|
153
|
+
* @param {String} pgSchema The PostGIS DB schema
|
|
154
|
+
* @param {String} pgDb The PostGIS DB name
|
|
155
|
+
* @param {Boolean} [exposePk] expose primary key, defaults to false
|
|
156
|
+
*
|
|
157
|
+
* @throws Error if request fails
|
|
158
|
+
*/
|
|
159
|
+
createPostgisStore(workspace: string, namespaceUri: string, dataStore: string, pgHost: string, pgPort: number, pgUser: string, pgPassword: string, pgSchema: string, pgDb: string, exposePk?: boolean): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Creates an ImageMosaic store from a zip archive with the 3 necessary files
|
|
162
|
+
* - datastore.properties
|
|
163
|
+
* - indexer.properties
|
|
164
|
+
* - timeregex.properties
|
|
165
|
+
*
|
|
166
|
+
* The zip archive has to be given as absolute path, so before it has to be
|
|
167
|
+
* placed on the server, where your GeoServer is running.
|
|
168
|
+
*
|
|
169
|
+
* @param {String} workspace The WS to create the data store in
|
|
170
|
+
* @param {String} dataStore The data store name
|
|
171
|
+
* @param {String} zipArchivePath Absolute path to zip archive with the 3 properties files
|
|
172
|
+
*
|
|
173
|
+
* @throws Error if request fails
|
|
174
|
+
*
|
|
175
|
+
* @returns {String} The response text
|
|
176
|
+
*/
|
|
177
|
+
createImageMosaicStore(workspace: string, coverageStore: any, zipArchivePath: string): string;
|
|
178
|
+
/**
|
|
179
|
+
* Creates a WMS based data store.
|
|
180
|
+
*
|
|
181
|
+
* @param {String} workspace The WS to create the data store in
|
|
182
|
+
* @param {String} dataStore The data store name
|
|
183
|
+
* @param {String} wmsCapabilitiesUrl Base WMS capabilities URL
|
|
184
|
+
*
|
|
185
|
+
* @throws Error if request fails
|
|
186
|
+
*/
|
|
187
|
+
createWmsStore(workspace: string, dataStore: string, wmsCapabilitiesUrl: string): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* Creates a WMTS based data store.
|
|
190
|
+
*
|
|
191
|
+
* @param {String} workspace The WS to create the data store in
|
|
192
|
+
* @param {String} dataStore The data store name
|
|
193
|
+
* @param {String} wmtsCapabilitiesUrl Base WMTS capabilities URL
|
|
194
|
+
*
|
|
195
|
+
* @throws Error if request fails
|
|
196
|
+
*/
|
|
197
|
+
createWmtsStore(workspace: string, dataStore: string, wmtsCapabilitiesUrl: string): Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Creates a WFS based data store.
|
|
200
|
+
*
|
|
201
|
+
* @param {String} workspace The WS to create the data store in
|
|
202
|
+
* @param {String} dataStore The data store name
|
|
203
|
+
* @param {String} wfsCapabilitiesUrl WFS capabilities URL
|
|
204
|
+
* @param {String} namespaceUrl URL of the GeoServer namespace
|
|
205
|
+
* @param {Boolean} [useHttpConnectionPooling=true] use HTTP connection pooling for WFS connection
|
|
206
|
+
*
|
|
207
|
+
* @throws Error if request fails
|
|
208
|
+
*/
|
|
209
|
+
createWfsStore(workspace: string, dataStore: string, wfsCapabilitiesUrl: string, namespaceUrl: string, useHttpConnectionPooling?: boolean): Promise<void>;
|
|
210
|
+
/**
|
|
211
|
+
* Deletes a data store.
|
|
212
|
+
*
|
|
213
|
+
* @param {String} workspace The workspace where the data store is in
|
|
214
|
+
* @param {String} coverageStore Name of data store to delete
|
|
215
|
+
* @param {String} recurse Flag to enable recursive deletion
|
|
216
|
+
*
|
|
217
|
+
* @throws Error if request fails
|
|
218
|
+
*/
|
|
219
|
+
deleteDataStore(workspace: string, dataStore: any, recurse: string): Promise<void>;
|
|
220
|
+
/**
|
|
221
|
+
* Deletes a CoverageStore.
|
|
222
|
+
*
|
|
223
|
+
* @param {String} workspace The workspace where the CoverageStore is in
|
|
224
|
+
* @param {String} coverageStore Name of CoverageStore to delete
|
|
225
|
+
* @param {String} recurse Flag to enable recursive deletion
|
|
226
|
+
*
|
|
227
|
+
* @throws Error if request fails
|
|
228
|
+
*/
|
|
229
|
+
deleteCoverageStore(workspace: string, coverageStore: string, recurse: string): Promise<void>;
|
|
230
|
+
/**
|
|
231
|
+
* Creates a GeoPackage store from a file placed in the geoserver_data dir.
|
|
232
|
+
*
|
|
233
|
+
* @param {String} workspace The WS to create the data store in
|
|
234
|
+
* @param {String} dataStore The data store name
|
|
235
|
+
* @param {String} gpkgPath Relative path to GeoPackage file within geoserver_data dir
|
|
236
|
+
*
|
|
237
|
+
* @throws Error if request fails
|
|
238
|
+
*/
|
|
239
|
+
createGpkgStore(workspace: string, dataStore: string, gpkgPath: string): Promise<void>;
|
|
240
|
+
}
|
|
241
|
+
import fs from 'fs';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for GeoServer image mosaics
|
|
3
|
+
*
|
|
4
|
+
* @module ImageMosaicClient
|
|
5
|
+
*/
|
|
6
|
+
export default class ImageMosaicClient {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a GeoServer REST ImageMosaicClient instance.
|
|
9
|
+
*
|
|
10
|
+
* @param {String} url The URL of the GeoServer REST API endpoint
|
|
11
|
+
* @param {String} auth The Basic Authentication string
|
|
12
|
+
*/
|
|
13
|
+
constructor(url: string, auth: string);
|
|
14
|
+
url: string;
|
|
15
|
+
auth: string;
|
|
16
|
+
/**
|
|
17
|
+
* Returns all granules of an image mosaic.
|
|
18
|
+
*
|
|
19
|
+
* @param {String} workspace Workspace of image mosaic
|
|
20
|
+
* @param {String} coverageStore CoverageStore of image mosaic
|
|
21
|
+
* @param {String} coverage Name of image mosaic
|
|
22
|
+
*
|
|
23
|
+
* @throws Error if request fails
|
|
24
|
+
*
|
|
25
|
+
* @returns {Object} An object with the granules
|
|
26
|
+
*/
|
|
27
|
+
getGranules(workspace: string, coverageStore: string, coverage: string): Object;
|
|
28
|
+
/**
|
|
29
|
+
* Harvests all granules in the given folder for an image mosaic.
|
|
30
|
+
*
|
|
31
|
+
* @param {String} workspace Workspace of image mosaic
|
|
32
|
+
* @param {String} coverageStore CoverageStore of image mosaic
|
|
33
|
+
* @param {String} filePath Server path of folder to harvest
|
|
34
|
+
*
|
|
35
|
+
* @throws Error if request fails
|
|
36
|
+
*
|
|
37
|
+
* @returns {Object} An object with the granules
|
|
38
|
+
*/
|
|
39
|
+
harvestGranules(workspace: string, coverageStore: string, filePath: string): Object;
|
|
40
|
+
/**
|
|
41
|
+
* Adds a granule (defined by a server file) to an image mosaic.
|
|
42
|
+
*
|
|
43
|
+
* @param {String} workspace Workspace of image mosaic
|
|
44
|
+
* @param {String} coverageStore CoverageStore of image mosaic
|
|
45
|
+
* @param {String} filePath Server file path of new granule
|
|
46
|
+
*
|
|
47
|
+
* @throws Error if request fails
|
|
48
|
+
*/
|
|
49
|
+
addGranuleByServerFile(workspace: string, coverageStore: string, filePath: string): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Deletes a single granule of an image mosaic.
|
|
52
|
+
*
|
|
53
|
+
* @param {String} workspace Workspace of image mosaic
|
|
54
|
+
* @param {String} coverageStore CoverageStore of image mosaic
|
|
55
|
+
* @param {String} coverage Name of image mosaic
|
|
56
|
+
* @param {String} covFileLocation Location of coverage file
|
|
57
|
+
*
|
|
58
|
+
* @throws Error if request fails
|
|
59
|
+
*/
|
|
60
|
+
deleteSingleGranule(workspace: string, coverageStore: string, coverage: string, covFileLocation: string): Promise<boolean>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for GeoServer layers
|
|
3
|
+
*
|
|
4
|
+
* @module LayerClient
|
|
5
|
+
*/
|
|
6
|
+
export default class LayerClient {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a GeoServer REST LayerClient instance.
|
|
9
|
+
*
|
|
10
|
+
* @param {String} url The URL of the GeoServer REST API endpoint
|
|
11
|
+
* @param {String} auth The Basic Authentication string
|
|
12
|
+
*/
|
|
13
|
+
constructor(url: string, auth: string);
|
|
14
|
+
url: string;
|
|
15
|
+
auth: string;
|
|
16
|
+
/**
|
|
17
|
+
* Returns a GeoServer layer by the given workspace and layer name,
|
|
18
|
+
* e.g. "myWs:myLayer".
|
|
19
|
+
*
|
|
20
|
+
* @param {String} workspace The name of the workspace, can be undefined
|
|
21
|
+
* @param {String} layerName The name of the layer to query
|
|
22
|
+
*
|
|
23
|
+
* @throws Error if request fails
|
|
24
|
+
*
|
|
25
|
+
* @returns {Object} An object with layer information or undefined if it cannot be found
|
|
26
|
+
*/
|
|
27
|
+
get(workspace: string, layerName: string): Object;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the attribution text and link of a layer.
|
|
30
|
+
*
|
|
31
|
+
* @param {String} workspace The name of the workspace, can be undefined
|
|
32
|
+
* @param {String} layerName The name of the layer to query
|
|
33
|
+
* @param {String} [attributionText] The attribution text
|
|
34
|
+
* @param {String} [attributionLink] The attribution link
|
|
35
|
+
*
|
|
36
|
+
* @throws Error if request fails
|
|
37
|
+
*/
|
|
38
|
+
modifyAttribution(workspace: string, layerName: string, attributionText?: string, attributionLink?: string): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Returns all layers in the GeoServer.
|
|
41
|
+
*
|
|
42
|
+
* @throws Error if request fails
|
|
43
|
+
*
|
|
44
|
+
* @returns {Object} An object with all layer information
|
|
45
|
+
*/
|
|
46
|
+
getAll(): Object;
|
|
47
|
+
/**
|
|
48
|
+
* Get all layers of a workspace.
|
|
49
|
+
*
|
|
50
|
+
* @param {String} workspace The workspace
|
|
51
|
+
*
|
|
52
|
+
* @throws Error if request fails
|
|
53
|
+
*
|
|
54
|
+
* @return {Object} An object with the information about the layers
|
|
55
|
+
*/
|
|
56
|
+
getLayers(workspace: string): Object;
|
|
57
|
+
/**
|
|
58
|
+
* Returns information about a cascaded WMS layer.
|
|
59
|
+
*
|
|
60
|
+
* @param {String} workspace The workspace
|
|
61
|
+
* @param {String} datastore The datastore
|
|
62
|
+
* @param {String} layerName The WMS layer name
|
|
63
|
+
*
|
|
64
|
+
* @throws Error if request fails
|
|
65
|
+
*
|
|
66
|
+
* @returns {Object} An object with layer information or undefined if it cannot be found
|
|
67
|
+
*/
|
|
68
|
+
getWmsLayer(workspace: string, datastore: string, layerName: string): Object;
|
|
69
|
+
/**
|
|
70
|
+
* Returns information about a cascaded WMTS layer.
|
|
71
|
+
*
|
|
72
|
+
* @param {String} workspace The workspace
|
|
73
|
+
* @param {String} datastore The datastore
|
|
74
|
+
* @param {String} layerName The WMTS layer name
|
|
75
|
+
*
|
|
76
|
+
* @throws Error if request fails
|
|
77
|
+
*
|
|
78
|
+
* @returns {Object} An object with layer information or undefined if it cannot be found
|
|
79
|
+
*/
|
|
80
|
+
getWmtsLayer(workspace: string, datastore: string, layerName: string): Object;
|
|
81
|
+
/**
|
|
82
|
+
* Publishes a FeatureType in the default data store of the workspace.
|
|
83
|
+
*
|
|
84
|
+
* @param {String} workspace Workspace to publish FeatureType in
|
|
85
|
+
* @param {String} nativeName Native name of FeatureType
|
|
86
|
+
* @param {String} [name] Published name of FeatureType, defaults to `nativeName`
|
|
87
|
+
* @param {String} [title] Published title of FeatureType, defaults to `name` or `nativeName`
|
|
88
|
+
* @param {String} [srs="EPSG:4326"] The SRS of the FeatureType
|
|
89
|
+
* @param {Boolean} [enabled=true] Flag to enable FeatureType by default
|
|
90
|
+
* @param {String} [abstract] The abstract of the layer
|
|
91
|
+
*
|
|
92
|
+
* @throws Error if request fails
|
|
93
|
+
*/
|
|
94
|
+
publishFeatureTypeDefaultDataStore(workspace: string, nativeName: string, name?: string, title?: string, srs?: string, enabled?: boolean, abstract?: string): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Publishes a FeatureType in the given data store of the workspace.
|
|
97
|
+
*
|
|
98
|
+
* @param {String} workspace Workspace to publish FeatureType in
|
|
99
|
+
* @param {String} dataStore The datastore where the FeatureType's data is in
|
|
100
|
+
* @param {String} nativeName Native name of FeatureType
|
|
101
|
+
* @param {String} [name] Published name of FeatureType, defaults to `nativeName`
|
|
102
|
+
* @param {String} [title] Published title of FeatureType, defaults to `name` or `nativeName`
|
|
103
|
+
* @param {String} [srs="EPSG:4326"] The SRS of the FeatureType
|
|
104
|
+
* @param {Boolean} [enabled=true] Flag to enable FeatureType by default
|
|
105
|
+
* @param {String} [abstract] The abstract of the layer
|
|
106
|
+
* @param {String} [nativeBoundingBox] The native BoundingBox of the FeatureType (has to be set if no data is in store at creation time)
|
|
107
|
+
*
|
|
108
|
+
* @throws Error if request fails
|
|
109
|
+
*/
|
|
110
|
+
publishFeatureType(workspace: string, dataStore: string, nativeName: string, name?: string, title?: string, srs?: string, enabled?: boolean, abstract?: string, nativeBoundingBox?: string): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Get detailed information about a FeatureType.
|
|
113
|
+
*
|
|
114
|
+
* @param {String} workspace The workspace of the FeatureType
|
|
115
|
+
* @param {String} datastore The datastore of the FeatureType
|
|
116
|
+
* @param {String} name The name of the FeatureType
|
|
117
|
+
*
|
|
118
|
+
* @throws Error if request fails
|
|
119
|
+
*
|
|
120
|
+
* @returns {Object} The object of the FeatureType
|
|
121
|
+
*/
|
|
122
|
+
getFeatureType(workspace: string, datastore: string, name: string): Object;
|
|
123
|
+
/**
|
|
124
|
+
* Get detailed information about a FeatureType.
|
|
125
|
+
*
|
|
126
|
+
* @param {String} workspace The workspace of the FeatureType
|
|
127
|
+
* @param {String} name The name of the FeatureType
|
|
128
|
+
*
|
|
129
|
+
* @throws GeoServerResponseError if request fails or layer does not exist or lacks the right properties.
|
|
130
|
+
*
|
|
131
|
+
* @returns {Object} The object of the FeatureType
|
|
132
|
+
*/
|
|
133
|
+
getFeatureTypeFromLayer(workspace: string, layer: any): Object;
|
|
134
|
+
/**
|
|
135
|
+
* Publishes a WMS layer.
|
|
136
|
+
*
|
|
137
|
+
* @param {String} workspace Workspace to publish WMS layer in
|
|
138
|
+
* @param {String} dataStore The datastore where the WMS is connected
|
|
139
|
+
* @param {String} nativeName Native name of WMS layer
|
|
140
|
+
* @param {String} [name] Published name of WMS layer, defaults to `nativeName`
|
|
141
|
+
* @param {String} [title] Published title of WMS layer, defaults to `name` or `nativeName`
|
|
142
|
+
* @param {String} [srs="EPSG:4326"] The SRS of the WMS layer
|
|
143
|
+
* @param {Boolean} [enabled=true] Flag to enable WMS layer by default
|
|
144
|
+
* @param {String} [abstract] The abstract of the layer
|
|
145
|
+
*
|
|
146
|
+
* @throws Error if request fails
|
|
147
|
+
*/
|
|
148
|
+
publishWmsLayer(workspace: string, dataStore: string, nativeName: string, name?: string, title?: string, srs?: string, enabled?: boolean, abstract?: string): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Publishes a raster stored in a database.
|
|
151
|
+
*
|
|
152
|
+
* @param {String} workspace Workspace to publish layer in
|
|
153
|
+
* @param {String} coverageStore The coveragestore where the layer's data is in
|
|
154
|
+
* @param {String} nativeName Native name of raster
|
|
155
|
+
* @param {String} [name] Published name of layer, defaults to `nativeName`
|
|
156
|
+
* @param {String} [title] Published title of layer, defaults to `name` or `nativeName`
|
|
157
|
+
* @param {String} [srs="EPSG:4326"] The SRS of the layer
|
|
158
|
+
* @param {Boolean} [enabled=true] Flag to enable layer by default
|
|
159
|
+
* @param {String} [abstract] The abstract of the layer
|
|
160
|
+
*
|
|
161
|
+
* @throws Error if request fails
|
|
162
|
+
*/
|
|
163
|
+
publishDbRaster(workspace: string, coverageStore: string, nativeName: string, name?: string, title?: string, srs?: string, enabled?: boolean, abstract?: string): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Deletes a FeatureType.
|
|
166
|
+
*
|
|
167
|
+
* @param {String} workspace Workspace where layer to delete is in
|
|
168
|
+
* @param {String} datastore The datastore where the layer to delete is in
|
|
169
|
+
* @param {String} name Layer to delete
|
|
170
|
+
* @param {Boolean} recurse Flag to enable recursive deletion
|
|
171
|
+
*
|
|
172
|
+
* @throws Error if request fails
|
|
173
|
+
*/
|
|
174
|
+
deleteFeatureType(workspace: string, datastore: string, name: string, recurse: boolean): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Enables TIME dimension for the given coverage layer.
|
|
177
|
+
*
|
|
178
|
+
* @param {String} workspace Workspace where layer to enable time dimension for is in
|
|
179
|
+
* @param {String} datastore The datastore where the layer to enable time dimension for is in
|
|
180
|
+
* @param {String} name Layer to enable time dimension for
|
|
181
|
+
* @param {String} presentation Presentation type: 'LIST' or 'DISCRETE_INTERVAL' or 'CONTINUOUS_INTERVAL'
|
|
182
|
+
* @param {Number} resolution Resolution in milliseconds, e.g. 3600000 for 1 hour
|
|
183
|
+
* @param {String} defaultValue The default time value, e.g. 'MINIMUM' or 'MAXIMUM' or 'NEAREST' or 'FIXED'
|
|
184
|
+
* @param {Boolean} [nearestMatchEnabled] Enable nearest match
|
|
185
|
+
* @param {Boolean} [rawNearestMatchEnabled] Enable raw nearest match
|
|
186
|
+
* @param {String} [acceptableInterval] Acceptable interval for nearest match, e.g.'PT30M'
|
|
187
|
+
*
|
|
188
|
+
* @throws Error if request fails
|
|
189
|
+
*/
|
|
190
|
+
enableTimeCoverage(workspace: string, dataStore: any, name: string, presentation: string, resolution: number, defaultValue: string, nearestMatchEnabled?: boolean, rawNearestMatchEnabled?: boolean, acceptableInterval?: string): Promise<void>;
|
|
191
|
+
/**
|
|
192
|
+
* Enables TIME dimension for the given FeatureType layer.
|
|
193
|
+
*
|
|
194
|
+
* @param {String} workspace Workspace containing layer to enable time dimension for
|
|
195
|
+
* @param {String} datastore The datastore containing the FeatureType to enable time dimension for
|
|
196
|
+
* @param {String} name FeatureType to enable time dimension for
|
|
197
|
+
* @param {String} attribute Data column / attribute holding the time values
|
|
198
|
+
* @param {String} presentation Presentation type: 'LIST' or 'DISCRETE_INTERVAL' or 'CONTINUOUS_INTERVAL'
|
|
199
|
+
* @param {Number} resolution Resolution in milliseconds, e.g. 3600000 for 1 hour
|
|
200
|
+
* @param {String} defaultValue The default time value, e.g. 'MINIMUM' or 'MAXIMUM' or 'NEAREST' or 'FIXED'
|
|
201
|
+
* @param {Boolean} [nearestMatchEnabled] Enable nearest match
|
|
202
|
+
* @param {Boolean} [rawNearestMatchEnabled] Enable raw nearest match
|
|
203
|
+
*
|
|
204
|
+
* @throws Error if request fails
|
|
205
|
+
*/
|
|
206
|
+
enableTimeFeatureType(workspace: string, dataStore: any, name: string, attribute: string, presentation: string, resolution: number, defaultValue: string, nearestMatchEnabled?: boolean, rawNearestMatchEnabled?: boolean, acceptableInterval: any): Promise<void>;
|
|
207
|
+
/**
|
|
208
|
+
* Returns a dedicated coverage object.
|
|
209
|
+
*
|
|
210
|
+
* @param {String} workspace Workspace containing the coverage
|
|
211
|
+
* @param {String} coverageStore The coveragestore containing the coverage
|
|
212
|
+
* @param {String} name Coverage to query
|
|
213
|
+
*
|
|
214
|
+
* @throws Error if request fails
|
|
215
|
+
*
|
|
216
|
+
* @returns {Object} An object with coverage information or undefined if it cannot be found
|
|
217
|
+
*/
|
|
218
|
+
getCoverage(workspace: string, coverageStore: string, name: string): Object;
|
|
219
|
+
/**
|
|
220
|
+
* Returns a dedicated coverage object.
|
|
221
|
+
*
|
|
222
|
+
* @param {String} workspace Workspace containing the coverage
|
|
223
|
+
* @param {String} name Coverage to query
|
|
224
|
+
*
|
|
225
|
+
* @throws Error if request fails
|
|
226
|
+
*
|
|
227
|
+
* @returns {Object} An object with coverage information or undefined if it cannot be found
|
|
228
|
+
*/
|
|
229
|
+
getCoverageFromLayer(workspace: string, name: string): Object;
|
|
230
|
+
/**
|
|
231
|
+
* Renames the existing bands of a coverage layer.
|
|
232
|
+
*
|
|
233
|
+
* Make sure to provide the same number of bands as existing in the layer.
|
|
234
|
+
*
|
|
235
|
+
* @param {String} workspace Workspace of layer
|
|
236
|
+
* @param {String} datastore The datastore of the layer
|
|
237
|
+
* @param {String} layername The layer name
|
|
238
|
+
* @param {String[]} bandNames An array of the new band names in correct order
|
|
239
|
+
*
|
|
240
|
+
* @throws Error if request fails
|
|
241
|
+
*/
|
|
242
|
+
renameCoverageBands(workspace: string, dataStore: any, layername: string, bandNames: string[]): Promise<void>;
|
|
243
|
+
/**
|
|
244
|
+
* Returns the data store of a layer.
|
|
245
|
+
*
|
|
246
|
+
* @param {String} workspace The workspace of the layer
|
|
247
|
+
* @param {String} layer The name of the layer
|
|
248
|
+
*
|
|
249
|
+
* @throws GeoServerResponseError if request fails or layer does not exist or lacks a data store.
|
|
250
|
+
*
|
|
251
|
+
* @returns {Object} The data store object
|
|
252
|
+
*/
|
|
253
|
+
getDataStore(workspace: string, layer: string): Object;
|
|
254
|
+
/**
|
|
255
|
+
* Returns the coverage store of a layer.
|
|
256
|
+
*
|
|
257
|
+
* @param {String} workspace The workspace of the layer
|
|
258
|
+
* @param {String} layer The name of the layer
|
|
259
|
+
*
|
|
260
|
+
* @throws GeoServerResponseError if request fails or layer does not exist or lacks a coverage store.
|
|
261
|
+
*
|
|
262
|
+
* @returns {Object} The coverage store object
|
|
263
|
+
*/
|
|
264
|
+
getCoverageStore(workspace: string, layer: string): Object;
|
|
265
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for GeoServer layergroups
|
|
3
|
+
*
|
|
4
|
+
* @module LayerGroupClient
|
|
5
|
+
*/
|
|
6
|
+
export default class LayerGroupClient {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a GeoServer REST LayerGroupClient instance.
|
|
9
|
+
*
|
|
10
|
+
* @param {String} url The URL of the GeoServer REST API endpoint
|
|
11
|
+
* @param {String} auth The Basic Authentication string
|
|
12
|
+
*/
|
|
13
|
+
constructor(url: string, auth: string);
|
|
14
|
+
url: string;
|
|
15
|
+
auth: string;
|
|
16
|
+
/**
|
|
17
|
+
* @typedef {object} bounds
|
|
18
|
+
* @property {number} minx The minimum x coordinates. Default: -180
|
|
19
|
+
* @property {number} miny The minimum y coordinates. Default: -90
|
|
20
|
+
* @property {number} maxx The maximum x coordinates. Default: 180
|
|
21
|
+
* @property {number} maxy The maximum y coordinates. Default: 90
|
|
22
|
+
* @property {String} crs The crs of the bounds. Default: 'EPSG:4326'
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Create a GeoServer layergroup by the given workspace, layerGroupName, layers and options
|
|
26
|
+
* @param {String} workspace The name of the workspace
|
|
27
|
+
* @param {String} layerGroupName The name of the layer group
|
|
28
|
+
* @param {Array.<String>} layers List of layers to be added to the group. Must be in same workspace as layergroup
|
|
29
|
+
* @param {String} options.mode The mode of the layergroup. Default to SINGLE
|
|
30
|
+
* @param {String} options.layerGroupTitle The title of the layergroup.
|
|
31
|
+
* @param {bounds} options.bounds The bounds of the layer group.
|
|
32
|
+
*
|
|
33
|
+
* @throws Error if request fails
|
|
34
|
+
*
|
|
35
|
+
* @returns {string} A string with layer group location or undefined if not found
|
|
36
|
+
*/
|
|
37
|
+
create(workspace: string, layerGroupName: string, layers: Array<string>, layerGroupOptions: any): string;
|
|
38
|
+
/**
|
|
39
|
+
* Returns a GeoServer layergroup by the given workspace and layergroup name,
|
|
40
|
+
* e.g. "myWs:myLayergroup".
|
|
41
|
+
*
|
|
42
|
+
* @param {String} workspace The name of the workspace
|
|
43
|
+
* @param {String} layerGroupName The name of the layer group to query
|
|
44
|
+
*
|
|
45
|
+
* @throws Error if request fails
|
|
46
|
+
*
|
|
47
|
+
* @returns {Object} An object with layer group information or undefined if it cannot be found
|
|
48
|
+
*/
|
|
49
|
+
get(workspace: string, layerGroupName: string): Object;
|
|
50
|
+
/**
|
|
51
|
+
* Updates an existing GeoServer layergroup
|
|
52
|
+
*
|
|
53
|
+
* @param {String} workspace The name of the workspace
|
|
54
|
+
* @param {String} layerName The name of the layergroup to update
|
|
55
|
+
* @param {Object} layerGroupDefinition The updated definiton of the layergroup
|
|
56
|
+
*
|
|
57
|
+
* @throws Error if request fails
|
|
58
|
+
*/
|
|
59
|
+
update(workspace: string, layerGroupName: any, layerGroupDefinition: Object): Promise<void>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for GeoServer namespace
|
|
3
|
+
*
|
|
4
|
+
* @module NamespaceClient
|
|
5
|
+
*/
|
|
6
|
+
export default class NamespaceClient {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a GeoServer REST NamespaceClient instance.
|
|
9
|
+
*
|
|
10
|
+
* @param {String} url The URL of the GeoServer REST API endpoint
|
|
11
|
+
* @param {String} auth The Basic Authentication string
|
|
12
|
+
*/
|
|
13
|
+
constructor(url: string, auth: string);
|
|
14
|
+
url: string;
|
|
15
|
+
auth: string;
|
|
16
|
+
/**
|
|
17
|
+
* Returns all namespaces.
|
|
18
|
+
*
|
|
19
|
+
* @throws Error if request fails
|
|
20
|
+
*
|
|
21
|
+
* @returns {Object} An object describing the namespace
|
|
22
|
+
*/
|
|
23
|
+
getAll(): Object;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new namespace.
|
|
26
|
+
*
|
|
27
|
+
* @param {String} prefix Prefix of the new namespace
|
|
28
|
+
* @param {String} uri Uri of the new namespace
|
|
29
|
+
*
|
|
30
|
+
* @throws Error if request fails
|
|
31
|
+
*
|
|
32
|
+
* @returns {String} The name of the created namespace
|
|
33
|
+
*/
|
|
34
|
+
create(prefix: string, uri: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Returns a namespace.
|
|
37
|
+
*
|
|
38
|
+
* @param {String} name Name of the namespace
|
|
39
|
+
*
|
|
40
|
+
* @throws Error if request fails
|
|
41
|
+
*
|
|
42
|
+
* @returns {Object} An object describing the namespace or undefined if it cannot be found
|
|
43
|
+
*/
|
|
44
|
+
get(name: string): Object;
|
|
45
|
+
/**
|
|
46
|
+
* Deletes a namespace.
|
|
47
|
+
*
|
|
48
|
+
* @param {String} name Name of the namespace to delete
|
|
49
|
+
*
|
|
50
|
+
* @throws Error if request fails
|
|
51
|
+
*/
|
|
52
|
+
delete(name: string): Promise<void>;
|
|
53
|
+
}
|