@sassoftware/restaflib 4.4.28 → 4.4.29

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/lib/restaflib.js CHANGED
@@ -653,7 +653,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
653
653
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
654
654
 
655
655
  "use strict";
656
- eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _programs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./programs */ \"./programs/index.js\");\n/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n* SPDX-License-Identifier: Apache-2.0\r\n*/\n\n\n\n\n\n\n/** \r\n * lib\r\n */\n\n/**\r\n *\r\n * @description Fetch rows from cas Tables\r\n * \r\n * @async\r\n * @module casFetchRows\r\n * @category restaflib/cas\r\n * @param {store} store - restaf store\r\n * @param {rafObject} session - cas session\r\n * @param {object} payload - info to read data\r\n * @returns {promise} returns data and data for scrolling.\r\n * \r\n * @example\r\n * async function test_casFetchRows () {\r\n * let {session} = await casSetup(store);\r\n * let payload = {\r\n * from : 1,\r\n * count : 20,\r\n * format: true,\r\n * table : {caslib: 'Public', name: 'cars'}\r\n * };\r\n * \r\n * let result = await restaflib.casFetchRows(store, session, payload);\r\n * console.log(result.data.schema);\r\n * console.log('The next start is at:' + result.pagination.next.from);\r\n * console.log(result.data.rows[0].toString());\r\n * \r\n * while (result.pagination.next.from !== -1) {\r\n * console.log('The start is at: ' + result.pagination.next.from);\r\n * result = await restaflib.casFetchRows(store, session, result.pagination.next);\r\n * console.log('The next start is at:' + result.pagination.next.from);\r\n * console.log(result.data.rows[0].toString());\r\n * };\r\n * console.log('--------------------------------------- scroll backwards');\r\n *\r\n * while (result.pagination.prev.from !== -1) {\r\n * console.log('The start is at: ' + result.pagination.prev.from);\r\n * result = await restaflib.casFetchRows(store, session, result.pagination.prev);\r\n * console.log('The previous start is at: ' + result.pagination.prev.from);\r\n * console.log(result.data.rows[0].toString());\r\n * };\r\n *\r\n * await store.apiCall(session.links('delete'));\r\n * }\r\n */\n\nfunction casFetchRows(_x, _x2, _x3) {\n return _casFetchRows.apply(this, arguments);\n}\n\nfunction _casFetchRows() {\n _casFetchRows = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, payload) {\n var casFetch, src, result, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n casFetch = payload.version === 2 ? 'casFetchRowsv2' : 'casFetchRows';\n src = _programs__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"]['commonCasl']() + ' ' + _programs__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"][casFetch]();\n _context.next = 4;\n return Object(_caslRunBase__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session, src, payload);\n\n case 4:\n result = _context.sent;\n r = result.items('results', 'casResults').toJS();\n\n if (r.data == null) {\n r.data = {\n rows: []\n };\n }\n\n return _context.abrupt(\"return\", r);\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _casFetchRows.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (casFetchRows);\n\n//# sourceURL=webpack://restaflib/./casFetchRows.js?");
656
+ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _programs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./programs */ \"./programs/index.js\");\n/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n* SPDX-License-Identifier: Apache-2.0\r\n*/\n\n\n\n\n\n\n/** \r\n * lib\r\n */\n\n/**\r\n *\r\n * @description Fetch rows from cas Tables\r\n * \r\n * @async\r\n * @module casFetchRows\r\n * @category restaflib/cas\r\n * @param {store} store - restaf store\r\n * @param {rafObject} session - cas session\r\n * @param {object} payload - info to read data\r\n * @returns {promise} returns data and data for scrolling.\r\n * \r\n * @example\r\n * async function test_casFetchRows () {\r\n * let {session} = await casSetup(store);\r\n * let payload = {\r\n * from : 1,\r\n * count : 20,\r\n * format: true,\r\n * table : {caslib: 'Public', name: 'cars'}\r\n * };\r\n * \r\n * let result = await restaflib.casFetchRows(store, session, payload);\r\n * console.log(result.data.schema);\r\n * console.log('The next start is at:' + result.pagination.next.from);\r\n * console.log(result.data.rows[0].toString());\r\n * \r\n * while (result.pagination.next.from !== -1) {\r\n * console.log('The start is at: ' + result.pagination.next.from);\r\n * result = await restaflib.casFetchRows(store, session, result.pagination.next);\r\n * console.log('The next start is at:' + result.pagination.next.from);\r\n * console.log(result.data.rows[0].toString());\r\n * };\r\n * console.log('--------------------------------------- scroll backwards');\r\n *\r\n * while (result.pagination.prev.from !== -1) {\r\n * console.log('The start is at: ' + result.pagination.prev.from);\r\n * result = await restaflib.casFetchRows(store, session, result.pagination.prev);\r\n * console.log('The previous start is at: ' + result.pagination.prev.from);\r\n * console.log(result.data.rows[0].toString());\r\n * };\r\n *\r\n * await store.apiCall(session.links('delete'));\r\n * }\r\n */\n\nfunction casFetchRows(_x, _x2, _x3) {\n return _casFetchRows.apply(this, arguments);\n}\n\nfunction _casFetchRows() {\n _casFetchRows = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, payload) {\n var src, result, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (payload.where == null) {\n payload.where = ' ';\n }\n\n src = _programs__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"]['commonCasl']() + ' ' + _programs__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"][casFetchRows]();\n _context.next = 4;\n return Object(_caslRunBase__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session, src, payload);\n\n case 4:\n result = _context.sent;\n r = result.items('results', 'casResults').toJS();\n\n if (r.data == null) {\n r.data = {\n rows: []\n };\n }\n\n return _context.abrupt(\"return\", r);\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _casFetchRows.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (casFetchRows);\n\n//# sourceURL=webpack://restaflib/./casFetchRows.js?");
657
657
 
