@sassoftware/restaf 4.2.2 → 4.2.5

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 CHANGED
@@ -1771,7 +1771,7 @@ eval("/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODU
1771
1771
  /***/ (function(module, exports, __webpack_require__) {
1772
1772
 
1773
1773
  "use strict";
1774
- eval("/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n* SPDX-License-Identifier: Apache-2.0\r\n*/\n\n\nmodule.exports = function casSessionLinks(uri, urihttp, casHttp, server, casProxyFlag) {\n var href = casProxyFlag === true ? \"\".concat(uri, \"/actions\") : \"\".concat(urihttp, \"/actions\");\n var isIdle = casProxyFlag === true ? \"\".concat(uri, \"/isIdle\") : \"\".concat(urihttp, \"/isIdle\");\n var r = [{\n method: 'POST',\n href: href,\n rel: 'execute',\n uri: href,\n responseType: 'application/json',\n type: 'application/json',\n itemType: 'application/json',\n title: 'Run CAS Action',\n customHandling: 'casExecute',\n casHttp: casHttp,\n server: server,\n extended: true\n },\n /*\r\n {\r\n \tmethod : 'POST',\r\n \thref : `${urihttp}/actions`,\r\n \trel : (casProxyFlag === false) ? 'execute' : 'cashttp',\r\n \turi : `${urihttp}/actions`,\r\n \tresponseType : 'application/json',\r\n \ttype : 'application/json',\r\n \titemType : 'application/json',\r\n \ttitle : 'Run CAS Action',\r\n \tcustomHandling: 'casExecute',\r\n \tcasHttp : casHttp,\r\n \tserver : server,\r\n \textended : true\r\n },\r\n */\n {\n method: 'GET',\n href: isIdle,\n rel: 'state',\n uri: isIdle,\n responseType: 'application/json',\n type: 'application/json',\n itemType: 'application/json',\n title: 'state',\n customHandling: 'casState',\n casHttp: casHttp,\n server: server,\n extended: true\n }];\n return r;\n};\n\n//# sourceURL=webpack://restaf/./serverCalls/casSessionLinks.js?");
1774
+ eval("/*\r\n* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\r\n* SPDX-License-Identifier: Apache-2.0\r\n*/\n\n\nmodule.exports = function casSessionLinks(uri, urihttp, casHttp, server, casProxyFlag) {\n var href = casProxyFlag === true ? \"\".concat(uri, \"/actions\") : \"\".concat(urihttp, \"/actions\");\n var isIdle = casProxyFlag === true ? \"\".concat(uri, \"/isIdle\") : \"\".concat(urihttp, \"/isIdle\");\n var r = [{\n method: 'POST',\n href: href,\n rel: 'execute',\n uri: href,\n responseType: 'application/json',\n type: 'application/json',\n itemType: 'application/json',\n title: 'Run CAS Action',\n customHandling: 'casExecute',\n casHttp: casHttp,\n server: server,\n extended: true\n },\n /*\r\n {\r\n \tmethod : 'POST',\r\n \thref : `${urihttp}/actions`,\r\n \trel : (casProxyFlag === false) ? 'execute' : 'cashttp',\r\n \turi : `${urihttp}/actions`,\r\n \tresponseType : 'application/json',\r\n \ttype : 'application/json',\r\n \titemType : 'application/json',\r\n \ttitle : 'Run CAS Action',\r\n \tcustomHandling: 'casExecute',\r\n \tcasHttp : casHttp,\r\n \tserver : server,\r\n \textended : true\r\n },\r\n */\n {\n method: 'GET',\n href: isIdle,\n rel: 'state',\n uri: isIdle,\n responseType: 'application/json',\n type: 'application/json',\n itemType: 'application/json',\n title: 'state',\n customHandling: 'casState',\n casHttp: casHttp,\n server: server,\n extended: true\n }];\n debugger;\n console.log(r);\n return r;\n};\n\n//# sourceURL=webpack://restaf/./serverCalls/casSessionLinks.js?");
1775
1775
 
1776
1776
  /***/ }),
1777
1777
 
@@ -1836,7 +1836,7 @@ eval("/*------------------------------------------------------------------------
1836
1836
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1837
1837
 
1838
1838
  "use strict";
1839
- 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 axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);\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\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n/* eslint-disable no-prototype-builtins */\n\n/*------------------------------------------------------------------------------------\r\n Copyright (c) SAS Institute Inc.\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n ---------------------------------------------------------------------------------------*/\n\n\n\n // axios.defaults.withCredentials = true\n\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/* X-Uaa-Csrf */\n\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 l = patchURL4ns(iconfig, link.href);\n var url = \"\".concat(l).concat(link.href);\n var config = {\n method: link.method,\n url: url,\n\n /*iconfig.host + link.href,*/\n headers: {\n Accept: link.responseType,\n 'Content-Type': link.type,\n\n /* 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 /*\r\n client_id : iconfig.clientID,\r\n client_secret: iconfig.clientSecret\r\n */\n\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}\n\nfunction request(iconfig) {\n 'use strict';\n\n var link = iconfig.link,\n logonInfo = iconfig.logonInfo;\n\n var iLink = _objectSpread({}, link);\n\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\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\n var l = patchURL4ns(logonInfo, iLink.href);\n var url = \"\".concat(l).concat(iLink.href); // handle casaction upload\n\n casAction = casAction != null ? casAction.toLowerCase() : null;\n\n if (casAction === 'upload') {\n casAction = 'table.upload';\n }\n\n if (casAction !== null) {\n url = \"\".concat(url, \"/\").concat(casAction);\n }\n\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\n var config = {\n method: iLink.method,\n url: url,\n transformResponse: function transformResponse(data) {\n return data;\n },\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300 || status === 302;\n }\n };\n\n if (logonInfo.token !== null) {\n config.headers = {\n Authorization: logonInfo.tokenType + ' ' + logonInfo.token\n };\n } else {\n config.headers = {};\n config.withCredentials = iconfig.withCredentials == null ? true : iconfig.withCredentials;\n }\n\n var type = fullType(iLink.type);\n\n if (iLink.hasOwnProperty('responseType')) {\n if (type !== null) {\n config.headers['Content-Type'] = type;\n }\n\n config.headers.Accept = fullType(iLink.responseType);\n } else if (type !== null) {\n config.headers.Accept = type;\n\n if (iLink.method === 'PUT' || iLink.method === 'POST' || iLink.method === 'PATCH') {\n config.headers['Content-Type'] = type;\n }\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\n if (ixsrf !== null) {\n var xsrfHeaderName = ixsrf['x-csrf-header'];\n config.xsrfHeaderName = xsrfHeaderName; // https://github.com/axios/axios/issues/2024\n\n config.headers[xsrfHeaderName] = ixsrf['x-csrf-token'];\n }\n\n if (iqs !== null) {\n config.params = _objectSpread({}, iqs);\n }\n\n config.data = idata === null ? {} : idata;\n config.maxContentLength = 2 * 10063256;\n var httpOptions = iconfig.storeConfig.httpOptions;\n\n if (httpOptions != null) {\n for (var k in httpOptions) {\n config[k] = httpOptions[k];\n }\n }\n\n return makeCall(config, iconfig, logonInfo);\n}\n\nfunction patchURL4ns(logInfo, link) {\n if (logInfo.ns == null) {\n return logInfo.host;\n }\n\n var service = link.split('/')[1];\n var h = \"\".concat(logInfo.protocol).concat(service, \".storeConfig.ns.svc.cluster.local\");\n return h;\n}\n\nfunction makeCall(config, iconfig, storeConfig) {\n // for nodejs apps use the nodejs env variables instead of restaf config.\n // NODE_TLS_REJECT_UNAUTHORIZED\n // SSL_CERT_FILE\n // let { sslOptions } = iconfig;\n if (storeConfig.protocol === 'https://') {\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\n return new Promise(function (resolve, reject) {\n axios__WEBPACK_IMPORTED_MODULE_2___default()(config).then(function (response) {\n parseJSON(response.data).then(function (data) {\n iconfig.data = null;\n /* get rid of the payload*/\n\n response.data = {\n results: data,\n iconfig: Object.assign({}, iconfig)\n };\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}\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\n try {\n var odata = JSON.parse(temp);\n resolve(odata);\n } catch (err) {\n resolve(data);\n }\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\n if (k.toUpperCase() === name.toUpperCase()) {\n return payload[k];\n }\n }\n\n return null;\n}\n\nfunction fullType(type) {\n var ntype = type;\n\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\n return ntype;\n} // Code below is for experimenting.\n\n\nfunction keepAlive(action) {\n return axios__WEBPACK_IMPORTED_MODULE_2___default()(action.payload);\n}\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?");
1839
+ 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 axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);\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\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n/* eslint-disable no-prototype-builtins */\n\n/*------------------------------------------------------------------------------------\r\n Copyright (c) SAS Institute Inc.\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n ---------------------------------------------------------------------------------------*/\n\n\n\n // axios.defaults.withCredentials = true\n\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/* X-Uaa-Csrf */\n\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 l = patchURL4ns(iconfig, link.href);\n var url = \"\".concat(l).concat(link.href);\n var config = {\n method: link.method,\n url: url,\n\n /*iconfig.host + link.href,*/\n headers: {\n Accept: link.responseType,\n 'Content-Type': link.type,\n\n /* 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 /*\r\n client_id : iconfig.clientID,\r\n client_secret: iconfig.clientSecret\r\n */\n\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}\n\nfunction request(iconfig) {\n 'use strict';\n\n var link = iconfig.link,\n logonInfo = iconfig.logonInfo;\n\n var iLink = _objectSpread({}, link);\n\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\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\n debugger;\n var l = patchURL4ns(logonInfo, iLink.href);\n var url = \"\".concat(l).concat(iLink.href); // handle casaction upload\n\n casAction = casAction != null ? casAction.toLowerCase() : null;\n\n if (casAction === 'upload') {\n casAction = 'table.upload';\n }\n\n if (casAction !== null) {\n url = \"\".concat(url, \"/\").concat(casAction);\n }\n\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\n var config = {\n method: iLink.method,\n url: url,\n transformResponse: function transformResponse(data) {\n return data;\n },\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300 || status === 302;\n }\n };\n\n if (logonInfo.token !== null) {\n config.headers = {\n Authorization: logonInfo.tokenType + ' ' + logonInfo.token\n };\n } else {\n config.headers = {};\n config.withCredentials = iconfig.withCredentials == null ? true : iconfig.withCredentials;\n }\n\n var type = fullType(iLink.type);\n\n if (iLink.hasOwnProperty('responseType')) {\n if (type !== null) {\n config.headers['Content-Type'] = type;\n }\n\n config.headers.Accept = fullType(iLink.responseType);\n } else if (type !== null) {\n config.headers.Accept = type;\n\n if (iLink.method === 'PUT' || iLink.method === 'POST' || iLink.method === 'PATCH') {\n config.headers['Content-Type'] = type;\n }\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\n if (ixsrf !== null) {\n var xsrfHeaderName = ixsrf['x-csrf-header'];\n config.xsrfHeaderName = xsrfHeaderName; // https://github.com/axios/axios/issues/2024\n\n config.headers[xsrfHeaderName] = ixsrf['x-csrf-token'];\n }\n\n if (iqs !== null) {\n config.params = _objectSpread({}, iqs);\n }\n\n config.data = idata === null ? {} : idata;\n config.maxContentLength = 2 * 10063256;\n var httpOptions = iconfig.storeConfig.httpOptions;\n\n if (httpOptions != null) {\n for (var k in httpOptions) {\n config[k] = httpOptions[k];\n }\n }\n\n return makeCall(config, iconfig, logonInfo);\n}\n\nfunction patchURL4ns(logInfo, link) {\n if (logInfo.ns == null) {\n return logInfo.host;\n }\n\n var service = link.split('/')[1];\n var h = \"\".concat(logInfo.protocol).concat(service, \".storeConfig.ns.svc.cluster.local\");\n return h;\n}\n\nfunction makeCall(config, iconfig, storeConfig) {\n // for nodejs apps use the nodejs env variables instead of restaf config.\n // NODE_TLS_REJECT_UNAUTHORIZED\n // SSL_CERT_FILE\n // let { sslOptions } = iconfig;\n if (storeConfig.protocol === 'https://') {\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\n return new Promise(function (resolve, reject) {\n axios__WEBPACK_IMPORTED_MODULE_2___default()(config).then(function (response) {\n parseJSON(response.data).then(function (data) {\n iconfig.data = null;\n /* get rid of the payload*/\n\n response.data = {\n results: data,\n iconfig: Object.assign({}, iconfig)\n };\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}\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\n try {\n var odata = JSON.parse(temp);\n resolve(odata);\n } catch (err) {\n resolve(data);\n }\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\n if (k.toUpperCase() === name.toUpperCase()) {\n return payload[k];\n }\n }\n\n return null;\n}\n\nfunction fullType(type) {\n var ntype = type;\n\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\n return ntype;\n} // Code below is for experimenting.\n\n\nfunction keepAlive(action) {\n return axios__WEBPACK_IMPORTED_MODULE_2___default()(action.payload);\n}\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?");
1840
1840
 
