geoserver-node-client 1.6.2 → 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/package.json +12 -5
- package/dist/src/datastore.js +1 -1
- package/dist/src/layer.js +25 -25
- 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 +12 -5
- package/src/datastore.js +1 -1
- package/src/layer.js +25 -25
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for GeoServer "Reset/Reload" to clear internal caches and reload
|
|
3
|
+
* configuration from disk endpoint.
|
|
4
|
+
*
|
|
5
|
+
* @module ResetReloadClient
|
|
6
|
+
*/
|
|
7
|
+
export default class ResetReloadClient {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a GeoServer REST ResetReloadClient instance.
|
|
10
|
+
*
|
|
11
|
+
* @param {String} url The URL of the GeoServer REST API endpoint
|
|
12
|
+
* @param {String} auth The Basic Authentication string
|
|
13
|
+
*/
|
|
14
|
+
constructor(url: string, auth: string);
|
|
15
|
+
url: string;
|
|
16
|
+
auth: string;
|
|
17
|
+
/**
|
|
18
|
+
* Resets all store, raster, and schema caches. This operation is used to
|
|
19
|
+
* force GeoServer to drop all caches and store connections and reconnect to
|
|
20
|
+
* each of them the next time they are needed by a request.
|
|
21
|
+
* This is useful in case the stores themselves cache some information about
|
|
22
|
+
* the data structures they manage that may have changed in the meantime.
|
|
23
|
+
*
|
|
24
|
+
* @throws Error if request fails
|
|
25
|
+
*/
|
|
26
|
+
reset(): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Reloads the GeoServer catalog and configuration from disk. This operation
|
|
29
|
+
* is used in cases where an external tool has modified the on-disk
|
|
30
|
+
* configuration. This operation will also force GeoServer to drop any
|
|
31
|
+
* internal caches and reconnect to all data stores.
|
|
32
|
+
*
|
|
33
|
+
* @throws Error if request fails
|
|
34
|
+
*/
|
|
35
|
+
reload(): Promise<void>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for GeoServer security.
|
|
3
|
+
*
|
|
4
|
+
* @module SecurityClient
|
|
5
|
+
*/
|
|
6
|
+
export default class SecurityClient {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a GeoServer REST SecurityClient 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 users registered in GeoServer.
|
|
18
|
+
*
|
|
19
|
+
* @throws Error if request fails
|
|
20
|
+
*
|
|
21
|
+
* @returns {Object} An object with all users
|
|
22
|
+
*/
|
|
23
|
+
getAllUsers(): Object;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new user.
|
|
26
|
+
*
|
|
27
|
+
* @param {String} username The name of the user to be created
|
|
28
|
+
* @param {String} password The password of the user to be created
|
|
29
|
+
*
|
|
30
|
+
* @throws Error if request fails
|
|
31
|
+
*/
|
|
32
|
+
createUser(username: string, password: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Updates an existing user. User name is only taken for identification and
|
|
35
|
+
* cannot be changed with this API call.
|
|
36
|
+
*
|
|
37
|
+
* @param {String} username The name of the user to be created
|
|
38
|
+
* @param {String} password The password of the user to be created
|
|
39
|
+
* @param {Boolean} enabled Enable / disable the user
|
|
40
|
+
*
|
|
41
|
+
* @throws Error if request fails
|
|
42
|
+
*/
|
|
43
|
+
updateUser(username: string, password: string, enabled: boolean): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Deletes an existing user.
|
|
46
|
+
*
|
|
47
|
+
* @param {String} username The name of the user to be deleted
|
|
48
|
+
*
|
|
49
|
+
* @throws Error if request fails
|
|
50
|
+
*/
|
|
51
|
+
deleteUser(username: string): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Returns all roles registered in GeoServer.
|
|
54
|
+
*
|
|
55
|
+
* @throws Error if request fails
|
|
56
|
+
*
|
|
57
|
+
* @returns {Object} An object with all roles like { "roles": ["ADMIN", "GROUP_ADMIN"] }
|
|
58
|
+
*/
|
|
59
|
+
getAllRoles(): Object;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a new role.
|
|
62
|
+
*
|
|
63
|
+
* @param {String} role The name of the role to be created
|
|
64
|
+
*
|
|
65
|
+
* @throws Error if request fails
|
|
66
|
+
*/
|
|
67
|
+
createRole(role: string): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Deletes an existing role.
|
|
70
|
+
*
|
|
71
|
+
* @param {String} role The name of the role to be deleted
|
|
72
|
+
*
|
|
73
|
+
* @throws Error if request fails
|
|
74
|
+
*/
|
|
75
|
+
deleteRole(role: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Associates the given role to the user.
|
|
78
|
+
*
|
|
79
|
+
* @param {String} username The name of the user to add the role to
|
|
80
|
+
* @param {String} role The role to associate
|
|
81
|
+
*
|
|
82
|
+
* @throws Error if request fails
|
|
83
|
+
*/
|
|
84
|
+
associateUserRole(username: string, role: string): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Returns all data access rules registered in GeoServer.
|
|
87
|
+
*
|
|
88
|
+
* @throws Error if request fails
|
|
89
|
+
*
|
|
90
|
+
* @returns {Object} An object with all data access rules like { "*.*.r": ["ADMIN", "GROUP_ADMIN"] }
|
|
91
|
+
*/
|
|
92
|
+
getAllAccessRules(): Object;
|
|
93
|
+
/**
|
|
94
|
+
* Creates a new data access rule.
|
|
95
|
+
*
|
|
96
|
+
* @param {String} rule The rule in the form '<MY_WS>.<MY_LAYER>.r'
|
|
97
|
+
* @param {String[]} roles The roles to allow access to rule
|
|
98
|
+
*
|
|
99
|
+
* @throws Error if request fails
|
|
100
|
+
*/
|
|
101
|
+
createDataAccessRule(rule: string, roles: string[]): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Deletes an existing data access rule.
|
|
104
|
+
*
|
|
105
|
+
* @param {String} rule The rule to be deleted, like '<MY_WS>.<MY_LAYER>.r'
|
|
106
|
+
*
|
|
107
|
+
* @throws Error if request fails
|
|
108
|
+
*/
|
|
109
|
+
deleteDataAccessRule(rule: string): Promise<void>;
|
|
110
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for GeoServer settings.
|
|
3
|
+
*
|
|
4
|
+
* @module SettingsClient
|
|
5
|
+
*/
|
|
6
|
+
export default class SettingsClient {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a GeoServer REST SettingsClient 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 the complete GeoServer settings object.
|
|
18
|
+
*
|
|
19
|
+
* @throws Error if request fails
|
|
20
|
+
*
|
|
21
|
+
* @returns {Object} Settings object
|
|
22
|
+
*/
|
|
23
|
+
getSettings(): Object;
|
|
24
|
+
/**
|
|
25
|
+
* Update the global GeoServer settings.
|
|
26
|
+
*
|
|
27
|
+
* @param {Object} settings The adapted GeoServer settings object
|
|
28
|
+
*/
|
|
29
|
+
updateSettings(settings: Object): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Update the global proxyBaseUrl setting.
|
|
32
|
+
*
|
|
33
|
+
* @param {String} proxyBaseUrl The proxy base URL
|
|
34
|
+
*/
|
|
35
|
+
updateProxyBaseUrl(proxyBaseUrl: string): Promise<false | undefined>;
|
|
36
|
+
/**
|
|
37
|
+
* Get the contact information of the GeoServer.
|
|
38
|
+
*
|
|
39
|
+
* @throws Error if request fails
|
|
40
|
+
*
|
|
41
|
+
* @returns {Object} An object with contact information
|
|
42
|
+
*/
|
|
43
|
+
getContactInformation(): Object;
|
|
44
|
+
/**
|
|
45
|
+
* Update the contact information.
|
|
46
|
+
*
|
|
47
|
+
* Deleting is not supported.
|
|
48
|
+
*
|
|
49
|
+
* @param {String} [address] The contact's address
|
|
50
|
+
* @param {String} [city] The contact's city
|
|
51
|
+
* @param {String} [country] The contact's country
|
|
52
|
+
* @param {String} [postalCode] The contact's postCode
|
|
53
|
+
* @param {String} [state] The contact's state
|
|
54
|
+
* @param {String} [email] The contact's email
|
|
55
|
+
* @param {String} [organization] The contact's organization
|
|
56
|
+
* @param {String} [contactPerson] The contact person
|
|
57
|
+
* @param {String} [phoneNumber] The contact's phone number
|
|
58
|
+
*
|
|
59
|
+
* @throws Error if request fails
|
|
60
|
+
*/
|
|
61
|
+
updateContactInformation(address?: string, city?: string, country?: string, postalCode?: string, state?: string, email?: string, organization?: string, contactPerson?: string, phoneNumber?: string): Promise<void>;
|
|
62
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for GeoServer styles
|
|
3
|
+
*
|
|
4
|
+
* @module StyleClient
|
|
5
|
+
*/
|
|
6
|
+
export default class StyleClient {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a GeoServer REST StyleClient 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 default styles.
|
|
18
|
+
*
|
|
19
|
+
* @throws Error if request fails
|
|
20
|
+
*
|
|
21
|
+
* @returns {Object} An object with the default styles
|
|
22
|
+
*/
|
|
23
|
+
getDefaults(): Object;
|
|
24
|
+
/**
|
|
25
|
+
* Returns all styles in a workspace.
|
|
26
|
+
*
|
|
27
|
+
* @param {String} workspace Workspace name to get styles for
|
|
28
|
+
*
|
|
29
|
+
* @throws Error if request fails
|
|
30
|
+
*
|
|
31
|
+
* @returns {Object} An object with all styles
|
|
32
|
+
*/
|
|
33
|
+
getInWorkspace(workspace: string): Object;
|
|
34
|
+
/**
|
|
35
|
+
* Returns all styles defined in workspaces.
|
|
36
|
+
*
|
|
37
|
+
* @throws Error if request fails
|
|
38
|
+
*
|
|
39
|
+
* @returns {Object[]} An array with all style objects
|
|
40
|
+
*/
|
|
41
|
+
getAllWorkspaceStyles(): Object[];
|
|
42
|
+
/**
|
|
43
|
+
* Returns all styles as combined object (default ones and those in
|
|
44
|
+
* workspaces).
|
|
45
|
+
*
|
|
46
|
+
* @returns {Object[]} An array with all style objects
|
|
47
|
+
*/
|
|
48
|
+
getAll(): Object[];
|
|
49
|
+
/**
|
|
50
|
+
* Publishes a new SLD style.
|
|
51
|
+
*
|
|
52
|
+
* @param {String} workspace The workspace to publish the style in
|
|
53
|
+
* @param {String} name Name of the style
|
|
54
|
+
* @param {String} sldBody SLD style (as XML text)
|
|
55
|
+
*
|
|
56
|
+
* @throws Error if request fails
|
|
57
|
+
*/
|
|
58
|
+
publish(workspace: string, name: string, sldBody: string): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Deletes a style.
|
|
61
|
+
*
|
|
62
|
+
* @param {String} workspace The name of the workspace, can be undefined if style is not assigned to a workspace
|
|
63
|
+
* @param {String} name The name of the style to delete
|
|
64
|
+
* @param {Boolean} [recurse=false] If references to the specified style in existing layers should be deleted
|
|
65
|
+
* @param {Boolean} [purge=false] Whether the underlying file containing the style should be deleted on disk
|
|
66
|
+
*/
|
|
67
|
+
delete(workspace: string, name: string, recurse?: boolean, purge?: boolean): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Assigns a style to a layer.
|
|
70
|
+
*
|
|
71
|
+
* @param {String} workspaceOfLayer The name of the layer's workspace, can be undefined
|
|
72
|
+
* @param {String} layerName The name of the layer to query
|
|
73
|
+
* @param {String} workspaceOfStyle The workspace of the style, can be undefined
|
|
74
|
+
* @param {String} styleName The name of the style
|
|
75
|
+
* @param {Boolean} [isDefaultStyle=true] If the style should be the default style of the layer
|
|
76
|
+
*
|
|
77
|
+
* @throws Error if request fails
|
|
78
|
+
*/
|
|
79
|
+
assignStyleToLayer(workspaceOfLayer: string, layerName: string, workspaceOfStyle: string, styleName: string, isDefaultStyle?: boolean): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Get information about a style.
|
|
82
|
+
*
|
|
83
|
+
* @param {String} workspace The name of the workspace, can be undefined
|
|
84
|
+
* @param {String} styleName The name of the style
|
|
85
|
+
*
|
|
86
|
+
* @throws Error if request fails
|
|
87
|
+
*
|
|
88
|
+
* @returns {Object} An object about the style or undefined if it cannot be found
|
|
89
|
+
*/
|
|
90
|
+
getStyleInformation(workspace: string, styleName: string): Object;
|
|
91
|
+
}
|