658
658
  /***/ }),
659
659
 
@@ -848,7 +848,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
848
848
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
849
849
 
850
850
  "use strict";
851
- eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _computeSummary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeSummary */ \"./computeSummary.js\");\n/* harmony import */ var _computeRun__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./computeRun */ \"./computeRun.js\");\n/* harmony import */ var _computeResults__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./computeResults */ \"./computeResults.js\");\n/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n* SPDX-License-Identifier: Apache-2.0\r\n*/\n\n\n\n\n\n\n\n/**\r\n * @description Setup access to compute service\r\n * @async\r\n * @module computeSetup\r\n * @category restaflib/compute\r\n * \r\n * @param {store} store - restaf store\r\n * @param {session} SAS compute Session\r\n * @param {tables} tables Tables to be setup{libref:xx,name:xxx} or array of this object \r\n * @param {string} preamble SAS code to execute before setup\r\n * @returns {promise} - returns a compute summary \r\n */\n\nfunction computeSetupTables(_x, _x2, _x3, _x4) {\n return _computeSetupTables.apply(this, arguments);\n}\n\nfunction _computeSetupTables() {\n _computeSetupTables = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, tables, preamble) {\n var result, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(preamble != null)) {\n _context.next = 6;\n break;\n }\n\n _context.next = 3;\n return Object(_computeRun__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(store, session, preamble);\n\n case 3:\n result = _context.sent;\n\n if (!(result.SASJobStatus !== 'completed')) {\n _context.next = 6;\n break;\n }\n\n throw \"Error: Preamble failed with completion code of \".concat(result.SASJobStatus);\n\n case 6:\n _context.next = 8;\n return Object(_computeSummary__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session, null, tables);\n\n case 8:\n r = _context.sent;\n return _context.abrupt(\"return\", r);\n\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _computeSetupTables.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (computeSetupTables);\n\n//# sourceURL=webpack://restaflib/./computeSetupTables.js?");
851
+ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _computeSummary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeSummary */ \"./computeSummary.js\");\n/* harmony import */ var _computeRun__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./computeRun */ \"./computeRun.js\");\n/* harmony import */ var _computeResults__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./computeResults */ \"./computeResults.js\");\n/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n* SPDX-License-Identifier: Apache-2.0\r\n*/\n\n\n\n\n\n\n\n/**\r\n * @description Setup access to compute service\r\n * @async\r\n * @private\r\n * @module computeSetup\r\n * @category restaflib/compute\r\n * \r\n * @param {store} store - restaf store\r\n * @param {session} SAS compute Session\r\n * @param {tables} tables Tables to be setup{libref:xx,name:xxx} or array of this object \r\n * @param {string} preamble SAS code to execute before setup\r\n * @returns {promise} - returns a compute summary \r\n */\n\nfunction computeSetupTables(_x, _x2, _x3, _x4) {\n return _computeSetupTables.apply(this, arguments);\n}\n\nfunction _computeSetupTables() {\n _computeSetupTables = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, tables, preamble) {\n var result, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(preamble != null)) {\n _context.next = 6;\n break;\n }\n\n _context.next = 3;\n return Object(_computeRun__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(store, session, preamble);\n\n case 3:\n result = _context.sent;\n\n if (!(result.SASJobStatus !== 'completed')) {\n _context.next = 6;\n break;\n }\n\n throw \"Error: Preamble failed with completion code of \".concat(result.SASJobStatus);\n\n case 6:\n _context.next = 8;\n return Object(_computeSummary__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session, null, tables);\n\n case 8:\n r = _context.sent;\n return _context.abrupt(\"return\", r);\n\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _computeSetupTables.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (computeSetupTables);\n\n//# sourceURL=webpack://restaflib/./computeSetupTables.js?");
852
852
 
