@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
package/lib/restaflib.js
CHANGED
|
@@ -19,808 +19,787 @@
|
|
|
19
19
|
return /******/ (() => { // webpackBootstrap
|
|
20
20
|
/******/ var __webpack_modules__ = ({
|
|
21
21
|
|
|
22
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/OverloadYield.js"
|
|
22
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/OverloadYield.js"
|
|
23
23
|
/*!*********************************************************************!*\
|
|
24
24
|
!*** ../../../node_modules/@babel/runtime/helpers/OverloadYield.js ***!
|
|
25
25
|
\*********************************************************************/
|
|
26
|
-
|
|
26
|
+
(module) {
|
|
27
27
|
|
|
28
28
|
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://restaflib/../../../node_modules/@babel/runtime/helpers/OverloadYield.js?\n}");
|
|
29
29
|
|
|
30
|
-
/***/ }
|
|
30
|
+
/***/ },
|
|
31
31
|
|
|
32
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"
|
|
32
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"
|
|
33
33
|
/*!************************************************************************!*\
|
|
34
34
|
!*** ../../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
|
|
35
35
|
\************************************************************************/
|
|
36
|
-
|
|
36
|
+
(module) {
|
|
37
37
|
|
|
38
38
|
eval("{function _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}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://restaflib/../../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js?\n}");
|
|
39
39
|
|
|
40
|
-
/***/ }
|
|
40
|
+
/***/ },
|
|
41
41
|
|
|
42
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/arrayWithHoles.js"
|
|
42
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/arrayWithHoles.js"
|
|
43
43
|
/*!**********************************************************************!*\
|
|
44
44
|
!*** ../../../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
|
|
45
45
|
\**********************************************************************/
|
|
46
|
-
|
|
46
|
+
(module) {
|
|
47
47
|
|
|
48
48
|
eval("{function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://restaflib/../../../node_modules/@babel/runtime/helpers/arrayWithHoles.js?\n}");
|
|
49
49
|
|
|
50
|
-
/***/ }
|
|
50
|
+
/***/ },
|
|
51
51
|
|
|
52
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js"
|
|
52
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js"
|
|
53
53
|
/*!************************************************************************!*\
|
|
54
54
|
!*** ../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
|
|
55
55
|
\************************************************************************/
|
|
56
|
-
|
|
56
|
+
(module) {
|
|
57
57
|
|
|
58
58
|
eval("{function 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}\nmodule.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://restaflib/../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js?\n}");
|
|
59
59
|
|
|
60
|
-
/***/ }
|
|
60
|
+
/***/ },
|
|
61
61
|
|
|
62
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/defineProperty.js"
|
|
62
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/defineProperty.js"
|
|
63
63
|
/*!**********************************************************************!*\
|
|
64
64
|
!*** ../../../node_modules/@babel/runtime/helpers/defineProperty.js ***!
|
|
65
65
|
\**********************************************************************/
|
|
66
|
-
|
|
66
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
67
67
|
|
|
68
68
|
eval("{var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ \"../../../node_modules/@babel/runtime/helpers/toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(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}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://restaflib/../../../node_modules/@babel/runtime/helpers/defineProperty.js?\n}");
|
|
69
69
|
|
|
70
|
-
/***/ }
|
|
70
|
+
/***/ },
|
|
71
71
|
|
|
72
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"
|
|
72
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"
|
|
73
73
|
/*!****************************************************************************!*\
|
|
74
74
|
!*** ../../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
|
|
75
75
|
\****************************************************************************/
|
|
76
|
-
|
|
76
|
+
(module) {
|
|
77
77
|
|
|
78
78
|
eval("{function _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}\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://restaflib/../../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js?\n}");
|
|
79
79
|
|
|
80
|
-
/***/ }
|
|
80
|
+
/***/ },
|
|
81
81
|
|
|
82
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/nonIterableRest.js"
|
|
82
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/nonIterableRest.js"
|
|
83
83
|
/*!***********************************************************************!*\
|
|
84
84
|
!*** ../../../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
|
|
85
85
|
\***********************************************************************/
|
|
86
|
-
|
|
86
|
+
(module) {
|
|
87
87
|
|
|
88
88
|
eval("{function _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}\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://restaflib/../../../node_modules/@babel/runtime/helpers/nonIterableRest.js?\n}");
|
|
89
89
|
|
|
90
|
-
/***/ }
|
|
90
|
+
/***/ },
|
|
91
91
|
|
|
92
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/regenerator.js"
|
|
92
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regenerator.js"
|
|
93
93
|
/*!*******************************************************************!*\
|
|
94
94
|
!*** ../../../node_modules/@babel/runtime/helpers/regenerator.js ***!
|
|
95
95
|
\*******************************************************************/
|
|
96
|
-
|
|
96
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
97
97
|
|
|
98
98
|
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://restaflib/../../../node_modules/@babel/runtime/helpers/regenerator.js?\n}");
|
|
99
99
|
|
|
100
|
-
/***/ }
|
|
100
|
+
/***/ },
|
|
101
101
|
|
|
102
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorAsync.js"
|
|
102
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorAsync.js"
|
|
103
103
|
/*!************************************************************************!*\
|
|
104
104
|
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
|
|
105
105
|
\************************************************************************/
|
|
106
|
-
|
|
106
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
107
107
|
|
|
108
108
|
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://restaflib/../../../node_modules/@babel/runtime/helpers/regeneratorAsync.js?\n}");
|
|
109
109
|
|
|
110
|
-
/***/ }
|
|
110
|
+
/***/ },
|
|
111
111
|
|
|
112
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"
|
|
112
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"
|
|
113
113
|
/*!***************************************************************************!*\
|
|
114
114
|
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
|
|
115
115
|
\***************************************************************************/
|
|
116
|
-
|
|
116
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
117
117
|
|
|
118
118
|
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://restaflib/../../../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js?\n}");
|
|
119
119
|
|
|
120
|
-
/***/ }
|
|
120
|
+
/***/ },
|
|
121
121
|
|
|
122
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"
|
|
122
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"
|
|
123
123
|
/*!********************************************************************************!*\
|
|
124
124
|
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
|
|
125
125
|
\********************************************************************************/
|
|
126
|
-
|
|
126
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
127
127
|
|
|
128
128
|
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://restaflib/../../../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js?\n}");
|
|
129
129
|
|
|
130
|
-
/***/ }
|
|
130
|
+
/***/ },
|
|
131
131
|
|
|
132
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorDefine.js"
|
|
132
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorDefine.js"
|
|
133
133
|
/*!*************************************************************************!*\
|
|
134
134
|
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
|
|
135
135
|
\*************************************************************************/
|
|
136
|
-
|
|
136
|
+
(module) {
|
|
137
137
|
|
|
138
138
|
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://restaflib/../../../node_modules/@babel/runtime/helpers/regeneratorDefine.js?\n}");
|
|
139
139
|
|
|
140
|
-
/***/ }
|
|
140
|
+
/***/ },
|
|
141
141
|
|
|
142
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorKeys.js"
|
|
142
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorKeys.js"
|
|
143
143
|
/*!***********************************************************************!*\
|
|
144
144
|
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
|
|
145
145
|
\***********************************************************************/
|
|
146
|
-
|
|
146
|
+
(module) {
|
|
147
147
|
|
|
148
148
|
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://restaflib/../../../node_modules/@babel/runtime/helpers/regeneratorKeys.js?\n}");
|
|
149
149
|
|
|
150
|
-
/***/ }
|
|
150
|
+
/***/ },
|
|
151
151
|
|
|
152
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js"
|
|
152
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js"
|
|
153
153
|
/*!**************************************************************************!*\
|
|
154
154
|
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
|
|
155
155
|
\**************************************************************************/
|
|
156
|
-
|
|
156
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
157
157
|
|
|
158
158
|
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://restaflib/../../../node_modules/@babel/runtime/helpers/regeneratorRuntime.js?\n}");
|
|
159
159
|
|
|
160
|
-
/***/ }
|
|
160
|
+
/***/ },
|
|
161
161
|
|
|
162
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorValues.js"
|
|
162
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/regeneratorValues.js"
|
|
163
163
|
/*!*************************************************************************!*\
|
|
164
164
|
!*** ../../../node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
|
|
165
165
|
\*************************************************************************/
|
|
166
|
-
|
|
166
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
167
167
|
|
|
168
168
|
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://restaflib/../../../node_modules/@babel/runtime/helpers/regeneratorValues.js?\n}");
|
|
169
169
|
|
|
170
|
-
/***/ }
|
|
170
|
+
/***/ },
|
|
171
171
|
|
|
172
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/slicedToArray.js"
|
|
172
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/slicedToArray.js"
|
|
173
173
|
/*!*********************************************************************!*\
|
|
174
174
|
!*** ../../../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
|
|
175
175
|
\*********************************************************************/
|
|
176
|
-
|
|
176
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
177
177
|
|
|
178
178
|
eval("{var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ \"../../../node_modules/@babel/runtime/helpers/arrayWithHoles.js\");\nvar iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ \"../../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js\");\nvar unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ \"../../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js\");\nvar nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ \"../../../node_modules/@babel/runtime/helpers/nonIterableRest.js\");\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://restaflib/../../../node_modules/@babel/runtime/helpers/slicedToArray.js?\n}");
|
|
179
179
|
|
|
180
|
-
/***/ }
|
|
180
|
+
/***/ },
|
|
181
181
|
|
|
182
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/toPrimitive.js"
|
|
182
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/toPrimitive.js"
|
|
183
183
|
/*!*******************************************************************!*\
|
|
184
184
|
!*** ../../../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
|
|
185
185
|
\*******************************************************************/
|
|
186
|
-
|
|
186
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
187
187
|
|
|
188
188
|
eval("{var _typeof = (__webpack_require__(/*! ./typeof.js */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\")[\"default\"]);\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(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\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://restaflib/../../../node_modules/@babel/runtime/helpers/toPrimitive.js?\n}");
|
|
189
189
|
|
|
190
|
-
/***/ }
|
|
190
|
+
/***/ },
|
|
191
191
|
|
|
192
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/toPropertyKey.js"
|
|
192
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/toPropertyKey.js"
|
|
193
193
|
/*!*********************************************************************!*\
|
|
194
194
|
!*** ../../../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
|
|
195
195
|
\*********************************************************************/
|
|
196
|
-
|
|
196
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
197
197
|
|
|
198
198
|
eval("{var _typeof = (__webpack_require__(/*! ./typeof.js */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\")[\"default\"]);\nvar toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ \"../../../node_modules/@babel/runtime/helpers/toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://restaflib/../../../node_modules/@babel/runtime/helpers/toPropertyKey.js?\n}");
|
|
199
199
|
|
|
200
|
-
/***/ }
|
|
200
|
+
/***/ },
|
|
201
201
|
|
|
202
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/typeof.js"
|
|
202
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/typeof.js"
|
|
203
203
|
/*!**************************************************************!*\
|
|
204
204
|
!*** ../../../node_modules/@babel/runtime/helpers/typeof.js ***!
|
|
205
205
|
\**************************************************************/
|
|
206
|
-
|
|
206
|
+
(module) {
|
|
207
207
|
|
|
208
208
|
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://restaflib/../../../node_modules/@babel/runtime/helpers/typeof.js?\n}");
|
|
209
209
|
|
|
210
|
-
/***/ }
|
|
210
|
+
/***/ },
|
|
211
211
|
|
|
212
|
-
/***/ "../../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"
|
|
212
|
+
/***/ "../../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"
|
|
213
213
|
/*!**********************************************************************************!*\
|
|
214
214
|
!*** ../../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
|
|
215
215
|
\**********************************************************************************/
|
|
216
|
-
|
|
216
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
217
217
|
|
|
218
218
|
eval("{var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ \"../../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(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) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack://restaflib/../../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js?\n}");
|
|
219
219
|
|
|
220
|
-
/***/ }
|
|
220
|
+
/***/ },
|
|
221
221
|
|
|
222
|
-
/***/ "../../../node_modules/@babel/runtime/regenerator/index.js"
|
|
222
|
+
/***/ "../../../node_modules/@babel/runtime/regenerator/index.js"
|
|
223
223
|
/*!*****************************************************************!*\
|
|
224
224
|
!*** ../../../node_modules/@babel/runtime/regenerator/index.js ***!
|
|
225
225
|
\*****************************************************************/
|
|
226
|
-
|
|
226
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
227
227
|
|
|
228
228
|
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://restaflib/../../../node_modules/@babel/runtime/regenerator/index.js?\n}");
|
|
229
229
|
|
|
230
|
-
/***/ }
|
|
230
|
+
/***/ },
|
|
231
231
|
|
|
232
|
-
/***/ "./casActionRun.js"
|
|
232
|
+
/***/ "./casActionRun.js"
|
|
233
233
|
/*!*************************!*\
|
|
234
234
|
!*** ./casActionRun.js ***!
|
|
235
235
|
\*************************/
|
|
236
|
-
|
|
236
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
237
237
|
|
|
238
238
|
"use strict";
|
|
239
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/*\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
|
|
239
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\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 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store) {\n var _len,\n rest,\n _key,\n result,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n for (_len = _args.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = _args[_key];\n }\n _context.next = 1;\n return store.runAction.apply(store, rest);\n case 1:\n result = _context.sent;\n return _context.abrupt(\"return\", result.items().toJS());\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casActionRun.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casActionRun);\n\n//# sourceURL=webpack://restaflib/./casActionRun.js?\n}");
|
|
240
240
|
|
|
241
|
-
/***/ }
|
|
241
|
+
/***/ },
|
|
242
242
|
|
|
243
|
-
/***/ "./casAppendTable.js"
|
|
243
|
+
/***/ "./casAppendTable.js"
|
|
244
244
|
/*!***************************!*\
|
|
245
245
|
!*** ./casAppendTable.js ***!
|
|
246
246
|
\***************************/
|
|
247
|
-
|
|
247
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
248
248
|
|
|
249
249
|
"use strict";
|
|
250
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
250
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _caslRunBase_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 = _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://restaflib/./casAppendTable.js?\n}");
|
|
251
251
|
|
|
252
|
-
/***/ }
|
|
252
|
+
/***/ },
|
|
253
253
|
|
|
254
|
-
/***/ "./casFetchData.js"
|
|
254
|
+
/***/ "./casFetchData.js"
|
|
255
255
|
/*!*************************!*\
|
|
256
256
|
!*** ./casFetchData.js ***!
|
|
257
257
|
\*************************/
|
|
258
|
-
|
|
258
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
259
259
|
|
|
260
260
|
"use strict";
|
|
261
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
261
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _caslRunBase_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 = _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://restaflib/./casFetchData.js?\n}");
|
|
262
262
|
|
|
263
|
-
/***/ }
|
|
263
|
+
/***/ },
|
|
264
264
|
|
|
265
|
-
/***/ "./casFetchRows.js"
|
|
265
|
+
/***/ "./casFetchRows.js"
|
|
266
266
|
/*!*************************!*\
|
|
267
267
|
!*** ./casFetchRows.js ***!
|
|
268
268
|
\*************************/
|
|
269
|
-
|
|
269
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
270
270
|
|
|
271
271
|
"use strict";
|
|
272
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
272
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _caslRunBase_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 = _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://restaflib/./casFetchRows.js?\n}");
|
|
273
273
|
|
|
274
|
-
/***/ }
|
|
274
|
+
/***/ },
|
|
275
275
|
|
|
276
|
-
/***/ "./casLoadTable.js"
|
|
276
|
+
/***/ "./casLoadTable.js"
|
|
277
277
|
/*!*************************!*\
|
|
278
278
|
!*** ./casLoadTable.js ***!
|
|
279
279
|
\*************************/
|
|
280
|
-
|
|
280
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
281
281
|
|
|
282
282
|
"use strict";
|
|
283
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
283
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _caslRun_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 = _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://restaflib/./casLoadTable.js?\n}");
|
|
284
284
|
|
|
285
|
-
/***/ }
|
|
285
|
+
/***/ },
|
|
286
286
|
|
|
287
|
-
/***/ "./casSaveTable.js"
|
|
287
|
+
/***/ "./casSaveTable.js"
|
|
288
288
|
/*!*************************!*\
|
|
289
289
|
!*** ./casSaveTable.js ***!
|
|
290
290
|
\*************************/
|
|
291
|
-
|
|
291
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
292
292
|
|
|
293
293
|
"use strict";
|
|
294
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n
|
|
294
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\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 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, table, replace, loadTable) {\n var caslib, name, src;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n caslib = table.caslib, name = table.name;\n src = \"\\n table.save /\\n replace=true\\n table = {caslib=\\\"\".concat(caslib, \"\\\" name=\\\"\").concat(name, \"\\\"}\\n caslib=\\\"\").concat(caslib, \"\\\" name=\\\"\").concat(name, \".sashdat\\\";\\n\\n /* clean up before promoting the table */\\n table.droptable /\\n caslib=\\\"\").concat(caslib, \"\\\" name=\\\"\").concat(name, \"\\\" ;\\n\\n /* promote the table to make it available for further analysis */\\n table.loadTable status=status r=rc/\\n caslib=\\\"\").concat(caslib, \"\\\",\\n path=\\\"\").concat(name, \".sashdat\\\",\\n casout={name=\\\"\").concat(name, \"\\\", caslib=\\\"\").concat(caslib, \"\\\" promote=True};\\n run;\\n\\t\");\n return _context.abrupt(\"return\", {\n msg: \"\".concat(caslib, \".\").concat(name, \" saved}\"),\n statusCode: 0\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casSaveTable.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casSaveTable);\n\n//# sourceURL=webpack://restaflib/./casSaveTable.js?\n}");
|
|
295
295
|
|
|
296
|
-
/***/ }
|
|
296
|
+
/***/ },
|
|
297
297
|
|
|
298
|
-
/***/ "./casSetup.js"
|
|
298
|
+
/***/ "./casSetup.js"
|
|
299
299
|
/*!*********************!*\
|
|
300
300
|
!*** ./casSetup.js ***!
|
|
301
301
|
\*********************/
|
|
302
|
-
|
|
302
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
303
303
|
|
|
304
304
|
"use strict";
|
|
305
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/*\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
|
|
305
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\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 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, logonPayload, sessionID, casServer) {\n var msg, _yield$store$addServi, casManagement, servers, casserver, itemsList, index, session, payload, sessionList, selfcmd;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(logonPayload != null)) {\n _context.next = 2;\n break;\n }\n _context.next = 1;\n return store.logon(logonPayload);\n case 1:\n msg = _context.sent;\n case 2:\n _context.next = 3;\n return store.addServices('casManagement');\n case 3:\n _yield$store$addServi = _context.sent;\n casManagement = _yield$store$addServi.casManagement;\n _context.next = 4;\n return store.apiCall(casManagement.links('servers'));\n case 4:\n servers = _context.sent;\n if (!(servers.itemsList().size === 0)) {\n _context.next = 5;\n break;\n }\n throw {\n Error: 'No cas servers were found'\n };\n case 5:\n casserver = null;\n if (!(casServer == null)) {\n _context.next = 6;\n break;\n }\n casserver = servers.itemsList(0);\n _context.next = 8;\n break;\n case 6:\n itemsList = servers.itemsList().toJS();\n index = itemsList.findIndex(function (s) {\n return s === casServer;\n });\n if (!(index === -1)) {\n _context.next = 7;\n break;\n }\n throw {\n Error: \"server with name of \".concat(casServer, \" was not found\")\n };\n case 7:\n casserver = servers.itemsList(index);\n case 8:\n session = null;\n if (!(sessionID == null)) {\n _context.next = 10;\n break;\n }\n _context.next = 9;\n return store.apiCall(servers.itemsCmd(casserver, 'createSession'));\n case 9:\n session = _context.sent;\n _context.next = 15;\n break;\n case 10:\n if (!(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(sessionID) === 'object')) {\n _context.next = 11;\n break;\n }\n session = sessionID;\n _context.next = 15;\n break;\n case 11:\n payload = {\n qs: {\n filter: \"eq( id,'\".concat(sessionID, \"')\")\n }\n }; // console.log('after session' ,JSON.stringify(store.getXsrfData()));\n _context.next = 12;\n return store.apiCall(servers.itemsCmd(casserver, \"sessions\"), payload);\n case 12:\n sessionList = _context.sent;\n if (!(sessionList.items().size === 0)) {\n _context.next = 13;\n break;\n }\n throw \"ERROR: The sessionID \".concat(sessionID, \" was not found.\");\n case 13:\n selfcmd = sessionList.itemsCmd(sessionList.itemsList(0), \"self\");\n _context.next = 14;\n return store.apiCall(selfcmd);\n case 14:\n session = _context.sent;\n case 15:\n return _context.abrupt(\"return\", {\n servers: servers,\n session: session\n });\n case 16:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casSetup.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casSetup);\n\n//# sourceURL=webpack://restaflib/./casSetup.js?\n}");
|
|
306
306
|
|
|
307
|
-
/***/ }
|
|
307
|
+
/***/ },
|
|
308
308
|
|
|
309
|
-
/***/ "./casTableToJson.js"
|
|
309
|
+
/***/ "./casTableToJson.js"
|
|
310
310
|
/*!***************************!*\
|
|
311
311
|
!*** ./casTableToJson.js ***!
|
|
312
312
|
\***************************/
|
|
313
|
-
|
|
313
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
314
314
|
|
|
315
315
|
"use strict";
|
|
316
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n
|
|
316
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n;\n/**\n * @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://restaflib/./casTableToJson.js?\n}");
|
|
317
317
|
|
|
318
|
-
/***/ }
|
|
318
|
+
/***/ },
|
|
319
319
|
|
|
320
|
-
/***/ "./casUpdateData.js"
|
|
320
|
+
/***/ "./casUpdateData.js"
|
|
321
321
|
/*!**************************!*\
|
|
322
322
|
!*** ./casUpdateData.js ***!
|
|
323
323
|
\**************************/
|
|
324
|
-
|
|
324
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
325
325
|
|
|
326
326
|
"use strict";
|
|
327
327
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/*\n * Copyright © 2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @description Update a record in a cas table\n * @async\n * @module casUpdateData\n * @category restaflib/cas\n * @param {store} store - store\n * @param {rafObject} session - cas session\n * @param {*} payload - {data,where,table}\n * @returns {promise} - return \n * @example\n * let inputs = restaflib.casUpdateData(store, session, payload);\n * payload = { where: {key1: vale1, key2: value2,...},\n * data: {var1:value1, var2:value2,....}},\n * table: {caslib: caslib, name: name}\n * Expects a single row\n */\nfunction casUpdateData(_x, _x2, _x3) {\n return _casUpdateData.apply(this, arguments);\n}\nfunction _casUpdateData() {\n _casUpdateData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, session, payload) {\n var data, where, table, swhere, andbit, k, v, valString, set, _k, value, valueString, tbl, updateRow, pl, r, status, disp;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n data = payload.data, where = payload.where, table = payload.table;\n swhere = '';\n andbit = ' ';\n for (k in where) {\n v = where[k];\n valString = typeof v === \"string\" ? \"'\".concat(v.toString(), \"'\") : v;\n swhere = swhere + andbit + k + \"= \".concat(valString, \" \");\n andbit = ' AND ';\n }\n set = [];\n for (_k in data) {\n value = data[_k];\n valueString = void 0;\n if (value == null) {\n valueString = '.';\n } else if (typeof value === 'string') {\n valueString = JSON.stringify(value) /*`${JSON.stringify(value)}`*/;\n } else {\n valueString = value.toString();\n }\n set.push({\n var: _k,\n value: valueString\n });\n }\n tbl = _objectSpread(_objectSpread({}, table), {}, {\n where: \"\".concat(swhere)\n });\n updateRow = {\n table: tbl,\n set: set\n };\n pl = {\n action: 'table.update',\n data: updateRow\n };\n _context.next = 1;\n return store.runAction(session, pl);\n case 1:\n r = _context.sent;\n status = {\n msg: 'Update completed',\n statusCode: 0\n };\n disp = r.items().toJS().disposition;\n if (disp.statusCode !== 0) {\n status.statusCode = disp.statusCode;\n status.msg = disp.reason;\n }\n return _context.abrupt(\"return\", status);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _casUpdateData.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casUpdateData);\n\n//# sourceURL=webpack://restaflib/./casUpdateData.js?\n}");
|
|
328
328
|
|
|
329
|
-
/***/ }
|
|
329
|
+
/***/ },
|
|
330
330
|
|
|
331
|
-
/***/ "./casUpload.js"
|
|
331
|
+
/***/ "./casUpload.js"
|
|
332
332
|
/*!**********************!*\
|
|
333
333
|
!*** ./casUpload.js ***!
|
|
334
334
|
\**********************/
|
|
335
|
-
|
|
335
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
336
336
|
|
|
337
337
|
"use strict";
|
|
338
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var
|
|
338
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _uploadSetup_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 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, session, source, output, save, altSrc) {\n var table, fileInfo, buf, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n // parse source file to figure out what we are uploading\n // const fss = fs.promises\n table = output;\n if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(output) === 'object') {\n table = \"\".concat(output.caslib, \".\").concat(output.name);\n }\n fileInfo = (0,_uploadSetup_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://restaflib/./casUpload.js?\n}");
|
|
339
339
|
|
|
340
|
-
/***/ }
|
|
340
|
+
/***/ },
|
|
341
341
|
|
|
342
|
-
/***/ "./caslDescribe.js"
|
|
342
|
+
/***/ "./caslDescribe.js"
|
|
343
343
|
/*!*************************!*\
|
|
344
344
|
!*** ./caslDescribe.js ***!
|
|
345
345
|
\*************************/
|
|
346
|
-
|
|
346
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
347
347
|
|
|
348
348
|
"use strict";
|
|
349
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var
|
|
349
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _caslRunBase_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) { _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 = _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://restaflib/./caslDescribe.js?\n}");
|
|
350
350
|
|
|
351
|
-
/***/ }
|
|
351
|
+
/***/ },
|
|
352
352
|
|
|
353
|
-
/***/ "./caslRun.js"
|
|
353
|
+
/***/ "./caslRun.js"
|
|
354
354
|
/*!********************!*\
|
|
355
355
|
!*** ./caslRun.js ***!
|
|
356
356
|
\********************/
|
|
357
|
-
|
|
357
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
358
358
|
|
|
359
359
|
"use strict";
|
|
360
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
360
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _caslRunBase_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 = _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://restaflib/./caslRun.js?\n}");
|
|
361
361
|
|
|
362
|
-
/***/ }
|
|
362
|
+
/***/ },
|
|
363
363
|
|
|
364
|
-
/***/ "./caslRunBase.js"
|
|
364
|
+
/***/ "./caslRunBase.js"
|
|
365
365
|
/*!************************!*\
|
|
366
366
|
!*** ./caslRunBase.js ***!
|
|
367
367
|
\************************/
|
|
368
|
-
|
|
368
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
369
369
|
|
|
370
370
|
"use strict";
|
|
371
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
371
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jsonToDict_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 = _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://restaflib/./caslRunBase.js?\n}");
|
|
372
372
|
|
|
373
|
-
/***/ }
|
|
373
|
+
/***/ },
|
|
374
374
|
|
|
375
|
-
/***/ "./caslScore.js"
|
|
375
|
+
/***/ "./caslScore.js"
|
|
376
376
|
/*!**********************!*\
|
|
377
377
|
!*** ./caslScore.js ***!
|
|
378
378
|
\**********************/
|
|
379
|
-
|
|
379
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
380
380
|
|
|
381
381
|
"use strict";
|
|
382
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var
|
|
382
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _caslRunBase_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) { _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 = _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://restaflib/./caslScore.js?\n}");
|
|
383
383
|
|
|
384
|
-
/***/ }
|
|
384
|
+
/***/ },
|
|
385
385
|
|
|
386
|
-
/***/ "./computeAppendTable.js"
|
|
386
|
+
/***/ "./computeAppendTable.js"
|
|
387
387
|
/*!*******************************!*\
|
|
388
388
|
!*** ./computeAppendTable.js ***!
|
|
389
389
|
\*******************************/
|
|
390
|
-
|
|
390
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
391
391
|
|
|
392
392
|
"use strict";
|
|
393
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
393
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _computeRun_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 = _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://restaflib/./computeAppendTable.js?\n}");
|
|
394
394
|
|
|
395
|
-
/***/ }
|
|
395
|
+
/***/ },
|
|
396
396
|
|
|
397
|
-
/***/ "./computeFetchData.js"
|
|
397
|
+
/***/ "./computeFetchData.js"
|
|
398
398
|
/*!*****************************!*\
|
|
399
399
|
!*** ./computeFetchData.js ***!
|
|
400
400
|
\*****************************/
|
|
401
|
-
|
|
401
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
402
402
|
|
|
403
403
|
"use strict";
|
|
404
404
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n *\n * @description Fetch data from a SAS Table\n * @async\n * @module computeFetchData\n * @category restaflib/compute\n * @param {object} store - restaf store\n * @param {computeSummary} computeSummary - Summary object created by computeSummary method\n * @param {string} table - name of the table\n * @param {string} scroll direction - null(to get first set)|next|prev|first|last\n * @param {object} payload - query values\n *\n * @returns {promise} - {columns: <column names>, rows: <data for rows> , scrollOptions: <available scroll directions>}\n */\nfunction computeFetchData(_x, _x2, _x3, _x4, _x5, _x6) {\n return _computeFetchData.apply(this, arguments);\n} // convert cells to rowSet\nfunction _computeFetchData() {\n _computeFetchData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, computeSummary, table, direction, payload, useRow) {\n var data, dataIsformatted, tname, ipayload, dataIsFormatted, linkRel, adhoc, tableInfo, t1, colCount, qc, columns, schema, items, cx, c, newcol, indx, result, rowsData, current, dir, _result, _rowsData;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n data = null;\n dataIsformatted = false;\n tname = typeof table === \"string\" ? table : \"\".concat(table.libref, \".\").concat(table.name);\n tname = tname.toUpperCase(); /*to allow for compute service table info */\n ipayload = payload != null ? _objectSpread({}, payload) : {\n qs: {}\n };\n ipayload.qs.includeIndex = true;\n dataIsFormatted = ipayload.qs.format;\n linkRel = useRow == null ? \"rows\" : useRow; // is payload an override or is this an adhoc request(i.e user is ignoring scroll info)\n adhoc = payload != null && direction == null ? true : false; // retrieve current info on this table(if any)\n tableInfo = computeSummary.tables[tname];\n if (!(tableInfo != null)) {\n _context.next = 6;\n break;\n }\n // reset current on if this is an adhoc request.\n if (adhoc === true) {\n tableInfo.current = null;\n }\n //get column info \n if (!(tableInfo.current === null || direction == null || direction === \"first\")) {\n _context.next = 4;\n break;\n }\n _context.next = 1;\n return store.apiCall(tableInfo.self);\n case 1:\n t1 = _context.sent;\n colCount = t1.items().toJS()[\"columnCount\"]; // get columns explicitly since user can control this thru payload\n qc = {\n qs: {\n start: 0,\n limit: colCount\n }\n };\n _context.next = 2;\n return store.apiCall(t1.links(\"columns\"), qc);\n case 2:\n columns = _context.sent;\n schema = [];\n items = columns.items().toJS();\n if (linkRel === \"rows\") {\n schema.push({\n name: \"_index_\",\n Column: \"_Index_\",\n Label: \"Index\",\n length: 8,\n type: \"FLOAT\",\n format: \"BEST\",\n informat: \"BEST\",\n custom: false,\n isFormat: false\n });\n }\n for (cx in items) {\n c = items[cx];\n newcol = {\n name: c.name.toLowerCase(),\n Column: c.name.toLowerCase(),\n Label: c.data.label,\n length: c.data.length,\n type: c.data.type,\n format: c.data.format != null ? c.data.format.name : null,\n informat: c.data.informat != null ? c.data.informat.name : null,\n custom: false,\n isFormat: dataIsFormatted\n };\n indx = ipayload.qs.includeIndex === true ? 1 : 0;\n schema[c.data.index + indx] = newcol;\n }\n // Now get data using rows or rowSet rel\n _context.next = 3;\n return store.apiCall(t1.links(linkRel), ipayload);\n case 3:\n result = _context.sent;\n // If using linkRel of rows, convert the data to rowSet schema\n rowsData = linkRel === \"rowSet\" ? result.items('rows').toJS() : cells2RowSet(result);\n tableInfo.current = result;\n tableInfo.schema = schema;\n tableInfo.columns = columns;\n data = {\n columns: columns,\n schema: schema,\n rows: rowsData,\n scrollOptions: result.scrollCmds().keySeq().toJS()\n };\n _context.next = 6;\n break;\n case 4:\n current = tableInfo.current;\n dir = direction;\n if (direction === \"next\" && current.scrollCmds(\"next\") === null) {\n dir = current.links(\"last\") !== null ? \"last\" : null;\n }\n if (direction === \"prev\" && current.scrollCmds(\"prev\") === null) {\n dir = current.links(\"first\") !== null ? \"first\" : null;\n }\n data = {\n schema: tableInfo.schema,\n columns: tableInfo.columns,\n currentColumns: tableInfo.currentColumns,\n rows: [],\n scrollOptions: current.scrollCmds().keySeq().toJS()\n };\n if (!(dir !== null && current.scrollCmds(dir) !== null)) {\n _context.next = 6;\n break;\n }\n _context.next = 5;\n return store.apiCall(current.scrollCmds(dir), ipayload);\n case 5:\n _result = _context.sent;\n tableInfo.current = _result;\n _rowsData = linkRel !== \"rows\" ? _result.items('rows').toJS() : cells2RowSet(_result);\n data = {\n schema: tableInfo.schema,\n columns: tableInfo.schema,\n rows: _rowsData,\n scrollOptions: _result.scrollCmds().keySeq().toJS()\n };\n case 6:\n return _context.abrupt(\"return\", data);\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeFetchData.apply(this, arguments);\n}\nfunction cells2RowSet(result) {\n var rowsData = result.items().toJS().map(function (r) {\n return r.cells;\n });\n return rowsData;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeFetchData);\n\n//# sourceURL=webpack://restaflib/./computeFetchData.js?\n}");
|
|
405
405
|
|
|
406
|
-
/***/ }
|
|
406
|
+
/***/ },
|
|
407
407
|
|
|
408
|
-
/***/ "./computeFileContent.js"
|
|
408
|
+
/***/ "./computeFileContent.js"
|
|
409
409
|
/*!*******************************!*\
|
|
410
410
|
!*** ./computeFileContent.js ***!
|
|
411
411
|
\*******************************/
|
|
412
|
-
|
|
412
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
413
413
|
|
|
414
414
|
"use strict";
|
|
415
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/*\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
|
|
415
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\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 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, computeSummary, fileref, url) {\n var fileInfo, payload, result, r, rx, _r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n fileInfo = computeSummary.files[fileref];\n if (!(fileInfo == null)) {\n _context.next = 1;\n break;\n }\n throw \"Invalid fileref \".concat(fileref);\n case 1:\n if (!(fileInfo.current === null)) {\n _context.next = 4;\n break;\n }\n payload = {\n qs: {\n filter: \"eq(name,'\".concat(fileref, \"')\")\n }\n };\n _context.next = 2;\n return store.apiCall(computeSummary.session.links('files'), payload);\n case 2:\n result = _context.sent;\n _context.next = 3;\n return store.apiCall(result.itemsCmd(fileref, 'self'));\n case 3:\n result = _context.sent;\n fileInfo.current = result;\n case 4:\n if (!(url === true)) {\n _context.next = 5;\n break;\n }\n r = \"\".concat(computeSummary.session.host).concat(fileInfo.current.links('content', 'link', 'uri'));\n return _context.abrupt(\"return\", r);\n case 5:\n if (!(fileInfo.data === null)) {\n _context.next = 7;\n break;\n }\n _context.next = 6;\n return store.apiCall(fileInfo.current.links('content'));\n case 6:\n rx = _context.sent;\n _r = rx.items();\n fileInfo.data = _r;\n return _context.abrupt(\"return\", _r);\n case 7:\n return _context.abrupt(\"return\", fileInfo.data);\n case 8:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeFileContent.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeFileContent);\n\n//# sourceURL=webpack://restaflib/./computeFileContent.js?\n}");
|
|
416
416
|
|
|
417
|
-
/***/ }
|
|
417
|
+
/***/ },
|
|
418
418
|
|
|
419
|
-
/***/ "./computeResults.js"
|
|
419
|
+
/***/ "./computeResults.js"
|
|
420
420
|
/*!***************************!*\
|
|
421
421
|
!*** ./computeResults.js ***!
|
|
422
422
|
\***************************/
|
|
423
|
-
|
|
423
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
424
424
|
|
|
425
425
|
"use strict";
|
|
426
426
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @description Return Log|listing|ODS|list of tables in the compute service job\n * @async\n * @module computeResults\n * @category restaflib/compute\n * @param {object} store - restaf store\n * @param {object} computeSummary - computeSummary object\n * @param {string} type - type of result( log|listing|ods|table)\n * @returns {object|string} - string for all except table(array of names)\n */\nfunction computeResults(_x, _x2, _x3) {\n return _computeResults.apply(this, arguments);\n}\nfunction _computeResults() {\n _computeResults = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, computeSummary, type) {\n var log, result, next, _result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(type === 'log' || type === 'listing')) {\n _context.next = 7;\n break;\n }\n log = [];\n if (!(computeSummary[type] !== null)) {\n _context.next = 5;\n break;\n }\n _context.next = 1;\n return store.apiCall(computeSummary[type]);\n case 1:\n result = _context.sent;\n log = log.concat(result.items().toJS());\n case 2:\n if (!((next = result.scrollCmds('next')) !== null)) {\n _context.next = 4;\n break;\n }\n _context.next = 3;\n return store.apiCall(next);\n case 3:\n result = _context.sent;\n log = log.concat(result.items().toJS());\n _context.next = 2;\n break;\n case 4:\n _context.next = 6;\n break;\n case 5:\n log[0] = \"Note: No \".concat(type);\n case 6:\n return _context.abrupt(\"return\", log);\n case 7:\n if (!(type === 'ods')) {\n _context.next = 11;\n break;\n }\n if (!(computeSummary.ods !== null)) {\n _context.next = 9;\n break;\n }\n _context.next = 8;\n return store.apiCall(computeSummary.ods);\n case 8:\n _result = _context.sent;\n return _context.abrupt(\"return\", _result.items());\n case 9:\n return _context.abrupt(\"return\", '<h2> No ODS output </h2>');\n case 10:\n _context.next = 14;\n break;\n case 11:\n if (!(type === 'tables')) {\n _context.next = 12;\n break;\n }\n return _context.abrupt(\"return\", Object.keys(computeSummary.tables));\n case 12:\n if (!(type === 'files')) {\n _context.next = 13;\n break;\n }\n return _context.abrupt(\"return\", Object.keys(computeSummary.files));\n case 13:\n throw \"Error: Invalid type \".concat(type);\n case 14:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeResults.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeResults);\n\n//# sourceURL=webpack://restaflib/./computeResults.js?\n}");
|
|
427
427
|
|
|
428
|
-
/***/ }
|
|
428
|
+
/***/ },
|
|
429
429
|
|
|
430
|
-
/***/ "./computeRun.js"
|
|
430
|
+
/***/ "./computeRun.js"
|
|
431
431
|
/*!***********************!*\
|
|
432
432
|
!*** ./computeRun.js ***!
|
|
433
433
|
\***********************/
|
|
434
|
-
|
|
434
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
435
435
|
|
|
436
436
|
"use strict";
|
|
437
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
437
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _computeRunBase_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 = _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://restaflib/./computeRun.js?\n}");
|
|
438
438
|
|
|
439
|
-
/***/ }
|
|
439
|
+
/***/ },
|
|
440
440
|
|
|
441
|
-
/***/ "./computeRunBase.js"
|
|
441
|
+
/***/ "./computeRunBase.js"
|
|
442
442
|
/*!***************************!*\
|
|
443
443
|
!*** ./computeRunBase.js ***!
|
|
444
444
|
\***************************/
|
|
445
|
-
|
|
445
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
446
446
|
|
|
447
447
|
"use strict";
|
|
448
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
448
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _computeSummary_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 = _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://restaflib/./computeRunBase.js?\n}");
|
|
449
449
|
|
|
450
|
-
/***/ }
|
|
450
|
+
/***/ },
|
|
451
451
|
|
|
452
|
-
/***/ "./computeSetup.js"
|
|
452
|
+
/***/ "./computeSetup.js"
|
|
453
453
|
/*!*************************!*\
|
|
454
454
|
!*** ./computeSetup.js ***!
|
|
455
455
|
\*************************/
|
|
456
|
-
|
|
456
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
457
457
|
|
|
458
458
|
"use strict";
|
|
459
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n
|
|
459
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n\n\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 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, contextName, payload, sessionPayload, sessionID) {\n var msg, _yield$store$addServi, compute, session, _p, sessionList, index, selfcmd, p, contexts, name, createSession, _t;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(sessionID != null && _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(sessionID) === 'object')) {\n _context.next = 1;\n break;\n }\n return _context.abrupt(\"return\", sessionID);\n case 1:\n if (!(payload != null)) {\n _context.next = 3;\n break;\n }\n _context.next = 2;\n return store.logon(payload);\n case 2:\n msg = _context.sent;\n case 3:\n _context.next = 4;\n return store.addServices('compute');\n case 4:\n _yield$store$addServi = _context.sent;\n compute = _yield$store$addServi.compute;\n // Not PUP\n session = null; // Use user specified session\n if (!(sessionID != null)) {\n _context.next = 8;\n break;\n }\n _p = {\n start: 0,\n limit: 100,\n qs: {\n filter: \"eq(id,'\".concat(sessionID, \"')\")\n }\n };\n _context.next = 5;\n return store.apiCall(compute.links('sessions'), _p);\n case 5:\n sessionList = _context.sent;\n index = sessionList.itemsList().toJS().indexOf(sessionID);\n if (!(index < 0)) {\n _context.next = 6;\n break;\n }\n throw \"ERROR: The sessionID \".concat(sessionID, \" was not found.\");\n case 6:\n selfcmd = sessionList.itemsCmd(sessionList.itemsList(index), \"self\");\n _context.next = 7;\n return store.apiCall(selfcmd);\n case 7:\n session = _context.sent;\n return _context.abrupt(\"return\", session);\n case 8:\n if (!(store.store.config.options.computeServerId != null)) {\n _context.next = 10;\n break;\n }\n console.log('NOTE: Detected Workbench');\n _context.next = 9;\n return store.apiCall(compute.links('createSession'));\n case 9:\n session = _context.sent;\n return _context.abrupt(\"return\", session);\n case 10:\n // create a session - most common case\n\n if (contextName == null) {\n contextName = 'SAS Job Execution compute context';\n }\n p = {\n qs: {\n filter: \"contains(name,'\".concat(contextName, \"')\")\n }\n };\n contexts = null;\n _context.prev = 11;\n _context.next = 12;\n return store.apiCall(compute.links(\"contexts\"), p);\n case 12:\n contexts = _context.sent;\n if (!(contexts.itemsList().size === 0)) {\n _context.next = 13;\n break;\n }\n throw \"Context \".concat(contextName, \" not found\");\n case 13:\n _context.next = 15;\n break;\n case 14:\n _context.prev = 14;\n _t = _context[\"catch\"](11);\n console.error('Error: Not able to get context');\n throw _t;\n case 15:\n name = contexts.itemsList(0);\n if (!(sessionID == null)) {\n _context.next = 17;\n break;\n }\n p = sessionPayload == null ? null : sessionPayload;\n createSession = contexts.itemsCmd(name, 'createSession');\n _context.next = 16;\n return store.apiCall(createSession, sessionPayload);\n case 16:\n session = _context.sent;\n case 17:\n return _context.abrupt(\"return\", session);\n case 18:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[11, 14]]);\n }));\n return _computeSetup.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeSetup);\n\n//# sourceURL=webpack://restaflib/./computeSetup.js?\n}");
|
|
460
460
|
|
|
461
|
-
/***/ }
|
|
461
|
+
/***/ },
|
|
462
462
|
|
|
463
|
-
/***/ "./computeSetupTables.js"
|
|
463
|
+
/***/ "./computeSetupTables.js"
|
|
464
464
|
/*!*******************************!*\
|
|
465
465
|
!*** ./computeSetupTables.js ***!
|
|
466
466
|
\*******************************/
|
|
467
|
-
|
|
467
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
468
468
|
|
|
469
469
|
"use strict";
|
|
470
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
470
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _computeSummary_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 = _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://restaflib/./computeSetupTables.js?\n}");
|
|
471
471
|
|
|
472
|
-
/***/ }
|
|
472
|
+
/***/ },
|
|
473
473
|
|
|
474
|
-
/***/ "./computeSummary.js"
|
|
474
|
+
/***/ "./computeSummary.js"
|
|
475
475
|
/*!***************************!*\
|
|
476
476
|
!*** ./computeSummary.js ***!
|
|
477
477
|
\***************************/
|
|
478
|
-
|
|
478
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
479
479
|
|
|
480
480
|
"use strict";
|
|
481
481
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n/**\n * @description Reduce the job information into consummable form(async)\n * \n * @async\n * @module computeSummary\n * @category restaflib/compute\n * \n * @param {store} store - restaf store\n * @param {rafObject} session - compute Session\n * @param {rafObject} job - rafObject representing the compute service job after job completion\n * @param {object|Array=} tables (see computeSetupTables)\n * @returns {promise} - the computeSummary object for easy handling of logs,listing,ods, tables\n * \n */\nfunction computeSummary(_x, _x2, _x3, _x4) {\n return _computeSummary.apply(this, arguments);\n}\nfunction _computeSummary() {\n _computeSummary = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, session, job, tables) {\n var result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(job != null && tables == null)) {\n _context.next = 2;\n break;\n }\n _context.next = 1;\n return jobResults(store, session, job);\n case 1:\n result = _context.sent;\n _context.next = 4;\n break;\n case 2:\n _context.next = 3;\n return isetupTable(store, session, tables);\n case 3:\n result = _context.sent;\n case 4:\n return _context.abrupt(\"return\", result);\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeSummary.apply(this, arguments);\n}\nfunction jobResults(_x5, _x6, _x7) {\n return _jobResults.apply(this, arguments);\n}\nfunction _jobResults() {\n _jobResults = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee2(store, session, job) {\n var cResult, reportLink, results, size, i, resultItem, type, r, _r, _r2;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n cResult = {\n session: session,\n log: null,\n listing: null,\n ods: null,\n job: job /*null*/,\n tables: {},\n files: {}\n };\n cResult.log = job.links('log');\n cResult.listing = job.links('listing');\n reportLink = job.links('results');\n if (!(reportLink !== null)) {\n _context2.next = 2;\n break;\n }\n _context2.next = 1;\n return store.apiCall(reportLink);\n case 1:\n results = _context2.sent;\n size = results.itemsList().size;\n if (size > 0) {\n for (i = 0; i < size; i++) {\n resultItem = results.itemsList(i);\n type = results.items(resultItem, 'data', 'type').toLowerCase();\n if (type === 'ods') {\n cResult['ods'] = results.itemsCmd(resultItem, 'self');\n } else if (type === 'table') {\n r = {\n self: results.itemsCmd(resultItem, 'self'),\n current: null\n };\n cResult.tables[resultItem.toUpperCase()] = r;\n } else if (type === 'file') {\n _r = {\n self: resultItem,\n current: null,\n data: null\n };\n cResult.files[resultItem] = _r;\n } else {\n _r2 = {\n self: resultItem,\n current: null,\n data: null\n };\n cResult[type] = _r2;\n }\n }\n }\n case 2:\n return _context2.abrupt(\"return\", cResult);\n case 3:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _jobResults.apply(this, arguments);\n}\nfunction isetupTable(_x8, _x9, _x0) {\n return _isetupTable.apply(this, arguments);\n}\nfunction _isetupTable() {\n _isetupTable = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee3(store, session, tables) {\n var cResult, tableList, i, itable, libref, name, p, currentLibrefs, rlink, currentLibrefSelf, _tables, tname, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n cResult = {\n session: session,\n log: null,\n listing: null,\n ods: null,\n job: null,\n tables: {},\n files: {}\n };\n tableList = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(tables) === 'object' ? [tables] : tables;\n i = 0;\n case 1:\n if (!(i < tableList.length)) {\n _context3.next = 8;\n break;\n }\n itable = tableList[i];\n libref = itable.libref.toUpperCase();\n name = itable.name.toUpperCase();\n p = {\n qs: {\n filter: \"eq(name,'\".concat(libref, \"')\")\n }\n };\n _context3.next = 2;\n return store.apiCall(session.links('librefs'), p);\n case 2:\n currentLibrefs = _context3.sent;\n if (!(currentLibrefs.itemsList().size === 0)) {\n _context3.next = 3;\n break;\n }\n throw \"ERROR: Libref \".concat(libref, \" not found\");\n case 3:\n // get the links for this libref\n rlink = currentLibrefs.itemsCmd(libref, 'self');\n _context3.next = 4;\n return store.apiCall(rlink);\n case 4:\n currentLibrefSelf = _context3.sent;\n // get the table\n p = {\n qs: {\n filter: \"eq(name,'\".concat(name, \"')\")\n }\n };\n _context3.next = 5;\n return store.apiCall(currentLibrefSelf.links('tables'), p);\n case 5:\n _tables = _context3.sent;\n if (!(_tables.itemsList().size === 0)) {\n _context3.next = 6;\n break;\n }\n throw \"ERROR: Table \".concat(name, \" not found\");\n case 6:\n tname = \"\".concat(libref, \".\").concat(name).toLowerCase();\n r = {\n self: _tables.itemsCmd(name, 'self'),\n current: null\n };\n cResult.tables[tname.toUpperCase()] = r;\n case 7:\n i++;\n _context3.next = 1;\n break;\n case 8:\n return _context3.abrupt(\"return\", cResult);\n case 9:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _isetupTable.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeSummary);\n\n//# sourceURL=webpack://restaflib/./computeSummary.js?\n}");
|
|
482
482
|
|
|
483
|
-
/***/ }
|
|
483
|
+
/***/ },
|
|
484
484
|
|
|
485
|
-
/***/ "./computeUpdateData.js"
|
|
485
|
+
/***/ "./computeUpdateData.js"
|
|
486
486
|
/*!******************************!*\
|
|
487
487
|
!*** ./computeUpdateData.js ***!
|
|
488
488
|
\******************************/
|
|
489
|
-
|
|
489
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
490
490
|
|
|
491
491
|
"use strict";
|
|
492
492
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/*\n * Copyright © 2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n* @description Update a record in a cas table\n* @async\n* @private\n* @module computeUpdateData\n* @category restaflib/cas\n* @param {store} store - store\n* @param {rafObject} session - cas session\n* @param {*} payload - {data,where,table}\n* @returns {promise} - return \n* @example\n* let inputs = restaflib.computeUpdateData(store, session, payload);\n* payload = { where: {key1: vale1, key2: value2,...},\n* data: {var1:value1, var2:value2,....},\n* table: {caslib: caslib, name: name}\n* Expects a single row\n*/\nfunction computeUpdateData(_x, _x2, _x3) {\n return _computeUpdateData.apply(this, arguments);\n}\nfunction _computeUpdateData() {\n _computeUpdateData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, payload) {\n var data, table, where, src, set, comma, k, swhere, andbit, _k, v, valString, asrc, p, job, qs, status, c;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n data = payload.data, table = payload.table, where = payload.where;\n src = \"proc sql; update \".concat(table.libref, \".\").concat(table.name);\n set = 'SET ';\n comma = ' ';\n for (k in data) {\n set = set + comma + k + '=' + value2String(data[k]);\n comma = ', ';\n }\n src = src + ' ' + set;\n swhere = ' WHERE ';\n andbit = ' ';\n if (typeof where === 'string') {\n swhere = swhere + where;\n } else {\n for (_k in where) {\n v = where[_k];\n valString = value2String(v);\n swhere = swhere + andbit + _k + \"= \".concat(valString, \" \");\n andbit = ' AND ';\n }\n }\n src = src + ' ' + swhere + ';run;';\n asrc = src.split(/\\r?\\n/);\n p = {\n data: {\n code: asrc\n }\n };\n _context.next = 1;\n return store.apiCall(session.links('execute'), p);\n case 1:\n job = _context.sent;\n qs = {\n qs: {\n newState: 'Completed',\n timeout: 1\n }\n }; // eslint-disable-next-line no-unused-vars\n _context.next = 2;\n return store.jobState(job, qs);\n case 2:\n status = _context.sent;\n c = status.data === 'completed' ? 0 : 1;\n return _context.abrupt(\"return\", {\n statusCode: c,\n msg: status.data\n });\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _computeUpdateData.apply(this, arguments);\n}\nfunction value2String(value) {\n var valueString;\n if (value == null) {\n valueString = '.';\n } else if (typeof value === 'string') {\n valueString = JSON.stringify(value);\n } else {\n valueString = value.toString();\n }\n return valueString;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (computeUpdateData);\n\n//# sourceURL=webpack://restaflib/./computeUpdateData.js?\n}");
|
|
493
493
|
|
|
494
|
-
/***/ }
|
|
494
|
+
/***/ },
|
|
495
495
|
|
|
496
|
-
/***/ "./computeUpload.js"
|
|
496
|
+
/***/ "./computeUpload.js"
|
|
497
497
|
/*!**************************!*\
|
|
498
498
|
!*** ./computeUpload.js ***!
|
|
499
499
|
\**************************/
|
|
500
|
-
|
|
500
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
501
501
|
|
|
502
502
|
"use strict";
|
|
503
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
503
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _computeRun_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 = _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://restaflib/./computeUpload.js?\n}");
|
|
504
504
|
|
|
505
|
-
/***/ }
|
|
505
|
+
/***/ },
|
|
506
506
|
|
|
507
|
-
/***/ "./findReport.js"
|
|
507
|
+
/***/ "./findReport.js"
|
|
508
508
|
/*!***********************!*\
|
|
509
509
|
!*** ./findReport.js ***!
|
|
510
510
|
\***********************/
|
|
511
|
-
|
|
511
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
512
512
|
|
|
513
513
|
"use strict";
|
|
514
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n\n
|
|
514
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\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 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, name) {\n var _yield$store$addServi, reports, payload, reportsList;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 1;\n return store.addServices('reports');\n case 1:\n _yield$store$addServi = _context.sent;\n reports = _yield$store$addServi.reports;\n console.log(reports);\n payload = null;\n if (name !== null) {\n payload = {\n qs: {\n filter: \"eq(name,'\".concat(name, \"')\")\n }\n };\n }\n // call the reports service\n console.log('-----------', reports.links('reports'));\n _context.next = 2;\n return store.apiCall(reports.links('reports'), payload);\n case 2:\n reportsList = _context.sent;\n return _context.abrupt(\"return\", reportsList.itemsList().size === 0 ? null : reportsList);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _findReport.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (findReport);\n\n//# sourceURL=webpack://restaflib/./findReport.js?\n}");
|
|
515
515
|
|
|
516
|
-
/***/ }
|
|
516
|
+
/***/ },
|
|
517
517
|
|
|
518
|
-
/***/ "./getReportImage.js"
|
|
518
|
+
/***/ "./getReportImage.js"
|
|
519
519
|
/*!***************************!*\
|
|
520
520
|
!*** ./getReportImage.js ***!
|
|
521
521
|
\***************************/
|
|
522
|
-
|
|
522
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
523
523
|
|
|
524
524
|
"use strict";
|
|
525
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
525
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _findReport_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 = _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://restaflib/./getReportImage.js?\n}");
|
|
526
526
|
|
|
527
|
-
/***/ }
|
|
527
|
+
/***/ },
|
|
528
528
|
|
|
529
|
-
/***/ "./getReportUri.js"
|
|
529
|
+
/***/ "./getReportUri.js"
|
|
530
530
|
/*!*************************!*\
|
|
531
531
|
!*** ./getReportUri.js ***!
|
|
532
532
|
\*************************/
|
|
533
|
-
|
|
533
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
534
534
|
|
|
535
535
|
"use strict";
|
|
536
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
536
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _findReport_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 = _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://restaflib/./getReportUri.js?\n}");
|
|
537
537
|
|
|
538
|
-
/***/ }
|
|
538
|
+
/***/ },
|
|
539
539
|
|
|
540
|
-
/***/ "./getSasTableRows.js"
|
|
540
|
+
/***/ "./getSasTableRows.js"
|
|
541
541
|
/*!****************************!*\
|
|
542
542
|
!*** ./getSasTableRows.js ***!
|
|
543
543
|
\****************************/
|
|
544
|
-
|
|
544
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
545
545
|
|
|
546
546
|
"use strict";
|
|
547
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/*\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
|
|
547
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\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 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee2(store, computeSummary, tableName) {\n var tableSelf, t1, table, columns, rows, result, count, _loop, i;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n tableSelf = computeSummary.tables[tableName];\n _context2.next = 1;\n return store.apiCall(tableSelf);\n case 1:\n t1 = _context2.sent;\n _context2.next = 2;\n return store.apiCall(t1.links('rowSet'));\n case 2:\n table = _context2.sent;\n columns = table.items('columns');\n rows = table.items('rows');\n result = [];\n count = rows.size;\n _loop = /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee() {\n var row, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n row = rows.get(i);\n r = {};\n columns.map(function (c, i) {\n var varx = c.toLowerCase();\n r[varx] = row.get(i);\n });\n result.push(r);\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n });\n i = 0;\n case 3:\n if (!(i < count)) {\n _context2.next = 5;\n break;\n }\n return _context2.delegateYield(_loop(), \"t0\", 4);\n case 4:\n i++;\n _context2.next = 3;\n break;\n case 5:\n return _context2.abrupt(\"return\", result);\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return _getSasTableRows.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getSasTableRows);\n\n//# sourceURL=webpack://restaflib/./getSasTableRows.js?\n}");
|
|
548
548
|
|
|
549
|
-
/***/ }
|
|
549
|
+
/***/ },
|
|
550
550
|
|
|
551
|
-
/***/ "./getScoreStep.js"
|
|
551
|
+
/***/ "./getScoreStep.js"
|
|
552
552
|
/*!*************************!*\
|
|
553
553
|
!*** ./getScoreStep.js ***!
|
|
554
554
|
\*************************/
|
|
555
|
-
|
|
555
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
556
556
|
|
|
557
557
|
"use strict";
|
|
558
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n
|
|
558
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n/**\n * @private\n * @module getScoreStep\n * @category restaflib/mas\n * @param {*} store \n * @param {*} microanalyticScore \n * @param {*} name \n * @returns {promise}\n */\nfunction getScoreStep(_x, _x2, _x3) {\n return _getScoreStep.apply(this, arguments);\n}\nfunction _getScoreStep() {\n _getScoreStep = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, microanalyticScore, name) {\n var payload, modList, rafLink, allSteps, control;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n payload = {\n qs: {\n filter: \"eq(name,'\".concat(name.trim(), \"')\")\n }\n };\n _context.next = 1;\n return store.apiCall(microanalyticScore.links('modules'), payload);\n case 1:\n modList = _context.sent;\n if (!(modList.itemsList().size === 0)) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\", null);\n case 2:\n rafLink = modList.itemsCmd(name, 'steps');\n _context.next = 3;\n return store.apiCall(rafLink);\n case 3:\n allSteps = _context.sent;\n control = {\n name: name,\n stepsRafLink: allSteps,\n stepIds: modList.items(name, 'data', 'stepIds').toJS(),\n microanalyticScore: microanalyticScore\n };\n return _context.abrupt(\"return\", control);\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _getScoreStep.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getScoreStep);\n\n//# sourceURL=webpack://restaflib/./getScoreStep.js?\n}");
|
|
559
559
|
|
|
560
|
-
/***/ }
|
|
560
|
+
/***/ },
|
|
561
561
|
|
|
562
|
-
/***/ "./index.js"
|
|
562
|
+
/***/ "./index.js"
|
|
563
563
|
/*!******************!*\
|
|
564
564
|
!*** ./index.js ***!
|
|
565
565
|
\******************/
|
|
566
|
-
|
|
566
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
567
567
|
|
|
568
568
|
"use strict";
|
|
569
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ casActionRun: () => (/* reexport safe */ _casActionRun__WEBPACK_IMPORTED_MODULE_5__[\"default\"]),\n/* harmony export */ casAppendTable: () => (/* reexport safe */ _casAppendTable__WEBPACK_IMPORTED_MODULE_9__[\"default\"]),\n/* harmony export */ casFetchData: () => (/* reexport safe */ _casFetchData__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */ casFetchRows: () => (/* reexport safe */ _casFetchRows__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n/* harmony export */ casLoadTable: () => (/* reexport safe */ _casLoadTable__WEBPACK_IMPORTED_MODULE_13__[\"default\"]),\n/* harmony export */ casSaveTable: () => (/* reexport safe */ _casSaveTable__WEBPACK_IMPORTED_MODULE_12__[\"default\"]),\n/* harmony export */ casSetup: () => (/* reexport safe */ _casSetup__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */ casTableToJson: () => (/* reexport safe */ _casTableToJson__WEBPACK_IMPORTED_MODULE_10__[\"default\"]),\n/* harmony export */ casUpdateData: () => (/* reexport safe */ _casUpdateData__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n/* harmony export */ casUpload: () => (/* reexport safe */ _casUpload__WEBPACK_IMPORTED_MODULE_11__[\"default\"]),\n/* harmony export */ caslDescribe: () => (/* reexport safe */ _caslDescribe__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ caslRun: () => (/* reexport safe */ _caslRun__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ caslRunBase: () => (/* reexport safe */ _caslRunBase__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ caslScore: () => (/* reexport safe */ _caslScore__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ computeAppendTable: () => (/* reexport safe */ _computeAppendTable__WEBPACK_IMPORTED_MODULE_21__[\"default\"]),\n/* harmony export */ computeFetchData: () => (/* reexport safe */ _computeFetchData__WEBPACK_IMPORTED_MODULE_19__[\"default\"]),\n/* harmony export */ computeFileContent: () => (/* reexport safe */ _computeFileContent__WEBPACK_IMPORTED_MODULE_20__[\"default\"]),\n/* harmony export */ computeResults: () => (/* reexport safe */ _computeResults__WEBPACK_IMPORTED_MODULE_18__[\"default\"]),\n/* harmony export */ computeRun: () => (/* reexport safe */ _computeRun__WEBPACK_IMPORTED_MODULE_14__[\"default\"]),\n/* harmony export */ computeSetup: () => (/* reexport safe */ _computeSetup__WEBPACK_IMPORTED_MODULE_15__[\"default\"]),\n/* harmony export */ computeSetupTables: () => (/* reexport safe */ _computeSetupTables__WEBPACK_IMPORTED_MODULE_17__[\"default\"]),\n/* harmony export */ computeSummary: () => (/* reexport safe */ _computeSummary__WEBPACK_IMPORTED_MODULE_16__[\"default\"]),\n/* harmony export */ computeUpdateData: () => (/* reexport safe */ _computeUpdateData__WEBPACK_IMPORTED_MODULE_22__[\"default\"]),\n/* harmony export */ computeUpload: () => (/* reexport safe */ _computeUpload__WEBPACK_IMPORTED_MODULE_23__[\"default\"]),\n/* harmony export */ findReport: () => (/* reexport safe */ _findReport__WEBPACK_IMPORTED_MODULE_24__[\"default\"]),\n/* harmony export */ getReportImage: () => (/* reexport safe */ _getReportImage__WEBPACK_IMPORTED_MODULE_25__[\"default\"]),\n/* harmony export */ getReportUri: () => (/* reexport safe */ _getReportUri__WEBPACK_IMPORTED_MODULE_26__[\"default\"]),\n/* harmony export */ getSasTableRows: () => (/* reexport safe */ _getSasTableRows__WEBPACK_IMPORTED_MODULE_27__[\"default\"]),\n/* harmony export */ jesRun: () => (/* reexport safe */ _jesRun__WEBPACK_IMPORTED_MODULE_28__[\"default\"]),\n/* harmony export */ jobRun: () => (/* reexport safe */ _jobRun__WEBPACK_IMPORTED_MODULE_29__[\"default\"]),\n/* harmony export */ jsonToDict: () => (/* reexport safe */ _jsonToDict__WEBPACK_IMPORTED_MODULE_30__[\"default\"]),\n/* harmony export */ lib: () => (/* binding */ lib),\n/* harmony export */ masAddModel: () => (/* reexport safe */ _masAddModel__WEBPACK_IMPORTED_MODULE_35__[\"default\"]),\n/* harmony export */ masDescribe: () => (/* reexport safe */ _masDescribe__WEBPACK_IMPORTED_MODULE_32__[\"default\"]),\n/* harmony export */ masRun: () => (/* reexport safe */ _masRun__WEBPACK_IMPORTED_MODULE_33__[\"default\"]),\n/* harmony export */ masScore: () => (/* reexport safe */ _masScore__WEBPACK_IMPORTED_MODULE_34__[\"default\"]),\n/* harmony export */ masSetup: () => (/* reexport safe */ _masSetup__WEBPACK_IMPORTED_MODULE_31__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _caslRun__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./caslRun */ \"./caslRun.js\");\n/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _caslScore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslScore */ \"./caslScore.js\");\n/* harmony import */ var _caslDescribe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslDescribe */ \"./caslDescribe.js\");\n/* harmony import */ var _casSetup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casSetup */ \"./casSetup.js\");\n/* harmony import */ var _casActionRun__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./casActionRun */ \"./casActionRun.js\");\n/* harmony import */ var _casFetchData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./casFetchData */ \"./casFetchData.js\");\n/* harmony import */ var _casFetchRows__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./casFetchRows */ \"./casFetchRows.js\");\n/* harmony import */ var _casUpdateData__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./casUpdateData */ \"./casUpdateData.js\");\n/* harmony import */ var _casAppendTable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./casAppendTable */ \"./casAppendTable.js\");\n/* harmony import */ var _casTableToJson__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./casTableToJson */ \"./casTableToJson.js\");\n/* harmony import */ var _casUpload__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./casUpload */ \"./casUpload.js\");\n/* harmony import */ var _casSaveTable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./casSaveTable */ \"./casSaveTable.js\");\n/* harmony import */ var _casLoadTable__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./casLoadTable */ \"./casLoadTable.js\");\n/* harmony import */ var _computeRun__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./computeRun */ \"./computeRun.js\");\n/* harmony import */ var _computeSetup__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./computeSetup */ \"./computeSetup.js\");\n/* harmony import */ var _computeSummary__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./computeSummary */ \"./computeSummary.js\");\n/* harmony import */ var _computeSetupTables__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./computeSetupTables */ \"./computeSetupTables.js\");\n/* harmony import */ var _computeResults__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./computeResults */ \"./computeResults.js\");\n/* harmony import */ var _computeFetchData__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./computeFetchData */ \"./computeFetchData.js\");\n/* harmony import */ var _computeFileContent__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./computeFileContent */ \"./computeFileContent.js\");\n/* harmony import */ var _computeAppendTable__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./computeAppendTable */ \"./computeAppendTable.js\");\n/* harmony import */ var _computeUpdateData__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./computeUpdateData */ \"./computeUpdateData.js\");\n/* harmony import */ var _computeUpload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./computeUpload */ \"./computeUpload.js\");\n/* harmony import */ var _findReport__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./findReport */ \"./findReport.js\");\n/* harmony import */ var _getReportImage__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./getReportImage */ \"./getReportImage.js\");\n/* harmony import */ var _getReportUri__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./getReportUri */ \"./getReportUri.js\");\n/* harmony import */ var _getSasTableRows__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./getSasTableRows */ \"./getSasTableRows.js\");\n/* harmony import */ var _jesRun__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./jesRun */ \"./jesRun.js\");\n/* harmony import */ var _jobRun__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./jobRun */ \"./jobRun.js\");\n/* harmony import */ var _jsonToDict__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./jsonToDict */ \"./jsonToDict.js\");\n/* harmony import */ var _masSetup__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./masSetup */ \"./masSetup.js\");\n/* harmony import */ var _masDescribe__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./masDescribe */ \"./masDescribe.js\");\n/* harmony import */ var _masRun__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./masRun */ \"./masRun.js\");\n/* harmony import */ var _masScore__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./masScore */ \"./masScore.js\");\n/* harmony import */ var _masAddModel__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./masAddModel */ \"./masAddModel.js\");\n/* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./lib */ \"./lib.js\");\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar lib = (0,_lib__WEBPACK_IMPORTED_MODULE_36__[\"default\"])();\n\n\n//# sourceURL=webpack://restaflib/./index.js?\n}");
|
|
569
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* 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://restaflib/./index.js?\n}");
|
|
570
570
|
|
|
571
|
-
/***/ }
|
|
571
|
+
/***/ },
|
|
572
572
|
|
|
573
|
-
/***/ "./jesRun.js"
|
|
573
|
+
/***/ "./jesRun.js"
|
|
574
574
|
/*!*******************!*\
|
|
575
575
|
!*** ./jesRun.js ***!
|
|
576
576
|
\*******************/
|
|
577
|
-
|
|
577
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
578
578
|
|
|
579
579
|
"use strict";
|
|
580
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var
|
|
580
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jesRunBase_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) { _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 = _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 = _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://restaflib/./jesRun.js?\n}");
|
|
581
581
|
|
|
582
|
-
/***/ }
|
|
582
|
+
/***/ },
|
|
583
583
|
|
|
584
|
-
/***/ "./jesRunBase.js"
|
|
584
|
+
/***/ "./jesRunBase.js"
|
|
585
585
|
/*!***********************!*\
|
|
586
586
|
!*** ./jesRunBase.js ***!
|
|
587
587
|
\***********************/
|
|
588
|
-
|
|
588
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
589
589
|
|
|
590
590
|
"use strict";
|
|
591
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
591
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jesSummary_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 = _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://restaflib/./jesRunBase.js?\n}");
|
|
592
592
|
|
|
593
|
-
/***/ }
|
|
593
|
+
/***/ },
|
|
594
594
|
|
|
595
|
-
/***/ "./
|
|
596
|
-
/*!*********************!*\
|
|
597
|
-
!*** ./jesSetup.js ***!
|
|
598
|
-
\*********************/
|
|
599
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
600
|
-
|
|
601
|
-
"use strict";
|
|
602
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n/**\n * @description Setup access to compute service\n * @async\n * @module jesSetup\n * @private\n * \n * @param {object} store - restaf store\n * @param {object} payload - logon payload - If null assumes that logon was done earlier.\n * \n * @returns {object} - returns a jobExecution raf object\n */\n\n\nfunction jesSetup(_x, _x2) {\n return _jesSetup.apply(this, arguments);\n}\nfunction _jesSetup() {\n _jesSetup = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, payload) {\n var services;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(payload != null)) {\n _context.next = 1;\n break;\n }\n _context.next = 1;\n return store.logon(payload);\n case 1:\n _context.next = 2;\n return store.addServices('jobExecution', 'compute', 'jobDefinitions');\n case 2:\n services = _context.sent;\n return _context.abrupt(\"return\", services.jobExecution);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _jesSetup.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (jesSetup);\n\n//# sourceURL=webpack://restaflib/./jesSetup.js?\n}");
|
|
603
|
-
|
|
604
|
-
/***/ }),
|
|
605
|
-
|
|
606
|
-
/***/ "./jesSummary.js":
|
|
595
|
+
/***/ "./jesSummary.js"
|
|
607
596
|
/*!***********************!*\
|
|
608
597
|
!*** ./jesSummary.js ***!
|
|
609
598
|
\***********************/
|
|
610
|
-
|
|
599
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
611
600
|
|
|
612
601
|
"use strict";
|
|
613
602
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n/**\n * @description Reduce the job information into consummable form(async)\n * \n * @async\n * @module jesSummary\n * @category restaflib/jes\n * @private\n * @param {object} store - restaf store\n * @param {object} job - rafObject representing the compute service job\n * \n * @returns {promise} - the computeSummary object for easy handling of logs,listing,ods, tables\n */\nfunction jesSummary(_x, _x2) {\n return _jesSummary.apply(this, arguments);\n}\nfunction _jesSummary() {\n _jesSummary = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, job) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 1;\n return jobResults(store, job);\n case 1:\n return _context.abrupt(\"return\", _context.sent);\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _jesSummary.apply(this, arguments);\n}\nfunction jobResults(_x3, _x4) {\n return _jobResults.apply(this, arguments);\n}\nfunction _jobResults() {\n _jobResults = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee3(store, job) {\n var items, cResult, p, table, key, pa, l, la, id, r, name, formatLog, getContent, _getContent, _t2, _t3;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _getContent = function _getContent3() {\n _getContent = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee2(store, key, id, table) {\n var _yield$store$addServi, files, payload, f, contentRaf, text, _items, _r, t, _t;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 1;\n return store.addServices(\"files\");\n case 1:\n _yield$store$addServi = _context2.sent;\n files = _yield$store$addServi.files;\n payload = {\n qs: {\n filter: \"eq(id,'\".concat(id, \"')\")\n }\n };\n _context2.prev = 2;\n _context2.next = 3;\n return store.apiCall(files.links(\"files\"), payload);\n case 3:\n f = _context2.sent;\n contentRaf = f.itemsCmd(f.itemsList(0), 'content');\n _context2.next = 4;\n return store.apiCall(contentRaf);\n case 4:\n text = _context2.sent;\n _items = text.items();\n if (!(typeof _items === 'string')) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt(\"return\", _items);\n case 5:\n _r = _items.toJS();\n if (!table) {\n _context2.next = 7;\n break;\n }\n 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://restaflib/./jesSummary.js?\n}");
|
|
614
603
|
|
|
615
|
-
/***/ }
|
|
604
|
+
/***/ },
|
|
616
605
|
|
|
617
|
-
/***/ "./jobRun.js"
|
|
606
|
+
/***/ "./jobRun.js"
|
|
618
607
|
/*!*******************!*\
|
|
619
608
|
!*** ./jobRun.js ***!
|
|
620
609
|
\*******************/
|
|
621
|
-
|
|
610
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
622
611
|
|
|
623
612
|
"use strict";
|
|
624
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jesSummary_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./jesSummary.js */ \"./jesSummary.js\");\n
|
|
613
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jesSummary_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./jesSummary.js */ \"./jesSummary.js\");\n\n\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n;\n\n/**\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 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(store, jobName, args) {\n var _yield$store$addServi, jobExecution, payload, thisJob, id, argument, jobRequest, job1, status, results, _t;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 1;\n return store.addServices('jobExecution');\n case 1:\n _yield$store$addServi = _context.sent;\n jobExecution = _yield$store$addServi.jobExecution;\n payload = {\n qs: {\n filter: \"eq(name,'\".concat(jobName, \"')\")\n }\n };\n _context.prev = 2;\n _context.next = 3;\n return store.apiCall(jobExecution.links('jobs'), payload);\n case 3:\n thisJob = _context.sent;\n if (!(thisJob.itemsList().size === 0)) {\n _context.next = 4;\n break;\n }\n throw \"Error: \".concat(jobName, \" not found in the system\");\n case 4:\n id = thisJob.items(thisJob.itemsList(0), 'data', 'jobRequest', 'jobDefinition'); //setup job request payload\n argument = _objectSpread(_objectSpread({}, args), {}, {\n _omitSessionResults: false,\n _resultfile: '*',\n _output_json: 'json'\n });\n jobRequest = {\n data: {\n jobDefinition: id,\n arguments: argument\n }\n }; // use the submit job link to submit the job\n _context.next = 5;\n return store.apiCall(thisJob.links('submitJob'), jobRequest);\n case 5:\n job1 = _context.sent;\n _context.next = 6;\n return store.jobState(job1, null, 'wait', 2);\n case 6:\n status = _context.sent;\n if (!(status.data === 'running')) {\n _context.next = 7;\n break;\n }\n throw \"ERROR: Job did not complete in allotted time.\";\n case 7:\n if (!(status.data === 'failed')) {\n _context.next = 8;\n break;\n }\n throw \"ERROR: Job failed. See SAS Environment for details.\";\n case 8:\n _context.next = 9;\n return (0,_jesSummary_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(store, status.job);\n case 9:\n results = _context.sent;\n return _context.abrupt(\"return\", results);\n case 10:\n _context.next = 12;\n break;\n case 11:\n _context.prev = 11;\n _t = _context[\"catch\"](2);\n throw _t;\n case 12:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[2, 11]]);\n }));\n return _jobRun.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (jobRun);\n\n//# sourceURL=webpack://restaflib/./jobRun.js?\n}");
|
|
625
614
|
|
|
626
|
-
/***/ }
|
|
615
|
+
/***/ },
|
|
627
616
|
|
|
628
|
-
/***/ "./jsonToDict.js"
|
|
617
|
+
/***/ "./jsonToDict.js"
|
|
629
618
|
/*!***********************!*\
|
|
630
619
|
!*** ./jsonToDict.js ***!
|
|
631
620
|
\***********************/
|
|
632
|
-
|
|
621
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
633
622
|
|
|
634
623
|
"use strict";
|
|
635
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n
|
|
624
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"../../../node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n*/\n;\n\n/**\n * @description Produce a string with casl dictionary suitable for inclusion in casl code\n * \n * @module jsonToDict\n * @category restaflib/util\n * @param {object} obj - the JS object of interest\n * @param {string} name - the name to assign to the dictionary\n * \n * @returns {string} returns the string containing the casl dictionary\n * @alias module: jsonToDict\n * @example\n * \n * obj = {x: 1, b:2, c: ['a','b']};\n * name ='_appEnv_';\n * result is a string _appEnv_ = {x=2, b=3, c={\"a\", \"b\"}}\n */\n\nfunction jsonToDict(obj, name) {\n var o1;\n if (obj === null) {\n o1 = \"{}\";\n } else {\n o1 = Array.isArray(obj) === true ? handleArray(obj) : handleObject(obj);\n }\n return \"\".concat(name, \" = \").concat(o1, \";\");\n}\nfunction handleObject(obj) {\n var r = '{ ';\n var sep = ' ';\n for (var k in obj) {\n if (Array.isArray(obj[k]) === true) {\n var o = handleArray(obj[k]);\n r = r + sep + \"\".concat(k, \"=\") + o;\n } else {\n var type = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(obj[k]);\n if (type === 'object') {\n var _o = handleObject(obj[k]);\n r = r + sep + \"\".concat(k, \"=\") + _o;\n } else {\n r = r + sep + \"\".concat(k, \"=\") + (type === 'string' ? \" \\\"\".concat(obj[k], \"\\\" \") : \"\".concat(obj[k], \" \"));\n }\n }\n sep = ',';\n }\n r = r + '} ';\n return r;\n}\nfunction handleArray(obj) {\n var r = '{';\n var sep = ' ';\n var size = obj.length;\n for (var k = 0; k < size; k++) {\n if (Array.isArray(obj[k]) === true) {\n var o = handleArray(obj[k]);\n r = r + sep + \"\".concat(k, \"=\") + o;\n } else {\n var type = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(obj[k]);\n if (type === 'object') {\n var _o2 = handleObject(obj[k]);\n r = r + sep + _o2;\n } else {\n r = r + sep + (type === 'string' ? \" \\\"\".concat(obj[k], \"\\\" \") : \"\".concat(obj[k], \" \"));\n }\n sep = ',';\n }\n }\n r = r + '}';\n return r;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (jsonToDict);\n\n//# sourceURL=webpack://restaflib/./jsonToDict.js?\n}");
|
|
636
625
|
|
|
637
|
-
/***/ }
|
|
626
|
+
/***/ },
|
|
638
627
|
|
|
639
|
-
/***/ "./
|
|
640
|
-
/*!****************!*\
|
|
641
|
-
!*** ./lib.js ***!
|
|
642
|
-
\****************/
|
|
643
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
644
|
-
|
|
645
|
-
"use strict";
|
|
646
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _caslRun__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./caslRun */ \"./caslRun.js\");\n/* harmony import */ var _caslRunBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./caslRunBase */ \"./caslRunBase.js\");\n/* harmony import */ var _caslScore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./caslScore */ \"./caslScore.js\");\n/* harmony import */ var _caslDescribe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./caslDescribe */ \"./caslDescribe.js\");\n/* harmony import */ var _casSetup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./casSetup */ \"./casSetup.js\");\n/* harmony import */ var _casActionRun__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./casActionRun */ \"./casActionRun.js\");\n/* harmony import */ var _casFetchData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./casFetchData */ \"./casFetchData.js\");\n/* harmony import */ var _casUpdateData__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./casUpdateData */ \"./casUpdateData.js\");\n/* harmony import */ var _casTableToJson__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./casTableToJson */ \"./casTableToJson.js\");\n/* harmony import */ var _computeRun__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./computeRun */ \"./computeRun.js\");\n/* harmony import */ var _computeSetup__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./computeSetup */ \"./computeSetup.js\");\n/* harmony import */ var _computeSummary__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./computeSummary */ \"./computeSummary.js\");\n/* harmony import */ var _computeResults__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./computeResults */ \"./computeResults.js\");\n/* harmony import */ var _computeFetchData__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./computeFetchData */ \"./computeFetchData.js\");\n/* harmony import */ var _computeFileContent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./computeFileContent */ \"./computeFileContent.js\");\n/* harmony import */ var _findReport__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./findReport */ \"./findReport.js\");\n/* harmony import */ var _getReportImage__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./getReportImage */ \"./getReportImage.js\");\n/* harmony import */ var _getReportUri__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./getReportUri */ \"./getReportUri.js\");\n/* harmony import */ var _getSasTableRows__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./getSasTableRows */ \"./getSasTableRows.js\");\n/* harmony import */ var _jesSetup__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./jesSetup */ \"./jesSetup.js\");\n/* harmony import */ var _jesRun__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./jesRun */ \"./jesRun.js\");\n/* harmony import */ var _jesSummary__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./jesSummary */ \"./jesSummary.js\");\n/* harmony import */ var _jsonToDict__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./jsonToDict */ \"./jsonToDict.js\");\n/* harmony import */ var _masSetup__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./masSetup */ \"./masSetup.js\");\n/* harmony import */ var _masDescribe__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./masDescribe */ \"./masDescribe.js\");\n/* harmony import */ var _masRun__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./masRun */ \"./masRun.js\");\n/* harmony import */ var _masAddModel__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./masAddModel */ \"./masAddModel.js\");\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//import casUpload from './casUpload';\n//import uploadData from './uploadData';\n\nfunction lib() {\n return {\n caslRun: _caslRun__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n caslRunBase: _caslRunBase__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n casSetup: _casSetup__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n casActionRun: _casActionRun__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n // casTableToJson,\n casFetchData: _casFetchData__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n casUpdateData: _casUpdateData__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n computeRun: _computeRun__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n computeSetup: _computeSetup__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n computeSummary: _computeSummary__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n computeFetchData: _computeFetchData__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n computeFileContent: _computeFileContent__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n computeResults: _computeResults__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n findReport: _findReport__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n getReportImage: _getReportImage__WEBPACK_IMPORTED_MODULE_16__[\"default\"],\n getReportUri: _getReportUri__WEBPACK_IMPORTED_MODULE_17__[\"default\"],\n getSASTableRows: _getSasTableRows__WEBPACK_IMPORTED_MODULE_18__[\"default\"],\n jesSetup: _jesSetup__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n jesRun: _jesRun__WEBPACK_IMPORTED_MODULE_20__[\"default\"],\n jesSummary: _jesSummary__WEBPACK_IMPORTED_MODULE_21__[\"default\"],\n jsonToDict: _jsonToDict__WEBPACK_IMPORTED_MODULE_22__[\"default\"],\n casTableToJson: _casTableToJson__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n caslScore: _caslScore__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n caslDescribe: _caslDescribe__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n masSetup: _masSetup__WEBPACK_IMPORTED_MODULE_23__[\"default\"],\n masAddModel: _masAddModel__WEBPACK_IMPORTED_MODULE_26__[\"default\"],\n masDescribe: _masDescribe__WEBPACK_IMPORTED_MODULE_24__[\"default\"],\n masRun: _masRun__WEBPACK_IMPORTED_MODULE_25__[\"default\"]\n\n // casUpload : casUpload,\n // uploadData: uploadData\n };\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (lib);\n\n//# sourceURL=webpack://restaflib/./lib.js?\n}");
|
|
647
|
-
|
|
648
|
-
/***/ }),
|
|
649
|
-
|
|
650
|
-
/***/ "./masAddModel.js":
|
|
628
|
+
/***/ "./masAddModel.js"
|
|
651
629
|
/*!************************!*\
|
|
652
630
|
!*** ./masAddModel.js ***!
|
|
653
631
|
\************************/
|
|
654
|
-
|
|
632
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
655
633
|
|
|
656
634
|
"use strict";
|
|
657
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
635
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _getScoreStep_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 = _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://restaflib/./masAddModel.js?\n}");
|
|
658
636
|
|
|
659
|
-
/***/ }
|
|
637
|
+
/***/ },
|
|
660
638
|
|
|
661
|
-
/***/ "./masDescribe.js"
|
|
639
|
+
/***/ "./masDescribe.js"
|
|
662
640
|
/*!************************!*\
|
|
663
641
|
!*** ./masDescribe.js ***!
|
|
664
642
|
\************************/
|
|
665
|
-
|
|
643
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
666
644
|
|
|
667
645
|
"use strict";
|
|
668
646
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Score using MAS\n * @module masDescribe\n * @category restaflib/mas\n * @param {object} masControl - object from masSetup\n * @param {string} modelName - name of model to be executed\n * @param {string} step - if not specified it will try to find score or execute\n * \n * @returns {object} - return input information\n * @alias module: masDescribe\n * @example\n * let inputs = restaflib.masDescribe(masControl, 'modela', 'score');\n */\nfunction masDescribe(masControl, modelName, step, all) {\n var stepControl = masControl.steps[modelName];\n if (stepControl === null) {\n return [];\n }\n var currentStep = null;\n if (step == null) {\n var stepIndex = stepControl.stepIds.findIndex(function (x) {\n return x === 'execute' || x === 'score';\n });\n if (stepIndex === -1) {\n return [];\n } else {\n currentStep = stepControl.stepIds[stepIndex];\n }\n var desc = stepControl.stepsRafLink.items(currentStep, 'data', 'inputs');\n var desco = stepControl.stepsRafLink.items(currentStep, 'data', 'outputs');\n if (desc === null) {\n return [];\n }\n var result = all === true ? {\n inputs: desc.toJS(),\n outputs: desco.toJS()\n } : desc.toJS();\n return result;\n } else {\n var _stepIndex = stepControl.stepIds.findIndex(function (x) {\n return x === step;\n });\n if (_stepIndex === -1) {\n return [];\n } else {\n currentStep = step;\n }\n var allSteps = stepControl.stepsRafLink.items(currentStep, 'data', 'inputs');\n var outputs = stepControl.stepsRafLink.items(currentStep, 'data', 'outputs');\n if (allSteps === null) {\n return [];\n }\n var _result = all === true ? {\n inputs: allSteps.toJS(),\n outputs: outputs.toJS()\n } : allSteps.toJS();\n return _result;\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (masDescribe);\n\n//# sourceURL=webpack://restaflib/./masDescribe.js?\n}");
|
|
669
647
|
|
|
670
|
-
/***/ }
|
|
648
|
+
/***/ },
|
|
671
649
|
|
|
672
|
-
/***/ "./masRun.js"
|
|
650
|
+
/***/ "./masRun.js"
|
|
673
651
|
/*!*******************!*\
|
|
674
652
|
!*** ./masRun.js ***!
|
|
675
653
|
\*******************/
|
|
676
|
-
|
|
654
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
677
655
|
|
|
678
656
|
"use strict";
|
|
679
657
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Score using MAS\n * @module masRun\n * @param {store} restaf store\n * @category restaflib/mas\n * @param {object} masControl - object from masSetup\n * @param {string} modelName - name of model to be executed\n * @param {object} scenario - can be [{name: var1, value: value1},{...} ] or {varname: value,...}\n * @param {string} stepName - if not specified it will default to score or execute\n * \n * @returns {promise} - returns scoring results\n * @alias module: masrun\n * @example\n * async function example (models, payload) {\n * await store.logon(payload);\n * let masControl = await restaflib.masSetup(store, models);\n * let defaults = {\n * prescriber_count : 1,\n * strength_per_unit: 15,\n * age : 74,\n * avg_opioid_prescriber_rate: 10.4,\n * doctorshop_med : 1,\n * max_avg_med_90 : 10,\n * max_mme_per_day: 40,\n * max_opioid_prescriber_rate: 13.21,\n * opioid_days: 3\n * };\n * let inp = restaflib.masDescribe(masControl, models[0], 'score');\n * print.object(inp, 'describe for score model');\n * inp = inp.map((n) => {\n * n.value = defaults[n.name];\n * return n;\n * });\n * print.object(inp, 'updated input for score model');\n * let result = await restaflib.masRun (store, masControl, models[0], inp, 'score');\n * print.object(result, 'scoring result');\n * }\n */\nfunction masRun(_x, _x2, _x3, _x4, _x5, _x6) {\n return _masRun.apply(this, arguments);\n}\nfunction _masRun() {\n _masRun = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, masControl, modelName, scenario, step, cmd) {\n var stepControl, inputIsArray, inputs, r, item, scorePayload, currentStep, stepIndex, _stepIndex, rafLink, t, result, outputs, score;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n stepControl = masControl.steps[modelName];\n inputIsArray = false;\n inputs = [];\n if (Array.isArray(scenario) === false) {\n for (r in scenario) {\n item = {\n name: r,\n value: scenario[r]\n };\n inputs.push(item);\n }\n } else {\n inputIsArray = true;\n }\n scorePayload = {\n data: {\n inputs: inputIsArray === true ? scenario : inputs\n }\n };\n currentStep = null; //TBD: Need to convert stepId from array to object for cleaner coding\n if (!(step == null)) {\n _context.next = 3;\n break;\n }\n stepIndex = stepControl.stepIds.findIndex(function (x) {\n return x === 'execute' || x === 'score';\n });\n if (!(stepIndex === -1)) {\n _context.next = 1;\n break;\n }\n return _context.abrupt(\"return\", []);\n case 1:\n currentStep = stepControl.stepIds[stepIndex];\n case 2:\n _context.next = 5;\n break;\n case 3:\n _stepIndex = stepControl.stepIds.findIndex(function (x) {\n return x === step;\n });\n if (!(_stepIndex === -1)) {\n _context.next = 4;\n break;\n }\n return _context.abrupt(\"return\", []);\n case 4:\n currentStep = step;\n case 5:\n if (cmd == null) {\n cmd = 'execute';\n }\n rafLink = stepControl.stepsRafLink.itemsCmd(currentStep, cmd);\n if (!(rafLink === null)) {\n _context.next = 6;\n break;\n }\n t = [{\n name: 'Error',\n type: 'string',\n value: \"name: \".concat(modelName, \" step: \").concat(step, \" operation: \").concat(cmd, \" is an invalid combination\")\n }];\n return _context.abrupt(\"return\", t);\n case 6:\n _context.next = 7;\n return store.apiCall(rafLink, scorePayload);\n case 7:\n result = _context.sent;\n outputs = result.items('outputs').toJS();\n if (inputIsArray === true) {\n score = outputs;\n } else {\n score = {};\n outputs.map(function (m) {\n score[m.name] = m.value;\n });\n }\n return _context.abrupt(\"return\", score);\n case 8:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _masRun.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (masRun);\n\n//# sourceURL=webpack://restaflib/./masRun.js?\n}");
|
|
680
658
|
|
|
681
|
-
/***/ }
|
|
659
|
+
/***/ },
|
|
682
660
|
|
|
683
|
-
/***/ "./masScore.js"
|
|
661
|
+
/***/ "./masScore.js"
|
|
684
662
|
/*!*********************!*\
|
|
685
663
|
!*** ./masScore.js ***!
|
|
686
664
|
\*********************/
|
|
687
|
-
|
|
665
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
688
666
|
|
|
689
667
|
"use strict";
|
|
690
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
668
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* 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 = _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://restaflib/./masScore.js?\n}");
|
|
691
669
|
|
|
692
|
-
/***/ }
|
|
670
|
+
/***/ },
|
|
693
671
|
|
|
694
|
-
/***/ "./masSetup.js"
|
|
672
|
+
/***/ "./masSetup.js"
|
|
695
673
|
/*!*********************!*\
|
|
696
674
|
!*** ./masSetup.js ***!
|
|
697
675
|
\*********************/
|
|
698
|
-
|
|
676
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
699
677
|
|
|
700
678
|
"use strict";
|
|
701
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
679
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _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 = _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://restaflib/./masSetup.js?\n}");
|
|
702
680
|
|
|
703
|
-
/***/ }
|
|
681
|
+
/***/ },
|
|
704
682
|
|
|
705
|
-
/***/ "./programs/casAppendTable.js"
|
|
683
|
+
/***/ "./programs/casAppendTable.js"
|
|
706
684
|
/*!************************************!*\
|
|
707
685
|
!*** ./programs/casAppendTable.js ***!
|
|
708
686
|
\************************************/
|
|
709
|
-
|
|
687
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
710
688
|
|
|
711
689
|
"use strict";
|
|
712
690
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\nfunction casAppendTable() {\n var src = \"\\n rc = checkAndLoadTable(_args_.masterTable.caslib, _args_.masterTable.name);\\n\\n if (rc ne true) then do;\\n text = 'Unable to access ' ||_args_.masterTable.caslib||'.'||_args_.masterTable.name; \\n rx = {severity=2,reason=6, status='error',statusCode=2, formatted=text};\\n exit(rx); \\n end; \\n \\n rc = checkAndLoadTable(_args_.setTable.caslib, _args_.setTable.name);\\n if (rc ne true) then do;\\n text = 'Unable to access ' ||_args_.setTable.caslib||'.'||_args_.setTable.name; \\n rx = {severity=2,reason=6, status='error',statusCode=2, formatted=text};\\n return rx;\\n end;\\n\\n\\n setdata = _args_.setTable.caslib ||'.'||_args_.setTable.name;\\n masterdata = _args_.masterTable.caslib ||'.'||_args_.masterTable.name;\\n\\n action datastep.runCode r=result status=rc/\\n code='data ' ||masterdata||'(append=YES);set ' || setdata ||'; run;';\\n\\n if (rc.statusCode ne 0) then do;\\n exit(rc);\\n end; \\n else do;\\n results = {msg= 'Append succeeded', statusCode=true};\\n end;\\n \\n send_response({casResults = results});\\n \";\n return src;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casAppendTable);\n\n//# sourceURL=webpack://restaflib/./programs/casAppendTable.js?\n}");
|
|
713
691
|
|
|
714
|
-
/***/ }
|
|
692
|
+
/***/ },
|
|
715
693
|
|
|
716
|
-
/***/ "./programs/casFetchData.js"
|
|
694
|
+
/***/ "./programs/casFetchData.js"
|
|
717
695
|
/*!**********************************!*\
|
|
718
696
|
!*** ./programs/casFetchData.js ***!
|
|
719
697
|
\**********************************/
|
|
720
|
-
|
|
698
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
721
699
|
|
|
722
700
|
"use strict";
|
|
723
701
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\nfunction casFetchData() {\n var code = \"\\n print _args_;\\n\\n results = casFetchRows(_args_.table.caslib, _args_.table.name , _args_.start + 1, _args_.limit, _args_.format, _args_.where); \\n send_response({casResults = results}); \\n \\n function casFetchRows(caslib, name, from, count, format, where) ; \\n \\n rc = checkAndLoadTable(caslib, name);\\n \\n if (rc ne true) then do;\\n text = 'Unable to access ' ||caslib||'.'||name; \\n rx = {severity=2,reason=6, status='error',statusCode=2, formatted=text};\\n exit(rx); \\n end; \\n\\n /*\\n * get tableoinfo to get rowCount\\n */\\n\\n action table.tableinfo r= result/ \\n caslib = caslib \\n name = name; \\n \\n rowCount = result.TableInfo[1, 'rows'];\\n to = from + count - 1;\\n\\n \\n /*\\n * get column information\\n */\\n\\n action table.columninfo r=infoResult /\\n table = {caslib=caslib name=name};\\n\\n columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}};\\n i = 2;\\n do c over inforesult.columninfo;\\n columns[i] = c;\\n i = i + 1;\\n end;\\n \\n /*\\n * Fetch the current set of rows\\n */\\n\\n rows = {};\\n if (from <= rowCount) then do;\\n action table.fetch r = result status=rcx/ \\n table = {caslib=caslib, name=name where=where} \\n from= from to=to format=format sastypes=true\\n ;\\n if (rcx.severity eq 2) then do;\\n exit(rcx);\\n end;\\n /* \\n * create payload to return\\n */\\n\\n i = 1;\\n rows ={};\\n do row over result.fetch;\\n rr = {};\\n j = 1;\\n do key,v over row;\\n rr[j] = override(columns[j].Type, v);\\n j = j + 1;\\n end;\\n rows[i] = rr;\\n i = i + 1;\\n end;\\n end;\\n\\n currentCount = DIM(rows);\\n pagination = {}; \\n table = {caslib=caslib, name=name};\\n\\n pagination = setPagination(from, count, format, where, currentCount, rowCount, table);\\n \\n lastRequest={start=from-1, limit=count, format=format, currentCount=currentCount, \\n rowCount=rowCount, where=where, table=table, version='3'};\\n scrollOptions = getKeys(pagination);\\n return( \\n {pagination = pagination, data = {schema=columns, rows=rows , scrollOptions=scrollOptions}, lasRequest=lastRequest}\\n );\\n end; \\n \\n \\n /*\\n * For non-primary column types set new content\\n */\\n\\n function setPagination(from, count, format, where, currentCount, rowCount, table);\\n\\n\\n prevStart = max(from - count - 1, 0);\\n\\n if (currentCount lt count) then do; \\n pagination.prev = {start=prevStart, limit=count, format=format, where=' ', table=table};\\n if (prevStart ne 0) then do;\\n pagination.first = {start=0, limit=count, format=format, where=' ', table=table};\\n end; \\n return pagination;\\n end;\\n currentStart = from -1;\\n if (currentStart eq 0) then do;\\n pagination.next = {start=count, limit=count, format=format, where=' ', table=table};\\n return pagination;\\n end;\\n\\n nextStart = currentStart + count;\\n pagination.next = {start=nextStart, limit=count, format=format, where=' ', table=table};\\n pagination.prev = {start=prevStart, limit=count, format=format, where=' ', table=table};\\n if (prevStart ne 0) then do;\\n pagination.first = {start=0, limit=count, format=format, where=' ', table=table};\\n end; \\n return pagination;\\n end;\\n\\n\\n\\n\\n function override(type, iv);\\n if (type EQ 'varbinary') then v = '...varbinary';\\n else if (type EQ 'blob') then v = '...blob';\\n else if (type EQ 'table') then v = '...table';\\n else if (type EQ 'dictionary') then v = '...dictionary';\\n else if (type EQ 'list') then v = '...list';\\n else if (type EQ 'isArray') then v = '...array';\\n else v = iv;\\n return v;\\n end;\\n\\n \\n \";\n return code;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casFetchData);\n\n//# sourceURL=webpack://restaflib/./programs/casFetchData.js?\n}");
|
|
724
702
|
|
|
725
|
-
/***/ }
|
|
703
|
+
/***/ },
|
|
726
704
|
|
|
727
|
-
/***/ "./programs/casFetchRows.js"
|
|
705
|
+
/***/ "./programs/casFetchRows.js"
|
|
728
706
|
/*!**********************************!*\
|
|
729
707
|
!*** ./programs/casFetchRows.js ***!
|
|
730
708
|
\**********************************/
|
|
731
|
-
|
|
709
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
732
710
|
|
|
733
711
|
"use strict";
|
|
734
712
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n/* deprecate */\nfunction casFetchRows() {\n var code = \"\\n results = casFetchRows(_args_.table.caslib, _args_.table.name , _args_.from, _args_.count, _args_.format, _args_.where); \\n send_response({casResults = results}); \\n \\n function casFetchRows(caslib, name, from, count, format, where) ; \\n \\n rc = checkAndLoadTable(caslib, name);\\n \\n if (rc ne true) then do;\\n text = 'Unable to access ' ||caslib||'.'||name; \\n rx = {severity=2,reason=6, status='error',statusCode=2, formatted=text};\\n exit(rx); \\n end; \\n\\n /*\\n * get all table to get rowCount\\n */\\n\\n action table.tableinfo r= result/ \\n caslib = caslib \\n name = name; \\n \\n rowCount = result.TableInfo[1, 'rows']; \\n \\n to = from + count - 1; \\n \\n /*\\n * get column information\\n */\\n\\n action table.columninfo r=infoResult /\\n table = {caslib=caslib name=name};\\n\\n columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}};\\n i = 2;\\n do c over inforesult.columninfo;\\n columns[i] = c;\\n i = i + 1;\\n end;\\n \\n /*\\n * Fetch the current set of rows\\n */\\n /* wherex = dictTowhere(where); let user send in the where clause */\\n print where;\\n\\n action table.fetch r = result / \\n table = {caslib=caslib, name=name where=where} \\n from= from to=to format=format sastypes=true\\n ;\\n\\n /* \\n * create payload to return\\n */\\n\\n i = 1;\\n rows ={};\\n do row over result.fetch;\\n rr = {};\\n j = 1;\\n do key,v over row;\\n rr[j] = override(columns[j].Type, v);\\n j = j + 1;\\n end;\\n rows[i] = rr;\\n i = i + 1;\\n end;\\n\\n pagePrev = max(from - count, 1);\\n \\n if ( to eq rowCount ) then do; \\n pageNext = -1; \\n end; \\n else do ; \\n pageNext = min(to + 1, rowCount); \\n end; \\n table = {caslib=caslib, name=name};\\n pagination = {next= {from=pageNext, count=count, format=format, where=where table=table}, prev={from=pagePrev, count=count, format=format, where=where, table=table}};\\n pagination.current = {from = from, to=to, rowCount=rowCount, version=1};\\n return( \\n {pagination = pagination, data = {schema=columns, rows=rows }}\\n );\\n end; \\n \\n \\n /*\\n * For non-primary column types set new content\\n */\\n\\n function override(type, iv);\\n if (type EQ 'varbinary') then v = '...varbinary';\\n else if (type EQ 'blob') then v = '...blob';\\n else if (type EQ 'table') then v = '...table';\\n else if (type EQ 'dictionary') then v = '...dictionary';\\n else if (type EQ 'list') then v = '...list';\\n else if (type EQ 'isArray') then v = '...array';\\n else v = iv;\\n return v;\\n end;\\n\\n \\n \";\n return code;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (casFetchRows);\n\n//# sourceURL=webpack://restaflib/./programs/casFetchRows.js?\n}");
|
|
735
713
|
|
|
736
|
-
/***/ }
|
|
714
|
+
/***/ },
|
|
737
715
|
|
|
738
|
-
/***/ "./programs/commonCasl.js"
|
|
716
|
+
/***/ "./programs/commonCasl.js"
|
|
739
717
|
/*!********************************!*\
|
|
740
718
|
!*** ./programs/commonCasl.js ***!
|
|
741
719
|
\********************************/
|
|
742
|
-
|
|
720
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
743
721
|
|
|
744
722
|
"use strict";
|
|
745
723
|
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\nfunction commonCasl() {\n var casl = \"\\n function checkAndLoadTable(caslib, name); \\n \\n /* verify caslib is there */\\n table.queryCaslib status=status result=result/\\n caslib = caslib;\\n do k,v over result; /* to handle casuser[user] */ \\n rc = v;\\n end;\\n if ( rc eq false ) then \\n return -1;\\n /* \\n * Check to see if table is already loaded \\n */ \\n action table.tableExists r=result/ \\n caslib = caslib \\n name = name; \\n /* \\n * if not loaded then try to load it \\n */ \\n rc = true;\\n if (result.exists eq 0 or result.exists eq 2) then do; \\n path = lookupPath(caslib, name);\\n if (path eq '*') then do;\\n rc = false;\\n end;\\n else do;\\n action table.loadTable status=status/ \\n caslib = caslib \\n source = path \\n casout={caslib= caslib name=name}; \\n if (status.statusCode ne 0 ) then rc = false;\\n end; \\n end; \\n return rc; \\n end; \\n \\n function saveAndLoadTable(caslib, source, targetlib, targetname,promote);\\n \\n /* load source */\\n r = checkAndLoadTable(caslib, source);\\n \\n sashdat = target||\\\".sashdat\\\";\\n table.save /\\n caslib= targetlib name=sashdat\\n table = {caslib=caslib name=source} replace=true;\\n \\n table.droptable /\\n caslib=targetlib name=target quiet=true;\\n \\n table.loadtable result=r status=rc/\\n caslib=targetlib casout={caslib=targetlib name=target replace=TRUE}\\n path=sashdat;\\n \\n if (promote eq true) then do;\\n table.promote result=r status=rc/\\n caslib=caslib name=target quiet=true\\n targetLib=caslib target=target;\\n end;\\n if (rc.severity eq 2) then do;\\n print rc;\\n print 'Ignoring error';\\n end;\\n r = 0;\\n return r;\\n \\n end;\\n \\n function lookupPath(caslib, name ) ; \\n table.fileInfo r = result/\\n caslib=caslib; \\n \\n names = result.fileInfo[,4]; \\n nameu = upcase(name)||'.SASHDAT'; \\n cpath = '*'; \\n count = 0; \\n \\n do n over names; \\n if (upcase(n) eq nameu) then do; \\n count = count + 1; \\n if ( cpath eq '*') then do; \\n cpath = n; \\n end; \\n end; \\n end; \\n \\n if (count GT 1 ) then do; \\n print 'Warning: ' count 'Files with names only different in case exist - First one chosen';\\n print 'Path: ' cpath ' will be used****'; \\n end; \\n r = cpath; \\n return r; \\n end; \\n /*-----------------------------------------*/ \\n /* isModel: is it model table */ \\n /*-----------------------------------------*/ \\n \\n function isModel(caslib, name) ; \\n table.columnInfo r = result / \\n table = {caslib=caslib , name=name}; \\n validTable = false; \\n mtype = 'bad'; \\n do c over result.columninfo; \\n cu = upCase(c.Column); \\n if ( cu eq 'DATASTEPSRC') then do; \\n mtype = 'ds'; \\n end; \\n else if ( cu eq '_STATE_' ) then do; \\n mtype = 'astore'; \\n end; \\n else if (cu eq 'MODELMETADATA') then do; \\n mtype = 'ds2'; \\n end; \\n end; \\n print 'Specified model type: ' || mtype; \\n return mtype; \\n end; \\n \\n /*-----------------------------------------*/ \\n /* Returns contents of the specified table */ \\n /*-----------------------------------------*/ \\n \\n function contents(caslib, name) ; \\n table.columnInfo r = result / \\n table = {caslib=caslib , name=name}; \\n /* columns ={{Column='_Index_',ID=0,Type='double',RawLength=5,FormattedLength=5,NFL=0,NFD=0}}; */ \\n i = 1; \\n columns = {}; \\n do c over result.columninfo; \\n columns[i] = c; \\n i = i + 1; \\n end; \\n return {describe = columns, table = {}}; \\n end; \\n \\n /*------------------------------------------*/ \\n /* Returns unique values */ \\n /*-----------------------------------------*/ \\n \\n function selectionLists(idvars,caslib, name, where); \\n \\n s = checkAndLoadTable(caslib, name); \\n if ( s ne true) then do; \\n results = {Errors= 'Unable to access ' ||caslib||'.'||name, statusCode = s}; \\n \\n end; \\n print idvars;\\n do k over idvars; \\n r = _getValues(k, caslib, name, where); \\n results[k] = r; \\n end; \\n return { data=results, statusCode=0}; \\n end; \\n function _getValues(id, caslib, name, where) ; \\n \\n action table.dropTable/ \\n caslib='casuser' name='dtemp1' quiet=TRUE; \\n \\n action table.deleteSource status=src / \\n caslib='casuser' source= 'dtemp1.sashdat' quiet=TRUE; \\n \\n action simple.groupby result=r status=rc/ \\n aggregator = 'N' \\n inputs = {id} \\n table = {caslib=caslib name=name, where=where} \\n casout = {caslib='casuser' name='dtemp1'} \\n ; \\n action table.fetch result=r/ \\n table={caslib='casuser' name='dtemp1'} \\n sortby={{name=id, order='ascending'}}; \\n result = r.Fetch[,2]; \\n return result; \\n end; \\n /*------------------------------------------*/ \\n /* get a record */ \\n /*------------------------------------------*/ \\n \\n function _fetchData(filter, table); \\n s = checkAndLoadTable(table.caslib, table.name); \\n if ( s ne 0 ) then do; \\n results = {Errors= 'Unable to access ' ||table.caslib||'.'||table.name}; \\n return results; \\n end; \\n wherex = dictTowhere(filter); \\n /* wherex = table.caslib||'.'||table.name||'(where=('||wherex||'));'; \\n \\n destroyTable('casuser', 'input'); \\n \\n action datastep.runCode r=result status=rc/ \\n single='yes' \\n code = 'data casuser.input; set ' || wherex||'run;'; \\n */ \\n \\n action table.fetch r = result / \\n table={caslib=table.caslib name=table.name where=wherex}; \\n \\n rows = resultsToDict(result.Fetch); \\n return {scenario = rows, table = result.Fetch}; \\n \\n end; \\n function destroyTable(caslib,name); \\n action table.dropTable/ \\n caslib=caslib name=name quiet=TRUE; \\n \\n action table.deleteSource status=src / \\n caslib=caslib source= name||'.sashdat' quiet=TRUE; \\n \\n return true; \\n end; \\n \\n \\n function dictToWhere(filter); \\n where =''; \\n andbit=' '; \\n do k,v over filter; \\n if (isString(v) ) then do; \\n where = where || andbit || k || ' eq ' || '\\\"'||v||'\\\"'; \\n end; \\n else do; \\n where = where || andbit || k || ' eq ' || v ; \\n end; \\n andbit =' and '; \\n end; \\n return where; \\n end; \\n \\n function resultsToDict(r); \\n casResults = {}; \\n i = 1; \\n do row over r; \\n casResults[i] = row; \\n i = i + 1; \\n end; \\n return casResults; \\n end; \\n \\n function argsToTable(_arg_, caslib, name ); \\n action table.droptable/ \\n caslib=caslib name=name quiet=TRUE; \\n i = 1; \\n do key,obj over _arg_; \\n columns[i] = key; \\n row[i] = obj; \\n if ( isString(obj) ) then \\n type[i] = 'varchar'; \\n else if ( isInteger(obj) ) then \\n type[i] = 'int'; \\n else type[i] = 'double'; \\n i = i + 1; \\n end; \\n \\n data1 = newTable('data1', columns, type, row ); \\n \\n saveresult data1 casout=name caslib=caslib replace; \\n end; \\n \\n function saveAndPromoteTable(caslib, target, source);\\n sashdat = target||\\\".sashdat\\\";\\n rc = checkAndLoadTable(caslib, source);\\n table.droptable /\\n caslib=caslib name=target quiet=true;\\n \\n table.save /\\n caslib= caslib name=sashdat\\n table = {caslib=caslib name=source} replace=true;\\n \\n table.loadtable result=r/\\n caslib=caslib casout={caslib=caslib name=target replace=TRUE}\\n path=sashdat;\\n \\n table.promote result=r status=rc/\\n caslib=caslib name=target quiet=true\\n targetLib=caslib target=target;\\n print rc;\\n r = rc.severity;\\n if (rc.severity gt 0) then do;\\n print rc;\\n print 'Ignoring error';\\n rc = 0;\\n end;\\n \\n return r;\\n end; \\n \\n \";\n return casl;\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (commonCasl);\n\n//# sourceURL=webpack://restaflib/./programs/commonCasl.js?\n}");
|
|
746
724
|
|
|
747
|
-
/***/ }
|
|
725
|
+
/***/ },
|
|
748
726
|
|
|
749
|
-
/***/ "./programs/index.js"
|
|
727
|
+
/***/ "./programs/index.js"
|
|
750
728
|
/*!***************************!*\
|
|
751
729
|
!*** ./programs/index.js ***!
|
|
752
730
|
\***************************/
|
|
753
|
-
|
|
731
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
754
732
|
|
|
755
733
|
"use strict";
|
|
756
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var
|
|
734
|
+
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://restaflib/./programs/index.js?\n}");
|
|
757
735
|
|
|
758
|
-
/***/ }
|
|
736
|
+
/***/ },
|
|
759
737
|
|
|
760
|
-
/***/ "./programs/scoreCasl.js"
|
|
738
|
+
/***/ "./programs/scoreCasl.js"
|
|
761
739
|
/*!*******************************!*\
|
|
762
740
|
!*** ./programs/scoreCasl.js ***!
|
|
763
741
|
\*******************************/
|
|
764
|
-
|
|
742
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
765
743
|
|
|
766
|
-
|
|
744
|
+
"use strict";
|
|
745
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n\nfunction 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://restaflib/./programs/scoreCasl.js?\n}");
|
|
767
746
|
|
|
768
|
-
/***/ }
|
|
747
|
+
/***/ },
|
|
769
748
|
|
|
770
|
-
/***/ "./uploadHandlers/index.js"
|
|
749
|
+
/***/ "./uploadHandlers/index.js"
|
|
771
750
|
/*!*********************************!*\
|
|
772
751
|
!*** ./uploadHandlers/index.js ***!
|
|
773
752
|
\*********************************/
|
|
774
|
-
|
|
753
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
775
754
|
|
|
776
755
|
"use strict";
|
|
777
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ uploadAstore: () => (/* reexport safe */
|
|
756
|
+
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://restaflib/./uploadHandlers/index.js?\n}");
|
|
778
757
|
|
|
779
|
-
/***/ }
|
|
758
|
+
/***/ },
|
|
780
759
|
|
|
781
|
-
/***/ "./uploadHandlers/saveTable.js"
|
|
760
|
+
/***/ "./uploadHandlers/saveTable.js"
|
|
782
761
|
/*!*************************************!*\
|
|
783
762
|
!*** ./uploadHandlers/saveTable.js ***!
|
|
784
763
|
\*************************************/
|
|
785
|
-
|
|
764
|
+
(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
786
765
|
|
|
787
766
|
"use strict";
|
|
788
|
-
eval("{/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/*\n* Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n* SPDX-License-Identifier: Apache-2.0\n*/\n
|
|
767
|
+
eval("{/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/*\n* 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 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, caslib, name) {\n var payload, rc;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n payload = {\n action: 'table.save',\n data: {\n name: \"\".concat(name),\n caslib: \"\".concat(caslib),\n replace: true,\n table: {\n name: \"\".concat(name),\n caslib: \"\".concat(caslib)\n }\n }\n };\n _context.next = 1;\n return store.runAction(session, payload);\n case 1:\n rc = _context.sent;\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _saveTable.apply(this, arguments);\n}\n/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (saveTable);\n\n//# sourceURL=webpack://restaflib/./uploadHandlers/saveTable.js?\n}");
|
|
789
768
|
|
|
790
|
-
/***/ }
|
|
769
|
+
/***/ },
|
|
791
770
|
|
|
792
|
-
/***/ "./uploadHandlers/uploadAstore.js"
|
|
771
|
+
/***/ "./uploadHandlers/uploadAstore.js"
|
|
793
772
|
/*!****************************************!*\
|
|
794
773
|
!*** ./uploadHandlers/uploadAstore.js ***!
|
|
795
774
|
\****************************************/
|
|
796
|
-
|
|
775
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
797
776
|
|
|
798
777
|
"use strict";
|
|
799
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n
|
|
778
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/*\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n;\nfunction uploadAstore(_x, _x2, _x3, _x4) {\n return _uploadAstore.apply(this, arguments);\n}\nfunction _uploadAstore() {\n _uploadAstore = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(store, session, astoreBuf, fileInfo) {\n var _fileInfo$output, caslib, name, casl, payload, r;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _fileInfo$output = fileInfo.output, caslib = _fileInfo$output.caslib, name = _fileInfo$output.name;\n if (!(name == null)) {\n _context.next = 1;\n break;\n }\n throw 'Please specify table as caslib.name';\n case 1:\n name = name.toLowerCase(name);\n\n // delete old table\n casl = \"\\n action table.droptable /\\n caslib= '\".concat(caslib, \"' name= '\").concat(name, \"' quiet=true;\\n\\n action table.deleteSource/\\n caslib= '\").concat(caslib, \"' source= '\").concat(name, \".sashdat' quiet=true; \\n \");\n payload = {\n action: 'sccasl.runcasl',\n data: {\n code: casl\n }\n };\n _context.next = 2;\n return store.runAction(session, payload);\n case 2:\n // upload table\n\n payload = {\n action: 'astore.upload',\n data: {\n rstore: {\n name: \"\".concat(name),\n caslib: \"\".concat(caslib),\n replace: true\n },\n store: astoreBuf\n }\n };\n _context.next = 3;\n return store.runAction(session, payload);\n case 3:\n r = _context.sent;\n return _context.abrupt(\"return\", \"Upload of \".concat(fileInfo.source, \" to \").concat(caslib, \".\").concat(name, \" completed\"));\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _uploadAstore.apply(this, arguments);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (uploadAstore);\n\n//# sourceURL=webpack://restaflib/./uploadHandlers/uploadAstore.js?\n}");
|
|
800
779
|
|
|
801
|
-
/***/ }
|
|
780
|
+
/***/ },
|
|
802
781
|
|
|
803
|
-
/***/ "./uploadHandlers/uploadSrc.js"
|
|
782
|
+
/***/ "./uploadHandlers/uploadSrc.js"
|
|
804
783
|
/*!*************************************!*\
|
|
805
784
|
!*** ./uploadHandlers/uploadSrc.js ***!
|
|
806
785
|
\*************************************/
|
|
807
|
-
|
|
786
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
808
787
|
|
|
809
788
|
"use strict";
|
|
810
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var
|
|
789
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _caslRun_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 = _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 = _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://restaflib/./uploadHandlers/uploadSrc.js?\n}");
|
|
811
790
|
|
|
812
|
-
/***/ }
|
|
791
|
+
/***/ },
|
|
813
792
|
|
|
814
|
-
/***/ "./uploadSetup.js"
|
|
793
|
+
/***/ "./uploadSetup.js"
|
|
815
794
|
/*!************************!*\
|
|
816
795
|
!*** ./uploadSetup.js ***!
|
|
817
796
|
\************************/
|
|
818
|
-
|
|
797
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
819
798
|
|
|
820
799
|
"use strict";
|
|
821
|
-
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"../../../node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var
|
|
800
|
+
eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"../../../node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _uploadHandlers_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 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_output$split, 2),\n caslib = _output$split2[0],\n name = _output$split2[1];\n return {\n source: source,\n output: {\n caslib: caslib,\n name: name.toLowerCase()\n },\n fileType: fileType /* for cas actions */,\n fileExt: fext,\n fileOptions: fileOptions,\n transform: transform,\n contentType: contentType,\n handler: handler\n };\n function toBase64(data) {\n return new Buffer.from(data).toString('base64');\n }\n function toCsv(data, fileInfo) {\n // preprocess to get rid of things that upset datastep\n // eslint-disable-next-line no-control-regex\n var isrc = data.replace(/[^\\x00-\\x7F]/g, '');\n var src = isrc.replace(/\\r?\\n/g, '');\n // convert to a csv\n var fileType = fileInfo.fileExt;\n var varname = fileType === 'sas' ? 'dataStepSrc' : fileType === 'ds2' ? 'ds2Src' : fileType === 'casl' ? 'caslSrc' : 'dataStepsrc';\n var csv = 'modelName' + '\\\\' + varname + '\\n' + fileInfo.output.name + '\\\\' + ' ' + src + '\\n';\n return csv;\n }\n function noChange(data) {\n return data;\n }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (uploadSetup);\n\n//# sourceURL=webpack://restaflib/./uploadSetup.js?\n}");
|
|
822
801
|
|
|
823
|
-
/***/ }
|
|
802
|
+
/***/ }
|
|
824
803
|
|
|
825
804
|
/******/ });
|
|
826
805
|
/************************************************************************/
|
|
@@ -834,6 +813,12 @@ eval("{/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* har
|
|
|
834
813
|
/******/ if (cachedModule !== undefined) {
|
|
835
814
|
/******/ return cachedModule.exports;
|
|
836
815
|
/******/ }
|
|
816
|
+
/******/ // Check if module exists (development only)
|
|
817
|
+
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
818
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
819
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
820
|
+
/******/ throw e;
|
|
821
|
+
/******/ }
|
|
837
822
|
/******/ // Create a new module (and put it into the cache)
|
|
838
823
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
839
824
|
/******/ // no module.id needed
|