@sassoftware/restaflib 4.4.38 → 4.5.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.
- package/dist/restaflib.js +11 -11
- package/lib/restaflib.js +11 -11
- package/package.json +2 -2
- package/dist/restaflib.min.js +0 -10
package/dist/restaflib.js
CHANGED
|
@@ -581,7 +581,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
|
|
|
581
581
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
582
582
|
|
|
583
583
|
"use strict";
|
|
584
|
-
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 _casSaveTable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./casSaveTable */ \"./casSaveTable.js\");\n/* harmony import */ var _programs__WEBPACK_IMPORTED_MODULE_4__ = __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\n/** \r\n* @description Append a cas table to a master cas table \r\n* @async\r\n* @module casAppendTable\r\n* @category restaflib/cas\r\n* @param {store} store - store\r\n* @param {rafObject} session - cas session\r\n* @param {casTable} input Input table with new rows {caslib: xxx, name: nnn}\r\n* @param {casTable} output Master table {caslib: xxx, name: nnn}\r\n* @param {boolean} saveflag If true the master table will be saved to disk\r\n* @param {*} payload -\r\n* @returns {promise} - return \r\n* @example\r\n* let status = restaflib.casAppendTable(store, session, 'casuser.temp', 'public.master', true));\r\n* \r\n*/\n\nfunction casAppendTable(_x, _x2, _x3, _x4, _x5) {\n return _casAppendTable.apply(this, arguments);\n}\n\nfunction _casAppendTable() {\n _casAppendTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, input, output, save) {\n var src, args, 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
|
|
584
|
+
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 _casSaveTable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./casSaveTable */ \"./casSaveTable.js\");\n/* harmony import */ var _programs__WEBPACK_IMPORTED_MODULE_4__ = __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\n/** \r\n* @description Append a cas table to a master cas table \r\n* @async\r\n* @module casAppendTable\r\n* @category restaflib/cas\r\n* @param {store} store - store\r\n* @param {rafObject} session - cas session\r\n* @param {casTable} input Input table with new rows {caslib: xxx, name: nnn}\r\n* @param {casTable} output Master table {caslib: xxx, name: nnn}\r\n* @param {boolean} saveflag If true the master table will be saved to disk\r\n* @param {*} payload -\r\n* @returns {promise} - return \r\n* @example\r\n* let status = restaflib.casAppendTable(store, session, 'casuser.temp', 'public.master', true));\r\n* \r\n*/\n\nfunction casAppendTable(_x, _x2, _x3, _x4, _x5) {\n return _casAppendTable.apply(this, arguments);\n}\n\nfunction _casAppendTable() {\n _casAppendTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, input, output, save) {\n var src, args, 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 src = _programs__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"]['commonCasl']() + ' ' + _programs__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"]['casAppendTable']();\n args = {\n masterTable: output,\n setTable: input,\n save: save != null ? save : false\n };\n _context.next = 4;\n return Object(_caslRunBase__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session, src, args);\n\n case 4:\n result = _context.sent;\n r = result.items('results', 'casResults').toJS();\n\n if (!(save === true)) {\n _context.next = 9;\n break;\n }\n\n _context.next = 9;\n return Object(_casSaveTable__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(store, session, output);\n\n case 9:\n return _context.abrupt(\"return\", r);\n\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _casAppendTable.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (casAppendTable);\n\n//# sourceURL=webpack://restaflib/./casAppendTable.js?");
|
|
585
585
|
|
|
586
586
|
/***/ }),
|
|
587
587
|
|
|
@@ -607,7 +607,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
|
|
|
607
607
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
608
608
|
|
|
609
609
|
"use strict";
|
|
610
|
-
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
|
|
610
|
+
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?");
|
|
611
611
|
|
|
612
612
|
/***/ }),
|
|
613
613
|
|
|
@@ -633,7 +633,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
|
|
|
633
633
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
634
634
|
|
|
635
635
|
"use strict";
|
|
636
|
-
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/*\r\n * ------------------------------------------------------------------------------------\r\n * * Copyright (c) SAS Institute Inc.\r\n * * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * * you may not use this file except in compliance with the License.\r\n * * You may obtain a copy of the License at\r\n * *\r\n * * http://www.apache.org/licenses/LICENSE-2.0\r\n * *\r\n * * Unless required by applicable law or agreed to in writing, software\r\n * * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ----------------------------------------------------------------------------------------\r\n *\r\n */\n\n/**\r\n *\r\n * @description Calls cas server and returns the results(async)\r\n * \r\n * @async\r\n * @module casSetup\r\n * @category restaflib/cas\r\n * @param {store} store - restaf store\r\n * @param {logonPayload} logonPayload - if not null, then use this to logon to Viya\r\n * \r\n * @returns {promise} returns an object {session: xxx, servers: yyy}\r\n */\n\n\n\n\n\nfunction casSetup(_x, _x2) {\n return _casSetup.apply(this, arguments);\n}\n\nfunction _casSetup() {\n _casSetup = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, logonPayload) {\n var _yield$store$addServi, casManagement, servers, casserver, session;\n\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 (!(logonPayload != null)) {\n _context.next =
|
|
636
|
+
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/*\r\n * ------------------------------------------------------------------------------------\r\n * * Copyright (c) SAS Institute Inc.\r\n * * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * * you may not use this file except in compliance with the License.\r\n * * You may obtain a copy of the License at\r\n * *\r\n * * http://www.apache.org/licenses/LICENSE-2.0\r\n * *\r\n * * Unless required by applicable law or agreed to in writing, software\r\n * * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ----------------------------------------------------------------------------------------\r\n *\r\n */\n\n/**\r\n *\r\n * @description Calls cas server and returns the results(async)\r\n * \r\n * @async\r\n * @module casSetup\r\n * @category restaflib/cas\r\n * @param {store} store - restaf store\r\n * @param {logonPayload} logonPayload - if not null, then use this to logon to Viya\r\n * \r\n * @returns {promise} returns an object {session: xxx, servers: yyy}\r\n */\n\n\n\n\n\nfunction casSetup(_x, _x2) {\n return _casSetup.apply(this, arguments);\n}\n\nfunction _casSetup() {\n _casSetup = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, logonPayload) {\n var _yield$store$addServi, casManagement, servers, casserver, session;\n\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 console.log(logonPayload);\n debugger;\n\n if (!(logonPayload != null)) {\n _context.next = 5;\n break;\n }\n\n _context.next = 5;\n return store.logon(logonPayload);\n\n case 5:\n _context.next = 7;\n return store.addServices('casManagement');\n\n case 7:\n _yield$store$addServi = _context.sent;\n casManagement = _yield$store$addServi.casManagement;\n _context.next = 11;\n return store.apiCall(casManagement.links('servers'));\n\n case 11:\n servers = _context.sent;\n\n if (!(servers.itemsList().size === 0)) {\n _context.next = 14;\n break;\n }\n\n throw {\n Error: 'No cas servers were found'\n };\n\n case 14:\n casserver = servers.itemsList(0);\n _context.next = 17;\n return store.apiCall(servers.itemsCmd(casserver, 'createSession'));\n\n case 17:\n session = _context.sent;\n return _context.abrupt(\"return\", {\n servers: servers,\n session: session\n });\n\n case 19:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _casSetup.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (casSetup);\n\n//# sourceURL=webpack://restaflib/./casSetup.js?");
|
|
637
637
|
|
|
638
638
|
/***/ }),
|
|
639
639
|
|
|
@@ -672,7 +672,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IM
|
|
|
672
672
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
673
673
|
|
|
674
674
|
"use strict";
|
|
675
|
-
eval("/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"../../../node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _uploadSetup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./uploadSetup */ \"./uploadSetup.js\");\n/* harmony import */ var _uploadHandlers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./uploadHandlers */ \"./uploadHandlers/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\nvar fs = __webpack_require__(/*! fs */ \"../../../node_modules/node-libs-browser/mock/empty.js\").promises;\n\n\n\n/**\r\n * @description upload different artifacts\r\n * @private\r\n * @async\r\n * @module casUpload\r\n * @param {store} store \r\n * @param {*} session \r\n * @param {*} source \r\n * @param {*} output \r\n * @param {*} save \r\n * @param {*} altSrc \r\n * @returns {promise}\r\n */\n\nfunction casUpload(_x, _x2, _x3, _x4, _x5, _x6) {\n return _casUpload.apply(this, arguments);\n}\n\nfunction _casUpload() {\n _casUpload = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee(store, session, source, output, save, altSrc) {\n var table, fileInfo, buf, r, _table$split, _table$split2, caslib, name;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // parse source file to figure out what we are uploading\n table = output;\n
|
|
675
|
+
eval("/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"../../../node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _uploadSetup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./uploadSetup */ \"./uploadSetup.js\");\n/* harmony import */ var _uploadHandlers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./uploadHandlers */ \"./uploadHandlers/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\nvar fs = __webpack_require__(/*! fs */ \"../../../node_modules/node-libs-browser/mock/empty.js\").promises;\n\n\n\n/**\r\n * @description upload different artifacts\r\n * @private\r\n * @async\r\n * @module casUpload\r\n * @param {store} store \r\n * @param {*} session \r\n * @param {*} source \r\n * @param {*} output \r\n * @param {*} save \r\n * @param {*} altSrc \r\n * @returns {promise}\r\n */\n\nfunction casUpload(_x, _x2, _x3, _x4, _x5, _x6) {\n return _casUpload.apply(this, arguments);\n}\n\nfunction _casUpload() {\n _casUpload = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee(store, session, source, output, save, altSrc) {\n var table, fileInfo, buf, r, _table$split, _table$split2, caslib, name;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // parse source file to figure out what we are uploading\n table = output;\n\n if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(output) === 'object') {\n table = \"\".concat(output.caslib, \".\").concat(output.name);\n }\n\n ;\n fileInfo = Object(_uploadSetup__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(source, table); // read the file\n\n if (!(altSrc != null)) {\n _context.next = 8;\n break;\n }\n\n _context.t0 = altSrc;\n _context.next = 11;\n break;\n\n case 8:\n _context.next = 10;\n return fs.readFile(source, fileInfo.fileOptions);\n\n case 10:\n _context.t0 = _context.sent;\n\n case 11:\n buf = _context.t0;\n\n // transfrom data if necessary for upload\n if (fileInfo.transform !== null) {\n buf = fileInfo.transform(buf, fileInfo);\n } // upload using specific upload handlers\n\n\n _context.next = 15;\n return fileInfo.handler(store, session, buf, fileInfo, save);\n\n case 15:\n r = _context.sent;\n\n if (!(save === true)) {\n _context.next = 21;\n break;\n }\n\n _table$split = table.split('.'), _table$split2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_table$split, 2), caslib = _table$split2[0], name = _table$split2[1];\n _context.next = 20;\n return Object(_uploadHandlers__WEBPACK_IMPORTED_MODULE_5__[/* saveTable */ \"a\"])(store, session, caslib, name);\n\n case 20:\n r = r + '\\n' + \" \".concat(output, \" was saved\");\n\n case 21:\n return _context.abrupt(\"return\", r);\n\n case 22:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _casUpload.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (casUpload);\n\n//# sourceURL=webpack://restaflib/./casUpload.js?");
|
|
676
676
|
|
|
677
677
|
/***/ }),
|
|
678
678
|
|
|
@@ -737,7 +737,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IM
|
|
|
737
737
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
738
738
|
|
|
739
739
|
"use strict";
|
|
740
|
-
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 _computeRun__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeRun */ \"./computeRun.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/** \r\n* @description Append a compute table to a master compute table \r\n* @async\r\n* @module computeAppendTable\r\n* @category restaflib/compute\r\n* @param {store} store - store\r\n* @param {rafObject} session - compute session\r\n* @param {computeTable} input Input table with new rows {libref: xxx, name: nnn}\r\n* @param {computeTable} output Master table {computelib: xxx, name: nnn}\r\n* @
|
|
740
|
+
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 _computeRun__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeRun */ \"./computeRun.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/** \r\n* @description Append a compute table to a master compute table \r\n* @async\r\n* @module computeAppendTable\r\n* @category restaflib/compute\r\n* @param {store} store - store\r\n* @param {rafObject} session - compute session\r\n* @param {computeTable} input Input table with new rows {libref: xxx, name: nnn}\r\n* @param {computeTable} output Master table {computelib: xxx, name: nnn}\r\n* @returns {promise} - return \r\n* @example\r\n* let status = restaflib.computeAppendTable(store, session, 'computeuser.temp', 'public.master', true));\r\n* \r\n*/\n\nfunction computeAppendTable(_x, _x2, _x3, _x4) {\n return _computeAppendTable.apply(this, arguments);\n}\n\nfunction _computeAppendTable() {\n _computeAppendTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, input, output) {\n var src, computeSummary, statusCode;\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 src = \"\\n proc append base=\".concat(output.libref, \".{output.name} \\n data= \").concat(input.libref, \".\").concat(input.name, \"; run;\\n \");\n _context.next = 3;\n return Object(_computeRun__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session, src);\n\n case 3:\n computeSummary = _context.sent;\n statusCode = computeSummary.SASJobStatus === 'completed' ? 0 : 1;\n return _context.abrupt(\"return\", {\n msg: \"Append Completed. Status is: \".concat(computeSummary.SASJobStatus),\n statusCode: statusCode\n });\n\n case 6:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _computeAppendTable.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (computeAppendTable);\n\n//# sourceURL=webpack://restaflib/./computeAppendTable.js?");
|
|
741
741
|
|
|
742
742
|
/***/ }),
|
|
743
743
|
|
|
@@ -750,7 +750,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
|
|
|
750
750
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
751
751
|
|
|
752
752
|
"use strict";
|
|
753
|
-
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\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* \r\n* @description Fetch data from a SAS Table\r\n* @async\r\n* @module computeFetchData\r\n* @category restaflib/compute\r\n* @param {object} store - restaf store\r\n* @param {computeSummary} computeSummary - Summary object created by computeSummary method\r\n* @param {string} table - name of the table\r\n* @param {string} scroll direction - null(to get first set)|next|prev|first|last\r\n* \r\n* @returns {promise} - {columns: <columnames>, rows: <data for rows> , scrollOptions: <available scroll directions>}\r\n*/\nfunction computeFetchData(_x, _x2, _x3, _x4, _x5) {\n return _computeFetchData.apply(this, arguments);\n}\n\nfunction _computeFetchData() {\n _computeFetchData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, computeSummary, table, direction, payload) {\n var data, tname, adhoc, tableInfo, t1, result, columns, schema, items, cx, c, newcol, datax, current, dir, _result, _datax;\n\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 data = null
|
|
753
|
+
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\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* \r\n* @description Fetch data from a SAS Table\r\n* @async\r\n* @module computeFetchData\r\n* @category restaflib/compute\r\n* @param {object} store - restaf store\r\n* @param {computeSummary} computeSummary - Summary object created by computeSummary method\r\n* @param {string} table - name of the table\r\n* @param {string} scroll direction - null(to get first set)|next|prev|first|last\r\n* \r\n* @returns {promise} - {columns: <columnames>, rows: <data for rows> , scrollOptions: <available scroll directions>}\r\n*/\nfunction computeFetchData(_x, _x2, _x3, _x4, _x5) {\n return _computeFetchData.apply(this, arguments);\n}\n\nfunction _computeFetchData() {\n _computeFetchData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, computeSummary, table, direction, payload) {\n var data, tname, adhoc, tableInfo, t1, result, columns, schema, items, cx, c, newcol, datax, current, dir, _result, _datax;\n\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 data = null;\n tname = typeof table === 'string' ? table : \"\".concat(table.libref, \".\").concat(table.name);\n tname = tname.toUpperCase();\n /*to allow for compute service table info */\n // is payload an override or the real thing?\n\n adhoc = payload != null && direction == null ? true : false;\n tableInfo = computeSummary.tables[tname];\n\n if (!(tableInfo != null)) {\n _context.next = 37;\n break;\n }\n\n // reset info on this table if user does adhoc retrieval\n // trying to keep track of multiple streams for same table is a nightmare\n if (adhoc === true) {\n tableInfo.current = null;\n }\n\n if (!(tableInfo.current === null || direction == null || direction === 'first')) {\n _context.next = 26;\n break;\n }\n\n _context.next = 10;\n return store.apiCall(tableInfo.self);\n\n case 10:\n t1 = _context.sent;\n _context.next = 13;\n return store.apiCall(t1.links('rowSet'), payload);\n\n case 13:\n result = _context.sent;\n _context.next = 16;\n return store.apiCall(t1.links('columns'));\n\n case 16:\n columns = _context.sent;\n schema = [];\n items = columns.items().toJS();\n\n for (cx in items) {\n c = items[cx];\n newcol = {\n name: c.name.toLowerCase(),\n Column: c.name.toLowerCase(),\n Label: c.data.label,\n length: c.data.length,\n type: c.data.type,\n custom: false\n };\n schema.push(newcol);\n }\n\n tableInfo.current = result;\n tableInfo.schema = schema;\n datax = result.items().toJS();\n data = {\n columns: datax.columns,\n schema: schema,\n rows: datax.rows,\n scrollOptions: result.scrollCmds().keySeq().toJS()\n };\n _context.next = 37;\n break;\n\n case 26:\n current = tableInfo.current;\n dir = direction;\n if (payload) if (direction === 'next' && current.scrollCmds('next') === null) {\n dir = current.links('last') !== null ? 'last' : null;\n }\n\n if (direction === 'prev' && current.scrollCmds('prev') === null) {\n dir = current.links('first') !== null ? 'first' : null;\n }\n\n if (!(dir !== null && current.scrollCmds(dir) !== null)) {\n _context.next = 37;\n break;\n }\n\n _context.next = 33;\n return store.apiCall(current.scrollCmds(dir), payload);\n\n case 33:\n _result = _context.sent;\n tableInfo.current = _result;\n _datax = _result.items().toJS();\n data = {\n schema: tableInfo.schema,\n columns: _datax.columns,\n rows: _datax.rows,\n scrollOptions: _result.scrollCmds().keySeq().toJS()\n };\n\n case 37:\n return _context.abrupt(\"return\", data);\n\n case 38:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _computeFetchData.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (computeFetchData);\n\n//# sourceURL=webpack://restaflib/./computeFetchData.js?");
|
|
754
754
|
|
|
755
755
|
/***/ }),
|
|
756
756
|
|
|
@@ -841,7 +841,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
|
|
|
841
841
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
842
842
|
|
|
843
843
|
"use strict";
|
|
844
|
-
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
|
|
844
|
+
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 i = 0;\n\n case 3:\n if (!(i < tableList.length)) {\n _context3.next = 29;\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 = 10;\n return store.apiCall(session.links('librefs'), p);\n\n case 10:\n currentLibrefs = _context3.sent;\n\n if (!(currentLibrefs.itemsList().size === 0)) {\n _context3.next = 13;\n break;\n }\n\n throw \"Libref \".concat(libref, \" not found\");\n\n case 13:\n // get the links for this libref\n rlink = currentLibrefs.itemsCmd(libref, 'self');\n _context3.next = 16;\n return store.apiCall(rlink);\n\n case 16:\n currentLibrefSelf = _context3.sent;\n // get the table\n p = {\n qs: {\n filter: \"eq(name,'\".concat(name, \"')\")\n }\n };\n _context3.next = 20;\n return store.apiCall(currentLibrefSelf.links('tables'));\n\n case 20:\n _tables = _context3.sent;\n\n if (!(_tables.itemsList().size === 0)) {\n _context3.next = 23;\n break;\n }\n\n throw \"Table \".concat(name, \" not found\");\n\n case 23:\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 26:\n i++;\n _context3.next = 3;\n break;\n\n case 29:\n return _context3.abrupt(\"return\", cResult);\n\n case 30:\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?");
|
|
845
845
|
|
|
846
846
|
/***/ }),
|
|
847
847
|
|
|
@@ -854,7 +854,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_M
|
|
|
854
854
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
855
855
|
|
|
856
856
|
"use strict";
|
|
857
|
-
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\n\n\n/*\r\n * Copyright © 2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n * SPDX-License-Identifier: Apache-2.0\r\n */\n\n/**\r\n* @description Update a record in a cas table\r\n* @async\r\n* @module computeUpdateData\r\n* @category restaflib/cas\r\n* @param {store} store - store\r\n* @param {rafObject} session - cas session\r\n* @param {*} payload - {data,where,table}\r\n* @returns {promise} - return \r\n* @example\r\n* let inputs = restaflib.computeUpdateData(store, session, payload);\r\n* payload = { where: {key1: vale1, key2: value2,...},\r\n* data: {var1:value1, var2:value2,....},\r\n* table: {caslib: caslib, name: name}\r\n* Expects a single row\r\n*/\nfunction computeUpdateData(_x, _x2, _x3) {\n return _computeUpdateData.apply(this, arguments);\n}\n\nfunction _computeUpdateData() {\n _computeUpdateData = _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 table, where, src, set, comma, k,
|
|
857
|
+
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\n\n\n/*\r\n * Copyright © 2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n * SPDX-License-Identifier: Apache-2.0\r\n */\n\n/**\r\n* @description Update a record in a cas table\r\n* @async\r\n* @private\r\n* @module computeUpdateData\r\n* @category restaflib/cas\r\n* @param {store} store - store\r\n* @param {rafObject} session - cas session\r\n* @param {*} payload - {data,where,table}\r\n* @returns {promise} - return \r\n* @example\r\n* let inputs = restaflib.computeUpdateData(store, session, payload);\r\n* payload = { where: {key1: vale1, key2: value2,...},\r\n* data: {var1:value1, var2:value2,....},\r\n* table: {caslib: caslib, name: name}\r\n* Expects a single row\r\n*/\nfunction computeUpdateData(_x, _x2, _x3) {\n return _computeUpdateData.apply(this, arguments);\n}\n\nfunction _computeUpdateData() {\n _computeUpdateData = _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 data, table, where, src, set, comma, k, swhere, andbit, _k, v, valString, asrc, p, job, qs, status, c;\n\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 data = payload.data, table = payload.table, where = payload.where;\n src = \"proc sql; update \".concat(table.libref, \".\").concat(table.name);\n set = 'SET ';\n comma = ' ';\n\n for (k in data) {\n set = set + comma + k + '=' + value2String(data[k]);\n comma = ', ';\n }\n\n ;\n src = src + ' ' + set;\n swhere = ' WHERE ';\n andbit = ' ';\n\n for (_k in where) {\n v = where[_k];\n valString = value2String(v);\n swhere = swhere + andbit + _k + \"= \".concat(valString, \" \");\n andbit = ' AND ';\n }\n\n src = src + ' ' + swhere + ';run;';\n asrc = src.split(/\\r?\\n/);\n p = {\n data: {\n code: asrc\n }\n };\n _context.next = 15;\n return store.apiCall(session.links('execute'), p);\n\n case 15:\n job = _context.sent;\n qs = {\n qs: {\n newState: 'Completed',\n timeout: 1\n }\n }; // eslint-disable-next-line no-unused-vars\n\n _context.next = 19;\n return store.jobState(job, qs);\n\n case 19:\n status = _context.sent;\n c = status.data === 'completed' ? 0 : 1;\n return _context.abrupt(\"return\", {\n statusCode: c,\n msg: status.data\n });\n\n case 22:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _computeUpdateData.apply(this, arguments);\n}\n\nfunction value2String(value) {\n var valueString;\n\n if (value == null) {\n valueString = '.';\n } else if (typeof value === 'string') {\n valueString = JSON.stringify(value);\n } else {\n valueString = value.toString();\n }\n\n return valueString;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (computeUpdateData);\n\n//# sourceURL=webpack://restaflib/./computeUpdateData.js?");
|
|
858
858
|
|
|
859
859
|
/***/ }),
|
|
860
860
|
|
|
@@ -867,7 +867,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
|
|
|
867
867
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
868
868
|
|
|
869
869
|
"use strict";
|
|
870
|
-
eval("/* harmony import */ var
|
|
870
|
+
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/*\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\nvar fs = __webpack_require__(/*! fs */ \"../../../node_modules/node-libs-browser/mock/empty.js\").promises;\n/**\r\n * @description upload different artifacts\r\n * @private\r\n * @async\r\n * @module computeUpload\r\n * @param {store} store \r\n * @param {rafobject} session compute session \r\n * @param {computeTable} table - name of table to be created\r\n * @param {object} data - rows of data objects\r\n * @param {object} columns columns\r\n * @returns {promise}\r\n */\n\n\nfunction computeUpload(_x, _x2, _x3, _x4, _x5) {\n return _computeUpload.apply(this, arguments);\n}\n\nfunction _computeUpload() {\n _computeUpload = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, table, data, columns) {\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 return _context.abrupt(\"return\", {\n msg: 'Placeholder',\n statusCode: 0\n });\n\n case 1:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _computeUpload.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (computeUpload);\n\n//# sourceURL=webpack://restaflib/./computeUpload.js?");
|
|
871
871
|
|
|
872
872
|
/***/ }),
|
|
873
873
|
|
|
@@ -1256,7 +1256,7 @@ eval("/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights
|
|
|
1256
1256
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1257
1257
|
|
|
1258
1258
|
"use strict";
|
|
1259
|
-
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\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 */\nvar FormData = __webpack_require__(/*! form-data */ \"../../../node_modules/form-data/lib/browser.js\");\n\nfunction uploadData(_x, _x2, _x3, _x4, _x5, _x6) {\n return _uploadData.apply(this, arguments);\n}\n\nfunction _uploadData() {\n _uploadData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(caslib, fileName, file, type, store, scope) {\n var _yield$store$addServi, casManagement, servers, serverName, p1, caslibResult, tables, qt, lastTable, n, uri, formData, p3, upload;\n\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 _context.next = 2;\n return store.addServices('casManagement');\n\n case 2:\n _yield$store$addServi = _context.sent;\n casManagement = _yield$store$addServi.casManagement;\n _context.next = 6;\n return store.apiCall(casManagement.links('servers'));\n\n case 6:\n servers = _context.sent;\n\n if (!(servers.itemsList().size === 0)) {\n _context.next = 9;\n break;\n }\n\n throw {\n Error: 'No cas servers were found'\n };\n\n case 9:\n serverName = servers.itemsList(0); // query for preferred caslib \n\n p1 = {\n qs: {\n filter: \"eq(name,\".concat(caslib, \")\")\n }\n };\n _context.next = 13;\n return store.apiCall(servers.itemsCmd(serverName, 'caslibs'), p1);\n\n case 13:\n caslibResult = _context.sent;\n _context.next = 16;\n return store.apiCall(caslibResult.itemsCmd(caslib, 'tables'));\n\n case 16:\n tables = _context.sent;\n qt = {\n qs: {\n filter: \"eq(name, \".concat(fileName.trim().toUpperCase(), \")\")\n }\n };\n _context.next = 20;\n return store.apiCall(caslibResult.itemsCmd(caslib, 'tables'), qt);\n\n case 20:\n lastTable = _context.sent;\n\n if (!(lastTable.itemsList().size === 1)) {\n _context.next = 25;\n break;\n }\n\n n = lastTable.itemsList(0);\n uri = lastTable.items(n, 'data', 'tableReference', 'tableUri');\n return _context.abrupt(\"return\", uri);\n\n case 25:\n // upload table using the upload rel\n formData = new FormData();\n formData.append('tableName', fileName);\n formData.append('format', type);\n formData.append('scope', scope == null ? 'global' : scope);\n formData.append('replace', true);\n formData.append('containsHeaderRow', true);\n formData.append('file', file); // note that we are passing the File object\n\n p3 = {\n data: formData,\n headers: {\n 'content-type': \"multipart/form-data; boundary=\\\"----------12345678901234567\\\"\"\n }\n };\n
|
|
1259
|
+
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\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 */\nvar FormData = __webpack_require__(/*! form-data */ \"../../../node_modules/form-data/lib/browser.js\");\n\nfunction uploadData(_x, _x2, _x3, _x4, _x5, _x6) {\n return _uploadData.apply(this, arguments);\n}\n\nfunction _uploadData() {\n _uploadData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(caslib, fileName, file, type, store, scope) {\n var _yield$store$addServi, casManagement, servers, serverName, p1, caslibResult, tables, qt, lastTable, n, uri, formData, p3, upload;\n\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 _context.next = 2;\n return store.addServices('casManagement');\n\n case 2:\n _yield$store$addServi = _context.sent;\n casManagement = _yield$store$addServi.casManagement;\n _context.next = 6;\n return store.apiCall(casManagement.links('servers'));\n\n case 6:\n servers = _context.sent;\n\n if (!(servers.itemsList().size === 0)) {\n _context.next = 9;\n break;\n }\n\n throw {\n Error: 'No cas servers were found'\n };\n\n case 9:\n serverName = servers.itemsList(0); // query for preferred caslib \n\n p1 = {\n qs: {\n filter: \"eq(name,\".concat(caslib, \")\")\n }\n };\n _context.next = 13;\n return store.apiCall(servers.itemsCmd(serverName, 'caslibs'), p1);\n\n case 13:\n caslibResult = _context.sent;\n _context.next = 16;\n return store.apiCall(caslibResult.itemsCmd(caslib, 'tables'));\n\n case 16:\n tables = _context.sent;\n qt = {\n qs: {\n filter: \"eq(name, \".concat(fileName.trim().toUpperCase(), \")\")\n }\n };\n _context.next = 20;\n return store.apiCall(caslibResult.itemsCmd(caslib, 'tables'), qt);\n\n case 20:\n lastTable = _context.sent;\n\n if (!(lastTable.itemsList().size === 1)) {\n _context.next = 25;\n break;\n }\n\n n = lastTable.itemsList(0);\n uri = lastTable.items(n, 'data', 'tableReference', 'tableUri');\n return _context.abrupt(\"return\", uri);\n\n case 25:\n // upload table using the upload rel\n formData = new FormData();\n formData.append('tableName', fileName);\n formData.append('format', type);\n formData.append('scope', scope == null ? 'global' : scope);\n formData.append('replace', true);\n formData.append('containsHeaderRow', true);\n formData.append('file', file); // note that we are passing the File object\n\n p3 = {\n data: formData,\n headers: {\n 'content-type': \"multipart/form-data; boundary=\\\"----------12345678901234567\\\"\"\n }\n };\n _context.next = 35;\n return store.apiCall(tables.links('upload'), p3);\n\n case 35:\n upload = _context.sent;\n return _context.abrupt(\"return\", upload);\n\n case 37:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _uploadData.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (uploadData);\n\n//# sourceURL=webpack://restaflib/./uploadData.js?");
|
|
1260
1260
|
|
|
1261
1261
|
/***/ }),
|
|
1262
1262
|
|
|
@@ -1308,7 +1308,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
|
|
|
1308
1308
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1309
1309
|
|
|
1310
1310
|
"use strict";
|
|
1311
|
-
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 _caslRun__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../caslRun */ \"./caslRun.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\nfunction uploadSrc(_x, _x2, _x3, _x4, _x5) {\n return _uploadSrc.apply(this, arguments);\n}\n\nfunction _uploadSrc() {\n _uploadSrc = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, modelBuf, fileInfo, save) {\n var _fileInfo$output, caslib, name, JSON_Parameters, p, r, casl, _r, text;\n\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 _fileInfo$output = fileInfo.output, caslib = _fileInfo$output.caslib, name = _fileInfo$output.name;\n\n if (!(name == null)) {\n _context.next = 3;\n break;\n }\n\n throw 'Please specify table as caslib.name';\n\n case 3:\n _context.next = 5;\n return cleanup(store, session, caslib, name);\n\n case 5:\n JSON_Parameters = {\n casout: {\n caslib: caslib,\n\n /* a valid caslib */\n name: name\n /* name of output file on cas server */\n\n },\n importOptions: {\n fileType: fileInfo.fileType\n /* type of the file being uploaded */\n\n }\n };\n\n if (fileInfo.fileExt === 'sas' || fileInfo.fileExt === 'ds2') {\n JSON_Parameters.importOptions.delimiter = '\\\\';\n }\n\n p = {\n headers: {\n 'JSON-Parameters': JSON_Parameters,\n 'Content-Type': 'binary/octet-stream'\n },\n data: modelBuf,\n action: 'table.upload'\n };\n _context.next = 10;\n return store.runAction(session, p);\n\n case 10:\n r = _context.sent;\n\n if (!(save === true)) {\n _context.next =
|
|
1311
|
+
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 _caslRun__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../caslRun */ \"./caslRun.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\nfunction uploadSrc(_x, _x2, _x3, _x4, _x5) {\n return _uploadSrc.apply(this, arguments);\n}\n\nfunction _uploadSrc() {\n _uploadSrc = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, modelBuf, fileInfo, save) {\n var _fileInfo$output, caslib, name, JSON_Parameters, p, r, casl, _r, text;\n\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 _fileInfo$output = fileInfo.output, caslib = _fileInfo$output.caslib, name = _fileInfo$output.name;\n\n if (!(name == null)) {\n _context.next = 3;\n break;\n }\n\n throw 'Please specify table as caslib.name';\n\n case 3:\n _context.next = 5;\n return cleanup(store, session, caslib, name);\n\n case 5:\n JSON_Parameters = {\n casout: {\n caslib: caslib,\n\n /* a valid caslib */\n name: name\n /* name of output file on cas server */\n\n },\n importOptions: {\n fileType: fileInfo.fileType\n /* type of the file being uploaded */\n\n }\n };\n\n if (fileInfo.fileExt === 'sas' || fileInfo.fileExt === 'ds2') {\n JSON_Parameters.importOptions.delimiter = '\\\\';\n }\n\n p = {\n headers: {\n 'JSON-Parameters': JSON_Parameters,\n 'Content-Type': 'binary/octet-stream'\n },\n data: modelBuf,\n action: 'table.upload'\n };\n _context.next = 10;\n return store.runAction(session, p);\n\n case 10:\n r = _context.sent;\n\n if (!(save === true)) {\n _context.next = 16;\n break;\n }\n\n casl = \"\\n\\t\\t\\taction table.save r = result / \\n\\t\\t\\ttable = {caslib='\".concat(caslib, \"' name='\").concat(name, \"'} replace=true\\n\\t\\t\\tcaslib='\").concat(caslib, \"' name='\").concat(name, \"';\\n\\n\\t\\t\\tsend_response(result);\\n\\t\\t\\t\");\n _context.next = 15;\n return Object(_caslRun__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session, casl, null, true);\n\n case 15:\n _r = _context.sent;\n\n case 16:\n text = fileInfo.source == null ? \"inline source\" : fileInfo.source;\n return _context.abrupt(\"return\", \"Upload of \".concat(text, \" to \").concat((fileInfo.output, caslib), \".\").concat(fileInfo.output.name, \" completed\"));\n\n case 18:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _uploadSrc.apply(this, arguments);\n}\n\nfunction cleanup(_x6, _x7, _x8, _x9) {\n return _cleanup.apply(this, arguments);\n}\n\nfunction _cleanup() {\n _cleanup = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2(store, session, caslib, name) {\n var table, deleteSrc, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n table = \"\".concat(caslib, \".\").concat(name);\n deleteSrc = \"\\n\\t\\taction table.dropTable/ \\n caslib='\".concat(caslib, \"' name='\").concat(name, \"' quiet=TRUE; \\n \\n action table.deleteSource status=src / \\n caslib='casuser' source= '\").concat(table, \"' quiet=TRUE; \\n\\t\\tsend_response({csResults = {results= 'data deleted'}})\\n\\t\\t\");\n _context2.next = 4;\n return Object(_caslRun__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session, deleteSrc);\n\n case 4:\n r = _context2.sent;\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n return _cleanup.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (uploadSrc);\n\n//# sourceURL=webpack://restaflib/./uploadHandlers/uploadSrc.js?");
|
|
1312
1312
|
|
|
1313
1313
|
/***/ }),
|
|
1314
1314
|
|