@sassoftware/restaflib 5.5.1-1 → 5.5.1-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +263 -263
- package/dist/restaflib.js +64 -53
- package/dist/restaflib.min.js +1 -1
- package/lib/restaflib.js +64 -53
- package/package.json +39 -39
package/lib/restaflib.js
CHANGED
|
@@ -236,7 +236,7 @@ eval("{// TODO(Babel 8): Remove this file.\n\nvar runtime = __webpack_require__(
|
|
|
236
236
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
237
237
|
|
|
238
238
|
"use strict";
|
|
239
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
239
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n/**\n *\n * @description Calls cas server and returns the results(async)\n * \n * @async\n * @module casActionRun\n * @category restaflib/cas\n * @param {store} store - restaf store\n * @param {rafObject} session - cas session\n * @param {object} parameters - parameters for the action\n * \n * @returns {promise} returns results from cas \n * @alias module: casActionRun\n * @example\n * async function test_casAction () {\n * let {session} = await restaflib.casSetup(store);\n * // run fetch action\n * let p = \n * { action: 'table.fetch',\n * data : { table: { caslib: 'public', name: 'cars' } }\n * };\n * let casResults = await restaflib.casActionRun(store, session, p);\n * print.object(casResults.tables.Fetch, 'Fetched Table');\n * await store.apiCall(session.links('delete'));\n * }\n */\n\n\n// Notes: Function to call cas \n// See README file for notes on REUSECASSESSION\n//\n\n\nfunction casActionRun(_x) {\n return _casActionRun.apply(this, arguments);\n}\nfunction _casActionRun() {\n _casActionRun = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store) {\n var _len,\n rest,\n _key,\n result,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n for (_len = _args.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = _args[_key];\n }\n _context.next = 1;\n return store.runAction.apply(store, rest);\n case 1:\n result = _context.sent;\n return _context.abrupt(\"return\", result.items().toJS());\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casActionRun.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casActionRun);\n\n//# sourceURL=webpack://restaflib/./casActionRun.js?\n}");
|
|
240
240
|
|
|
241
241
|
/***/ }),
|
|
242
242
|
|
|
@@ -247,7 +247,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
247
247
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
248
248
|
|
|
249
249
|
"use strict";
|
|
250
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
250
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n\n/** \n* @description Append a cas table to a master cas table \n* @async\n* @module casAppendTable\n* @category restaflib/cas\n* @param {store} store - store\n* @param {rafObject} session - cas session\n* @param {casTable} input Input table with new rows {caslib: xxx, name: nnn}\n* @param {casTable} output Master table {caslib: xxx, name: nnn}\n* @param {boolean} saveflag If true the master table will be saved to disk\n* @param {boolean} promote If true the master table will be promoted\n* @param {*} payload -\n* @returns {promise} - return \n* @example\n* let status = restaflib.casAppendTable(store, session, 'casuser.temp', 'public.master', true));\n* \n*/\nfunction casAppendTable(_x, _x2, _x3, _x4, _x5, _x6) {\n return _casAppendTable.apply(this, arguments);\n}\nfunction _casAppendTable() {\n _casAppendTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, input, output, save, promote) {\n var src, args, result, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n src = _programs__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['commonCasl']() + ' ' + _programs__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['casAppendTable']();\n args = {\n masterTable: output,\n setTable: input,\n save: save != null ? save : true,\n promote: promote != null ? promote : false\n };\n _context.next = 1;\n return (0,_caslRunBase__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, src, args);\n case 1:\n result = _context.sent;\n r = result.items('results', 'casResults').toJS();\n if (!(save === true)) {\n _context.next = 2;\n break;\n }\n _context.next = 2;\n return (0,_casSaveTable__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(store, session, output);\n case 2:\n return _context.abrupt(\"return\", r);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casAppendTable.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casAppendTable);\n\n//# sourceURL=webpack://restaflib/./casAppendTable.js?\n}");
|
|
251
251
|
|
|
252
252
|
/***/ }),
|
|
253
253
|
|
|
@@ -258,7 +258,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
258
258
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
259
259
|
|
|
260
260
|
"use strict";
|
|
261
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
261
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n/**\n * @description Fetch rows from cas Tables\n * @async\n * @module casFetchData\n * @category restaflib/cas\n * @param {store} store restaf store\n * @param {rafObject} session cas session\n * @param {object} payload info to read data\n * @returns {promise} returns data and data for scrolling.\n * @example\n * let payload = { start:0, limit:20, format: false, table: {caslib: 'casuser', name: 'sales'}} ;\n * let result = await casFetchData(store, session, payload);\n * result = {\n * data : {rows: array of row data, schema=<schema for table>},\n * pagination: {next: {<page>}, prev: {<page>}\n * }\n * page = {start: <number>, limit: <number>, format: <true:false> table: <caslib: <string>, name:<string>}\n * }\n * Will return a row of length 0 if no data is found.\n * Will throw exceptions if cas code fails(ex: fetch action fails)\n */\nfunction casFetchData(_x, _x2, _x3) {\n return _casFetchData.apply(this, arguments);\n}\nfunction _casFetchData() {\n _casFetchData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, payload) {\n var src, result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n src = _programs__WEBPACK_IMPORTED_MODULE_3__[\"default\"]['commonCasl']() + ' ' + _programs__WEBPACK_IMPORTED_MODULE_3__[\"default\"]['casFetchData'](); // console.log(src);\n _context.next = 1;\n return (0,_caslRunBase__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, src, payload);\n case 1:\n result = _context.sent;\n return _context.abrupt(\"return\", result.items('results', 'casResults').toJS());\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casFetchData.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casFetchData);\n\n//# sourceURL=webpack://restaflib/./casFetchData.js?\n}");
|
|
262
262
|
|
|
263
263
|
/***/ }),
|
|
264
264
|
|
|
@@ -269,7 +269,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
269
269
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
270
270
|
|
|
271
271
|
"use strict";
|
|
272
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
272
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n/** \n * lib\n */\n/**\n *\n * @description Fetch rows from cas Tables\n * @private\n * @async\n * @module casFetchRows\n * @category restaflib/cas\n * @param {store} store - restaf store\n * @param {rafObject} session - cas session\n * @param {object} payload - info to read data\n * @returns {promise} returns data and data for scrolling.\n * \n * @example\n * async function test_casFetchRows () {\n * let {session} = await casSetup(store);\n * let payload = {\n * from : 1,\n * count : 20,\n * format: true,\n * table : {caslib: 'Public', name: 'cars'}\n * };\n * \n * let result = await restaflib.casFetchRows(store, session, payload);\n * console.log(result.data.schema);\n * console.log('The next start is at:' + result.pagination.next.from);\n * console.log(result.data.rows[0].toString());\n * \n * while (result.pagination.next.from !== -1) {\n * console.log('The start is at: ' + result.pagination.next.from);\n * result = await restaflib.casFetchRows(store, session, result.pagination.next);\n * console.log('The next start is at:' + result.pagination.next.from);\n * console.log(result.data.rows[0].toString());\n * };\n * console.log('--------------------------------------- scroll backwards');\n *\n * while (result.pagination.prev.from !== -1) {\n * console.log('The start is at: ' + result.pagination.prev.from);\n * result = await restaflib.casFetchRows(store, session, result.pagination.prev);\n * console.log('The previous start is at: ' + result.pagination.prev.from);\n * console.log(result.data.rows[0].toString());\n * };\n *\n * await store.apiCall(session.links('delete'));\n * }\n */\nfunction casFetchRows(_x, _x2, _x3) {\n return _casFetchRows.apply(this, arguments);\n}\nfunction _casFetchRows() {\n _casFetchRows = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, payload) {\n var src, result, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (payload.where == null) {\n payload.where = ' ';\n }\n src = _programs__WEBPACK_IMPORTED_MODULE_3__[\"default\"]['commonCasl']() + ' ' + _programs__WEBPACK_IMPORTED_MODULE_3__[\"default\"]['casFetchRows']();\n _context.next = 1;\n return (0,_caslRunBase__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, src, payload);\n case 1:\n result = _context.sent;\n r = result.items('results', 'casResults').toJS();\n if (r.data == null) {\n r.data = {\n rows: []\n };\n }\n return _context.abrupt(\"return\", r);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casFetchRows.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casFetchRows);\n\n//# sourceURL=webpack://restaflib/./casFetchRows.js?\n}");
|
|
273
273
|
|
|
274
274
|
/***/ }),
|
|
275
275
|
|
|
@@ -280,7 +280,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
280
280
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
281
281
|
|
|
282
282
|
"use strict";
|
|
283
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
283
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n/**\n *\n * @description Save a cas table with replace by default\n * \n * @async\n * @module casLoadTable\n * @category restaflib/cas\n * @param {store} store restaf store\n * @param {session} session cas session\n * @param {casTable} table cas table to be loaded\n * \n * @returns {promise} returns status object\n */\nfunction casLoadTable(_x, _x2, _x3, _x4) {\n return _casLoadTable.apply(this, arguments);\n}\nfunction _casLoadTable() {\n _casLoadTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, table, _force) {\n var src, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n src = \"\\n\\t print _args_;\\n rc = checkAndLoadTable(_args_.caslib, _args_.name);\\n\\t\\tif (rc ne true) then do;\\n\\t\\t\\ttext = 'Unable to access ' ||_args_.caslib||'.'||_args_.name; \\n\\t\\t\\trx = {severity=2,reason=6, status='error',statusCode=2, formatted=text};\\n\\t\\t\\texit(rx); \\n\\t\\tend; \\n\\t print 'return code = ' || rc;\\n\\t send_response({casResults={status='ok'}});\\n \";\n _context.next = 1;\n return (0,_caslRun__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, src, table, true);\n case 1:\n r = _context.sent;\n return _context.abrupt(\"return\", {\n msg: \"\".concat(table.caslib, \".\").concat(table.name, \" loaded}\"),\n statusCode: 0\n });\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casLoadTable.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casLoadTable);\n\n//# sourceURL=webpack://restaflib/./casLoadTable.js?\n}");
|
|
284
284
|
|
|
285
285
|
/***/ }),
|
|
286
286
|
|
|
@@ -291,7 +291,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
291
291
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
292
292
|
|
|
293
293
|
"use strict";
|
|
294
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
294
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n *\n * @description Save a cas table with replace by default\n * \n * @async\n * @module casSaveTable\n * @category restaflib/cas\n * @param {store} store restaf store\n * @param {session} session cas session\n * @param {casTable} table cas table to be saved\n * @param {boolean=} replace default is replace\n * @param {boolean=} loadTable load table (default= true)\n * \n * @returns {promise} returns status object\n */\n\n\nfunction casSaveTable(_x, _x2, _x3, _x4, _x5) {\n return _casSaveTable.apply(this, arguments);\n}\nfunction _casSaveTable() {\n _casSaveTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, table, replace, loadTable) {\n var caslib, name, src;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n caslib = table.caslib, name = table.name;\n src = \"\\n table.save /\\n replace=true\\n table = {caslib=\\\"\".concat(caslib, \"\\\" name=\\\"\").concat(name, \"\\\"}\\n caslib=\\\"\").concat(caslib, \"\\\" name=\\\"\").concat(name, \".sashdat\\\";\\n\\n /* clean up before promoting the table */\\n table.droptable /\\n caslib=\\\"\").concat(caslib, \"\\\" name=\\\"\").concat(name, \"\\\" ;\\n\\n /* promote the table to make it available for further analysis */\\n table.loadTable status=status r=rc/\\n caslib=\\\"\").concat(caslib, \"\\\",\\n path=\\\"\").concat(name, \".sashdat\\\",\\n casout={name=\\\"\").concat(name, \"\\\", caslib=\\\"\").concat(caslib, \"\\\" promote=True};\\n run;\\n\\t\");\n return _context.abrupt(\"return\", {\n msg: \"\".concat(caslib, \".\").concat(name, \" saved}\"),\n statusCode: 0\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casSaveTable.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casSaveTable);\n\n//# sourceURL=webpack://restaflib/./casSaveTable.js?\n}");
|
|
295
295
|
|
|
296
296
|
/***/ }),
|
|
297
297
|
|
|
@@ -302,7 +302,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
302
302
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
303
303
|
|
|
304
304
|
"use strict";
|
|
305
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
305
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights reserved * * Licensed under the Apache License, Version 2.0 (the \"License\");\n * * you may not use this file except in compliance with the License.\n * * You may obtain a copy of the License at\n * *\n * * http://www.apache.org/licenses/LICENSE-2.0\n * *\n * * Unless required by applicable law or agreed to in writing, software\n * * distributed under the License is distributed on an \"AS IS\" BASIS,\n * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * * See the License for the specific language governing permissions and\n * limitations under the License.\n * ----------------------------------------------------------------------------------------\n *\n */\n/**\n *\n * @description Calls cas server and returns the results(async)\n * \n * @async\n * @module casSetup\n * @category restaflib/cas\n * @param {store} store - restaf store\n * @param {logonPayload} logonPayload - if not null, then use this to logon to Viya\n * @param {string=} sessionID - id of an existing session to attach.\n * @param {string} sasServer - name of cas server to use. else defaults to the first server on list.\n * \n * @returns {promise} returns an object {session: xxx, servers: yyy}\n * @example \n * const {servers, session} = await casSetup(storem logonPayload, <sessionID>)\n */\n\n\n\n\n\nfunction casSetup(_x, _x2, _x3, _x4) {\n return _casSetup.apply(this, arguments);\n}\nfunction _casSetup() {\n _casSetup = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, logonPayload, sessionID, casServer) {\n var msg, _yield$store$addServi, casManagement, servers, casserver, itemsList, index, session, payload, sessionList, selfcmd;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(logonPayload != null)) {\n _context.next = 2;\n break;\n }\n _context.next = 1;\n return store.logon(logonPayload);\n case 1:\n msg = _context.sent;\n case 2:\n _context.next = 3;\n return store.addServices('casManagement');\n case 3:\n _yield$store$addServi = _context.sent;\n casManagement = _yield$store$addServi.casManagement;\n _context.next = 4;\n return store.apiCall(casManagement.links('servers'));\n case 4:\n servers = _context.sent;\n if (!(servers.itemsList().size === 0)) {\n _context.next = 5;\n break;\n }\n throw {\n Error: 'No cas servers were found'\n };\n case 5:\n casserver = null;\n if (!(casServer == null)) {\n _context.next = 6;\n break;\n }\n casserver = servers.itemsList(0);\n _context.next = 8;\n break;\n case 6:\n itemsList = servers.itemsList().toJS();\n index = itemsList.findIndex(function (s) {\n return s === casServer;\n });\n if (!(index === -1)) {\n _context.next = 7;\n break;\n }\n throw {\n Error: \"server with name of \".concat(casServer, \" was not found\")\n };\n case 7:\n casserver = servers.itemsList(index);\n case 8:\n session = null;\n if (!(sessionID == null)) {\n _context.next = 10;\n break;\n }\n _context.next = 9;\n return store.apiCall(servers.itemsCmd(casserver, 'createSession'));\n case 9:\n session = _context.sent;\n _context.next = 15;\n break;\n case 10:\n if (!(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(sessionID) === 'object')) {\n _context.next = 11;\n break;\n }\n session = sessionID;\n _context.next = 15;\n break;\n case 11:\n payload = {\n qs: {\n filter: \"eq( id,'\".concat(sessionID, \"')\")\n }\n }; // console.log('after session' ,JSON.stringify(store.getXsrfData()));\n _context.next = 12;\n return store.apiCall(servers.itemsCmd(casserver, \"sessions\"), payload);\n case 12:\n sessionList = _context.sent;\n if (!(sessionList.items().size === 0)) {\n _context.next = 13;\n break;\n }\n throw \"ERROR: The sessionID \".concat(sessionID, \" was not found.\");\n case 13:\n selfcmd = sessionList.itemsCmd(sessionList.itemsList(0), \"self\");\n _context.next = 14;\n return store.apiCall(selfcmd);\n case 14:\n session = _context.sent;\n case 15:\n return _context.abrupt(\"return\", {\n servers: servers,\n session: session\n });\n case 16:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casSetup.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casSetup);\n\n//# sourceURL=webpack://restaflib/./casSetup.js?\n}");
|
|
306
306
|
|
|
307
307
|
/***/ }),
|
|
308
308
|
|
|
@@ -313,7 +313,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
313
313
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
314
314
|
|
|
315
315
|
"use strict";
|
|
316
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\
|
|
316
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * @description Converts a cas table to JSON(utility)\n * @module casTableToJson\n * @category restaflib/util\n * @param {object} result - the raf object returned from a call to cas\n * @param {string} table - the name of the table\n * \n * @returns {object} - the new json version [{var1: value1, var2: value2,...}, {...}]\n * @alias module: casTableToJson\n * \n */\nfunction casTableToJson(result, table) {\n var data = result.items('tables', table);\n var itemRows = data.get('rows');\n var columns = [];\n data.get('schema').map(function (s) {\n columns.push(s.get('name'));\n });\n var allResults = [];\n itemRows.map(function (r) {\n var row = {};\n r.map(function (value, j) {\n row[columns[j]] = value;\n });\n allResults.push(row);\n });\n return allResults;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casTableToJson);\n\n//# sourceURL=webpack://restaflib/./casTableToJson.js?\n}");
|
|
317
317
|
|
|
318
318
|
/***/ }),
|
|
319
319
|
|
|
@@ -324,7 +324,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
324
324
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
325
325
|
|
|
326
326
|
"use strict";
|
|
327
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__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\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/*\
|
|
327
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__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\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/*\n * Copyright © 2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @description Update a record in a cas table\n * @async\n * @module casUpdateData\n * @category restaflib/cas\n * @param {store} store - store\n * @param {rafObject} session - cas session\n * @param {*} payload - {data,where,table}\n * @returns {promise} - return \n * @example\n * let inputs = restaflib.casUpdateData(store, session, payload);\n * payload = { where: {key1: vale1, key2: value2,...},\n * data: {var1:value1, var2:value2,....}},\n * table: {caslib: caslib, name: name}\n * Expects a single row\n */\nfunction casUpdateData(_x, _x2, _x3) {\n return _casUpdateData.apply(this, arguments);\n}\nfunction _casUpdateData() {\n _casUpdateData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, session, payload) {\n var data, where, table, swhere, andbit, k, v, valString, set, _k, value, valueString, tbl, updateRow, pl, r, status, disp;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n data = payload.data, where = payload.where, table = payload.table;\n swhere = '';\n andbit = ' ';\n for (k in where) {\n v = where[k];\n valString = typeof v === \"string\" ? \"'\".concat(v.toString(), \"'\") : v;\n swhere = swhere + andbit + k + \"= \".concat(valString, \" \");\n andbit = ' AND ';\n }\n set = [];\n for (_k in data) {\n value = data[_k];\n valueString = void 0;\n if (value == null) {\n valueString = '.';\n } else if (typeof value === 'string') {\n valueString = JSON.stringify(value) /*`${JSON.stringify(value)}`*/;\n } else {\n valueString = value.toString();\n }\n set.push({\n var: _k,\n value: valueString\n });\n }\n tbl = _objectSpread(_objectSpread({}, table), {}, {\n where: \"\".concat(swhere)\n });\n updateRow = {\n table: tbl,\n set: set\n };\n pl = {\n action: 'table.update',\n data: updateRow\n };\n _context.next = 1;\n return store.runAction(session, pl);\n case 1:\n r = _context.sent;\n status = {\n msg: 'Update completed',\n statusCode: 0\n };\n disp = r.items().toJS().disposition;\n if (disp.statusCode !== 0) {\n status.statusCode = disp.statusCode;\n status.msg = disp.reason;\n }\n return _context.abrupt(\"return\", status);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casUpdateData.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casUpdateData);\n\n//# sourceURL=webpack://restaflib/./casUpdateData.js?\n}");
|
|
328
328
|
|
|
329
329
|
/***/ }),
|
|
330
330
|
|
|
@@ -335,7 +335,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
335
335
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
336
336
|
|
|
337
337
|
"use strict";
|
|
338
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/* harmony import */ var _uploadSetup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uploadSetup */ \"./uploadSetup.js\");\n/* harmony import */ var _uploadHandlers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./uploadHandlers */ \"./uploadHandlers/index.js\");\n/*\
|
|
338
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/* harmony import */ var _uploadSetup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uploadSetup */ \"./uploadSetup.js\");\n/* harmony import */ var _uploadHandlers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./uploadHandlers */ \"./uploadHandlers/index.js\");\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n//import fs from 'fs'; \n\n\n\n\n\n/**\n * @description upload different artifacts\n * @private\n * @async\n * @module casUpload\n * @param {store} store \n * @param {*} session \n * @param {*} source \n * @param {*} output \n * @param {*} save \n * @param {*} altSrc \n * @returns {promise}\n */\nfunction casUpload(_x, _x2, _x3, _x4, _x5, _x6) {\n return _casUpload.apply(this, arguments);\n}\nfunction _casUpload() {\n _casUpload = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, session, source, output, save, altSrc) {\n var table, fileInfo, buf, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n // parse source file to figure out what we are uploading\n // const fss = fs.promises\n table = output;\n if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(output) === 'object') {\n table = \"\".concat(output.caslib, \".\").concat(output.name);\n }\n fileInfo = (0,_uploadSetup__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(source, table); // read the file\n //let buf = ( altSrc != null ) ? altSrc : await fss.readFile( source, fileInfo.fileOptions );\n buf = altSrc; // transfrom data if necessary for upload\n /*if ( fileInfo.transform !== null ) {\n buf = fileInfo.transform( buf, fileInfo );\n }*/\n // upload using specific upload handlers\n _context.next = 1;\n return fileInfo.handler(store, session, buf, fileInfo, save);\n case 1:\n r = _context.sent;\n return _context.abrupt(\"return\", r);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casUpload.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casUpload);\n\n//# sourceURL=webpack://restaflib/./casUpload.js?\n}");
|
|
339
339
|
|
|
340
340
|
/***/ }),
|
|
341
341
|
|
|
@@ -346,7 +346,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
346
346
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
347
347
|
|
|
348
348
|
"use strict";
|
|
349
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__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/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _programs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./programs */ \"./programs/index.js\");\n/*\
|
|
349
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__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/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _programs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./programs */ \"./programs/index.js\");\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n/**\n *\n * @description Score data in casl\n * \n * @async\n * @module caslDescribe\n * @category restaflib/cas\n * @param {store} store - restaf store\n * @param {rafObject} session - cas session\n * @param {object} scenario - scenario values\n * \n * @returns {promise} returns the scores as an object\n */\n\n\n\n\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n\n\nfunction caslDescribe(_x, _x2, _x3) {\n return _caslDescribe.apply(this, arguments);\n}\nfunction _caslDescribe() {\n _caslDescribe = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, session, scenario) {\n var src, appEnv, result, finalResult;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n src = _programs__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['commonCasl']() + ' ' + _programs__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['scoreCasl']();\n appEnv = _objectSpread({\n path: '/describe'\n }, scenario);\n _context.next = 1;\n return (0,_caslRunBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(store, session, src, appEnv);\n case 1:\n result = _context.sent;\n finalResult = result.items('results').toJS();\n return _context.abrupt(\"return\", finalResult);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _caslDescribe.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (caslDescribe);\n\n//# sourceURL=webpack://restaflib/./caslDescribe.js?\n}");
|
|
350
350
|
|
|
351
351
|
/***/ }),
|
|
352
352
|
|
|
@@ -357,7 +357,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
357
357
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
358
358
|
|
|
359
359
|
"use strict";
|
|
360
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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\n\n/*\
|
|
360
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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\n\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n/**\n *\n * @description Calls cas server and returns the results(async)\n * \n * @async\n * @module caslRun\n * @category restaflib/cas\n * \n * @param {store} store - restaf store\n * @param {rafObject} session - cas session\n * @param {string} src - casl src statements\n * @param {object=} args - user input args (reference this as _args_ in casl program)\n * @param {boolean=} useCommons - include the common casl programs(checkAndLoad etc...)\n * @returns {promise} returns results from cas\n * @example\n\n * let restaf = require(\"@sassoftware/restaf\");\nlet payload = require('./config')();\nlet {casSetup} = require('@sassoftware/restaflib');\n\nlet prtUtil = require(\"./prtUtil\");\n\nlet store = restaf.initStore({casProxy: true});\nasync function example () {\n let { session } = await casSetup (store, payload);\n // console.log(JSON.stringify(session.links(), null, 4));\n let casl = `\n action datastep.runcode/ single='YES' code = 'data casuser.a; x=1; run;';\n action table.fetch r=r1/\n table= { caslib= 'casuser', name= 'a' } ;\n run;\n action datastep.runcode/ single='YES' code = 'data casuser.b; y=1; run;';\n action table.fetch r=r2/\n table= { caslib= 'casuser', name= 'b' } ;\n run;\n c = {a=10, b=20};\n send_response({a=r1, b=r2, c=c});\n `;\n\n\n let r = await store.runCasl(session, casl);\n\n console.log(r.items().toJS());\n let a = r.items().toJS();\n console.log(a);\n return \"done\";\n}\n\nexample()\n .then(r => console.log(r))\n .catch(err => console.log(err));\n*/\nfunction caslRun(_x, _x2, _x3, _x4, _x5) {\n return _caslRun.apply(this, arguments);\n}\nfunction _caslRun() {\n _caslRun = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, src, args, useCommons) {\n var tsrc,\n _len,\n rest,\n _key,\n result,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n tsrc = src;\n if (useCommons !== false) {\n tsrc = _programs__WEBPACK_IMPORTED_MODULE_3__[\"default\"]['commonCasl']() + ' ' + src;\n }\n for (_len = _args.length, rest = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\n rest[_key - 5] = _args[_key];\n }\n _context.next = 1;\n return _caslRunBase__WEBPACK_IMPORTED_MODULE_2__[\"default\"].apply(void 0, [store, session, tsrc, args].concat(rest));\n case 1:\n result = _context.sent;\n return _context.abrupt(\"return\", result.items().toJS());\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _caslRun.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (caslRun);\n\n//# sourceURL=webpack://restaflib/./caslRun.js?\n}");
|
|
361
361
|
|
|
362
362
|
/***/ }),
|
|
363
363
|
|
|
@@ -368,7 +368,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
368
368
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
369
369
|
|
|
370
370
|
"use strict";
|
|
371
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _jsonToDict__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jsonToDict */ \"./jsonToDict.js\");\n/*\
|
|
371
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _jsonToDict__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jsonToDict */ \"./jsonToDict.js\");\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n/** \n * lib\n */\n/** \n *\n * @description Calls cas server and returns the results(async)\n * @private\n * @async\n * @function caslRunBase(async)\n * @category restaflib/cas\n * @param {object} store - restaf store\n * @param {object} session - cas session\n * @param {object} src - casl src statements\n * @param {object} args - arguments to pass to on to CAS as _args_\n * \n * @returns {object} standard return value from apiCall\n */\nfunction caslRunBase(_x, _x2, _x3, _x4) {\n return _caslRunBase.apply(this, arguments);\n}\nfunction _caslRunBase() {\n _caslRunBase = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, src, args) {\n var _args_,\n code,\n payload,\n _len,\n rest,\n _key,\n result,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n //\n // create casl statements for arguments and appenv\n //\n _args_ = (0,_jsonToDict__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(args !== null ? args : {}, '_args_');\n code = _args_ + ' ' + src; // Patch for issues with sccasl.runcasl via REST API\n code = code.replace(/\\r?\\n|\\r/g, '');\n // setup payload for runAction\n payload = {\n action: 'sccasl.runcasl',\n data: {\n code: code\n }\n };\n for (_len = _args.length, rest = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {\n rest[_key - 4] = _args[_key];\n }\n _context.next = 1;\n return store.runAction.apply(store, [session, payload].concat(rest));\n case 1:\n result = _context.sent;\n return _context.abrupt(\"return\", result);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _caslRunBase.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (caslRunBase);\n\n//# sourceURL=webpack://restaflib/./caslRunBase.js?\n}");
|
|
372
372
|
|
|
373
373
|
/***/ }),
|
|
374
374
|
|
|
@@ -379,7 +379,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
379
379
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
380
380
|
|
|
381
381
|
"use strict";
|
|
382
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__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/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _programs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./programs */ \"./programs/index.js\");\n/*\
|
|
382
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__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/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _programs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./programs */ \"./programs/index.js\");\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n/** \n * lib\n */\n/**\n *\n * @description Score data in casl\n * \n * @async\n * @module caslScore\n * @category restaflib/cas\n * @param {store} store - restaf store\n * @param {rafObject} session - cas session\n * @param {object} scenario - scenario values\n * \n * @returns {promise} returns the scores as an object\n */\n\n\n\n\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n\n\nfunction caslScore(_x, _x2, _x3) {\n return _caslScore.apply(this, arguments);\n}\nfunction _caslScore() {\n _caslScore = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, session, scenario) {\n var src, appEnv, result, finalResult;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n src = _programs__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['commonCasl']() + ' ' + _programs__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['scoreCasl']();\n appEnv = _objectSpread({\n path: '/score'\n }, scenario);\n _context.next = 1;\n return (0,_caslRunBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(store, session, src, appEnv);\n case 1:\n result = _context.sent;\n finalResult = result.items('results', 'casResults').toJS()[0];\n return _context.abrupt(\"return\", finalResult);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _caslScore.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (caslScore);\n\n//# sourceURL=webpack://restaflib/./caslScore.js?\n}");
|
|
383
383
|
|
|
384
384
|
/***/ }),
|
|
385
385
|
|
|
@@ -390,7 +390,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
390
390
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
391
391
|
|
|
392
392
|
"use strict";
|
|
393
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
393
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n/** \n* @description Append a compute table to a master compute table \n* @async\n* @module computeAppendTable\n* @category restaflib/compute\n* @param {store} store - store\n* @param {rafObject} session - compute session\n* @param {computeTable} input Input table with new rows {libref: xxx, name: nnn}\n* @param {computeTable} output Master table {computelib: xxx, name: nnn}\n* @returns {promise} - return \n* @example\n* let status = restaflib.computeAppendTable(store, session, 'computeuser.temp', 'public.master', true));\n* \n*/\nfunction computeAppendTable(_x, _x2, _x3, _x4) {\n return _computeAppendTable.apply(this, arguments);\n}\nfunction _computeAppendTable() {\n _computeAppendTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, input, output) {\n var src, computeSummary, statusCode;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) 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 = 1;\n return (0,_computeRun__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, src);\n case 1:\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 case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeAppendTable.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeAppendTable);\n\n//# sourceURL=webpack://restaflib/./computeAppendTable.js?\n}");
|
|
394
394
|
|
|
395
395
|
/***/ }),
|
|
396
396
|
|
|
@@ -401,7 +401,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
401
401
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
402
402
|
|
|
403
403
|
"use strict";
|
|
404
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__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\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/*\
|
|
404
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__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\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n *\n * @description Fetch data from a SAS Table\n * @async\n * @module computeFetchData\n * @category restaflib/compute\n * @param {object} store - restaf store\n * @param {computeSummary} computeSummary - Summary object created by computeSummary method\n * @param {string} table - name of the table\n * @param {string} scroll direction - null(to get first set)|next|prev|first|last\n * @param {object} payload - query values\n *\n * @returns {promise} - {columns: <column names>, rows: <data for rows> , scrollOptions: <available scroll directions>}\n */\nfunction computeFetchData(_x, _x2, _x3, _x4, _x5, _x6) {\n return _computeFetchData.apply(this, arguments);\n} // convert cells to rowSet\nfunction _computeFetchData() {\n _computeFetchData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, computeSummary, table, direction, payload, useRow) {\n var data, dataIsformatted, tname, ipayload, dataIsFormatted, linkRel, adhoc, tableInfo, t1, colCount, qc, columns, schema, items, cx, c, newcol, indx, result, rowsData, current, dir, _result, _rowsData;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n data = null;\n dataIsformatted = false;\n tname = typeof table === \"string\" ? table : \"\".concat(table.libref, \".\").concat(table.name);\n tname = tname.toUpperCase(); /*to allow for compute service table info */\n ipayload = payload != null ? _objectSpread({}, payload) : {\n qs: {}\n };\n ipayload.qs.includeIndex = true;\n dataIsFormatted = ipayload.qs.format;\n linkRel = useRow == null ? \"rows\" : useRow; // is payload an override or is this an adhoc request(i.e user is ignoring scroll info)\n adhoc = payload != null && direction == null ? true : false; // retrieve current info on this table(if any)\n tableInfo = computeSummary.tables[tname];\n if (!(tableInfo != null)) {\n _context.next = 6;\n break;\n }\n // reset current on if this is an adhoc request.\n if (adhoc === true) {\n tableInfo.current = null;\n }\n //get column info \n if (!(tableInfo.current === null || direction == null || direction === \"first\")) {\n _context.next = 4;\n break;\n }\n _context.next = 1;\n return store.apiCall(tableInfo.self);\n case 1:\n t1 = _context.sent;\n colCount = t1.items().toJS()[\"columnCount\"]; // get columns explicitly since user can control this thru payload\n qc = {\n qs: {\n start: 0,\n limit: colCount\n }\n };\n _context.next = 2;\n return store.apiCall(t1.links(\"columns\"), qc);\n case 2:\n columns = _context.sent;\n schema = [];\n items = columns.items().toJS();\n if (linkRel === \"rows\") {\n schema.push({\n name: \"_index_\",\n Column: \"_Index_\",\n Label: \"Index\",\n length: 8,\n type: \"FLOAT\",\n format: \"BEST\",\n informat: \"BEST\",\n custom: false,\n isFormat: false\n });\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 format: c.data.format != null ? c.data.format.name : null,\n informat: c.data.informat != null ? c.data.informat.name : null,\n custom: false,\n isFormat: dataIsFormatted\n };\n indx = ipayload.qs.includeIndex === true ? 1 : 0;\n schema[c.data.index + indx] = newcol;\n }\n // Now get data using rows or rowSet rel\n _context.next = 3;\n return store.apiCall(t1.links(linkRel), ipayload);\n case 3:\n result = _context.sent;\n // If using linkRel of rows, convert the data to rowSet schema\n rowsData = linkRel === \"rowSet\" ? result.items('rows').toJS() : cells2RowSet(result);\n tableInfo.current = result;\n tableInfo.schema = schema;\n tableInfo.columns = columns;\n data = {\n columns: columns,\n schema: schema,\n rows: rowsData,\n scrollOptions: result.scrollCmds().keySeq().toJS()\n };\n _context.next = 6;\n break;\n case 4:\n current = tableInfo.current;\n dir = direction;\n if (direction === \"next\" && current.scrollCmds(\"next\") === null) {\n dir = current.links(\"last\") !== null ? \"last\" : null;\n }\n if (direction === \"prev\" && current.scrollCmds(\"prev\") === null) {\n dir = current.links(\"first\") !== null ? \"first\" : null;\n }\n data = {\n schema: tableInfo.schema,\n columns: tableInfo.columns,\n currentColumns: tableInfo.currentColumns,\n rows: [],\n scrollOptions: current.scrollCmds().keySeq().toJS()\n };\n if (!(dir !== null && current.scrollCmds(dir) !== null)) {\n _context.next = 6;\n break;\n }\n _context.next = 5;\n return store.apiCall(current.scrollCmds(dir), ipayload);\n case 5:\n _result = _context.sent;\n tableInfo.current = _result;\n _rowsData = linkRel !== \"rows\" ? _result.items('rows').toJS() : cells2RowSet(_result);\n data = {\n schema: tableInfo.schema,\n columns: tableInfo.schema,\n rows: _rowsData,\n scrollOptions: _result.scrollCmds().keySeq().toJS()\n };\n case 6:\n return _context.abrupt(\"return\", data);\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeFetchData.apply(this, arguments);\n}\nfunction cells2RowSet(result) {\n var rowsData = result.items().toJS().map(function (r) {\n return r.cells;\n });\n return rowsData;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeFetchData);\n\n//# sourceURL=webpack://restaflib/./computeFetchData.js?\n}");
|
|
405
405
|
|
|
406
406
|
/***/ }),
|
|
407
407
|
|
|
@@ -412,7 +412,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
412
412
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
413
413
|
|
|
414
414
|
"use strict";
|
|
415
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
415
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n//\n// Notes: Retrieve a SAS table and convert to a json\n// convert table to object of the form [{var1: value, var2: value,...},....]\n// ex: [{merlot:10, twobit:20}, {merlot: 20, twobit:30}]\n\n\n\n/**\n * @description return content of a file output from a compute run\n * @async\n * @module computeFileContent\n * @category restaflib/compute\n *\n * @param {object} store - restaf store\n * @param {object} computeSummary - computeSummary\n * @param {string} fileref - name of the fileref\n * @param {boolean} url - set to true if you want the url and not the content\n *\n * @returns {promise} - get uri for content]\n */\n\n\nfunction computeFileContent(_x, _x2, _x3, _x4) {\n return _computeFileContent.apply(this, arguments);\n}\nfunction _computeFileContent() {\n _computeFileContent = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, computeSummary, fileref, url) {\n var fileInfo, payload, result, r, rx, _r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n fileInfo = computeSummary.files[fileref];\n if (!(fileInfo == null)) {\n _context.next = 1;\n break;\n }\n throw \"Invalid fileref \".concat(fileref);\n case 1:\n if (!(fileInfo.current === null)) {\n _context.next = 4;\n break;\n }\n payload = {\n qs: {\n filter: \"eq(name,'\".concat(fileref, \"')\")\n }\n };\n _context.next = 2;\n return store.apiCall(computeSummary.session.links('files'), payload);\n case 2:\n result = _context.sent;\n _context.next = 3;\n return store.apiCall(result.itemsCmd(fileref, 'self'));\n case 3:\n result = _context.sent;\n fileInfo.current = result;\n case 4:\n if (!(url === true)) {\n _context.next = 5;\n break;\n }\n r = \"\".concat(computeSummary.session.host).concat(fileInfo.current.links('content', 'link', 'uri'));\n return _context.abrupt(\"return\", r);\n case 5:\n if (!(fileInfo.data === null)) {\n _context.next = 7;\n break;\n }\n _context.next = 6;\n return store.apiCall(fileInfo.current.links('content'));\n case 6:\n rx = _context.sent;\n _r = rx.items();\n fileInfo.data = _r;\n return _context.abrupt(\"return\", _r);\n case 7:\n return _context.abrupt(\"return\", fileInfo.data);\n case 8:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeFileContent.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeFileContent);\n\n//# sourceURL=webpack://restaflib/./computeFileContent.js?\n}");
|
|
416
416
|
|
|
417
417
|
/***/ }),
|
|
418
418
|
|
|
@@ -423,7 +423,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
423
423
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
424
424
|
|
|
425
425
|
"use strict";
|
|
426
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
426
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @description Return Log|listing|ODS|list of tables in the compute service job\n * @async\n * @module computeResults\n * @category restaflib/compute\n * @param {object} store - restaf store\n * @param {object} computeSummary - computeSummary object\n * @param {string} type - type of result( log|listing|ods|table)\n * @returns {object|string} - string for all except table(array of names)\n */\nfunction computeResults(_x, _x2, _x3) {\n return _computeResults.apply(this, arguments);\n}\nfunction _computeResults() {\n _computeResults = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, computeSummary, type) {\n var log, result, next, _result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(type === 'log' || type === 'listing')) {\n _context.next = 7;\n break;\n }\n log = [];\n if (!(computeSummary[type] !== null)) {\n _context.next = 5;\n break;\n }\n _context.next = 1;\n return store.apiCall(computeSummary[type]);\n case 1:\n result = _context.sent;\n log = log.concat(result.items().toJS());\n case 2:\n if (!((next = result.scrollCmds('next')) !== null)) {\n _context.next = 4;\n break;\n }\n _context.next = 3;\n return store.apiCall(next);\n case 3:\n result = _context.sent;\n log = log.concat(result.items().toJS());\n _context.next = 2;\n break;\n case 4:\n _context.next = 6;\n break;\n case 5:\n log[0] = \"Note: No \".concat(type);\n case 6:\n return _context.abrupt(\"return\", log);\n case 7:\n if (!(type === 'ods')) {\n _context.next = 11;\n break;\n }\n if (!(computeSummary.ods !== null)) {\n _context.next = 9;\n break;\n }\n _context.next = 8;\n return store.apiCall(computeSummary.ods);\n case 8:\n _result = _context.sent;\n return _context.abrupt(\"return\", _result.items());\n case 9:\n return _context.abrupt(\"return\", '<h2> No ODS output </h2>');\n case 10:\n _context.next = 14;\n break;\n case 11:\n if (!(type === 'tables')) {\n _context.next = 12;\n break;\n }\n return _context.abrupt(\"return\", Object.keys(computeSummary.tables));\n case 12:\n if (!(type === 'files')) {\n _context.next = 13;\n break;\n }\n return _context.abrupt(\"return\", Object.keys(computeSummary.files));\n case 13:\n throw \"Error: Invalid type \".concat(type);\n case 14:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeResults.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeResults);\n\n//# sourceURL=webpack://restaflib/./computeResults.js?\n}");
|
|
427
427
|
|
|
428
428
|
/***/ }),
|
|
429
429
|
|
|
@@ -434,7 +434,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
434
434
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
435
435
|
|
|
436
436
|
"use strict";
|
|
437
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _computeRunBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeRunBase */ \"./computeRunBase.js\");\n/*\
|
|
437
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _computeRunBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeRunBase */ \"./computeRunBase.js\");\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * @member compute\n * @description Prepare data for runCompute(@async)\n * @async\n * @module computeRun\n * @category restaflib/compute\n * \n * @param {store} store - restaf store\n * @param {rafObject} session - current compute service session\n * @param {string} src - code to execute\n * @param {object=} macros - macros as a json\n * @param {number=} timeout - long polling timeout in seconds\n * @param {function=} checkStatus - callback to check on status\n * @param {object=} userContext - this is passed to the statusHandler \n * @returns {promise} computeSummary object. Job Status is computeSummary.SASJobStatus\n * @example\n * The job status will be one of these completed|warning|error|failed\n * Typical call:\n * let computeSummary = await computeRun(store,computeSession, src, args);\n * \n * Advanced call: If you want to track the job status pass a checkStatus function with some context\n \n const checkStatus = (state, context) => {\n console.log('state', state);\n console.log('context ', context);\n // do something useful - like in an UI display status for user\n \n // To stop waiting on job completion return a state value like 'exit' or any string\n // the value has to be something other than the state passed in.\n // this will force the code to stop waiting on the server and return to the app.\n // It is upto your app to take appropriate actions(like cancelling the job)\n // Below is a trivial example\n context.counter = context.counter + 1;\n\t\tif (state === 'running' && context.counter > 5) {\n\t\t\tcontext.realState = state;\n\t\t\tstate = 'exit';\n }\n return state;\n } // return true if you want to stop waiting on the job. Does not cancel the job\n \n===============================================\n\n* A simple example\n\n async function runtest(store, logonPayload) {\n let computeSession = await restaflib.computeSetup(store, null, logonPayload);\n let macros = {\n data: 'sashelp.cars'\n };\n let src = `\n ods html style=barrettsblue; \n proc print data=&data;run;\n ods html close; \n run;\n `;\n \n let computeSummary = await restaflib.computeRun(\n store,\n computeSession,\n src,\n macros\n );\n console.log('Job Status: ', computeSummary.SASJobStatus);\n\n let log = await restaflib.computeResults(store, computeSummary, \"log\");\n let ods = await restaflib.computeResults(store, computeSummary, \"ods\");\n return 'done';\n\n }\n\n */\n\n\n\nfunction computeRun(_x, _x2, _x3, _x4, _x5, _x6, _x7) {\n return _computeRun.apply(this, arguments);\n}\nfunction _computeRun() {\n _computeRun = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, src, macros, timeout, checkStatus, userContext) {\n var code, arg, c, asrc, resultSummary;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n // adjust for backward compatability\n if (typeof checkStatus === 'number') {\n checkStatus = null;\n }\n\n // generate macro variables\n code = ['options NOSYNTAXCHECK OBS=MAX;%let syscc=0;'];\n if (macros != null) {\n for (arg in macros) {\n c = \"%let \".concat(arg, \"=\").concat(macros[arg], \";\");\n code.push(c);\n }\n }\n\n // Concat macro to code\n asrc = src.replace(/\\t/g, ' ');\n asrc = asrc.split(/\\r?\\n/);\n code = code.concat(asrc).concat(';');\n\n // run code and get results\n _context.next = 1;\n return (0,_computeRunBase__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, code, timeout, checkStatus, userContext);\n case 1:\n resultSummary = _context.sent;\n return _context.abrupt(\"return\", resultSummary);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeRun.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeRun);\n\n//# sourceURL=webpack://restaflib/./computeRun.js?\n}");
|
|
438
438
|
|
|
439
439
|
/***/ }),
|
|
440
440
|
|
|
@@ -445,7 +445,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
445
445
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
446
446
|
|
|
447
447
|
"use strict";
|
|
448
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
448
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n/**\n * @description Reduce compute service execution results\n * @private\n * @async\n * @module computeRunBase\n * \n * @param {object} store - restaf store\n * @param {object} session - compute service session\n * @param {code} code - SAS code to be executed\n * @param {int} timeout optional - timeout for long poll in seconds(default= 5)\n\n * \n * @returns {object} computeSummary Object\n * \n */\nfunction computeRunBase(_x, _x2, _x3, _x4, _x5, _x6) {\n return _computeRunBase.apply(this, arguments);\n}\nfunction _computeRunBase() {\n _computeRunBase = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, code, timeout, eventHandler, userContext) {\n var payload, job, p, status, results;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n payload = {\n data: {\n code: code\n }\n }; // Now execute the data step and wait for completion\n // clear bad state if any\n _context.next = 1;\n return store.apiCall(session.links('execute'), payload);\n case 1:\n job = _context.sent;\n p = {\n qs: {\n wait: timeout != null ? timeout : 5\n },\n headers: {\n \"If-None-Match\": job.headers('etag')\n }\n };\n _context.next = 2;\n return store.jobState(job, p, 'longpoll', 0, eventHandler, userContext);\n case 2:\n status = _context.sent;\n _context.next = 3;\n return (0,_computeSummary__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, status.job);\n case 3:\n results = _context.sent;\n results.SASJobStatus = status.data;\n results.jobStateStatus = status;\n return _context.abrupt(\"return\", results);\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeRunBase.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeRunBase);\n\n//# sourceURL=webpack://restaflib/./computeRunBase.js?\n}");
|
|
449
449
|
|
|
450
450
|
/***/ }),
|
|
451
451
|
|
|
@@ -456,7 +456,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
456
456
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
457
457
|
|
|
458
458
|
"use strict";
|
|
459
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
459
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * @description Setup access to compute service\n * @async\n * @module computeSetup\n * @category restaflib/compute\n * \n * @param {store} store - restaf store\n * @param {string=} contextName name of the context. If not specified defaults to Job Execution context\n * @param {logonPayload=} payload logon payload.If null assumes that logon was done earlier.\n * @param {sessionPayload=} sessionPayload for createSession call\n * @param {string=} sessionID id of a session to attach\n * @returns {promise} - returns a compute session\n */\n\n\n\nfunction computeSetup(_x, _x2, _x3, _x4, _x5) {\n return _computeSetup.apply(this, arguments);\n}\nfunction _computeSetup() {\n _computeSetup = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, contextName, payload, sessionPayload, sessionID) {\n var msg, _yield$store$addServi, compute, session, _p, sessionList, index, selfcmd, p, contexts, name, createSession, _t;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(sessionID != null && _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(sessionID) === 'object')) {\n _context.next = 1;\n break;\n }\n return _context.abrupt(\"return\", sessionID);\n case 1:\n if (!(payload != null)) {\n _context.next = 3;\n break;\n }\n _context.next = 2;\n return store.logon(payload);\n case 2:\n msg = _context.sent;\n case 3:\n _context.next = 4;\n return store.addServices('compute');\n case 4:\n _yield$store$addServi = _context.sent;\n compute = _yield$store$addServi.compute;\n // Not PUP\n session = null; // Use user specified session\n if (!(sessionID != null)) {\n _context.next = 8;\n break;\n }\n _p = {\n start: 0,\n limit: 100,\n qs: {\n filter: \"eq(id,'\".concat(sessionID, \"')\")\n }\n };\n _context.next = 5;\n return store.apiCall(compute.links('sessions'), _p);\n case 5:\n sessionList = _context.sent;\n index = sessionList.itemsList().toJS().indexOf(sessionID);\n if (!(index < 0)) {\n _context.next = 6;\n break;\n }\n throw \"ERROR: The sessionID \".concat(sessionID, \" was not found.\");\n case 6:\n selfcmd = sessionList.itemsCmd(sessionList.itemsList(index), \"self\");\n _context.next = 7;\n return store.apiCall(selfcmd);\n case 7:\n session = _context.sent;\n return _context.abrupt(\"return\", session);\n case 8:\n if (!(store.store.config.options.computeServerId != null)) {\n _context.next = 10;\n break;\n }\n console.log('NOTE: Detected Workbench');\n _context.next = 9;\n return store.apiCall(compute.links('createSession'));\n case 9:\n session = _context.sent;\n return _context.abrupt(\"return\", session);\n case 10:\n // create a session - most common case\n\n if (contextName == null) {\n contextName = 'SAS Job Execution compute context';\n }\n p = {\n qs: {\n filter: \"contains(name,'\".concat(contextName, \"')\")\n }\n };\n contexts = null;\n _context.prev = 11;\n _context.next = 12;\n return store.apiCall(compute.links(\"contexts\"), p);\n case 12:\n contexts = _context.sent;\n if (!(contexts.itemsList().size === 0)) {\n _context.next = 13;\n break;\n }\n throw \"Context \".concat(contextName, \" not found\");\n case 13:\n _context.next = 15;\n break;\n case 14:\n _context.prev = 14;\n _t = _context[\"catch\"](11);\n console.error('Error: Not able to get context');\n throw _t;\n case 15:\n name = contexts.itemsList(0);\n if (!(sessionID == null)) {\n _context.next = 17;\n break;\n }\n p = sessionPayload == null ? null : sessionPayload;\n createSession = contexts.itemsCmd(name, 'createSession');\n _context.next = 16;\n return store.apiCall(createSession, sessionPayload);\n case 16:\n session = _context.sent;\n case 17:\n return _context.abrupt(\"return\", session);\n case 18:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[11, 14]]);\n }));\n return _computeSetup.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeSetup);\n\n//# sourceURL=webpack://restaflib/./computeSetup.js?\n}");
|
|
460
460
|
|
|
461
461
|
/***/ }),
|
|
462
462
|
|
|
@@ -467,7 +467,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
467
467
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
468
468
|
|
|
469
469
|
"use strict";
|
|
470
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
470
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n\n\n/**\n * @description Setup access to compute service\n * @async\n * @private\n * @module computeSetup\n * @category restaflib/compute\n * \n * @param {store} store - restaf store\n * @param {session} SAS compute Session\n * @param {tables} tables Tables to be setup{libref:xx,name:xxx} or array of this object \n * @param {string} preamble SAS code to execute before setup\n * @returns {promise} - returns a compute summary \n */\nfunction computeSetupTables(_x, _x2, _x3, _x4) {\n return _computeSetupTables.apply(this, arguments);\n}\nfunction _computeSetupTables() {\n _computeSetupTables = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, tables, preamble) {\n var result, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(preamble != null)) {\n _context.next = 2;\n break;\n }\n _context.next = 1;\n return (0,_computeRun__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(store, session, preamble);\n case 1:\n result = _context.sent;\n if (!(result.SASJobStatus !== 'completed')) {\n _context.next = 2;\n break;\n }\n throw \"Error: Preamble failed with completion code of \".concat(result.SASJobStatus);\n case 2:\n _context.next = 3;\n return (0,_computeSummary__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, null, tables);\n case 3:\n r = _context.sent;\n return _context.abrupt(\"return\", r);\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeSetupTables.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeSetupTables);\n\n//# sourceURL=webpack://restaflib/./computeSetupTables.js?\n}");
|
|
471
471
|
|
|
472
472
|
/***/ }),
|
|
473
473
|
|
|
@@ -478,7 +478,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
478
478
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
479
479
|
|
|
480
480
|
"use strict";
|
|
481
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
481
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n/**\n * @description Reduce the job information into consummable form(async)\n * \n * @async\n * @module computeSummary\n * @category restaflib/compute\n * \n * @param {store} store - restaf store\n * @param {rafObject} session - compute Session\n * @param {rafObject} job - rafObject representing the compute service job after job completion\n * @param {object|Array=} tables (see computeSetupTables)\n * @returns {promise} - the computeSummary object for easy handling of logs,listing,ods, tables\n * \n */\nfunction computeSummary(_x, _x2, _x3, _x4) {\n return _computeSummary.apply(this, arguments);\n}\nfunction _computeSummary() {\n _computeSummary = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, session, job, tables) {\n var result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(job != null && tables == null)) {\n _context.next = 2;\n break;\n }\n _context.next = 1;\n return jobResults(store, session, job);\n case 1:\n result = _context.sent;\n _context.next = 4;\n break;\n case 2:\n _context.next = 3;\n return isetupTable(store, session, tables);\n case 3:\n result = _context.sent;\n case 4:\n return _context.abrupt(\"return\", result);\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeSummary.apply(this, arguments);\n}\nfunction jobResults(_x5, _x6, _x7) {\n return _jobResults.apply(this, arguments);\n}\nfunction _jobResults() {\n _jobResults = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2(store, session, job) {\n var cResult, reportLink, results, size, i, resultItem, type, r, _r, _r2;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n cResult = {\n session: session,\n log: null,\n listing: null,\n ods: null,\n job: 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 if (!(reportLink !== null)) {\n _context2.next = 2;\n break;\n }\n _context2.next = 1;\n return store.apiCall(reportLink);\n case 1:\n results = _context2.sent;\n size = results.itemsList().size;\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 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 case 2:\n return _context2.abrupt(\"return\", cResult);\n case 3:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _jobResults.apply(this, arguments);\n}\nfunction isetupTable(_x8, _x9, _x0) {\n return _isetupTable.apply(this, arguments);\n}\nfunction _isetupTable() {\n _isetupTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee3(store, session, tables) {\n var cResult, tableList, i, itable, libref, name, p, currentLibrefs, rlink, currentLibrefSelf, _tables, tname, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context3) {\n while (1) 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 case 1:\n if (!(i < tableList.length)) {\n _context3.next = 8;\n break;\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 = 2;\n return store.apiCall(session.links('librefs'), p);\n case 2:\n currentLibrefs = _context3.sent;\n if (!(currentLibrefs.itemsList().size === 0)) {\n _context3.next = 3;\n break;\n }\n throw \"ERROR: Libref \".concat(libref, \" not found\");\n case 3:\n // get the links for this libref\n rlink = currentLibrefs.itemsCmd(libref, 'self');\n _context3.next = 4;\n return store.apiCall(rlink);\n case 4:\n currentLibrefSelf = _context3.sent;\n // get the table\n p = {\n qs: {\n filter: \"eq(name,'\".concat(name, \"')\")\n }\n };\n _context3.next = 5;\n return store.apiCall(currentLibrefSelf.links('tables'), p);\n case 5:\n _tables = _context3.sent;\n if (!(_tables.itemsList().size === 0)) {\n _context3.next = 6;\n break;\n }\n throw \"ERROR: Table \".concat(name, \" not found\");\n case 6:\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 case 7:\n i++;\n _context3.next = 1;\n break;\n case 8:\n return _context3.abrupt(\"return\", cResult);\n case 9:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _isetupTable.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeSummary);\n\n//# sourceURL=webpack://restaflib/./computeSummary.js?\n}");
|
|
482
482
|
|
|
483
483
|
/***/ }),
|
|
484
484
|
|
|
@@ -489,7 +489,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
489
489
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
490
490
|
|
|
491
491
|
"use strict";
|
|
492
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
492
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * Copyright © 2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n* @description Update a record in a cas table\n* @async\n* @private\n* @module computeUpdateData\n* @category restaflib/cas\n* @param {store} store - store\n* @param {rafObject} session - cas session\n* @param {*} payload - {data,where,table}\n* @returns {promise} - return \n* @example\n* let inputs = restaflib.computeUpdateData(store, session, payload);\n* payload = { where: {key1: vale1, key2: value2,...},\n* data: {var1:value1, var2:value2,....},\n* table: {caslib: caslib, name: name}\n* Expects a single row\n*/\nfunction computeUpdateData(_x, _x2, _x3) {\n return _computeUpdateData.apply(this, arguments);\n}\nfunction _computeUpdateData() {\n _computeUpdateData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().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 return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) 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 for (k in data) {\n set = set + comma + k + '=' + value2String(data[k]);\n comma = ', ';\n }\n src = src + ' ' + set;\n swhere = ' WHERE ';\n andbit = ' ';\n if (typeof where === 'string') {\n swhere = swhere + where;\n } else {\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 = 1;\n return store.apiCall(session.links('execute'), p);\n case 1:\n job = _context.sent;\n qs = {\n qs: {\n newState: 'Completed',\n timeout: 1\n }\n }; // eslint-disable-next-line no-unused-vars\n _context.next = 2;\n return store.jobState(job, qs);\n case 2:\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 case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeUpdateData.apply(this, arguments);\n}\nfunction value2String(value) {\n var valueString;\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 return valueString;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeUpdateData);\n\n//# sourceURL=webpack://restaflib/./computeUpdateData.js?\n}");
|
|
493
493
|
|
|
494
494
|
/***/ }),
|
|
495
495
|
|
|
@@ -500,7 +500,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
500
500
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
501
501
|
|
|
502
502
|
"use strict";
|
|
503
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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\n\n/*\
|
|
503
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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\n\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n/**\n * @description upload different artifacts\n * @private\n * @async\n * @module computeUpload\n * @param {store} store \n * @param {rafobject} session compute session \n * @param {computeTable} table - name of table to be created\n * @param {object} data - rows of data objects\n * @param {object} columns columns\n * @returns {promise}\n */\nfunction computeUpload(_x, _x2, _x3, _x4, _x5) {\n return _computeUpload.apply(this, arguments);\n}\nfunction _computeUpload() {\n _computeUpload = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, table, csvArray, columns) {\n var src, l, inx, k, c, x;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n src = \"data \".concat(table.libref, \".\").concat(table.name, \"; INFILE datalines delimiter=',' ;\\n\");\n l = '';\n inx = 'INPUT ';\n for (k in columns) {\n c = columns[k];\n inx = inx + c.Column + ' ';\n if (c.Type === 'CHAR') {\n x = \" \".concat(c.Column, \" $ \").concat(c.length, \" \\n\");\n l = l + ' ' + x;\n }\n }\n if (l.length > 0) {\n l = 'LENGTH ' + l + ';\\n';\n }\n inx = inx + ';\\n';\n src = src + ';\\n' + l + inx + 'datalines;\\n' + csvArray + '\\n; run; proc print;run;\\n';\n _context.next = 1;\n return (0,_computeRun__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, src);\n case 1:\n return _context.abrupt(\"return\", {\n msg: 'done',\n statusCode: 0\n });\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeUpload.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeUpload);\n\n//# sourceURL=webpack://restaflib/./computeUpload.js?\n}");
|
|
504
504
|
|
|
505
505
|
/***/ }),
|
|
506
506
|
|
|
@@ -511,7 +511,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
511
511
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
512
512
|
|
|
513
513
|
"use strict";
|
|
514
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
514
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n/**\n * @description Search for a named report(async)\n * @async\n * @module findReport\n * @category restaflib/report\n * \n * @param {object} store - restaf store\n * @param {string} name - name of the VA report (null to get a list of all reports)\n * \n * @returns {object} - either null or rafObject for the report\n */\n\n\nfunction findReport(_x, _x2) {\n return _findReport.apply(this, arguments);\n}\nfunction _findReport() {\n _findReport = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, name) {\n var _yield$store$addServi, reports, payload, reportsList;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 1;\n return store.addServices('reports');\n case 1:\n _yield$store$addServi = _context.sent;\n reports = _yield$store$addServi.reports;\n console.log(reports);\n payload = null;\n if (name !== null) {\n payload = {\n qs: {\n filter: \"eq(name,'\".concat(name, \"')\")\n }\n };\n }\n // call the reports service\n console.log('-----------', reports.links('reports'));\n _context.next = 2;\n return store.apiCall(reports.links('reports'), payload);\n case 2:\n reportsList = _context.sent;\n return _context.abrupt(\"return\", reportsList.itemsList().size === 0 ? null : reportsList);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _findReport.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (findReport);\n\n//# sourceURL=webpack://restaflib/./findReport.js?\n}");
|
|
515
515
|
|
|
516
516
|
/***/ }),
|
|
517
517
|
|
|
@@ -522,7 +522,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
522
522
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
523
523
|
|
|
524
524
|
"use strict";
|
|
525
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _findReport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./findReport */ \"./findReport.js\");\n/*\
|
|
525
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _findReport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./findReport */ \"./findReport.js\");\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * @description Return the svg of the specified report(async)\n * \n * @module getReportImage\n * @category restaflib/report\n * @param {object} store - restaf store\n * @param {string} name - name of the report\n * \n * @returns {string} - the svg of the report\n * \n */\n\n\n\nfunction getReportImage(_x, _x2) {\n return _getReportImage.apply(this, arguments);\n}\nfunction _getReportImage() {\n _getReportImage = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, name) {\n var reportImages, reportsList, uri, data, p, job, status, image;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n reportImages = store.rafObject('reportImages');\n _context.next = 1;\n return (0,_findReport__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, name);\n case 1:\n reportsList = _context.sent;\n if (!(reportsList === null)) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\", \"\".concat(name, \" was not found\"));\n case 2:\n uri = reportsList.itemsCmd(reportsList.itemsList(0), 'self', 'link', 'uri');\n data = {\n reportUri: uri,\n sectionIndex: 0,\n layoutType: 'entireSection',\n size: \"400x400\"\n };\n p = {\n data: data\n };\n _context.next = 3;\n return store.apiCall(reportImages.links('createJob'), p);\n case 3:\n job = _context.sent;\n _context.next = 4;\n return store.jobState(job, {\n qs: {\n wait: 1.5\n }\n }, 10, 2);\n case 4:\n status = _context.sent;\n if (!(status.data !== 'completed')) {\n _context.next = 5;\n break;\n }\n return _context.abrupt(\"return\", \"Job failed \".concat(status.data));\n case 5:\n _context.next = 6;\n return store.apiCall(status.job.itemsCmd(status.job.itemsList(0), 'image'));\n case 6:\n image = _context.sent;\n return _context.abrupt(\"return\", image.items());\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _getReportImage.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getReportImage);\n\n//# sourceURL=webpack://restaflib/./getReportImage.js?\n}");
|
|
526
526
|
|
|
527
527
|
/***/ }),
|
|
528
528
|
|
|
@@ -533,7 +533,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
533
533
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
534
534
|
|
|
535
535
|
"use strict";
|
|
536
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _findReport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./findReport */ \"./findReport.js\");\n/*\
|
|
536
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _findReport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./findReport */ \"./findReport.js\");\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * @description Generate url for report(async)\n * @module getReportUri\n * @category restaflib/report\n * \n * @param {object} store - restaf store\n * @param {string} name - name of report\n * \n * @returns {promise} array of report's of the form {name: name, uri: uri} for the report(s)\n */\n\n\n\nfunction getReportUri(_x, _x2) {\n return _getReportUri.apply(this, arguments);\n}\nfunction _getReportUri() {\n _getReportUri = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, name) {\n var reportsList, e, result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 1;\n return (0,_findReport__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, name);\n case 1:\n reportsList = _context.sent;\n if (!(reportsList === null)) {\n _context.next = 2;\n break;\n }\n e = name == null ? 'No reports were found' : \"\".concat(name, \" was not found\");\n throw e;\n case 2:\n result = [];\n reportsList.items().map(function (i, n) {\n var uri = {\n name: n,\n uri: reportsList.itemsCmd(n, 'self', 'link', 'uri')\n };\n result.push(uri);\n });\n return _context.abrupt(\"return\", result);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _getReportUri.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getReportUri);\n\n//# sourceURL=webpack://restaflib/./getReportUri.js?\n}");
|
|
537
537
|
|
|
538
538
|
/***/ }),
|
|
539
539
|
|
|
@@ -544,7 +544,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
544
544
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
545
545
|
|
|
546
546
|
"use strict";
|
|
547
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
547
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n//\n// Notes: Retrieve a SAS table and convert to a json\n// convert table to object of the form [{var1: value, var2: value,...},....]\n// ex: [{merlot:10, twobit:20}, {merlot: 20, twobit:30}]\n\n\n\n/**\n * @description Convert table to object of the form [{var1: value, var2: value,...},....](async)\n * @async\n * @private\n * @module getSASTableRows\n * @category restaflib/compute\n * \n * @param {object} store - restaf store\n * @param {object} computeSummary - computeSummary\n * @param {string} tableName - name of the table\n * \n * @returns {promise} - get retrieved rows [{var1:value, var2:...}]\n */\n\n\nfunction getSasTableRows(_x, _x2, _x3) {\n return _getSasTableRows.apply(this, arguments);\n}\nfunction _getSasTableRows() {\n _getSasTableRows = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee2(store, computeSummary, tableName) {\n var tableSelf, t1, table, columns, rows, result, count, _loop, i;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n tableSelf = computeSummary.tables[tableName];\n _context2.next = 1;\n return store.apiCall(tableSelf);\n case 1:\n t1 = _context2.sent;\n _context2.next = 2;\n return store.apiCall(t1.links('rowSet'));\n case 2:\n table = _context2.sent;\n columns = table.items('columns');\n rows = table.items('rows');\n result = [];\n count = rows.size;\n _loop = /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee() {\n var row, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n row = rows.get(i);\n r = {};\n columns.map(function (c, i) {\n var varx = c.toLowerCase();\n r[varx] = row.get(i);\n });\n result.push(r);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n });\n i = 0;\n case 3:\n if (!(i < count)) {\n _context2.next = 5;\n break;\n }\n return _context2.delegateYield(_loop(), \"t0\", 4);\n case 4:\n i++;\n _context2.next = 3;\n break;\n case 5:\n return _context2.abrupt(\"return\", result);\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _getSasTableRows.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getSasTableRows);\n\n//# sourceURL=webpack://restaflib/./getSasTableRows.js?\n}");
|
|
548
548
|
|
|
549
549
|
/***/ }),
|
|
550
550
|
|
|
@@ -555,7 +555,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
555
555
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
556
556
|
|
|
557
557
|
"use strict";
|
|
558
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _sassoftware_restaflib_src_masAddModel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sassoftware/restaflib/src/masAddModel */ \"./masAddModel.js\");\n\n\n\n\n/*\
|
|
558
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _sassoftware_restaflib_src_masAddModel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @sassoftware/restaflib/src/masAddModel */ \"./masAddModel.js\");\n\n\n\n\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n/**\n * @private\n * @module getScoreStep\n * @category restaflib/mas\n * @param {*} store \n * @param {*} microanalyticScore \n * @param {*} name \n * @returns {promise}\n */\nfunction getScoreStep(_x, _x2, _x3) {\n return _getScoreStep.apply(this, arguments);\n}\nfunction _getScoreStep() {\n _getScoreStep = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, microanalyticScore, name) {\n var payload, modList, rafLink, allSteps, control;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n payload = {\n qs: {\n filter: \"eq(name,'\".concat(name.trim(), \"')\")\n }\n };\n _context.next = 1;\n return store.apiCall(microanalyticScore.links('modules'), payload);\n case 1:\n modList = _context.sent;\n if (!(modList.itemsList().size === 0)) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\", null);\n case 2:\n rafLink = modList.itemsCmd(name, 'steps');\n _context.next = 3;\n return store.apiCall(rafLink);\n case 3:\n allSteps = _context.sent;\n control = {\n name: name,\n stepsRafLink: allSteps,\n stepIds: modList.items(name, 'data', 'stepIds').toJS(),\n microanalyticScore: microanalyticScore\n };\n return _context.abrupt(\"return\", control);\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _getScoreStep.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getScoreStep);\n\n//# sourceURL=webpack://restaflib/./getScoreStep.js?\n}");
|
|
559
559
|
|
|
560
560
|
/***/ }),
|
|
561
561
|
|
|
@@ -566,7 +566,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
566
566
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
567
567
|
|
|
568
568
|
"use strict";
|
|
569
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ casActionRun: () => (/* reexport safe */ _casActionRun__WEBPACK_IMPORTED_MODULE_5__[\"default\"]),\n/* harmony export */ casAppendTable: () => (/* reexport safe */ _casAppendTable__WEBPACK_IMPORTED_MODULE_9__[\"default\"]),\n/* harmony export */ casFetchData: () => (/* reexport safe */ _casFetchData__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */ casFetchRows: () => (/* reexport safe */ _casFetchRows__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n/* harmony export */ casLoadTable: () => (/* reexport safe */ _casLoadTable__WEBPACK_IMPORTED_MODULE_13__[\"default\"]),\n/* harmony export */ casSaveTable: () => (/* reexport safe */ _casSaveTable__WEBPACK_IMPORTED_MODULE_12__[\"default\"]),\n/* harmony export */ casSetup: () => (/* reexport safe */ _casSetup__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */ casTableToJson: () => (/* reexport safe */ _casTableToJson__WEBPACK_IMPORTED_MODULE_10__[\"default\"]),\n/* harmony export */ casUpdateData: () => (/* reexport safe */ _casUpdateData__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n/* harmony export */ casUpload: () => (/* reexport safe */ _casUpload__WEBPACK_IMPORTED_MODULE_11__[\"default\"]),\n/* harmony export */ caslDescribe: () => (/* reexport safe */ _caslDescribe__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ caslRun: () => (/* reexport safe */ _caslRun__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ caslRunBase: () => (/* reexport safe */ _caslRunBase__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ caslScore: () => (/* reexport safe */ _caslScore__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ computeAppendTable: () => (/* reexport safe */ _computeAppendTable__WEBPACK_IMPORTED_MODULE_21__[\"default\"]),\n/* harmony export */ computeFetchData: () => (/* reexport safe */ _computeFetchData__WEBPACK_IMPORTED_MODULE_19__[\"default\"]),\n/* harmony export */ computeFileContent: () => (/* reexport safe */ _computeFileContent__WEBPACK_IMPORTED_MODULE_20__[\"default\"]),\n/* harmony export */ computeResults: () => (/* reexport safe */ _computeResults__WEBPACK_IMPORTED_MODULE_18__[\"default\"]),\n/* harmony export */ computeRun: () => (/* reexport safe */ _computeRun__WEBPACK_IMPORTED_MODULE_14__[\"default\"]),\n/* harmony export */ computeSetup: () => (/* reexport safe */ _computeSetup__WEBPACK_IMPORTED_MODULE_15__[\"default\"]),\n/* harmony export */ computeSetupTables: () => (/* reexport safe */ _computeSetupTables__WEBPACK_IMPORTED_MODULE_17__[\"default\"]),\n/* harmony export */ computeSummary: () => (/* reexport safe */ _computeSummary__WEBPACK_IMPORTED_MODULE_16__[\"default\"]),\n/* harmony export */ computeUpdateData: () => (/* reexport safe */ _computeUpdateData__WEBPACK_IMPORTED_MODULE_22__[\"default\"]),\n/* harmony export */ computeUpload: () => (/* reexport safe */ _computeUpload__WEBPACK_IMPORTED_MODULE_23__[\"default\"]),\n/* harmony export */ findReport: () => (/* reexport safe */ _findReport__WEBPACK_IMPORTED_MODULE_24__[\"default\"]),\n/* harmony export */ getReportImage: () => (/* reexport safe */ _getReportImage__WEBPACK_IMPORTED_MODULE_25__[\"default\"]),\n/* harmony export */ getReportUri: () => (/* reexport safe */ _getReportUri__WEBPACK_IMPORTED_MODULE_26__[\"default\"]),\n/* harmony export */ getSasTableRows: () => (/* reexport safe */ _getSasTableRows__WEBPACK_IMPORTED_MODULE_27__[\"default\"]),\n/* harmony export */ jesRun: () => (/* reexport safe */ _jesRun__WEBPACK_IMPORTED_MODULE_29__[\"default\"]),\n/* harmony export */ jesSetup: () => (/* reexport safe */ _jesSetup__WEBPACK_IMPORTED_MODULE_28__[\"default\"]),\n/* harmony export */ jesSummary: () => (/* reexport safe */ _jesSummary__WEBPACK_IMPORTED_MODULE_30__[\"default\"]),\n/* harmony export */ jsonToDict: () => (/* reexport safe */ _jsonToDict__WEBPACK_IMPORTED_MODULE_31__[\"default\"]),\n/* harmony export */ lib: () => (/* binding */ lib),\n/* harmony export */ masAddModel: () => (/* reexport safe */ _masAddModel__WEBPACK_IMPORTED_MODULE_36__[\"default\"]),\n/* harmony export */ masDescribe: () => (/* reexport safe */ _masDescribe__WEBPACK_IMPORTED_MODULE_33__[\"default\"]),\n/* harmony export */ masRun: () => (/* reexport safe */ _masRun__WEBPACK_IMPORTED_MODULE_34__[\"default\"]),\n/* harmony export */ masScore: () => (/* reexport safe */ _masScore__WEBPACK_IMPORTED_MODULE_35__[\"default\"]),\n/* harmony export */ masSetup: () => (/* reexport safe */ _masSetup__WEBPACK_IMPORTED_MODULE_32__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _caslRun__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./caslRun */ \"./caslRun.js\");\n/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _caslScore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslScore */ \"./caslScore.js\");\n/* harmony import */ var _caslDescribe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslDescribe */ \"./caslDescribe.js\");\n/* harmony import */ var _casSetup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casSetup */ \"./casSetup.js\");\n/* harmony import */ var _casActionRun__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./casActionRun */ \"./casActionRun.js\");\n/* harmony import */ var _casFetchData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./casFetchData */ \"./casFetchData.js\");\n/* harmony import */ var _casFetchRows__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./casFetchRows */ \"./casFetchRows.js\");\n/* harmony import */ var _casUpdateData__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./casUpdateData */ \"./casUpdateData.js\");\n/* harmony import */ var _casAppendTable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./casAppendTable */ \"./casAppendTable.js\");\n/* harmony import */ var _casTableToJson__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./casTableToJson */ \"./casTableToJson.js\");\n/* harmony import */ var _casUpload__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./casUpload */ \"./casUpload.js\");\n/* harmony import */ var _casSaveTable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./casSaveTable */ \"./casSaveTable.js\");\n/* harmony import */ var _casLoadTable__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./casLoadTable */ \"./casLoadTable.js\");\n/* harmony import */ var _computeRun__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./computeRun */ \"./computeRun.js\");\n/* harmony import */ var _computeSetup__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./computeSetup */ \"./computeSetup.js\");\n/* harmony import */ var _computeSummary__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./computeSummary */ \"./computeSummary.js\");\n/* harmony import */ var _computeSetupTables__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./computeSetupTables */ \"./computeSetupTables.js\");\n/* harmony import */ var _computeResults__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./computeResults */ \"./computeResults.js\");\n/* harmony import */ var _computeFetchData__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./computeFetchData */ \"./computeFetchData.js\");\n/* harmony import */ var _computeFileContent__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./computeFileContent */ \"./computeFileContent.js\");\n/* harmony import */ var _computeAppendTable__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./computeAppendTable */ \"./computeAppendTable.js\");\n/* harmony import */ var _computeUpdateData__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./computeUpdateData */ \"./computeUpdateData.js\");\n/* harmony import */ var _computeUpload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./computeUpload */ \"./computeUpload.js\");\n/* harmony import */ var _findReport__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./findReport */ \"./findReport.js\");\n/* harmony import */ var _getReportImage__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./getReportImage */ \"./getReportImage.js\");\n/* harmony import */ var _getReportUri__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./getReportUri */ \"./getReportUri.js\");\n/* harmony import */ var _getSasTableRows__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./getSasTableRows */ \"./getSasTableRows.js\");\n/* harmony import */ var _jesSetup__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./jesSetup */ \"./jesSetup.js\");\n/* harmony import */ var _jesRun__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./jesRun */ \"./jesRun.js\");\n/* harmony import */ var _jesSummary__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./jesSummary */ \"./jesSummary.js\");\n/* harmony import */ var _jsonToDict__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./jsonToDict */ \"./jsonToDict.js\");\n/* harmony import */ var _masSetup__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./masSetup */ \"./masSetup.js\");\n/* harmony import */ var _masDescribe__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./masDescribe */ \"./masDescribe.js\");\n/* harmony import */ var _masRun__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./masRun */ \"./masRun.js\");\n/* harmony import */ var _masScore__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./masScore */ \"./masScore.js\");\n/* harmony import */ var _masAddModel__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./masAddModel */ \"./masAddModel.js\");\n/* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./lib */ \"./lib.js\");\n/*\r\n* Copyright © 2023, 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//import print from './print';\n\n//import uploadData from './uploadData';\n\n\nvar lib = (0,_lib__WEBPACK_IMPORTED_MODULE_37__[\"default\"])();\n\n\n//# sourceURL=webpack://restaflib/./index.js?\n}");
|
|
569
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ casActionRun: () => (/* reexport safe */ _casActionRun__WEBPACK_IMPORTED_MODULE_5__[\"default\"]),\n/* harmony export */ casAppendTable: () => (/* reexport safe */ _casAppendTable__WEBPACK_IMPORTED_MODULE_9__[\"default\"]),\n/* harmony export */ casFetchData: () => (/* reexport safe */ _casFetchData__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */ casFetchRows: () => (/* reexport safe */ _casFetchRows__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n/* harmony export */ casLoadTable: () => (/* reexport safe */ _casLoadTable__WEBPACK_IMPORTED_MODULE_13__[\"default\"]),\n/* harmony export */ casSaveTable: () => (/* reexport safe */ _casSaveTable__WEBPACK_IMPORTED_MODULE_12__[\"default\"]),\n/* harmony export */ casSetup: () => (/* reexport safe */ _casSetup__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */ casTableToJson: () => (/* reexport safe */ _casTableToJson__WEBPACK_IMPORTED_MODULE_10__[\"default\"]),\n/* harmony export */ casUpdateData: () => (/* reexport safe */ _casUpdateData__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n/* harmony export */ casUpload: () => (/* reexport safe */ _casUpload__WEBPACK_IMPORTED_MODULE_11__[\"default\"]),\n/* harmony export */ caslDescribe: () => (/* reexport safe */ _caslDescribe__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ caslRun: () => (/* reexport safe */ _caslRun__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ caslRunBase: () => (/* reexport safe */ _caslRunBase__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ caslScore: () => (/* reexport safe */ _caslScore__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ computeAppendTable: () => (/* reexport safe */ _computeAppendTable__WEBPACK_IMPORTED_MODULE_21__[\"default\"]),\n/* harmony export */ computeFetchData: () => (/* reexport safe */ _computeFetchData__WEBPACK_IMPORTED_MODULE_19__[\"default\"]),\n/* harmony export */ computeFileContent: () => (/* reexport safe */ _computeFileContent__WEBPACK_IMPORTED_MODULE_20__[\"default\"]),\n/* harmony export */ computeResults: () => (/* reexport safe */ _computeResults__WEBPACK_IMPORTED_MODULE_18__[\"default\"]),\n/* harmony export */ computeRun: () => (/* reexport safe */ _computeRun__WEBPACK_IMPORTED_MODULE_14__[\"default\"]),\n/* harmony export */ computeSetup: () => (/* reexport safe */ _computeSetup__WEBPACK_IMPORTED_MODULE_15__[\"default\"]),\n/* harmony export */ computeSetupTables: () => (/* reexport safe */ _computeSetupTables__WEBPACK_IMPORTED_MODULE_17__[\"default\"]),\n/* harmony export */ computeSummary: () => (/* reexport safe */ _computeSummary__WEBPACK_IMPORTED_MODULE_16__[\"default\"]),\n/* harmony export */ computeUpdateData: () => (/* reexport safe */ _computeUpdateData__WEBPACK_IMPORTED_MODULE_22__[\"default\"]),\n/* harmony export */ computeUpload: () => (/* reexport safe */ _computeUpload__WEBPACK_IMPORTED_MODULE_23__[\"default\"]),\n/* harmony export */ findReport: () => (/* reexport safe */ _findReport__WEBPACK_IMPORTED_MODULE_24__[\"default\"]),\n/* harmony export */ getReportImage: () => (/* reexport safe */ _getReportImage__WEBPACK_IMPORTED_MODULE_25__[\"default\"]),\n/* harmony export */ getReportUri: () => (/* reexport safe */ _getReportUri__WEBPACK_IMPORTED_MODULE_26__[\"default\"]),\n/* harmony export */ getSasTableRows: () => (/* reexport safe */ _getSasTableRows__WEBPACK_IMPORTED_MODULE_27__[\"default\"]),\n/* harmony export */ jesRun: () => (/* reexport safe */ _jesRun__WEBPACK_IMPORTED_MODULE_28__[\"default\"]),\n/* harmony export */ jobRun: () => (/* reexport safe */ _jobRun__WEBPACK_IMPORTED_MODULE_29__[\"default\"]),\n/* harmony export */ jsonToDict: () => (/* reexport safe */ _jsonToDict__WEBPACK_IMPORTED_MODULE_30__[\"default\"]),\n/* harmony export */ lib: () => (/* binding */ lib),\n/* harmony export */ masAddModel: () => (/* reexport safe */ _masAddModel__WEBPACK_IMPORTED_MODULE_35__[\"default\"]),\n/* harmony export */ masDescribe: () => (/* reexport safe */ _masDescribe__WEBPACK_IMPORTED_MODULE_32__[\"default\"]),\n/* harmony export */ masRun: () => (/* reexport safe */ _masRun__WEBPACK_IMPORTED_MODULE_33__[\"default\"]),\n/* harmony export */ masScore: () => (/* reexport safe */ _masScore__WEBPACK_IMPORTED_MODULE_34__[\"default\"]),\n/* harmony export */ masSetup: () => (/* reexport safe */ _masSetup__WEBPACK_IMPORTED_MODULE_31__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _caslRun__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./caslRun */ \"./caslRun.js\");\n/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _caslScore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslScore */ \"./caslScore.js\");\n/* harmony import */ var _caslDescribe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslDescribe */ \"./caslDescribe.js\");\n/* harmony import */ var _casSetup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casSetup */ \"./casSetup.js\");\n/* harmony import */ var _casActionRun__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./casActionRun */ \"./casActionRun.js\");\n/* harmony import */ var _casFetchData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./casFetchData */ \"./casFetchData.js\");\n/* harmony import */ var _casFetchRows__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./casFetchRows */ \"./casFetchRows.js\");\n/* harmony import */ var _casUpdateData__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./casUpdateData */ \"./casUpdateData.js\");\n/* harmony import */ var _casAppendTable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./casAppendTable */ \"./casAppendTable.js\");\n/* harmony import */ var _casTableToJson__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./casTableToJson */ \"./casTableToJson.js\");\n/* harmony import */ var _casUpload__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./casUpload */ \"./casUpload.js\");\n/* harmony import */ var _casSaveTable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./casSaveTable */ \"./casSaveTable.js\");\n/* harmony import */ var _casLoadTable__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./casLoadTable */ \"./casLoadTable.js\");\n/* harmony import */ var _computeRun__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./computeRun */ \"./computeRun.js\");\n/* harmony import */ var _computeSetup__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./computeSetup */ \"./computeSetup.js\");\n/* harmony import */ var _computeSummary__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./computeSummary */ \"./computeSummary.js\");\n/* harmony import */ var _computeSetupTables__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./computeSetupTables */ \"./computeSetupTables.js\");\n/* harmony import */ var _computeResults__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./computeResults */ \"./computeResults.js\");\n/* harmony import */ var _computeFetchData__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./computeFetchData */ \"./computeFetchData.js\");\n/* harmony import */ var _computeFileContent__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./computeFileContent */ \"./computeFileContent.js\");\n/* harmony import */ var _computeAppendTable__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./computeAppendTable */ \"./computeAppendTable.js\");\n/* harmony import */ var _computeUpdateData__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./computeUpdateData */ \"./computeUpdateData.js\");\n/* harmony import */ var _computeUpload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./computeUpload */ \"./computeUpload.js\");\n/* harmony import */ var _findReport__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./findReport */ \"./findReport.js\");\n/* harmony import */ var _getReportImage__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./getReportImage */ \"./getReportImage.js\");\n/* harmony import */ var _getReportUri__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./getReportUri */ \"./getReportUri.js\");\n/* harmony import */ var _getSasTableRows__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./getSasTableRows */ \"./getSasTableRows.js\");\n/* harmony import */ var _jesRun__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./jesRun */ \"./jesRun.js\");\n/* harmony import */ var _jobRun__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./jobRun */ \"./jobRun.js\");\n/* harmony import */ var _jsonToDict__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./jsonToDict */ \"./jsonToDict.js\");\n/* harmony import */ var _masSetup__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./masSetup */ \"./masSetup.js\");\n/* harmony import */ var _masDescribe__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./masDescribe */ \"./masDescribe.js\");\n/* harmony import */ var _masRun__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./masRun */ \"./masRun.js\");\n/* harmony import */ var _masScore__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./masScore */ \"./masScore.js\");\n/* harmony import */ var _masAddModel__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./masAddModel */ \"./masAddModel.js\");\n/* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./lib */ \"./lib.js\");\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar lib = (0,_lib__WEBPACK_IMPORTED_MODULE_36__[\"default\"])();\n\n\n//# sourceURL=webpack://restaflib/./index.js?\n}");
|
|
570
570
|
|
|
571
571
|
/***/ }),
|
|
572
572
|
|
|
@@ -577,7 +577,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
577
577
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
578
578
|
|
|
579
579
|
"use strict";
|
|
580
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var
|
|
580
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__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/* harmony import */ var _jesRunBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./jesRunBase */ \"./jesRunBase.js\");\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n\n/**\n * @description Prepare data for runCompute(@async)\n * @private\n * @module spBase\n * \n * @param {object} store - restaf store\n * @param {string jobDefinition - jogdefinition name\n * @param {object} args - arguments to pass to the job definition\n * \n * @returns {object} computeSummary object\n * \n */\nfunction jesRun(_x, _x2, _x3, _x4) {\n return _jesRun.apply(this, arguments);\n}\nfunction _jesRun() {\n _jesRun = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, jobDefinitionName, args, jobDef) {\n var jobDefinitionUri, argument, jobRequest, jobResult, _t;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(jobDef != null)) {\n _context.next = 1;\n break;\n }\n _t = jobDef;\n _context.next = 3;\n break;\n case 1:\n _context.next = 2;\n return jobDefUri(store, jobDefinitionName);\n case 2:\n _t = _context.sent;\n case 3:\n jobDefinitionUri = _t;\n // jobDefinition.type ='Compute';\n argument = _objectSpread(_objectSpread({}, args), {}, {\n _omitSessionResults: false,\n _resultfile: '*',\n _output_json: 'json'\n });\n jobRequest = {\n data: {\n jobDefinitionUri: jobDefinitionUri,\n arguments: argument\n }\n }; // run code and get results\n _context.next = 4;\n return (0,_jesRunBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(store, jobRequest);\n case 4:\n jobResult = _context.sent;\n return _context.abrupt(\"return\", jobResult);\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _jesRun.apply(this, arguments);\n}\nfunction jobDefUri(_x5, _x6) {\n return _jobDefUri.apply(this, arguments);\n}\nfunction _jobDefUri() {\n _jobDefUri = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2(store, name) {\n var _yield$store$addServi, jobDefinitions, uri, payload, rafLink, jdefList, _t2;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 1;\n return store.addServices('jobDefinitions');\n case 1:\n _yield$store$addServi = _context2.sent;\n jobDefinitions = _yield$store$addServi.jobDefinitions;\n uri = null;\n payload = {\n qs: {\n filter: \"eq(name,'\".concat(name, \"')\")\n }\n };\n rafLink = jobDefinitions.links('job-definitions');\n _context2.prev = 2;\n _context2.next = 3;\n return store.apiCall(rafLink, payload);\n case 3:\n jdefList = _context2.sent;\n if (!(jdefList.itemsList().size === 0)) {\n _context2.next = 4;\n break;\n }\n throw \"Error: \".concat(name, \" not found in the system\");\n case 4:\n uri = jdefList.itemsCmd(name, 'self', 'link', 'uri');\n case 5:\n return _context2.abrupt(\"return\", uri);\n case 6:\n _context2.prev = 6;\n _t2 = _context2[\"catch\"](2);\n throw \"Error: \".concat(name, \" not found in the system\");\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 6]]);\n }));\n return _jobDefUri.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (jesRun);\n\n//# sourceURL=webpack://restaflib/./jesRun.js?\n}");
|
|
581
581
|
|
|
582
582
|
/***/ }),
|
|
583
583
|
|
|
@@ -588,7 +588,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
588
588
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
589
589
|
|
|
590
590
|
"use strict";
|
|
591
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _jesSummary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jesSummary */ \"./jesSummary.js\");\n/*\
|
|
591
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _jesSummary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jesSummary */ \"./jesSummary.js\");\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n//\n// Notes: Run jobExecution service\n//\n/** \n * @description Reduce jobExecution service to an consummable form(async)\n * @private\n * @module jesRunBase\n * \n * @param {object} store - restaf store\n * @param {object} payload - payload for the jobExecution service\n * \n * @returns {promise} results from a sas jobExecution job in a consumable form\n * \n */\nfunction jesRunBase(_x, _x2) {\n return _jesRunBase.apply(this, arguments);\n}\nfunction _jesRunBase() {\n _jesRunBase = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, payload) {\n var _yield$store$addServi, jobExecution, job, status, results, _t;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 1;\n return store.addServices('jobExecution');\n case 1:\n _yield$store$addServi = _context.sent;\n jobExecution = _yield$store$addServi.jobExecution;\n _context.prev = 2;\n _context.next = 3;\n return store.apiCall(jobExecution.links('create'), payload);\n case 3:\n job = _context.sent;\n _context.next = 4;\n return store.jobState(job, null, 'wait', 2);\n case 4:\n status = _context.sent;\n if (!(status.data === 'running')) {\n _context.next = 5;\n break;\n }\n throw \"ERROR: Job did not complete in allotted time\";\n case 5:\n if (!(status.data === 'failed')) {\n _context.next = 6;\n break;\n }\n throw JSON.stringify(status);\n case 6:\n _context.next = 7;\n return (0,_jesSummary__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, status.job);\n case 7:\n results = _context.sent;\n results.status = status.data;\n case 8:\n _context.next = 10;\n break;\n case 9:\n _context.prev = 9;\n _t = _context[\"catch\"](2);\n throw \"Error: \".concat(_t);\n case 10:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[2, 9]]);\n }));\n return _jesRunBase.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (jesRunBase);\n\n//# sourceURL=webpack://restaflib/./jesRunBase.js?\n}");
|
|
592
592
|
|
|
593
593
|
/***/ }),
|
|
594
594
|
|
|
@@ -599,7 +599,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
599
599
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
600
600
|
|
|
601
601
|
"use strict";
|
|
602
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
602
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * @description Setup access to compute service\n * @async\n * @module jesSetup\n * @private\n * \n * @param {object} store - restaf store\n * @param {object} payload - logon payload - If null assumes that logon was done earlier.\n * \n * @returns {object} - returns a jobExecution raf object\n */\n\n\nfunction jesSetup(_x, _x2) {\n return _jesSetup.apply(this, arguments);\n}\nfunction _jesSetup() {\n _jesSetup = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, payload) {\n var services;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(payload != null)) {\n _context.next = 1;\n break;\n }\n _context.next = 1;\n return store.logon(payload);\n case 1:\n _context.next = 2;\n return store.addServices('jobExecution', 'compute', 'jobDefinitions');\n case 2:\n services = _context.sent;\n return _context.abrupt(\"return\", services.jobExecution);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _jesSetup.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (jesSetup);\n\n//# sourceURL=webpack://restaflib/./jesSetup.js?\n}");
|
|
603
603
|
|
|
604
604
|
/***/ }),
|
|
605
605
|
|
|
@@ -610,7 +610,18 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
610
610
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
611
611
|
|
|
612
612
|
"use strict";
|
|
613
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
613
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n/**\n * @description Reduce the job information into consummable form(async)\n * \n * @async\n * @module jesSummary\n * @category restaflib/jes\n * @private\n * @param {object} store - restaf store\n * @param {object} job - rafObject representing the compute service job\n * \n * @returns {promise} - the computeSummary object for easy handling of logs,listing,ods, tables\n */\nfunction jesSummary(_x, _x2) {\n return _jesSummary.apply(this, arguments);\n}\nfunction _jesSummary() {\n _jesSummary = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, job) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 1;\n return jobResults(store, job);\n case 1:\n return _context.abrupt(\"return\", _context.sent);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _jesSummary.apply(this, arguments);\n}\nfunction jobResults(_x3, _x4) {\n return _jobResults.apply(this, arguments);\n}\nfunction _jobResults() {\n _jobResults = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee3(store, job) {\n var items, cResult, p, table, key, pa, l, la, id, r, name, formatLog, getContent, _getContent, _t2, _t3;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _getContent = function _getContent3() {\n _getContent = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee2(store, key, id, table) {\n var _yield$store$addServi, files, payload, f, contentRaf, text, _items, _r, t, _t;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 1;\n return store.addServices(\"files\");\n case 1:\n _yield$store$addServi = _context2.sent;\n files = _yield$store$addServi.files;\n payload = {\n qs: {\n filter: \"eq(id,'\".concat(id, \"')\")\n }\n };\n _context2.prev = 2;\n _context2.next = 3;\n return store.apiCall(files.links(\"files\"), payload);\n case 3:\n f = _context2.sent;\n contentRaf = f.itemsCmd(f.itemsList(0), 'content');\n _context2.next = 4;\n return store.apiCall(contentRaf);\n case 4:\n text = _context2.sent;\n _items = text.items();\n if (!(typeof _items === 'string')) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt(\"return\", _items);\n case 5:\n _r = _items.toJS();\n if (!table) {\n _context2.next = 7;\n break;\n }\n t = [];\n if (!Array.isArray(_r)) {\n _context2.next = 6;\n break;\n }\n return _context2.abrupt(\"return\", _r);\n case 6:\n Object.values(_r).forEach(function (value) {\n t.push(value);\n });\n return _context2.abrupt(\"return\", t);\n case 7:\n _context2.next = 9;\n break;\n case 8:\n _context2.prev = 8;\n _t = _context2[\"catch\"](2);\n return _context2.abrupt(\"return\", null);\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 8]]);\n }));\n return _getContent.apply(this, arguments);\n };\n getContent = function _getContent2(_x5, _x6, _x7, _x8) {\n return _getContent.apply(this, arguments);\n };\n formatLog = function _formatLog(log) {\n if (log == null || Array.isArray(log) === false) return ' ';\n var logText = '';\n // eslint-disable-next-line array-callback-return\n log.map(function (data) {\n var line = data.line.replace(/(\\r\\n|\\n|\\r)/gm, \"\");\n if (line.length === 0) {\n logText = logText + '\\n';\n } else {\n logText = logText + line + '\\n';\n }\n });\n return logText;\n };\n items = job.items().toJS();\n cResult = {\n computeContext: items.results['COMPUTE_CONTEXT'],\n computeJob: items.results['COMPUTE_JOB'],\n computeSession: items.results['COMPUTE_SESSION'],\n session: job.session,\n log: null,\n listing: null,\n ods: null,\n job: job /*null*/,\n tables: {},\n files: {},\n results: items.results\n }; // extract fileid in the files service.\n _t2 = _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().keys(items.results);\n case 1:\n if ((_t3 = _t2()).done) {\n _context3.next = 5;\n break;\n }\n p = _t3.value;\n if (p === 'COMPUTE_CONTEXT' || p === 'COMPUTE_JOB' || p === 'COMPUTE_SESSION') {\n _context3.next = 4;\n break;\n }\n table = false;\n key = null;\n if (p.endsWith('.json')) {\n key = p;\n table = true;\n } else {\n pa = p.split('.');\n pa.shift();\n key = pa.join('.');\n }\n l = items.results[p];\n if (!(l === null)) {\n _context3.next = 2;\n break;\n }\n return _context3.abrupt(\"continue\", 1);\n case 2:\n la = l.split('/');\n id = la[la.length - 1];\n _context3.next = 3;\n return getContent(store, key, id, table);\n case 3:\n r = _context3.sent;\n if (table) {\n name = key.split('.json')[0];\n cResult.tables[name] = r;\n } else {\n cResult.files[key] = r;\n }\n case 4:\n _context3.next = 1;\n break;\n case 5:\n // now format log and listing\n cResult.log = formatLog(cResult.files['log']);\n cResult.listing = formatLog(cResult.files['listing']);\n return _context3.abrupt(\"return\", cResult);\n case 6:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _jobResults.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (jesSummary);\n\n//# sourceURL=webpack://restaflib/./jesSummary.js?\n}");
|
|
614
|
+
|
|
615
|
+
/***/ }),
|
|
616
|
+
|
|
617
|
+
/***/ "./jobRun.js":
|
|
618
|
+
/*!*******************!*\
|
|
619
|
+
!*** ./jobRun.js ***!
|
|
620
|
+
\*******************/
|
|
621
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
622
|
+
|
|
623
|
+
"use strict";
|
|
624
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__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/* harmony import */ var _jesSummary_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./jesSummary.js */ \"./jesSummary.js\");\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * @description Prepare data for runCompute(@async)\n * @private\n * @module jobRun\n * \n * @param {object} store - restaf store\n * @param {string} jobName - name of the job\n * @param {object} args - arguments to pass to the job definition\n * \n * @returns {promise} - returns scoring results\n * \n */\n\n\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n\nfunction jobRun(_x, _x2, _x3) {\n return _jobRun.apply(this, arguments);\n}\nfunction _jobRun() {\n _jobRun = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, jobName, args) {\n var _yield$store$addServi, jobExecution, payload, thisJob, id, argument, jobRequest, job1, status, results, _t;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 1;\n return store.addServices('jobExecution');\n case 1:\n _yield$store$addServi = _context.sent;\n jobExecution = _yield$store$addServi.jobExecution;\n payload = {\n qs: {\n filter: \"eq(name,'\".concat(jobName, \"')\")\n }\n };\n _context.prev = 2;\n _context.next = 3;\n return store.apiCall(jobExecution.links('jobs'), payload);\n case 3:\n thisJob = _context.sent;\n if (!(thisJob.itemsList().size === 0)) {\n _context.next = 4;\n break;\n }\n throw \"Error: \".concat(jobName, \" not found in the system\");\n case 4:\n id = thisJob.items(thisJob.itemsList(0), 'data', 'jobRequest', 'jobDefinition'); //setup job request payload\n argument = _objectSpread(_objectSpread({}, args), {}, {\n _omitSessionResults: false,\n _resultfile: '*',\n _output_json: 'json'\n });\n jobRequest = {\n data: {\n jobDefinition: id,\n arguments: argument\n }\n }; // use the submit job link to submit the job\n _context.next = 5;\n return store.apiCall(thisJob.links('submitJob'), jobRequest);\n case 5:\n job1 = _context.sent;\n _context.next = 6;\n return store.jobState(job1, null, 'wait', 2);\n case 6:\n status = _context.sent;\n if (!(status.data === 'running')) {\n _context.next = 7;\n break;\n }\n throw \"ERROR: Job did not complete in allotted time.\";\n case 7:\n if (!(status.data === 'failed')) {\n _context.next = 8;\n break;\n }\n throw \"ERROR: Job failed. See SAS Environment for details.\";\n case 8:\n _context.next = 9;\n return (0,_jesSummary_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(store, status.job);\n case 9:\n results = _context.sent;\n return _context.abrupt(\"return\", results);\n case 10:\n _context.next = 12;\n break;\n case 11:\n _context.prev = 11;\n _t = _context[\"catch\"](2);\n throw _t;\n case 12:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[2, 11]]);\n }));\n return _jobRun.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (jobRun);\n\n//# sourceURL=webpack://restaflib/./jobRun.js?\n}");
|
|
614
625
|
|
|
615
626
|
/***/ }),
|
|
616
627
|
|
|
@@ -621,7 +632,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
621
632
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
622
633
|
|
|
623
634
|
"use strict";
|
|
624
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
635
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * @description Produce a string with casl dictionary suitable for inclusion in casl code\n * \n * @module jsonToDict\n * @category restaflib/util\n * @param {object} obj - the JS object of interest\n * @param {string} name - the name to assign to the dictionary\n * \n * @returns {string} returns the string containing the casl dictionary\n * @alias module: jsonToDict\n * @example\n * \n * obj = {x: 1, b:2, c: ['a','b']};\n * name ='_appEnv_';\n * result is a string _appEnv_ = {x=2, b=3, c={\"a\", \"b\"}}\n */\n\nfunction jsonToDict(obj, name) {\n var o1;\n if (obj === null) {\n o1 = \"{}\";\n } else {\n o1 = Array.isArray(obj) === true ? handleArray(obj) : handleObject(obj);\n }\n return \"\".concat(name, \" = \").concat(o1, \";\");\n}\nfunction handleObject(obj) {\n var r = '{ ';\n var sep = ' ';\n for (var k in obj) {\n if (Array.isArray(obj[k]) === true) {\n var o = handleArray(obj[k]);\n r = r + sep + \"\".concat(k, \"=\") + o;\n } else {\n var type = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(obj[k]);\n if (type === 'object') {\n var _o = handleObject(obj[k]);\n r = r + sep + \"\".concat(k, \"=\") + _o;\n } else {\n r = r + sep + \"\".concat(k, \"=\") + (type === 'string' ? \" \\\"\".concat(obj[k], \"\\\" \") : \"\".concat(obj[k], \" \"));\n }\n }\n sep = ',';\n }\n r = r + '} ';\n return r;\n}\nfunction handleArray(obj) {\n var r = '{';\n var sep = ' ';\n var size = obj.length;\n for (var k = 0; k < size; k++) {\n if (Array.isArray(obj[k]) === true) {\n var o = handleArray(obj[k]);\n r = r + sep + \"\".concat(k, \"=\") + o;\n } else {\n var type = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(obj[k]);\n if (type === 'object') {\n var _o2 = handleObject(obj[k]);\n r = r + sep + _o2;\n } else {\n r = r + sep + (type === 'string' ? \" \\\"\".concat(obj[k], \"\\\" \") : \"\".concat(obj[k], \" \"));\n }\n sep = ',';\n }\n }\n r = r + '}';\n return r;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (jsonToDict);\n\n//# sourceURL=webpack://restaflib/./jsonToDict.js?\n}");
|
|
625
636
|
|
|
626
637
|
/***/ }),
|
|
627
638
|
|
|
@@ -632,7 +643,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
632
643
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
633
644
|
|
|
634
645
|
"use strict";
|
|
635
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _caslRun__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./caslRun */ \"./caslRun.js\");\n/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _caslScore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslScore */ \"./caslScore.js\");\n/* harmony import */ var _caslDescribe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslDescribe */ \"./caslDescribe.js\");\n/* harmony import */ var _casSetup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casSetup */ \"./casSetup.js\");\n/* harmony import */ var _casActionRun__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./casActionRun */ \"./casActionRun.js\");\n/* harmony import */ var _casFetchData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./casFetchData */ \"./casFetchData.js\");\n/* harmony import */ var _casUpdateData__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./casUpdateData */ \"./casUpdateData.js\");\n/* harmony import */ var _casTableToJson__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./casTableToJson */ \"./casTableToJson.js\");\n/* harmony import */ var _computeRun__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./computeRun */ \"./computeRun.js\");\n/* harmony import */ var _computeSetup__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./computeSetup */ \"./computeSetup.js\");\n/* harmony import */ var _computeSummary__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./computeSummary */ \"./computeSummary.js\");\n/* harmony import */ var _computeResults__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./computeResults */ \"./computeResults.js\");\n/* harmony import */ var _computeFetchData__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./computeFetchData */ \"./computeFetchData.js\");\n/* harmony import */ var _computeFileContent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./computeFileContent */ \"./computeFileContent.js\");\n/* harmony import */ var _findReport__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./findReport */ \"./findReport.js\");\n/* harmony import */ var _getReportImage__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./getReportImage */ \"./getReportImage.js\");\n/* harmony import */ var _getReportUri__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./getReportUri */ \"./getReportUri.js\");\n/* harmony import */ var _getSasTableRows__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./getSasTableRows */ \"./getSasTableRows.js\");\n/* harmony import */ var _jesSetup__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./jesSetup */ \"./jesSetup.js\");\n/* harmony import */ var _jesRun__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./jesRun */ \"./jesRun.js\");\n/* harmony import */ var _jesSummary__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./jesSummary */ \"./jesSummary.js\");\n/* harmony import */ var _jsonToDict__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./jsonToDict */ \"./jsonToDict.js\");\n/* harmony import */ var _masSetup__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./masSetup */ \"./masSetup.js\");\n/* harmony import */ var _masDescribe__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./masDescribe */ \"./masDescribe.js\");\n/* harmony import */ var _masRun__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./masRun */ \"./masRun.js\");\n/* harmony import */ var _masAddModel__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./masAddModel */ \"./masAddModel.js\");\n/*\
|
|
646
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _caslRun__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./caslRun */ \"./caslRun.js\");\n/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _caslScore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslScore */ \"./caslScore.js\");\n/* harmony import */ var _caslDescribe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslDescribe */ \"./caslDescribe.js\");\n/* harmony import */ var _casSetup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casSetup */ \"./casSetup.js\");\n/* harmony import */ var _casActionRun__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./casActionRun */ \"./casActionRun.js\");\n/* harmony import */ var _casFetchData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./casFetchData */ \"./casFetchData.js\");\n/* harmony import */ var _casUpdateData__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./casUpdateData */ \"./casUpdateData.js\");\n/* harmony import */ var _casTableToJson__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./casTableToJson */ \"./casTableToJson.js\");\n/* harmony import */ var _computeRun__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./computeRun */ \"./computeRun.js\");\n/* harmony import */ var _computeSetup__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./computeSetup */ \"./computeSetup.js\");\n/* harmony import */ var _computeSummary__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./computeSummary */ \"./computeSummary.js\");\n/* harmony import */ var _computeResults__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./computeResults */ \"./computeResults.js\");\n/* harmony import */ var _computeFetchData__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./computeFetchData */ \"./computeFetchData.js\");\n/* harmony import */ var _computeFileContent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./computeFileContent */ \"./computeFileContent.js\");\n/* harmony import */ var _findReport__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./findReport */ \"./findReport.js\");\n/* harmony import */ var _getReportImage__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./getReportImage */ \"./getReportImage.js\");\n/* harmony import */ var _getReportUri__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./getReportUri */ \"./getReportUri.js\");\n/* harmony import */ var _getSasTableRows__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./getSasTableRows */ \"./getSasTableRows.js\");\n/* harmony import */ var _jesSetup__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./jesSetup */ \"./jesSetup.js\");\n/* harmony import */ var _jesRun__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./jesRun */ \"./jesRun.js\");\n/* harmony import */ var _jesSummary__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./jesSummary */ \"./jesSummary.js\");\n/* harmony import */ var _jsonToDict__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./jsonToDict */ \"./jsonToDict.js\");\n/* harmony import */ var _masSetup__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./masSetup */ \"./masSetup.js\");\n/* harmony import */ var _masDescribe__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./masDescribe */ \"./masDescribe.js\");\n/* harmony import */ var _masRun__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./masRun */ \"./masRun.js\");\n/* harmony import */ var _masAddModel__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./masAddModel */ \"./masAddModel.js\");\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//import casUpload from './casUpload';\n//import uploadData from './uploadData';\n\nfunction lib() {\n return {\n caslRun: _caslRun__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n caslRunBase: _caslRunBase__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n casSetup: _casSetup__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n casActionRun: _casActionRun__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n // casTableToJson,\n casFetchData: _casFetchData__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n casUpdateData: _casUpdateData__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n computeRun: _computeRun__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n computeSetup: _computeSetup__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n computeSummary: _computeSummary__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n computeFetchData: _computeFetchData__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n computeFileContent: _computeFileContent__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n computeResults: _computeResults__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n findReport: _findReport__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n getReportImage: _getReportImage__WEBPACK_IMPORTED_MODULE_16__[\"default\"],\n getReportUri: _getReportUri__WEBPACK_IMPORTED_MODULE_17__[\"default\"],\n getSASTableRows: _getSasTableRows__WEBPACK_IMPORTED_MODULE_18__[\"default\"],\n jesSetup: _jesSetup__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n jesRun: _jesRun__WEBPACK_IMPORTED_MODULE_20__[\"default\"],\n jesSummary: _jesSummary__WEBPACK_IMPORTED_MODULE_21__[\"default\"],\n jsonToDict: _jsonToDict__WEBPACK_IMPORTED_MODULE_22__[\"default\"],\n casTableToJson: _casTableToJson__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n caslScore: _caslScore__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n caslDescribe: _caslDescribe__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n masSetup: _masSetup__WEBPACK_IMPORTED_MODULE_23__[\"default\"],\n masAddModel: _masAddModel__WEBPACK_IMPORTED_MODULE_26__[\"default\"],\n masDescribe: _masDescribe__WEBPACK_IMPORTED_MODULE_24__[\"default\"],\n masRun: _masRun__WEBPACK_IMPORTED_MODULE_25__[\"default\"]\n\n // casUpload : casUpload,\n // uploadData: uploadData\n };\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (lib);\n\n//# sourceURL=webpack://restaflib/./lib.js?\n}");
|
|
636
647
|
|
|
637
648
|
/***/ }),
|
|
638
649
|
|
|
@@ -643,7 +654,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
643
654
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
644
655
|
|
|
645
656
|
"use strict";
|
|
646
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _getScoreStep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getScoreStep */ \"./getScoreStep.js\");\n/*\
|
|
657
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _getScoreStep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getScoreStep */ \"./getScoreStep.js\");\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * setup access to MAS\n * @module masSetup\n * @category restaflib/mas\n * @param {object} store - restaf store\n * @param {object} masControl - control object from masSetup\n * @param {object} models - array of models to add\n * \n * @returns {object} - masControl used in masRun\n * @alias module: masSetup\n * @example \n * let masControl = await masSetup(store, ['modelA', 'modelB']);\n */\n\n\n\nfunction masAddModel(_x, _x2, _x3) {\n return _masAddModel.apply(this, arguments);\n}\nfunction _masAddModel() {\n _masAddModel = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, masControl, models) {\n var microanalyticScore, i, m, result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n microanalyticScore = masControl.service;\n i = 0;\n case 1:\n if (!(i < models.length)) {\n _context.next = 4;\n break;\n }\n m = models[i];\n if (!(masControl.steps[m] == null)) {\n _context.next = 3;\n break;\n }\n _context.next = 2;\n return (0,_getScoreStep__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, microanalyticScore, m);\n case 2:\n result = _context.sent;\n masControl.steps[m] = result;\n case 3:\n i++;\n _context.next = 1;\n break;\n case 4:\n return _context.abrupt(\"return\", true);\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _masAddModel.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (masAddModel);\n\n//# sourceURL=webpack://restaflib/./masAddModel.js?\n}");
|
|
647
658
|
|
|
648
659
|
/***/ }),
|
|
649
660
|
|
|
@@ -654,7 +665,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
654
665
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
655
666
|
|
|
656
667
|
"use strict";
|
|
657
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\
|
|
668
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Score using MAS\n * @module masDescribe\n * @category restaflib/mas\n * @param {object} masControl - object from masSetup\n * @param {string} modelName - name of model to be executed\n * @param {string} step - if not specified it will try to find score or execute\n * \n * @returns {object} - return input information\n * @alias module: masDescribe\n * @example\n * let inputs = restaflib.masDescribe(masControl, 'modela', 'score');\n */\nfunction masDescribe(masControl, modelName, step, all) {\n var stepControl = masControl.steps[modelName];\n if (stepControl === null) {\n return [];\n }\n var currentStep = null;\n if (step == null) {\n var stepIndex = stepControl.stepIds.findIndex(function (x) {\n return x === 'execute' || x === 'score';\n });\n if (stepIndex === -1) {\n return [];\n } else {\n currentStep = stepControl.stepIds[stepIndex];\n }\n var desc = stepControl.stepsRafLink.items(currentStep, 'data', 'inputs');\n var desco = stepControl.stepsRafLink.items(currentStep, 'data', 'outputs');\n if (desc === null) {\n return [];\n }\n var result = all === true ? {\n inputs: desc.toJS(),\n outputs: desco.toJS()\n } : desc.toJS();\n return result;\n } else {\n var _stepIndex = stepControl.stepIds.findIndex(function (x) {\n return x === step;\n });\n if (_stepIndex === -1) {\n return [];\n } else {\n currentStep = step;\n }\n var allSteps = stepControl.stepsRafLink.items(currentStep, 'data', 'inputs');\n var outputs = stepControl.stepsRafLink.items(currentStep, 'data', 'outputs');\n if (allSteps === null) {\n return [];\n }\n var _result = all === true ? {\n inputs: allSteps.toJS(),\n outputs: outputs.toJS()\n } : allSteps.toJS();\n return _result;\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (masDescribe);\n\n//# sourceURL=webpack://restaflib/./masDescribe.js?\n}");
|
|
658
669
|
|
|
659
670
|
/***/ }),
|
|
660
671
|
|
|
@@ -665,7 +676,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
665
676
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
666
677
|
|
|
667
678
|
"use strict";
|
|
668
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
679
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Score using MAS\n * @module masRun\n * @param {store} restaf store\n * @category restaflib/mas\n * @param {object} masControl - object from masSetup\n * @param {string} modelName - name of model to be executed\n * @param {object} scenario - can be [{name: var1, value: value1},{...} ] or {varname: value,...}\n * @param {string} stepName - if not specified it will default to score or execute\n * \n * @returns {promise} - returns scoring results\n * @alias module: masrun\n * @example\n * async function example (models, payload) {\n * await store.logon(payload);\n * let masControl = await restaflib.masSetup(store, models);\n * let defaults = {\n * prescriber_count : 1,\n * strength_per_unit: 15,\n * age : 74,\n * avg_opioid_prescriber_rate: 10.4,\n * doctorshop_med : 1,\n * max_avg_med_90 : 10,\n * max_mme_per_day: 40,\n * max_opioid_prescriber_rate: 13.21,\n * opioid_days: 3\n * };\n * let inp = restaflib.masDescribe(masControl, models[0], 'score');\n * print.object(inp, 'describe for score model');\n * inp = inp.map((n) => {\n * n.value = defaults[n.name];\n * return n;\n * });\n * print.object(inp, 'updated input for score model');\n * let result = await restaflib.masRun (store, masControl, models[0], inp, 'score');\n * print.object(result, 'scoring result');\n * }\n */\nfunction masRun(_x, _x2, _x3, _x4, _x5, _x6) {\n return _masRun.apply(this, arguments);\n}\nfunction _masRun() {\n _masRun = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, masControl, modelName, scenario, step, cmd) {\n var stepControl, inputIsArray, inputs, r, item, scorePayload, currentStep, stepIndex, _stepIndex, rafLink, t, result, outputs, score;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n stepControl = masControl.steps[modelName];\n inputIsArray = false;\n inputs = [];\n if (Array.isArray(scenario) === false) {\n for (r in scenario) {\n item = {\n name: r,\n value: scenario[r]\n };\n inputs.push(item);\n }\n } else {\n inputIsArray = true;\n }\n scorePayload = {\n data: {\n inputs: inputIsArray === true ? scenario : inputs\n }\n };\n currentStep = null; //TBD: Need to convert stepId from array to object for cleaner coding\n if (!(step == null)) {\n _context.next = 3;\n break;\n }\n stepIndex = stepControl.stepIds.findIndex(function (x) {\n return x === 'execute' || x === 'score';\n });\n if (!(stepIndex === -1)) {\n _context.next = 1;\n break;\n }\n return _context.abrupt(\"return\", []);\n case 1:\n currentStep = stepControl.stepIds[stepIndex];\n case 2:\n _context.next = 5;\n break;\n case 3:\n _stepIndex = stepControl.stepIds.findIndex(function (x) {\n return x === step;\n });\n if (!(_stepIndex === -1)) {\n _context.next = 4;\n break;\n }\n return _context.abrupt(\"return\", []);\n case 4:\n currentStep = step;\n case 5:\n if (cmd == null) {\n cmd = 'execute';\n }\n rafLink = stepControl.stepsRafLink.itemsCmd(currentStep, cmd);\n if (!(rafLink === null)) {\n _context.next = 6;\n break;\n }\n t = [{\n name: 'Error',\n type: 'string',\n value: \"name: \".concat(modelName, \" step: \").concat(step, \" operation: \").concat(cmd, \" is an invalid combination\")\n }];\n return _context.abrupt(\"return\", t);\n case 6:\n _context.next = 7;\n return store.apiCall(rafLink, scorePayload);\n case 7:\n result = _context.sent;\n outputs = result.items('outputs').toJS();\n if (inputIsArray === true) {\n score = outputs;\n } else {\n score = {};\n outputs.map(function (m) {\n score[m.name] = m.value;\n });\n }\n return _context.abrupt(\"return\", score);\n case 8:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _masRun.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (masRun);\n\n//# sourceURL=webpack://restaflib/./masRun.js?\n}");
|
|
669
680
|
|
|
670
681
|
/***/ }),
|
|
671
682
|
|
|
@@ -676,7 +687,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
676
687
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
677
688
|
|
|
678
689
|
"use strict";
|
|
679
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _masSetup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./masSetup */ \"./masSetup.js\");\n/* harmony import */ var _masRun__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./masRun */ \"./masRun.js\");\n\n\n/*\
|
|
690
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _masSetup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./masSetup */ \"./masSetup.js\");\n/* harmony import */ var _masRun__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./masRun */ \"./masRun.js\");\n\n\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Score using MAS\n * @module masScore\n * @category restaflib/mas\n * @param {store} restaf store\n * @param {string} modelName - name of model to be executed\n * @param {object} scenario - can be [{name: var1, value: value1},{...} ] or {varname: value,...}\n * @returns {promise} - returns scoring results\n * @alias module: masScore\n * @example\n * async function example (store, model) {\n * let scenario = {\n * prescriber_count : 1,\n * strength_per_unit: 15,\n * age : 74,\n * avg_opioid_prescriber_rate: 10.4,\n * doctorshop_med : 1,\n * max_avg_med_90 : 10,\n * max_mme_per_day: 40,\n * max_opioid_prescriber_rate: 13.21,\n * opioid_days: 3\n * };\n * \n * let result = await restaflib.masScore (store, model, scenario);\n * print.object(result, 'scoring result');\n * }\n */\n\n\nfunction masScore(_x, _x2, _x3) {\n return _masScore.apply(this, arguments);\n}\nfunction _masScore() {\n _masScore = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, modelName, scenario) {\n var masControl, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 1;\n return (0,_masSetup__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, [modelName]);\n case 1:\n masControl = _context.sent;\n _context.next = 2;\n return (0,_masRun__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(store, masControl, modelName, scenario, 'score', 'execute');\n case 2:\n r = _context.sent;\n return _context.abrupt(\"return\", r);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _masScore.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (masScore);\n\n//# sourceURL=webpack://restaflib/./masScore.js?\n}");
|
|
680
691
|
|
|
681
692
|
/***/ }),
|
|
682
693
|
|
|
@@ -687,7 +698,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
687
698
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
688
699
|
|
|
689
700
|
"use strict";
|
|
690
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _getScoreStep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getScoreStep */ \"./getScoreStep.js\");\n/*\
|
|
701
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _getScoreStep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getScoreStep */ \"./getScoreStep.js\");\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * setup access to MAS\n * @module masSetup\n * @category restaflib/mas\n * @param {object} store - restaf store\n * @param {object} models - an array of model names\n * @param {object} logonPayload - null|restaf logon payload\n * \n * @returns {object} - masControl used in masRun\n * @alias module: masSetup\n * @example \n * let masControl = await masSetup(store, ['modelA', 'modelB']);\n */\n\n\n\nfunction masSetup(_x, _x2, _x3) {\n return _masSetup.apply(this, arguments);\n}\nfunction _masSetup() {\n _masSetup = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, models, logonPayload) {\n var _yield$store$addServi, microanalyticScore, control, i, m, result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(logonPayload != null)) {\n _context.next = 1;\n break;\n }\n _context.next = 1;\n return store.logon(logonPayload);\n case 1:\n _context.next = 2;\n return store.addServices('microanalyticScore');\n case 2:\n _yield$store$addServi = _context.sent;\n microanalyticScore = _yield$store$addServi.microanalyticScore;\n control = {\n service: microanalyticScore,\n steps: {}\n };\n i = 0;\n case 3:\n if (!(i < models.length)) {\n _context.next = 6;\n break;\n }\n m = models[i];\n _context.next = 4;\n return (0,_getScoreStep__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, microanalyticScore, m);\n case 4:\n result = _context.sent;\n control.steps[m] = result;\n case 5:\n i++;\n _context.next = 3;\n break;\n case 6:\n return _context.abrupt(\"return\", control);\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _masSetup.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (masSetup);\n\n//# sourceURL=webpack://restaflib/./masSetup.js?\n}");
|
|
691
702
|
|
|
692
703
|
/***/ }),
|
|
693
704
|
|
|
@@ -698,7 +709,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
698
709
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
699
710
|
|
|
700
711
|
"use strict";
|
|
701
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\
|
|
712
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\nfunction casAppendTable() {\n var src = \"\\n rc = checkAndLoadTable(_args_.masterTable.caslib, _args_.masterTable.name);\\n\\n if (rc ne true) then do;\\n text = 'Unable to access ' ||_args_.masterTable.caslib||'.'||_args_.masterTable.name; \\n rx = {severity=2,reason=6, status='error',statusCode=2, formatted=text};\\n exit(rx); \\n end; \\n \\n rc = checkAndLoadTable(_args_.setTable.caslib, _args_.setTable.name);\\n if (rc ne true) then do;\\n text = 'Unable to access ' ||_args_.setTable.caslib||'.'||_args_.setTable.name; \\n rx = {severity=2,reason=6, status='error',statusCode=2, formatted=text};\\n return rx;\\n end;\\n\\n\\n setdata = _args_.setTable.caslib ||'.'||_args_.setTable.name;\\n masterdata = _args_.masterTable.caslib ||'.'||_args_.masterTable.name;\\n\\n action datastep.runCode r=result status=rc/\\n code='data ' ||masterdata||'(append=YES);set ' || setdata ||'; run;';\\n\\n if (rc.statusCode ne 0) then do;\\n exit(rc);\\n end; \\n else do;\\n results = {msg= 'Append succeeded', statusCode=true};\\n end;\\n \\n send_response({casResults = results});\\n \";\n return src;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casAppendTable);\n\n//# sourceURL=webpack://restaflib/./programs/casAppendTable.js?\n}");
|
|
702
713
|
|
|
703
714
|
/***/ }),
|
|
704
715
|
|
|
@@ -709,7 +720,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
709
720
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
710
721
|
|
|
711
722
|
"use strict";
|
|
712
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\
|
|
723
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\nfunction casFetchData() {\n var code = \"\\n print _args_;\\n\\n results = casFetchRows(_args_.table.caslib, _args_.table.name , _args_.start + 1, _args_.limit, _args_.format, _args_.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 text = 'Unable to access ' ||caslib||'.'||name; \\n rx = {severity=2,reason=6, status='error',statusCode=2, formatted=text};\\n exit(rx); \\n end; \\n\\n /*\\n * get tableoinfo 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 = from + count - 1;\\n\\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\\n rows = {};\\n if (from <= rowCount) then do;\\n action table.fetch r = result status=rcx/ \\n table = {caslib=caslib, name=name where=where} \\n from= from to=to format=format sastypes=true\\n ;\\n if (rcx.severity eq 2) then do;\\n exit(rcx);\\n end;\\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 end;\\n\\n currentCount = DIM(rows);\\n pagination = {}; \\n table = {caslib=caslib, name=name};\\n\\n pagination = setPagination(from, count, format, where, currentCount, rowCount, table);\\n \\n lastRequest={start=from-1, limit=count, format=format, currentCount=currentCount, \\n rowCount=rowCount, where=where, table=table, version='3'};\\n scrollOptions = getKeys(pagination);\\n return( \\n {pagination = pagination, data = {schema=columns, rows=rows , scrollOptions=scrollOptions}, lasRequest=lastRequest}\\n );\\n end; \\n \\n \\n /*\\n * For non-primary column types set new content\\n */\\n\\n function setPagination(from, count, format, where, currentCount, rowCount, table);\\n\\n\\n prevStart = max(from - count - 1, 0);\\n\\n if (currentCount lt count) then do; \\n pagination.prev = {start=prevStart, limit=count, format=format, where=' ', table=table};\\n if (prevStart ne 0) then do;\\n pagination.first = {start=0, limit=count, format=format, where=' ', table=table};\\n end; \\n return pagination;\\n end;\\n currentStart = from -1;\\n if (currentStart eq 0) then do;\\n pagination.next = {start=count, limit=count, format=format, where=' ', table=table};\\n return pagination;\\n end;\\n\\n nextStart = currentStart + count;\\n pagination.next = {start=nextStart, limit=count, format=format, where=' ', table=table};\\n pagination.prev = {start=prevStart, limit=count, format=format, where=' ', table=table};\\n if (prevStart ne 0) then do;\\n pagination.first = {start=0, limit=count, format=format, where=' ', table=table};\\n end; \\n return pagination;\\n end;\\n\\n\\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/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casFetchData);\n\n//# sourceURL=webpack://restaflib/./programs/casFetchData.js?\n}");
|
|
713
724
|
|
|
714
725
|
/***/ }),
|
|
715
726
|
|
|
@@ -720,7 +731,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
720
731
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
721
732
|
|
|
722
733
|
"use strict";
|
|
723
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\
|
|
734
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n/* deprecate */\nfunction casFetchRows() {\n var code = \"\\n results = casFetchRows(_args_.table.caslib, _args_.table.name , _args_.from, _args_.count, _args_.format, _args_.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 text = 'Unable to access ' ||caslib||'.'||name; \\n rx = {severity=2,reason=6, status='error',statusCode=2, formatted=text};\\n exit(rx); \\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 \\n to = from + count - 1; \\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 sastypes=true\\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 = {next= {from=pageNext, count=count, format=format, where=where table=table}, prev={from=pagePrev, count=count, format=format, where=where, table=table}};\\n pagination.current = {from = from, to=to, rowCount=rowCount, version=1};\\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/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casFetchRows);\n\n//# sourceURL=webpack://restaflib/./programs/casFetchRows.js?\n}");
|
|
724
735
|
|
|
725
736
|
/***/ }),
|
|
726
737
|
|
|
@@ -731,7 +742,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
731
742
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
732
743
|
|
|
733
744
|
"use strict";
|
|
734
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\r\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n* SPDX-License-Identifier: Apache-2.0\r\n*/\n\nfunction commonCasl() {\n var casl = \"\\n function checkAndLoadTable(caslib, name); \\n \\n /* verify caslib is there */\\n table.queryCaslib status=status result=result/\\n caslib = caslib;\\n do k,v over result; /* to handle casuser[user] */ \\n rc = v;\\n end;\\n if ( rc eq false ) then \\n return -1;\\n /* \\n * Check to see if table is already loaded \\n */ \\n action table.tableExists r=result/ \\n caslib = caslib \\n name = name; \\n /* \\n * if not loaded then try to load it \\n */ \\n rc = true;\\n if (result.exists eq 0 or result.exists eq 2) then do; \\n path = lookupPath(caslib, name);\\n if (path eq '*') then do;\\n rc = false;\\n end;\\n else do;\\n action table.loadTable status=status/ \\n caslib = caslib \\n source = path \\n casout={caslib= caslib name=name}; \\n if (status.statusCode ne 0 ) then rc = false;\\n end; \\n end; \\n return rc; \\n end; \\n \\n function saveAndLoadTable(caslib, source, targetlib, targetname,promote);\\n \\n /* load source */\\n r = checkAndLoadTable(caslib, source);\\n \\n sashdat = target||\\\".sashdat\\\";\\n table.save /\\n caslib= targetlib name=sashdat\\n table = {caslib=caslib name=source} replace=true;\\n \\n table.droptable /\\n caslib=targetlib name=target quiet=true;\\n \\n table.loadtable result=r status=rc/\\n caslib=targetlib casout={caslib=targetlib name=target replace=TRUE}\\n path=sashdat;\\n \\n if (promote eq true) then do;\\n table.promote result=r status=rc/\\n caslib=caslib name=target quiet=true\\n targetLib=caslib target=target;\\n end;\\n if (rc.severity eq 2) then do;\\n print rc;\\n print 'Ignoring error';\\n end;\\n r = 0;\\n return r;\\n \\n end;\\n \\n function lookupPath(caslib, name ) ; \\n table.fileInfo r = result/\\n caslib=caslib; \\n \\n names = result.fileInfo[,4]; \\n nameu = upcase(name)||'.SASHDAT'; \\n cpath = '*'; \\n count = 0; \\n \\n do n over names; \\n if (upcase(n) eq nameu) then do; \\n count = count + 1; \\n if ( cpath eq '*') then do; \\n cpath = n; \\n end; \\n end; \\n end; \\n \\n if (count GT 1 ) then do; \\n print 'Warning: ' count 'Files with names only different in case exist - First one chosen';\\n print 'Path: ' cpath ' will be used****'; \\n end; \\n r = cpath; \\n return r; \\n end; \\n /*-----------------------------------------*/ \\n /* isModel: is it model table */ \\n /*-----------------------------------------*/ \\n \\n function isModel(caslib, name) ; \\n table.columnInfo r = result / \\n table = {caslib=caslib , name=name}; \\n validTable = false; \\n mtype = 'bad'; \\n do c over result.columninfo; \\n cu = upCase(c.Column); \\n if ( cu eq 'DATASTEPSRC') then do; \\n mtype = 'ds'; \\n end; \\n else if ( cu eq '_STATE_' ) then do; \\n mtype = 'astore'; \\n end; \\n else if (cu eq 'MODELMETADATA') then do; \\n mtype = 'ds2'; \\n end; \\n end; \\n print 'Specified model type: ' || mtype; \\n return mtype; \\n end; \\n \\n /*-----------------------------------------*/ \\n /* Returns contents of the specified table */ \\n /*-----------------------------------------*/ \\n \\n function contents(caslib, name) ; \\n table.columnInfo r = result / \\n table = {caslib=caslib , name=name}; \\n /* columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}}; */ \\n i = 1; \\n columns = {}; \\n do c over result.columninfo; \\n columns[i] = c; \\n i = i + 1; \\n end; \\n return {describe = columns, table = {}}; \\n end; \\n \\n /*------------------------------------------*/ \\n /* Returns unique values */ \\n /*-----------------------------------------*/ \\n \\n function selectionLists(idvars,caslib, name, where); \\n \\n s = checkAndLoadTable(caslib, name); \\n if ( s ne true) then do; \\n results = {Errors= 'Unable to access ' ||caslib||'.'||name, statusCode = s}; \\n \\n end; \\n print idvars;\\n do k over idvars; \\n r = _getValues(k, caslib, name, where); \\n results[k] = r; \\n end; \\n return { data=results, statusCode=0}; \\n end; \\n function _getValues(id, caslib, name, where) ; \\n \\n action table.dropTable/ \\n caslib='casuser' name='dtemp1' quiet=TRUE; \\n \\n action table.deleteSource status=src / \\n caslib='casuser' source= 'dtemp1.sashdat' quiet=TRUE; \\n \\n action simple.groupby result=r status=rc/ \\n aggregator = 'N' \\n inputs = {id} \\n table = {caslib=caslib name=name, where=where} \\n casout = {caslib='casuser' name='dtemp1'} \\n ; \\n action table.fetch result=r/ \\n table={caslib='casuser' name='dtemp1'} \\n sortby={{name=id, order='ascending'}}; \\n result = r.Fetch[,2]; \\n return result; \\n end; \\n /*------------------------------------------*/ \\n /* get a record */ \\n /*------------------------------------------*/ \\n \\n function _fetchData(filter, table); \\n s = checkAndLoadTable(table.caslib, table.name); \\n if ( s ne 0 ) then do; \\n results = {Errors= 'Unable to access ' ||table.caslib||'.'||table.name}; \\n return results; \\n end; \\n wherex = dictTowhere(filter); \\n /* wherex = table.caslib||'.'||table.name||'(where=('||wherex||'));'; \\n \\n destroyTable('casuser', 'input'); \\n \\n action datastep.runCode r=result status=rc/ \\n single='yes' \\n code = 'data casuser.input; set ' || wherex||'run;'; \\n */ \\n \\n action table.fetch r = result / \\n table={caslib=table.caslib name=table.name where=wherex}; \\n \\n rows = resultsToDict(result.Fetch); \\n return {scenario = rows, table = result.Fetch}; \\n \\n end; \\n function destroyTable(caslib,name); \\n action table.dropTable/ \\n caslib=caslib name=name quiet=TRUE; \\n \\n action table.deleteSource status=src / \\n caslib=caslib source= name||'.sashdat' quiet=TRUE; \\n \\n return true; \\n end; \\n \\n \\n function dictToWhere(filter); \\n where =''; \\n andbit=' '; \\n do k,v over filter; \\n if (isString(v) ) then do; \\n where = where || andbit || k || ' eq ' || '\\\"'||v||'\\\"'; \\n end; \\n else do; \\n where = where || andbit || k || ' eq ' || v ; \\n end; \\n andbit =' and '; \\n end; \\n return where; \\n end; \\n \\n function resultsToDict(r); \\n casResults = {}; \\n i = 1; \\n do row over r; \\n casResults[i] = row; \\n i = i + 1; \\n end; \\n return casResults; \\n end; \\n \\n function argsToTable(_arg_, caslib, name ); \\n action table.droptable/ \\n caslib=caslib name=name quiet=TRUE; \\n i = 1; \\n do key,obj over _arg_; \\n columns[i] = key; \\n row[i] = obj; \\n if ( isString(obj) ) then \\n type[i] = 'varchar'; \\n else if ( isInteger(obj) ) then \\n type[i] = 'int'; \\n else type[i] = 'double'; \\n i = i + 1; \\n end; \\n \\n data1 = newTable('data1', columns, type, row ); \\n \\n saveresult data1 casout=name caslib=caslib replace; \\n end; \\n \\n function saveAndPromoteTable(caslib, target, source);\\n sashdat = target||\\\".sashdat\\\";\\n rc = checkAndLoadTable(caslib, source);\\n table.droptable /\\n caslib=caslib name=target quiet=true;\\n \\n table.save /\\n caslib= caslib name=sashdat\\n table = {caslib=caslib name=source} replace=true;\\n \\n table.loadtable result=r/\\n caslib=caslib casout={caslib=caslib name=target replace=TRUE}\\n path=sashdat;\\n \\n table.promote result=r status=rc/\\n caslib=caslib name=target quiet=true\\n targetLib=caslib target=target;\\n print rc;\\n r = rc.severity;\\n if (rc.severity gt 0) then do;\\n print rc;\\n print 'Ignoring error';\\n rc = 0;\\n end;\\n \\n return r;\\n end; \\n \\n \";\n return casl;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (commonCasl);\n\n//# sourceURL=webpack://restaflib/./programs/commonCasl.js?\n}");
|
|
745
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\nfunction commonCasl() {\n var casl = \"\\n function checkAndLoadTable(caslib, name); \\n \\n /* verify caslib is there */\\n table.queryCaslib status=status result=result/\\n caslib = caslib;\\n do k,v over result; /* to handle casuser[user] */ \\n rc = v;\\n end;\\n if ( rc eq false ) then \\n return -1;\\n /* \\n * Check to see if table is already loaded \\n */ \\n action table.tableExists r=result/ \\n caslib = caslib \\n name = name; \\n /* \\n * if not loaded then try to load it \\n */ \\n rc = true;\\n if (result.exists eq 0 or result.exists eq 2) then do; \\n path = lookupPath(caslib, name);\\n if (path eq '*') then do;\\n rc = false;\\n end;\\n else do;\\n action table.loadTable status=status/ \\n caslib = caslib \\n source = path \\n casout={caslib= caslib name=name}; \\n if (status.statusCode ne 0 ) then rc = false;\\n end; \\n end; \\n return rc; \\n end; \\n \\n function saveAndLoadTable(caslib, source, targetlib, targetname,promote);\\n \\n /* load source */\\n r = checkAndLoadTable(caslib, source);\\n \\n sashdat = target||\\\".sashdat\\\";\\n table.save /\\n caslib= targetlib name=sashdat\\n table = {caslib=caslib name=source} replace=true;\\n \\n table.droptable /\\n caslib=targetlib name=target quiet=true;\\n \\n table.loadtable result=r status=rc/\\n caslib=targetlib casout={caslib=targetlib name=target replace=TRUE}\\n path=sashdat;\\n \\n if (promote eq true) then do;\\n table.promote result=r status=rc/\\n caslib=caslib name=target quiet=true\\n targetLib=caslib target=target;\\n end;\\n if (rc.severity eq 2) then do;\\n print rc;\\n print 'Ignoring error';\\n end;\\n r = 0;\\n return r;\\n \\n end;\\n \\n function lookupPath(caslib, name ) ; \\n table.fileInfo r = result/\\n caslib=caslib; \\n \\n names = result.fileInfo[,4]; \\n nameu = upcase(name)||'.SASHDAT'; \\n cpath = '*'; \\n count = 0; \\n \\n do n over names; \\n if (upcase(n) eq nameu) then do; \\n count = count + 1; \\n if ( cpath eq '*') then do; \\n cpath = n; \\n end; \\n end; \\n end; \\n \\n if (count GT 1 ) then do; \\n print 'Warning: ' count 'Files with names only different in case exist - First one chosen';\\n print 'Path: ' cpath ' will be used****'; \\n end; \\n r = cpath; \\n return r; \\n end; \\n /*-----------------------------------------*/ \\n /* isModel: is it model table */ \\n /*-----------------------------------------*/ \\n \\n function isModel(caslib, name) ; \\n table.columnInfo r = result / \\n table = {caslib=caslib , name=name}; \\n validTable = false; \\n mtype = 'bad'; \\n do c over result.columninfo; \\n cu = upCase(c.Column); \\n if ( cu eq 'DATASTEPSRC') then do; \\n mtype = 'ds'; \\n end; \\n else if ( cu eq '_STATE_' ) then do; \\n mtype = 'astore'; \\n end; \\n else if (cu eq 'MODELMETADATA') then do; \\n mtype = 'ds2'; \\n end; \\n end; \\n print 'Specified model type: ' || mtype; \\n return mtype; \\n end; \\n \\n /*-----------------------------------------*/ \\n /* Returns contents of the specified table */ \\n /*-----------------------------------------*/ \\n \\n function contents(caslib, name) ; \\n table.columnInfo r = result / \\n table = {caslib=caslib , name=name}; \\n /* columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}}; */ \\n i = 1; \\n columns = {}; \\n do c over result.columninfo; \\n columns[i] = c; \\n i = i + 1; \\n end; \\n return {describe = columns, table = {}}; \\n end; \\n \\n /*------------------------------------------*/ \\n /* Returns unique values */ \\n /*-----------------------------------------*/ \\n \\n function selectionLists(idvars,caslib, name, where); \\n \\n s = checkAndLoadTable(caslib, name); \\n if ( s ne true) then do; \\n results = {Errors= 'Unable to access ' ||caslib||'.'||name, statusCode = s}; \\n \\n end; \\n print idvars;\\n do k over idvars; \\n r = _getValues(k, caslib, name, where); \\n results[k] = r; \\n end; \\n return { data=results, statusCode=0}; \\n end; \\n function _getValues(id, caslib, name, where) ; \\n \\n action table.dropTable/ \\n caslib='casuser' name='dtemp1' quiet=TRUE; \\n \\n action table.deleteSource status=src / \\n caslib='casuser' source= 'dtemp1.sashdat' quiet=TRUE; \\n \\n action simple.groupby result=r status=rc/ \\n aggregator = 'N' \\n inputs = {id} \\n table = {caslib=caslib name=name, where=where} \\n casout = {caslib='casuser' name='dtemp1'} \\n ; \\n action table.fetch result=r/ \\n table={caslib='casuser' name='dtemp1'} \\n sortby={{name=id, order='ascending'}}; \\n result = r.Fetch[,2]; \\n return result; \\n end; \\n /*------------------------------------------*/ \\n /* get a record */ \\n /*------------------------------------------*/ \\n \\n function _fetchData(filter, table); \\n s = checkAndLoadTable(table.caslib, table.name); \\n if ( s ne 0 ) then do; \\n results = {Errors= 'Unable to access ' ||table.caslib||'.'||table.name}; \\n return results; \\n end; \\n wherex = dictTowhere(filter); \\n /* wherex = table.caslib||'.'||table.name||'(where=('||wherex||'));'; \\n \\n destroyTable('casuser', 'input'); \\n \\n action datastep.runCode r=result status=rc/ \\n single='yes' \\n code = 'data casuser.input; set ' || wherex||'run;'; \\n */ \\n \\n action table.fetch r = result / \\n table={caslib=table.caslib name=table.name where=wherex}; \\n \\n rows = resultsToDict(result.Fetch); \\n return {scenario = rows, table = result.Fetch}; \\n \\n end; \\n function destroyTable(caslib,name); \\n action table.dropTable/ \\n caslib=caslib name=name quiet=TRUE; \\n \\n action table.deleteSource status=src / \\n caslib=caslib source= name||'.sashdat' quiet=TRUE; \\n \\n return true; \\n end; \\n \\n \\n function dictToWhere(filter); \\n where =''; \\n andbit=' '; \\n do k,v over filter; \\n if (isString(v) ) then do; \\n where = where || andbit || k || ' eq ' || '\\\"'||v||'\\\"'; \\n end; \\n else do; \\n where = where || andbit || k || ' eq ' || v ; \\n end; \\n andbit =' and '; \\n end; \\n return where; \\n end; \\n \\n function resultsToDict(r); \\n casResults = {}; \\n i = 1; \\n do row over r; \\n casResults[i] = row; \\n i = i + 1; \\n end; \\n return casResults; \\n end; \\n \\n function argsToTable(_arg_, caslib, name ); \\n action table.droptable/ \\n caslib=caslib name=name quiet=TRUE; \\n i = 1; \\n do key,obj over _arg_; \\n columns[i] = key; \\n row[i] = obj; \\n if ( isString(obj) ) then \\n type[i] = 'varchar'; \\n else if ( isInteger(obj) ) then \\n type[i] = 'int'; \\n else type[i] = 'double'; \\n i = i + 1; \\n end; \\n \\n data1 = newTable('data1', columns, type, row ); \\n \\n saveresult data1 casout=name caslib=caslib replace; \\n end; \\n \\n function saveAndPromoteTable(caslib, target, source);\\n sashdat = target||\\\".sashdat\\\";\\n rc = checkAndLoadTable(caslib, source);\\n table.droptable /\\n caslib=caslib name=target quiet=true;\\n \\n table.save /\\n caslib= caslib name=sashdat\\n table = {caslib=caslib name=source} replace=true;\\n \\n table.loadtable result=r/\\n caslib=caslib casout={caslib=caslib name=target replace=TRUE}\\n path=sashdat;\\n \\n table.promote result=r status=rc/\\n caslib=caslib name=target quiet=true\\n targetLib=caslib target=target;\\n print rc;\\n r = rc.severity;\\n if (rc.severity gt 0) then do;\\n print rc;\\n print 'Ignoring error';\\n rc = 0;\\n end;\\n \\n return r;\\n end; \\n \\n \";\n return casl;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (commonCasl);\n\n//# sourceURL=webpack://restaflib/./programs/commonCasl.js?\n}");
|
|
735
746
|
|
|
736
747
|
/***/ }),
|
|
737
748
|
|
|
@@ -742,7 +753,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
742
753
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
743
754
|
|
|
744
755
|
"use strict";
|
|
745
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _casAppendTable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casAppendTable */ \"./programs/casAppendTable.js\");\n/*\
|
|
756
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _casAppendTable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casAppendTable */ \"./programs/casAppendTable.js\");\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n commonCasl: _commonCasl__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n casFetchData: _casFetchData__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n casFetchRows: _casFetchRows__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n scoreCasl: (_scoreCasl__WEBPACK_IMPORTED_MODULE_0___default()),\n casAppendTable: _casAppendTable__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n casRowSets: _casFetchData__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n});\n\n//# sourceURL=webpack://restaflib/./programs/index.js?\n}");
|
|
746
757
|
|
|
747
758
|
/***/ }),
|
|
748
759
|
|
|
@@ -752,7 +763,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
752
763
|
\*******************************/
|
|
753
764
|
/***/ ((module) => {
|
|
754
765
|
|
|
755
|
-
eval("{/*\
|
|
766
|
+
eval("{/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\nmodule.exports = function scoreCasl() {\n var casl = \"\\n result = runMain(_args_); \\n send_response(result); \\n /* print result; */\\n \\n \\n function runMain(_args_) ; \\n r = {Error= 'No path'}; \\n if ( _args_.path eq '/selectors') then do; \\n r = selectionLists(_args_.selectors, _args_.table.caslib, _args_.table.name); \\n end; \\n else if ( _args_.path eq '/contents') then do; \\n r = contents(_args_.table.caslib, _args_.table.name); \\n end; \\n else if (_args_.path eq '/describe') then do; \\n r = describeModel(_args_); \\n end; \\n else if (_args_.path eq '/scenario' ) then do;\\n r = fetchData(_args_.filter, _args_.table);\\n end;\\n else if (_args_.path eq '/score') then do; \\n if( exists(_args_, 'modelName') eq false ) then\\n modelname = '';\\n else modelName =_args_.modelName;\\n r = runScoreCode(_args_.model, _args_.scenario, modelName); \\n end; \\n else do; \\n r = {icasResults={Errors = 'Invalid action option specified' || _args_.path}, statusCode=404}; \\n end; \\n print r;\\n if ( r.statusCode ne 0) then do;\\n print r.icasResults;\\n exit({severity=2,reason=6, status=r.iCasResults.Errors,statusCode=r.statusCode});\\n end;\\n result = {casResults = r.icasResults}; \\n print '***************************************************************'; \\n print result; \\n print '***************************************************************'; \\n return result; \\n end; \\n \\n /*-----------------------------------------*/ \\n /* describeModel */ \\n /*-----------------------------------------*/ \\n \\n function describeModel(_args_) ; \\n s = checkAndLoadTable(_args_.model.caslib, _args_.model.name); \\n if ( s ne true) then do; \\n results = {Errors= 'Unable to access ' ||_args_.model.caslib||'.'||_args_.model.name}; \\n return {icasResults=results, statusCode=404}; \\n end; \\n \\n mtype = isModel(_args_.model.caslib, _args_.model.name); \\n if ( mtype EQ 'astore' ) then do; \\n r = astoreDescribe(_args_.model); \\n end; \\n else if (mtype EQ 'ds' or mtype EQ 'ds2') then do;\\n s = checkAndLoadTable(_args_.table.caslib, _args_.table.name); \\n if ( s ne true ) then do; \\n results = {Errors= 'Unable to access ' ||_args_.table.caslib||'.'||_args_.table.name}; \\n return {icasResults=results, statusCode=404}; \\n end; \\n r = contents( _args_.table.caslib, _args_.table.name); \\n end; \\n return {icasResults= r, statusCode=0} ;\\n end; \\n \\n /*------------------------------------------*/ \\n /* astoreDescribe */ \\n /*------------------------------------------*/ \\n \\n function astoreDescribe(model); \\n action astore.describe r=result/ \\n rstore = { caslib= model.caslib name = model.name }; \\n rows = resultsToDict(result.InputVariables); \\n return {describe = rows, table = result.InputVariables}; \\n end; \\n \\n /*------------------------------------------*/ \\n /* score */ \\n /*------------------------------------------*/ \\n function runScoreCode( model, scenario, modelName); \\n print model; \\n s = checkAndLoadTable(model.caslib, model.name); \\n if ( s ne true ) then do; \\n results = {Errors= 'Unable to access ' ||model.caslib||'.'||model.name}; \\n return {icasResults=results, statusCode=404}; \\n end;\\n \\n mtype = isModel(model.caslib, model.name); \\n \\n if ( mtype eq 'bad' ) then do; \\n results = {Error= model.caslib||'.'||model.name || ' is not recognized as a valid supported model. Please check your values'};\\n return {icasResults=results, statusCode=400};\\n end; \\n destroyTable('casuser', 'input'); \\n argsToTable(scenario, 'casuser', 'input'); \\n \\n destroyTable('casuser', 'output'); \\n \\n if (mtype eq 'astore') then do; \\n print 'Scoring with astore'; \\n action astore.score r = result/ \\n rstore = {caslib=model.caslib name=model.name} \\n out = {caslib='casuser' name='output'} \\n table = {caslib='casuser' name='input'}; \\n end; \\n else if (mtype eq 'ds') then do; \\n print 'scoring with datastep code'; \\n action datastep.runcodetable r = result/ \\n single='YES' \\n codeTable= {caslib=model.caslib name=model.name} \\n casout = {caslib='casuser' name='output'} \\n table = {caslib='casuser' name='input'}; \\n end; \\n else if (mtype eq 'ds2' ) then do; \\n print 'Scoring with d2'; \\n if ( missing(modelName) eq true) then do;\\n results = {Error= 'modelName is missing. Please check your values'};\\n return {icasResults=results, statusCode=400};\\n end;\\n\\n action ds2.runModel r = result/ \\n modelTable = {caslib=model.caslib, name=model.name} \\n modelName = modelName \\n table = {caslib= 'casuser', name='input'} \\n casOut = {caslib= 'casuser' name='output'}; \\n end; \\n \\n \\n action table.fetch r = result / \\n table={caslib='casuser' name='output'}; \\n \\n rows = resultsToDict(result.Fetch); \\n \\n return {icasResults= rows, statusCode=0} ;\\n end; \\n \\n \\n \";\n return casl;\n};\n\n/*\n cas mycas; \n proc cas; \n \n \n _args_1 = { \n path = '/describe', \n model = { caslib='models', name='cms_sdoh_risk_stratification_cluster'}, \n table = { caslib= \"public\", name = \"cluster_test2\"}, \n scenario = { \n SDOH_Physically_Unhealthy_Days_= 4.3, \n SDOH_Per_Adults_Bachelors = 19.6, \n SDOH_Unemployment_Rate = 9.6, \n SDOH_Median_Household_Income = 45493 \n } \n \n }; \n \n _args_2 = { \n path = '/score', \n model = { caslib='models', name='cms_sdoh_risk_stratification_cluster'}, \n table = { caslib= \"public\", name = \"cluster_test2\"}, \n scenario = { \n SDOH_Physically_Unhealthy_Days_ = 4.3, \n SDOH_Per_Adults_Bachelors = 19.6, \n SDOH_Unemployment_Rate = 9.6, \n SDOH_Median_Household_Income = 45493 \n } \n \n }; \n \n _args_3 = { \n path = '/describe', \n model = { caslib='modelstore', name='_LBP6S3ZAQGO614AJKDJT3AF93'}, \n table = { caslib='', name=''}, \n scenario = { \n sensor_ratio = 4.3, \n days_out_of_service = 5 \n } \n }; \n \n \n _args_4 = { \n path = '/score', \n model = { caslib='modelstore', name='_LBP6S3ZAQGO614AJKDJT3AF93'}, \n table = { caslib='', name=''}, \n scenario = { \n sensor_ratio = 4.3, \n days_out_of_service = 5 \n } \n }; \n \n \n _args_5 = { \n path = '/score', \n modelName= 'Gradient_Boosting_3f3c7c89_13ac_469e_a761_28ee066e5b87' \n model = { caslib='casuser', name='testdest'}, \n table = { caslib=\"\", name=\"\"}, \n scenario = { \n sensor_ratio = 4.3, \n days_out_of_service = 5 \n } \n }; \n \n _args_6 = { \n path = '/score', \n modelName= 'Gradient_Boosting_7adb0404_85e3_474d_9d03_1059ef7ae008' \n model = { caslib='public', name='testpublish'}, \n table = { caslib=\"\", name=\"\"}, \n scenario = { \n sensor_ratio = 4.3, \n days_out_of_service = 5 \n } \n }; \n result = runMain(_args_1); \n result = runMain(_args_2); \n result = runMain(_args_3); \n result = runMain(_args_4); \n result = runMain(_args_5); \n */\n\n//# sourceURL=webpack://restaflib/./programs/scoreCasl.js?\n}");
|
|
756
767
|
|
|
757
768
|
/***/ }),
|
|
758
769
|
|
|
@@ -763,7 +774,7 @@ eval("{/*\r\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights
|
|
|
763
774
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
764
775
|
|
|
765
776
|
"use strict";
|
|
766
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ uploadAstore: () => (/* reexport safe */ _uploadAstore__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ uploadSrc: () => (/* reexport safe */ _uploadSrc__WEBPACK_IMPORTED_MODULE_1__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _uploadAstore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uploadAstore */ \"./uploadHandlers/uploadAstore.js\");\n/* harmony import */ var _uploadSrc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uploadSrc */ \"./uploadHandlers/uploadSrc.js\");\n/* harmony import */ var _saveTable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./saveTable */ \"./uploadHandlers/saveTable.js\");\n/*\
|
|
777
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ uploadAstore: () => (/* reexport safe */ _uploadAstore__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ uploadSrc: () => (/* reexport safe */ _uploadSrc__WEBPACK_IMPORTED_MODULE_1__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _uploadAstore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uploadAstore */ \"./uploadHandlers/uploadAstore.js\");\n/* harmony import */ var _uploadSrc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uploadSrc */ \"./uploadHandlers/uploadSrc.js\");\n/* harmony import */ var _saveTable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./saveTable */ \"./uploadHandlers/saveTable.js\");\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n//# sourceURL=webpack://restaflib/./uploadHandlers/index.js?\n}");
|
|
767
778
|
|
|
768
779
|
/***/ }),
|
|
769
780
|
|
|
@@ -774,7 +785,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
774
785
|
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {
|
|
775
786
|
|
|
776
787
|
"use strict";
|
|
777
|
-
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/*\
|
|
788
|
+
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* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\nfunction saveTable(_x, _x2, _x3, _x4) {\n return _saveTable.apply(this, arguments);\n}\nfunction _saveTable() {\n _saveTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, caslib, name) {\n var payload, rc;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n payload = {\n action: 'table.save',\n data: {\n name: \"\".concat(name),\n caslib: \"\".concat(caslib),\n replace: true,\n table: {\n name: \"\".concat(name),\n caslib: \"\".concat(caslib)\n }\n }\n };\n _context.next = 1;\n return store.runAction(session, payload);\n case 1:\n rc = _context.sent;\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _saveTable.apply(this, arguments);\n}\n/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (saveTable);\n\n//# sourceURL=webpack://restaflib/./uploadHandlers/saveTable.js?\n}");
|
|
778
789
|
|
|
779
790
|
/***/ }),
|
|
780
791
|
|
|
@@ -785,7 +796,7 @@ eval("{/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK
|
|
|
785
796
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
786
797
|
|
|
787
798
|
"use strict";
|
|
788
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
799
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n\n\n\nfunction uploadAstore(_x, _x2, _x3, _x4) {\n return _uploadAstore.apply(this, arguments);\n}\nfunction _uploadAstore() {\n _uploadAstore = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, astoreBuf, fileInfo) {\n var _fileInfo$output, caslib, name, casl, payload, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _fileInfo$output = fileInfo.output, caslib = _fileInfo$output.caslib, name = _fileInfo$output.name;\n if (!(name == null)) {\n _context.next = 1;\n break;\n }\n throw 'Please specify table as caslib.name';\n case 1:\n name = name.toLowerCase(name);\n\n // delete old table\n casl = \"\\n action table.droptable /\\n caslib= '\".concat(caslib, \"' name= '\").concat(name, \"' quiet=true;\\n\\n action table.deleteSource/\\n caslib= '\").concat(caslib, \"' source= '\").concat(name, \".sashdat' quiet=true; \\n \");\n payload = {\n action: 'sccasl.runcasl',\n data: {\n code: casl\n }\n };\n _context.next = 2;\n return store.runAction(session, payload);\n case 2:\n // upload table\n\n payload = {\n action: 'astore.upload',\n data: {\n rstore: {\n name: \"\".concat(name),\n caslib: \"\".concat(caslib),\n replace: true\n },\n store: astoreBuf\n }\n };\n _context.next = 3;\n return store.runAction(session, payload);\n case 3:\n r = _context.sent;\n return _context.abrupt(\"return\", \"Upload of \".concat(fileInfo.source, \" to \").concat(caslib, \".\").concat(name, \" completed\"));\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _uploadAstore.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (uploadAstore);\n\n//# sourceURL=webpack://restaflib/./uploadHandlers/uploadAstore.js?\n}");
|
|
789
800
|
|
|
790
801
|
/***/ }),
|
|
791
802
|
|
|
@@ -796,7 +807,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
796
807
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
797
808
|
|
|
798
809
|
"use strict";
|
|
799
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\
|
|
810
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\nfunction uploadSrc(_x, _x2, _x3, _x4, _x5) {\n return _uploadSrc.apply(this, arguments);\n}\nfunction _uploadSrc() {\n _uploadSrc = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, modelBuf, fileInfo, save) {\n var _fileInfo$output, caslib, name, rx, JSON_Parameters, p, r, casl, _r, text;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _fileInfo$output = fileInfo.output, caslib = _fileInfo$output.caslib, name = _fileInfo$output.name;\n if (!(name == null)) {\n _context.next = 1;\n break;\n }\n throw 'Please specify table as caslib.name';\n case 1:\n _context.next = 2;\n return cleanup(store, session, caslib, name);\n case 2:\n rx = _context.sent;\n JSON_Parameters = {\n casout: {\n caslib: caslib,\n /* a valid caslib */\n name: name /* name of output file on cas server */\n },\n importOptions: {\n fileType: fileInfo.fileType /* type of the file being uploaded */\n }\n };\n if (fileInfo.fileExt === 'sas' || fileInfo.fileExt === 'ds2') {\n JSON_Parameters.importOptions.delimiter = '\\\\';\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 = 3;\n return store.runAction(session, p);\n case 3:\n r = _context.sent;\n if (!(save === true)) {\n _context.next = 5;\n break;\n }\n casl = \"\\n\\t\\t\\n\\t\\t\\taction table.save r = result / \\n\\t\\t\\t\\ttable = {caslib='\".concat(caslib, \"' name='\").concat(name, \"'} \\n\\t\\t\\t\\tcaslib='\").concat(caslib, \"' name='\").concat(name, \"' replace=true;\\n\\t\\t\\t\\n\\t\\t\\taction table.loadTable r = result2 /\\n\\t\\t\\t\\tcaslib='\").concat(caslib, \"' casout={caslib='\").concat(caslib, \"' name='\").concat(name, \"' replace=true} \\n\\t\\t\\t\\tpath='\").concat(name, \".sashdat' ;\\n\\n\\t\\t\\n\\t\\t send_response({status=result2});\\n\\t\\t\\t\");\n _context.next = 4;\n return (0,_caslRun__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, casl, null, true);\n case 4:\n _r = _context.sent;\n case 5:\n text = fileInfo.source == null ? \"inline source\" : fileInfo.source;\n return _context.abrupt(\"return\", r);\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _uploadSrc.apply(this, arguments);\n}\nfunction cleanup(_x6, _x7, _x8, _x9) {\n return _cleanup.apply(this, arguments);\n}\nfunction _cleanup() {\n _cleanup = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee2(store, session, caslib, name) {\n var table, deleteSrc, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context2) {\n while (1) 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(name, \".sashdat' quiet=TRUE; \\n\\t\\tsend_response({casResults = {status=src, results= 'data deleted'}})\\n\\t\\t\");\n _context2.next = 1;\n return (0,_caslRun__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, session, deleteSrc);\n case 1:\n r = _context2.sent;\n return _context2.abrupt(\"return\", r);\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _cleanup.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (uploadSrc);\n\n//# sourceURL=webpack://restaflib/./uploadHandlers/uploadSrc.js?\n}");
|
|
800
811
|
|
|
801
812
|
/***/ }),
|
|
802
813
|
|
|
@@ -807,7 +818,7 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
807
818
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
808
819
|
|
|
809
820
|
"use strict";
|
|
810
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _uploadHandlers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uploadHandlers */ \"./uploadHandlers/index.js\");\n\n/*\
|
|
821
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* 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 _uploadHandlers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uploadHandlers */ \"./uploadHandlers/index.js\");\n\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * parse a source file name\n * @module uploadSetup\n * @private\n * @param {string} source - the source file( absolute or relative path can be used)\n * @returns {object} - returns {ext: file-extension, fileOptions: <option for fread>, transform: transform for content-type, contentType: content-type}\n * @alias module: uploadSetup\n * @example\n * let t = uploadSetup('./cars.sashdat');\n */\n\nfunction uploadSetup(source, output) {\n var fileOptions = null; /* option for file reader */\n var contentType = 'binary/octet-stream'; /* header content-type on API call */\n\n var fileType; /* fileType for use in API call */\n var handler = _uploadHandlers__WEBPACK_IMPORTED_MODULE_1__.uploadSrc;\n var transform = noChange;\n var fext;\n if (source == null) {\n fext = 'csv';\n } else {\n fext = source.split('.').pop().toLowerCase();\n }\n switch (fext) {\n case 'sas7bdat':\n {\n fileType = 'basesas';\n break;\n }\n case 'sashdat':\n {\n fileType = 'hdat';\n break;\n }\n case 'csv':\n {\n fileType = fext;\n fileOptions = 'UTF8';\n break;\n }\n case 'xslx':\n case 'xsl':\n {\n fileType = fext;\n break;\n }\n case 'astore':\n case 'sasast':\n {\n fileType = fext;\n handler = _uploadHandlers__WEBPACK_IMPORTED_MODULE_1__.uploadAstore;\n transform = toBase64;\n break;\n }\n case 'ds2':\n case 'sas':\n {\n fileType = 'csv';\n fileOptions = 'UTF8';\n handler = _uploadHandlers__WEBPACK_IMPORTED_MODULE_1__.uploadSrc;\n transform = toCsv;\n break;\n }\n default:\n {\n throw \"Currently file type of \".concat(fext, \" is not supported\");\n }\n }\n var _output$split = output.split('.'),\n _output$split2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_output$split, 2),\n caslib = _output$split2[0],\n name = _output$split2[1];\n return {\n source: source,\n output: {\n caslib: caslib,\n name: name.toLowerCase()\n },\n fileType: fileType /* for cas actions */,\n fileExt: fext,\n fileOptions: fileOptions,\n transform: transform,\n contentType: contentType,\n handler: handler\n };\n function toBase64(data) {\n return new Buffer.from(data).toString('base64');\n }\n function toCsv(data, fileInfo) {\n // preprocess to get rid of things that upset datastep\n // eslint-disable-next-line no-control-regex\n var isrc = data.replace(/[^\\x00-\\x7F]/g, '');\n var src = isrc.replace(/\\r?\\n/g, '');\n // convert to a csv\n var fileType = fileInfo.fileExt;\n var varname = fileType === 'sas' ? 'dataStepSrc' : fileType === 'ds2' ? 'ds2Src' : fileType === 'casl' ? 'caslSrc' : 'dataStepsrc';\n var csv = 'modelName' + '\\\\' + varname + '\\n' + fileInfo.output.name + '\\\\' + ' ' + src + '\\n';\n return csv;\n }\n function noChange(data) {\n return data;\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (uploadSetup);\n\n//# sourceURL=webpack://restaflib/./uploadSetup.js?\n}");
|
|
811
822
|
|
|
812
823
|
/***/ })
|
|
813
824
|
|