@contrail/cli 3.4.4-alpha.7adb62a → 3.4.4-alpha.e5b7d5d
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 +1 -1
- package/node_modules/@contrail/loader/README.md +0 -0
- package/node_modules/@contrail/loader/lib/index.d.ts +941 -0
- package/node_modules/@contrail/loader/lib/index.js +12492 -0
- package/node_modules/@contrail/loader/lib/index.js.map +1 -0
- package/node_modules/@contrail/loader/package.json +70 -0
- package/node_modules/csv-parse/LICENSE +21 -0
- package/node_modules/csv-parse/README.md +86 -0
- package/node_modules/csv-parse/dist/cjs/index.cjs +1424 -0
- package/node_modules/csv-parse/dist/cjs/index.d.cts +283 -0
- package/node_modules/csv-parse/dist/cjs/sync.cjs +1336 -0
- package/node_modules/csv-parse/dist/cjs/sync.d.cts +11 -0
- package/node_modules/csv-parse/dist/esm/index.d.ts +283 -0
- package/node_modules/csv-parse/dist/esm/index.js +6544 -0
- package/node_modules/csv-parse/dist/esm/sync.d.ts +11 -0
- package/node_modules/csv-parse/dist/esm/sync.js +3305 -0
- package/node_modules/csv-parse/dist/iife/index.js +6553 -0
- package/node_modules/csv-parse/dist/iife/sync.js +3313 -0
- package/node_modules/csv-parse/dist/umd/index.js +6554 -0
- package/node_modules/csv-parse/dist/umd/sync.js +3314 -0
- package/node_modules/csv-parse/lib/api/CsvError.js +19 -0
- package/node_modules/csv-parse/lib/api/index.js +729 -0
- package/node_modules/csv-parse/lib/api/init_state.js +58 -0
- package/node_modules/csv-parse/lib/api/normalize_columns_array.js +33 -0
- package/node_modules/csv-parse/lib/api/normalize_options.js +448 -0
- package/node_modules/csv-parse/lib/index.d.ts +283 -0
- package/node_modules/csv-parse/lib/index.js +121 -0
- package/node_modules/csv-parse/lib/stream.js +27 -0
- package/node_modules/csv-parse/lib/sync.d.ts +11 -0
- package/node_modules/csv-parse/lib/sync.js +27 -0
- package/node_modules/csv-parse/lib/utils/ResizeableBuffer.js +64 -0
- package/node_modules/csv-parse/lib/utils/is_object.js +6 -0
- package/node_modules/csv-parse/lib/utils/underscore.js +8 -0
- package/node_modules/csv-parse/package.json +142 -0
- package/oclif.manifest.json +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@contrail/loader",
|
|
3
|
+
"version": "1.0.32",
|
|
4
|
+
"description": "Client library for helping with loader jobs.",
|
|
5
|
+
"homepage": "https://archergreysorg.github.io/contrail-loader/",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsup && dts-bundle-generator --no-check --external-inlines @contrail/entity-types --external-inlines @contrail/types --external-inlines @contrail/util --external-inlines @contrail/entity-compare --external-inlines @contrail/policies -o lib/index.d.ts src/index.ts",
|
|
10
|
+
"build:tsc": "tsc",
|
|
11
|
+
"typecheck": "tsc --noEmit",
|
|
12
|
+
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
13
|
+
"lint": "tslint -p tsconfig.json",
|
|
14
|
+
"generate-docs": "npx typedoc src/index.ts --disableSources --excludeInternal",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"lint-staged:check": "lint-staged --config .lintstagedrc-check.json",
|
|
17
|
+
"lint-staged:format": "lint-staged --allow-empty --config .lintstagedrc-format.json",
|
|
18
|
+
"publish-package": "npm run build && npm publish"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [],
|
|
21
|
+
"author": "",
|
|
22
|
+
"license": "ISC",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"lib"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"csv-parse": "^5.5.5",
|
|
31
|
+
"form-data": "^4.0.0",
|
|
32
|
+
"lodash": "^4.17.21",
|
|
33
|
+
"node-fetch": "^2.6.0",
|
|
34
|
+
"p-limit": "^3.0.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@contrail/entity-compare": "^1.0.5",
|
|
38
|
+
"@contrail/policies": "^2.0.7",
|
|
39
|
+
"@contrail/entity-types": "1.6.1",
|
|
40
|
+
"@contrail/types": "^3.0.33",
|
|
41
|
+
"@contrail/util": "^1.1.8",
|
|
42
|
+
"@types/jest": "^29.5.2",
|
|
43
|
+
"@types/lodash": "^4.17.24",
|
|
44
|
+
"@types/node": "^18.0.0",
|
|
45
|
+
"dts-bundle-generator": "^9.5.1",
|
|
46
|
+
"jest": "^29.5.0",
|
|
47
|
+
"lint-staged": "^15.2.5",
|
|
48
|
+
"prettier": "3.2.5",
|
|
49
|
+
"ts-jest": "^29.1.1",
|
|
50
|
+
"tslint": "^5.11.0",
|
|
51
|
+
"tslint-config-prettier": "^1.18.0",
|
|
52
|
+
"tsup": "^8.5.1",
|
|
53
|
+
"typedoc": "^0.25.7",
|
|
54
|
+
"typescript": "^4.7"
|
|
55
|
+
},
|
|
56
|
+
"jest": {
|
|
57
|
+
"moduleFileExtensions": [
|
|
58
|
+
"js",
|
|
59
|
+
"json",
|
|
60
|
+
"ts"
|
|
61
|
+
],
|
|
62
|
+
"rootDir": "src",
|
|
63
|
+
"testRegex": ".spec.ts$",
|
|
64
|
+
"transform": {
|
|
65
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
|
66
|
+
},
|
|
67
|
+
"coverageDirectory": "../coverage",
|
|
68
|
+
"testEnvironment": "node"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2010 Adaltas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
|
|
2
|
+
# CSV parser for Node.js and the web
|
|
3
|
+
|
|
4
|
+
[](https://github.com/adaltas/node-csv/actions)
|
|
5
|
+
[](https://www.npmjs.com/package/csv-parse)
|
|
6
|
+
[](https://www.npmjs.com/package/csv-parse)
|
|
7
|
+
|
|
8
|
+
The [`csv-parse` package](https://csv.js.org/parse/) is a parser converting CSV text input into arrays or objects. It is part of the [CSV project](https://csv.js.org/).
|
|
9
|
+
|
|
10
|
+
It implements the Node.js [`stream.Transform` API](http://nodejs.org/api/stream.html#stream_class_stream_transform). It also provides a simple callback-based API for convenience. It is both extremely easy to use and powerful. It was first released in 2010 and is used against big data sets by a large community.
|
|
11
|
+
|
|
12
|
+
## Documentation
|
|
13
|
+
|
|
14
|
+
* [Project homepage](https://csv.js.org/parse/)
|
|
15
|
+
* [API](https://csv.js.org/parse/api/)
|
|
16
|
+
* [Options](https://csv.js.org/parse/options/)
|
|
17
|
+
* [Info properties](https://csv.js.org/parse/info/)
|
|
18
|
+
* [Common errors](https://csv.js.org/parse/errors/)
|
|
19
|
+
* [Examples](https://csv.js.org/project/examples/)
|
|
20
|
+
|
|
21
|
+
## Main features
|
|
22
|
+
|
|
23
|
+
* Flexible with lot of [options](https://csv.js.org/parse/options/)
|
|
24
|
+
* Multiple [distributions](https://csv.js.org/parse/distributions/): Node.js, Web, ECMAScript modules and CommonJS
|
|
25
|
+
* Follow the Node.js streaming API
|
|
26
|
+
* Simplicity with the optional callback API
|
|
27
|
+
* Support delimiters, quotes, escape characters and comments
|
|
28
|
+
* Line breaks discovery
|
|
29
|
+
* Support big datasets
|
|
30
|
+
* Complete test coverage and lot of samples for inspiration
|
|
31
|
+
* No external dependencies
|
|
32
|
+
* Work nicely with the [csv-generate](https://csv.js.org/generate/), [stream-transform](https://csv.js.org/transform/) and [csv-stringify](https://csv.js.org/stringify/) packages
|
|
33
|
+
* MIT License
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
Run `npm install csv` to install the full CSV module or run `npm install csv-parse` if you are only interested by the CSV parser.
|
|
38
|
+
|
|
39
|
+
Use the callback and sync APIs for simplicity or the stream based API for scalability.
|
|
40
|
+
|
|
41
|
+
## Example
|
|
42
|
+
|
|
43
|
+
The [API](https://csv.js.org/parse/api/) is available in multiple flavors. This example illustrates the stream API.
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
import assert from 'assert';
|
|
47
|
+
import { parse } from 'csv-parse';
|
|
48
|
+
|
|
49
|
+
const records = [];
|
|
50
|
+
// Initialize the parser
|
|
51
|
+
const parser = parse({
|
|
52
|
+
delimiter: ':'
|
|
53
|
+
});
|
|
54
|
+
// Use the readable stream api to consume records
|
|
55
|
+
parser.on('readable', function(){
|
|
56
|
+
let record;
|
|
57
|
+
while ((record = parser.read()) !== null) {
|
|
58
|
+
records.push(record);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
// Catch any error
|
|
62
|
+
parser.on('error', function(err){
|
|
63
|
+
console.error(err.message);
|
|
64
|
+
});
|
|
65
|
+
// Test that the parsed records matched the expected records
|
|
66
|
+
parser.on('end', function(){
|
|
67
|
+
assert.deepStrictEqual(
|
|
68
|
+
records,
|
|
69
|
+
[
|
|
70
|
+
[ 'root','x','0','0','root','/root','/bin/bash' ],
|
|
71
|
+
[ 'someone','x','1022','1022','','/home/someone','/bin/bash' ]
|
|
72
|
+
]
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
// Write data to the stream
|
|
76
|
+
parser.write("root:x:0:0:root:/root:/bin/bash\n");
|
|
77
|
+
parser.write("someone:x:1022:1022::/home/someone:/bin/bash\n");
|
|
78
|
+
// Close the readable stream
|
|
79
|
+
parser.end();
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Contributors
|
|
83
|
+
|
|
84
|
+
The project is sponsored by [Adaltas](https://www.adaltas.com), an Big Data consulting firm based in Paris, France.
|
|
85
|
+
|
|
86
|
+
* David Worms: <https://github.com/wdavidw>
|