itoolkit 1.0.0-rc.1 → 1.0.1

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.
Files changed (92) hide show
  1. package/.eslintrc.js +37 -11
  2. package/CHANGELOG.md +76 -2
  3. package/README.md +8 -8
  4. package/lib/Connection.js +0 -1
  5. package/lib/Deprecated.js +3 -4
  6. package/lib/ProgramCall.js +2 -2
  7. package/lib/transports/httpTransport.js +2 -2
  8. package/lib/transports/idbTransport.js +23 -11
  9. package/lib/transports/odbcTransport.js +16 -2
  10. package/lib/transports/sshTransport.js +4 -5
  11. package/package.json +15 -14
  12. package/test/README.md +2 -4
  13. package/test/functional/CommandCallFunctional.js +20 -12
  14. package/test/functional/ProgramCallFunctional.js +6 -66
  15. package/test/functional/checkObjectExists.js +12 -1
  16. package/test/functional/checkVersion.js +17 -0
  17. package/test/functional/deprecated/commandsFunctional.js +20 -11
  18. package/test/functional/deprecated/iDataQueueFunctional.js +10 -11
  19. package/test/functional/deprecated/iNetworkFunctional.js +8 -9
  20. package/test/functional/deprecated/iObjFunctional.js +18 -19
  21. package/test/functional/deprecated/iPgmFunctional.js +6 -42
  22. package/test/functional/deprecated/iProdFunctional.js +10 -11
  23. package/test/functional/deprecated/iSqlFunctional.js +30 -32
  24. package/test/functional/deprecated/iUserSpaceFunctional.js +29 -18
  25. package/test/functional/deprecated/iWorkFunctional.js +61 -59
  26. package/test/functional/iDataQueueFunctional.js +8 -9
  27. package/test/functional/iNetworkFunctional.js +6 -8
  28. package/test/functional/iObjFunctional.js +16 -17
  29. package/test/functional/iProdFunctional.js +8 -9
  30. package/test/functional/iSqlFunctional.js +30 -31
  31. package/test/functional/iUserSpaceFunctional.js +27 -16
  32. package/test/functional/iWorkFunctional.js +29 -33
  33. package/test/unit/CommandCallUnit.js +10 -11
  34. package/test/unit/ConnectionUnit.js +12 -19
  35. package/test/unit/ProgamCallUnit.js +27 -25
  36. package/test/unit/deprecated/commandsUnit.js +10 -11
  37. package/test/unit/deprecated/iConnUnit.js +12 -16
  38. package/test/unit/deprecated/iPgmUnit.js +25 -21
  39. package/test/unit/deprecated/iSqlUnit.js +69 -70
  40. package/test/unit/deprecated/xmlToJsonUnit.js +6 -9
  41. package/docs/CommandCall.rst +0 -22
  42. package/docs/Connection.rst +0 -133
  43. package/docs/Makefile +0 -20
  44. package/docs/ProgramCall.rst +0 -30
  45. package/docs/conf.py +0 -63
  46. package/docs/deprecated/examples/addQuery.js +0 -27
  47. package/docs/deprecated/examples/addToLibraryList.js +0 -15
  48. package/docs/deprecated/examples/callProcedure.js +0 -28
  49. package/docs/deprecated/examples/clearDataQueue.js +0 -15
  50. package/docs/deprecated/examples/createUserSpace.js +0 -15
  51. package/docs/deprecated/examples/deleteUserSpace.js +0 -15
  52. package/docs/deprecated/examples/getDataArea.js +0 -15
  53. package/docs/deprecated/examples/getInstalledProducts.js +0 -15
  54. package/docs/deprecated/examples/getJobInfo.js +0 -15
  55. package/docs/deprecated/examples/getJobStatus.js +0 -15
  56. package/docs/deprecated/examples/getNetInterfaceData.js +0 -15
  57. package/docs/deprecated/examples/getPTFInfo.js +0 -15
  58. package/docs/deprecated/examples/getProductInfo.js +0 -15
  59. package/docs/deprecated/examples/getSysStatus.js +0 -15
  60. package/docs/deprecated/examples/getSysStatusExt.js +0 -15
  61. package/docs/deprecated/examples/getSysValue.js +0 -15
  62. package/docs/deprecated/examples/getTCPIPAttr.js +0 -15
  63. package/docs/deprecated/examples/getUserSpaceData.js +0 -15
  64. package/docs/deprecated/examples/receiveFromDataQueue.js +0 -15
  65. package/docs/deprecated/examples/retrCmdInfo.js +0 -15
  66. package/docs/deprecated/examples/retrPgmInfo.js +0 -15
  67. package/docs/deprecated/examples/retrSrvPgmInfo.js +0 -16
  68. package/docs/deprecated/examples/retrUserAuthToObj.js +0 -15
  69. package/docs/deprecated/examples/retrUserInfo.js +0 -15
  70. package/docs/deprecated/examples/retrUsrAuth.js +0 -15
  71. package/docs/deprecated/examples/sendToDataQueue.js +0 -15
  72. package/docs/deprecated/examples/setUserSpaceData.js +0 -15
  73. package/docs/deprecated/iCmd.rst +0 -7
  74. package/docs/deprecated/iConn.rst +0 -9
  75. package/docs/deprecated/iDataQueue.rst +0 -33
  76. package/docs/deprecated/iNetwork.rst +0 -27
  77. package/docs/deprecated/iObj.rst +0 -64
  78. package/docs/deprecated/iPgm.rst +0 -9
  79. package/docs/deprecated/iProd.rst +0 -36
  80. package/docs/deprecated/iQsh.rst +0 -7
  81. package/docs/deprecated/iSh.rst +0 -7
  82. package/docs/deprecated/iSql.rst +0 -30
  83. package/docs/deprecated/iUserSpace.rst +0 -38
  84. package/docs/deprecated/iWork.rst +0 -58
  85. package/docs/deprecated.rst +0 -21
  86. package/docs/examples/cosine.js +0 -27
  87. package/docs/examples/qusrobjd.js +0 -80
  88. package/docs/examples/rtvjoba.js +0 -24
  89. package/docs/features.rst +0 -12
  90. package/docs/index.rst +0 -71
  91. package/docs/migratation-guide-v1.0.rst +0 -325
  92. package/docs/requirements.txt +0 -1
