geoserver-node-client 1.2.2 → 1.2.4

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 CHANGED
@@ -4,34 +4,35 @@
4
4
  [![Website](https://img.shields.io/website?up_message=API-Docs&url=https%3A%2F%2Fmeggsimum.github.io%2Fgeoserver-node-client%2F)](https://meggsimum.github.io/geoserver-node-client)
5
5
  ![GitHub Release Date](https://img.shields.io/github/release-date/meggsimum/geoserver-node-client)
6
6
  ![GitHub last commit](https://img.shields.io/github/last-commit/meggsimum/geoserver-node-client)
7
- ![](https://github.com/meggsimum/geoserver-node-client/actions/workflows/ci-geoserver-node-client.yml/badge.svg)
7
+ ![CI Badge](https://github.com/meggsimum/geoserver-node-client/actions/workflows/ci-geoserver-node-client.yml/badge.svg)
8
8
 
9
9
  ![GeoSever Node Client Logo](/img/geoserver-node-client-logo_150px.png)
10
10
 
11
11
  Node.js / JavaScript Client for the [GeoServer REST API](https://docs.geoserver.org/stable/en/user/rest/).
12
12
 
13
- ### API-Docs ###
13
+ ## API-Docs
14
14
 
15
15
  Detailed [API-Docs](https://meggsimum.github.io/geoserver-node-client/) are automatically created with JSDoc.
16
16
 
17
- ### Meta information
17
+ ## Meta information
18
18
 
19
19
  Compatible with [GeoServer](https://geoserver.org)
20
20
 
21
- - v2.21.x
22
- - v2.20.x
23
- - v2.19.x (no more maintained and officially deprecated)
24
- - v2.18.x (no more maintained and officially deprecated)
25
- - v2.17.x (no more maintained and officially deprecated)
21
+ - v2.22.x
22
+ - v2.21.x
23
+ - v2.20.x (no more maintained and officially deprecated)
24
+ - v2.19.x (no more maintained and officially deprecated)
25
+ - v2.18.x (no more maintained and officially deprecated)
26
+ - v2.17.x (no more maintained and officially deprecated)
26
27
 
27
-
28
- ### Usage
28
+ ## Usage
29
29
 
30
30
  ```shell
31
31
  npm i geoserver-node-client
32
32
  ```
33
33
 
34
34
  usage with require (ES5):
35
+
35
36
  ```js
36
37
  var grcImport = require('geoserver-node-client');
37
38
  var GeoServerRestClient = grcImport.GeoServerRestClient;
@@ -51,6 +52,7 @@ main();
51
52
  ```
52
53
 
53
54
  usage as ES module (ES6)
55
+
54
56
  ```js
55
57
  import {GeoServerRestClient} from 'geoserver-node-client';
56
58
 
@@ -67,7 +69,7 @@ async function main () {
67
69
  main();
68
70
  ```
69
71
 
70
- ### Setup
72
+ ## Setup
71
73
 
72
74
  Run as local checkout (mainly for development purposes)
73
75
 
@@ -81,7 +83,7 @@ npm install
81
83
  npm run demo
82
84
  ```
83
85
 
84
- ### Error Handling
86
+ ## Error Handling
85
87
 
86
88
  A request either succeeds or throws the custom `GeoServerResponseError`. It has the standard `message` property with a "human-readable" text. Additionally the error has the property `geoServerOutput` which contains the direct response from GeoServer. This output is not guaranteed to exist and can either be a simple text or a complete HTML document. The latter is difficult to read, but might still be helpful for debugging. This example shows how these error properties can be used. It also shows how to filter by error type:
87
89
 
@@ -104,14 +106,12 @@ A request either succeeds or throws the custom `GeoServerResponseError`. It has
104
106
  }
105
107
  ```
106
108
 
107
- ### Unit Tests
109
+ ## Unit Tests
108
110
 
109
- First start a GeoServer, e.g. by using this Docker container:
111
+ First start a test setup using this Docker compose file:
110
112
 
111
113
  ```shell
112
- docker run \
113
- -p 8080:8080 \
114
- meggsimum/geoserver:2.20.4
114
+ docker-compose -f test/docker-compose.yml up
115
115
  ```
116
116
 
117
117
  Then, in an other terminal, run:
@@ -121,7 +121,7 @@ Then, in an other terminal, run:
121
121
  GEOSERVER_VERSION=2.20.4 npm run test
122
122
  ```
123
123
 
124
- ### Release
124
+ ## Release
125
125
 
126
126
  Setting a git tag and increasing the version in the `package.json` as well as releasing to npm is done via [release-it](https://github.com/release-it/release-it).
127
127
 
@@ -153,11 +153,11 @@ npm run release
153
153
  - makes a release commit and pushes it to GitHub
154
154
  - publishes the new version to npm
155
155
 
156
- ### Who do I talk to? ###
156
+ ## Who do I talk to?
157
157
 
158
- * meggsimum (Christian Mayer) - info __at## meggsimum ~~dot** de
158
+ - meggsimum (Christian Mayer) - info __at## meggsimum ~~dot** de
159
159
 
160
- ### Credits
160
+ ## Credits
161
161
 
162
162
  This project was initiated by [meggsimum](https://meggsimum.de) within the [mFund](https://www.bmvi.de/EN/Topics/Digital-Matters/mFund/mFund.html) research project [SAUBER](https://sauber-projekt.de/) and is further developed in the mFund research project [KLIPS](http://www.klips-projekt.de/):
163
163
  <p><img src="https://sauber-projekt.de/wp-content/uploads/2018/12/SAG_SAUBER_Logo_Dez3_transparent-1-e1543843688935.png" alt="SAUBER Logo" width="200"/></p>.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geoserver-node-client",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Node.js client for GeoServer REST API",
5
5
  "type": "commonjs",
6
6
  "main": "geoserver-rest-client.js",
@@ -49,8 +49,8 @@
49
49
  "eslint-plugin-node": "^11.1.0",
50
50
  "eslint-plugin-promise": "^4.3.1",
51
51
  "eslint-plugin-standard": "^4.1.0",
52
- "jsdoc": "^3.6.10",
52
+ "jsdoc": "^4.0.0",
53
53
  "mocha": "^9.1.3",
54
- "release-it": "^14.14.3"
54
+ "release-it": "^15.4.2"
55
55
  }
56
56
  }
@@ -170,7 +170,6 @@ var DatastoreClient = /*#__PURE__*/function () {
170
170
  return getWmtsStores;
171
171
  }()
172
172
  /**
173
- * @private
174
173
  * Get information about various store types in a workspace.
175
174
  *
176
175
  * @param {String} workspace The workspace name
@@ -179,6 +178,7 @@ var DatastoreClient = /*#__PURE__*/function () {
179
178
  * @throws Error if request fails
180
179
  *
181
180
  * @returns {Object} An object containing store details or undefined if it cannot be found
181
+ * @private
182
182
  */
183
183
 
184
184
  }, {
@@ -365,7 +365,6 @@ var DatastoreClient = /*#__PURE__*/function () {
365
365
  return getWmtsStore;
366
366
  }()
367
367
  /**
368
- * @private
369
368
  * Get GeoServer store by type
370
369
  *
371
370
  * @param {String} workspace The name of the workspace
@@ -375,6 +374,7 @@ var DatastoreClient = /*#__PURE__*/function () {
375
374
  * @throws Error if request fails
376
375
  *
377
376
  * @returns {Object} An object containing store details or undefined if it cannot be found
377
+ * @private
378
378
  */
379
379
 
380
380
  }, {
@@ -523,12 +523,12 @@ var DatastoreClient = /*#__PURE__*/function () {
523
523
  * @param {String} namespaceUri The namespace URI of the workspace
524
524
  * @param {String} dataStore The data store name to be created
525
525
  * @param {String} pgHost The PostGIS DB host
526
- * @param {String} pgPort The PostGIS DB port
526
+ * @param {Number} pgPort The PostGIS DB port
527
527
  * @param {String} pgUser The PostGIS DB user
528
528
  * @param {String} pgPassword The PostGIS DB password
529
529
  * @param {String} pgSchema The PostGIS DB schema
530
530
  * @param {String} pgDb The PostGIS DB name
531
- * @param {String} [exposePk] expose primary key, defaults to false
531
+ * @param {Boolean} [exposePk] expose primary key, defaults to false
532
532
  *
533
533
  * @throws Error if request fails
534
534
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geoserver-node-client",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Node.js client for GeoServer REST API",
5
5
  "type": "module",
6
6
  "main": "geoserver-rest-client.js",
@@ -49,8 +49,8 @@
49
49
  "eslint-plugin-node": "^11.1.0",
50
50
  "eslint-plugin-promise": "^4.3.1",
51
51
  "eslint-plugin-standard": "^4.1.0",
52
- "jsdoc": "^3.6.10",
52
+ "jsdoc": "^4.0.0",
53
53
  "mocha": "^9.1.3",
54
- "release-it": "^14.14.3"
54
+ "release-it": "^15.4.2"
55
55
  }
56
56
  }
package/src/datastore.js CHANGED
@@ -65,7 +65,6 @@ export default class DatastoreClient {
65
65
  }
66
66
 
67
67
  /**
68
- * @private
69
68
  * Get information about various store types in a workspace.
70
69
  *
71
70
  * @param {String} workspace The workspace name
@@ -74,6 +73,7 @@ export default class DatastoreClient {
74
73
  * @throws Error if request fails
75
74
  *
76
75
  * @returns {Object} An object containing store details or undefined if it cannot be found
76
+ * @private
77
77
  */
78
78
  async getStores (workspace, storeType) {
79
79
  const response = await fetch(this.url + 'workspaces/' + workspace + '/' + storeType + '.json', {
@@ -140,7 +140,6 @@ export default class DatastoreClient {
140
140
  }
141
141
 
142
142
  /**
143
- * @private
144
143
  * Get GeoServer store by type
145
144
  *
146
145
  * @param {String} workspace The name of the workspace
@@ -150,6 +149,7 @@ export default class DatastoreClient {
150
149
  * @throws Error if request fails
151
150
  *
152
151
  * @returns {Object} An object containing store details or undefined if it cannot be found
152
+ * @private
153
153
  */
154
154
  async getStore (workspace, storeName, storeType) {
155
155
  const url = this.url + 'workspaces/' + workspace + '/' + storeType + '/' + storeName + '.json';
@@ -225,12 +225,12 @@ export default class DatastoreClient {
225
225
  * @param {String} namespaceUri The namespace URI of the workspace
226
226
  * @param {String} dataStore The data store name to be created
227
227
  * @param {String} pgHost The PostGIS DB host
228
- * @param {String} pgPort The PostGIS DB port
228
+ * @param {Number} pgPort The PostGIS DB port
229
229
  * @param {String} pgUser The PostGIS DB user
230
230
  * @param {String} pgPassword The PostGIS DB password
231
231
  * @param {String} pgSchema The PostGIS DB schema
232
232
  * @param {String} pgDb The PostGIS DB name
233
- * @param {String} [exposePk] expose primary key, defaults to false
233
+ * @param {Boolean} [exposePk] expose primary key, defaults to false
234
234
  *
235
235
  * @throws Error if request fails
236
236
  */