853
853
  /***/ }),
854
854
 
@@ -861,7 +861,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
861
861
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
862
862
 
863
863
  "use strict";
864
- eval("/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\n\n/*\r\n * Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n * SPDX-License-Identifier: Apache-2.0\r\n*/\n\n/**\r\n * @description Reduce the job information into consummable form(async)\r\n * \r\n * @async\r\n * @module computeSummary\r\n * @category restaflib/compute\r\n * \r\n * @param {store} store - restaf store\r\n * @param {rafObject} job - rafObject representing the compute service job after job completion\r\n * \r\n * @returns {promise} - the computeSummary object for easy handling of logs,listing,ods, tables\r\n * @example\r\n * \r\n */\nfunction computeSummary(_x, _x2, _x3, _x4) {\n return _computeSummary.apply(this, arguments);\n}\n\nfunction _computeSummary() {\n _computeSummary = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee(store, session, job, tables) {\n '';\n var result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(job != null && tables == null)) {\n _context.next = 6;\n break;\n }\n\n _context.next = 3;\n return jobResults(store, session, job);\n\n case 3:\n result = _context.sent;\n _context.next = 9;\n break;\n\n case 6:\n _context.next = 8;\n return isetupTable(store, session, tables);\n\n case 8:\n result = _context.sent;\n\n case 9:\n return _context.abrupt(\"return\", result);\n\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _computeSummary.apply(this, arguments);\n}\n\nfunction jobResults(_x5, _x6, _x7) {\n return _jobResults.apply(this, arguments);\n}\n\nfunction _jobResults() {\n _jobResults = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee2(store, session, job) {\n var cResult, reportLink, results, size, i, resultItem, type, r, _r, _r2;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n cResult = {\n session: session,\n log: null,\n listing: null,\n ods: null,\n job: null,\n tables: {},\n files: {}\n };\n cResult.log = job.links('log');\n cResult.listing = job.links('listing');\n reportLink = job.links('results');\n\n if (!(reportLink !== null)) {\n _context2.next = 10;\n break;\n }\n\n _context2.next = 7;\n return store.apiCall(reportLink);\n\n case 7:\n results = _context2.sent;\n size = results.itemsList().size;\n\n if (size > 0) {\n for (i = 0; i < size; i++) {\n resultItem = results.itemsList(i);\n type = results.items(resultItem, 'data', 'type').toLowerCase();\n\n if (type === 'ods') {\n cResult['ods'] = results.itemsCmd(resultItem, 'self');\n } else if (type === 'table') {\n r = {\n self: results.itemsCmd(resultItem, 'self'),\n current: null\n };\n cResult.tables[resultItem.toUpperCase()] = r;\n } else if (type === 'file') {\n _r = {\n self: resultItem,\n current: null,\n data: null\n };\n cResult.files[resultItem] = _r;\n } else {\n _r2 = {\n self: resultItem,\n current: null,\n data: null\n };\n cResult[type] = _r2;\n }\n }\n }\n\n case 10:\n return _context2.abrupt(\"return\", cResult);\n\n case 11:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n return _jobResults.apply(this, arguments);\n}\n\nfunction isetupTable(_x8, _x9, _x10) {\n return _isetupTable.apply(this, arguments);\n}\n\nfunction _isetupTable() {\n _isetupTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee3(store, session, tables) {\n var cResult, tableList, i, itable, libref, name, p, currentLibrefs, rlink, currentLibrefSelf, _tables, tname, r;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n cResult = {\n session: session,\n log: null,\n listing: null,\n ods: null,\n job: null,\n tables: {},\n files: {}\n };\n tableList = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(tables) === 'object' ? [tables] : tables;\n console.log(tableList);\n i = 0;\n\n case 4:\n if (!(i < tableList.length)) {\n _context3.next = 30;\n break;\n }\n\n itable = tableList[i];\n libref = itable.libref.toUpperCase();\n name = itable.name.toUpperCase();\n p = {\n qs: {\n filter: \"eq(name,'\".concat(libref, \"')\")\n }\n };\n _context3.next = 11;\n return store.apiCall(session.links('librefs'), p);\n\n case 11:\n currentLibrefs = _context3.sent;\n\n if (!(currentLibrefs.itemsList().size === 0)) {\n _context3.next = 14;\n break;\n }\n\n throw \"Libref \".concat(libref, \" not found\");\n\n case 14:\n // get the links for this libref\n rlink = currentLibrefs.itemsCmd(libref, 'self');\n _context3.next = 17;\n return store.apiCall(rlink);\n\n case 17:\n currentLibrefSelf = _context3.sent;\n // get the table\n p = {\n qs: {\n filter: \"eq(name,'\".concat(name, \"')\")\n }\n };\n _context3.next = 21;\n return store.apiCall(currentLibrefSelf.links('tables'));\n\n case 21:\n _tables = _context3.sent;\n\n if (!(_tables.itemsList().size === 0)) {\n _context3.next = 24;\n break;\n }\n\n throw \"Table \".concat(name, \" not found\");\n\n case 24:\n tname = \"\".concat(libref, \".\").concat(name).toLowerCase();\n r = {\n self: _tables.itemsCmd(name, 'self'),\n current: null\n };\n cResult.tables[tname.toUpperCase()] = r;\n\n case 27:\n i++;\n _context3.next = 4;\n break;\n\n case 30:\n return _context3.abrupt(\"return\", cResult);\n\n case 31:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n return _isetupTable.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (computeSummary);\n\n//# sourceURL=webpack://restaflib/./computeSummary.js?");
864
+ eval("/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\n\n/*\r\n * Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n * SPDX-License-Identifier: Apache-2.0\r\n*/\n\n/**\r\n * @description Reduce the job information into consummable form(async)\r\n * \r\n * @async\r\n * @module computeSummary\r\n * @category restaflib/compute\r\n * \r\n * @param {store} store - restaf store\r\n * @param {rafObject} session - compute Session\r\n * @param {rafObject} job - rafObject representing the compute service job after job completion\r\n * @param {object|Array=} tables (see computeSetupTables)\r\n * @returns {promise} - the computeSummary object for easy handling of logs,listing,ods, tables\r\n * \r\n */\nfunction computeSummary(_x, _x2, _x3, _x4) {\n return _computeSummary.apply(this, arguments);\n}\n\nfunction _computeSummary() {\n _computeSummary = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee(store, session, job, tables) {\n '';\n var result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(job != null && tables == null)) {\n _context.next = 6;\n break;\n }\n\n _context.next = 3;\n return jobResults(store, session, job);\n\n case 3:\n result = _context.sent;\n _context.next = 9;\n break;\n\n case 6:\n _context.next = 8;\n return isetupTable(store, session, tables);\n\n case 8:\n result = _context.sent;\n\n case 9:\n return _context.abrupt(\"return\", result);\n\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _computeSummary.apply(this, arguments);\n}\n\nfunction jobResults(_x5, _x6, _x7) {\n return _jobResults.apply(this, arguments);\n}\n\nfunction _jobResults() {\n _jobResults = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee2(store, session, job) {\n var cResult, reportLink, results, size, i, resultItem, type, r, _r, _r2;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n cResult = {\n session: session,\n log: null,\n listing: null,\n ods: null,\n job: null,\n tables: {},\n files: {}\n };\n cResult.log = job.links('log');\n cResult.listing = job.links('listing');\n reportLink = job.links('results');\n\n if (!(reportLink !== null)) {\n _context2.next = 10;\n break;\n }\n\n _context2.next = 7;\n return store.apiCall(reportLink);\n\n case 7:\n results = _context2.sent;\n size = results.itemsList().size;\n\n if (size > 0) {\n for (i = 0; i < size; i++) {\n resultItem = results.itemsList(i);\n type = results.items(resultItem, 'data', 'type').toLowerCase();\n\n if (type === 'ods') {\n cResult['ods'] = results.itemsCmd(resultItem, 'self');\n } else if (type === 'table') {\n r = {\n self: results.itemsCmd(resultItem, 'self'),\n current: null\n };\n cResult.tables[resultItem.toUpperCase()] = r;\n } else if (type === 'file') {\n _r = {\n self: resultItem,\n current: null,\n data: null\n };\n cResult.files[resultItem] = _r;\n } else {\n _r2 = {\n self: resultItem,\n current: null,\n data: null\n };\n cResult[type] = _r2;\n }\n }\n }\n\n case 10:\n return _context2.abrupt(\"return\", cResult);\n\n case 11:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n return _jobResults.apply(this, arguments);\n}\n\nfunction isetupTable(_x8, _x9, _x10) {\n return _isetupTable.apply(this, arguments);\n}\n\nfunction _isetupTable() {\n _isetupTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee3(store, session, tables) {\n var cResult, tableList, i, itable, libref, name, p, currentLibrefs, rlink, currentLibrefSelf, _tables, tname, r;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n cResult = {\n session: session,\n log: null,\n listing: null,\n ods: null,\n job: null,\n tables: {},\n files: {}\n };\n tableList = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(tables) === 'object' ? [tables] : tables;\n console.log(tableList);\n i = 0;\n\n case 4:\n if (!(i < tableList.length)) {\n _context3.next = 30;\n break;\n }\n\n itable = tableList[i];\n libref = itable.libref.toUpperCase();\n name = itable.name.toUpperCase();\n p = {\n qs: {\n filter: \"eq(name,'\".concat(libref, \"')\")\n }\n };\n _context3.next = 11;\n return store.apiCall(session.links('librefs'), p);\n\n case 11:\n currentLibrefs = _context3.sent;\n\n if (!(currentLibrefs.itemsList().size === 0)) {\n _context3.next = 14;\n break;\n }\n\n throw \"Libref \".concat(libref, \" not found\");\n\n case 14:\n // get the links for this libref\n rlink = currentLibrefs.itemsCmd(libref, 'self');\n _context3.next = 17;\n return store.apiCall(rlink);\n\n case 17:\n currentLibrefSelf = _context3.sent;\n // get the table\n p = {\n qs: {\n filter: \"eq(name,'\".concat(name, \"')\")\n }\n };\n _context3.next = 21;\n return store.apiCall(currentLibrefSelf.links('tables'));\n\n case 21:\n _tables = _context3.sent;\n\n if (!(_tables.itemsList().size === 0)) {\n _context3.next = 24;\n break;\n }\n\n throw \"Table \".concat(name, \" not found\");\n\n case 24:\n tname = \"\".concat(libref, \".\").concat(name).toLowerCase();\n r = {\n self: _tables.itemsCmd(name, 'self'),\n current: null\n };\n cResult.tables[tname.toUpperCase()] = r;\n\n case 27:\n i++;\n _context3.next = 4;\n break;\n\n case 30:\n return _context3.abrupt(\"return\", cResult);\n\n case 31:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n return _isetupTable.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (computeSummary);\n\n//# sourceURL=webpack://restaflib/./computeSummary.js?");
865
865
 
