@sassoftware/restaflib 5.6.0 → 5.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/restaflib.esm.js +856 -0
- package/dist/restaflib.esm.min.js +2 -0
- package/dist/restaflib.umd.js +908 -0
- package/dist/restaflib.umd.min.js +2 -0
- package/dist/restaflib.umd.min.js.LICENSE.txt +1 -0
- package/lib/restaflib.js +266 -281
- package/lib/restaflib.min.js +2 -0
- package/lib/restaflib.min.js.LICENSE.txt +1 -0
- package/package.json +9 -7
- package/dist/restaflib.js +0 -923
- package/dist/restaflib.min.js +0 -2
- /package/dist/{restaflib.min.js.LICENSE.txt → restaflib.esm.min.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,856 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
3
|
+
* This devtool is neither made for production nor for readable output files.
|
|
4
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
5
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
6
|
+
* or disable the default devtool with "devtool: false".
|
|
7
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
|
+
*/
|
|
9
|
+
/******/ var __webpack_modules__ = ({
|
|
10
|
+
|
|
11
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/OverloadYield.js"
|
|
12
|
+
/*!*********************************************************************!*\
|
|
13
|
+
!*** ../../../node_modules/@babel/runtime/helpers/OverloadYield.js ***!
|
|
14
|
+
\*********************************************************************/
|
|
15
|
+
(module) {
|
|
16
|
+
|
|
17
|
+
eval("{function _OverloadYield(e, d) {\n this.v = e, this.k = d;\n}\nmodule.exports = _OverloadYield, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/OverloadYield.js?\n}");
|
|
18
|
+
|
|
19
|
+
/***/ },
|
|
20
|
+
|
|
21
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js"
|
|
22
|
+
/*!****************************************************************************!*\
|
|
23
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***!
|
|
24
|
+
\****************************************************************************/
|
|
25
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
26
|
+
|
|
27
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _arrayLikeToArray)\n/* harmony export */ });\nfunction _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js?\n}");
|
|
28
|
+
|
|
29
|
+
/***/ },
|
|
30
|
+
|
|
31
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js"
|
|
32
|
+
/*!**************************************************************************!*\
|
|
33
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***!
|
|
34
|
+
\**************************************************************************/
|
|
35
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
36
|
+
|
|
37
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _arrayWithHoles)\n/* harmony export */ });\nfunction _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js?\n}");
|
|
38
|
+
|
|
39
|
+
/***/ },
|
|
40
|
+
|
|
41
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"
|
|
42
|
+
/*!****************************************************************************!*\
|
|
43
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js ***!
|
|
44
|
+
\****************************************************************************/
|
|
45
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
|
+
|
|
47
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _asyncToGenerator)\n/* harmony export */ });\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js?\n}");
|
|
48
|
+
|
|
49
|
+
/***/ },
|
|
50
|
+
|
|
51
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js"
|
|
52
|
+
/*!**************************************************************************!*\
|
|
53
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
|
|
54
|
+
\**************************************************************************/
|
|
55
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
|
+
|
|
57
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _defineProperty)\n/* harmony export */ });\n/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ \"../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js\");\n\nfunction _defineProperty(e, r, t) {\n return (r = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js?\n}");
|
|
58
|
+
|
|
59
|
+
/***/ },
|
|
60
|
+
|
|
61
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js"
|
|
62
|
+
/*!********************************************************************************!*\
|
|
63
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js ***!
|
|
64
|
+
\********************************************************************************/
|
|
65
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
66
|
+
|
|
67
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _iterableToArrayLimit)\n/* harmony export */ });\nfunction _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js?\n}");
|
|
68
|
+
|
|
69
|
+
/***/ },
|
|
70
|
+
|
|
71
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js"
|
|
72
|
+
/*!***************************************************************************!*\
|
|
73
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***!
|
|
74
|
+
\***************************************************************************/
|
|
75
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
76
|
+
|
|
77
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _nonIterableRest)\n/* harmony export */ });\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js?\n}");
|
|
78
|
+
|
|
79
|
+
/***/ },
|
|
80
|
+
|
|
81
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js"
|
|
82
|
+
/*!*************************************************************************!*\
|
|
83
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js ***!
|
|
84
|
+
\*************************************************************************/
|
|
85
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
86
|
+
|
|
87
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _slicedToArray)\n/* harmony export */ });\n/* harmony import */ var _arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles.js */ \"../../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js\");\n/* harmony import */ var _iterableToArrayLimit_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit.js */ \"../../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js\");\n/* harmony import */ var _unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsupportedIterableToArray.js */ \"../../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js\");\n/* harmony import */ var _nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nonIterableRest.js */ \"../../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js\");\n\n\n\n\nfunction _slicedToArray(r, e) {\n return (0,_arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(r) || (0,_iterableToArrayLimit_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(r, e) || (0,_unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(r, e) || (0,_nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])();\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js?\n}");
|
|
88
|
+
|
|
89
|
+
/***/ },
|
|
90
|
+
|
|
91
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"
|
|
92
|
+
/*!***********************************************************************!*\
|
|
93
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
|
|
94
|
+
\***********************************************************************/
|
|
95
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
96
|
+
|
|
97
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ toPrimitive)\n/* harmony export */ });\n/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ \"../../../node_modules/@babel/runtime/helpers/esm/typeof.js\");\n\nfunction toPrimitive(t, r) {\n if (\"object\" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js?\n}");
|
|
98
|
+
|
|
99
|
+
/***/ },
|
|
100
|
+
|
|
101
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"
|
|
102
|
+
/*!*************************************************************************!*\
|
|
103
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
|
|
104
|
+
\*************************************************************************/
|
|
105
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
106
|
+
|
|
107
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ toPropertyKey)\n/* harmony export */ });\n/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ \"../../../node_modules/@babel/runtime/helpers/esm/typeof.js\");\n/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ \"../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js\");\n\n\nfunction toPropertyKey(t) {\n var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(t, \"string\");\n return \"symbol\" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(i) ? i : i + \"\";\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js?\n}");
|
|
108
|
+
|
|
109
|
+
/***/ },
|
|
110
|
+
|
|
111
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/typeof.js"
|
|
112
|
+
/*!******************************************************************!*\
|
|
113
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/typeof.js ***!
|
|
114
|
+
\******************************************************************/
|
|
115
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
116
|
+
|
|
117
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _typeof)\n/* harmony export */ });\nfunction _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/typeof.js?\n}");
|
|
118
|
+
|
|
119
|
+
/***/ },
|
|
120
|
+
|
|
121
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js"
|
|
122
|
+
/*!**************************************************************************************!*\
|
|
123
|
+
!*** ../../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***!
|
|
124
|
+
\**************************************************************************************/
|
|
125
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
126
|
+
|
|
127
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _unsupportedIterableToArray)\n/* harmony export */ });\n/* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayLikeToArray.js */ \"../../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js\");\n\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(r, a) : void 0;\n }\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js?\n}");
|
|
128
|
+
|
|
129
|
+
/***/ },
|
|
130
|
+
|
|
131
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regenerator.js"
|
|
132
|
+
/*!*******************************************************************!*\
|
|
133
|
+
!*** ../../../node_modules/@babel/runtime/helpers/regenerator.js ***!
|
|
134
|
+
\*******************************************************************/
|
|
135
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
136
|
+
|
|
137
|
+
eval("{var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ \"../../../node_modules/@babel/runtime/helpers/regeneratorDefine.js\");\nfunction _regenerator() {\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\n var e,\n t,\n r = \"function\" == typeof Symbol ? Symbol : {},\n n = r.iterator || \"@@iterator\",\n o = r.toStringTag || \"@@toStringTag\";\n function i(r, n, o, i) {\n var c = n && n.prototype instanceof Generator ? n : Generator,\n u = Object.create(c.prototype);\n return regeneratorDefine(u, \"_invoke\", function (r, n, o) {\n var i,\n c,\n u,\n f = 0,\n p = o || [],\n y = !1,\n G = {\n p: 0,\n n: 0,\n v: e,\n a: d,\n f: d.bind(e, 4),\n d: function d(t, r) {\n return i = t, c = 0, u = e, G.n = r, a;\n }\n };\n function d(r, n) {\n for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {\n var o,\n i = p[t],\n d = G.p,\n l = i[2];\n r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));\n }\n if (o || r > 1) return a;\n throw y = !0, n;\n }\n return function (o, p, l) {\n if (f > 1) throw TypeError(\"Generator is already running\");\n for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {\n i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);\n try {\n if (f = 2, i) {\n if (c || (o = \"next\"), t = i[o]) {\n if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\");\n if (!t.done) return t;\n u = t.value, c < 2 && (c = 0);\n } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1);\n i = e;\n } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;\n } catch (t) {\n i = e, c = 1, u = t;\n } finally {\n f = 1;\n }\n }\n return {\n value: t,\n done: y\n };\n };\n }(r, o, i), !0), u;\n }\n var a = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n t = Object.getPrototypeOf;\n var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {\n return this;\n }), t),\n u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);\n function f(e) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e;\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, \"constructor\", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", regeneratorDefine(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), regeneratorDefine(u), regeneratorDefine(u, o, \"Generator\"), regeneratorDefine(u, n, function () {\n return this;\n }), regeneratorDefine(u, \"toString\", function () {\n return \"[object Generator]\";\n }), (module.exports = _regenerator = function _regenerator() {\n return {\n w: i,\n m: f\n };\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports)();\n}\nmodule.exports = _regenerator, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/regenerator.js?\n}");
|
|
138
|
+
|
|
139
|
+
/***/ },
|
|
140
|
+
|
|
141
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorAsync.js"
|
|
142
|
+
/*!************************************************************************!*\
|
|
143
|
+
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
|
|
144
|
+
\************************************************************************/
|
|
145
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
146
|
+
|
|
147
|
+
eval("{var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ \"../../../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js\");\nfunction _regeneratorAsync(n, e, r, t, o) {\n var a = regeneratorAsyncGen(n, e, r, t, o);\n return a.next().then(function (n) {\n return n.done ? n.value : a.next();\n });\n}\nmodule.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/regeneratorAsync.js?\n}");
|
|
148
|
+
|
|
149
|
+
/***/ },
|
|
150
|
+
|
|
151
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"
|
|
152
|
+
/*!***************************************************************************!*\
|
|
153
|
+
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
|
|
154
|
+
\***************************************************************************/
|
|
155
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
156
|
+
|
|
157
|
+
eval("{var regenerator = __webpack_require__(/*! ./regenerator.js */ \"../../../node_modules/@babel/runtime/helpers/regenerator.js\");\nvar regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ \"../../../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js\");\nfunction _regeneratorAsyncGen(r, e, t, o, n) {\n return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);\n}\nmodule.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js?\n}");
|
|
158
|
+
|
|
159
|
+
/***/ },
|
|
160
|
+
|
|
161
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"
|
|
162
|
+
/*!********************************************************************************!*\
|
|
163
|
+
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
|
|
164
|
+
\********************************************************************************/
|
|
165
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
166
|
+
|
|
167
|
+
eval("{var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ \"../../../node_modules/@babel/runtime/helpers/OverloadYield.js\");\nvar regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ \"../../../node_modules/@babel/runtime/helpers/regeneratorDefine.js\");\nfunction AsyncIterator(t, e) {\n function n(r, o, i, f) {\n try {\n var c = t[r](o),\n u = c.value;\n return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {\n n(\"next\", t, i, f);\n }, function (t) {\n n(\"throw\", t, i, f);\n }) : e.resolve(u).then(function (t) {\n c.value = t, i(c);\n }, function (t) {\n return n(\"throw\", t, i, f);\n });\n } catch (t) {\n f(t);\n }\n }\n var r;\n this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, \"function\" == typeof Symbol && Symbol.asyncIterator || \"@asyncIterator\", function () {\n return this;\n })), regeneratorDefine(this, \"_invoke\", function (t, o, i) {\n function f() {\n return new e(function (e, r) {\n n(t, i, e, r);\n });\n }\n return r = r ? r.then(f, f) : f();\n }, !0);\n}\nmodule.exports = AsyncIterator, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js?\n}");
|
|
168
|
+
|
|
169
|
+
/***/ },
|
|
170
|
+
|
|
171
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorDefine.js"
|
|
172
|
+
/*!*************************************************************************!*\
|
|
173
|
+
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
|
|
174
|
+
\*************************************************************************/
|
|
175
|
+
(module) {
|
|
176
|
+
|
|
177
|
+
eval("{function _regeneratorDefine(e, r, n, t) {\n var i = Object.defineProperty;\n try {\n i({}, \"\", {});\n } catch (e) {\n i = 0;\n }\n module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {\n function o(r, n) {\n _regeneratorDefine(e, r, function (e) {\n return this._invoke(r, n, e);\n });\n }\n r ? i ? i(e, r, {\n value: n,\n enumerable: !t,\n configurable: !t,\n writable: !t\n }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2));\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _regeneratorDefine(e, r, n, t);\n}\nmodule.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/regeneratorDefine.js?\n}");
|
|
178
|
+
|
|
179
|
+
/***/ },
|
|
180
|
+
|
|
181
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorKeys.js"
|
|
182
|
+
/*!***********************************************************************!*\
|
|
183
|
+
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
|
|
184
|
+
\***********************************************************************/
|
|
185
|
+
(module) {
|
|
186
|
+
|
|
187
|
+
eval("{function _regeneratorKeys(e) {\n var n = Object(e),\n r = [];\n for (var t in n) r.unshift(t);\n return function e() {\n for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;\n return e.done = !0, e;\n };\n}\nmodule.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/regeneratorKeys.js?\n}");
|
|
188
|
+
|
|
189
|
+
/***/ },
|
|
190
|
+
|
|
191
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js"
|
|
192
|
+
/*!**************************************************************************!*\
|
|
193
|
+
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
|
|
194
|
+
\**************************************************************************/
|
|
195
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
196
|
+
|
|
197
|
+
eval("{var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ \"../../../node_modules/@babel/runtime/helpers/OverloadYield.js\");\nvar regenerator = __webpack_require__(/*! ./regenerator.js */ \"../../../node_modules/@babel/runtime/helpers/regenerator.js\");\nvar regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ \"../../../node_modules/@babel/runtime/helpers/regeneratorAsync.js\");\nvar regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ \"../../../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js\");\nvar regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ \"../../../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js\");\nvar regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ \"../../../node_modules/@babel/runtime/helpers/regeneratorKeys.js\");\nvar regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ \"../../../node_modules/@babel/runtime/helpers/regeneratorValues.js\");\nfunction _regeneratorRuntime() {\n \"use strict\";\n\n var r = regenerator(),\n e = r.m(_regeneratorRuntime),\n t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;\n function n(r) {\n var e = \"function\" == typeof r && r.constructor;\n return !!e && (e === t || \"GeneratorFunction\" === (e.displayName || e.name));\n }\n var o = {\n \"throw\": 1,\n \"return\": 2,\n \"break\": 3,\n \"continue\": 3\n };\n function a(r) {\n var e, t;\n return function (n) {\n e || (e = {\n stop: function stop() {\n return t(n.a, 2);\n },\n \"catch\": function _catch() {\n return n.v;\n },\n abrupt: function abrupt(r, e) {\n return t(n.a, o[r], e);\n },\n delegateYield: function delegateYield(r, o, a) {\n return e.resultName = o, t(n.d, regeneratorValues(r), a);\n },\n finish: function finish(r) {\n return t(n.f, r);\n }\n }, t = function t(r, _t, o) {\n n.p = e.prev, n.n = e.next;\n try {\n return r(_t, o);\n } finally {\n e.next = n.n;\n }\n }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;\n try {\n return r.call(this, e);\n } finally {\n n.p = e.prev, n.n = e.next;\n }\n };\n }\n return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return {\n wrap: function wrap(e, t, n, o) {\n return r.w(a(e), t, n, o && o.reverse());\n },\n isGeneratorFunction: n,\n mark: r.m,\n awrap: function awrap(r, e) {\n return new OverloadYield(r, e);\n },\n AsyncIterator: regeneratorAsyncIterator,\n async: function async(r, e, t, o, u) {\n return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);\n },\n keys: regeneratorKeys,\n values: regeneratorValues\n };\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports)();\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js?\n}");
|
|
198
|
+
|
|
199
|
+
/***/ },
|
|
200
|
+
|
|
201
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorValues.js"
|
|
202
|
+
/*!*************************************************************************!*\
|
|
203
|
+
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
|
|
204
|
+
\*************************************************************************/
|
|
205
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
206
|
+
|
|
207
|
+
eval("{var _typeof = (__webpack_require__(/*! ./typeof.js */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\")[\"default\"]);\nfunction _regeneratorValues(e) {\n if (null != e) {\n var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"],\n r = 0;\n if (t) return t.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) return {\n next: function next() {\n return e && r >= e.length && (e = void 0), {\n value: e && e[r++],\n done: !e\n };\n }\n };\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n}\nmodule.exports = _regeneratorValues, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/regeneratorValues.js?\n}");
|
|
208
|
+
|
|
209
|
+
/***/ },
|
|
210
|
+
|
|
211
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/typeof.js"
|
|
212
|
+
/*!**************************************************************!*\
|
|
213
|
+
!*** ../../../node_modules/@babel/runtime/helpers/typeof.js ***!
|
|
214
|
+
\**************************************************************/
|
|
215
|
+
(module) {
|
|
216
|
+
|
|
217
|
+
eval("{function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/helpers/typeof.js?\n}");
|
|
218
|
+
|
|
219
|
+
/***/ },
|
|
220
|
+
|
|
221
|
+
/***/ "../../../node_modules/@babel/runtime/regenerator/index.js"
|
|
222
|
+
/*!*****************************************************************!*\
|
|
223
|
+
!*** ../../../node_modules/@babel/runtime/regenerator/index.js ***!
|
|
224
|
+
\*****************************************************************/
|
|
225
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
226
|
+
|
|
227
|
+
eval("{// TODO(Babel 8): Remove this file.\n\nvar runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ \"../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n\n\n//# sourceURL=webpack:///../../../node_modules/@babel/runtime/regenerator/index.js?\n}");
|
|
228
|
+
|
|
229
|
+
/***/ },
|
|
230
|
+
|
|
231
|
+
/***/ "./casActionRun.js"
|
|
232
|
+
/*!*************************!*\
|
|
233
|
+
!*** ./casActionRun.js ***!
|
|
234
|
+
\*************************/
|
|
235
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
236
|
+
|
|
237
|
+
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/esm/asyncToGenerator.js\");\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/**\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//\nfunction casActionRun(_x) {\n return _casActionRun.apply(this, arguments);\n}\nfunction _casActionRun() {\n _casActionRun = (0,_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:///./casActionRun.js?\n}");
|
|
238
|
+
|
|
239
|
+
/***/ },
|
|
240
|
+
|
|
241
|
+
/***/ "./casAppendTable.js"
|
|
242
|
+
/*!***************************!*\
|
|
243
|
+
!*** ./casAppendTable.js ***!
|
|
244
|
+
\***************************/
|
|
245
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
246
|
+
|
|
247
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslRunBase.js */ \"./caslRunBase.js\");\n/* harmony import */ var _casSaveTable_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./casSaveTable.js */ \"./casSaveTable.js\");\n/* harmony import */ var _programs_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./programs/index.js */ \"./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* @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 = (0,_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_index_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['commonCasl']() + ' ' + _programs_index_js__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_js__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_js__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:///./casAppendTable.js?\n}");
|
|
248
|
+
|
|
249
|
+
/***/ },
|
|
250
|
+
|
|
251
|
+
/***/ "./casFetchData.js"
|
|
252
|
+
/*!*************************!*\
|
|
253
|
+
!*** ./casFetchData.js ***!
|
|
254
|
+
\*************************/
|
|
255
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
256
|
+
|
|
257
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslRunBase.js */ \"./caslRunBase.js\");\n/* harmony import */ var _programs_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./programs/index.js */ \"./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 * @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 = (0,_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_index_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]['commonCasl']() + ' ' + _programs_index_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]['casFetchData'](); // console.log(src);\n _context.next = 1;\n return (0,_caslRunBase_js__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:///./casFetchData.js?\n}");
|
|
258
|
+
|
|
259
|
+
/***/ },
|
|
260
|
+
|
|
261
|
+
/***/ "./casFetchRows.js"
|
|
262
|
+
/*!*************************!*\
|
|
263
|
+
!*** ./casFetchRows.js ***!
|
|
264
|
+
\*************************/
|
|
265
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
266
|
+
|
|
267
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslRunBase.js */ \"./caslRunBase.js\");\n/* harmony import */ var _programs_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./programs/index.js */ \"./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 * 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 = (0,_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_index_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]['commonCasl']() + ' ' + _programs_index_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]['casFetchRows']();\n _context.next = 1;\n return (0,_caslRunBase_js__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:///./casFetchRows.js?\n}");
|
|
268
|
+
|
|
269
|
+
/***/ },
|
|
270
|
+
|
|
271
|
+
/***/ "./casLoadTable.js"
|
|
272
|
+
/*!*************************!*\
|
|
273
|
+
!*** ./casLoadTable.js ***!
|
|
274
|
+
\*************************/
|
|
275
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
276
|
+
|
|
277
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslRun.js */ \"./caslRun.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 * @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 = (0,_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_js__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:///./casLoadTable.js?\n}");
|
|
278
|
+
|
|
279
|
+
/***/ },
|
|
280
|
+
|
|
281
|
+
/***/ "./casSaveTable.js"
|
|
282
|
+
/*!*************************!*\
|
|
283
|
+
!*** ./casSaveTable.js ***!
|
|
284
|
+
\*************************/
|
|
285
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
286
|
+
|
|
287
|
+
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/esm/asyncToGenerator.js\");\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/**\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 */\nfunction casSaveTable(_x, _x2, _x3, _x4, _x5) {\n return _casSaveTable.apply(this, arguments);\n}\nfunction _casSaveTable() {\n _casSaveTable = (0,_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:///./casSaveTable.js?\n}");
|
|
288
|
+
|
|
289
|
+
/***/ },
|
|
290
|
+
|
|
291
|
+
/***/ "./casSetup.js"
|
|
292
|
+
/*!*********************!*\
|
|
293
|
+
!*** ./casSetup.js ***!
|
|
294
|
+
\*********************/
|
|
295
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
296
|
+
|
|
297
|
+
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/esm/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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 * ------------------------------------------------------------------------------------\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;\nfunction casSetup(_x, _x2, _x3, _x4) {\n return _casSetup.apply(this, arguments);\n}\nfunction _casSetup() {\n _casSetup = (0,_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 (!((0,_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:///./casSetup.js?\n}");
|
|
298
|
+
|
|
299
|
+
/***/ },
|
|
300
|
+
|
|
301
|
+
/***/ "./casTableToJson.js"
|
|
302
|
+
/*!***************************!*\
|
|
303
|
+
!*** ./casTableToJson.js ***!
|
|
304
|
+
\***************************/
|
|
305
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
306
|
+
|
|
307
|
+
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 * @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 */\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:///./casTableToJson.js?\n}");
|
|
308
|
+
|
|
309
|
+
/***/ },
|
|
310
|
+
|
|
311
|
+
/***/ "./casUpdateData.js"
|
|
312
|
+
/*!**************************!*\
|
|
313
|
+
!*** ./casUpdateData.js ***!
|
|
314
|
+
\**************************/
|
|
315
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
316
|
+
|
|
317
|
+
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/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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) { (0,_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 = (0,_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:///./casUpdateData.js?\n}");
|
|
318
|
+
|
|
319
|
+
/***/ },
|
|
320
|
+
|
|
321
|
+
/***/ "./casUpload.js"
|
|
322
|
+
/*!**********************!*\
|
|
323
|
+
!*** ./casUpload.js ***!
|
|
324
|
+
\**********************/
|
|
325
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
326
|
+
|
|
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_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/esm/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uploadSetup.js */ \"./uploadSetup.js\");\n/* harmony import */ var _uploadHandlers_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./uploadHandlers/index.js */ \"./uploadHandlers/index.js\");\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\n//import fs from 'fs';\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 = (0,_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 ((0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(output) === 'object') {\n table = \"\".concat(output.caslib, \".\").concat(output.name);\n }\n fileInfo = (0,_uploadSetup_js__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:///./casUpload.js?\n}");
|
|
328
|
+
|
|
329
|
+
/***/ },
|
|
330
|
+
|
|
331
|
+
/***/ "./caslDescribe.js"
|
|
332
|
+
/*!*************************!*\
|
|
333
|
+
!*** ./caslDescribe.js ***!
|
|
334
|
+
\*************************/
|
|
335
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
336
|
+
|
|
337
|
+
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/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslRunBase.js */ \"./caslRunBase.js\");\n/* harmony import */ var _programs_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./programs/index.js */ \"./programs/index.js\");\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) { (0,_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 *\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\nfunction caslDescribe(_x, _x2, _x3) {\n return _caslDescribe.apply(this, arguments);\n}\nfunction _caslDescribe() {\n _caslDescribe = (0,_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_index_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['commonCasl']() + ' ' + _programs_index_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['scoreCasl']();\n appEnv = _objectSpread({\n path: '/describe'\n }, scenario);\n _context.next = 1;\n return (0,_caslRunBase_js__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:///./caslDescribe.js?\n}");
|
|
338
|
+
|
|
339
|
+
/***/ },
|
|
340
|
+
|
|
341
|
+
/***/ "./caslRun.js"
|
|
342
|
+
/*!********************!*\
|
|
343
|
+
!*** ./caslRun.js ***!
|
|
344
|
+
\********************/
|
|
345
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
346
|
+
|
|
347
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslRunBase.js */ \"./caslRunBase.js\");\n/* harmony import */ var _programs_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./programs/index.js */ \"./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 = (0,_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_index_js__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_js__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:///./caslRun.js?\n}");
|
|
348
|
+
|
|
349
|
+
/***/ },
|
|
350
|
+
|
|
351
|
+
/***/ "./caslRunBase.js"
|
|
352
|
+
/*!************************!*\
|
|
353
|
+
!*** ./caslRunBase.js ***!
|
|
354
|
+
\************************/
|
|
355
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
356
|
+
|
|
357
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jsonToDict.js */ \"./jsonToDict.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 * 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 {promise} standard return value from apiCall\n */\nfunction caslRunBase(_x, _x2, _x3, _x4) {\n return _caslRunBase.apply(this, arguments);\n}\nfunction _caslRunBase() {\n _caslRunBase = (0,_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_js__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:///./caslRunBase.js?\n}");
|
|
358
|
+
|
|
359
|
+
/***/ },
|
|
360
|
+
|
|
361
|
+
/***/ "./caslScore.js"
|
|
362
|
+
/*!**********************!*\
|
|
363
|
+
!*** ./caslScore.js ***!
|
|
364
|
+
\**********************/
|
|
365
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
366
|
+
|
|
367
|
+
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/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslRunBase.js */ \"./caslRunBase.js\");\n/* harmony import */ var _programs_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./programs/index.js */ \"./programs/index.js\");\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) { (0,_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 * 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\nfunction caslScore(_x, _x2, _x3) {\n return _caslScore.apply(this, arguments);\n}\nfunction _caslScore() {\n _caslScore = (0,_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_index_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['commonCasl']() + ' ' + _programs_index_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]['scoreCasl']();\n appEnv = _objectSpread({\n path: '/score'\n }, scenario);\n _context.next = 1;\n return (0,_caslRunBase_js__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:///./caslScore.js?\n}");
|
|
368
|
+
|
|
369
|
+
/***/ },
|
|
370
|
+
|
|
371
|
+
/***/ "./computeAppendTable.js"
|
|
372
|
+
/*!*******************************!*\
|
|
373
|
+
!*** ./computeAppendTable.js ***!
|
|
374
|
+
\*******************************/
|
|
375
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
376
|
+
|
|
377
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeRun.js */ \"./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\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 = (0,_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_js__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:///./computeAppendTable.js?\n}");
|
|
378
|
+
|
|
379
|
+
/***/ },
|
|
380
|
+
|
|
381
|
+
/***/ "./computeFetchData.js"
|
|
382
|
+
/*!*****************************!*\
|
|
383
|
+
!*** ./computeFetchData.js ***!
|
|
384
|
+
\*****************************/
|
|
385
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
386
|
+
|
|
387
|
+
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/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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) { (0,_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 = (0,_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:///./computeFetchData.js?\n}");
|
|
388
|
+
|
|
389
|
+
/***/ },
|
|
390
|
+
|
|
391
|
+
/***/ "./computeFileContent.js"
|
|
392
|
+
/*!*******************************!*\
|
|
393
|
+
!*** ./computeFileContent.js ***!
|
|
394
|
+
\*******************************/
|
|
395
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
396
|
+
|
|
397
|
+
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/esm/asyncToGenerator.js\");\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//\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 * @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 */\nfunction computeFileContent(_x, _x2, _x3, _x4) {\n return _computeFileContent.apply(this, arguments);\n}\nfunction _computeFileContent() {\n _computeFileContent = (0,_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:///./computeFileContent.js?\n}");
|
|
398
|
+
|
|
399
|
+
/***/ },
|
|
400
|
+
|
|
401
|
+
/***/ "./computeResults.js"
|
|
402
|
+
/*!***************************!*\
|
|
403
|
+
!*** ./computeResults.js ***!
|
|
404
|
+
\***************************/
|
|
405
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
406
|
+
|
|
407
|
+
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/esm/asyncToGenerator.js\");\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 = (0,_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:///./computeResults.js?\n}");
|
|
408
|
+
|
|
409
|
+
/***/ },
|
|
410
|
+
|
|
411
|
+
/***/ "./computeRun.js"
|
|
412
|
+
/*!***********************!*\
|
|
413
|
+
!*** ./computeRun.js ***!
|
|
414
|
+
\***********************/
|
|
415
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
416
|
+
|
|
417
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeRunBase.js */ \"./computeRunBase.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 * @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 */\nfunction computeRun(_x, _x2, _x3, _x4, _x5, _x6, _x7) {\n return _computeRun.apply(this, arguments);\n}\nfunction _computeRun() {\n _computeRun = (0,_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_js__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:///./computeRun.js?\n}");
|
|
418
|
+
|
|
419
|
+
/***/ },
|
|
420
|
+
|
|
421
|
+
/***/ "./computeRunBase.js"
|
|
422
|
+
/*!***************************!*\
|
|
423
|
+
!*** ./computeRunBase.js ***!
|
|
424
|
+
\***************************/
|
|
425
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
426
|
+
|
|
427
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeSummary.js */ \"./computeSummary.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 * @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 = (0,_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_js__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:///./computeRunBase.js?\n}");
|
|
428
|
+
|
|
429
|
+
/***/ },
|
|
430
|
+
|
|
431
|
+
/***/ "./computeSetup.js"
|
|
432
|
+
/*!*************************!*\
|
|
433
|
+
!*** ./computeSetup.js ***!
|
|
434
|
+
\*************************/
|
|
435
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
436
|
+
|
|
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_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/esm/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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/**\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 */\nfunction computeSetup(_x, _x2, _x3, _x4, _x5) {\n return _computeSetup.apply(this, arguments);\n}\nfunction _computeSetup() {\n _computeSetup = (0,_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 && (0,_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:///./computeSetup.js?\n}");
|
|
438
|
+
|
|
439
|
+
/***/ },
|
|
440
|
+
|
|
441
|
+
/***/ "./computeSetupTables.js"
|
|
442
|
+
/*!*******************************!*\
|
|
443
|
+
!*** ./computeSetupTables.js ***!
|
|
444
|
+
\*******************************/
|
|
445
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
446
|
+
|
|
447
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeSummary.js */ \"./computeSummary.js\");\n/* harmony import */ var _computeRun_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./computeRun.js */ \"./computeRun.js\");\n/* harmony import */ var _computeResults_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./computeResults.js */ \"./computeResults.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 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 = (0,_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_js__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_js__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:///./computeSetupTables.js?\n}");
|
|
448
|
+
|
|
449
|
+
/***/ },
|
|
450
|
+
|
|
451
|
+
/***/ "./computeSummary.js"
|
|
452
|
+
/*!***************************!*\
|
|
453
|
+
!*** ./computeSummary.js ***!
|
|
454
|
+
\***************************/
|
|
455
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
456
|
+
|
|
457
|
+
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/esm/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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 = (0,_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 = (0,_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 = (0,_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 = (0,_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:///./computeSummary.js?\n}");
|
|
458
|
+
|
|
459
|
+
/***/ },
|
|
460
|
+
|
|
461
|
+
/***/ "./computeUpdateData.js"
|
|
462
|
+
/*!******************************!*\
|
|
463
|
+
!*** ./computeUpdateData.js ***!
|
|
464
|
+
\******************************/
|
|
465
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
466
|
+
|
|
467
|
+
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/esm/asyncToGenerator.js\");\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 = (0,_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:///./computeUpdateData.js?\n}");
|
|
468
|
+
|
|
469
|
+
/***/ },
|
|
470
|
+
|
|
471
|
+
/***/ "./computeUpload.js"
|
|
472
|
+
/*!**************************!*\
|
|
473
|
+
!*** ./computeUpload.js ***!
|
|
474
|
+
\**************************/
|
|
475
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
476
|
+
|
|
477
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeRun.js */ \"./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 = (0,_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_js__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:///./computeUpload.js?\n}");
|
|
478
|
+
|
|
479
|
+
/***/ },
|
|
480
|
+
|
|
481
|
+
/***/ "./findReport.js"
|
|
482
|
+
/*!***********************!*\
|
|
483
|
+
!*** ./findReport.js ***!
|
|
484
|
+
\***********************/
|
|
485
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
486
|
+
|
|
487
|
+
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/esm/asyncToGenerator.js\");\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;\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 */\nfunction findReport(_x, _x2) {\n return _findReport.apply(this, arguments);\n}\nfunction _findReport() {\n _findReport = (0,_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:///./findReport.js?\n}");
|
|
488
|
+
|
|
489
|
+
/***/ },
|
|
490
|
+
|
|
491
|
+
/***/ "./getReportImage.js"
|
|
492
|
+
/*!***************************!*\
|
|
493
|
+
!*** ./getReportImage.js ***!
|
|
494
|
+
\***************************/
|
|
495
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
496
|
+
|
|
497
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./findReport.js */ \"./findReport.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 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\nfunction getReportImage(_x, _x2) {\n return _getReportImage.apply(this, arguments);\n}\nfunction _getReportImage() {\n _getReportImage = (0,_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_js__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:///./getReportImage.js?\n}");
|
|
498
|
+
|
|
499
|
+
/***/ },
|
|
500
|
+
|
|
501
|
+
/***/ "./getReportUri.js"
|
|
502
|
+
/*!*************************!*\
|
|
503
|
+
!*** ./getReportUri.js ***!
|
|
504
|
+
\*************************/
|
|
505
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
506
|
+
|
|
507
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./findReport.js */ \"./findReport.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 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\nfunction getReportUri(_x, _x2) {\n return _getReportUri.apply(this, arguments);\n}\nfunction _getReportUri() {\n _getReportUri = (0,_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_js__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:///./getReportUri.js?\n}");
|
|
508
|
+
|
|
509
|
+
/***/ },
|
|
510
|
+
|
|
511
|
+
/***/ "./getSasTableRows.js"
|
|
512
|
+
/*!****************************!*\
|
|
513
|
+
!*** ./getSasTableRows.js ***!
|
|
514
|
+
\****************************/
|
|
515
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
516
|
+
|
|
517
|
+
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/esm/asyncToGenerator.js\");\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//\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 * @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 */\nfunction getSasTableRows(_x, _x2, _x3) {\n return _getSasTableRows.apply(this, arguments);\n}\nfunction _getSasTableRows() {\n _getSasTableRows = (0,_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:///./getSasTableRows.js?\n}");
|
|
518
|
+
|
|
519
|
+
/***/ },
|
|
520
|
+
|
|
521
|
+
/***/ "./getScoreStep.js"
|
|
522
|
+
/*!*************************!*\
|
|
523
|
+
!*** ./getScoreStep.js ***!
|
|
524
|
+
\*************************/
|
|
525
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
526
|
+
|
|
527
|
+
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/esm/asyncToGenerator.js\");\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 * @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 = (0,_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:///./getScoreStep.js?\n}");
|
|
528
|
+
|
|
529
|
+
/***/ },
|
|
530
|
+
|
|
531
|
+
/***/ "./index.js"
|
|
532
|
+
/*!******************!*\
|
|
533
|
+
!*** ./index.js ***!
|
|
534
|
+
\******************/
|
|
535
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
536
|
+
|
|
537
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ casActionRun: () => (/* reexport safe */ _casActionRun_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]),\n/* harmony export */ casAppendTable: () => (/* reexport safe */ _casAppendTable_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"]),\n/* harmony export */ casFetchData: () => (/* reexport safe */ _casFetchData_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */ casFetchRows: () => (/* reexport safe */ _casFetchRows_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n/* harmony export */ casLoadTable: () => (/* reexport safe */ _casLoadTable_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"]),\n/* harmony export */ casSaveTable: () => (/* reexport safe */ _casSaveTable_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"]),\n/* harmony export */ casSetup: () => (/* reexport safe */ _casSetup_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */ casTableToJson: () => (/* reexport safe */ _casTableToJson_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"]),\n/* harmony export */ casUpdateData: () => (/* reexport safe */ _casUpdateData_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n/* harmony export */ casUpload: () => (/* reexport safe */ _casUpload_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]),\n/* harmony export */ caslDescribe: () => (/* reexport safe */ _caslDescribe_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ caslRun: () => (/* reexport safe */ _caslRun_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ caslRunBase: () => (/* reexport safe */ _caslRunBase_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ caslScore: () => (/* reexport safe */ _caslScore_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ computeAppendTable: () => (/* reexport safe */ _computeAppendTable_js__WEBPACK_IMPORTED_MODULE_21__[\"default\"]),\n/* harmony export */ computeFetchData: () => (/* reexport safe */ _computeFetchData_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"]),\n/* harmony export */ computeFileContent: () => (/* reexport safe */ _computeFileContent_js__WEBPACK_IMPORTED_MODULE_20__[\"default\"]),\n/* harmony export */ computeResults: () => (/* reexport safe */ _computeResults_js__WEBPACK_IMPORTED_MODULE_18__[\"default\"]),\n/* harmony export */ computeRun: () => (/* reexport safe */ _computeRun_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"]),\n/* harmony export */ computeSetup: () => (/* reexport safe */ _computeSetup_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"]),\n/* harmony export */ computeSetupTables: () => (/* reexport safe */ _computeSetupTables_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"]),\n/* harmony export */ computeSummary: () => (/* reexport safe */ _computeSummary_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"]),\n/* harmony export */ computeUpdateData: () => (/* reexport safe */ _computeUpdateData_js__WEBPACK_IMPORTED_MODULE_22__[\"default\"]),\n/* harmony export */ computeUpload: () => (/* reexport safe */ _computeUpload_js__WEBPACK_IMPORTED_MODULE_23__[\"default\"]),\n/* harmony export */ findReport: () => (/* reexport safe */ _findReport_js__WEBPACK_IMPORTED_MODULE_24__[\"default\"]),\n/* harmony export */ getReportImage: () => (/* reexport safe */ _getReportImage_js__WEBPACK_IMPORTED_MODULE_25__[\"default\"]),\n/* harmony export */ getReportUri: () => (/* reexport safe */ _getReportUri_js__WEBPACK_IMPORTED_MODULE_26__[\"default\"]),\n/* harmony export */ getSasTableRows: () => (/* reexport safe */ _getSasTableRows_js__WEBPACK_IMPORTED_MODULE_27__[\"default\"]),\n/* harmony export */ jesRun: () => (/* reexport safe */ _jesRun_js__WEBPACK_IMPORTED_MODULE_28__[\"default\"]),\n/* harmony export */ jobRun: () => (/* reexport safe */ _jobRun_js__WEBPACK_IMPORTED_MODULE_29__[\"default\"]),\n/* harmony export */ jsonToDict: () => (/* reexport safe */ _jsonToDict_js__WEBPACK_IMPORTED_MODULE_30__[\"default\"]),\n/* harmony export */ masAddModel: () => (/* reexport safe */ _masAddModel_js__WEBPACK_IMPORTED_MODULE_35__[\"default\"]),\n/* harmony export */ masDescribe: () => (/* reexport safe */ _masDescribe_js__WEBPACK_IMPORTED_MODULE_32__[\"default\"]),\n/* harmony export */ masRun: () => (/* reexport safe */ _masRun_js__WEBPACK_IMPORTED_MODULE_33__[\"default\"]),\n/* harmony export */ masScore: () => (/* reexport safe */ _masScore_js__WEBPACK_IMPORTED_MODULE_34__[\"default\"]),\n/* harmony export */ masSetup: () => (/* reexport safe */ _masSetup_js__WEBPACK_IMPORTED_MODULE_31__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _caslRun_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./caslRun.js */ \"./caslRun.js\");\n/* harmony import */ var _caslRunBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./caslRunBase.js */ \"./caslRunBase.js\");\n/* harmony import */ var _caslScore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslScore.js */ \"./caslScore.js\");\n/* harmony import */ var _caslDescribe_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslDescribe.js */ \"./caslDescribe.js\");\n/* harmony import */ var _casSetup_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casSetup.js */ \"./casSetup.js\");\n/* harmony import */ var _casActionRun_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./casActionRun.js */ \"./casActionRun.js\");\n/* harmony import */ var _casFetchData_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./casFetchData.js */ \"./casFetchData.js\");\n/* harmony import */ var _casFetchRows_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./casFetchRows.js */ \"./casFetchRows.js\");\n/* harmony import */ var _casUpdateData_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./casUpdateData.js */ \"./casUpdateData.js\");\n/* harmony import */ var _casAppendTable_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./casAppendTable.js */ \"./casAppendTable.js\");\n/* harmony import */ var _casTableToJson_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./casTableToJson.js */ \"./casTableToJson.js\");\n/* harmony import */ var _casUpload_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./casUpload.js */ \"./casUpload.js\");\n/* harmony import */ var _casSaveTable_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./casSaveTable.js */ \"./casSaveTable.js\");\n/* harmony import */ var _casLoadTable_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./casLoadTable.js */ \"./casLoadTable.js\");\n/* harmony import */ var _computeRun_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./computeRun.js */ \"./computeRun.js\");\n/* harmony import */ var _computeSetup_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./computeSetup.js */ \"./computeSetup.js\");\n/* harmony import */ var _computeSummary_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./computeSummary.js */ \"./computeSummary.js\");\n/* harmony import */ var _computeSetupTables_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./computeSetupTables.js */ \"./computeSetupTables.js\");\n/* harmony import */ var _computeResults_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./computeResults.js */ \"./computeResults.js\");\n/* harmony import */ var _computeFetchData_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./computeFetchData.js */ \"./computeFetchData.js\");\n/* harmony import */ var _computeFileContent_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./computeFileContent.js */ \"./computeFileContent.js\");\n/* harmony import */ var _computeAppendTable_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./computeAppendTable.js */ \"./computeAppendTable.js\");\n/* harmony import */ var _computeUpdateData_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./computeUpdateData.js */ \"./computeUpdateData.js\");\n/* harmony import */ var _computeUpload_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./computeUpload.js */ \"./computeUpload.js\");\n/* harmony import */ var _findReport_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./findReport.js */ \"./findReport.js\");\n/* harmony import */ var _getReportImage_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./getReportImage.js */ \"./getReportImage.js\");\n/* harmony import */ var _getReportUri_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./getReportUri.js */ \"./getReportUri.js\");\n/* harmony import */ var _getSasTableRows_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./getSasTableRows.js */ \"./getSasTableRows.js\");\n/* harmony import */ var _jesRun_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./jesRun.js */ \"./jesRun.js\");\n/* harmony import */ var _jobRun_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./jobRun.js */ \"./jobRun.js\");\n/* harmony import */ var _jsonToDict_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./jsonToDict.js */ \"./jsonToDict.js\");\n/* harmony import */ var _masSetup_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./masSetup.js */ \"./masSetup.js\");\n/* harmony import */ var _masDescribe_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./masDescribe.js */ \"./masDescribe.js\");\n/* harmony import */ var _masRun_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./masRun.js */ \"./masRun.js\");\n/* harmony import */ var _masScore_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./masScore.js */ \"./masScore.js\");\n/* harmony import */ var _masAddModel_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./masAddModel.js */ \"./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\n\n\n\n\n\n\n\n\n//import libx from './lib.js';\n\n//let lib = libx();\n\n\n//# sourceURL=webpack:///./index.js?\n}");
|
|
538
|
+
|
|
539
|
+
/***/ },
|
|
540
|
+
|
|
541
|
+
/***/ "./jesRun.js"
|
|
542
|
+
/*!*******************!*\
|
|
543
|
+
!*** ./jesRun.js ***!
|
|
544
|
+
\*******************/
|
|
545
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
546
|
+
|
|
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_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./jesRunBase.js */ \"./jesRunBase.js\");\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) { (0,_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/**\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 = (0,_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_js__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 = (0,_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 console.log(jdefList.items().toJS());\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:///./jesRun.js?\n}");
|
|
548
|
+
|
|
549
|
+
/***/ },
|
|
550
|
+
|
|
551
|
+
/***/ "./jesRunBase.js"
|
|
552
|
+
/*!***********************!*\
|
|
553
|
+
!*** ./jesRunBase.js ***!
|
|
554
|
+
\***********************/
|
|
555
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
556
|
+
|
|
557
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jesSummary.js */ \"./jesSummary.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// 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 = (0,_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_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, status.job);\n case 7:\n results = _context.sent;\n results.status = status.data;\n return _context.abrupt(\"return\", results);\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:///./jesRunBase.js?\n}");
|
|
558
|
+
|
|
559
|
+
/***/ },
|
|
560
|
+
|
|
561
|
+
/***/ "./jesSummary.js"
|
|
562
|
+
/*!***********************!*\
|
|
563
|
+
!*** ./jesSummary.js ***!
|
|
564
|
+
\***********************/
|
|
565
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
566
|
+
|
|
567
|
+
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/esm/asyncToGenerator.js\");\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 = (0,_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 = (0,_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 = (0,_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 if (!Array.isArray(_r)) {\n _context2.next = 6;\n break;\n }\n return _context2.abrupt(\"return\", _r);\n case 6:\n t = [];\n Object.values(_r).forEach(function (value) {\n t.push(value);\n });\n return _context2.abrupt(\"return\", t);\n case 7:\n return _context2.abrupt(\"return\", _r);\n case 8:\n _context2.next = 10;\n break;\n case 9:\n _context2.prev = 9;\n _t = _context2[\"catch\"](2);\n return _context2.abrupt(\"return\", null);\n case 10:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[2, 9]]);\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 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:///./jesSummary.js?\n}");
|
|
568
|
+
|
|
569
|
+
/***/ },
|
|
570
|
+
|
|
571
|
+
/***/ "./jobRun.js"
|
|
572
|
+
/*!*******************!*\
|
|
573
|
+
!*** ./jobRun.js ***!
|
|
574
|
+
\*******************/
|
|
575
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
576
|
+
|
|
577
|
+
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/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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\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) { (0,_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/**\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\nfunction jobRun(_x, _x2, _x3) {\n return _jobRun.apply(this, arguments);\n}\nfunction _jobRun() {\n _jobRun = (0,_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:///./jobRun.js?\n}");
|
|
578
|
+
|
|
579
|
+
/***/ },
|
|
580
|
+
|
|
581
|
+
/***/ "./jsonToDict.js"
|
|
582
|
+
/*!***********************!*\
|
|
583
|
+
!*** ./jsonToDict.js ***!
|
|
584
|
+
\***********************/
|
|
585
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
586
|
+
|
|
587
|
+
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/esm/typeof.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/**\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 = (0,_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 = (0,_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:///./jsonToDict.js?\n}");
|
|
588
|
+
|
|
589
|
+
/***/ },
|
|
590
|
+
|
|
591
|
+
/***/ "./masAddModel.js"
|
|
592
|
+
/*!************************!*\
|
|
593
|
+
!*** ./masAddModel.js ***!
|
|
594
|
+
\************************/
|
|
595
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
596
|
+
|
|
597
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getScoreStep.js */ \"./getScoreStep.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 * 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\nfunction masAddModel(_x, _x2, _x3) {\n return _masAddModel.apply(this, arguments);\n}\nfunction _masAddModel() {\n _masAddModel = (0,_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_js__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:///./masAddModel.js?\n}");
|
|
598
|
+
|
|
599
|
+
/***/ },
|
|
600
|
+
|
|
601
|
+
/***/ "./masDescribe.js"
|
|
602
|
+
/*!************************!*\
|
|
603
|
+
!*** ./masDescribe.js ***!
|
|
604
|
+
\************************/
|
|
605
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
606
|
+
|
|
607
|
+
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:///./masDescribe.js?\n}");
|
|
608
|
+
|
|
609
|
+
/***/ },
|
|
610
|
+
|
|
611
|
+
/***/ "./masRun.js"
|
|
612
|
+
/*!*******************!*\
|
|
613
|
+
!*** ./masRun.js ***!
|
|
614
|
+
\*******************/
|
|
615
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
616
|
+
|
|
617
|
+
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/esm/asyncToGenerator.js\");\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 = (0,_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:///./masRun.js?\n}");
|
|
618
|
+
|
|
619
|
+
/***/ },
|
|
620
|
+
|
|
621
|
+
/***/ "./masScore.js"
|
|
622
|
+
/*!*********************!*\
|
|
623
|
+
!*** ./masScore.js ***!
|
|
624
|
+
\*********************/
|
|
625
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
626
|
+
|
|
627
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./masSetup.js */ \"./masSetup.js\");\n/* harmony import */ var _masRun_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./masRun.js */ \"./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 = (0,_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_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(store, [modelName]);\n case 1:\n masControl = _context.sent;\n _context.next = 2;\n return (0,_masRun_js__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:///./masScore.js?\n}");
|
|
628
|
+
|
|
629
|
+
/***/ },
|
|
630
|
+
|
|
631
|
+
/***/ "./masSetup.js"
|
|
632
|
+
/*!*********************!*\
|
|
633
|
+
!*** ./masSetup.js ***!
|
|
634
|
+
\*********************/
|
|
635
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
636
|
+
|
|
637
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getScoreStep.js */ \"./getScoreStep.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 * 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\nfunction masSetup(_x, _x2, _x3) {\n return _masSetup.apply(this, arguments);\n}\nfunction _masSetup() {\n _masSetup = (0,_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_js__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:///./masSetup.js?\n}");
|
|
638
|
+
|
|
639
|
+
/***/ },
|
|
640
|
+
|
|
641
|
+
/***/ "./programs/casAppendTable.js"
|
|
642
|
+
/*!************************************!*\
|
|
643
|
+
!*** ./programs/casAppendTable.js ***!
|
|
644
|
+
\************************************/
|
|
645
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
646
|
+
|
|
647
|
+
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:///./programs/casAppendTable.js?\n}");
|
|
648
|
+
|
|
649
|
+
/***/ },
|
|
650
|
+
|
|
651
|
+
/***/ "./programs/casFetchData.js"
|
|
652
|
+
/*!**********************************!*\
|
|
653
|
+
!*** ./programs/casFetchData.js ***!
|
|
654
|
+
\**********************************/
|
|
655
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
656
|
+
|
|
657
|
+
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:///./programs/casFetchData.js?\n}");
|
|
658
|
+
|
|
659
|
+
/***/ },
|
|
660
|
+
|
|
661
|
+
/***/ "./programs/casFetchRows.js"
|
|
662
|
+
/*!**********************************!*\
|
|
663
|
+
!*** ./programs/casFetchRows.js ***!
|
|
664
|
+
\**********************************/
|
|
665
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
666
|
+
|
|
667
|
+
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:///./programs/casFetchRows.js?\n}");
|
|
668
|
+
|
|
669
|
+
/***/ },
|
|
670
|
+
|
|
671
|
+
/***/ "./programs/commonCasl.js"
|
|
672
|
+
/*!********************************!*\
|
|
673
|
+
!*** ./programs/commonCasl.js ***!
|
|
674
|
+
\********************************/
|
|
675
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
676
|
+
|
|
677
|
+
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:///./programs/commonCasl.js?\n}");
|
|
678
|
+
|
|
679
|
+
/***/ },
|
|
680
|
+
|
|
681
|
+
/***/ "./programs/index.js"
|
|
682
|
+
/*!***************************!*\
|
|
683
|
+
!*** ./programs/index.js ***!
|
|
684
|
+
\***************************/
|
|
685
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
686
|
+
|
|
687
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _scoreCasl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scoreCasl.js */ \"./programs/scoreCasl.js\");\n/* harmony import */ var _casFetchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./casFetchData.js */ \"./programs/casFetchData.js\");\n/* harmony import */ var _commonCasl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commonCasl.js */ \"./programs/commonCasl.js\");\n/* harmony import */ var _casFetchRows_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./casFetchRows.js */ \"./programs/casFetchRows.js\");\n/* harmony import */ var _casAppendTable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casAppendTable.js */ \"./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_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n casFetchData: _casFetchData_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n casFetchRows: _casFetchRows_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n scoreCasl: _scoreCasl_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n casAppendTable: _casAppendTable_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n casRowSets: _casFetchData_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n});\n\n//# sourceURL=webpack:///./programs/index.js?\n}");
|
|
688
|
+
|
|
689
|
+
/***/ },
|
|
690
|
+
|
|
691
|
+
/***/ "./programs/scoreCasl.js"
|
|
692
|
+
/*!*******************************!*\
|
|
693
|
+
!*** ./programs/scoreCasl.js ***!
|
|
694
|
+
\*******************************/
|
|
695
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
696
|
+
|
|
697
|
+
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 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/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (scoreCasl);\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:///./programs/scoreCasl.js?\n}");
|
|
698
|
+
|
|
699
|
+
/***/ },
|
|
700
|
+
|
|
701
|
+
/***/ "./uploadHandlers/index.js"
|
|
702
|
+
/*!*********************************!*\
|
|
703
|
+
!*** ./uploadHandlers/index.js ***!
|
|
704
|
+
\*********************************/
|
|
705
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
706
|
+
|
|
707
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ uploadAstore: () => (/* reexport safe */ _uploadAstore_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ uploadSrc: () => (/* reexport safe */ _uploadSrc_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _uploadAstore_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uploadAstore.js */ \"./uploadHandlers/uploadAstore.js\");\n/* harmony import */ var _uploadSrc_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uploadSrc.js */ \"./uploadHandlers/uploadSrc.js\");\n/* harmony import */ var _saveTable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./saveTable.js */ \"./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:///./uploadHandlers/index.js?\n}");
|
|
708
|
+
|
|
709
|
+
/***/ },
|
|
710
|
+
|
|
711
|
+
/***/ "./uploadHandlers/saveTable.js"
|
|
712
|
+
/*!*************************************!*\
|
|
713
|
+
!*** ./uploadHandlers/saveTable.js ***!
|
|
714
|
+
\*************************************/
|
|
715
|
+
(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
716
|
+
|
|
717
|
+
eval("{/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\");\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;\nfunction saveTable(_x, _x2, _x3, _x4) {\n return _saveTable.apply(this, arguments);\n}\nfunction _saveTable() {\n _saveTable = (0,_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:///./uploadHandlers/saveTable.js?\n}");
|
|
718
|
+
|
|
719
|
+
/***/ },
|
|
720
|
+
|
|
721
|
+
/***/ "./uploadHandlers/uploadAstore.js"
|
|
722
|
+
/*!****************************************!*\
|
|
723
|
+
!*** ./uploadHandlers/uploadAstore.js ***!
|
|
724
|
+
\****************************************/
|
|
725
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
726
|
+
|
|
727
|
+
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/esm/asyncToGenerator.js\");\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;\nfunction uploadAstore(_x, _x2, _x3, _x4) {\n return _uploadAstore.apply(this, arguments);\n}\nfunction _uploadAstore() {\n _uploadAstore = (0,_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:///./uploadHandlers/uploadAstore.js?\n}");
|
|
728
|
+
|
|
729
|
+
/***/ },
|
|
730
|
+
|
|
731
|
+
/***/ "./uploadHandlers/uploadSrc.js"
|
|
732
|
+
/*!*************************************!*\
|
|
733
|
+
!*** ./uploadHandlers/uploadSrc.js ***!
|
|
734
|
+
\*************************************/
|
|
735
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
736
|
+
|
|
737
|
+
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/esm/asyncToGenerator.js\");\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_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../caslRun.js */ \"./caslRun.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\nfunction uploadSrc(_x, _x2, _x3, _x4, _x5) {\n return _uploadSrc.apply(this, arguments);\n}\nfunction _uploadSrc() {\n _uploadSrc = (0,_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_js__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 = (0,_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_js__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:///./uploadHandlers/uploadSrc.js?\n}");
|
|
738
|
+
|
|
739
|
+
/***/ },
|
|
740
|
+
|
|
741
|
+
/***/ "./uploadSetup.js"
|
|
742
|
+
/*!************************!*\
|
|
743
|
+
!*** ./uploadSetup.js ***!
|
|
744
|
+
\************************/
|
|
745
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
746
|
+
|
|
747
|
+
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/esm/slicedToArray.js\");\n/* harmony import */ var _uploadHandlers_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uploadHandlers/index.js */ \"./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_index_js__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_index_js__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_index_js__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 = (0,_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:///./uploadSetup.js?\n}");
|
|
748
|
+
|
|
749
|
+
/***/ }
|
|
750
|
+
|
|
751
|
+
/******/ });
|
|
752
|
+
/************************************************************************/
|
|
753
|
+
/******/ // The module cache
|
|
754
|
+
/******/ var __webpack_module_cache__ = {};
|
|
755
|
+
/******/
|
|
756
|
+
/******/ // The require function
|
|
757
|
+
/******/ function __webpack_require__(moduleId) {
|
|
758
|
+
/******/ // Check if module is in cache
|
|
759
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
760
|
+
/******/ if (cachedModule !== undefined) {
|
|
761
|
+
/******/ return cachedModule.exports;
|
|
762
|
+
/******/ }
|
|
763
|
+
/******/ // Check if module exists (development only)
|
|
764
|
+
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
765
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
766
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
767
|
+
/******/ throw e;
|
|
768
|
+
/******/ }
|
|
769
|
+
/******/ // Create a new module (and put it into the cache)
|
|
770
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
771
|
+
/******/ // no module.id needed
|
|
772
|
+
/******/ // no module.loaded needed
|
|
773
|
+
/******/ exports: {}
|
|
774
|
+
/******/ };
|
|
775
|
+
/******/
|
|
776
|
+
/******/ // Execute the module function
|
|
777
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
778
|
+
/******/
|
|
779
|
+
/******/ // Return the exports of the module
|
|
780
|
+
/******/ return module.exports;
|
|
781
|
+
/******/ }
|
|
782
|
+
/******/
|
|
783
|
+
/************************************************************************/
|
|
784
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
785
|
+
/******/ (() => {
|
|
786
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
787
|
+
/******/ __webpack_require__.n = (module) => {
|
|
788
|
+
/******/ var getter = module && module.__esModule ?
|
|
789
|
+
/******/ () => (module['default']) :
|
|
790
|
+
/******/ () => (module);
|
|
791
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
792
|
+
/******/ return getter;
|
|
793
|
+
/******/ };
|
|
794
|
+
/******/ })();
|
|
795
|
+
/******/
|
|
796
|
+
/******/ /* webpack/runtime/define property getters */
|
|
797
|
+
/******/ (() => {
|
|
798
|
+
/******/ // define getter functions for harmony exports
|
|
799
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
800
|
+
/******/ for(var key in definition) {
|
|
801
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
802
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
803
|
+
/******/ }
|
|
804
|
+
/******/ }
|
|
805
|
+
/******/ };
|
|
806
|
+
/******/ })();
|
|
807
|
+
/******/
|
|
808
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
809
|
+
/******/ (() => {
|
|
810
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
811
|
+
/******/ })();
|
|
812
|
+
/******/
|
|
813
|
+
/************************************************************************/
|
|
814
|
+
/******/
|
|
815
|
+
/******/ // startup
|
|
816
|
+
/******/ // Load entry module and return exports
|
|
817
|
+
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
818
|
+
/******/ var __webpack_exports__ = __webpack_require__("./index.js");
|
|
819
|
+
/******/ const __webpack_exports__casActionRun = __webpack_exports__.casActionRun;
|
|
820
|
+
/******/ const __webpack_exports__casAppendTable = __webpack_exports__.casAppendTable;
|
|
821
|
+
/******/ const __webpack_exports__casFetchData = __webpack_exports__.casFetchData;
|
|
822
|
+
/******/ const __webpack_exports__casFetchRows = __webpack_exports__.casFetchRows;
|
|
823
|
+
/******/ const __webpack_exports__casLoadTable = __webpack_exports__.casLoadTable;
|
|
824
|
+
/******/ const __webpack_exports__casSaveTable = __webpack_exports__.casSaveTable;
|
|
825
|
+
/******/ const __webpack_exports__casSetup = __webpack_exports__.casSetup;
|
|
826
|
+
/******/ const __webpack_exports__casTableToJson = __webpack_exports__.casTableToJson;
|
|
827
|
+
/******/ const __webpack_exports__casUpdateData = __webpack_exports__.casUpdateData;
|
|
828
|
+
/******/ const __webpack_exports__casUpload = __webpack_exports__.casUpload;
|
|
829
|
+
/******/ const __webpack_exports__caslDescribe = __webpack_exports__.caslDescribe;
|
|
830
|
+
/******/ const __webpack_exports__caslRun = __webpack_exports__.caslRun;
|
|
831
|
+
/******/ const __webpack_exports__caslRunBase = __webpack_exports__.caslRunBase;
|
|
832
|
+
/******/ const __webpack_exports__caslScore = __webpack_exports__.caslScore;
|
|
833
|
+
/******/ const __webpack_exports__computeAppendTable = __webpack_exports__.computeAppendTable;
|
|
834
|
+
/******/ const __webpack_exports__computeFetchData = __webpack_exports__.computeFetchData;
|
|
835
|
+
/******/ const __webpack_exports__computeFileContent = __webpack_exports__.computeFileContent;
|
|
836
|
+
/******/ const __webpack_exports__computeResults = __webpack_exports__.computeResults;
|
|
837
|
+
/******/ const __webpack_exports__computeRun = __webpack_exports__.computeRun;
|
|
838
|
+
/******/ const __webpack_exports__computeSetup = __webpack_exports__.computeSetup;
|
|
839
|
+
/******/ const __webpack_exports__computeSetupTables = __webpack_exports__.computeSetupTables;
|
|
840
|
+
/******/ const __webpack_exports__computeSummary = __webpack_exports__.computeSummary;
|
|
841
|
+
/******/ const __webpack_exports__computeUpdateData = __webpack_exports__.computeUpdateData;
|
|
842
|
+
/******/ const __webpack_exports__computeUpload = __webpack_exports__.computeUpload;
|
|
843
|
+
/******/ const __webpack_exports__findReport = __webpack_exports__.findReport;
|
|
844
|
+
/******/ const __webpack_exports__getReportImage = __webpack_exports__.getReportImage;
|
|
845
|
+
/******/ const __webpack_exports__getReportUri = __webpack_exports__.getReportUri;
|
|
846
|
+
/******/ const __webpack_exports__getSasTableRows = __webpack_exports__.getSasTableRows;
|
|
847
|
+
/******/ const __webpack_exports__jesRun = __webpack_exports__.jesRun;
|
|
848
|
+
/******/ const __webpack_exports__jobRun = __webpack_exports__.jobRun;
|
|
849
|
+
/******/ const __webpack_exports__jsonToDict = __webpack_exports__.jsonToDict;
|
|
850
|
+
/******/ const __webpack_exports__masAddModel = __webpack_exports__.masAddModel;
|
|
851
|
+
/******/ const __webpack_exports__masDescribe = __webpack_exports__.masDescribe;
|
|
852
|
+
/******/ const __webpack_exports__masRun = __webpack_exports__.masRun;
|
|
853
|
+
/******/ const __webpack_exports__masScore = __webpack_exports__.masScore;
|
|
854
|
+
/******/ const __webpack_exports__masSetup = __webpack_exports__.masSetup;
|
|
855
|
+
/******/ export { __webpack_exports__casActionRun as casActionRun, __webpack_exports__casAppendTable as casAppendTable, __webpack_exports__casFetchData as casFetchData, __webpack_exports__casFetchRows as casFetchRows, __webpack_exports__casLoadTable as casLoadTable, __webpack_exports__casSaveTable as casSaveTable, __webpack_exports__casSetup as casSetup, __webpack_exports__casTableToJson as casTableToJson, __webpack_exports__casUpdateData as casUpdateData, __webpack_exports__casUpload as casUpload, __webpack_exports__caslDescribe as caslDescribe, __webpack_exports__caslRun as caslRun, __webpack_exports__caslRunBase as caslRunBase, __webpack_exports__caslScore as caslScore, __webpack_exports__computeAppendTable as computeAppendTable, __webpack_exports__computeFetchData as computeFetchData, __webpack_exports__computeFileContent as computeFileContent, __webpack_exports__computeResults as computeResults, __webpack_exports__computeRun as computeRun, __webpack_exports__computeSetup as computeSetup, __webpack_exports__computeSetupTables as computeSetupTables, __webpack_exports__computeSummary as computeSummary, __webpack_exports__computeUpdateData as computeUpdateData, __webpack_exports__computeUpload as computeUpload, __webpack_exports__findReport as findReport, __webpack_exports__getReportImage as getReportImage, __webpack_exports__getReportUri as getReportUri, __webpack_exports__getSasTableRows as getSasTableRows, __webpack_exports__jesRun as jesRun, __webpack_exports__jobRun as jobRun, __webpack_exports__jsonToDict as jsonToDict, __webpack_exports__masAddModel as masAddModel, __webpack_exports__masDescribe as masDescribe, __webpack_exports__masRun as masRun, __webpack_exports__masScore as masScore, __webpack_exports__masSetup as masSetup };
|
|
856
|
+
/******/
|