geoserver-node-client 1.3.0 → 1.4.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 +5 -2
- package/dist/geoserver-rest-client.js +4 -25
- package/dist/package.json +15 -16
- package/dist/src/about.js +42 -70
- package/dist/src/datastore.js +450 -633
- package/dist/src/imagemosaic.js +112 -164
- package/dist/src/layer.js +591 -797
- package/dist/src/layergroup.js +275 -0
- package/dist/src/namespace.js +126 -186
- package/dist/src/reset-reload.js +49 -78
- package/dist/src/security.js +117 -169
- package/dist/src/settings.js +137 -198
- package/dist/src/style.js +260 -376
- package/dist/src/util/geoserver.js +12 -36
- package/dist/src/workspace.js +133 -190
- package/geoserver-rest-client.js +3 -0
- package/package.json +15 -16
- package/src/layergroup.js +176 -0
- package/src/workspace.js +4 -3
package/dist/src/imagemosaic.js
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
12
|
var _nodeFetch = _interopRequireDefault(require("node-fetch"));
|
|
19
|
-
|
|
20
13
|
var _geoserver = require("./util/geoserver.js");
|
|
21
|
-
|
|
22
14
|
/**
|
|
23
15
|
* Client for GeoServer image mosaics
|
|
24
16
|
*
|
|
@@ -36,6 +28,7 @@ var ImageMosaicClient = /*#__PURE__*/function () {
|
|
|
36
28
|
this.url = url;
|
|
37
29
|
this.auth = auth;
|
|
38
30
|
}
|
|
31
|
+
|
|
39
32
|
/**
|
|
40
33
|
* Returns all granules of an image mosaic.
|
|
41
34
|
*
|
|
@@ -47,58 +40,46 @@ var ImageMosaicClient = /*#__PURE__*/function () {
|
|
|
47
40
|
*
|
|
48
41
|
* @returns {Object} An object with the granules
|
|
49
42
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
43
|
(0, _createClass2["default"])(ImageMosaicClient, [{
|
|
53
44
|
key: "getGranules",
|
|
54
45
|
value: function () {
|
|
55
46
|
var _getGranules = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(workspace, coverageStore, coverage) {
|
|
56
47
|
var url, response, geoServerResponse;
|
|
57
48
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
58
|
-
while (1) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
'Content-type': 'text/plain'
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
case 3:
|
|
73
|
-
response = _context.sent;
|
|
74
|
-
|
|
75
|
-
if (response.ok) {
|
|
76
|
-
_context.next = 9;
|
|
77
|
-
break;
|
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
url = this.url + 'workspaces/' + workspace + '/coveragestores/' + coverageStore + '/coverages/' + coverage + '/index/granules.json';
|
|
52
|
+
_context.next = 3;
|
|
53
|
+
return (0, _nodeFetch["default"])(url, {
|
|
54
|
+
credentials: 'include',
|
|
55
|
+
method: 'GET',
|
|
56
|
+
headers: {
|
|
57
|
+
Authorization: this.auth,
|
|
58
|
+
'Content-type': 'text/plain'
|
|
78
59
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
60
|
+
});
|
|
61
|
+
case 3:
|
|
62
|
+
response = _context.sent;
|
|
63
|
+
if (response.ok) {
|
|
64
|
+
_context.next = 9;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
_context.next = 7;
|
|
68
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
69
|
+
case 7:
|
|
70
|
+
geoServerResponse = _context.sent;
|
|
71
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
72
|
+
case 9:
|
|
73
|
+
return _context.abrupt("return", response.json());
|
|
74
|
+
case 10:
|
|
75
|
+
case "end":
|
|
76
|
+
return _context.stop();
|
|
94
77
|
}
|
|
95
78
|
}, _callee, this);
|
|
96
79
|
}));
|
|
97
|
-
|
|
98
80
|
function getGranules(_x, _x2, _x3) {
|
|
99
81
|
return _getGranules.apply(this, arguments);
|
|
100
82
|
}
|
|
101
|
-
|
|
102
83
|
return getGranules;
|
|
103
84
|
}()
|
|
104
85
|
/**
|
|
@@ -112,58 +93,47 @@ var ImageMosaicClient = /*#__PURE__*/function () {
|
|
|
112
93
|
*
|
|
113
94
|
* @returns {Object} An object with the granules
|
|
114
95
|
*/
|
|
115
|
-
|
|
116
96
|
}, {
|
|
117
97
|
key: "harvestGranules",
|
|
118
98
|
value: function () {
|
|
119
99
|
var _harvestGranules = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(workspace, coverageStore, filePath) {
|
|
120
100
|
var url, response, geoServerResponse;
|
|
121
101
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
122
|
-
while (1) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
case 9:
|
|
153
|
-
return _context2.abrupt("return", response.json());
|
|
154
|
-
|
|
155
|
-
case 10:
|
|
156
|
-
case "end":
|
|
157
|
-
return _context2.stop();
|
|
158
|
-
}
|
|
102
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
url = this.url + 'workspaces/' + workspace + '/coveragestores/' + coverageStore + '/external.imagemosaic';
|
|
105
|
+
_context2.next = 3;
|
|
106
|
+
return (0, _nodeFetch["default"])(url, {
|
|
107
|
+
credentials: 'include',
|
|
108
|
+
method: 'POST',
|
|
109
|
+
headers: {
|
|
110
|
+
Authorization: this.auth,
|
|
111
|
+
'Content-Type': 'text/plain'
|
|
112
|
+
},
|
|
113
|
+
body: filePath
|
|
114
|
+
});
|
|
115
|
+
case 3:
|
|
116
|
+
response = _context2.sent;
|
|
117
|
+
if (response.ok) {
|
|
118
|
+
_context2.next = 9;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
_context2.next = 7;
|
|
122
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
123
|
+
case 7:
|
|
124
|
+
geoServerResponse = _context2.sent;
|
|
125
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
126
|
+
case 9:
|
|
127
|
+
return _context2.abrupt("return", response.json());
|
|
128
|
+
case 10:
|
|
129
|
+
case "end":
|
|
130
|
+
return _context2.stop();
|
|
159
131
|
}
|
|
160
132
|
}, _callee2, this);
|
|
161
133
|
}));
|
|
162
|
-
|
|
163
134
|
function harvestGranules(_x4, _x5, _x6) {
|
|
164
135
|
return _harvestGranules.apply(this, arguments);
|
|
165
136
|
}
|
|
166
|
-
|
|
167
137
|
return harvestGranules;
|
|
168
138
|
}()
|
|
169
139
|
/**
|
|
@@ -175,55 +145,45 @@ var ImageMosaicClient = /*#__PURE__*/function () {
|
|
|
175
145
|
*
|
|
176
146
|
* @throws Error if request fails
|
|
177
147
|
*/
|
|
178
|
-
|
|
179
148
|
}, {
|
|
180
149
|
key: "addGranuleByServerFile",
|
|
181
150
|
value: function () {
|
|
182
151
|
var _addGranuleByServerFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(workspace, coverageStore, filePath) {
|
|
183
152
|
var url, response, geoServerResponse;
|
|
184
153
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
185
|
-
while (1) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
geoServerResponse = _context3.sent;
|
|
213
|
-
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
214
|
-
|
|
215
|
-
case 9:
|
|
216
|
-
case "end":
|
|
217
|
-
return _context3.stop();
|
|
218
|
-
}
|
|
154
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
155
|
+
case 0:
|
|
156
|
+
url = this.url + 'workspaces/' + workspace + '/coveragestores/' + coverageStore + '/external.imagemosaic';
|
|
157
|
+
_context3.next = 3;
|
|
158
|
+
return (0, _nodeFetch["default"])(url, {
|
|
159
|
+
credentials: 'include',
|
|
160
|
+
method: 'POST',
|
|
161
|
+
headers: {
|
|
162
|
+
Authorization: this.auth,
|
|
163
|
+
'Content-type': 'text/plain'
|
|
164
|
+
},
|
|
165
|
+
body: filePath
|
|
166
|
+
});
|
|
167
|
+
case 3:
|
|
168
|
+
response = _context3.sent;
|
|
169
|
+
if (response.ok) {
|
|
170
|
+
_context3.next = 9;
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
_context3.next = 7;
|
|
174
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
175
|
+
case 7:
|
|
176
|
+
geoServerResponse = _context3.sent;
|
|
177
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
178
|
+
case 9:
|
|
179
|
+
case "end":
|
|
180
|
+
return _context3.stop();
|
|
219
181
|
}
|
|
220
182
|
}, _callee3, this);
|
|
221
183
|
}));
|
|
222
|
-
|
|
223
184
|
function addGranuleByServerFile(_x7, _x8, _x9) {
|
|
224
185
|
return _addGranuleByServerFile.apply(this, arguments);
|
|
225
186
|
}
|
|
226
|
-
|
|
227
187
|
return addGranuleByServerFile;
|
|
228
188
|
}()
|
|
229
189
|
/**
|
|
@@ -236,62 +196,50 @@ var ImageMosaicClient = /*#__PURE__*/function () {
|
|
|
236
196
|
*
|
|
237
197
|
* @throws Error if request fails
|
|
238
198
|
*/
|
|
239
|
-
|
|
240
199
|
}, {
|
|
241
200
|
key: "deleteSingleGranule",
|
|
242
201
|
value: function () {
|
|
243
202
|
var _deleteSingleGranule = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(workspace, coverageStore, coverage, covFileLocation) {
|
|
244
203
|
var url, response, geoServerResponse;
|
|
245
204
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
246
|
-
while (1) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
'Content-type': 'text/plain'
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
case 4:
|
|
262
|
-
response = _context4.sent;
|
|
263
|
-
|
|
264
|
-
if (response.ok) {
|
|
265
|
-
_context4.next = 10;
|
|
266
|
-
break;
|
|
205
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
206
|
+
case 0:
|
|
207
|
+
url = this.url + 'workspaces/' + workspace + '/coveragestores/' + coverageStore + '/coverages/' + coverage + '/index/granules.xml';
|
|
208
|
+
url += '?filter=location=\'' + covFileLocation + '\'';
|
|
209
|
+
_context4.next = 4;
|
|
210
|
+
return (0, _nodeFetch["default"])(url, {
|
|
211
|
+
credentials: 'include',
|
|
212
|
+
method: 'DELETE',
|
|
213
|
+
headers: {
|
|
214
|
+
Authorization: this.auth,
|
|
215
|
+
'Content-type': 'text/plain'
|
|
267
216
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
217
|
+
});
|
|
218
|
+
case 4:
|
|
219
|
+
response = _context4.sent;
|
|
220
|
+
if (response.ok) {
|
|
221
|
+
_context4.next = 10;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
_context4.next = 8;
|
|
225
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
226
|
+
case 8:
|
|
227
|
+
geoServerResponse = _context4.sent;
|
|
228
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
229
|
+
case 10:
|
|
230
|
+
return _context4.abrupt("return", true);
|
|
231
|
+
case 11:
|
|
232
|
+
case "end":
|
|
233
|
+
return _context4.stop();
|
|
283
234
|
}
|
|
284
235
|
}, _callee4, this);
|
|
285
236
|
}));
|
|
286
|
-
|
|
287
237
|
function deleteSingleGranule(_x10, _x11, _x12, _x13) {
|
|
288
238
|
return _deleteSingleGranule.apply(this, arguments);
|
|
289
239
|
}
|
|
290
|
-
|
|
291
240
|
return deleteSingleGranule;
|
|
292
241
|
}()
|
|
293
242
|
}]);
|
|
294
243
|
return ImageMosaicClient;
|
|
295
244
|
}();
|
|
296
|
-
|
|
297
245
|
exports["default"] = ImageMosaicClient;
|