866
866
  /***/ }),
867
867
 
@@ -1190,19 +1190,6 @@ eval("/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights
1190
1190
 
1191
1191
  /***/ }),
1192
1192
 
1193
- /***/ "./programs/casFetchRowsv2.js":
1194
- /*!************************************!*\
1195
- !*** ./programs/casFetchRowsv2.js ***!
1196
- \************************************/
1197
- /*! exports provided: default */
1198
- /*! exports used: default */
1199
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1200
-
1201
- "use strict";
1202
- eval("/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n* SPDX-License-Identifier: Apache-2.0\r\n*/\nfunction casFetchRowsv2() {\n var code = \"\\n print _args_;\\n\\n results = casFetchRows(_args_.table.caslib, _args_.table.name , _args_.qs.from, _args_.qs.count, _args_.qs.format, _args_.data.where); \\n send_response({casResults = results}); \\n \\n function casFetchRows(caslib, name, from, count, format, where) ; \\n \\n rc = checkAndLoadTable(caslib, name);\\n \\n if (rc ne true) then do;\\n results = {Errors= 'Unable to access ' ||caslib||'.'||name}; \\n return results; \\n end; \\n\\n /*\\n * get all table to get rowCount\\n */\\n\\n action table.tableinfo r= result/ \\n caslib = caslib \\n name = name; \\n \\n rowCount = result.TableInfo[1, 'rows']; \\n to = min(from + count -1, rowCount); \\n \\n /*\\n * get column information\\n */\\n\\n action table.columninfo r=infoResult /\\n table = {caslib=caslib name=name};\\n\\n columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}};\\n i = 2;\\n do c over inforesult.columninfo;\\n columns[i] = c;\\n i = i + 1;\\n end;\\n \\n /*\\n * Fetch the current set of rows\\n */\\n /* wherex = dictTowhere(where); let user send in the where clause */\\n print where;\\n\\n action table.fetch r = result / \\n table = {caslib=caslib, name=name where=where} \\n from= from to=to format=format \\n ;\\n\\n /* \\n * create payload to return\\n */\\n\\n i = 1;\\n rows ={};\\n do row over result.fetch;\\n rr = {};\\n j = 1;\\n do key,v over row;\\n rr[j] = override(columns[j].Type, v);\\n j = j + 1;\\n end;\\n rows[i] = rr;\\n i = i + 1;\\n end;\\n\\n pagePrev = max(from - count, 1);\\n \\n if ( to eq rowCount ) then do; \\n pageNext = -1; \\n end; \\n else do ; \\n pageNext = min(to + 1, rowCount); \\n end; \\n table = {caslib=caslib, name=name};\\n pagination = {\\n next= {qs={from=pageNext, count=count, format=format}, data={where = where}, version=2, table=table },\\n prev={from=pagePrev, count=count, format=format, where=where, version=2, table=table}\\n };\\n return( \\n {pagination = pagination, data = {schema=columns, rows=rows }}\\n );\\n end; \\n \\n \\n /*\\n * For non-primary column types set new content\\n */\\n\\n function override(type, iv);\\n if (type EQ 'varbinary') then v = '...varbinary';\\n else if (type EQ 'blob') then v = '...blob';\\n else if (type EQ 'table') then v = '...table';\\n else if (type EQ 'dictionary') then v = '...dictionary';\\n else if (type EQ 'list') then v = '...list';\\n else if (type EQ 'isArray') then v = '...array';\\n else v = iv;\\n return v;\\n end;\\n\\n \\n \";\n return code;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (casFetchRowsv2);\n\n//# sourceURL=webpack://restaflib/./programs/casFetchRowsv2.js?");
1203
-
1204
- /***/ }),
1205
-
1206
1193
  /***/ "./programs/commonCasl.js":
