{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/src/utilities/fetchData.ts","webpack:///./app/javascript/src/ActiveDocs/OAS3Autocomplete.ts","webpack:///./app/javascript/packs/active_docs.ts","webpack:///./app/javascript/src/ActiveDocs/swagger-ui-3-patch.scss?9589","webpack:///./app/javascript/src/ActiveDocs/swagger-ui-3-patch.scss"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","fetchData","url","fetch","then","response","ok","Error","statusText","json","X_DATA_ATTRIBUTE","X_DATA_PARAMS_DESCRIPTIONS","metric_names","metric_ids","app_keys","app_ids","application_ids","user_keys","account_ids","access_token","user_ids","service_ids","service_tokens","admin_ids","provider_users_ids","service_plan_ids","application_plan_ids","account_plan_ids","client_ids","client_secrets","addAutocompleteToParam","param","accountData","xDataKey","autocompleteData","every","assign","examples","reduce","item","concat","_toConsumableArray","summary","injectParametersToPath","path","commonParameters","arguments","undefined","keys","updatedPath","parameters","map","injectAutocompleteToCommonParameters","pathOperation","operationParameters","parametersWithAutocompleteData","injectParametersToPathOperation","autocompleteOAS3","serviceEndpoint","bodyWithServer","responseBody","originalServers","servers","injectServerToResponseBody","body","results","paths","injectAutocompleteToResponseBody","error","console","JSON","stringify","text","autocompleteRequestInterceptor","request","loadSpec","responseInterceptor","SwaggerUI","args","requestInterceptor","content","options","transform","locals"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,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FN,CAEN,CA+BQO,CAAiCR,EAAgB3B,EAAYiC,SAC7DN,C,CACJ,MAAOS,GACPC,QAAQD,MAAMA,GACdJ,EAAOL,C,CAGT,OAAA9G,OAAAuF,OAAAvF,OAAAuF,OAAA,GACK/B,GAAQ,CACX2D,OACA5H,KAAMkI,KAAKC,UAAUP,GACrBQ,KAAMF,KAAKC,UAAUP,IAEzB,EAUaS,EAAiC,SAACC,EAA2B1C,EAAkC0B,GAI1G,OAHIgB,EAAQC,WACVD,EAAQE,oBAAsB,SAACvE,GAA2B,OAAKoD,EAAiBpD,EAAU2B,EAAa0B,EAAgB,GAElHgB,CACT,C,mCCrJA,+DAaA5E,OAAO+E,UAAY,SAACC,EAAkCpB,GACpDzD,YAHqB,+BAIlBG,MAAK,SAAA4B,GAGJ,OAAO6C,IAAUhI,OAAAuF,OAAAvF,OAAAuF,OAAA,GACZ0C,GAAI,CACPC,mBAJyB,SAACL,GAA0B,OAAKD,YAA+BC,EAAS1C,EAAa0B,EAAgB,IAMlI,IAAE,OACK,SAAAU,GAAWC,QAAQD,MAAMA,EAAO,GAC3C,C,sBCvBA,IAAIY,EAAU,EAAQ,KAEA,kBAAZA,IAAsBA,EAAU,CAAC,CAAC7G,EAAOzB,EAAIsI,EAAS,MAOhE,IAAIC,EAAU,CAAC,KAAM,EAErBA,UAPIC,UAQJD,gBAAqBlC,GAER,EAAQ,GAAR,CAAmEiC,EAASC,GAEtFD,EAAQG,SAAQhH,EAAOD,QAAU8G,EAAQG,O,uBCjBlChH,EAAOD,QAAU,EAAQ,GAAR,EAAmE,IAEtFhB,KAAK,CAACiB,EAAOzB,EAAI,8lDAAmmD,I","file":"js/active_docs-f92c4f651c6bc8559f19.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t6: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([964,2]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","export function fetchData (url: string): Promise {\n return fetch(url)\n .then(response => {\n if (!response.ok) {\n throw new Error(response.statusText)\n }\n\n return response.json() as Promise\n })\n}\n","/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-unnecessary-condition */\n/* eslint-disable @typescript-eslint/default-param-last */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/naming-convention */\n/* TODO: this module needs to be properly typed !!! */\n\nimport type { Request as SwaggerUIRequest, Response as SwaggerUIResponse } from 'swagger-ui'\nimport type { AccountData, AccountDataResponse } from 'Types/SwaggerTypes'\n\nconst X_DATA_ATTRIBUTE = 'x-data-threescale-name'\n\nconst X_DATA_PARAMS_DESCRIPTIONS = {\n metric_names: 'Latest 5 metrics',\n metric_ids: 'Latest 5 metrics',\n app_keys: 'First application key from the latest five applications',\n app_ids: 'Latest 5 applications (across all accounts and services)',\n application_ids: 'Latest 5 applications',\n user_keys: 'First user key from latest 5 applications',\n account_ids: 'Latest 5 accounts',\n access_token: 'Access Token',\n user_ids: 'First user (admin) of the latest 5 account',\n service_ids: 'Service IDs',\n service_tokens: 'Service tokens',\n admin_ids: 'Latest 5 users (admin) from your account',\n provider_users_ids: 'Latest 5 users of your account',\n service_plan_ids: 'Latest 5 service plans',\n application_plan_ids: 'Latest 5 application plans',\n account_plan_ids: 'Latest 5 account plans',\n client_ids: 'Client IDs from the latest five applications',\n client_secrets: 'Client secrets from the latest five applications'\n} as const\n\nconst addAutocompleteToParam = (param: any, accountData: AccountData): any => {\n const xDataKey = param[X_DATA_ATTRIBUTE] as keyof typeof X_DATA_PARAMS_DESCRIPTIONS\n const autocompleteData = accountData[xDataKey]\n const paramHasAutocompleteData = autocompleteData && autocompleteData.length > 0 &&\n autocompleteData.every(p => p.name !== '')\n\n return paramHasAutocompleteData\n ? {\n ...param,\n examples: autocompleteData.reduce<{ summary: string; value: string }[]>((examples, item) => (\n [...examples, { summary: item.value ? `${item.name} - ${item.value}` : item.name, value: item.value }]\n ), [{ summary: X_DATA_PARAMS_DESCRIPTIONS[xDataKey], value: '-' }])\n }\n : param\n}\n\nconst injectParametersToPathOperation = (pathOperation: any, accountData: AccountData): any => {\n const operationParameters = pathOperation.parameters\n if (!operationParameters) return pathOperation\n const parametersWithAutocompleteData = operationParameters.map((param: any) => X_DATA_ATTRIBUTE in param ? addAutocompleteToParam(param, accountData) : param)\n return {\n ...pathOperation,\n parameters: parametersWithAutocompleteData\n }\n}\n\nconst injectAutocompleteToCommonParameters = (parameters: any[], accountData: AccountData): any[] => parameters.map(\n param => X_DATA_ATTRIBUTE in param ? addAutocompleteToParam(param, accountData) : param\n)\n\nconst injectParametersToPath = (\n path: Record,\n commonParameters: any[] | null | undefined = [],\n accountData: AccountData\n): any => (Object.keys(path).reduce>((updatedPath, item) => {\n updatedPath[item] = (item === 'parameters' && commonParameters)\n ? injectAutocompleteToCommonParameters(commonParameters, accountData)\n : injectParametersToPathOperation(path[item], accountData)\n return updatedPath\n}, {}))\n\nconst injectAutocompleteToResponseBody = (responseBody: string | { paths?: Record }, accountData: AccountData): any | string => {\n const res = (typeof responseBody !== 'string' && responseBody.paths && accountData) ? {\n ...responseBody,\n paths: Object.keys(responseBody.paths).reduce>((paths, path) => {\n const commonParameters = responseBody.paths![path].parameters\n paths[path] = injectParametersToPath(responseBody.paths![path], commonParameters, accountData)\n return paths\n }, {})\n } : responseBody\n return res\n}\n\nconst injectServerToResponseBody = (responseBody: any | string, serviceEndpoint: string): any | string => {\n if (typeof responseBody === 'string') {\n return responseBody\n }\n\n const originalServers = responseBody.servers || []\n const servers = serviceEndpoint ? [{ url: serviceEndpoint }] : originalServers\n\n return {\n ...responseBody,\n servers\n }\n}\n\nexport interface Response extends SwaggerUIResponse {\n body: {\n servers: unknown;\n paths: any;\n };\n data: string;\n text: string;\n}\n\nconst autocompleteOAS3 = (response: SwaggerUIResponse, accountData: AccountDataResponse, serviceEndpoint: string): Response => {\n const bodyWithServer = injectServerToResponseBody(response.body, serviceEndpoint)\n\n let body = undefined\n try {\n body = accountData.results\n ? injectAutocompleteToResponseBody(bodyWithServer, accountData.results)\n : bodyWithServer\n } catch (error: unknown) {\n console.error(error)\n body = bodyWithServer\n }\n\n return {\n ...response,\n body,\n data: JSON.stringify(body),\n text: JSON.stringify(body)\n }\n}\n\n/**\n * Intercept the request, and if it fetches the OpenAPI specification, apply a custom responseInterceptor that applies\n * transformations (inject servers list and autocomplete data) to the response\n * keep the responses to the actual API calls (made through 'Try it out') untouched\n * @param request request made through Swagger UI\n * @param accountData data for autocompletion\n * @param serviceEndpoint Public Base URL of the gateway, that will replace the URL in the \"servers\" object\n */\nexport const autocompleteRequestInterceptor = (request: SwaggerUIRequest, accountData: AccountDataResponse, serviceEndpoint: string): Promise | SwaggerUIRequest => {\n if (request.loadSpec) {\n request.responseInterceptor = (response: SwaggerUIResponse) => autocompleteOAS3(response, accountData, serviceEndpoint)\n }\n return request\n}\n","// We can define the 3scale plugins here and export the modified bundle\nimport SwaggerUI from 'swagger-ui'\nimport 'swagger-ui/dist/swagger-ui.css'\n\nimport { autocompleteRequestInterceptor } from 'ActiveDocs/OAS3Autocomplete'\nimport { fetchData } from 'utilities/fetchData'\n\nimport type { AccountDataResponse } from 'Types/SwaggerTypes'\n\nimport 'ActiveDocs/swagger-ui-3-patch.scss'\n\nconst accountDataUrl = '/api_docs/account_data.json'\n\nwindow.SwaggerUI = (args: SwaggerUI.SwaggerUIOptions, serviceEndpoint: string) => {\n fetchData(accountDataUrl)\n .then(accountData => {\n const requestInterceptor = (request: SwaggerUI.Request) => autocompleteRequestInterceptor(request, accountData, serviceEndpoint)\n\n return SwaggerUI({\n ...args,\n requestInterceptor\n } as SwaggerUI.SwaggerUIOptions)\n })\n .catch(error => { console.error(error) })\n}\n","\nvar content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./swagger-ui-3-patch.scss\");\n\nif(typeof content === 'string') content = [[module.id, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = require(\"!../../../../node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(module.hot) {\n\tmodule.hot.accept(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./swagger-ui-3-patch.scss\", function() {\n\t\tvar newContent = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./swagger-ui-3-patch.scss\");\n\n\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\n\t\tvar locals = (function(a, b) {\n\t\t\tvar key, idx = 0;\n\n\t\t\tfor(key in a) {\n\t\t\t\tif(!b || a[key] !== b[key]) return false;\n\t\t\t\tidx++;\n\t\t\t}\n\n\t\t\tfor(key in b) idx--;\n\n\t\t\treturn idx === 0;\n\t\t}(content.locals, newContent.locals));\n\n\t\tif(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');\n\n\t\tupdate(newContent);\n\t});\n\n\tmodule.hot.dispose(function() { update(); });\n}","exports = module.exports = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \".swagger-section section{background-color:unset}.swagger-section .wrapper{background-color:rgba(255,255,255,.2);padding-bottom:4em;padding-left:30px;padding-right:30px;padding-top:2em}.swagger-section .information-container{background-color:unset;padding:0}.swagger-section .information-container .info .title{color:rgba(0,0,0,.6);font-family:Futura,\\\"Trebuchet MS\\\",Arial,sans-serif;font-size:25px}.swagger-section .information-container .info .main small,.swagger-section .information-container .info .main pre,.swagger-section .information-container .info .main a{display:none}.swagger-section .scheme-container{background:unset;box-shadow:unset;padding:unset}.swagger-section .scheme-container .wrapper{padding-bottom:2em}.swagger-section .opblock{border:0;margin:0 0 10px}.swagger-section .opblock .opblock-tag-section .nostyle{font-family:Droid Sans,sans-serif;font-size:1.6rem;font-weight:700}.swagger-section .opblock .opblock-summary{background-color:#e7f0f7;padding:0}.swagger-section .opblock .opblock-summary-method{border-radius:0;display:inline-block;font-size:.7em;line-height:2em;padding:7px 0 4px;text-align:center;text-decoration:none;text-transform:uppercase;width:50px}.swagger-section .opblock .opblock-summary-path{padding-left:10px}.swagger-section .opblock .opblock-summary-path span{font-family:Futura,\\\"Trebuchet MS\\\",Arial,sans-serif;font-size:1.4rem;font-weight:normal}.swagger-section .opblock .opblock-tag a,.swagger-section .opblock .opblock-tag small,.swagger-section .opblock .opblock-tag div{display:inline-block}.swagger-section .opblock .opblock-tag button{display:inline-block;margin-left:1rem}\", \"\"]);\n\n"],"sourceRoot":""}