itoolkit 1.0.1 → 1.1.0-rc.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 +6 -2
- package/lib/CommandCall.js +2 -16
- package/lib/Connection.js +2 -16
- package/lib/Deprecated.js +892 -895
- package/lib/ProgramCall.js +2 -16
- package/lib/itoolkit.js +2 -16
- package/lib/transports/httpTransport.js +2 -16
- package/lib/transports/idbTransport.js +2 -16
- package/lib/transports/odbcTransport.js +2 -16
- package/lib/transports/sshTransport.js +2 -16
- package/package.json +21 -10
- package/.eslintrc.js +0 -39
- package/.gitattributes +0 -2
- package/.readthedocs.yml +0 -16
- package/CHANGELOG.md +0 -228
- package/contributors.txt +0 -2
- package/test/README.md +0 -44
- package/test/functional/CommandCallFunctional.js +0 -87
- package/test/functional/ProgramCallFunctional.js +0 -106
- package/test/functional/checkObjectExists.js +0 -193
- package/test/functional/checkVersion.js +0 -17
- package/test/functional/config.js +0 -35
- package/test/functional/deprecated/commandsFunctional.js +0 -108
- package/test/functional/deprecated/iDataQueueFunctional.js +0 -103
- package/test/functional/deprecated/iNetworkFunctional.js +0 -159
- package/test/functional/deprecated/iObjFunctional.js +0 -349
- package/test/functional/deprecated/iPgmFunctional.js +0 -104
- package/test/functional/deprecated/iProdFunctional.js +0 -160
- package/test/functional/deprecated/iSqlFunctional.js +0 -453
- package/test/functional/deprecated/iUserSpaceFunctional.js +0 -138
- package/test/functional/deprecated/iWorkFunctional.js +0 -238
- package/test/functional/iDataQueueFunctional.js +0 -83
- package/test/functional/iNetworkFunctional.js +0 -131
- package/test/functional/iObjFunctional.js +0 -326
- package/test/functional/iProdFunctional.js +0 -134
- package/test/functional/iSqlFunctional.js +0 -448
- package/test/functional/iUserSpaceFunctional.js +0 -134
- package/test/functional/iWorkFunctional.js +0 -215
- package/test/unit/CommandCallUnit.js +0 -87
- package/test/unit/ConnectionUnit.js +0 -188
- package/test/unit/ProgamCallUnit.js +0 -281
- package/test/unit/deprecated/commandsUnit.js +0 -87
- package/test/unit/deprecated/iConnUnit.js +0 -158
- package/test/unit/deprecated/iPgmUnit.js +0 -211
- package/test/unit/deprecated/iSqlUnit.js +0 -441
- package/test/unit/deprecated/xmlToJsonUnit.js +0 -200
package/lib/ProgramCall.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
2
|
-
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
4
|
-
// associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
5
|
-
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
6
|
-
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
7
|
-
// furnished to do so, subject to the following conditions:
|
|
8
|
-
|
|
9
|
-
// The above copyright notice and this permission notice shall be included in all copies or
|
|
10
|
-
// substantial portions of the Software.
|
|
11
|
-
|
|
12
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
13
|
-
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
14
|
-
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
15
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
16
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
// Copyright contributors to the nodejs-itoolkit project
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
17
3
|
|
|
18
4
|
/* eslint-disable no-underscore-dangle */
|
|
19
5
|
|
package/lib/itoolkit.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
2
|
-
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
4
|
-
// associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
5
|
-
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
6
|
-
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
7
|
-
// furnished to do so, subject to the following conditions:
|
|
8
|
-
|
|
9
|
-
// The above copyright notice and this permission notice shall be included in all copies or
|
|
10
|
-
// substantial portions of the Software.
|
|
11
|
-
|
|
12
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
13
|
-
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
14
|
-
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
15
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
16
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
// Copyright contributors to the nodejs-itoolkit project
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
17
3
|
|
|
18
4
|
/**
|
|
19
5
|
* main entry point for itoolkit package
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
2
|
-
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
4
|
-
// associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
5
|
-
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
6
|
-
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
7
|
-
// furnished to do so, subject to the following conditions:
|
|
8
|
-
|
|
9
|
-
// The above copyright notice and this permission notice shall be included in all copies or
|
|
10
|
-
// substantial portions of the Software.
|
|
11
|
-
|
|
12
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
13
|
-
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
14
|
-
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
15
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
16
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
// Copyright contributors to the nodejs-itoolkit project
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
17
3
|
|
|
18
4
|
const http = require('http');
|
|
19
5
|
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
2
|
-
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
4
|
-
// associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
5
|
-
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
6
|
-
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
7
|
-
// furnished to do so, subject to the following conditions:
|
|
8
|
-
|
|
9
|
-
// The above copyright notice and this permission notice shall be included in all copies or
|
|
10
|
-
// substantial portions of the Software.
|
|
11
|
-
|
|
12
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
13
|
-
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
14
|
-
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
15
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
16
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
// Copyright contributors to the nodejs-itoolkit project
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
17
3
|
|
|
18
4
|
let idb = null;
|
|
19
5
|
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
2
|
-
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
4
|
-
// associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
5
|
-
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
6
|
-
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
7
|
-
// furnished to do so, subject to the following conditions:
|
|
8
|
-
|
|
9
|
-
// The above copyright notice and this permission notice shall be included in all copies or
|
|
10
|
-
// substantial portions of the Software.
|
|
11
|
-
|
|
12
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
13
|
-
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
14
|
-
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
15
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
16
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
// Copyright contributors to the nodejs-itoolkit project
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
17
3
|
|
|
18
4
|
let odbc = null;
|
|
19
5
|
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
// Copyright
|
|
2
|
-
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
4
|
-
// associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
5
|
-
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
6
|
-
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
7
|
-
// furnished to do so, subject to the following conditions:
|
|
8
|
-
|
|
9
|
-
// The above copyright notice and this permission notice shall be included in all copies or
|
|
10
|
-
// substantial portions of the Software.
|
|
11
|
-
|
|
12
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
13
|
-
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
14
|
-
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
15
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
16
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
// Copyright contributors to the nodejs-itoolkit project
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
17
3
|
|
|
18
4
|
const { Client } = require('ssh2');
|
|
19
5
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "itoolkit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-rc.0",
|
|
4
4
|
"description": "XMLSERVICE wrapper to access to all things IBM i",
|
|
5
5
|
"main": "lib/itoolkit.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"lib/"
|
|
8
|
+
],
|
|
6
9
|
"directories": {
|
|
7
10
|
"lib": "lib",
|
|
8
11
|
"test": "test"
|
|
@@ -11,7 +14,8 @@
|
|
|
11
14
|
"test": "./node_modules/mocha/bin/mocha.js --recursive test/unit",
|
|
12
15
|
"test-integration": "./node_modules/mocha/bin/mocha.js --timeout 5s test/functional/*.js",
|
|
13
16
|
"lint": "./node_modules/eslint/bin/eslint.js lib/ test/",
|
|
14
|
-
"
|
|
17
|
+
"lint-fix": "./node_modules/eslint/bin/eslint.js lib/ test/ --fix",
|
|
18
|
+
"release": "./node_modules/release-it/bin/release-it.js"
|
|
15
19
|
},
|
|
16
20
|
"repository": {
|
|
17
21
|
"type": "git",
|
|
@@ -41,25 +45,32 @@
|
|
|
41
45
|
],
|
|
42
46
|
"dependencies": {
|
|
43
47
|
"depd": "^2.0.0",
|
|
44
|
-
"
|
|
48
|
+
"fast-xml-parser": "^5.7.0"
|
|
45
49
|
},
|
|
46
50
|
"devDependencies": {
|
|
51
|
+
"@release-it/conventional-changelog": "^12.0.2",
|
|
47
52
|
"chai": "^4.3.6",
|
|
48
53
|
"eslint": "^8.26.0",
|
|
49
54
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
50
55
|
"eslint-plugin-import": "^2.26.0",
|
|
51
56
|
"eslint-plugin-mocha": "^10.1.0",
|
|
52
|
-
"mocha": "^
|
|
57
|
+
"mocha": "^12.0.1",
|
|
58
|
+
"release-it": "^21.0.3",
|
|
53
59
|
"sinon": "^14.0.1"
|
|
54
60
|
},
|
|
55
61
|
"optionalDependencies": {
|
|
56
|
-
"idb-connector": "^1.
|
|
57
|
-
"idb-pconnector": "^1.
|
|
58
|
-
"odbc": "^2.
|
|
59
|
-
"ssh2": "^1.11.0"
|
|
60
|
-
"fast-xml-parser": "^4.0.11"
|
|
62
|
+
"idb-connector": "^1.3.0",
|
|
63
|
+
"idb-pconnector": "^1.2.0",
|
|
64
|
+
"odbc": "^2.6",
|
|
65
|
+
"ssh2": "^1.11.0"
|
|
61
66
|
},
|
|
62
67
|
"engines": {
|
|
63
|
-
"node": ">=
|
|
68
|
+
"node": ">= 20.0"
|
|
69
|
+
},
|
|
70
|
+
"allowScripts": {
|
|
71
|
+
"cpu-features@0.0.4": true,
|
|
72
|
+
"idb-pconnector@1.1.1": true,
|
|
73
|
+
"odbc@2.5.0": true,
|
|
74
|
+
"ssh2@1.11.0": true
|
|
64
75
|
}
|
|
65
76
|
}
|
package/.eslintrc.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: 'airbnb-base',
|
|
3
|
-
plugins: [
|
|
4
|
-
'mocha',
|
|
5
|
-
],
|
|
6
|
-
env: {
|
|
7
|
-
node: true,
|
|
8
|
-
},
|
|
9
|
-
rules: {
|
|
10
|
-
// Tweak rules set by airbnb config
|
|
11
|
-
// We need to allow use of console.log for verbose mode
|
|
12
|
-
'no-console': 'off',
|
|
13
|
-
// airbnb config forbids optionalDependencies
|
|
14
|
-
// https://github.com/airbnb/javascript/blob/c5bee75b1b358a3749f1a6d38ee6fad73de28e29/packages/eslint-config-airbnb-base/rules/imports.js#L95
|
|
15
|
-
"import/no-extraneous-dependencies": [ "error", { "optionalDependencies": true }],
|
|
16
|
-
// Project uses opt deps like odbc and idb-connector which may not exist
|
|
17
|
-
"import/no-unresolved": 'off',
|
|
18
|
-
},
|
|
19
|
-
overrides: [
|
|
20
|
-
{
|
|
21
|
-
files: ['test/**/*.js'],
|
|
22
|
-
env: {
|
|
23
|
-
node: true,
|
|
24
|
-
mocha: true,
|
|
25
|
-
},
|
|
26
|
-
extends: 'plugin:mocha/recommended',
|
|
27
|
-
rules: {
|
|
28
|
-
// These are set by airbnb-base, but go against Mocha conventions
|
|
29
|
-
// See https://mochajs.org/#arrow-functions
|
|
30
|
-
// and https://github.com/airbnb/javascript/issues/433
|
|
31
|
-
'func-names': 'off',
|
|
32
|
-
'prefer-arrow-callback': 'off',
|
|
33
|
-
|
|
34
|
-
// The following rules cause problems for our existing tests, so they are disabled for now:
|
|
35
|
-
'mocha/no-skipped-tests': 'off',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
};
|
package/.gitattributes
DELETED
package/.readthedocs.yml
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# .readthedocs.yml
|
|
2
|
-
# Read the Docs configuration file
|
|
3
|
-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
4
|
-
|
|
5
|
-
# Required
|
|
6
|
-
version: 2
|
|
7
|
-
|
|
8
|
-
# Build documentation in the docs/ directory with Sphinx
|
|
9
|
-
sphinx:
|
|
10
|
-
configuration: docs/conf.py
|
|
11
|
-
|
|
12
|
-
# Optionally set the version of Python and requirements required to build your docs
|
|
13
|
-
python:
|
|
14
|
-
version: 3.7
|
|
15
|
-
install:
|
|
16
|
-
- requirements: docs/requirements.txt
|
package/CHANGELOG.md
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [1.0.1](https://github.com/IBM/nodejs-itoolkit/compare/v1.0.0...v1.0.1) (2022-10-31)
|
|
4
|
-
|
|
5
|
-
- fix: Missing braces in README Example (#286)
|
|
6
|
-
- fix: Typo in ssh transport error message (#287)
|
|
7
|
-
- test: Remove redundant ProgramCall test (#284)
|
|
8
|
-
- test: Constrain eslint rules
|
|
9
|
-
- test: Fix eslint errors issues in eslintrc
|
|
10
|
-
- test: Configure tests to use Mocha env in eslintrc
|
|
11
|
-
- test: Adjust AirBnB rules for Mocha tests
|
|
12
|
-
- test: Use eslint-plugin-mocha for tests
|
|
13
|
-
- test: Remove arrow functions from mocha functions (#283)
|
|
14
|
-
- ci: Add eslint action (#244)
|
|
15
|
-
- docs: Update setup transport interface links (#292)
|
|
16
|
-
- fix: Emit deprecation warning for iPgm.addReturn (#295)
|
|
17
|
-
- build(deps-dev): bump standard-version from 7.1.0 to 8.0.1 (#299)
|
|
18
|
-
- build(deps): bump lodash from 4.17.15 to 4.17.19 (#302)
|
|
19
|
-
- chore: Unmark as stale if issue has been updated (#311)
|
|
20
|
-
- fix: Make exempt labels plural for stale action (#312)
|
|
21
|
-
- test: Check the XMLSERVICE version for QSH support (#303)
|
|
22
|
-
- fix: Update standard-version to resolve CVE-2020-8116 (#310)
|
|
23
|
-
- refactor: Handle optional dependencies better (#306)
|
|
24
|
-
- test: Fix mocha/no-identical-title eslint issue (#296)
|
|
25
|
-
- test: Fix mocha/no-hooks-for-single-case eslint issue (#297)
|
|
26
|
-
- fix: eslint GH action failure (#336)
|
|
27
|
-
- docs: Add comma to separate password and url key
|
|
28
|
-
- build(deps): Update deps to the latest version (#347)
|
|
29
|
-
- docs: Add omit as valid value for io (#346)
|
|
30
|
-
- docs: Reference alternate XML parser (#345)
|
|
31
|
-
- build: readthedocs build error (#349)
|
|
32
|
-
- build(deps): Add fast-xml-parser (#351)
|
|
33
|
-
- build(deps): Upgrade ssh2 to latest version (#355)
|
|
34
|
-
- fix: Better optional deps handling (#353)
|
|
35
|
-
- ci: Add npm publish action (#358)
|
|
36
|
-
- docs: Update cosine example to pass by value (#359)
|
|
37
|
-
|
|
38
|
-
## [1.0.0](https://github.com/IBM/nodejs-itoolkit/compare/1.0.0-alpha.1...1.0.0) (2020-05-08)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
### ⚠ BREAKING CHANGES
|
|
42
|
-
|
|
43
|
-
* Remove iSql.connect() and iSql.setOptions()
|
|
44
|
-
* Remove iConn.setTimeout()
|
|
45
|
-
|
|
46
|
-
### Features
|
|
47
|
-
|
|
48
|
-
* Allow DS for service program return value ([#217](https://github.com/IBM/nodejs-itoolkit/issues/217)) ([30e9f8a](https://github.com/IBM/nodejs-itoolkit/commit/30e9f8a69da829935dcee72dbd394032feef0e27))
|
|
49
|
-
* Specify supported Node versions ([#264](https://github.com/IBM/nodejs-itoolkit/issues/264)) ([63ec53c](https://github.com/IBM/nodejs-itoolkit/commit/63ec53c0ac17e9d4130b79074a61075ce0ac897e))
|
|
50
|
-
* use standard-version [#85](https://github.com/IBM/nodejs-itoolkit/issues/85) ([45f66a7](https://github.com/IBM/nodejs-itoolkit/commit/45f66a7f9ac5b5d37c907f5d088cb517cd4d3d66))
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
### Bug Fixes
|
|
54
|
-
|
|
55
|
-
* Add missing '?' in xml prolog ([bff8649](https://github.com/IBM/nodejs-itoolkit/commit/bff864991f73f5789c5dec563821c86eb1aab3fa))
|
|
56
|
-
* data type issue in Toolkit.getSysStatus and Toolkit.getSysStatusExt ([#190](https://github.com/IBM/nodejs-itoolkit/issues/190)) ([15397c2](https://github.com/IBM/nodejs-itoolkit/commit/15397c279d51b9282ef948b7d61d7d403690ce6f))
|
|
57
|
-
* Define errno structure correctly ([#192](https://github.com/IBM/nodejs-itoolkit/issues/192)) ([b1561f7](https://github.com/IBM/nodejs-itoolkit/commit/b1561f76e5803409c485f8b965745a060462852b)), closes [#191](https://github.com/IBM/nodejs-itoolkit/issues/191)
|
|
58
|
-
* Deprecated functional tests rest transport options ([#255](https://github.com/IBM/nodejs-itoolkit/issues/255)) ([903dd3f](https://github.com/IBM/nodejs-itoolkit/commit/903dd3f70f635f37bb2abba4a61b5a99a4f16ba3))
|
|
59
|
-
* eslint errors ([#243](https://github.com/IBM/nodejs-itoolkit/issues/243)) ([df40eb0](https://github.com/IBM/nodejs-itoolkit/commit/df40eb0c4898214493b22b9054d9eea57e6bccd9))
|
|
60
|
-
* Faulty error thrown by ProgramCall.addParam ([#124](https://github.com/IBM/nodejs-itoolkit/issues/124)) ([75d081c](https://github.com/IBM/nodejs-itoolkit/commit/75d081c86ae35f0557ea7b5a1f8886018de6ff36))
|
|
61
|
-
* Formatting errors in bug report template ([24a9262](https://github.com/IBM/nodejs-itoolkit/commit/24a92626e97f407dc7de998e2c65d6500d289eaf))
|
|
62
|
-
* Homepage link in package.json ([#267](https://github.com/IBM/nodejs-itoolkit/issues/267)) ([d5787ce](https://github.com/IBM/nodejs-itoolkit/commit/d5787cef2ade2d8fa298986a73040158dd2b6f84))
|
|
63
|
-
* HTTP transport should take a URL ([#252](https://github.com/IBM/nodejs-itoolkit/issues/252)) ([34e4e37](https://github.com/IBM/nodejs-itoolkit/commit/34e4e3765667a6060d82bd6dabf2bcd4569aa765))
|
|
64
|
-
* iConn unit test failure ([52f0330](https://github.com/IBM/nodejs-itoolkit/commit/52f0330801a8b5bbdbac19af4ff60ee80927a9e3))
|
|
65
|
-
* iConn unit test failure ([#274](https://github.com/IBM/nodejs-itoolkit/issues/274)) ([9e72857](https://github.com/IBM/nodejs-itoolkit/commit/9e728572fcfd734059d3a09e6934760518183250))
|
|
66
|
-
* Improper TOC nesting in main README ([#175](https://github.com/IBM/nodejs-itoolkit/issues/175)) ([db5d44c](https://github.com/IBM/nodejs-itoolkit/commit/db5d44cdcc79dbded8d3fa6f0717ed268d5d7606))
|
|
67
|
-
* minimist CVE ([#231](https://github.com/IBM/nodejs-itoolkit/issues/231)) ([6d02c43](https://github.com/IBM/nodejs-itoolkit/commit/6d02c43c38cf3c5fcc2e5ee559ea123ba97b12f2))
|
|
68
|
-
* Move iConn compatibility code to iConn itself ([#218](https://github.com/IBM/nodejs-itoolkit/issues/218)) ([73d798d](https://github.com/IBM/nodejs-itoolkit/commit/73d798deaf1ca840d2c0d5742ded40712fe33955))
|
|
69
|
-
* ssh transport econnreset ([#272](https://github.com/IBM/nodejs-itoolkit/issues/272)) ([d5e71c1](https://github.com/IBM/nodejs-itoolkit/commit/d5e71c159319574a937ee415df4c636d7f347ba7))
|
|
70
|
-
* ssh transport silent failure ([#225](https://github.com/IBM/nodejs-itoolkit/issues/225)) ([6e3b8a0](https://github.com/IBM/nodejs-itoolkit/commit/6e3b8a0f11539ee04540cf12d97cd6b67b3ed967))
|
|
71
|
-
* Test hooks timeout when using rest transport ([#253](https://github.com/IBM/nodejs-itoolkit/issues/253)) ([60fdd5b](https://github.com/IBM/nodejs-itoolkit/commit/60fdd5b75ba165646d8f888344aa1924c39272b1))
|
|
72
|
-
* TODOs in Deprecated.js ([#240](https://github.com/IBM/nodejs-itoolkit/issues/240)) ([cd47476](https://github.com/IBM/nodejs-itoolkit/commit/cd474766d769d7832cf38fca40a5ed14b19f4bfa))
|
|
73
|
-
* **idb:** Improve cleanup handling ([#233](https://github.com/IBM/nodejs-itoolkit/issues/233)) ([c2bb115](https://github.com/IBM/nodejs-itoolkit/commit/c2bb1152e13785a975597da41d6ca7df94bf4c09))
|
|
74
|
-
* Use encodeURIComponent for URL params ([2c98b22](https://github.com/IBM/nodejs-itoolkit/commit/2c98b229148adbc3475d2eba1c1f397cd7367447)), closes [#72](https://github.com/IBM/nodejs-itoolkit/issues/72) [#71](https://github.com/IBM/nodejs-itoolkit/issues/71)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
* Remove iConn.setTimeout() ([c978c41](https://github.com/IBM/nodejs-itoolkit/commit/c978c41ad28f5e4db152bd4bd5e56ba3824ea650))
|
|
78
|
-
* Remove iSql.connect() and iSql.setOptions() ([066e8ba](https://github.com/IBM/nodejs-itoolkit/commit/066e8ba43e0c68ff6165b4be8f1d00eac1242f38))
|
|
79
|
-
|
|
80
|
-
## [1.0.0-alpha.1](https://github.com/IBM/nodejs-itoolkit/compare/1.0.0-alpha.0...1.0.0-alpha.1) (2019-07-10)
|
|
81
|
-
|
|
82
|
-
### Bug Fixes
|
|
83
|
-
|
|
84
|
-
* Bump version to 1.0.0-alpha.1 ([a7b4770](https://github.com/IBM/nodejs-itoolkit/commit/a7b47704b4e564329288efad51d06fcd7d166609))
|
|
85
|
-
|
|
86
|
-
* Add check for connectError ([0ec197e](https://github.com/IBM/nodejs-itoolkit/commit/0ec197e37114c34857eb75edf4b86889c0fdfdd7))
|
|
87
|
-
|
|
88
|
-
* Use POST method for REST transport ([#65](https://github.com/IBM/nodejs-itoolkit/issues/65)) ([6a9f91f](https://github.com/IBM/nodejs-itoolkit/commit/6a9f91fc5b556a2991668a2fa64a4b321cb25bb2))
|
|
89
|
-
|
|
90
|
-
## [1.0.0-alpha.0](https://github.com/IBM/nodejs-itoolkit/compare/v0.1.6...1.0.0-alpha.0) (2019-06-27)
|
|
91
|
-
|
|
92
|
-
### ⚠ BREAKING CHANGES
|
|
93
|
-
|
|
94
|
-
* Removed 'sync' logic from all the functions. Have all internal functions using ProgramCaller instead of xt.iPgm. Fixed eslint-disable sections, but there are a few that are still needed (bitwise operations) ([#32](https://github.com/IBM/nodejs-itoolkit/issues/32)) ([7fdf0fd](https://github.com/IBM/nodejs-itoolkit/commit/7fdf0fd5b530297699ac8ffc80f5cfaa18e1fc72))
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
* Remove setTimeout() method see issue ([#32](https://github.com/IBM/nodejs-itoolkit/issues/32)) We no longer support sync mode which had an option to set timeout ([ee3d048](https://github.com/IBM/nodejs-itoolkit/commit/ee3d048cd61842a29b9ad8a848c8439c9658c337))
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
### Features
|
|
101
|
-
|
|
102
|
-
* Rework Connection.js see issues ([#25](https://github.com/IBM/nodejs-itoolkit/issues/25)) ([#2](https://github.com/IBM/nodejs-itoolkit/issues/2)) ([4dcb183](https://github.com/IBM/nodejs-itoolkit/commit/4dcb183bda082e55a820528a2e741d6e622a94cd))
|
|
103
|
-
|
|
104
|
-
Allow Connection.js Constructor to accept a single object see #25
|
|
105
|
-
Allow Connection.run() function to return error as first param of callback see #2
|
|
106
|
-
|
|
107
|
-
* Add ssh transport ([5f1c803](https://github.com/IBM/nodejs-itoolkit/commit/5f1c803855a35de12c23c7b91778fc1716dc3a0a))
|
|
108
|
-
|
|
109
|
-
* Add odbc transport ([7956a15](https://github.com/IBM/nodejs-itoolkit/commit/7956a153dc5d0665a1fecc3d0fe77075719da9dc))
|
|
110
|
-
|
|
111
|
-
### Bug Fixes
|
|
112
|
-
|
|
113
|
-
* Patch SqlCall.js ([aa9591c](https://github.com/IBM/nodejs-itoolkit/commit/aa9591c24402dcca0fbcf750e6a77ded4f4dbd9d))
|
|
114
|
-
|
|
115
|
-
* **deps:** update with ssh2 and missing depd dependency ([45c1c57](https://github.com/IBM/nodejs-itoolkit/commit/45c1c5768750b05fd1f6c1ae2858070e4ba1ff77))
|
|
116
|
-
|
|
117
|
-
* **deps:** Update odbc dependency ([04bac84](https://github.com/IBM/nodejs-itoolkit/commit/04bac848bd902e70e07861905ff81aa2c6a453d6))
|
|
118
|
-
|
|
119
|
-
* Rework idb and rest transports ([#17](https://github.com/IBM/nodejs-itoolkit/issues/17)) ([6f2ddcd](https://github.com/IBM/nodejs-itoolkit/commit/6f2ddcda9be8ed0f9ad4e46af4bc7d6722fce707))
|
|
120
|
-
|
|
121
|
-
Update transports interface to accept config, xmlInput, done
|
|
122
|
-
|
|
123
|
-
idb transport
|
|
124
|
-
|
|
125
|
-
Use iPLUGR512k variant instead of iPLUG512k to iterate over a result set
|
|
126
|
-
|
|
127
|
-
Ensure conn and stmt are always cleaned up properly
|
|
128
|
-
- even during error states the stmt and conn objects are now cleaned
|
|
129
|
-
- add function clean() to avoid duplication
|
|
130
|
-
- this commit should help resolve issue #17
|
|
131
|
-
|
|
132
|
-
rest transport
|
|
133
|
-
|
|
134
|
-
Validate required: database, username, password
|
|
135
|
-
|
|
136
|
-
Enforce output buffer to be set to the max
|
|
137
|
-
- before default was only set now output buffer is always set to the max
|
|
138
|
-
|
|
139
|
-
Small fixes add mising semicolons, remove some comments, etc
|
|
140
|
-
|
|
141
|
-
### Tests
|
|
142
|
-
|
|
143
|
-
* Added unit and functional tests ([163939c](https://github.com/IBM/nodejs-itoolkit/pull/38/commits/163939c6520d8a9b35e433699bdb8f9bdf0598a4))
|
|
144
|
-
|
|
145
|
-
* Fixed some issues found during unit testing ([1f5421f](https://github.com/IBM/nodejs-itoolkit/pull/38/commits/1f5421fc3a080f337668d2ce01fbb912eb6ca9c6))
|
|
146
|
-
|
|
147
|
-
* Move existing unit/functional tests to deprecated folder ([c7a875e](https://github.com/IBM/nodejs-itoolkit/commit/c7a875e1f090330d330a1928390043cc0a481140))
|
|
148
|
-
|
|
149
|
-
* Update unit/functional tests ([c6c470d](https://github.com/IBM/nodejs-itoolkit/commit/c6c470d9d8c5ee185ac0db191d54f0f94b056e51))
|
|
150
|
-
|
|
151
|
-
* Added ToolkitFunctional.js ([8aa1f56](https://github.com/IBM/nodejs-itoolkit/commit/8aa1f56c8a1ccffdb158ae280c9643bfed5e4104))
|
|
152
|
-
|
|
153
|
-
* Rename unit/functional tests ([b8733bc](https://github.com/IBM/nodejs-itoolkit/commit/b8733bc5306747033d48430a41070c4efb9bcc9c))
|
|
154
|
-
|
|
155
|
-
* Bump default timeout for tests from 2s -> 3s ([6ef2cb3](https://github.com/IBM/nodejs-itoolkit/commit/6ef2cb3754ba217280cd09daf7f99a1433421897))
|
|
156
|
-
|
|
157
|
-
* Update configuration options in functional tests ([4ba0b8f](https://github.com/IBM/nodejs-itoolkit/commit/4ba0b8f1c8a278b8d948bd841bf6fe3ddb9c1172))
|
|
158
|
-
|
|
159
|
-
* Add ssh to available transports also add verbose configuration ([15ec42d](https://github.com/IBM/nodejs-itoolkit/commit/15ec42dd1acbf0f613d6f56220c4277d1b0cbe82))
|
|
160
|
-
|
|
161
|
-
* Add config for DSN ([8957bb4](https://github.com/IBM/nodejs-itoolkit/commit/8957bb4f469675427920622787786296be670ae9))
|
|
162
|
-
|
|
163
|
-
### Refactor
|
|
164
|
-
|
|
165
|
-
* Rename command.js -> CommandCall.js ([7c12d91](https://github.com/IBM/nodejs-itoolkit/commit/7c12d91ff009157caea954863d7c52a2d114a35f))
|
|
166
|
-
|
|
167
|
-
* Add CommandCall Class ([8884e7a](https://github.com/IBM/nodejs-itoolkit/commit/8884e7a15d4989e477b5386e097f98c00885bdc0))
|
|
168
|
-
|
|
169
|
-
- class to maintain command types (sh, cl, qsh) see issue #24
|
|
170
|
-
- merge (sh, cl, qsh) code into toXml
|
|
171
|
-
- add in some JSDoc annotations
|
|
172
|
-
|
|
173
|
-
* Update Toolkit.js ([36492d2](https://github.com/IBM/nodejs-itoolkit/commit/36492d25a8e3d33b9275214b12767c07a3a13dc1))
|
|
174
|
-
|
|
175
|
-
Add in checks for when returnError is false in Toolkit.js.
|
|
176
|
-
This is case occurs when a call from deprecated class goes through
|
|
177
|
-
Toolkit.js. Instead of worrying about setting the flag on and off
|
|
178
|
-
create a new Connection object when same config when returnError is
|
|
179
|
-
false within the constructor. Then have proper checks for when to report
|
|
180
|
-
the error.
|
|
181
|
-
|
|
182
|
-
* Update Toolkit methods - Now all toolkit methods will have error first callbacks ([a632dbf](https://github.com/IBM/nodejs-itoolkit/commit/a632dbf1c99371771e47bd8922df9c75ce49f4b0))
|
|
183
|
-
|
|
184
|
-
* Move transports to lib/transports/ directory([8077fb7](https://github.com/IBM/nodejs-itoolkit/commit/8077fb70aec343c5cd5ed2e8c774d729bc43e1e7))
|
|
185
|
-
|
|
186
|
-
* Moving ALL deprecated functions into Deprecated.js They import the new classes and use them. Can be easily removed later. Also removed CommandGenerator class and just have 3 const functions exported ([d218b1d](https://github.com/IBM/nodejs-itoolkit/commit/d218b1d1e84844e841f2543d9f8687b6b96b76fd))
|
|
187
|
-
|
|
188
|
-
* Linted the tests, and made them use assert (before they only failed if the last object tested were not successful, and tracked success with a variable). Renamed the sql class to SqlCall. General cleanup ([a73d031](https://github.com/IBM/nodejs-itoolkit/commit/a73d03151ba2ce8272a00ba0b65b1e24b28529ff))
|
|
189
|
-
|
|
190
|
-
* Cut down and consolidated files. I think initial modularization was good, now building back up a little. icmd, iqsh, and ish are all mostly the same thing, and I made them live in the CommandGenerator class. Others, like iconn and isql, are definitely their own classes and rightly split off. I also put the deprecated classes into the file of the class that is replacing them to simplify the file structure. ([#24](https://github.com/IBM/nodejs-itoolkit/issues/24)) ([5e7b983](https://github.com/IBM/nodejs-itoolkit/issues/24))
|
|
191
|
-
|
|
192
|
-
* Creating 'Toolkit' class to hold all of the functions and stores the conn like the old classes. Keeping old classes but redirecting to toolkit and adding deprecation messages (todo) ([f8fc468](https://github.com/IBM/nodejs-itoolkit/commit/f8fc468d8d8bf2003ed105bd604a0c041d87b015))
|
|
193
|
-
|
|
194
|
-
* Consolidating 'classes' that serve no purpose into one file, now all functions that do the same type of work are together ([69d2825](https://github.com/IBM/nodejs-itoolkit/commit/69d282507797621565bc30a1bbcb1e4927f3697e))
|
|
195
|
-
|
|
196
|
-
* Modularize itoolkit.js ([#20](https://github.com/IBM/nodejs-itoolkit/issues/20)) ([35a2ffb](https://github.com/IBM/nodejs-itoolkit/commit/35a2ffb586300721127d93d8b64885d7aad6e84b))
|
|
197
|
-
|
|
198
|
-
* Getting rid of __getClass in itoolkit.js and places where it was imported ([f9812b7](https://github.com/IBM/nodejs-itoolkit/commit/5388b55dc0f0510b8f2570b6ea327d6853206fb1))
|
|
199
|
-
|
|
200
|
-
### Docs
|
|
201
|
-
|
|
202
|
-
* Add contribution guidelines ([89be160](https://github.com/IBM/nodejs-itoolkit/pull/38/commits/89be160344863dfd0509ea188cb1dc6d743625ad))
|
|
203
|
-
|
|
204
|
-
* Update Readme for v1.0.0 ([f51438e](https://github.com/IBM/nodejs-itoolkit/commit/f51438e21c1d1756f6105ec70b99f3aa22903c08))
|
|
205
|
-
|
|
206
|
-
* Update and Add SSH doc ([f7b8fd8](https://github.com/IBM/nodejs-itoolkit/commit/f7b8fd8d3c876765b9d8e027bb0816745dd9b18c))
|
|
207
|
-
|
|
208
|
-
* Add doc for odbc transport ([c0e80ff](https://github.com/IBM/nodejs-itoolkit/commit/c0e80ff110e48c8d51e1b95c65b82682150e0a99))
|
|
209
|
-
|
|
210
|
-
* Update install docs for alpha version ([8e81232](https://github.com/IBM/nodejs-itoolkit/commit/8e812324de0630f1de04e87eb0ae339a77ec22a5))
|
|
211
|
-
|
|
212
|
-
### Style
|
|
213
|
-
|
|
214
|
-
* Fix lingering files with CRLF line endings CRLF -> LF ([b21636c](https://github.com/IBM/nodejs-itoolkit/commit/b21636c4398c8c242bad278a3901d23991dd4f97))
|
|
215
|
-
|
|
216
|
-
* Fix line endings CRLF -> LF ([0541748](https://github.com/IBM/nodejs-itoolkit/commit/0541748c7c04c3e44ae1b2138bc0a74236c03986))
|
|
217
|
-
|
|
218
|
-
* Removing some eslint-disable comments now that ProgramCall fits with required naming convention ([be5247c](https://github.com/IBM/nodejs-itoolkit/commit/be5247c8e2fcd66d6b4026930c3bd3a7c778453e))
|
|
219
|
-
|
|
220
|
-
* Lint xmlToJson function ([17ef86f](https://github.com/IBM/nodejs-itoolkit/commit/17ef86f987b1056c8e325d73edfd5c5bada88dcc))
|
|
221
|
-
|
|
222
|
-
* Linted the /lib directory using airbnb-base linting configuration ([#21](https://github.com/IBM/nodejs-itoolkit/issues/21)) ([5388b55](https://github.com/IBM/nodejs-itoolkit/commit/5388b55dc0f0510b8f2570b6ea327d6853206fb1))
|
|
223
|
-
|
|
224
|
-
### [0.1.6](https://github.com/IBM/nodejs-itoolkit/compare/0.1.5...0.1.6) (2019-01-25)
|
|
225
|
-
|
|
226
|
-
### [0.1.5](https://github.com/IBM/nodejs-itoolkit/compare/0.1.4...0.1.5) (2019-01-08)
|
|
227
|
-
|
|
228
|
-
### 0.1.4 (2018-09-17)
|
package/contributors.txt
DELETED
package/test/README.md
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# Node.js Toolkit Tests
|
|
2
|
-
|
|
3
|
-
Ensure dependencies are installed by running `npm install` from the project root.
|
|
4
|
-
|
|
5
|
-
## Running Tests
|
|
6
|
-
|
|
7
|
-
- Run unit tests with `npm test`.
|
|
8
|
-
|
|
9
|
-
- Run functional tests with `npm run test-integration`.
|
|
10
|
-
|
|
11
|
-
***NOTE***
|
|
12
|
-
|
|
13
|
-
Integration tests require additional setup and configuration. Some tests require objects to preexist on the IBM i. The test case will check if the object exists and log instructions if the object is not found.
|
|
14
|
-
|
|
15
|
-
## [Setup Rest interface](https://nodejs-itoolkit.readthedocs.io/en/latest/Connection.html#rest)
|
|
16
|
-
|
|
17
|
-
## [Setup SSH interface](https://nodejs-itoolkit.readthedocs.io/en/latest/Connection.html#ssh)
|
|
18
|
-
|
|
19
|
-
## Configuring Tests
|
|
20
|
-
|
|
21
|
-
Functional tests can be configured using the following enviornment variables.
|
|
22
|
-
|
|
23
|
-
- `TKTRANSPORT` - The transport to use. Defaults to use `ssh`.
|
|
24
|
-
|
|
25
|
-
- `TKVERBOSE`- Enables verbose output.
|
|
26
|
-
|
|
27
|
-
- `TKHOST` - The hostname. Defaults to `localhost`.
|
|
28
|
-
|
|
29
|
-
- `TKUSER` - The user to connect as.
|
|
30
|
-
|
|
31
|
-
- `TKPASS` - The user's password.
|
|
32
|
-
|
|
33
|
-
- `TKDB` - The database to connect to. Defaults to `*LOCAL`.
|
|
34
|
-
|
|
35
|
-
- `TKPORT` - The port to use to connect.
|
|
36
|
-
|
|
37
|
-
- `TKPATH` - The path to xmlcgi. Defaults to `/cgi-bin/xmlcgi.pgm`
|
|
38
|
-
|
|
39
|
-
- `TKURL` - The url to the xmlcgi endpoint.
|
|
40
|
-
|
|
41
|
-
- `TKPK` - The path to a private key file when using `ssh` transport.
|
|
42
|
-
|
|
43
|
-
- `TKPHRASE` - The passphrase to decrypt the private key.
|
|
44
|
-
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// Copyright (c) International Business Machines Corp. 2019
|
|
2
|
-
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
4
|
-
// associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
5
|
-
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
6
|
-
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
7
|
-
// furnished to do so, subject to the following conditions:
|
|
8
|
-
|
|
9
|
-
// The above copyright notice and this permission notice shall be included in all copies or
|
|
10
|
-
// substantial portions of the Software.
|
|
11
|
-
|
|
12
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
13
|
-
// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
14
|
-
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
15
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
16
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
17
|
-
|
|
18
|
-
const { expect } = require('chai');
|
|
19
|
-
const { parseString } = require('xml2js');
|
|
20
|
-
const { CommandCall, Connection, ProgramCall } = require('../../lib/itoolkit');
|
|
21
|
-
const { config, printConfig } = require('./config');
|
|
22
|
-
const { isQSHSupported } = require('./checkVersion');
|
|
23
|
-
|
|
24
|
-
describe('CommandCall Functional Tests', function () {
|
|
25
|
-
before(function () {
|
|
26
|
-
printConfig();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe('CL command tests', function () {
|
|
30
|
-
it('calls CL command', function (done) {
|
|
31
|
-
const connection = new Connection(config);
|
|
32
|
-
connection.add(new CommandCall({ command: 'RTVJOBA USRLIBL(?) SYSLIBL(?)', type: 'cl' }));
|
|
33
|
-
connection.run((error, xmlOut) => {
|
|
34
|
-
expect(error).to.equal(null);
|
|
35
|
-
parseString(xmlOut, (parseError, result) => {
|
|
36
|
-
expect(parseError).to.equal(null);
|
|
37
|
-
expect(result.myscript.cmd[0].success[0]).to.include('+++ success RTVJOBA USRLIBL(?) SYSLIBL(?)');
|
|
38
|
-
done();
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
describe('SH command tests', function () {
|
|
45
|
-
it('calls PASE shell command', function (done) {
|
|
46
|
-
const connection = new Connection(config);
|
|
47
|
-
connection.add(new CommandCall({ command: 'system -i wrksyssts', type: 'sh' }));
|
|
48
|
-
connection.run((error, xmlOut) => {
|
|
49
|
-
expect(error).to.equal(null);
|
|
50
|
-
// xs does not return success property for sh or qsh command calls
|
|
51
|
-
// but on error sh or qsh node will not have any inner data
|
|
52
|
-
parseString(xmlOut, (parseError, result) => {
|
|
53
|
-
expect(parseError).to.equal(null);
|
|
54
|
-
expect(result.myscript.sh[0]._).to.match(/(System\sStatus\sInformation)/);
|
|
55
|
-
done();
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe('QSH command tests', function () {
|
|
62
|
-
it('calls QSH command', function (done) {
|
|
63
|
-
const connection = new Connection(config);
|
|
64
|
-
connection.add(new ProgramCall('MYPGMTOOLONG'));
|
|
65
|
-
connection.add(new CommandCall({ command: 'system wrksyssts', type: 'qsh' }));
|
|
66
|
-
connection.run((error, xmlOut) => {
|
|
67
|
-
expect(error).to.equal(null);
|
|
68
|
-
// xs does not return success property for sh or qsh command calls
|
|
69
|
-
// but on error sh or qsh node will not have any inner data
|
|
70
|
-
parseString(xmlOut, (parseError, result) => {
|
|
71
|
-
expect(parseError).to.equal(null);
|
|
72
|
-
const match = result.myscript.pgm[0].version[0].match(/\d\.\d\.\d/);
|
|
73
|
-
if (!match) {
|
|
74
|
-
throw Error('Unable to determine XMLSERVICE version');
|
|
75
|
-
}
|
|
76
|
-
if (!isQSHSupported(match[0])) {
|
|
77
|
-
// skip if QSH is unsupported
|
|
78
|
-
console.log(`XMLSERVICE version ${match[0]} does not support QSH`);
|
|
79
|
-
this.skip();
|
|
80
|
-
}
|
|
81
|
-
expect(result.myscript.qsh[0]._).to.match(/(System\sStatus\sInformation)/);
|
|
82
|
-
done();
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
});
|