1207
1194
  /*!********************************!*\
1208
1195
  !*** ./programs/commonCasl.js ***!
@@ -1225,7 +1212,7 @@ eval("/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights
1225
1212
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1226
1213
 
1227
1214
  "use strict";
1228
- eval("/* harmony import */ var _scoreCasl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scoreCasl */ \"./programs/scoreCasl.js\");\n/* harmony import */ var _scoreCasl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_scoreCasl__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _casFetchData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./casFetchData */ \"./programs/casFetchData.js\");\n/* harmony import */ var _commonCasl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commonCasl */ \"./programs/commonCasl.js\");\n/* harmony import */ var _casFetchRows__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./casFetchRows */ \"./programs/casFetchRows.js\");\n/* harmony import */ var _casFetchRowsv2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casFetchRowsv2 */ \"./programs/casFetchRowsv2.js\");\n/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n* SPDX-License-Identifier: Apache-2.0\r\n*/\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = ({\n commonCasl: _commonCasl__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"],\n casFetchData: _casFetchData__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"],\n casFetchRows: _casFetchRows__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"],\n scoreCasl: _scoreCasl__WEBPACK_IMPORTED_MODULE_0___default.a,\n casFetchRowsv2: _casFetchRowsv2__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"]\n});\n\n//# sourceURL=webpack://restaflib/./programs/index.js?");
1215
+ eval("/* harmony import */ var _scoreCasl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scoreCasl */ \"./programs/scoreCasl.js\");\n/* harmony import */ var _scoreCasl__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_scoreCasl__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _casFetchData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./casFetchData */ \"./programs/casFetchData.js\");\n/* harmony import */ var _commonCasl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commonCasl */ \"./programs/commonCasl.js\");\n/* harmony import */ var _casFetchRows__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./casFetchRows */ \"./programs/casFetchRows.js\");\n/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n* SPDX-License-Identifier: Apache-2.0\r\n*/\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = ({\n commonCasl: _commonCasl__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"],\n casFetchData: _casFetchData__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"],\n casFetchRows: _casFetchRows__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"],\n scoreCasl: _scoreCasl__WEBPACK_IMPORTED_MODULE_0___default.a\n});\n\n//# sourceURL=webpack://restaflib/./programs/index.js?");
1229
1216
 
1230
1217
  /***/ }),
1231
1218
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sassoftware/restaflib",
3
- "version": "4.4.28",
3
+ "version": "4.4.29",
4
4
  "description": "collection of useful functions for common scenarios",
5
5
  "repository": {
6
6
  "type": "git",