@@ -1,325 +0,0 @@
1
- Migrating from itoolkit v0.x to v1.x
2
- ************************************
3
-
4
- If you are upgrading an existing application its a great idea to have
5
- good test coverage before upgrading.
6
-
7
- Most applications applications using a version < 1.0.0 should continue
8
- to work but it’s still highly recommended to test your application
9
- first.
10
-
11
- .. WARNING::
12
- **BREAKING CHANGES**
13
-
14
- BREAKING CHANGES
15
- ================
16
-
17
- Sync Mode Operations
18
- --------------------
19
-
20
- ``iConn.run()`` no longer supports sync mode. Sync mode is not reccommended and since it did not work properly it was removed.
21
- See (`#32 <https://github.com/IBM/nodejs-itoolkit/issues/32>`__) for more details.
22
-
23
- ``iConn.setTimeout()`` is removed. This function was used to set the timeout for ``iConn.run``
24
- sync mode.
25
-
26
- iSql Authentication
27
- -------------------
28
-
29
- ``iSql.connect()`` and ``iSql.setOptions()`` are removed. These functions were used in conjunction
30
- for XMLSERVICE user
31
- authentication. The transports already handle user authentication.
32
-
33
- New Features
34
- ============
35
-
36
- SSH and ODBC transports
37
- -----------------------
38
-
39
- Users can now use ``ssh`` and ``odbc`` transports. This will allow users
40
- more ways to use itoolkit on their local machine.
41
-
42
- Support error first callbacks
43
- -----------------------------
44
-
45
- - ``iConn.run()`` did not return errors to the run callback.
46
- ``Connection.run()`` follows Node.js convention of `error first
47
- callbacks <https://nodejs.org/api/errors.html#errors_error_first_callbacks>`__.
48
- ``Connection`` still has a compatability option ``returnError`` to
49
- behave like ``iConn.run()`` and return the xml output as the first
50
- parameter of the run callback. See the :ref:`iconn-to-connection-run` section.
51
-
52
-
53
- Support DS types within addReturn
54
- ---------------------------------
55
-
56
- - ``iPgm.addReturn`` did not support the DS data type,
57
- ``ProgramCall.addReturn`` added support.
58
-
59
- Deprecated Classes and Functions
60
- ================================
61
-
62
- iConn
63
- -----
64
-
65
- The ``iConn`` class was replaced with the ``Connection`` class and it
66
- will be removed in ``v2.x``.
67
-
68
- Differences
69
- ^^^^^^^^^^^
70
-
71
- - ``Connection`` constructor accepts single object parameter.
72
- - ``Connection.run()`` follows Node.js convention of error first `error
73
- first
74
- callbacks <https://nodejs.org/api/errors.html#errors_error_first_callbacks>`__.
75
-
76
- Migrating from ``iConn`` to ``Connection``
77
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
-
79
- .. WARNING::
80
- Beware that the Connection and iConn classes differ in how they call the callbacks
81
- passed to their run methods. You cannot simply replace iConn with Connection without adjusting
82
- your callbacks. See the :ref:`iconn-to-connection-run` section.
83
-
84
- When connecting using idb-connector, ``iConn`` takes 3 arguments: ``database``, ``username``,
85
- and ``password``. These can be passed as attributes on the ``transportOptions`` attribute of the
86
- object passed to ``Connection`` and specify the transport is ``idb``. eg.
87
-
88
- .. code:: js
89
-
90
- // const conn = new iConn('*LOCAL', 'myuser', 'mypassword');
91
-
92
- const conn = new Connection({
93
- transport: 'idb',
94
- transportOptions: { database: '*LOCAL', username: 'myuser', password: 'mypassword' }
95
- });
96
-
97
- When connecting using rest, ``iConn`` takes 4 arguments: ``database``, ``username``, ``password``,
98
- and ``options``. The options object included ``host``, ``port``, and ``path`` to
99
- generate the url string. Instead specify ``database``, ``username``, ``password``, and ``url``
100
- on the ``transportOptions`` attribute of the object passed to ``Connection`` and specify the
101
- transport is ``rest``. eg.
102
-
103
- .. code:: js
104
-
105
- // const restConfig = { host: 'myhost.example.com', port: 80, path: '/cgi-bin/xmlcgi.pgm' }
106
- // const conn = new iConn('*LOCAL', 'myuser', 'mypassword', restConfig);
107
-
108
- const conn = new Connection({
109
- transport: 'rest',
110
- transportOptions: {
111
- database: '*LOCAL',
112
- username: 'myuser',
113
- password: 'mypassword',
114
- url: 'http://myhost.example.com/cgi-bin/xmlcgi.pgm',
115
- }
116
- });
117
-
118
- .. _iconn-to-connection-run:
119
-
120
- Migrating from ``iConn.run()`` to ``Connection.run()``
121
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122
-
123
- 1. Create an instance of Connection with ``returnError`` set to false.
124
- This is a compatabilty option to behave like ``iConn.run()`` and
125
- return the xml output as the first parameter of the run callback.
126
-
127
- .. code:: js
128
-
129
- // const conn = new iConn("*LOCAL", "myuser", "mypassword");
130
-
131
- const conn = new Connection({
132
- transport: 'idb',
133
- returnError: false,
134
- transportOptions: { database: '*LOCAL', username: 'myuser', password: 'mypassword' }
135
- });
136
-
137
- conn.add(...)
138
-
139
- conn.run((xmlOutput) => {
140
- ...
141
- })
142
-
143
- 2. Test your application still works as expected using this instance of
144
- ``Connection``.
145
-
146
- 3. Update ``Connection.run()`` callbacks to expect an error as the first
147
- parameter.
148
-
149
- .. code:: js
150
-
151
- conn.run((error, xmlOutput) => {
152
- if (error) { throw error; }
153
- });
154
-
155
- 4. Remove ``returnError`` property from the ``Connection`` constructor.
156
- The default behavior is to return error first callbacks.
157
-
158
- .. code:: js
159
-
160
- const conn = new Connection({
161
- transport: 'idb',
162
- transportOptions: { database: '*LOCAL', username: 'myuser', password: 'mypassword' }
163
- });
164
-
165
- iPgm
166
- ----
167
-
168
- ``iPgm`` was replaced by the ``ProgramCall`` and will be removed in
169
- ``v2.x``.
170
-
171
- Differences
172
- ^^^^^^^^^^^
173
-
174
- - Data and data structures and are now defined as objects.
175
- - ``ProgramCall.addParam()`` now accepts a single object parameter.
176
- - ``ProgramCall.addReturn()`` now accepts a single object parameter,
177
- - ``ProgramCall.addReturn()`` now supports DS as return type.
178
-
179
- Migrating from ``iPgm.addParam()`` to ``ProgramCall.addParam()``
180
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
181
-
182
- Parameter and data options are passed with the object parameter. Ensure
183
- the data type is specified; defaulting to use ``1024a`` is deprecated.
184
-
185
- .. code:: js
186
-
187
- // iPgm.addParam('0', '10i0', { io: 'in', setlen: 'rec1' })
188
-
189
- ProgramCall.addParam({ type: '10i0', io: 'in', setlen: 'rec1', value: 0 })
190
-
191
- Data structures have type ``ds`` and an additional ``fields`` property
192
- which is an array of data or ds objects.
193
-
194
- .. code:: js
195
-
196
- /*
197
- const ds = [
198
- [0, '10i0'],
199
- [0, '10i0', { setlen: 'rec2' }],
200
- ['', '36h'],
201
- ['', '10A'],
202
- ['', '1A'],
203
- ['', '1A'],
204
- [0, '10i0'],
205
- [0, '10i0'],
206
- ];
207
- */
208
-
209
- // iPgm.addParam(ds, { io: 'out', dim: '1' });
210
-
211
- const ds = {
212
- type: 'ds',
213
- dim: '1',
214
- io: 'out',
215
- fields: [
216
- { type: '10i0', value: 0 },
217
- { type: '10i0', value: 0, setlen: 'rec2' },
218
- { type: '36h', value: '' },
219
- { type: '10A', value: '' },
220
- { type: '1A', value: ''},
221
- { type: '1A', value: ''},
222
- { type: '10i0', value: 0 },
223
- { type: '10i0', value: 0 },
224
- ]
225
- };
226
-
227
- ProgramCall.addParam(ds);
228
-
229
- Migrating from ``iPgm.addReturn()`` to ``ProgramCall.addReturn()``
230
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
231
-
232
- Data previously defined as:
233
-
234
- ``addReturn('', '10A', { varying: '4' })``
235
-
236
- Will now be defined as:
237
-
238
- ``addReturn({type: '10A', value: '', varying: '4' })``
239
-
240
- iCmd
241
- ----
242
-
243
- ``iCmd`` is replaced by ``CommandCall`` and will be removed in ``v2.x``.
244
-
245
- A command previously generated with:
246
-
247
- ``const command = iCmd('RTVJOBA USRLIBL(?) SYSLIBL(?)')``
248
-
249
- Will now be generated with:
250
-
251
- ``const command = new CommandCall({type: 'cl', command: 'RTVJOBA USRLIBL(?) SYSLIBL(?)' })``
252
-
253
- iQsh
254
- ----
255
-
256
- ``iQsh`` is replaced by ``CommandCall`` and will be removed in ``v2.x``.
257
-
258
- A command previously generated with:
259
-
260
- ``const command = iQsh('system wrksyssts')``
261
-
262
- Will now be generated with:
263
-
264
- ``const command = new CommandCall({type: 'qsh', command: 'system wrksyssts' })``
265
-
266
- iSh
267
- ---
268
-
269
- ``iSh`` is replaced by ``CommandCall`` and will be removed in ``v2.x``.
270
-
271
- A command previously generated with:
272
-
273
- ``const command = iSh('ls /home')``
274
-
275
- Will now be generated with:
276
-
277
- ``const command = new CommandCall({type: 'sh', command: 'ls /home' })``
278
-
279
- iSql
280
- ----
281
-
282
- ``iSql`` class is deprecated and will be removed in ``v2.x``. The
283
- `odbc <https://www.npmjs.com/package/odbc>`__,
284
- `idb-connector <https://www.npmjs.com/package/idb-connector>`__, and
285
- `idb-pconnector <https://www.npmjs.com/package/idb-pconnector>`__ npm
286
- packages are much better SQL interfaces for IBM i and should be used
287
- instead.
288
-
289
- ``iSql.connect`` and ``iSql.setOptions`` are no longer available.
290
-
291
- xmlToJson
292
- ---------
293
-
294
- ``xmlToJson`` is deprecated and will be removed in ``v2.x``. Use
295
- `xml2js <https://www.npmjs.com/package/xml2js>`__ instead.
296
-
297
- iDataQueue
298
- ----------
299
-
300
- The ``iDataQueue`` class is deprecated and will be removed in ``v2.x``.
301
-
302
- iNetwork
303
- --------
304
-
305
- The ``iNetwork`` class is deprecated and will be removed in ``v2.x``.
306
-
307
- iObj
308
- ----
309
-
310
- The ``iObj`` class is deprecated and will be removed in ``v2.x``.
311
-
312
- iProd
313
- -----
314
-
315
- The ``iProd`` class is deprecated and will be removed in ``v2.x``.
316
-
317
- iUserSpace
318
- ----------
319
-
320
- The ``iUserSpace`` class is deprecated and will be removed in ``v2.x``.
321
-
322
- iWork
323
- -----
324
-
325
- The ``iWork`` class is deprecated and will be removed in ``v2.x``.
@@ -1 +0,0 @@
1
- sphinx-js>=2.8