@deltares/fews-web-oc-utils 2.2.0 → 2.3.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 +13 -1
- package/dist/fews-web-oc-utils.js +5 -12
- package/package.json +16 -20
package/README.md
CHANGED
|
@@ -24,12 +24,24 @@ Build only cjs bundle
|
|
|
24
24
|
npm run build:cjs
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
###
|
|
27
|
+
### Check formatting, lint and types
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
npm run check
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Lint
|
|
28
34
|
|
|
29
35
|
```
|
|
30
36
|
npm run lint
|
|
31
37
|
```
|
|
32
38
|
|
|
39
|
+
### Format files
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
npm run format
|
|
43
|
+
```
|
|
44
|
+
|
|
33
45
|
### Run tests
|
|
34
46
|
|
|
35
47
|
Get the coverage report
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/restservice/requestOptions.ts
|
|
2
2
|
var e = class {
|
|
3
3
|
_mode = "cors";
|
|
4
4
|
_relativeUrl = !0;
|
|
@@ -22,12 +22,7 @@ var e = class {
|
|
|
22
22
|
webserviceUrl;
|
|
23
23
|
transformRequest;
|
|
24
24
|
constructor(e, t) {
|
|
25
|
-
|
|
26
|
-
async function e(e) {
|
|
27
|
-
return e;
|
|
28
|
-
}
|
|
29
|
-
this.transformRequest = e;
|
|
30
|
-
} else this.transformRequest = t;
|
|
25
|
+
this.webserviceUrl = e, this.transformRequest = t ?? ((e) => Promise.resolve(e));
|
|
31
26
|
}
|
|
32
27
|
async getDataWithParser(e, t, n) {
|
|
33
28
|
let r = t.relativeUrl ? this.webserviceUrl + e : e, i = {}, a = {};
|
|
@@ -49,10 +44,9 @@ var e = class {
|
|
|
49
44
|
}
|
|
50
45
|
async postData(n, r, i) {
|
|
51
46
|
let a = new e();
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
47
|
+
a.relativeUrl = !n.startsWith("http");
|
|
48
|
+
let o = new Headers(i);
|
|
49
|
+
return o.has("Content-Type") || o.set("Content-Type", "application/json"), this.postDataWithParser(n, a, new t(), r, o);
|
|
56
50
|
}
|
|
57
51
|
async processResponse(e, t, n, r) {
|
|
58
52
|
e.responseCode = t.status, e.contentType = t.headers.get("content-type");
|
|
@@ -68,5 +62,4 @@ var e = class {
|
|
|
68
62
|
return await e.text();
|
|
69
63
|
}
|
|
70
64
|
};
|
|
71
|
-
//#endregion
|
|
72
65
|
export { t as DefaultParser, n as PiRestService, r as PlainTextParser, e as RequestOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deltares/fews-web-oc-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Util Library for common Web OC functionality",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Werner Kramer",
|
|
@@ -23,33 +23,28 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "
|
|
26
|
+
"build": "vp build && tsc -p tsconfig.build.json",
|
|
27
27
|
"doc": "typedoc src/index.ts",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"format": "
|
|
31
|
-
"test:unit": "
|
|
32
|
-
"test:e2e": "
|
|
33
|
-
"test": "
|
|
28
|
+
"check": "vp check",
|
|
29
|
+
"lint": "vp lint",
|
|
30
|
+
"format": "vp fmt .",
|
|
31
|
+
"test:unit": "vp test run test/unit",
|
|
32
|
+
"test:e2e": "vp test run test/e2e",
|
|
33
|
+
"test": "vp test"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"@types/node": "^24.12.2",
|
|
38
|
-
"eslint": "^10.10.0",
|
|
39
|
-
"eslint-config-prettier": "^10.1.8",
|
|
36
|
+
"@types/node": "^24.19.2",
|
|
40
37
|
"fetch-mock": "^12.6.0",
|
|
41
|
-
"globals": "^17.12.0",
|
|
42
38
|
"json-schema-to-typescript": "^16.0.0",
|
|
43
|
-
"prettier": "^3.9.6",
|
|
44
39
|
"tslib": "^2.8.1",
|
|
45
40
|
"typedoc": "^0.28.20",
|
|
46
41
|
"typescript": "^6.0.3",
|
|
47
|
-
"
|
|
48
|
-
"vite": "
|
|
49
|
-
"vitest": "
|
|
42
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
|
|
43
|
+
"vite-plus": "1.4.0",
|
|
44
|
+
"vitest": "5.0.5"
|
|
50
45
|
},
|
|
51
46
|
"engines": {
|
|
52
|
-
"node": "
|
|
47
|
+
"node": "^22.18.0 || ^24.11.0 || >=26.0.0"
|
|
53
48
|
},
|
|
54
49
|
"files": [
|
|
55
50
|
"dist/*"
|
|
@@ -65,7 +60,8 @@
|
|
|
65
60
|
"access": "public",
|
|
66
61
|
"registry": "https://registry.npmjs.org"
|
|
67
62
|
},
|
|
68
|
-
"
|
|
69
|
-
"
|
|
63
|
+
"overrides": {
|
|
64
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
|
|
65
|
+
"vitest": "5.0.5"
|
|
70
66
|
}
|
|
71
67
|
}
|