1841
1841
  /***/ }),
1842
1842
 
@@ -2252,7 +2252,7 @@ eval("/* harmony import */ var _extendFolder__WEBPACK_IMPORTED_MODULE_0__ = __we
2252
2252
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2253
2253
 
2254
2254
  "use strict";
2255
- 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 _apiCall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./apiCall */ \"./store/apiCall.js\");\n/* harmony import */ var _jobState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./jobState */ \"./store/jobState.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * * Copyright (c) SAS Institute Inc.\r\n * * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * * you may not use this file except in compliance with the License.\r\n * * You may obtain a copy of the License at\r\n * *\r\n * * http://www.apache.org/licenses/LICENSE-2.0\r\n * *\r\n * * Unless required by applicable law or agreed to in writing, software\r\n * * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ----------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\n\n\n\n\nfunction runAction(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8) {\n return _runAction.apply(this, arguments);\n}\n\nfunction _runAction() {\n _runAction = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, payload, context, onCompletion, maxTries, delay, progress) {\n var actionResult;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n actionResult = null;\n\n if (!(maxTries != null)) {\n _context.next = 7;\n break;\n }\n\n _context.next = 4;\n return submitAction(store, session, payload, context, maxTries, delay, progress);\n\n case 4:\n actionResult = _context.sent;\n _context.next = 10;\n break;\n\n case 7:\n _context.next = 9;\n return Object(_apiCall__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session.links('execute'), payload, 0);\n\n case 9:\n actionResult = _context.sent;\n\n case 10:\n if (!(casError(actionResult) === true)) {\n _context.next = 12;\n break;\n }\n\n throw JSON.stringify(actionResult.items());\n\n case 12:\n if (onCompletion != null) {\n onCompletion(context, actionResult);\n }\n\n return _context.abrupt(\"return\", actionResult);\n\n case 14:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _runAction.apply(this, arguments);\n}\n\nfunction casError(actionResult) {\n var statusCode = actionResult.items('disposition', 'statusCode');\n var severity = actionResult.items('disposition', 'severity').toLowerCase();\n return statusCode !== 0 || severity === 'error' ? true : false;\n}\n\nfunction submitAction(_x9, _x10, _x11, _x12, _x13, _x14, _x15) {\n return _submitAction.apply(this, arguments);\n}\n\nfunction _submitAction() {\n _submitAction = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2(store, session, payload, context, maxTries, delay, progress) {\n var actionPromise, r, result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n actionPromise = Object(_apiCall__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session.links('execute'), payload, 0);\n _context2.next = 3;\n return Object(_jobState__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(store, session, null, maxTries, delay, progress, context, true);\n\n case 3:\n r = _context2.sent;\n result = actionPromise.then(function (result) {\n return result;\n }, function (err) {\n return err;\n });\n return _context2.abrupt(\"return\", result);\n\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n return _submitAction.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (runAction);\n\n//# sourceURL=webpack://restaf/./store/runAction.js?");
2255
+ 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 _apiCall__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./apiCall */ \"./store/apiCall.js\");\n/* harmony import */ var _jobState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./jobState */ \"./store/jobState.js\");\n/*\r\n * ------------------------------------------------------------------------------------\r\n * * Copyright (c) SAS Institute Inc.\r\n * * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * * you may not use this file except in compliance with the License.\r\n * * You may obtain a copy of the License at\r\n * *\r\n * * http://www.apache.org/licenses/LICENSE-2.0\r\n * *\r\n * * Unless required by applicable law or agreed to in writing, software\r\n * * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n * ----------------------------------------------------------------------------------------\r\n *\r\n */\n\n\n\n\n\n\n\nfunction runAction(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8) {\n return _runAction.apply(this, arguments);\n}\n\nfunction _runAction() {\n _runAction = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(store, session, payload, context, onCompletion, maxTries, delay, progress) {\n var actionResult;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n actionResult = null;\n\n if (!(maxTries != null)) {\n _context.next = 7;\n break;\n }\n\n _context.next = 4;\n return submitAction(store, session, payload, context, maxTries, delay, progress);\n\n case 4:\n actionResult = _context.sent;\n _context.next = 11;\n break;\n\n case 7:\n debugger;\n _context.next = 10;\n return Object(_apiCall__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session.links('execute'), payload, 0);\n\n case 10:\n actionResult = _context.sent;\n\n case 11:\n if (!(casError(actionResult) === true)) {\n _context.next = 13;\n break;\n }\n\n throw JSON.stringify(actionResult.items());\n\n case 13:\n if (onCompletion != null) {\n onCompletion(context, actionResult);\n }\n\n return _context.abrupt(\"return\", actionResult);\n\n case 15:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _runAction.apply(this, arguments);\n}\n\nfunction casError(actionResult) {\n var statusCode = actionResult.items('disposition', 'statusCode');\n var severity = actionResult.items('disposition', 'severity').toLowerCase();\n return statusCode !== 0 || severity === 'error' ? true : false;\n}\n\nfunction submitAction(_x9, _x10, _x11, _x12, _x13, _x14, _x15) {\n return _submitAction.apply(this, arguments);\n}\n\nfunction _submitAction() {\n _submitAction = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2(store, session, payload, context, maxTries, delay, progress) {\n var actionPromise, r, result;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n actionPromise = Object(_apiCall__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(store, session.links('execute'), payload, 0);\n _context2.next = 3;\n return Object(_jobState__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(store, session, null, maxTries, delay, progress, context, true);\n\n case 3:\n r = _context2.sent;\n result = actionPromise.then(function (result) {\n return result;\n }, function (err) {\n return err;\n });\n return _context2.abrupt(\"return\", result);\n\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n return _submitAction.apply(this, arguments);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (runAction);\n\n//# sourceURL=webpack://restaf/./store/runAction.js?");
2256
2256
 
2257
2257
  /***/ }),
2258
2258