@sassoftware/restaf 5.1.23 → 5.2.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/restaf.js +8 -8
- package/dist/restaf.min.js +4 -4
- package/lib/restaf.js +8 -8
- package/package.json +1 -1
package/dist/restaf.js
CHANGED
|
@@ -2107,7 +2107,7 @@ eval("/*\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights
|
|
|
2107
2107
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2108
2108
|
|
|
2109
2109
|
"use strict";
|
|
2110
|
-
eval("/* harmony import */ var _fixImages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fixImages */ \"./serverCalls/fixImages.js\");\n/* harmony import */ var _fixImages__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_fixImages__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _fixReports__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fixReports */ \"./serverCalls/fixReports.js\");\n/* harmony import */ var _fixReports__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_fixReports__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _casSessionLinks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./casSessionLinks */ \"./serverCalls/casSessionLinks.js\");\n/* harmony import */ var _casSessionLinks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_casSessionLinks__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _reduceCasResults__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reduceCasResults */ \"./serverCalls/reduceCasResults.js\");\n/* harmony import */ var _reduceCasResults__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_reduceCasResults__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _fixMlPipelineAutomation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fixMlPipelineAutomation */ \"./serverCalls/fixMlPipelineAutomation.js\");\n/* harmony import */ var _fixMlPipelineAutomation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_fixMlPipelineAutomation__WEBPACK_IMPORTED_MODULE_4__);\n/*------------------------------------------------------------------------------------\r\n Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights reserved Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n ---------------------------------------------------------------------------------------*/\n\n\n// let fixImages = require( './fixImages' );\n// let fixReports = require( './fixReports' );\n// let casSessionLinks = require( './casSessionLinks' );\n// let reduceCasResults = require( './reduceCasResults' );\n// let fixMlPipelineAutomation = require( './fixMlPipelineAutomation' );\n\n\n\n\n\nfunction fixResponse(response) {\n //\n // Ensure all header keys are lowercase\n //\n\n var headers = {};\n for (var k in response.headers) {\n //noinspection JSUnfilteredForInLoop\n var k1 = k.toLowerCase();\n //noinspection JSUnfilteredForInLoop\n headers[k1] = response.headers[k];\n }\n headers['tkhttp-id'] = null;\n if (headers['set-cookie'] != null) {\n
|
|
2110
|
+
eval("/* harmony import */ var _fixImages__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fixImages */ \"./serverCalls/fixImages.js\");\n/* harmony import */ var _fixImages__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_fixImages__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _fixReports__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fixReports */ \"./serverCalls/fixReports.js\");\n/* harmony import */ var _fixReports__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_fixReports__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _casSessionLinks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./casSessionLinks */ \"./serverCalls/casSessionLinks.js\");\n/* harmony import */ var _casSessionLinks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_casSessionLinks__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _reduceCasResults__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reduceCasResults */ \"./serverCalls/reduceCasResults.js\");\n/* harmony import */ var _reduceCasResults__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_reduceCasResults__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _fixMlPipelineAutomation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fixMlPipelineAutomation */ \"./serverCalls/fixMlPipelineAutomation.js\");\n/* harmony import */ var _fixMlPipelineAutomation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_fixMlPipelineAutomation__WEBPACK_IMPORTED_MODULE_4__);\n/*------------------------------------------------------------------------------------\r\n Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights reserved Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n ---------------------------------------------------------------------------------------*/\n\n\n// let fixImages = require( './fixImages' );\n// let fixReports = require( './fixReports' );\n// let casSessionLinks = require( './casSessionLinks' );\n// let reduceCasResults = require( './reduceCasResults' );\n// let fixMlPipelineAutomation = require( './fixMlPipelineAutomation' );\n\n\n\n\n\nfunction fixResponse(response) {\n //\n // Ensure all header keys are lowercase\n //\n\n var headers = {};\n for (var k in response.headers) {\n //noinspection JSUnfilteredForInLoop\n var k1 = k.toLowerCase();\n //noinspection JSUnfilteredForInLoop\n headers[k1] = response.headers[k];\n }\n headers['tkhttp-id'] = null;\n var cookieValue = null;\n try {\n var _w = window;\n cookieValue = document.cookie.split(';').find(function (cookie) {\n return cookie.includes('tkhttp-id');\n });\n } catch (e) {\n if (headers['set-cookie'] != null) {\n cookieValue = response.headers['set-cookie'].find(function (cookie) {\n return cookie.includes('tkhttp-id');\n });\n }\n }\n headers['tkhttp-id'] = cookieValue != null ? cookieValue.split(';')[0].split('=')[1] : null;\n response.headers = headers;\n var cType = response.headers['content-type'];\n if (cType == null || typeof response.data.results === 'string') {\n return response;\n }\n\n // let contentType = cType.split(';') [0];\n var iLink = response.data.iconfig.link;\n fixCas(iLink, response);\n if (iLink.href.indexOf(\"reportImages/jobs\") > 0) {\n _fixImages__WEBPACK_IMPORTED_MODULE_0___default()(response);\n }\n if (iLink.href === \"/reports/reports\" && iLink.method === \"GET\") {\n _fixReports__WEBPACK_IMPORTED_MODULE_1___default()(response);\n }\n var il = iLink.href.split('?')[0];\n if (il === \"/mlPipelineAutomation/projects\" && iLink.method === \"GET\") {\n _fixMlPipelineAutomation__WEBPACK_IMPORTED_MODULE_4___default()(response);\n }\n return response;\n}\n\n// Plan:\n// step 1: propogate server name and cashttp info\n\nfunction fixCas(iLink, response) {\n // special handling for cas\n var casProxyFlag = false;\n if (response.data.hasOwnProperty('iconfig')) {\n if (response.data.iconfig.storeConfig != null) {\n casProxyFlag = response.data.iconfig.storeConfig.casProxy;\n }\n }\n\n // do a refresh - mainly for reattaching to a cas session\n\n if (iLink.rel === 'self' && iLink.type === 'application/vnd.sas.cas.session.summary' || iLink.rel === 'createSession' && iLink.responseType === 'application/vnd.sas.cas.session') {\n response.data.results.links = response.data.results.links.concat(fixCasSession(iLink, response.data.results, casProxyFlag));\n response.data.results.name2 = response.data.results.name.split(':')[0];\n }\n if (iLink.hasOwnProperty('itemType') && iLink.itemType === 'application/vnd.sas.cas.session.summary') {\n var items = response.data.results.items;\n var pre = \"/\".concat(iLink.casHttp, \"/cas/sessions\");\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n var uri = \"/casProxy/servers/\".concat(iLink.server, \"/cas/sessions/\").concat(item.id);\n var urihttp = \"\".concat(pre, \"/\").concat(item.id);\n item.links = item.links.map(function (l) {\n l.casHttp = iLink.casHttp;\n l.server = iLink.server;\n return l;\n });\n item.links = item.links.concat(_casSessionLinks__WEBPACK_IMPORTED_MODULE_2___default()(uri, urihttp, iLink.casHttp, iLink.server, casProxyFlag));\n }\n }\n if (iLink.hasOwnProperty('customHandling')) {\n response.data.results = _reduceCasResults__WEBPACK_IMPORTED_MODULE_3___default()(response.data.results);\n response.data.results = {\n items: Object.assign({}, response.data.results)\n };\n response.data.results.customHandling = iLink.customHandling;\n }\n\n //TBD: This could probbably be removed due to enhancements to casManagement\n if ((iLink.href === '/casManagement/' || iLink.href === '/casManagement') && iLink.method === 'GET') {\n response.data.results.links = response.data.results.links.map(function (l) {\n if (l.rel === 'collection') {\n l.title = 'servers';\n l.rel = 'servers';\n l.patch = 'cas';\n }\n return l;\n });\n }\n\n // A seperate loop in case casManagement fixes the issue\n if (iLink.hasOwnProperty('patch') && iLink.rel === 'servers') {\n var _items = response.data.results.items;\n var _loop = function _loop() {\n var item = _items[_i];\n var name = item.name;\n var ll = item.links.map(function (l) {\n l.casHttp = \"\".concat(name, \"-http\"); /* save the http info to propogate to sessions */\n l.server = name;\n return l;\n });\n item.links = ll;\n };\n for (var _i = 0; _i < _items.length; _i++) {\n _loop();\n }\n }\n}\nfunction fixCasSession(iLink, results, casProxyFlag) {\n // proprogate casHttp\n results.links = results.links.map(function (l) {\n l.casHttp = iLink.casHttp;\n l.server = iLink.server;\n return l;\n });\n return sessionLinks(iLink, results.id, casProxyFlag).concat(results.links);\n}\nfunction sessionLinks(iLink, sessionId, casProxyFlag) {\n var uri = \"/casProxy/servers/\".concat(iLink.server, \"/cas/sessions/\").concat(sessionId);\n var urihttp = \"/\".concat(iLink.casHttp, \"/cas/sessions/\").concat(sessionId);\n // propgate server name also\n return _casSessionLinks__WEBPACK_IMPORTED_MODULE_2___default()(uri, urihttp, iLink.casHttp, iLink.server, casProxyFlag);\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (fixResponse);\n\n//# sourceURL=webpack://restaf/./serverCalls/fixResponse.js?");
|
|
2111
2111
|
|
|
2112
2112
|
/***/ }),
|
|
2113
2113
|
|
|
@@ -2120,7 +2120,7 @@ eval("/* harmony import */ var _fixImages__WEBPACK_IMPORTED_MODULE_0__ = __webpa
|
|
|
2120
2120
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2121
2121
|
|
|
2122
2122
|
"use strict";
|
|
2123
|
-
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return trustedGrant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return keepAlive; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return request; });\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_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"../../../node_modules/axios/index.js\");\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! qs */ \"../../../node_modules/qs/lib/index.js\");\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _fixResponse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fixResponse */ \"./serverCalls/fixResponse.js\");\n/* harmony import */ var https__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! https */ \"../../../node_modules/https-browserify/index.js\");\n/* harmony import */ var https__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(https__WEBPACK_IMPORTED_MODULE_5__);\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_1___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/* eslint-disable no-prototype-builtins */\n/*------------------------------------------------------------------------------------\r\n Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights reserved Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n ---------------------------------------------------------------------------------------*/\n\n\n\n\n\n\n// axios.defaults.withCredentials = true\naxios__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"].interceptors.response.use(function (response) {\n return response;\n}, function (error) {\n return Promise.reject(error);\n});\n\n/* X-Uaa-Csrf */\nfunction trustedGrant(iconfig) {\n var link = iconfig.link;\n var auth1 = Buffer.from(iconfig.clientID + \":\" + iconfig.clientSecret).toString(\"base64\");\n auth1 = \"Basic \" + auth1;\n var baseUrl = patchURL4ns(iconfig, link.href);\n var config = {\n method: link.method,\n baseURl: baseUrl,\n url: link.href,\n /*iconfig.host + link.href,*/\n\n headers: {\n Accept: link.responseType,\n \"Content-Type\": link.type /* Axios seems to be case sensitive */,\n Authorization: auth1\n },\n withCredentials: false,\n data: {\n grant_type: \"password\",\n username: iconfig.user,\n password: iconfig.password\n },\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n transformResponse: function transformResponse(data) {\n return data;\n },\n transformRequest: function transformRequest(data) {\n return qs__WEBPACK_IMPORTED_MODULE_3___default.a.stringify(data);\n }\n };\n return makeCall(config, iconfig, iconfig);\n}\nfunction request(iconfig) {\n \"use strict\";\n\n var link = iconfig.link,\n logonInfo = iconfig.logonInfo;\n var iLink = _objectSpread({}, link);\n var payload = iconfig.hasOwnProperty(\"payload\") ? iconfig.payload : null;\n var iqs = null;\n var idata = null;\n var iheaders = null;\n var ixsrf = null;\n var casAction = null;\n debugger;\n if (payload !== null) {\n casAction = hasItem(payload, \"action\");\n iqs = hasItem(payload, \"qs\");\n idata = hasItem(payload, \"data\");\n iheaders = hasItem(payload, \"headers\");\n ixsrf = hasItem(payload, \"xsrf\");\n }\n var baseUrl = patchURL4ns(logonInfo, iLink.href);\n // let url = `${l}${iLink.href}`;\n\n // handle casaction upload\n casAction = casAction != null ? casAction.toLowerCase() : null;\n var url = casAction !== null ? \"\".concat(iLink.href, \"/\").concat(casAction) : \"\".concat(iLink.href);\n if (iLink.hasOwnProperty(\"customHandling\") && casAction !== null) {\n // casAction = casAction.toLowerCase();\n if (casAction === \"table.upload\") {\n iLink.method = \"PUT\";\n iLink.type = \"application/octet-stream\";\n iLink.responseType = \"application/json\";\n }\n }\n var config = {\n method: iLink.method,\n baseURL: baseUrl,\n url: url,\n transformResponse: function transformResponse(data) {\n return data;\n },\n validateStatus: function validateStatus(status) {\n /* 304 for state calls */\n return status === 302 || status === 304 || status >= 200 && status < 300;\n }\n };\n config.headers = {};\n if (logonInfo.token !== null) {\n config.headers['Authorization'] = logonInfo.tokenType + \" \" + logonInfo.token;\n } else {\n config.withCredentials = iconfig.withCredentials == null ? true : iconfig.withCredentials;\n }\n var type = fullType(iLink.type);\n if (iLink.hasOwnProperty(\"responseType\")) {\n if (type !== null) {\n config.headers[\"Content-Type\"] = type;\n }\n config.headers.Accept = fullType(iLink.responseType);\n } else if (type !== null) {\n config.headers.Accept = type;\n if (iLink.method === \"PUT\" || iLink.method === \"POST\" || iLink.method === \"PATCH\") {\n config.headers[\"Content-Type\"] = type;\n }\n }\n if (iheaders !== null) {\n for (var ih in iheaders) {\n //noinspection JSUnfilteredForInLoop\n if (ih.toLowerCase() === \"json-parameters\") {\n //noinspection JSUnfilteredForInLoop\n config.headers[ih] = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(iheaders[ih]) === \"object\" ? JSON.stringify(iheaders[ih]) : iheaders[ih];\n } else {\n //noinspection JSUnfilteredForInLoop\n config.headers[ih] = iheaders[ih];\n }\n }\n }\n debugger;\n if (ixsrf !== null) {\n /* TBD: fix parallel calls to get of this conditional */\n var xsrfHeaderName = ixsrf[\"x-csrf-header\"];\n console.log(xsrfHeaderName);\n if (xsrfHeaderName != null) {\n config.xsrfHeaderName = xsrfHeaderName;\n // https://github.com/axios/axios/issues/2024\n config.headers[xsrfHeaderName] = ixsrf[\"x-csrf-token\"];\n }\n if (ixsrf[\"tkhttp_id\"] != null) {\n config.headers[\"tkhttp_id\"] = ixsrf[\"tkhttp_id\"];\n }\n }\n if (iqs !== null) {\n config.params = _objectSpread({}, iqs);\n }\n config.data = idata === null ? {} : idata;\n config.maxContentLength = 2 * 10063256;\n var httpOptions = iconfig.storeConfig.httpOptions;\n if (httpOptions != null) {\n for (var k in httpOptions) {\n config[k] = httpOptions[k];\n }\n }\n setupProxy(iconfig, config);\n return makeCall(config, iconfig, logonInfo);\n}\n// setup if using reverse proxy server\nfunction setupProxy(iconfig, config) {\n var options = iconfig.logonInfo.options;\n if (options.proxyServer != null) {\n var proxy = options.proxy;\n if (proxy.pathname != null && proxy.pathname.trim().length > 0) {\n config.url = \"\".concat(proxy.pathname).concat(config.url); //prepend url with proxy path\n }\n\n config.baseURL = \"\".concat(proxy.protocol, \"//\").concat(proxy.host); //override base url\n }\n}\n// patch the url for namespace - useful for k8s to make calls into another namespace\nfunction patchURL4ns(logInfo, link) {\n var host = logInfo.host;\n if (logInfo.options.ns != null) {\n var service = link.split(\"/\")[1];\n host = \"\".concat(logInfo.protocol).concat(service, \".{logInfo.options.ns}.svc.cluster.local\");\n }\n return host;\n}\nfunction makeCall(config, iconfig, storeConfig) {\n if (storeConfig.protocol === \"https://\" && config.agent == null) {\n var opt = storeConfig.sslOptions != null ? storeConfig.sslOptions : {};\n var agent = new https__WEBPACK_IMPORTED_MODULE_5___default.a.Agent(opt);\n config.httpsAgent = agent;\n }\n return new Promise(function (resolve, reject) {\n debugger;\n if (config.headers['tkhttp-id'] != null) {\n console.log(config.url, '--', config.headers['tkhttp-id']);\n console.log('-----------------------');\n }\n Object(axios__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(config).then(function (response) {\n parseJSON(response.data).then(function (data) {\n iconfig.data = null; /* get rid of the payload*/\n response.data = {\n results: data,\n iconfig: Object.assign({}, iconfig)\n };\n if (data.hasOwnProperty(\"errorCode\")) {\n //noinspection JSUnresolvedVariable\n response.status = response.data.results.httpStatusCode;\n response.statusText = \"errorCode: \".concat(response.data.results.errorCode);\n reject({\n response: response\n });\n } else {\n resolve(Object(_fixResponse__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(response));\n }\n }).catch(function () {\n iconfig.data = null;\n response.data = {\n results: response.data,\n iconfig: Object.assign({}, iconfig)\n };\n resolve(Object(_fixResponse__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(response));\n });\n }).catch(function (error) {\n reject(error);\n });\n });\n}\nfunction parseJSON(data) {\n //noinspection JSUnusedLocalSymbols\n return new Promise(function (resolve, reject) {\n if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(data) === \"object\") {\n resolve(data);\n } else {\n var temp = data.replace(/\\r?\\n|\\r/g, \" \");\n try {\n var odata = JSON.parse(temp);\n resolve(odata);\n } catch (err) {\n resolve(data);\n }\n }\n });\n}\nfunction hasItem(payload, name) {\n for (var _i = 0, _Object$keys = Object.keys(payload); _i < _Object$keys.length; _i++) {\n var k = _Object$keys[_i];\n if (k.toUpperCase() === name.toUpperCase()) {\n return payload[k];\n }\n }\n return null;\n}\nfunction fullType(type) {\n var ntype = type;\n if (ntype === undefined || ntype === null) {\n ntype = null;\n } else {\n if (ntype.indexOf(\"application/vnd\") !== -1) {\n if (ntype.indexOf(\"+json\") === -1) {\n ntype = ntype + \"+json\";\n }\n }\n }\n return ntype;\n}\n\n// Code below is for experimenting.\n\nfunction keepAlive(action) {\n return Object(axios__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(action.payload);\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/buffer/index.js */ \"../../../node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://restaf/./serverCalls/index.js?");
|
|
2123
|
+
eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return trustedGrant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return keepAlive; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return request; });\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_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"../../../node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"../../../node_modules/axios/index.js\");\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! qs */ \"../../../node_modules/qs/lib/index.js\");\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _fixResponse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fixResponse */ \"./serverCalls/fixResponse.js\");\n/* harmony import */ var https__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! https */ \"../../../node_modules/https-browserify/index.js\");\n/* harmony import */ var https__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(https__WEBPACK_IMPORTED_MODULE_5__);\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_1___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/* eslint-disable no-prototype-builtins */\n/*------------------------------------------------------------------------------------\r\n Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights reserved Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n ---------------------------------------------------------------------------------------*/\n\n\n\n\n\n\n// axios.defaults.withCredentials = true\naxios__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"].interceptors.response.use(function (response) {\n return response;\n}, function (error) {\n return Promise.reject(error);\n});\n\n/* X-Uaa-Csrf */\nfunction trustedGrant(iconfig) {\n var link = iconfig.link;\n var auth1 = Buffer.from(iconfig.clientID + \":\" + iconfig.clientSecret).toString(\"base64\");\n auth1 = \"Basic \" + auth1;\n var baseUrl = patchURL4ns(iconfig, link.href);\n var config = {\n method: link.method,\n baseURl: baseUrl,\n url: link.href,\n /*iconfig.host + link.href,*/\n\n headers: {\n Accept: link.responseType,\n \"Content-Type\": link.type /* Axios seems to be case sensitive */,\n Authorization: auth1\n },\n withCredentials: false,\n data: {\n grant_type: \"password\",\n username: iconfig.user,\n password: iconfig.password\n },\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n transformResponse: function transformResponse(data) {\n return data;\n },\n transformRequest: function transformRequest(data) {\n return qs__WEBPACK_IMPORTED_MODULE_3___default.a.stringify(data);\n }\n };\n return makeCall(config, iconfig, iconfig);\n}\nfunction request(iconfig) {\n \"use strict\";\n\n var link = iconfig.link,\n logonInfo = iconfig.logonInfo;\n var iLink = _objectSpread({}, link);\n var payload = iconfig.hasOwnProperty(\"payload\") ? iconfig.payload : null;\n var iqs = null;\n var idata = null;\n var iheaders = null;\n var ixsrf = null;\n var casAction = null;\n debugger;\n if (payload !== null) {\n casAction = hasItem(payload, \"action\");\n iqs = hasItem(payload, \"qs\");\n idata = hasItem(payload, \"data\");\n iheaders = hasItem(payload, \"headers\");\n ixsrf = hasItem(payload, \"xsrf\");\n }\n var baseUrl = patchURL4ns(logonInfo, iLink.href);\n // let url = `${l}${iLink.href}`;\n\n // handle casaction upload\n casAction = casAction != null ? casAction.toLowerCase() : null;\n var url = casAction !== null ? \"\".concat(iLink.href, \"/\").concat(casAction) : \"\".concat(iLink.href);\n if (iLink.hasOwnProperty(\"customHandling\") && casAction !== null) {\n // casAction = casAction.toLowerCase();\n if (casAction === \"table.upload\") {\n iLink.method = \"PUT\";\n iLink.type = \"application/octet-stream\";\n iLink.responseType = \"application/json\";\n }\n }\n var config = {\n method: iLink.method,\n baseURL: baseUrl,\n url: url,\n transformResponse: function transformResponse(data) {\n return data;\n },\n validateStatus: function validateStatus(status) {\n /* 304 for state calls */\n return status === 302 || status === 304 || status >= 200 && status < 300;\n }\n };\n config.headers = {};\n if (logonInfo.token !== null) {\n config.headers['Authorization'] = logonInfo.tokenType + \" \" + logonInfo.token;\n } else {\n config.withCredentials = iconfig.withCredentials == null ? true : iconfig.withCredentials;\n }\n var type = fullType(iLink.type);\n if (iLink.hasOwnProperty(\"responseType\")) {\n if (type !== null) {\n config.headers[\"Content-Type\"] = type;\n }\n config.headers.Accept = fullType(iLink.responseType);\n } else if (type !== null) {\n config.headers.Accept = type;\n if (iLink.method === \"PUT\" || iLink.method === \"POST\" || iLink.method === \"PATCH\") {\n config.headers[\"Content-Type\"] = type;\n }\n }\n if (iheaders !== null) {\n for (var ih in iheaders) {\n //noinspection JSUnfilteredForInLoop\n if (ih.toLowerCase() === \"json-parameters\") {\n //noinspection JSUnfilteredForInLoop\n config.headers[ih] = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(iheaders[ih]) === \"object\" ? JSON.stringify(iheaders[ih]) : iheaders[ih];\n } else {\n //noinspection JSUnfilteredForInLoop\n config.headers[ih] = iheaders[ih];\n }\n }\n }\n debugger;\n if (ixsrf !== null) {\n /* TBD: fix parallel calls to get of this conditional */\n var xsrfHeaderName = ixsrf[\"x-csrf-header\"];\n if (xsrfHeaderName != null) {\n config.xsrfCookieName = null;\n config.xsrfHeaderName = xsrfHeaderName;\n // https://github.com/axios/axios/issues/2024\n config.headers[xsrfHeaderName] = ixsrf[xsrfHeaderName];\n }\n if (ixsrf[\"tkhttp-id\"] != null) {\n config.headers[\"tkhttp-id\"] = ixsrf[\"tkhttp-id\"];\n }\n } else {\n if (config.type === 'ADD_SERVICE') {\n config.xsrfHeaderName = 'X_CSRF_TOKEN';\n config.headers['X-CSRF-TOKEN'] = \"Fetch\";\n }\n }\n if (iqs !== null) {\n config.params = _objectSpread({}, iqs);\n }\n config.data = idata === null ? {} : idata;\n config.maxContentLength = 2 * 10063256;\n var httpOptions = iconfig.storeConfig.httpOptions;\n if (httpOptions != null) {\n for (var k in httpOptions) {\n config[k] = httpOptions[k];\n }\n }\n setupProxy(iconfig, config);\n return makeCall(config, iconfig, logonInfo);\n}\n// setup if using reverse proxy server\nfunction setupProxy(iconfig, config) {\n var options = iconfig.logonInfo.options;\n if (options.proxyServer != null) {\n var proxy = options.proxy;\n if (proxy.pathname != null && proxy.pathname.trim().length > 0) {\n config.url = \"\".concat(proxy.pathname).concat(config.url); //prepend url with proxy path\n }\n\n config.baseURL = \"\".concat(proxy.protocol, \"//\").concat(proxy.host); //override base url\n }\n}\n// patch the url for namespace - useful for k8s to make calls into another namespace\nfunction patchURL4ns(logInfo, link) {\n var host = logInfo.host;\n if (logInfo.options.ns != null) {\n var service = link.split(\"/\")[1];\n host = \"\".concat(logInfo.protocol).concat(service, \".{logInfo.options.ns}.svc.cluster.local\");\n }\n return host;\n}\nfunction makeCall(config, iconfig, storeConfig) {\n if (storeConfig.protocol === \"https://\" && config.agent == null) {\n var opt = storeConfig.sslOptions != null ? storeConfig.sslOptions : {};\n var agent = new https__WEBPACK_IMPORTED_MODULE_5___default.a.Agent(opt);\n config.httpsAgent = agent;\n }\n return new Promise(function (resolve, reject) {\n Object(axios__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(config).then(function (response) {\n parseJSON(response.data).then(function (data) {\n iconfig.data = null; /* get rid of the payload*/\n response.data = {\n results: data,\n iconfig: Object.assign({}, iconfig)\n };\n if (data.hasOwnProperty(\"errorCode\")) {\n //noinspection JSUnresolvedVariable\n response.status = response.data.results.httpStatusCode;\n response.statusText = \"errorCode: \".concat(response.data.results.errorCode);\n reject({\n response: response\n });\n } else {\n resolve(Object(_fixResponse__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(response));\n }\n }).catch(function () {\n iconfig.data = null;\n response.data = {\n results: response.data,\n iconfig: Object.assign({}, iconfig)\n };\n resolve(Object(_fixResponse__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(response));\n });\n }).catch(function (error) {\n reject(error);\n });\n });\n}\nfunction parseJSON(data) {\n //noinspection JSUnusedLocalSymbols\n return new Promise(function (resolve, reject) {\n if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(data) === \"object\") {\n resolve(data);\n } else {\n var temp = data.replace(/\\r?\\n|\\r/g, \" \");\n try {\n var odata = JSON.parse(temp);\n resolve(odata);\n } catch (err) {\n resolve(data);\n }\n }\n });\n}\nfunction hasItem(payload, name) {\n for (var _i = 0, _Object$keys = Object.keys(payload); _i < _Object$keys.length; _i++) {\n var k = _Object$keys[_i];\n if (k.toUpperCase() === name.toUpperCase()) {\n return payload[k];\n }\n }\n return null;\n}\nfunction fullType(type) {\n var ntype = type;\n if (ntype === undefined || ntype === null) {\n ntype = null;\n } else {\n if (ntype.indexOf(\"application/vnd\") !== -1) {\n if (ntype.indexOf(\"+json\") === -1) {\n ntype = ntype + \"+json\";\n }\n }\n }\n return ntype;\n}\n\n// Code below is for experimenting.\n\nfunction keepAlive(action) {\n return Object(axios__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(action.payload);\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/buffer/index.js */ \"../../../node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://restaf/./serverCalls/index.js?");
|
|
2124
2124
|
|
|
2125
2125
|
/***/ }),
|
|
2126
2126
|
|
|
@@ -2146,7 +2146,7 @@ eval("/*\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights
|
|
|
2146
2146
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2147
2147
|
|
|
2148
2148
|
"use strict";
|
|
2149
|
-
eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _iaddServices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./iaddServices */ \"./store/iaddServices.js\");\n/* harmony import */ var _actionTypes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actionTypes */ \"./actionTypes/index.js\");\n/* harmony import */ var _appData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./appData */ \"./store/appData.js\");\n/* harmony import */ var _getServiceRoot__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getServiceRoot */ \"./store/getServiceRoot.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\n\n\n\n\n\n/**\r\n * @description Add(initialize) services to the store\r\n * @async\r\n * @module addServices\r\n * @category restaf/core\r\n * @param {...any} serviceNames - list of services\r\n * @returns {promise}\r\n * @example\r\n * const {compute, casManagement} = await store.addServices('compute', 'casManagewment);\r\n * \r\n */\nfunction addServices(_x) {\n return _addServices.apply(this, arguments);\n}\nfunction _addServices() {\n _addServices = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store) {\n var _len,\n services,\n _key,\n subList,\n ifolder,\n _yield$iaddServices,\n folders,\n xsrfTokens,\n
|
|
2149
|
+
eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _iaddServices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./iaddServices */ \"./store/iaddServices.js\");\n/* harmony import */ var _actionTypes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actionTypes */ \"./actionTypes/index.js\");\n/* harmony import */ var _appData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./appData */ \"./store/appData.js\");\n/* harmony import */ var _getServiceRoot__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getServiceRoot */ \"./store/getServiceRoot.js\");\n/* harmony import */ var _getXsrfData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getXsrfData */ \"./store/getXsrfData.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\n\n\n\n\n/**\r\n * @description Add(initialize) services to the store\r\n * @async\r\n * @module addServices\r\n * @category restaf/core\r\n * @param {...any} serviceNames - list of services\r\n * @returns {promise}\r\n * @example\r\n * const {compute, casManagement} = await store.addServices('compute', 'casManagewment);\r\n * \r\n */\nfunction addServices(_x) {\n return _addServices.apply(this, arguments);\n}\nfunction _addServices() {\n _addServices = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store) {\n var _len,\n services,\n _key,\n subList,\n ifolder,\n _iterator,\n _step,\n service,\n _yield$iaddServices,\n folders,\n xsrfTokens,\n xsrf,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n debugger;\n for (_len = _args.length, services = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n services[_key - 1] = _args[_key];\n }\n if (services.includes('casManagement')) {\n // services.push('casManagement/cas');\n services.push('casProxy');\n // services.push('cas-shared-default-http/healthCheck');\n }\n\n // loop for initialized services\n subList = [];\n ifolder = {};\n services.map(function (s) {\n ifolder[s] = Object(_getServiceRoot__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(store, s);\n if (ifolder[s] === null) {\n subList.push(s);\n }\n });\n\n // initialize new services\n if (!(subList.length > 0)) {\n _context.next = 32;\n break;\n }\n debugger;\n _iterator = _createForOfIteratorHelper(subList);\n _context.prev = 9;\n _iterator.s();\n case 11:\n if ((_step = _iterator.n()).done) {\n _context.next = 24;\n break;\n }\n service = _step.value;\n _context.next = 15;\n return Object(_iaddServices__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, [service]);\n case 15:\n _yield$iaddServices = _context.sent;\n folders = _yield$iaddServices.folders;\n xsrfTokens = _yield$iaddServices.xsrfTokens;\n xsrf = xsrfTokens[service];\n Object(_appData__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(store, _actionTypes__WEBPACK_IMPORTED_MODULE_3__[/* API_XSRF */ \"h\"], service, xsrf, service);\n if (xsrf['tkhttp-id'] != null) {\n Object(_appData__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(store, _actionTypes__WEBPACK_IMPORTED_MODULE_3__[/* API_XSRF */ \"h\"], 'tkhttpid', xsrf, service);\n }\n ifolder[service] = folders[service];\n case 22:\n _context.next = 11;\n break;\n case 24:\n _context.next = 29;\n break;\n case 26:\n _context.prev = 26;\n _context.t0 = _context[\"catch\"](9);\n _iterator.e(_context.t0);\n case 29:\n _context.prev = 29;\n _iterator.f();\n return _context.finish(29);\n case 32:\n return _context.abrupt(\"return\", ifolder);\n case 33:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[9, 26, 29, 32]]);\n }));\n return _addServices.apply(this, arguments);\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (addServices);\n\n//# sourceURL=webpack://restaf/./store/addServices.js?");
|
|
2150
2150
|
|
|
2151
2151
|
/***/ }),
|
|
2152
2152
|
|
|
@@ -2159,7 +2159,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_
|
|
|
2159
2159
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2160
2160
|
|
|
2161
2161
|
"use strict";
|
|
2162
|
-
eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _iapiCall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./iapiCall */ \"./store/iapiCall.js\");\n/* harmony import */ var _actionTypes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actionTypes */ \"./actionTypes/index.js\");\n/* harmony import */ var _appData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./appData */ \"./store/appData.js\");\n/* harmony import */ var _readXsrfData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./readXsrfData */ \"./store/readXsrfData.js\");\n/* harmony import */ var _getXsrfData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getXsrfData */ \"./store/getXsrfData.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\n\n\n\n\n\n\n\n/**\r\n * @description make an api call to viya\r\n * @module apiCall\r\n * @category restaf/core\r\n * @param {rafLinkeRel} iroute \r\n * @param {*} payload \r\n * @param {...any} rest \r\n * @returns {promise} returns a rafObject\r\n */\nfunction apiCall(_x, _x2, _x3) {\n return _apiCall.apply(this, arguments);\n}\nfunction _apiCall() {\n _apiCall = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, iroute, payload) {\n var _len,\n rest,\n _key,\n response,\n newXsrf,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n // const apiCall = ( store, iroute, payload, ...rest ) => {\n debugger;\n for (_len = _args.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {\n rest[_key - 3] = _args[_key];\n }\n _context.next = 4;\n return _iapiCall__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"].apply(void 0, [store, iroute, _actionTypes__WEBPACK_IMPORTED_MODULE_3__[/* API_CALL */ \"b\"], payload].concat(rest));\n case 4:\n response = _context.sent;\n debugger;\n
|
|
2162
|
+
eval("/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"../../../node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _iapiCall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./iapiCall */ \"./store/iapiCall.js\");\n/* harmony import */ var _actionTypes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actionTypes */ \"./actionTypes/index.js\");\n/* harmony import */ var _appData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./appData */ \"./store/appData.js\");\n/* harmony import */ var _readXsrfData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./readXsrfData */ \"./store/readXsrfData.js\");\n/* harmony import */ var _getXsrfData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getXsrfData */ \"./store/getXsrfData.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\n\n\n\n\n\n\n\n/**\r\n * @description make an api call to viya\r\n * @module apiCall\r\n * @category restaf/core\r\n * @param {rafLinkeRel} iroute \r\n * @param {*} payload \r\n * @param {...any} rest \r\n * @returns {promise} returns a rafObject\r\n */\nfunction apiCall(_x, _x2, _x3) {\n return _apiCall.apply(this, arguments);\n}\nfunction _apiCall() {\n _apiCall = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, iroute, payload) {\n var _len,\n rest,\n _key,\n response,\n newXsrf,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n // const apiCall = ( store, iroute, payload, ...rest ) => {\n debugger;\n for (_len = _args.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {\n rest[_key - 3] = _args[_key];\n }\n _context.next = 4;\n return _iapiCall__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"].apply(void 0, [store, iroute, _actionTypes__WEBPACK_IMPORTED_MODULE_3__[/* API_CALL */ \"b\"], payload].concat(rest));\n case 4:\n response = _context.sent;\n debugger;\n newXsrf = Object(_readXsrfData__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(response.headers, response.usedService, iroute.route);\n if (newXsrf['x-csrf-header'] != null || newXsrf['tkhttp-id'] != null) {\n Object(_appData__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(store, _actionTypes__WEBPACK_IMPORTED_MODULE_3__[/* API_XSRF */ \"h\"], response.usedService, newXsrf);\n }\n if (newXsrf['tkhttp-id'] != null) {\n Object(_appData__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(store, _actionTypes__WEBPACK_IMPORTED_MODULE_3__[/* API_XSRF */ \"h\"], 'tkhttpid', newXsrf);\n }\n return _context.abrupt(\"return\", response);\n case 10:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _apiCall.apply(this, arguments);\n}\n;\n/* harmony default export */ __webpack_exports__[\"a\"] = (apiCall);\n\n//# sourceURL=webpack://restaf/./store/apiCall.js?");
|
|
2163
2163
|
|
|
2164
2164
|
/***/ }),
|
|
2165
2165
|
|
|
@@ -2315,7 +2315,7 @@ eval("/*\r\n * -----------------------------------------------------------------
|
|
|
2315
2315
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2316
2316
|
|
|
2317
2317
|
"use strict";
|
|
2318
|
-
eval("/* harmony import */ var _actionTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../actionTypes */ \"./actionTypes/index.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\nfunction getXsrfData(store) {\n var list = store.getState();\n list = list[_actionTypes__WEBPACK_IMPORTED_MODULE_0__[/* API_XSRF_ROOT */ \"i\"]];\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n var path = args.length > 0 ? ['userData'].concat(args) : ['userData'];\n var xsrf = list.getIn(path, null);\n return xsrf
|
|
2318
|
+
eval("/* harmony import */ var _actionTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../actionTypes */ \"./actionTypes/index.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\nfunction getXsrfData(store) {\n var list = store.getState();\n list = list[_actionTypes__WEBPACK_IMPORTED_MODULE_0__[/* API_XSRF_ROOT */ \"i\"]];\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n var path = args.length > 0 ? ['userData'].concat(args) : ['userData'];\n var xsrf = list.getIn(path, null);\n return xsrf != null ? xsrf.toJS() : null;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (getXsrfData);\n\n//# sourceURL=webpack://restaf/./store/getXsrfData.js?");
|
|
2319
2319
|
|
|
2320
2320
|
/***/ }),
|
|
2321
2321
|
|
|
@@ -2341,7 +2341,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK
|
|
|
2341
2341
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2342
2342
|
|
|
2343
2343
|
"use strict";
|
|
2344
|
-
eval("/* harmony import */ var _actionTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../actionTypes */ \"./actionTypes/index.js\");\n/* harmony import */ var _getResults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getResults */ \"./store/getResults.js\");\n/* harmony import */ var _extendFolder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./extendFolder */ \"./store/extendFolder.js\");\n/* harmony import */ var _reducers_injectAsyncReducers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../reducers/injectAsyncReducers */ \"./reducers/injectAsyncReducers.js\");\n/* harmony import */ var _reducers_baseReducer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/baseReducer */ \"./reducers/baseReducer.js\");\n/* harmony import */ var _readXsrfData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./readXsrfData */ \"./store/readXsrfData.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\n\n\n\n\n\nvar iaddServices = function iaddServices(store, services) {\n return new Promise(function (resolve, reject) {\n //\n // Add a reducer for each service\n //\n\n services.forEach(function (service) {\n Object(_reducers_injectAsyncReducers__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(store, service, Object(_reducers_baseReducer__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(service));\n });\n\n //\n // Create actionArray for the services\n //\n var actionArray = services.map(function (service) {\n var s = {\n type: _actionTypes__WEBPACK_IMPORTED_MODULE_0__[/* ADD_SERVICE */ \"a\"],\n link: {\n method: 'GET',\n href: '/' + service + '/',\n rel: 'root',\n type: 'application/vnd.sas.api+json',\n responseType: 'application/json, application/vnd.sas.api+json',\n uri: '/' + service + '/'\n },\n logonInfo: null,\n tLink: null,\n /* null indicates root of service */\n serviceName: service,\n route: service,\n storeConfig: store.config\n };\n //to support PuP / workbench\n if (service == 'compute' && store.config.options.computeServerId != null && store.config.options.computeServerId.trim().length > 0) {\n console.log('assuming workbench');\n s.link.href = '/compute/servers/' + store.config.options.computeServerId + '/';\n s.link.url = s.link.href;\n }\n return s;\n });\n\n //\n // The first callback needs to be ignored\n //\n var start = true;\n\n //\n // subscribe function\n //\n var nextE = function nextE() {\n if (start) {\n start = false;\n return;\n }\n var folders = {};\n var xsrfTokens = {};\n /* */\n //\n // check the status of the call.\n // if all of them completed then resolve this promise or reject if error as soon as\n // an error is detected.\n //\n\n var count = 0;\n for (var i = 0; i < actionArray.length; i++) {\n //noinspection JSUnresolvedVariable\n var f = Object(_getResults__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"])(store, actionArray[i].route);\n if (f !== null) {\n var runStatus = f.get('runStatus');\n if (runStatus === 'error') {\n unSubscribe();\n var err = {\n service: services[i],\n detail: f.get('statusInfo')\n };\n reject(err);\n } else if (runStatus === 'ready') {\n count++;\n var ff = Object(_extendFolder__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, f);\n folders[services[i]] = ff;\n xsrfTokens[services[i]] = Object(_readXsrfData__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(ff.headers, services[i]);\n }\n }\n }\n if (count === actionArray.length) {\n unSubscribe();\n resolve({\n folders: folders,\n xsrfTokens: xsrfTokens\n });\n }\n };\n\n //\n // subscribe to store\n //\n var unSubscribe = store.subscribe(nextE);\n\n //\n // dispatch the actionArray\n //\n\n //\n // interval is a place holder for creating interval between calls\n // Yet to be implemented\n //\n\n store.dispatch({\n type: _actionTypes__WEBPACK_IMPORTED_MODULE_0__[/* API_CALL_PARALLEL */ \"c\"],\n interval: -1,\n actionArray: actionArray\n });\n });\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (iaddServices);\n\n//# sourceURL=webpack://restaf/./store/iaddServices.js?");
|
|
2344
|
+
eval("/* harmony import */ var _actionTypes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../actionTypes */ \"./actionTypes/index.js\");\n/* harmony import */ var _getResults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getResults */ \"./store/getResults.js\");\n/* harmony import */ var _extendFolder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./extendFolder */ \"./store/extendFolder.js\");\n/* harmony import */ var _reducers_injectAsyncReducers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../reducers/injectAsyncReducers */ \"./reducers/injectAsyncReducers.js\");\n/* harmony import */ var _reducers_baseReducer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducers/baseReducer */ \"./reducers/baseReducer.js\");\n/* harmony import */ var _readXsrfData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./readXsrfData */ \"./store/readXsrfData.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\n\n\n\n\n\nvar iaddServices = function iaddServices(store, services) {\n return new Promise(function (resolve, reject) {\n //\n // Add a reducer for each service\n //\n\n services.forEach(function (service) {\n Object(_reducers_injectAsyncReducers__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(store, service, Object(_reducers_baseReducer__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(service));\n });\n\n //\n // Create actionArray for the services\n //\n var actionArray = services.map(function (service) {\n var s = {\n type: _actionTypes__WEBPACK_IMPORTED_MODULE_0__[/* ADD_SERVICE */ \"a\"],\n link: {\n method: 'GET',\n href: '/' + service + '/',\n rel: 'root',\n type: 'application/vnd.sas.api+json',\n responseType: 'application/json, application/vnd.sas.api+json',\n uri: '/' + service + '/'\n },\n logonInfo: null,\n tLink: null,\n /* null indicates root of service */\n serviceName: service,\n usedService: service,\n route: service,\n storeConfig: store.config\n };\n //to support PuP / workbench\n if (service == 'compute' && store.config.options.computeServerId != null && store.config.options.computeServerId.trim().length > 0) {\n console.log('assuming workbench');\n s.link.href = '/compute/servers/' + store.config.options.computeServerId + '/';\n s.link.url = s.link.href;\n }\n return s;\n });\n\n //\n // The first callback needs to be ignored\n //\n var start = true;\n\n //\n // subscribe function\n //\n var nextE = function nextE() {\n if (start) {\n start = false;\n return;\n }\n var folders = {};\n var xsrfTokens = {};\n /* */\n //\n // check the status of the call.\n // if all of them completed then resolve this promise or reject if error as soon as\n // an error is detected.\n //\n\n var count = 0;\n for (var i = 0; i < actionArray.length; i++) {\n //noinspection JSUnresolvedVariable\n var f = Object(_getResults__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"])(store, actionArray[i].route);\n if (f !== null) {\n var runStatus = f.get('runStatus');\n if (runStatus === 'error') {\n unSubscribe();\n var err = {\n service: services[i],\n detail: f.get('statusInfo')\n };\n reject(err);\n } else if (runStatus === 'ready') {\n count++;\n var ff = Object(_extendFolder__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, f);\n folders[services[i]] = ff;\n xsrfTokens[services[i]] = Object(_readXsrfData__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(ff.headers, services[i], services[i]);\n }\n }\n }\n if (count === actionArray.length) {\n unSubscribe();\n resolve({\n folders: folders,\n xsrfTokens: xsrfTokens\n });\n }\n };\n\n //\n // subscribe to store\n //\n var unSubscribe = store.subscribe(nextE);\n\n //\n // dispatch the actionArray\n //\n\n //\n // interval is a place holder for creating interval between calls\n // Yet to be implemented\n //\n\n store.dispatch({\n type: _actionTypes__WEBPACK_IMPORTED_MODULE_0__[/* API_CALL_PARALLEL */ \"c\"],\n interval: -1,\n actionArray: actionArray\n });\n });\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (iaddServices);\n\n//# sourceURL=webpack://restaf/./store/iaddServices.js?");
|
|
2345
2345
|
|
|
2346
2346
|
/***/ }),
|
|
2347
2347
|
|
|
@@ -2484,7 +2484,7 @@ eval("/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IM
|
|
|
2484
2484
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2485
2485
|
|
|
2486
2486
|
"use strict";
|
|
2487
|
-
eval("/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"../../../node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _getResults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getResults */ \"./store/getResults.js\");\n/* harmony import */ var _getXsrfData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getXsrfData */ \"./store/getXsrfData.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\nvar Immutable = __webpack_require__(/*! immutable */ \"../../../node_modules/immutable/dist/immutable.es.js\");\n\n\n\nvar prepareAction = function prepareAction(store, iroute, actionType, payload, delay, eventHandler, parentRoute, jobContext) {\n var paginator;\n var route;\n var link;\n var serviceName;\n var current;\n debugger;\n if (typeof iroute === \"string\") {\n current = Object(_getResults__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"])(store, iroute);\n route = iroute;\n } else {\n current = iroute;\n route = current.get(\"route\");\n }\n if (current === null || Immutable.Iterable.isIterable(current) === false) {\n return null;\n }\n /* */\n paginator = current.get(\"paginator\");\n link = current.get(\"link\").toJS();\n if (paginator) {\n route = current.get(\"parentRoute\");\n serviceName = route.split(\":/\")[0];\n } else {\n var searchPath = route.split(\":/\");\n serviceName = searchPath[0];\n searchPath.splice(1, 0, store.apiCallNo);\n route = searchPath.join(\":/\");\n store.apiCallNo++;\n }\n var action = {\n type: actionType,\n delay: delay == null ? 0 : delay,\n paginator: paginator,\n serviceName: serviceName,\n route: route,\n eventHandler: eventHandler,\n parentRoute: parentRoute,\n jobContext: jobContext,\n storeConfig: store.config,\n usedService: serviceName,\n link: link\n };\n
|
|
2487
|
+
eval("/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"../../../node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _getResults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getResults */ \"./store/getResults.js\");\n/* harmony import */ var _getXsrfData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getXsrfData */ \"./store/getXsrfData.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\nvar Immutable = __webpack_require__(/*! immutable */ \"../../../node_modules/immutable/dist/immutable.es.js\");\n\n\n\nvar prepareAction = function prepareAction(store, iroute, actionType, payload, delay, eventHandler, parentRoute, jobContext) {\n var paginator;\n var route;\n var link;\n var serviceName;\n var current;\n debugger;\n if (typeof iroute === \"string\") {\n current = Object(_getResults__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"])(store, iroute);\n route = iroute;\n } else {\n current = iroute;\n route = current.get(\"route\");\n }\n if (current === null || Immutable.Iterable.isIterable(current) === false) {\n return null;\n }\n /* */\n paginator = current.get(\"paginator\");\n link = current.get(\"link\").toJS();\n if (paginator) {\n route = current.get(\"parentRoute\");\n serviceName = route.split(\":/\")[0];\n } else {\n var searchPath = route.split(\":/\");\n serviceName = searchPath[0];\n searchPath.splice(1, 0, store.apiCallNo);\n route = searchPath.join(\":/\");\n store.apiCallNo++;\n }\n var action = {\n type: actionType,\n delay: delay == null ? 0 : delay,\n paginator: paginator,\n serviceName: serviceName,\n route: route,\n eventHandler: eventHandler,\n parentRoute: parentRoute,\n jobContext: jobContext,\n storeConfig: store.config,\n usedService: serviceName,\n link: link\n };\n if (link.href.split('/')[1] === 'casProxy') {\n action.usedService = 'casProxy';\n } else if (link.href.split('/')[1] === 'cas-shared-default-http') {\n action.usedService = 'cas-shared-default-http';\n }\n var xsrf = Object(_getXsrfData__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, action.usedService);\n debugger;\n if (payload != null) {\n action.payload = payload;\n }\n debugger;\n if (action.usedService === \"casProxy\" || action.usedService === \"cas-shared-default-http\") {\n debugger;\n xsrf = Object(_getXsrfData__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, action.usedService);\n var tkhttpid = Object(_getXsrfData__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, 'tkhttpid');\n if (tkhttpid != null) {\n xsrf['tkhttp-id'] = tkhttpid['tkhttp-id'];\n }\n }\n debugger;\n if (payload != null) {\n action.payload.xsrf = xsrf;\n } else {\n action.payload = {\n xsrf: xsrf\n };\n }\n return action;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (prepareAction);\n\n//# sourceURL=webpack://restaf/./store/prepareAction.js?");
|
|
2488
2488
|
|
|
2489
2489
|
/***/ }),
|
|
2490
2490
|
|
|
@@ -2497,7 +2497,7 @@ eval("/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_r
|
|
|
2497
2497
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2498
2498
|
|
|
2499
2499
|
"use strict";
|
|
2500
|
-
eval("/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\nfunction readXsrfData(headers, service) {\n var xsrfData = {\n serviceName: service,\n
|
|
2500
|
+
eval("/*\r\n * ------------------------------------------------------------------------------------\r\n * Copyright © 2023, SAS Institute Inc., Cary, NC, USA. * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ---------------------------------------------------------------------------------------\r\n *\r\n */\nfunction readXsrfData(headers, service, iroute) {\n var xsrfData = {\n serviceName: service,\n iroute: iroute,\n 'x-csrf-header': null,\n 'tkhttp-id': null\n };\n var xheader = headers('x-csrf-header');\n xsrfData['x-csrf-header'] = xheader;\n // xsrf data is present\n if (xheader != null) {\n xsrfData[xheader] = headers(xheader.toLowerCase());\n }\n // save tkhtt-id for cas use\n xsrfData['tkhttp-id'] = headers('tkhttp-id') != null ? headers('tkhttp-id') : null;\n return xsrfData;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (readXsrfData);\n\n//# sourceURL=webpack://restaf/./store/readXsrfData.js?");
|
|
2501
2501
|
|
|
2502
2502
|
/***/ }),
|
|
2503
2503
|
|