@ezs/basics 1.15.2 → 1.16.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/CHANGELOG.md +41 -0
- package/lib/index.js +4 -2
- package/lib/url-connect.js +2 -0
- package/lib/url-fetch.js +8 -1
- package/lib/url-stream.js +4 -3
- package/package.json +27 -32
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,47 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.16.0](https://github.com/Inist-CNRS/ezs/compare/@ezs/basics@1.15.5...@ezs/basics@1.16.0) (2022-02-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* 🎸 module.exports for all packages ([086a289](https://github.com/Inist-CNRS/ezs/commit/086a289ccbaa5c72ee7bc6652ab3c6c6b5578138))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.15.5](https://github.com/Inist-CNRS/ezs/compare/@ezs/basics@1.15.4...@ezs/basics@1.15.5) (2022-02-04)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* 🐛 improve warning debug message on error ([5ff32e8](https://github.com/Inist-CNRS/ezs/commit/5ff32e8e2e6c48913d8d1abd35b9cee68ff19be4))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [1.15.4](https://github.com/Inist-CNRS/ezs/compare/@ezs/basics@1.15.3...@ezs/basics@1.15.4) (2022-01-31)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* npm dependencies ([36c7ebe](https://github.com/Inist-CNRS/ezs/commit/36c7ebea03e82e9d177f7480f587511360e3dace))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## [1.15.3](https://github.com/Inist-CNRS/ezs/compare/@ezs/basics@1.15.2...@ezs/basics@1.15.3) (2022-01-31)
|
|
40
|
+
|
|
41
|
+
**Note:** Version bump only for package @ezs/basics
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
6
47
|
## [1.15.2](https://github.com/Inist-CNRS/ezs/compare/@ezs/basics@1.15.1...@ezs/basics@1.15.2) (2022-01-27)
|
|
7
48
|
|
|
8
49
|
**Note:** Version bump only for package @ezs/basics
|
package/lib/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var _iniString = _interopRequireDefault(require("./ini-string"));
|
|
|
55
55
|
|
|
56
56
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
const funcs = {
|
|
59
59
|
BUFObject: _bufObject.default,
|
|
60
60
|
OBJCount: _objCount.default,
|
|
61
61
|
OBJNamespaces: _objNamespaces.default,
|
|
@@ -87,4 +87,6 @@ var _default = {
|
|
|
87
87
|
split: _txtParse.default.TXTParse,
|
|
88
88
|
segmenter: _txtParse.default.TXTParse
|
|
89
89
|
};
|
|
90
|
-
|
|
90
|
+
var _default = funcs;
|
|
91
|
+
exports.default = _default;
|
|
92
|
+
module.exports = funcs;
|
package/lib/url-connect.js
CHANGED
|
@@ -50,6 +50,7 @@ function URLConnect(data, feed) {
|
|
|
50
50
|
method: 'POST',
|
|
51
51
|
body: this.input.pipe(ezs('dump')).pipe(ezs.toBuffer()),
|
|
52
52
|
timeout,
|
|
53
|
+
headers,
|
|
53
54
|
signal: controller.signal
|
|
54
55
|
}).then(({
|
|
55
56
|
body,
|
|
@@ -70,6 +71,7 @@ function URLConnect(data, feed) {
|
|
|
70
71
|
this.whenFinish = Promise.resolve(true);
|
|
71
72
|
|
|
72
73
|
if (!noerror) {
|
|
74
|
+
(0, _debug.default)('ezs')(`Break item #${this.getIndex()} [URLConnect] <${e}>`);
|
|
73
75
|
feed.stop(e);
|
|
74
76
|
} else {
|
|
75
77
|
(0, _debug.default)('ezs')(`Ignore item #${this.getIndex()} [URLConnect] <${e}>`);
|
package/lib/url-fetch.js
CHANGED
|
@@ -64,6 +64,12 @@ async function URLFetch(data, feed) {
|
|
|
64
64
|
|
|
65
65
|
try {
|
|
66
66
|
const response = await (0, _fetchWithProxy.default)(url, parameters);
|
|
67
|
+
|
|
68
|
+
if (!response.ok) {
|
|
69
|
+
const msg = `Received status code ${response.status} (${response.statusText})`;
|
|
70
|
+
throw new Error(msg);
|
|
71
|
+
}
|
|
72
|
+
|
|
67
73
|
const func = json ? 'json' : 'text';
|
|
68
74
|
const value = await response[func]();
|
|
69
75
|
|
|
@@ -79,10 +85,11 @@ async function URLFetch(data, feed) {
|
|
|
79
85
|
controller.abort();
|
|
80
86
|
|
|
81
87
|
if (noerror) {
|
|
88
|
+
(0, _debug.default)('ezs')(`Ignore item #${this.getIndex()} [URLFetch] <${e}>`);
|
|
82
89
|
return feed.send(data);
|
|
83
90
|
}
|
|
84
91
|
|
|
85
|
-
(0, _debug.default)('ezs')(`
|
|
92
|
+
(0, _debug.default)('ezs')(`Break item #${this.getIndex()} [URLFetch] <${e}>`);
|
|
86
93
|
return feed.send(e);
|
|
87
94
|
}
|
|
88
95
|
}
|
package/lib/url-stream.js
CHANGED
|
@@ -103,12 +103,12 @@ async function URLStream(data, feed) {
|
|
|
103
103
|
|
|
104
104
|
try {
|
|
105
105
|
const response = await (0, _fetchWithProxy.default)(cURL.href, {
|
|
106
|
-
headers,
|
|
107
106
|
timeout,
|
|
107
|
+
headers,
|
|
108
108
|
signal: controller.signal
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
if (response.
|
|
111
|
+
if (!response.ok) {
|
|
112
112
|
const msg = `Received status code ${response.status} (${response.statusText})`;
|
|
113
113
|
throw new Error(msg);
|
|
114
114
|
}
|
|
@@ -120,10 +120,11 @@ async function URLStream(data, feed) {
|
|
|
120
120
|
controller.abort();
|
|
121
121
|
|
|
122
122
|
if (noerror) {
|
|
123
|
+
(0, _debug.default)('ezs')(`Ignore item #${this.getIndex()} [URLStream] <${e}>`);
|
|
123
124
|
return feed.send(data);
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
(0, _debug.default)('ezs')(`
|
|
127
|
+
(0, _debug.default)('ezs')(`Break item #${this.getIndex()} [URLStream] <${e}>`);
|
|
127
128
|
return feed.send(e);
|
|
128
129
|
}
|
|
129
130
|
}
|
package/package.json
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezs/basics",
|
|
3
|
-
"version": "1.15.2",
|
|
4
3
|
"description": "Basics statements for EZS",
|
|
5
|
-
"
|
|
6
|
-
"test": "test"
|
|
7
|
-
},
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/Inist-CNRS/ezs.git"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"ezs"
|
|
14
|
-
],
|
|
4
|
+
"version": "1.16.0",
|
|
15
5
|
"author": "Nicolas Thouvenin <nthouvenin@gmail.com>",
|
|
16
|
-
"
|
|
17
|
-
"bugs": {
|
|
18
|
-
"url": "https://github.com/Inist-CNRS/ezs/issues"
|
|
19
|
-
},
|
|
20
|
-
"homepage": "https://github.com/Inist-CNRS/ezs/tree/master/packages/basics#readme",
|
|
6
|
+
"bugs": "https://github.com/Inist-CNRS/ezs/issues",
|
|
21
7
|
"dependencies": {
|
|
22
8
|
"JSONStream": "1.3.5",
|
|
23
|
-
"better-https-proxy-agent": "1.0.
|
|
9
|
+
"better-https-proxy-agent": "1.0.9",
|
|
24
10
|
"csv-string": "3.2.0",
|
|
25
|
-
"debug": "4.3.
|
|
11
|
+
"debug": "4.3.3",
|
|
26
12
|
"fetch-with-proxy": "3.0.1",
|
|
27
13
|
"flat": "5.0.2",
|
|
28
14
|
"lodash.escaperegexp": "4.1.2",
|
|
@@ -31,33 +17,42 @@
|
|
|
31
17
|
"lodash.mapvalues": "4.6.0",
|
|
32
18
|
"lodash.set": "4.3.2",
|
|
33
19
|
"lodash.zipobject": "4.1.3",
|
|
34
|
-
"micromatch": "4.0.
|
|
20
|
+
"micromatch": "4.0.4",
|
|
35
21
|
"node-abort-controller": "1.1.0",
|
|
36
22
|
"parse-headers": "2.0.4",
|
|
37
23
|
"stream-write": "1.0.1",
|
|
38
24
|
"tmp-filepath": "2.0.0",
|
|
39
25
|
"unzipper": "0.10.11",
|
|
40
|
-
"xml-mapping": "1.7.
|
|
26
|
+
"xml-mapping": "1.7.2",
|
|
41
27
|
"xml-splitter": "1.2.1",
|
|
42
28
|
"yajson-stream": "1.3.3"
|
|
43
29
|
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"pako": "2.0.4"
|
|
32
|
+
},
|
|
33
|
+
"directories": {
|
|
34
|
+
"test": "test"
|
|
35
|
+
},
|
|
36
|
+
"gitHead": "b0ced7e413e748195400608f9d3dc33d4487f112",
|
|
37
|
+
"homepage": "https://github.com/Inist-CNRS/ezs/tree/master/packages/basics#readme",
|
|
38
|
+
"keywords": [
|
|
39
|
+
"ezs"
|
|
40
|
+
],
|
|
41
|
+
"license": "MIT",
|
|
44
42
|
"main": "./lib/index.js",
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@ezs/core": "*"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"repository": "Inist-CNRS/ezs.git",
|
|
45
50
|
"scripts": {
|
|
51
|
+
"build": "babel --root-mode upward src --out-dir lib",
|
|
46
52
|
"doc": "documentation readme src/* --sort-order=alpha --shallow --markdown-toc-max-depth=2 --readme-file=../../docs/plugin-basics.md --section=usage && cp ../../docs/plugin-basics.md ./README.md",
|
|
47
53
|
"lint": "eslint --ext=.js ./test/*.js ./src/*.js",
|
|
48
|
-
"build": "babel --root-mode upward src --out-dir lib",
|
|
49
54
|
"prepublish": "npm run build",
|
|
50
55
|
"pretest": "npm run build",
|
|
51
56
|
"preversion": "npm run doc"
|
|
52
|
-
}
|
|
53
|
-
"publishConfig": {
|
|
54
|
-
"access": "public"
|
|
55
|
-
},
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"pako": "1.0.11"
|
|
58
|
-
},
|
|
59
|
-
"peerDependencies": {
|
|
60
|
-
"@ezs/core": "1.27.0"
|
|
61
|
-
},
|
|
62
|
-
"gitHead": "244fa62654a8651678bc3d2d0ee6ed46da2782b5"
|
|
57
|
+
}
|
|
63
58
|
}
|