geoserver-node-client 1.2.4 → 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 +513 -654
- 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/datastore.js +22 -1
- package/src/layergroup.js +176 -0
- package/src/workspace.js +4 -3
package/dist/src/layer.js
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
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
|
var _about = _interopRequireDefault(require("./about.js"));
|
|
23
|
-
|
|
24
15
|
/**
|
|
25
16
|
* Client for GeoServer layers
|
|
26
17
|
*
|
|
@@ -38,6 +29,7 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
38
29
|
this.url = url;
|
|
39
30
|
this.auth = auth;
|
|
40
31
|
}
|
|
32
|
+
|
|
41
33
|
/**
|
|
42
34
|
* Returns a GeoServer layer by the given workspace and layer name,
|
|
43
35
|
* e.g. "myWs:myLayer".
|
|
@@ -49,75 +41,59 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
49
41
|
*
|
|
50
42
|
* @returns {Object} An object with layer information or undefined if it cannot be found
|
|
51
43
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
44
|
(0, _createClass2["default"])(LayerClient, [{
|
|
55
45
|
key: "get",
|
|
56
46
|
value: function () {
|
|
57
47
|
var _get = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(workspace, layerName) {
|
|
58
48
|
var qualifiedName, response, grc, geoServerResponse;
|
|
59
49
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
60
|
-
while (1) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
headers: {
|
|
74
|
-
Authorization: this.auth
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
case 3:
|
|
79
|
-
response = _context.sent;
|
|
80
|
-
|
|
81
|
-
if (response.ok) {
|
|
82
|
-
_context.next = 16;
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
grc = new _about["default"](this.url, this.auth);
|
|
87
|
-
_context.next = 8;
|
|
88
|
-
return grc.exists();
|
|
89
|
-
|
|
90
|
-
case 8:
|
|
91
|
-
if (!_context.sent) {
|
|
92
|
-
_context.next = 12;
|
|
93
|
-
break;
|
|
50
|
+
while (1) switch (_context.prev = _context.next) {
|
|
51
|
+
case 0:
|
|
52
|
+
if (workspace) {
|
|
53
|
+
qualifiedName = "".concat(workspace, ":").concat(layerName);
|
|
54
|
+
} else {
|
|
55
|
+
qualifiedName = layerName;
|
|
56
|
+
}
|
|
57
|
+
_context.next = 3;
|
|
58
|
+
return (0, _nodeFetch["default"])(this.url + 'layers/' + qualifiedName + '.json', {
|
|
59
|
+
credentials: 'include',
|
|
60
|
+
method: 'GET',
|
|
61
|
+
headers: {
|
|
62
|
+
Authorization: this.auth
|
|
94
63
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
_context.next =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
64
|
+
});
|
|
65
|
+
case 3:
|
|
66
|
+
response = _context.sent;
|
|
67
|
+
if (response.ok) {
|
|
68
|
+
_context.next = 16;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
grc = new _about["default"](this.url, this.auth);
|
|
72
|
+
_context.next = 8;
|
|
73
|
+
return grc.exists();
|
|
74
|
+
case 8:
|
|
75
|
+
if (!_context.sent) {
|
|
76
|
+
_context.next = 12;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
return _context.abrupt("return");
|
|
80
|
+
case 12:
|
|
81
|
+
_context.next = 14;
|
|
82
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
83
|
+
case 14:
|
|
84
|
+
geoServerResponse = _context.sent;
|
|
85
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
86
|
+
case 16:
|
|
87
|
+
return _context.abrupt("return", response.json());
|
|
88
|
+
case 17:
|
|
89
|
+
case "end":
|
|
90
|
+
return _context.stop();
|
|
113
91
|
}
|
|
114
92
|
}, _callee, this);
|
|
115
93
|
}));
|
|
116
|
-
|
|
117
94
|
function get(_x, _x2) {
|
|
118
95
|
return _get.apply(this, arguments);
|
|
119
96
|
}
|
|
120
|
-
|
|
121
97
|
return get;
|
|
122
98
|
}()
|
|
123
99
|
/**
|
|
@@ -130,85 +106,68 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
130
106
|
*
|
|
131
107
|
* @throws Error if request fails
|
|
132
108
|
*/
|
|
133
|
-
|
|
134
109
|
}, {
|
|
135
110
|
key: "modifyAttribution",
|
|
136
111
|
value: function () {
|
|
137
112
|
var _modifyAttribution = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(workspace, layerName, attributionText, attributionLink) {
|
|
138
113
|
var qualifiedName, jsonBody, url, response, geoServerResponse;
|
|
139
114
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
140
|
-
while (1) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
_context2.next = 15;
|
|
194
|
-
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
195
|
-
|
|
196
|
-
case 15:
|
|
197
|
-
geoServerResponse = _context2.sent;
|
|
198
|
-
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
199
|
-
|
|
200
|
-
case 17:
|
|
201
|
-
case "end":
|
|
202
|
-
return _context2.stop();
|
|
203
|
-
}
|
|
115
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
116
|
+
case 0:
|
|
117
|
+
if (workspace) {
|
|
118
|
+
qualifiedName = "".concat(workspace, ":").concat(layerName);
|
|
119
|
+
} else {
|
|
120
|
+
qualifiedName = layerName;
|
|
121
|
+
}
|
|
122
|
+
// take existing layer properties as template
|
|
123
|
+
_context2.next = 3;
|
|
124
|
+
return this.get(workspace, layerName);
|
|
125
|
+
case 3:
|
|
126
|
+
jsonBody = _context2.sent;
|
|
127
|
+
if (!(!jsonBody || !jsonBody.layer || !jsonBody.layer.attribution)) {
|
|
128
|
+
_context2.next = 6;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
throw new _geoserver.GeoServerResponseError("layer '".concat(workspace, ":").concat(layerName, "' misses the property 'attribution'"));
|
|
132
|
+
case 6:
|
|
133
|
+
// set attribution text and link
|
|
134
|
+
if (attributionText) {
|
|
135
|
+
jsonBody.layer.attribution.title = attributionText;
|
|
136
|
+
}
|
|
137
|
+
if (attributionLink) {
|
|
138
|
+
jsonBody.layer.attribution.href = attributionLink;
|
|
139
|
+
}
|
|
140
|
+
url = this.url + 'layers/' + qualifiedName + '.json';
|
|
141
|
+
_context2.next = 11;
|
|
142
|
+
return (0, _nodeFetch["default"])(url, {
|
|
143
|
+
credentials: 'include',
|
|
144
|
+
method: 'PUT',
|
|
145
|
+
headers: {
|
|
146
|
+
Authorization: this.auth,
|
|
147
|
+
'Content-Type': 'application/json'
|
|
148
|
+
},
|
|
149
|
+
body: JSON.stringify(jsonBody)
|
|
150
|
+
});
|
|
151
|
+
case 11:
|
|
152
|
+
response = _context2.sent;
|
|
153
|
+
if (response.ok) {
|
|
154
|
+
_context2.next = 17;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
_context2.next = 15;
|
|
158
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
159
|
+
case 15:
|
|
160
|
+
geoServerResponse = _context2.sent;
|
|
161
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
162
|
+
case 17:
|
|
163
|
+
case "end":
|
|
164
|
+
return _context2.stop();
|
|
204
165
|
}
|
|
205
166
|
}, _callee2, this);
|
|
206
167
|
}));
|
|
207
|
-
|
|
208
168
|
function modifyAttribution(_x3, _x4, _x5, _x6) {
|
|
209
169
|
return _modifyAttribution.apply(this, arguments);
|
|
210
170
|
}
|
|
211
|
-
|
|
212
171
|
return modifyAttribution;
|
|
213
172
|
}()
|
|
214
173
|
/**
|
|
@@ -218,55 +177,44 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
218
177
|
*
|
|
219
178
|
* @returns {Object} An object with all layer information
|
|
220
179
|
*/
|
|
221
|
-
|
|
222
180
|
}, {
|
|
223
181
|
key: "getAll",
|
|
224
182
|
value: function () {
|
|
225
183
|
var _getAll = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
226
184
|
var response, geoServerResponse;
|
|
227
185
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
228
|
-
while (1) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
Authorization: this.auth
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
case 2:
|
|
241
|
-
response = _context3.sent;
|
|
242
|
-
|
|
243
|
-
if (response.ok) {
|
|
244
|
-
_context3.next = 8;
|
|
245
|
-
break;
|
|
186
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
187
|
+
case 0:
|
|
188
|
+
_context3.next = 2;
|
|
189
|
+
return (0, _nodeFetch["default"])(this.url + 'layers.json', {
|
|
190
|
+
credentials: 'include',
|
|
191
|
+
method: 'GET',
|
|
192
|
+
headers: {
|
|
193
|
+
Authorization: this.auth
|
|
246
194
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
195
|
+
});
|
|
196
|
+
case 2:
|
|
197
|
+
response = _context3.sent;
|
|
198
|
+
if (response.ok) {
|
|
199
|
+
_context3.next = 8;
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
_context3.next = 6;
|
|
203
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
204
|
+
case 6:
|
|
205
|
+
geoServerResponse = _context3.sent;
|
|
206
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
207
|
+
case 8:
|
|
208
|
+
return _context3.abrupt("return", response.json());
|
|
209
|
+
case 9:
|
|
210
|
+
case "end":
|
|
211
|
+
return _context3.stop();
|
|
262
212
|
}
|
|
263
213
|
}, _callee3, this);
|
|
264
214
|
}));
|
|
265
|
-
|
|
266
215
|
function getAll() {
|
|
267
216
|
return _getAll.apply(this, arguments);
|
|
268
217
|
}
|
|
269
|
-
|
|
270
218
|
return getAll;
|
|
271
219
|
}()
|
|
272
220
|
/**
|
|
@@ -278,59 +226,47 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
278
226
|
*
|
|
279
227
|
* @return {Object} An object with the information about the layers
|
|
280
228
|
*/
|
|
281
|
-
|
|
282
229
|
}, {
|
|
283
230
|
key: "getLayers",
|
|
284
231
|
value: function () {
|
|
285
232
|
var _getLayers = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(workspace) {
|
|
286
233
|
var response, geoServerResponse;
|
|
287
234
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
288
|
-
while (1) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
Authorization: this.auth
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
case 2:
|
|
301
|
-
response = _context4.sent;
|
|
302
|
-
|
|
303
|
-
if (response.ok) {
|
|
304
|
-
_context4.next = 8;
|
|
305
|
-
break;
|
|
235
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
236
|
+
case 0:
|
|
237
|
+
_context4.next = 2;
|
|
238
|
+
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/layers.json', {
|
|
239
|
+
credentials: 'include',
|
|
240
|
+
method: 'GET',
|
|
241
|
+
headers: {
|
|
242
|
+
Authorization: this.auth
|
|
306
243
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
244
|
+
});
|
|
245
|
+
case 2:
|
|
246
|
+
response = _context4.sent;
|
|
247
|
+
if (response.ok) {
|
|
248
|
+
_context4.next = 8;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
_context4.next = 6;
|
|
252
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
253
|
+
case 6:
|
|
254
|
+
geoServerResponse = _context4.sent;
|
|
255
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
256
|
+
case 8:
|
|
257
|
+
_context4.next = 10;
|
|
258
|
+
return response.json();
|
|
259
|
+
case 10:
|
|
260
|
+
return _context4.abrupt("return", _context4.sent);
|
|
261
|
+
case 11:
|
|
262
|
+
case "end":
|
|
263
|
+
return _context4.stop();
|
|
326
264
|
}
|
|
327
265
|
}, _callee4, this);
|
|
328
266
|
}));
|
|
329
|
-
|
|
330
267
|
function getLayers(_x7) {
|
|
331
268
|
return _getLayers.apply(this, arguments);
|
|
332
269
|
}
|
|
333
|
-
|
|
334
270
|
return getLayers;
|
|
335
271
|
}()
|
|
336
272
|
/**
|
|
@@ -344,75 +280,59 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
344
280
|
*
|
|
345
281
|
* @returns {Object} An object with layer information or undefined if it cannot be found
|
|
346
282
|
*/
|
|
347
|
-
|
|
348
283
|
}, {
|
|
349
284
|
key: "getWmsLayer",
|
|
350
285
|
value: function () {
|
|
351
286
|
var _getWmsLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(workspace, datastore, layerName) {
|
|
352
287
|
var response, grc, geoServerResponse;
|
|
353
288
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
354
|
-
while (1) {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
Authorization: this.auth
|
|
363
|
-
}
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
case 2:
|
|
367
|
-
response = _context5.sent;
|
|
368
|
-
|
|
369
|
-
if (response.ok) {
|
|
370
|
-
_context5.next = 15;
|
|
371
|
-
break;
|
|
289
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
290
|
+
case 0:
|
|
291
|
+
_context5.next = 2;
|
|
292
|
+
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/wmsstores/' + datastore + '/wmslayers/' + layerName + '.json', {
|
|
293
|
+
credentials: 'include',
|
|
294
|
+
method: 'GET',
|
|
295
|
+
headers: {
|
|
296
|
+
Authorization: this.auth
|
|
372
297
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
return _context5.stop();
|
|
404
|
-
}
|
|
298
|
+
});
|
|
299
|
+
case 2:
|
|
300
|
+
response = _context5.sent;
|
|
301
|
+
if (response.ok) {
|
|
302
|
+
_context5.next = 15;
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
grc = new _about["default"](this.url, this.auth);
|
|
306
|
+
_context5.next = 7;
|
|
307
|
+
return grc.exists();
|
|
308
|
+
case 7:
|
|
309
|
+
if (!_context5.sent) {
|
|
310
|
+
_context5.next = 11;
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
return _context5.abrupt("return");
|
|
314
|
+
case 11:
|
|
315
|
+
_context5.next = 13;
|
|
316
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
317
|
+
case 13:
|
|
318
|
+
geoServerResponse = _context5.sent;
|
|
319
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
320
|
+
case 15:
|
|
321
|
+
_context5.next = 17;
|
|
322
|
+
return response.json();
|
|
323
|
+
case 17:
|
|
324
|
+
return _context5.abrupt("return", _context5.sent);
|
|
325
|
+
case 18:
|
|
326
|
+
case "end":
|
|
327
|
+
return _context5.stop();
|
|
405
328
|
}
|
|
406
329
|
}, _callee5, this);
|
|
407
330
|
}));
|
|
408
|
-
|
|
409
331
|
function getWmsLayer(_x8, _x9, _x10) {
|
|
410
332
|
return _getWmsLayer.apply(this, arguments);
|
|
411
333
|
}
|
|
412
|
-
|
|
413
334
|
return getWmsLayer;
|
|
414
335
|
}() // TODO: automated test needed
|
|
415
|
-
|
|
416
336
|
/**
|
|
417
337
|
* Returns information about a cascaded WMTS layer.
|
|
418
338
|
*
|
|
@@ -424,72 +344,57 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
424
344
|
*
|
|
425
345
|
* @returns {Object} An object with layer information or undefined if it cannot be found
|
|
426
346
|
*/
|
|
427
|
-
|
|
428
347
|
}, {
|
|
429
348
|
key: "getWmtsLayer",
|
|
430
349
|
value: function () {
|
|
431
350
|
var _getWmtsLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(workspace, datastore, layerName) {
|
|
432
351
|
var response, grc, geoServerResponse;
|
|
433
352
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
434
|
-
while (1) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
Authorization: this.auth
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
|
|
446
|
-
case 2:
|
|
447
|
-
response = _context6.sent;
|
|
448
|
-
|
|
449
|
-
if (response.ok) {
|
|
450
|
-
_context6.next = 15;
|
|
451
|
-
break;
|
|
353
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
354
|
+
case 0:
|
|
355
|
+
_context6.next = 2;
|
|
356
|
+
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/wmtsstores/' + datastore + '/layers/' + layerName + '.json', {
|
|
357
|
+
credentials: 'include',
|
|
358
|
+
method: 'GET',
|
|
359
|
+
headers: {
|
|
360
|
+
Authorization: this.auth
|
|
452
361
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
return _context6.stop();
|
|
484
|
-
}
|
|
362
|
+
});
|
|
363
|
+
case 2:
|
|
364
|
+
response = _context6.sent;
|
|
365
|
+
if (response.ok) {
|
|
366
|
+
_context6.next = 15;
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
grc = new _about["default"](this.url, this.auth);
|
|
370
|
+
_context6.next = 7;
|
|
371
|
+
return grc.exists();
|
|
372
|
+
case 7:
|
|
373
|
+
if (!_context6.sent) {
|
|
374
|
+
_context6.next = 11;
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
return _context6.abrupt("return");
|
|
378
|
+
case 11:
|
|
379
|
+
_context6.next = 13;
|
|
380
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
381
|
+
case 13:
|
|
382
|
+
geoServerResponse = _context6.sent;
|
|
383
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
384
|
+
case 15:
|
|
385
|
+
_context6.next = 17;
|
|
386
|
+
return response.json();
|
|
387
|
+
case 17:
|
|
388
|
+
return _context6.abrupt("return", _context6.sent);
|
|
389
|
+
case 18:
|
|
390
|
+
case "end":
|
|
391
|
+
return _context6.stop();
|
|
485
392
|
}
|
|
486
393
|
}, _callee6, this);
|
|
487
394
|
}));
|
|
488
|
-
|
|
489
395
|
function getWmtsLayer(_x11, _x12, _x13) {
|
|
490
396
|
return _getWmtsLayer.apply(this, arguments);
|
|
491
397
|
}
|
|
492
|
-
|
|
493
398
|
return getWmtsLayer;
|
|
494
399
|
}()
|
|
495
400
|
/**
|
|
@@ -505,64 +410,54 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
505
410
|
*
|
|
506
411
|
* @throws Error if request fails
|
|
507
412
|
*/
|
|
508
|
-
|
|
509
413
|
}, {
|
|
510
414
|
key: "publishFeatureTypeDefaultDataStore",
|
|
511
415
|
value: function () {
|
|
512
416
|
var _publishFeatureTypeDefaultDataStore = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(workspace, nativeName, name, title, srs, enabled, _abstract) {
|
|
513
417
|
var body, response, geoServerResponse;
|
|
514
418
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
515
|
-
while (1) {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
"abstract": _abstract || ''
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
_context7.next = 3;
|
|
529
|
-
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/featuretypes', {
|
|
530
|
-
credentials: 'include',
|
|
531
|
-
method: 'POST',
|
|
532
|
-
headers: {
|
|
533
|
-
Authorization: this.auth,
|
|
534
|
-
'Content-Type': 'application/json'
|
|
535
|
-
},
|
|
536
|
-
body: JSON.stringify(body)
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
case 3:
|
|
540
|
-
response = _context7.sent;
|
|
541
|
-
|
|
542
|
-
if (response.ok) {
|
|
543
|
-
_context7.next = 9;
|
|
544
|
-
break;
|
|
419
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
420
|
+
case 0:
|
|
421
|
+
body = {
|
|
422
|
+
featureType: {
|
|
423
|
+
name: name,
|
|
424
|
+
nativeName: nativeName || name,
|
|
425
|
+
title: title || name,
|
|
426
|
+
srs: srs || 'EPSG:4326',
|
|
427
|
+
enabled: enabled,
|
|
428
|
+
"abstract": _abstract || ''
|
|
545
429
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
430
|
+
};
|
|
431
|
+
_context7.next = 3;
|
|
432
|
+
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/featuretypes', {
|
|
433
|
+
credentials: 'include',
|
|
434
|
+
method: 'POST',
|
|
435
|
+
headers: {
|
|
436
|
+
Authorization: this.auth,
|
|
437
|
+
'Content-Type': 'application/json'
|
|
438
|
+
},
|
|
439
|
+
body: JSON.stringify(body)
|
|
440
|
+
});
|
|
441
|
+
case 3:
|
|
442
|
+
response = _context7.sent;
|
|
443
|
+
if (response.ok) {
|
|
444
|
+
_context7.next = 9;
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
_context7.next = 7;
|
|
448
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
449
|
+
case 7:
|
|
450
|
+
geoServerResponse = _context7.sent;
|
|
451
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
452
|
+
case 9:
|
|
453
|
+
case "end":
|
|
454
|
+
return _context7.stop();
|
|
558
455
|
}
|
|
559
456
|
}, _callee7, this);
|
|
560
457
|
}));
|
|
561
|
-
|
|
562
458
|
function publishFeatureTypeDefaultDataStore(_x14, _x15, _x16, _x17, _x18, _x19, _x20) {
|
|
563
459
|
return _publishFeatureTypeDefaultDataStore.apply(this, arguments);
|
|
564
460
|
}
|
|
565
|
-
|
|
566
461
|
return publishFeatureTypeDefaultDataStore;
|
|
567
462
|
}()
|
|
568
463
|
/**
|
|
@@ -580,73 +475,62 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
580
475
|
*
|
|
581
476
|
* @throws Error if request fails
|
|
582
477
|
*/
|
|
583
|
-
|
|
584
478
|
}, {
|
|
585
479
|
key: "publishFeatureType",
|
|
586
480
|
value: function () {
|
|
587
481
|
var _publishFeatureType = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(workspace, dataStore, nativeName, name, title, srs, enabled, _abstract2, nativeBoundingBox) {
|
|
588
482
|
var body, response, geoServerResponse;
|
|
589
483
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
590
|
-
while (1) {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
$: srs
|
|
598
|
-
};
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
body = {
|
|
602
|
-
featureType: {
|
|
603
|
-
name: name || nativeName,
|
|
604
|
-
nativeName: nativeName,
|
|
605
|
-
title: title || name,
|
|
606
|
-
srs: srs || 'EPSG:4326',
|
|
607
|
-
enabled: enabled,
|
|
608
|
-
"abstract": _abstract2 || '',
|
|
609
|
-
nativeBoundingBox: nativeBoundingBox
|
|
610
|
-
}
|
|
484
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
485
|
+
case 0:
|
|
486
|
+
// apply CRS info for native BBOX if not provided
|
|
487
|
+
if (nativeBoundingBox && !nativeBoundingBox.crs) {
|
|
488
|
+
nativeBoundingBox.crs = {
|
|
489
|
+
'@class': 'projected',
|
|
490
|
+
$: srs
|
|
611
491
|
};
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
case 4:
|
|
624
|
-
response = _context8.sent;
|
|
625
|
-
|
|
626
|
-
if (response.ok) {
|
|
627
|
-
_context8.next = 10;
|
|
628
|
-
break;
|
|
492
|
+
}
|
|
493
|
+
body = {
|
|
494
|
+
featureType: {
|
|
495
|
+
name: name || nativeName,
|
|
496
|
+
nativeName: nativeName,
|
|
497
|
+
title: title || name,
|
|
498
|
+
srs: srs || 'EPSG:4326',
|
|
499
|
+
enabled: enabled,
|
|
500
|
+
"abstract": _abstract2 || '',
|
|
501
|
+
nativeBoundingBox: nativeBoundingBox
|
|
629
502
|
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
503
|
+
};
|
|
504
|
+
_context8.next = 4;
|
|
505
|
+
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/datastores/' + dataStore + '/featuretypes', {
|
|
506
|
+
credentials: 'include',
|
|
507
|
+
method: 'POST',
|
|
508
|
+
headers: {
|
|
509
|
+
Authorization: this.auth,
|
|
510
|
+
'Content-Type': 'application/json'
|
|
511
|
+
},
|
|
512
|
+
body: JSON.stringify(body)
|
|
513
|
+
});
|
|
514
|
+
case 4:
|
|
515
|
+
response = _context8.sent;
|
|
516
|
+
if (response.ok) {
|
|
517
|
+
_context8.next = 10;
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
_context8.next = 8;
|
|
521
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
522
|
+
case 8:
|
|
523
|
+
geoServerResponse = _context8.sent;
|
|
524
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
525
|
+
case 10:
|
|
526
|
+
case "end":
|
|
527
|
+
return _context8.stop();
|
|
642
528
|
}
|
|
643
529
|
}, _callee8, this);
|
|
644
530
|
}));
|
|
645
|
-
|
|
646
531
|
function publishFeatureType(_x21, _x22, _x23, _x24, _x25, _x26, _x27, _x28, _x29) {
|
|
647
532
|
return _publishFeatureType.apply(this, arguments);
|
|
648
533
|
}
|
|
649
|
-
|
|
650
534
|
return publishFeatureType;
|
|
651
535
|
}()
|
|
652
536
|
/**
|
|
@@ -660,69 +544,55 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
660
544
|
*
|
|
661
545
|
* @returns {Object} The object of the FeatureType
|
|
662
546
|
*/
|
|
663
|
-
|
|
664
547
|
}, {
|
|
665
548
|
key: "getFeatureType",
|
|
666
549
|
value: function () {
|
|
667
550
|
var _getFeatureType = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(workspace, datastore, name) {
|
|
668
551
|
var url, response, grc, geoServerResponse;
|
|
669
552
|
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
670
|
-
while (1) {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
Authorization: this.auth
|
|
680
|
-
}
|
|
681
|
-
});
|
|
682
|
-
|
|
683
|
-
case 3:
|
|
684
|
-
response = _context9.sent;
|
|
685
|
-
|
|
686
|
-
if (response.ok) {
|
|
687
|
-
_context9.next = 16;
|
|
688
|
-
break;
|
|
553
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
554
|
+
case 0:
|
|
555
|
+
url = this.url + 'workspaces/' + workspace + '/datastores/' + datastore + '/featuretypes/' + name + '.json';
|
|
556
|
+
_context9.next = 3;
|
|
557
|
+
return (0, _nodeFetch["default"])(url, {
|
|
558
|
+
credentials: 'include',
|
|
559
|
+
method: 'GET',
|
|
560
|
+
headers: {
|
|
561
|
+
Authorization: this.auth
|
|
689
562
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}
|
|
563
|
+
});
|
|
564
|
+
case 3:
|
|
565
|
+
response = _context9.sent;
|
|
566
|
+
if (response.ok) {
|
|
567
|
+
_context9.next = 16;
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
grc = new _about["default"](this.url, this.auth);
|
|
571
|
+
_context9.next = 8;
|
|
572
|
+
return grc.exists();
|
|
573
|
+
case 8:
|
|
574
|
+
if (!_context9.sent) {
|
|
575
|
+
_context9.next = 12;
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
return _context9.abrupt("return");
|
|
579
|
+
case 12:
|
|
580
|
+
_context9.next = 14;
|
|
581
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
582
|
+
case 14:
|
|
583
|
+
geoServerResponse = _context9.sent;
|
|
584
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
585
|
+
case 16:
|
|
586
|
+
return _context9.abrupt("return", response.json());
|
|
587
|
+
case 17:
|
|
588
|
+
case "end":
|
|
589
|
+
return _context9.stop();
|
|
718
590
|
}
|
|
719
591
|
}, _callee9, this);
|
|
720
592
|
}));
|
|
721
|
-
|
|
722
593
|
function getFeatureType(_x30, _x31, _x32) {
|
|
723
594
|
return _getFeatureType.apply(this, arguments);
|
|
724
595
|
}
|
|
725
|
-
|
|
726
596
|
return getFeatureType;
|
|
727
597
|
}()
|
|
728
598
|
/**
|
|
@@ -739,64 +609,54 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
739
609
|
*
|
|
740
610
|
* @throws Error if request fails
|
|
741
611
|
*/
|
|
742
|
-
|
|
743
612
|
}, {
|
|
744
613
|
key: "publishWmsLayer",
|
|
745
614
|
value: function () {
|
|
746
615
|
var _publishWmsLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(workspace, dataStore, nativeName, name, title, srs, enabled, _abstract3) {
|
|
747
616
|
var body, response, geoServerResponse;
|
|
748
617
|
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
749
|
-
while (1) {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
"abstract": _abstract3 || ''
|
|
760
|
-
}
|
|
761
|
-
};
|
|
762
|
-
_context10.next = 3;
|
|
763
|
-
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/wmsstores/' + dataStore + '/wmslayers', {
|
|
764
|
-
credentials: 'include',
|
|
765
|
-
method: 'POST',
|
|
766
|
-
headers: {
|
|
767
|
-
Authorization: this.auth,
|
|
768
|
-
'Content-Type': 'application/json'
|
|
769
|
-
},
|
|
770
|
-
body: JSON.stringify(body)
|
|
771
|
-
});
|
|
772
|
-
|
|
773
|
-
case 3:
|
|
774
|
-
response = _context10.sent;
|
|
775
|
-
|
|
776
|
-
if (response.ok) {
|
|
777
|
-
_context10.next = 9;
|
|
778
|
-
break;
|
|
618
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
619
|
+
case 0:
|
|
620
|
+
body = {
|
|
621
|
+
wmsLayer: {
|
|
622
|
+
name: name || nativeName,
|
|
623
|
+
nativeName: nativeName,
|
|
624
|
+
title: title || name || nativeName,
|
|
625
|
+
srs: srs || 'EPSG:4326',
|
|
626
|
+
enabled: enabled,
|
|
627
|
+
"abstract": _abstract3 || ''
|
|
779
628
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
629
|
+
};
|
|
630
|
+
_context10.next = 3;
|
|
631
|
+
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/wmsstores/' + dataStore + '/wmslayers', {
|
|
632
|
+
credentials: 'include',
|
|
633
|
+
method: 'POST',
|
|
634
|
+
headers: {
|
|
635
|
+
Authorization: this.auth,
|
|
636
|
+
'Content-Type': 'application/json'
|
|
637
|
+
},
|
|
638
|
+
body: JSON.stringify(body)
|
|
639
|
+
});
|
|
640
|
+
case 3:
|
|
641
|
+
response = _context10.sent;
|
|
642
|
+
if (response.ok) {
|
|
643
|
+
_context10.next = 9;
|
|
644
|
+
break;
|
|
645
|
+
}
|
|
646
|
+
_context10.next = 7;
|
|
647
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
648
|
+
case 7:
|
|
649
|
+
geoServerResponse = _context10.sent;
|
|
650
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
651
|
+
case 9:
|
|
652
|
+
case "end":
|
|
653
|
+
return _context10.stop();
|
|
792
654
|
}
|
|
793
655
|
}, _callee10, this);
|
|
794
656
|
}));
|
|
795
|
-
|
|
796
657
|
function publishWmsLayer(_x33, _x34, _x35, _x36, _x37, _x38, _x39, _x40) {
|
|
797
658
|
return _publishWmsLayer.apply(this, arguments);
|
|
798
659
|
}
|
|
799
|
-
|
|
800
660
|
return publishWmsLayer;
|
|
801
661
|
}()
|
|
802
662
|
/**
|
|
@@ -813,64 +673,54 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
813
673
|
*
|
|
814
674
|
* @throws Error if request fails
|
|
815
675
|
*/
|
|
816
|
-
|
|
817
676
|
}, {
|
|
818
677
|
key: "publishDbRaster",
|
|
819
678
|
value: function () {
|
|
820
679
|
var _publishDbRaster = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(workspace, coverageStore, nativeName, name, title, srs, enabled, _abstract4) {
|
|
821
680
|
var body, response, geoServerResponse;
|
|
822
681
|
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
823
|
-
while (1) {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
"abstract": _abstract4 || ''
|
|
834
|
-
}
|
|
835
|
-
};
|
|
836
|
-
_context11.next = 3;
|
|
837
|
-
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/coveragestores/' + coverageStore + '/coverages', {
|
|
838
|
-
credentials: 'include',
|
|
839
|
-
method: 'POST',
|
|
840
|
-
headers: {
|
|
841
|
-
Authorization: this.auth,
|
|
842
|
-
'Content-Type': 'application/json'
|
|
843
|
-
},
|
|
844
|
-
body: JSON.stringify(body)
|
|
845
|
-
});
|
|
846
|
-
|
|
847
|
-
case 3:
|
|
848
|
-
response = _context11.sent;
|
|
849
|
-
|
|
850
|
-
if (response.ok) {
|
|
851
|
-
_context11.next = 9;
|
|
852
|
-
break;
|
|
682
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
683
|
+
case 0:
|
|
684
|
+
body = {
|
|
685
|
+
coverage: {
|
|
686
|
+
name: name || nativeName,
|
|
687
|
+
nativeName: nativeName,
|
|
688
|
+
title: title || name,
|
|
689
|
+
srs: srs,
|
|
690
|
+
enabled: enabled,
|
|
691
|
+
"abstract": _abstract4 || ''
|
|
853
692
|
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
693
|
+
};
|
|
694
|
+
_context11.next = 3;
|
|
695
|
+
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/coveragestores/' + coverageStore + '/coverages', {
|
|
696
|
+
credentials: 'include',
|
|
697
|
+
method: 'POST',
|
|
698
|
+
headers: {
|
|
699
|
+
Authorization: this.auth,
|
|
700
|
+
'Content-Type': 'application/json'
|
|
701
|
+
},
|
|
702
|
+
body: JSON.stringify(body)
|
|
703
|
+
});
|
|
704
|
+
case 3:
|
|
705
|
+
response = _context11.sent;
|
|
706
|
+
if (response.ok) {
|
|
707
|
+
_context11.next = 9;
|
|
708
|
+
break;
|
|
709
|
+
}
|
|
710
|
+
_context11.next = 7;
|
|
711
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
712
|
+
case 7:
|
|
713
|
+
geoServerResponse = _context11.sent;
|
|
714
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
715
|
+
case 9:
|
|
716
|
+
case "end":
|
|
717
|
+
return _context11.stop();
|
|
866
718
|
}
|
|
867
719
|
}, _callee11, this);
|
|
868
720
|
}));
|
|
869
|
-
|
|
870
721
|
function publishDbRaster(_x41, _x42, _x43, _x44, _x45, _x46, _x47, _x48) {
|
|
871
722
|
return _publishDbRaster.apply(this, arguments);
|
|
872
723
|
}
|
|
873
|
-
|
|
874
724
|
return publishDbRaster;
|
|
875
725
|
}()
|
|
876
726
|
/**
|
|
@@ -883,52 +733,42 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
883
733
|
*
|
|
884
734
|
* @throws Error if request fails
|
|
885
735
|
*/
|
|
886
|
-
|
|
887
736
|
}, {
|
|
888
737
|
key: "deleteFeatureType",
|
|
889
738
|
value: function () {
|
|
890
739
|
var _deleteFeatureType = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(workspace, datastore, name, recurse) {
|
|
891
740
|
var response, geoServerResponse;
|
|
892
741
|
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
893
|
-
while (1) {
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
Authorization: this.auth
|
|
902
|
-
}
|
|
903
|
-
});
|
|
904
|
-
|
|
905
|
-
case 2:
|
|
906
|
-
response = _context12.sent;
|
|
907
|
-
|
|
908
|
-
if (response.ok) {
|
|
909
|
-
_context12.next = 8;
|
|
910
|
-
break;
|
|
742
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
743
|
+
case 0:
|
|
744
|
+
_context12.next = 2;
|
|
745
|
+
return (0, _nodeFetch["default"])(this.url + 'workspaces/' + workspace + '/datastores/' + datastore + '/featuretypes/' + name + '?recurse=' + recurse, {
|
|
746
|
+
credentials: 'include',
|
|
747
|
+
method: 'DELETE',
|
|
748
|
+
headers: {
|
|
749
|
+
Authorization: this.auth
|
|
911
750
|
}
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
751
|
+
});
|
|
752
|
+
case 2:
|
|
753
|
+
response = _context12.sent;
|
|
754
|
+
if (response.ok) {
|
|
755
|
+
_context12.next = 8;
|
|
756
|
+
break;
|
|
757
|
+
}
|
|
758
|
+
_context12.next = 6;
|
|
759
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
760
|
+
case 6:
|
|
761
|
+
geoServerResponse = _context12.sent;
|
|
762
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
763
|
+
case 8:
|
|
764
|
+
case "end":
|
|
765
|
+
return _context12.stop();
|
|
924
766
|
}
|
|
925
767
|
}, _callee12, this);
|
|
926
768
|
}));
|
|
927
|
-
|
|
928
769
|
function deleteFeatureType(_x49, _x50, _x51, _x52) {
|
|
929
770
|
return _deleteFeatureType.apply(this, arguments);
|
|
930
771
|
}
|
|
931
|
-
|
|
932
772
|
return deleteFeatureType;
|
|
933
773
|
}()
|
|
934
774
|
/**
|
|
@@ -946,76 +786,66 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
946
786
|
*
|
|
947
787
|
* @throws Error if request fails
|
|
948
788
|
*/
|
|
949
|
-
|
|
950
789
|
}, {
|
|
951
790
|
key: "enableTimeCoverage",
|
|
952
791
|
value: function () {
|
|
953
792
|
var _enableTimeCoverage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(workspace, dataStore, name, presentation, resolution, defaultValue, nearestMatchEnabled, rawNearestMatchEnabled, acceptableInterval) {
|
|
954
793
|
var body, url, response, geoServerResponse;
|
|
955
794
|
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
|
956
|
-
while (1) {
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}]
|
|
977
|
-
}
|
|
795
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
796
|
+
case 0:
|
|
797
|
+
body = {
|
|
798
|
+
coverage: {
|
|
799
|
+
metadata: {
|
|
800
|
+
entry: [{
|
|
801
|
+
'@key': 'time',
|
|
802
|
+
dimensionInfo: {
|
|
803
|
+
enabled: true,
|
|
804
|
+
presentation: presentation || 'DISCRETE_INTERVAL',
|
|
805
|
+
resolution: resolution,
|
|
806
|
+
units: 'ISO8601',
|
|
807
|
+
defaultValue: {
|
|
808
|
+
strategy: defaultValue
|
|
809
|
+
},
|
|
810
|
+
nearestMatchEnabled: nearestMatchEnabled,
|
|
811
|
+
rawNearestMatchEnabled: rawNearestMatchEnabled,
|
|
812
|
+
acceptableInterval: acceptableInterval
|
|
813
|
+
}
|
|
814
|
+
}]
|
|
978
815
|
}
|
|
979
|
-
};
|
|
980
|
-
url = this.url + 'workspaces/' + workspace + '/coveragestores/' + dataStore + '/coverages/' + name + '.json';
|
|
981
|
-
_context13.next = 4;
|
|
982
|
-
return (0, _nodeFetch["default"])(url, {
|
|
983
|
-
credentials: 'include',
|
|
984
|
-
method: 'PUT',
|
|
985
|
-
headers: {
|
|
986
|
-
Authorization: this.auth,
|
|
987
|
-
'Content-Type': 'application/json'
|
|
988
|
-
},
|
|
989
|
-
body: JSON.stringify(body)
|
|
990
|
-
});
|
|
991
|
-
|
|
992
|
-
case 4:
|
|
993
|
-
response = _context13.sent;
|
|
994
|
-
|
|
995
|
-
if (response.ok) {
|
|
996
|
-
_context13.next = 10;
|
|
997
|
-
break;
|
|
998
816
|
}
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
817
|
+
};
|
|
818
|
+
url = this.url + 'workspaces/' + workspace + '/coveragestores/' + dataStore + '/coverages/' + name + '.json';
|
|
819
|
+
_context13.next = 4;
|
|
820
|
+
return (0, _nodeFetch["default"])(url, {
|
|
821
|
+
credentials: 'include',
|
|
822
|
+
method: 'PUT',
|
|
823
|
+
headers: {
|
|
824
|
+
Authorization: this.auth,
|
|
825
|
+
'Content-Type': 'application/json'
|
|
826
|
+
},
|
|
827
|
+
body: JSON.stringify(body)
|
|
828
|
+
});
|
|
829
|
+
case 4:
|
|
830
|
+
response = _context13.sent;
|
|
831
|
+
if (response.ok) {
|
|
832
|
+
_context13.next = 10;
|
|
833
|
+
break;
|
|
834
|
+
}
|
|
835
|
+
_context13.next = 8;
|
|
836
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
837
|
+
case 8:
|
|
838
|
+
geoServerResponse = _context13.sent;
|
|
839
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
840
|
+
case 10:
|
|
841
|
+
case "end":
|
|
842
|
+
return _context13.stop();
|
|
1011
843
|
}
|
|
1012
844
|
}, _callee13, this);
|
|
1013
845
|
}));
|
|
1014
|
-
|
|
1015
846
|
function enableTimeCoverage(_x53, _x54, _x55, _x56, _x57, _x58, _x59, _x60, _x61) {
|
|
1016
847
|
return _enableTimeCoverage.apply(this, arguments);
|
|
1017
848
|
}
|
|
1018
|
-
|
|
1019
849
|
return enableTimeCoverage;
|
|
1020
850
|
}()
|
|
1021
851
|
/**
|
|
@@ -1033,76 +863,66 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
1033
863
|
*
|
|
1034
864
|
* @throws Error if request fails
|
|
1035
865
|
*/
|
|
1036
|
-
|
|
1037
866
|
}, {
|
|
1038
867
|
key: "enableTimeFeatureType",
|
|
1039
868
|
value: function () {
|
|
1040
869
|
var _enableTimeFeatureType = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(workspace, dataStore, name, attribute, presentation, resolution, defaultValue, nearestMatchEnabled, rawNearestMatchEnabled, acceptableInterval) {
|
|
1041
870
|
var body, url, response, geoServerResponse;
|
|
1042
871
|
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
|
1043
|
-
while (1) {
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
}]
|
|
1064
|
-
}
|
|
872
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
873
|
+
case 0:
|
|
874
|
+
body = {
|
|
875
|
+
featureType: {
|
|
876
|
+
metadata: {
|
|
877
|
+
entry: [{
|
|
878
|
+
'@key': 'time',
|
|
879
|
+
dimensionInfo: {
|
|
880
|
+
attribute: attribute,
|
|
881
|
+
presentation: presentation,
|
|
882
|
+
resolution: resolution,
|
|
883
|
+
units: 'ISO8601',
|
|
884
|
+
defaultValue: {
|
|
885
|
+
strategy: defaultValue
|
|
886
|
+
},
|
|
887
|
+
nearestMatchEnabled: nearestMatchEnabled,
|
|
888
|
+
rawNearestMatchEnabled: rawNearestMatchEnabled,
|
|
889
|
+
acceptableInterval: acceptableInterval
|
|
890
|
+
}
|
|
891
|
+
}]
|
|
1065
892
|
}
|
|
1066
|
-
};
|
|
1067
|
-
url = this.url + 'workspaces/' + workspace + '/datastores/' + dataStore + '/featuretypes/' + name + '.json';
|
|
1068
|
-
_context14.next = 4;
|
|
1069
|
-
return (0, _nodeFetch["default"])(url, {
|
|
1070
|
-
credentials: 'include',
|
|
1071
|
-
method: 'PUT',
|
|
1072
|
-
headers: {
|
|
1073
|
-
Authorization: this.auth,
|
|
1074
|
-
'Content-Type': 'application/json'
|
|
1075
|
-
},
|
|
1076
|
-
body: JSON.stringify(body)
|
|
1077
|
-
});
|
|
1078
|
-
|
|
1079
|
-
case 4:
|
|
1080
|
-
response = _context14.sent;
|
|
1081
|
-
|
|
1082
|
-
if (response.ok) {
|
|
1083
|
-
_context14.next = 10;
|
|
1084
|
-
break;
|
|
1085
893
|
}
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
894
|
+
};
|
|
895
|
+
url = this.url + 'workspaces/' + workspace + '/datastores/' + dataStore + '/featuretypes/' + name + '.json';
|
|
896
|
+
_context14.next = 4;
|
|
897
|
+
return (0, _nodeFetch["default"])(url, {
|
|
898
|
+
credentials: 'include',
|
|
899
|
+
method: 'PUT',
|
|
900
|
+
headers: {
|
|
901
|
+
Authorization: this.auth,
|
|
902
|
+
'Content-Type': 'application/json'
|
|
903
|
+
},
|
|
904
|
+
body: JSON.stringify(body)
|
|
905
|
+
});
|
|
906
|
+
case 4:
|
|
907
|
+
response = _context14.sent;
|
|
908
|
+
if (response.ok) {
|
|
909
|
+
_context14.next = 10;
|
|
910
|
+
break;
|
|
911
|
+
}
|
|
912
|
+
_context14.next = 8;
|
|
913
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
914
|
+
case 8:
|
|
915
|
+
geoServerResponse = _context14.sent;
|
|
916
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
917
|
+
case 10:
|
|
918
|
+
case "end":
|
|
919
|
+
return _context14.stop();
|
|
1098
920
|
}
|
|
1099
921
|
}, _callee14, this);
|
|
1100
922
|
}));
|
|
1101
|
-
|
|
1102
923
|
function enableTimeFeatureType(_x62, _x63, _x64, _x65, _x66, _x67, _x68, _x69, _x70, _x71) {
|
|
1103
924
|
return _enableTimeFeatureType.apply(this, arguments);
|
|
1104
925
|
}
|
|
1105
|
-
|
|
1106
926
|
return enableTimeFeatureType;
|
|
1107
927
|
}()
|
|
1108
928
|
/**
|
|
@@ -1116,69 +936,55 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
1116
936
|
*
|
|
1117
937
|
* @returns {Object} An object with coverage information or undefined if it cannot be found
|
|
1118
938
|
*/
|
|
1119
|
-
|
|
1120
939
|
}, {
|
|
1121
940
|
key: "getCoverage",
|
|
1122
941
|
value: function () {
|
|
1123
942
|
var _getCoverage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(workspace, coverageStore, name) {
|
|
1124
943
|
var url, response, grc, geoServerResponse;
|
|
1125
944
|
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
|
1126
|
-
while (1) {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
Authorization: this.auth
|
|
1136
|
-
}
|
|
1137
|
-
});
|
|
1138
|
-
|
|
1139
|
-
case 3:
|
|
1140
|
-
response = _context15.sent;
|
|
1141
|
-
|
|
1142
|
-
if (response.ok) {
|
|
1143
|
-
_context15.next = 16;
|
|
1144
|
-
break;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
grc = new _about["default"](this.url, this.auth);
|
|
1148
|
-
_context15.next = 8;
|
|
1149
|
-
return grc.exists();
|
|
1150
|
-
|
|
1151
|
-
case 8:
|
|
1152
|
-
if (!_context15.sent) {
|
|
1153
|
-
_context15.next = 12;
|
|
1154
|
-
break;
|
|
945
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
946
|
+
case 0:
|
|
947
|
+
url = this.url + 'workspaces/' + workspace + '/coveragestores/' + coverageStore + '/coverages/' + name + '.json';
|
|
948
|
+
_context15.next = 3;
|
|
949
|
+
return (0, _nodeFetch["default"])(url, {
|
|
950
|
+
credentials: 'include',
|
|
951
|
+
method: 'GET',
|
|
952
|
+
headers: {
|
|
953
|
+
Authorization: this.auth
|
|
1155
954
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
_context15.next =
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
955
|
+
});
|
|
956
|
+
case 3:
|
|
957
|
+
response = _context15.sent;
|
|
958
|
+
if (response.ok) {
|
|
959
|
+
_context15.next = 16;
|
|
960
|
+
break;
|
|
961
|
+
}
|
|
962
|
+
grc = new _about["default"](this.url, this.auth);
|
|
963
|
+
_context15.next = 8;
|
|
964
|
+
return grc.exists();
|
|
965
|
+
case 8:
|
|
966
|
+
if (!_context15.sent) {
|
|
967
|
+
_context15.next = 12;
|
|
968
|
+
break;
|
|
969
|
+
}
|
|
970
|
+
return _context15.abrupt("return");
|
|
971
|
+
case 12:
|
|
972
|
+
_context15.next = 14;
|
|
973
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
974
|
+
case 14:
|
|
975
|
+
geoServerResponse = _context15.sent;
|
|
976
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
977
|
+
case 16:
|
|
978
|
+
return _context15.abrupt("return", response.json());
|
|
979
|
+
case 17:
|
|
980
|
+
case "end":
|
|
981
|
+
return _context15.stop();
|
|
1174
982
|
}
|
|
1175
983
|
}, _callee15, this);
|
|
1176
984
|
}));
|
|
1177
|
-
|
|
1178
985
|
function getCoverage(_x72, _x73, _x74) {
|
|
1179
986
|
return _getCoverage.apply(this, arguments);
|
|
1180
987
|
}
|
|
1181
|
-
|
|
1182
988
|
return getCoverage;
|
|
1183
989
|
}()
|
|
1184
990
|
/**
|
|
@@ -1193,72 +999,60 @@ var LayerClient = /*#__PURE__*/function () {
|
|
|
1193
999
|
*
|
|
1194
1000
|
* @throws Error if request fails
|
|
1195
1001
|
*/
|
|
1196
|
-
|
|
1197
1002
|
}, {
|
|
1198
1003
|
key: "renameCoverageBands",
|
|
1199
1004
|
value: function () {
|
|
1200
1005
|
var _renameCoverageBands = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(workspace, dataStore, layername, bandNames) {
|
|
1201
1006
|
var body, url, response, geoServerResponse;
|
|
1202
1007
|
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
|
1203
|
-
while (1) {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
coverageDimension: []
|
|
1210
|
-
}
|
|
1008
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1009
|
+
case 0:
|
|
1010
|
+
body = {
|
|
1011
|
+
coverage: {
|
|
1012
|
+
dimensions: {
|
|
1013
|
+
coverageDimension: []
|
|
1211
1014
|
}
|
|
1212
|
-
}; // dynamically create the body
|
|
1213
|
-
|
|
1214
|
-
bandNames.forEach(function (bandName) {
|
|
1215
|
-
body.coverage.dimensions.coverageDimension.push({
|
|
1216
|
-
name: bandName
|
|
1217
|
-
});
|
|
1218
|
-
});
|
|
1219
|
-
url = this.url + 'workspaces/' + workspace + '/coveragestores/' + dataStore + '/coverages/' + layername + '.json';
|
|
1220
|
-
_context16.next = 5;
|
|
1221
|
-
return (0, _nodeFetch["default"])(url, {
|
|
1222
|
-
credentials: 'include',
|
|
1223
|
-
method: 'PUT',
|
|
1224
|
-
headers: {
|
|
1225
|
-
Authorization: this.auth,
|
|
1226
|
-
'Content-Type': 'application/json'
|
|
1227
|
-
},
|
|
1228
|
-
body: JSON.stringify(body)
|
|
1229
|
-
});
|
|
1230
|
-
|
|
1231
|
-
case 5:
|
|
1232
|
-
response = _context16.sent;
|
|
1233
|
-
|
|
1234
|
-
if (response.ok) {
|
|
1235
|
-
_context16.next = 11;
|
|
1236
|
-
break;
|
|
1237
1015
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1016
|
+
}; // dynamically create the body
|
|
1017
|
+
bandNames.forEach(function (bandName) {
|
|
1018
|
+
body.coverage.dimensions.coverageDimension.push({
|
|
1019
|
+
name: bandName
|
|
1020
|
+
});
|
|
1021
|
+
});
|
|
1022
|
+
url = this.url + 'workspaces/' + workspace + '/coveragestores/' + dataStore + '/coverages/' + layername + '.json';
|
|
1023
|
+
_context16.next = 5;
|
|
1024
|
+
return (0, _nodeFetch["default"])(url, {
|
|
1025
|
+
credentials: 'include',
|
|
1026
|
+
method: 'PUT',
|
|
1027
|
+
headers: {
|
|
1028
|
+
Authorization: this.auth,
|
|
1029
|
+
'Content-Type': 'application/json'
|
|
1030
|
+
},
|
|
1031
|
+
body: JSON.stringify(body)
|
|
1032
|
+
});
|
|
1033
|
+
case 5:
|
|
1034
|
+
response = _context16.sent;
|
|
1035
|
+
if (response.ok) {
|
|
1036
|
+
_context16.next = 11;
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
_context16.next = 9;
|
|
1040
|
+
return (0, _geoserver.getGeoServerResponseText)(response);
|
|
1041
|
+
case 9:
|
|
1042
|
+
geoServerResponse = _context16.sent;
|
|
1043
|
+
throw new _geoserver.GeoServerResponseError(null, geoServerResponse);
|
|
1044
|
+
case 11:
|
|
1045
|
+
case "end":
|
|
1046
|
+
return _context16.stop();
|
|
1250
1047
|
}
|
|
1251
1048
|
}, _callee16, this);
|
|
1252
1049
|
}));
|
|
1253
|
-
|
|
1254
1050
|
function renameCoverageBands(_x75, _x76, _x77, _x78) {
|
|
1255
1051
|
return _renameCoverageBands.apply(this, arguments);
|
|
1256
1052
|
}
|
|
1257
|
-
|
|
1258
1053
|
return renameCoverageBands;
|
|
1259
1054
|
}()
|
|
1260
1055
|
}]);
|
|
1261
1056
|
return LayerClient;
|
|
1262
1057
|
}();
|
|
1263
|
-
|
|
1264
1058
|
exports["default"] = LayerClient;
|