@looker/run-it 0.9.45 → 0.9.48
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +21 -0
- package/lib/RunIt.js.map +1 -1
- package/lib/RunItProvider.js.map +1 -1
- package/lib/components/Collapser/CollapserCard.js.map +1 -1
- package/lib/components/Collapser/index.js.map +1 -1
- package/lib/components/ConfigForm/ConfigForm.js.map +1 -1
- package/lib/components/ConfigForm/index.js.map +1 -1
- package/lib/components/ConfigForm/utils.js.map +1 -1
- package/lib/components/CopyLinkWrapper/CopyLinkWrapper.js.map +1 -1
- package/lib/components/CopyLinkWrapper/index.js.map +1 -1
- package/lib/components/DataGrid/DataGrid.js.map +1 -1
- package/lib/components/DataGrid/gridUtils.js.map +1 -1
- package/lib/components/DataGrid/index.js.map +1 -1
- package/lib/components/DocSdkCalls/DocMultiCall.js.map +1 -1
- package/lib/components/DocSdkCalls/DocSdkCalls.js.map +1 -1
- package/lib/components/DocSdkCalls/callUtils.js.map +1 -1
- package/lib/components/DocSdkCalls/index.js.map +1 -1
- package/lib/components/Loading/Loading.js.map +1 -1
- package/lib/components/Loading/index.js.map +1 -1
- package/lib/components/LoginForm/LoginForm.js.map +1 -1
- package/lib/components/LoginForm/index.js.map +1 -1
- package/lib/components/MethodBadge/MethodBadge.js.map +1 -1
- package/lib/components/MethodBadge/index.js.map +1 -1
- package/lib/components/PerfTracker/PerfChart.js.map +1 -1
- package/lib/components/PerfTracker/PerfTable.js.map +1 -1
- package/lib/components/PerfTracker/PerfTracker.js.map +1 -1
- package/lib/components/PerfTracker/index.js.map +1 -1
- package/lib/components/PerfTracker/perfTableUtils.js.map +1 -1
- package/lib/components/PerfTracker/perfUtils.js.map +1 -1
- package/lib/components/RequestForm/FormItem.js.map +1 -1
- package/lib/components/RequestForm/RequestForm.js.map +1 -1
- package/lib/components/RequestForm/formUtils.js.map +1 -1
- package/lib/components/RequestForm/index.js.map +1 -1
- package/lib/components/ResponseExplorer/ResponseExplorer.js.map +1 -1
- package/lib/components/ResponseExplorer/index.js.map +1 -1
- package/lib/components/ShowResponse/ShowResponse.js.map +1 -1
- package/lib/components/ShowResponse/index.js.map +1 -1
- package/lib/components/ShowResponse/responseUtils.js +3 -3
- package/lib/components/ShowResponse/responseUtils.js.map +1 -1
- package/lib/components/common/common.js.map +1 -1
- package/lib/components/common/index.js.map +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/esm/RunIt.js.map +1 -1
- package/lib/esm/RunItProvider.js.map +1 -1
- package/lib/esm/components/Collapser/CollapserCard.js.map +1 -1
- package/lib/esm/components/Collapser/index.js.map +1 -1
- package/lib/esm/components/ConfigForm/ConfigForm.js.map +1 -1
- package/lib/esm/components/ConfigForm/index.js.map +1 -1
- package/lib/esm/components/ConfigForm/utils.js.map +1 -1
- package/lib/esm/components/CopyLinkWrapper/CopyLinkWrapper.js.map +1 -1
- package/lib/esm/components/CopyLinkWrapper/index.js.map +1 -1
- package/lib/esm/components/DataGrid/DataGrid.js.map +1 -1
- package/lib/esm/components/DataGrid/gridUtils.js.map +1 -1
- package/lib/esm/components/DataGrid/index.js.map +1 -1
- package/lib/esm/components/DocSdkCalls/DocMultiCall.js.map +1 -1
- package/lib/esm/components/DocSdkCalls/DocSdkCalls.js.map +1 -1
- package/lib/esm/components/DocSdkCalls/callUtils.js.map +1 -1
- package/lib/esm/components/DocSdkCalls/index.js.map +1 -1
- package/lib/esm/components/Loading/Loading.js.map +1 -1
- package/lib/esm/components/Loading/index.js.map +1 -1
- package/lib/esm/components/LoginForm/LoginForm.js.map +1 -1
- package/lib/esm/components/LoginForm/index.js.map +1 -1
- package/lib/esm/components/MethodBadge/MethodBadge.js.map +1 -1
- package/lib/esm/components/MethodBadge/index.js.map +1 -1
- package/lib/esm/components/PerfTracker/PerfChart.js.map +1 -1
- package/lib/esm/components/PerfTracker/PerfTable.js.map +1 -1
- package/lib/esm/components/PerfTracker/PerfTracker.js.map +1 -1
- package/lib/esm/components/PerfTracker/index.js.map +1 -1
- package/lib/esm/components/PerfTracker/perfTableUtils.js.map +1 -1
- package/lib/esm/components/PerfTracker/perfUtils.js.map +1 -1
- package/lib/esm/components/RequestForm/FormItem.js.map +1 -1
- package/lib/esm/components/RequestForm/RequestForm.js.map +1 -1
- package/lib/esm/components/RequestForm/formUtils.js.map +1 -1
- package/lib/esm/components/RequestForm/index.js.map +1 -1
- package/lib/esm/components/ResponseExplorer/ResponseExplorer.js.map +1 -1
- package/lib/esm/components/ResponseExplorer/index.js.map +1 -1
- package/lib/esm/components/ShowResponse/ShowResponse.js.map +1 -1
- package/lib/esm/components/ShowResponse/index.js.map +1 -1
- package/lib/esm/components/ShowResponse/responseUtils.js +3 -3
- package/lib/esm/components/ShowResponse/responseUtils.js.map +1 -1
- package/lib/esm/components/common/common.js.map +1 -1
- package/lib/esm/components/common/index.js.map +1 -1
- package/lib/esm/components/index.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/test-data/index.js.map +1 -1
- package/lib/esm/test-data/responses.js.map +1 -1
- package/lib/esm/test-data/specs.js.map +1 -1
- package/lib/esm/utils/RunItSDK.js +4 -4
- package/lib/esm/utils/RunItSDK.js.map +1 -1
- package/lib/esm/utils/index.js.map +1 -1
- package/lib/esm/utils/requestUtils.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/test-data/index.js.map +1 -1
- package/lib/test-data/responses.js.map +1 -1
- package/lib/test-data/specs.js.map +1 -1
- package/lib/utils/RunItSDK.js +4 -4
- package/lib/utils/RunItSDK.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/requestUtils.js.map +1 -1
- package/package.json +4 -4
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"responseUtils.js","names":["allSimple","data","Array","isArray","i","length","col","test","Object","Date","copyRaw","code","language","isColumnar","complex","values","find","row","ItemType","itemType","value","Undefined","Simple","getTypes","json","types","Set","add","key","type","keys","forEach","k","v","canTabulate","size","has","ShowJSON","response","content","body","toString","parsed","JSON","parse","json2Csv","undefined","showGrid","stringify","raw","ShowText","statusMessage","ShowCSV","parseCsv","ShowMD","tabs","useTabs","ShowImage","Blob","URL","createObjectURL","contentType","btoa","url","ShowHTML","ShowSQL","ShowUnknown","message","ShowPDF","ShowRaw","responseHandlers","label","isRecognized","component","responseMode","ResponseMode","string","pickResponseHandler","result","handler","fallbackResponseHandler"],"sources":["../../../../src/components/ShowResponse/responseUtils.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { ReactElement } from 'react'\nimport React from 'react'\nimport type { IRawResponse } from '@looker/sdk-rtl'\nimport { ResponseMode, responseMode } from '@looker/sdk-rtl'\nimport {\n Paragraph,\n MessageBar,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n useTabs,\n} from '@looker/components'\nimport { CodeCopy, Markdown } from '@looker/code-editor'\nimport { DataGrid, parseCsv, json2Csv } from '../DataGrid'\n\n/**\n * Are all items this array \"simple\"\n * @param data to check for simplicity\n */\nexport const allSimple = (data: any[]) => {\n if (!Array.isArray(data)) return false\n for (let i = 0; i < data.length; i++) {\n const col = data[i]\n if (col) {\n if (/\\[object Object]/gi.test(col)) return false\n if (Array.isArray(col)) return false\n if (col instanceof Object && !(col instanceof Date)) return false\n }\n }\n return true\n}\n\nconst copyRaw = (code: string, language = 'unknown') => {\n return (\n <CodeCopy language={language} code={code} lineNumbers={false} transparent />\n )\n}\n\n/**\n * Is every array in this array a \"simple\" data row?\n * @param data to check for columnarity\n */\nexport const isColumnar = (data: any[]) => {\n if (data.length === 0) return false\n if (data.length === 1 && data[0].length === 0) return false\n const complex = Object.values(data).find((row: any[]) => !allSimple(row))\n return !complex\n}\n\nenum ItemType {\n Array = 'a',\n Object = 'o',\n Simple = 's',\n Undefined = 'u',\n}\n\n/**\n * Is this an array, an object, a value, or undefined\n * @param value to check\n */\nconst itemType = (value: any): ItemType => {\n if (!value) return ItemType.Undefined\n if (Array.isArray(value)) return ItemType.Array\n if (value instanceof Object) return ItemType.Object\n return ItemType.Simple\n}\n\n/**\n * Get the 2D type mapping for the object\n * @param json to analyze\n */\nconst getTypes = (json: any) => {\n const types = [new Set<ItemType>(), new Set<ItemType>()]\n if (!json) {\n types[0].add(ItemType.Undefined)\n return types\n }\n for (const key of Object.keys(json)) {\n const value = json[key]\n const type = itemType(value)\n types[0].add(type)\n switch (type) {\n case ItemType.Array:\n case ItemType.Object:\n Object.keys(value).forEach((k) => {\n const v = value[k]\n types[1].add(itemType(v))\n })\n break\n }\n }\n return types\n}\n\n/**\n * Is this a uniform object that can be converted into a table?\n * @param json to analyze\n */\nexport const canTabulate = (json: any) => {\n const types = getTypes(json)\n return (\n types[0].size === 1 &&\n (types[0].has(ItemType.Array) || types[0].has(ItemType.Object)) &&\n types[1].size <= 1\n )\n}\n\n/**\n * Show JSON responses\n *\n * Shows the JSON in a syntax-highlighted fashion\n * If the JSON is parseable as 2D row/column data it will also be shown in grid\n * If JSON cannot be parsed it will be shown as is\n * @param response\n */\nconst ShowJSON = (response: IRawResponse) => {\n const content = response.body.toString()\n const parsed = JSON.parse(response.body)\n const data = canTabulate(parsed) ? json2Csv(content) : undefined\n const showGrid = data && isColumnar(data.data)\n const json = JSON.stringify(parsed, null, 2)\n const raw = copyRaw(json, 'json')\n if (showGrid) return <DataGrid data={data.data} raw={raw} />\n return raw\n}\n\n/** A handler for text type responses */\nconst ShowText = (response: IRawResponse) => (\n <>\n {response.statusMessage !== 'OK' && response.statusMessage}\n {copyRaw(response.body.toString())}\n </>\n)\n\n/**\n * Show CSV grid and raw data\n * @param response HTTP response to parse and display\n */\nconst ShowCSV = (response: IRawResponse) => {\n const raw = copyRaw(response.body.toString())\n const data = parseCsv(response.body.toString())\n return <DataGrid data={data.data} raw={raw} />\n}\n\nconst ShowMD = (response: IRawResponse) => {\n const tabs = useTabs()\n const raw = copyRaw(response.body.toString(), 'markup')\n const data = response.body.toString()\n return (\n <>\n <TabList {...tabs}>\n <Tab key=\"md\">Markdown</Tab>\n <Tab key=\"raw\">Raw</Tab>\n </TabList>\n <TabPanels {...tabs} pt=\"0\">\n <TabPanel key=\"doc\">\n <Markdown source={data} />\n </TabPanel>\n <TabPanel key=\"text\">{raw}</TabPanel>\n </TabPanels>\n </>\n )\n}\n\n/** A handler for image type responses */\nconst ShowImage = (response: IRawResponse) => {\n let content: string\n if (response.body instanceof Blob) {\n content = URL.createObjectURL(response.body).toString()\n } else {\n content = `data:${response.contentType};base64,${btoa(response.body)}`\n }\n return (\n <img\n src={content}\n alt={`${response.url} returned ${response.contentType}`}\n />\n )\n}\n\n/** A handler for HTTP type responses */\nconst ShowHTML = (response: IRawResponse) =>\n copyRaw(response.body.toString(), 'html')\n\nconst ShowSQL = (response: IRawResponse) =>\n copyRaw(response.body.toString(), 'sql')\n\n/**\n * A handler for unknown response types. It renders the size of the unknown response and its type.\n */\nconst ShowUnknown = (response: IRawResponse) => {\n const body = response.body || ''\n const message = `Received ${\n body instanceof Blob ? body.size : body.toString().length\n } bytes of ${response.contentType} data.`\n return <Paragraph>{message}</Paragraph>\n}\n\n/** Displays a PDF inside the page */\nconst ShowPDF = (response: IRawResponse) => {\n // TODO display a PDF, maybe similar to https://github.com/wojtekmaj/react-pdf/blob/master/sample/webpack/Sample.jsx\n return ShowUnknown(response)\n}\n\n/** A handler for responses that cannot be parsed */\nconst ShowRaw = (response: IRawResponse) => (\n <>\n {ShowUnknown(response)}\n <MessageBar intent=\"warn\" noActions>\n The response body could not be parsed. Displaying raw data.\n </MessageBar>\n {copyRaw(response?.body?.toString() || '')}\n </>\n)\n\ninterface Responder {\n /** A label indicating the supported MIME type(s) */\n label: string\n /** A lambda for determining whether a given MIME type is supported */\n isRecognized: (contentType: string) => boolean\n /** A component that renders recognized MIME types */\n component: (response: IRawResponse) => ReactElement\n}\n\n/**\n * An array of response handlers, describing currently supported MIME types\n */\nexport const responseHandlers: Responder[] = [\n // TODO: Add support for content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet and pdf\n {\n label: 'json',\n isRecognized: (contentType) => /application\\/json/g.test(contentType),\n component: (response) => ShowJSON(response),\n },\n {\n label: 'html',\n isRecognized: (contentType) => /text\\/html/g.test(contentType),\n component: (response) => ShowHTML(response),\n },\n {\n label: 'csv',\n isRecognized: (contentType) => /text\\/csv/g.test(contentType),\n component: (response) => ShowCSV(response),\n },\n {\n label: 'md',\n isRecognized: (contentType) => /text\\/markdown/g.test(contentType),\n component: (response) => ShowMD(response),\n },\n // SVG would normally be considered a \"string\" because of the xml tag, so it must be checked before text\n {\n label: 'img',\n isRecognized: (contentType) =>\n /image\\/(png|jpg|jpeg|svg\\+xml)/.test(contentType),\n component: (response) => ShowImage(response),\n },\n {\n // render task: 9d52f842b2c3f474970123302b2fa7e0\n label: 'pdf',\n isRecognized: (contentType) => /application\\/pdf/g.test(contentType),\n component: (response) => ShowPDF(response),\n },\n {\n label: 'sql',\n isRecognized: (contentType) => /application\\/sql/g.test(contentType),\n component: (response) => ShowSQL(response),\n },\n {\n label: 'text',\n isRecognized: (contentType) =>\n responseMode(contentType) === ResponseMode.string ||\n contentType === 'text',\n component: (response) => ShowText(response),\n },\n {\n label: 'unknown',\n isRecognized: (contentType: string) => !!contentType,\n component: (response) => ShowUnknown(response),\n },\n]\n\n/** find the response handler or return the default */\nexport const pickResponseHandler = (response: IRawResponse) => {\n let result = responseHandlers[responseHandlers.length - 1]\n for (const handler of responseHandlers) {\n if (handler.isRecognized(response.contentType)) {\n result = handler\n break\n }\n }\n return result\n}\n\nexport const fallbackResponseHandler = (): Responder => ({\n label: 'unknown',\n isRecognized: (contentType: string) => !!contentType,\n component: (response) => ShowRaw(response),\n})\n"],"mappings":";;;;;;AA0BA;AAEA;AACA;AASA;AACA;AAA0D;AAAA;AAMnD,IAAMA,SAAS,GAAIC,IAAW,IAAK;EACxC,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,EAAE,OAAO,KAAK;EACtC,KAAK,IAAIG,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,IAAI,CAACI,MAAM,EAAED,CAAC,EAAE,EAAE;IACpC,IAAME,GAAG,GAAGL,IAAI,CAACG,CAAC,CAAC;IACnB,IAAIE,GAAG,EAAE;MACP,IAAI,oBAAoB,CAACC,IAAI,CAACD,GAAG,CAAC,EAAE,OAAO,KAAK;MAChD,IAAIJ,KAAK,CAACC,OAAO,CAACG,GAAG,CAAC,EAAE,OAAO,KAAK;MACpC,IAAIA,GAAG,YAAYE,MAAM,IAAI,EAAEF,GAAG,YAAYG,IAAI,CAAC,EAAE,OAAO,KAAK;IACnE;EACF;EACA,OAAO,IAAI;AACb,CAAC;AAAA;AAED,IAAMC,OAAO,GAAG,SAAVA,OAAO,CAAIC,IAAY,EAA2B;EAAA,IAAzBC,QAAQ,uEAAG,SAAS;EACjD,OACE,6BAAC,oBAAQ;IAAC,QAAQ,EAAEA,QAAS;IAAC,IAAI,EAAED,IAAK;IAAC,WAAW,EAAE,KAAM;IAAC,WAAW;EAAA,EAAG;AAEhF,CAAC;AAMM,IAAME,UAAU,GAAIZ,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EACpDY,SAAS,EAAGnC,QAAQ,IAAK+B,OAAO,CAAC/B,QAAQ;AAC3C,CAAC,CAAC;AAAA"}
|
1
|
+
{"version":3,"file":"responseUtils.js","names":["_react","_interopRequireDefault","require","_sdkRtl","_components","_codeEditor","_DataGrid","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","allSimple","data","Array","isArray","col","test","Date","exports","copyRaw","code","language","undefined","createElement","CodeCopy","lineNumbers","transparent","isColumnar","complex","values","find","row","ItemType","itemType","value","Undefined","Simple","getTypes","json","types","Set","add","_loop","type","keys","forEach","k","v","canTabulate","size","has","ShowJSON","response","content","body","toString","parsed","JSON","parse","json2Csv","showGrid","stringify","raw","DataGrid","ShowText","Fragment","statusMessage","ShowCSV","parseCsv","ShowMD","tabs","useTabs","TabList","Tab","TabPanels","pt","TabPanel","Markdown","ShowImage","Blob","URL","createObjectURL","concat","contentType","btoa","src","alt","url","ShowHTML","ShowSQL","ShowUnknown","message","Paragraph","ShowPDF","ShowRaw","_response$body","MessageBar","intent","noActions","responseHandlers","label","isRecognized","component","responseMode","ResponseMode","string","pickResponseHandler","result","handler","fallbackResponseHandler"],"sources":["../../../../src/components/ShowResponse/responseUtils.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport type { ReactElement } from 'react'\nimport React from 'react'\nimport type { IRawResponse } from '@looker/sdk-rtl'\nimport { ResponseMode, responseMode } from '@looker/sdk-rtl'\nimport {\n Paragraph,\n MessageBar,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n useTabs,\n} from '@looker/components'\nimport { CodeCopy, Markdown } from '@looker/code-editor'\nimport { DataGrid, parseCsv, json2Csv } from '../DataGrid'\n\n/**\n * Are all items this array \"simple\"\n * @param data to check for simplicity\n */\nexport const allSimple = (data: any[]) => {\n if (!Array.isArray(data)) return false\n for (let i = 0; i < data.length; i++) {\n const col = data[i]\n if (col) {\n if (/\\[object Object]/gi.test(col)) return false\n if (Array.isArray(col)) return false\n if (col instanceof Object && !(col instanceof Date)) return false\n }\n }\n return true\n}\n\nconst copyRaw = (code: string, language = 'unknown') => {\n return (\n <CodeCopy language={language} code={code} lineNumbers={false} transparent />\n )\n}\n\n/**\n * Is every array in this array a \"simple\" data row?\n * @param data to check for columnarity\n */\nexport const isColumnar = (data: any[]) => {\n if (data.length === 0) return false\n if (data.length === 1 && data[0].length === 0) return false\n const complex = Object.values(data).find((row: any[]) => !allSimple(row))\n return !complex\n}\n\nenum ItemType {\n Array = 'a',\n Object = 'o',\n Simple = 's',\n Undefined = 'u',\n}\n\n/**\n * Is this an array, an object, a value, or undefined\n * @param value to check\n */\nconst itemType = (value: any): ItemType => {\n if (!value) return ItemType.Undefined\n if (Array.isArray(value)) return ItemType.Array\n if (value instanceof Object) return ItemType.Object\n return ItemType.Simple\n}\n\n/**\n * Get the 2D type mapping for the object\n * @param json to analyze\n */\nconst getTypes = (json: any) => {\n const types = [new Set<ItemType>(), new Set<ItemType>()]\n if (!json) {\n types[0].add(ItemType.Undefined)\n return types\n }\n for (const key of Object.keys(json)) {\n const value = json[key]\n const type = itemType(value)\n types[0].add(type)\n switch (type) {\n case ItemType.Array:\n case ItemType.Object:\n Object.keys(value).forEach((k) => {\n const v = value[k]\n types[1].add(itemType(v))\n })\n break\n }\n }\n return types\n}\n\n/**\n * Is this a uniform object that can be converted into a table?\n * @param json to analyze\n */\nexport const canTabulate = (json: any) => {\n const types = getTypes(json)\n return (\n types[0].size === 1 &&\n (types[0].has(ItemType.Array) || types[0].has(ItemType.Object)) &&\n types[1].size <= 1\n )\n}\n\n/**\n * Show JSON responses\n *\n * Shows the JSON in a syntax-highlighted fashion\n * If the JSON is parseable as 2D row/column data it will also be shown in grid\n * If JSON cannot be parsed it will be shown as is\n * @param response\n */\nconst ShowJSON = (response: IRawResponse) => {\n const content = response.body.toString()\n const parsed = JSON.parse(response.body)\n const data = canTabulate(parsed) ? json2Csv(content) : undefined\n const showGrid = data && isColumnar(data.data)\n const json = JSON.stringify(parsed, null, 2)\n const raw = copyRaw(json, 'json')\n if (showGrid) return <DataGrid data={data.data} raw={raw} />\n return raw\n}\n\n/** A handler for text type responses */\nconst ShowText = (response: IRawResponse) => (\n <>\n {response.statusMessage !== 'OK' && response.statusMessage}\n {copyRaw(response.body.toString())}\n </>\n)\n\n/**\n * Show CSV grid and raw data\n * @param response HTTP response to parse and display\n */\nconst ShowCSV = (response: IRawResponse) => {\n const raw = copyRaw(response.body.toString())\n const data = parseCsv(response.body.toString())\n return <DataGrid data={data.data} raw={raw} />\n}\n\nconst ShowMD = (response: IRawResponse) => {\n const tabs = useTabs()\n const raw = copyRaw(response.body.toString(), 'markup')\n const data = response.body.toString()\n return (\n <>\n <TabList {...tabs}>\n <Tab key=\"md\">Markdown</Tab>\n <Tab key=\"raw\">Raw</Tab>\n </TabList>\n <TabPanels {...tabs} pt=\"0\">\n <TabPanel key=\"doc\">\n <Markdown source={data} />\n </TabPanel>\n <TabPanel key=\"text\">{raw}</TabPanel>\n </TabPanels>\n </>\n )\n}\n\n/** A handler for image type responses */\nconst ShowImage = (response: IRawResponse) => {\n let content: string\n if (response.body instanceof Blob) {\n content = URL.createObjectURL(response.body).toString()\n } else {\n content = `data:${response.contentType};base64,${btoa(response.body)}`\n }\n return (\n <img\n src={content}\n alt={`${response.url} returned ${response.contentType}`}\n />\n )\n}\n\n/** A handler for HTTP type responses */\nconst ShowHTML = (response: IRawResponse) =>\n copyRaw(response.body.toString(), 'html')\n\nconst ShowSQL = (response: IRawResponse) =>\n copyRaw(response.body.toString(), 'sql')\n\n/**\n * A handler for unknown response types. It renders the size of the unknown response and its type.\n */\nconst ShowUnknown = (response: IRawResponse) => {\n const body = response.body || ''\n const message = `Received ${\n body instanceof Blob ? body.size : body.toString().length\n } bytes of ${response.contentType} data.`\n return <Paragraph>{message}</Paragraph>\n}\n\n/** Displays a PDF inside the page */\nconst ShowPDF = (response: IRawResponse) => {\n // TODO display a PDF, maybe similar to https://github.com/wojtekmaj/react-pdf/blob/master/sample/webpack/Sample.jsx\n return ShowUnknown(response)\n}\n\n/** A handler for responses that cannot be parsed */\nconst ShowRaw = (response: IRawResponse) => (\n <>\n {ShowUnknown(response)}\n <MessageBar intent=\"warn\" noActions>\n The response body could not be parsed. Displaying raw data.\n </MessageBar>\n {copyRaw(response?.body?.toString() || '')}\n </>\n)\n\ninterface Responder {\n /** A label indicating the supported MIME type(s) */\n label: string\n /** A lambda for determining whether a given MIME type is supported */\n isRecognized: (contentType: string) => boolean\n /** A component that renders recognized MIME types */\n component: (response: IRawResponse) => ReactElement\n}\n\n/**\n * An array of response handlers, describing currently supported MIME types\n */\nexport const responseHandlers: Responder[] = [\n // TODO: Add support for content type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet and pdf\n {\n label: 'json',\n isRecognized: (contentType) => /application\\/json/g.test(contentType),\n component: (response) => ShowJSON(response),\n },\n {\n label: 'html',\n isRecognized: (contentType) => /text\\/html/g.test(contentType),\n component: (response) => ShowHTML(response),\n },\n {\n label: 'csv',\n isRecognized: (contentType) => /text\\/csv/g.test(contentType),\n component: (response) => ShowCSV(response),\n },\n {\n label: 'md',\n isRecognized: (contentType) => /text\\/markdown/g.test(contentType),\n component: (response) => ShowMD(response),\n },\n // SVG would normally be considered a \"string\" because of the xml tag, so it must be checked before text\n {\n label: 'img',\n isRecognized: (contentType) =>\n /image\\/(png|jpg|jpeg|svg\\+xml)/.test(contentType),\n component: (response) => ShowImage(response),\n },\n {\n // render task: 9d52f842b2c3f474970123302b2fa7e0\n label: 'pdf',\n isRecognized: (contentType) => /application\\/pdf/g.test(contentType),\n component: (response) => ShowPDF(response),\n },\n {\n label: 'sql',\n isRecognized: (contentType) => /application\\/sql/g.test(contentType),\n component: (response) => ShowSQL(response),\n },\n {\n label: 'text',\n isRecognized: (contentType) =>\n responseMode(contentType) === ResponseMode.string ||\n contentType === 'text',\n component: (response) => ShowText(response),\n },\n {\n label: 'unknown',\n isRecognized: (contentType: string) => !!contentType,\n component: (response) => ShowUnknown(response),\n },\n]\n\n/** find the response handler or return the default */\nexport const pickResponseHandler = (response: IRawResponse) => {\n let result = responseHandlers[responseHandlers.length - 1]\n for (const handler of responseHandlers) {\n if (handler.isRecognized(response.contentType)) {\n result = handler\n break\n }\n }\n return result\n}\n\nexport const fallbackResponseHandler = (): Responder => ({\n label: 'unknown',\n isRecognized: (contentType: string) => !!contentType,\n component: (response) => ShowRaw(response),\n})\n"],"mappings":";;;;;;AA0BA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAA0D,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAA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A,mBAAA;AAEM,IAAMG,uBAAuB,GAAGA,CAAA,MAAkB;EACvDT,KAAK,EAAE,SAAS;EAChBC,YAAY,EAAGlB,WAAmB,IAAK,CAAC,CAACA,WAAW;EACpDmB,SAAS,EAAGlD,QAAQ,IAAK0C,OAAO,CAAC1C,QAAQ;AAC3C,CAAC,CAAC;AAAAlC,OAAA,CAAA2F,uBAAA,GAAAA,uBAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.js","names":["RunItHeading","styled","Heading","attrs","mb","pt","DarkSpan","Span","color"],"sources":["../../../../src/components/common/common.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport styled from 'styled-components'\nimport { Heading, Span } from '@looker/components'\nimport type { HeadingProps } from '@looker/components'\n\n/**\n * Common styled components to be used across the whole library\n */\n\nexport const RunItHeading = styled(Heading).attrs(\n ({ mb = 'xsmall', pt = 'xsmall' }: HeadingProps) => ({ mb, pt })\n)``\n\nexport const DarkSpan = styled(Span).attrs(({ color = 'text3' }) => ({\n color,\n}))``\n"],"mappings":";;;;;;AAyBA;AACA;AAAkD;AAO3C,
|
1
|
+
{"version":3,"file":"common.js","names":["_styledComponents","_interopRequireDefault","require","_components","obj","__esModule","default","RunItHeading","styled","Heading","attrs","_ref","mb","pt","withConfig","displayName","componentId","exports","DarkSpan","Span","_ref2","color"],"sources":["../../../../src/components/common/common.tsx"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport styled from 'styled-components'\nimport { Heading, Span } from '@looker/components'\nimport type { HeadingProps } from '@looker/components'\n\n/**\n * Common styled components to be used across the whole library\n */\n\nexport const RunItHeading = styled(Heading).attrs(\n ({ mb = 'xsmall', pt = 'xsmall' }: HeadingProps) => ({ mb, pt })\n)``\n\nexport const DarkSpan = styled(Span).attrs(({ color = 'text3' }) => ({\n color,\n}))``\n"],"mappings":";;;;;;AAyBA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAkD,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAO3C,IAAMG,YAAY,GAAG,IAAAC,yBAAM,EAACC,mBAAO,CAAC,CAACC,KAAK,CAC/CC,IAAA;EAAA,IAAC;IAAEC,EAAE,GAAG,QAAQ;IAAEC,EAAE,GAAG;EAAuB,CAAC,GAAAF,IAAA;EAAA,OAAM;IAAEC,EAAE;IAAEC;EAAG,CAAC;AAAA,CAAC,CACjE,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,QAAE;AAAAC,OAAA,CAAAV,YAAA,GAAAA,YAAA;AAEI,IAAMW,QAAQ,GAAG,IAAAV,yBAAM,EAACW,gBAAI,CAAC,CAACT,KAAK,CAACU,KAAA;EAAA,IAAC;IAAEC,KAAK,GAAG;EAAQ,CAAC,GAAAD,KAAA;EAAA,OAAM;IACnEC;EACF,CAAC;AAAA,CAAC,CAAC,CAAAP,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,QAAE;AAAAC,OAAA,CAAAC,QAAA,GAAAA,QAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/common/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { DarkSpan, RunItHeading } from './common'\n"],"mappings":";;;;;;;;;;;;;;;;;AAyBA"}
|
1
|
+
{"version":3,"file":"index.js","names":["_common","require"],"sources":["../../../../src/components/common/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport { DarkSpan, RunItHeading } from './common'\n"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,IAAAA,OAAA,GAAAC,OAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './common'\nexport * from './Collapser'\nexport * from './ConfigForm'\nexport * from './CopyLinkWrapper'\nexport * from './DocSdkCalls'\nexport * from './DataGrid'\nexport * from './LoginForm'\nexport * from './Loading'\nexport * from './MethodBadge'\nexport * from './PerfTracker'\nexport * from './RequestForm'\nexport * from './ResponseExplorer'\nexport * from './ShowResponse'\n"],"mappings":";;;;;AA0BA;
|
1
|
+
{"version":3,"file":"index.js","names":["_common","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_Collapser","_ConfigForm","_CopyLinkWrapper","_DocSdkCalls","_DataGrid","_LoginForm","_Loading","_MethodBadge","_PerfTracker","_RequestForm","_ResponseExplorer","_ShowResponse"],"sources":["../../../src/components/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './common'\nexport * from './Collapser'\nexport * from './ConfigForm'\nexport * from './CopyLinkWrapper'\nexport * from './DocSdkCalls'\nexport * from './DataGrid'\nexport * from './LoginForm'\nexport * from './Loading'\nexport * from './MethodBadge'\nexport * from './PerfTracker'\nexport * from './RequestForm'\nexport * from './ResponseExplorer'\nexport * from './ShowResponse'\n"],"mappings":";;;;;AA0BA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,UAAA,GAAAT,OAA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,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAe,iBAAA,CAAAf,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAW,iBAAA,CAAAf,GAAA;IAAA;EAAA;AAAA;AACA,IAAAgB,aAAA,GAAApB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAkB,aAAA,EAAAjB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAgB,aAAA,CAAAhB,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAY,aAAA,CAAAhB,GAAA;IAAA;EAAA;AAAA"}
|
package/lib/esm/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './RunIt'\nexport * from './RunItProvider'\nexport * from './utils'\nexport * from './components'\n"],"mappings":";;;;;AA0BA;
|
1
|
+
{"version":3,"file":"index.js","names":["_RunIt","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_RunItProvider","_utils","_components"],"sources":["../../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './RunIt'\nexport * from './RunItProvider'\nexport * from './utils'\nexport * from './components'\n"],"mappings":";;;;;AA0BA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAA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AG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAG,WAAA,CAAAP,GAAA;IAAA;EAAA;AAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/test-data/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport {\n testImageResponse,\n testJsonResponse,\n testSqlResponse,\n testTextResponse,\n testHtmlResponse,\n testUnknownResponse,\n testErrorResponse,\n testBogusJsonResponse,\n testOneRowComplexJson,\n} from './responses'\nexport { api } from './specs'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AAWA"}
|
1
|
+
{"version":3,"file":"index.js","names":["_responses","require","_specs"],"sources":["../../../src/test-data/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport {\n testImageResponse,\n testJsonResponse,\n testSqlResponse,\n testTextResponse,\n testHtmlResponse,\n testUnknownResponse,\n testErrorResponse,\n testBogusJsonResponse,\n testOneRowComplexJson,\n} from './responses'\nexport { api } from './specs'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAAA,UAAA,GAAAC,OAAA;AAWA,IAAAC,MAAA,GAAAD,OAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"responses.js","names":["testJsonResponse","method","url","headers","contentType","ok","statusCode","statusMessage","body","Buffer","from","requestStarted","responseCompleted","testOneRowComplexJson","testTextResponse","testHtmlResponse","testSqlResponse","testImageResponse","testUnknownResponse","testErrorResponse","testBogusJsonResponse"],"sources":["../../../src/test-data/responses.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IRawResponse } from '@looker/sdk-rtl'\n\nexport const testJsonResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: { 'content-type': 'application/json' },\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('[{\"key1\": \"value1\" }]'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testOneRowComplexJson: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: { 'content-type': 'application/json' },\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(`{\n \"id\": 520,\n \"view\": \"orders\",\n \"fields\": [\n \"orders.id\",\n \"users.age\",\n \"users.city\"\n ],\n \"pivots\": [],\n \"fill_fields\": [],\n \"filters\": null,\n \"filter_expression\": \"\",\n \"sorts\": [],\n \"limit\": \"\",\n \"column_limit\": \"\",\n \"total\": null,\n \"row_total\": \"\",\n \"subtotals\": [],\n \"vis_config\": null,\n \"filter_config\": null,\n \"visible_ui_sections\": \"\",\n \"slug\": \"64zJjJw\",\n \"client_id\": \"zfn3SwIaaHbJTbsXSJ0JO7\",\n \"share_url\": \"https://localhost:9999/x/zfn3SwIaaHbJTbsXSJ0JO7\",\n \"expanded_share_url\": \"https://localhost:9999/explore/thelook/orders?fields=orders.id,users.age,users.city&origin=share-expanded\",\n \"url\": \"/explore/thelook/orders?fields=orders.id,users.age,users.city\",\n \"has_table_calculations\": false,\n \"model\": \"thelook\",\n \"dynamic_fields\": \"\",\n \"query_timezone\": \"\",\n \"quick_calcs\": null,\n \"analysis_config\": null,\n \"can\": {\n \"run\": true,\n \"see_results\": true,\n \"explore\": true,\n \"create\": true,\n \"show\": true,\n \"cost_estimate\": true,\n \"index\": true,\n \"see_lookml\": true,\n \"see_aggregate_table_lookml\": true,\n \"see_derived_table_lookml\": true,\n \"see_sql\": true,\n \"save\": true,\n \"generate_drill_links\": true,\n \"download\": true,\n \"download_unlimited\": true,\n \"use_custom_fields\": true,\n \"schedule\": true\n }\n}`),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testTextResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/text/data',\n headers: { 'content-type': 'text/plain;charset=utf-8' },\n contentType: 'text/plain;charset=utf-8',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some text data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testHtmlResponse: IRawResponse = {\n method: 'GET',\n url: `https://some/html`,\n headers: { 'content-type': 'text/html;charset=utf-8' },\n contentType: 'text/html;charset=utf-8',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(\n '<table>\\n' +\n '<tr><th>Orders Created Date</th><th>Orders Count</th></tr>\\n' +\n '<tr><td>2019-12-22</td><td>39</td></tr>\\n' +\n '</table>'\n ),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testSqlResponse: IRawResponse = {\n method: 'GET',\n url: `https://some/sql`,\n headers: { 'content-type': 'application/sql' },\n contentType: 'application/sql',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(`SELECT\n COUNT(DISTINCT products.id ) AS \\`products.count\\`\nFROM demo_db.inventory_items AS inventory_items\nLEFT JOIN demo_db.products AS products ON inventory_items.product_id = products.id\nLIMIT 500`),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testImageResponse = (contentType = 'image/png'): IRawResponse => ({\n method: 'GET',\n url: `http://${contentType}`,\n headers: { 'content-type': contentType },\n contentType,\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some image data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n})\n\nexport const testUnknownResponse: IRawResponse = {\n method: 'GET',\n url: 'http://bogus',\n headers: {},\n contentType: 'bogus',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testErrorResponse: IRawResponse = {\n method: 'GET',\n url: 'http://error',\n headers: {},\n body: Buffer.from(\n '{\"message\": \"Not found\", \"documentation_url\": \"http://docs.looker.com\"}'\n ),\n contentType: 'text',\n ok: false,\n statusCode: 404,\n statusMessage: 'some status message',\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testBogusJsonResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: {},\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('<html><body>I AM A LYING JSON RESPONSE</body></html>'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n"],"mappings":";;;;;;AA4BO,IAAMA,gBAA8B,GAAG;EAC5CC,MAAM,EAAE,KAAK;EACbC,GAAG,EAAE,wBAAwB;EAC7BC,OAAO,EAAE;IAAE,cAAc,EAAE;EAAmB,CAAC;EAC/CC,WAAW,EAAE,kBAAkB;EAC/BC,EAAE,EAAE,IAAI;EACRC,UAAU,EAAE,GAAG;EACfC,aAAa,EAAE,IAAI;EACnBC,IAAI,EAAEC,MAAM,CAACC,IAAI,CAAC,uBAAuB,CAAC;EAC1CC,cAAc,EAAE,IAAI;EACpBC,iBAAiB,EAAE;AACrB,CAAC;
|
1
|
+
{"version":3,"file":"responses.js","names":["testJsonResponse","method","url","headers","contentType","ok","statusCode","statusMessage","body","Buffer","from","requestStarted","responseCompleted","exports","testOneRowComplexJson","testTextResponse","testHtmlResponse","testSqlResponse","testImageResponse","arguments","length","undefined","concat","testUnknownResponse","testErrorResponse","testBogusJsonResponse"],"sources":["../../../src/test-data/responses.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IRawResponse } from '@looker/sdk-rtl'\n\nexport const testJsonResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: { 'content-type': 'application/json' },\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('[{\"key1\": \"value1\" }]'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testOneRowComplexJson: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: { 'content-type': 'application/json' },\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(`{\n \"id\": 520,\n \"view\": \"orders\",\n \"fields\": [\n \"orders.id\",\n \"users.age\",\n \"users.city\"\n ],\n \"pivots\": [],\n \"fill_fields\": [],\n \"filters\": null,\n \"filter_expression\": \"\",\n \"sorts\": [],\n \"limit\": \"\",\n \"column_limit\": \"\",\n \"total\": null,\n \"row_total\": \"\",\n \"subtotals\": [],\n \"vis_config\": null,\n \"filter_config\": null,\n \"visible_ui_sections\": \"\",\n \"slug\": \"64zJjJw\",\n \"client_id\": \"zfn3SwIaaHbJTbsXSJ0JO7\",\n \"share_url\": \"https://localhost:9999/x/zfn3SwIaaHbJTbsXSJ0JO7\",\n \"expanded_share_url\": \"https://localhost:9999/explore/thelook/orders?fields=orders.id,users.age,users.city&origin=share-expanded\",\n \"url\": \"/explore/thelook/orders?fields=orders.id,users.age,users.city\",\n \"has_table_calculations\": false,\n \"model\": \"thelook\",\n \"dynamic_fields\": \"\",\n \"query_timezone\": \"\",\n \"quick_calcs\": null,\n \"analysis_config\": null,\n \"can\": {\n \"run\": true,\n \"see_results\": true,\n \"explore\": true,\n \"create\": true,\n \"show\": true,\n \"cost_estimate\": true,\n \"index\": true,\n \"see_lookml\": true,\n \"see_aggregate_table_lookml\": true,\n \"see_derived_table_lookml\": true,\n \"see_sql\": true,\n \"save\": true,\n \"generate_drill_links\": true,\n \"download\": true,\n \"download_unlimited\": true,\n \"use_custom_fields\": true,\n \"schedule\": true\n }\n}`),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testTextResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/text/data',\n headers: { 'content-type': 'text/plain;charset=utf-8' },\n contentType: 'text/plain;charset=utf-8',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some text data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testHtmlResponse: IRawResponse = {\n method: 'GET',\n url: `https://some/html`,\n headers: { 'content-type': 'text/html;charset=utf-8' },\n contentType: 'text/html;charset=utf-8',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(\n '<table>\\n' +\n '<tr><th>Orders Created Date</th><th>Orders Count</th></tr>\\n' +\n '<tr><td>2019-12-22</td><td>39</td></tr>\\n' +\n '</table>'\n ),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testSqlResponse: IRawResponse = {\n method: 'GET',\n url: `https://some/sql`,\n headers: { 'content-type': 'application/sql' },\n contentType: 'application/sql',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(`SELECT\n COUNT(DISTINCT products.id ) AS \\`products.count\\`\nFROM demo_db.inventory_items AS inventory_items\nLEFT JOIN demo_db.products AS products ON inventory_items.product_id = products.id\nLIMIT 500`),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testImageResponse = (contentType = 'image/png'): IRawResponse => ({\n method: 'GET',\n url: `http://${contentType}`,\n headers: { 'content-type': contentType },\n contentType,\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some image data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n})\n\nexport const testUnknownResponse: IRawResponse = {\n method: 'GET',\n url: 'http://bogus',\n headers: {},\n contentType: 'bogus',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testErrorResponse: IRawResponse = {\n method: 'GET',\n url: 'http://error',\n headers: {},\n body: Buffer.from(\n '{\"message\": \"Not found\", \"documentation_url\": \"http://docs.looker.com\"}'\n ),\n contentType: 'text',\n ok: false,\n statusCode: 404,\n statusMessage: 'some status message',\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testBogusJsonResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: {},\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('<html><body>I AM A LYING JSON RESPONSE</body></html>'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n"],"mappings":";;;;;;AA4BO,IAAMA,gBAA8B,GAAG;EAC5CC,MAAM,EAAE,KAAK;EACbC,GAAG,EAAE,wBAAwB;EAC7BC,OAAO,EAAE;IAAE,cAAc,EAAE;EAAmB,CAAC;EAC/CC,WAAW,EAAE,kBAAkB;EAC/BC,EAAE,EAAE,IAAI;EACRC,UAAU,EAAE,GAAG;EACfC,aAAa,EAAE,IAAI;EACnBC,IAAI,EAAEC,MAAM,CAACC,IAAI,CAAC,uBAAuB,CAAC;EAC1CC,cAAc,EAAE,IAAI;EACpBC,iBAAiB,EAAE;AACrB,CAAC;AAAAC,OAAA,CAAAb,gBAAA,GAAAA,gBAAA;AAEM,IAAMc,qBAAmC,GAAG;EACjDb,MAAM,EAAE,KAAK;EACbC,GAAG,EAAE,wBAAwB;EAC7BC,OAAO,EAAE;IAAE,cAAc,EAAE;EAAmB,CAAC;EAC/CC,WAAW,EAAE,kBAAkB;EAC/BC,EAAE,EAAE,IAAI;EACRC,UAAU,EAAE,GAAG;EACfC,aAAa,EAAE,IAAI;EACnBC,IAAI,EAAEC,MAAM,CAACC,IAAI,48CAmDhB;EACDC,cAAc,EAAE,IAAI;EACpBC,iBAAiB,EAAE;AACrB,CAAC;AAAAC,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAEM,IAAMC,gBAA8B,GAAG;EAC5Cd,MAAM,EAAE,KAAK;EACbC,GAAG,EAAE,wBAAwB;EAC7BC,OAAO,EAAE;IAAE,cAAc,EAAE;EAA2B,CAAC;EACvDC,WAAW,EAAE,0BAA0B;EACvCC,EAAE,EAAE,IAAI;EACRC,UAAU,EAAE,GAAG;EACfC,aAAa,EAAE,IAAI;EACnBC,IAAI,EAAEC,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AI,CAAC,sDAAsD,CAAC;EACzEC,cAAc,EAAE,IAAI;EACpBC,iBAAiB,EAAE;AACrB,CAAC;AAAAC,OAAA,CAAAY,qBAAA,GAAAA,qBAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"specs.js","names":["
|
1
|
+
{"version":3,"file":"specs.js","names":["_sdkCodegen","require","spec","api","ApiModel","fromJson","exports"],"sources":["../../../src/test-data/specs.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport { ApiModel } from '@looker/sdk-codegen'\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst spec = require('../../../../spec/Looker.3.1.oas.json')\n\nexport const api = ApiModel.fromJson(spec)\n"],"mappings":";;;;;;AAyBA,IAAAA,WAAA,GAAAC,OAAA;AAGA,IAAMC,IAAI,GAAGD,OAAO,CAAC,sCAAsC,CAAC;AAErD,IAAME,GAAG,GAAGC,oBAAQ,CAACC,QAAQ,CAACH,IAAI,CAAC;AAAAI,OAAA,CAAAH,GAAA,GAAAA,GAAA"}
|
@@ -26,9 +26,9 @@ var initRunItSdk = () => {
|
|
26
26
|
return sdk;
|
27
27
|
};
|
28
28
|
exports.initRunItSdk = initRunItSdk;
|
29
|
-
var StoreConstants
|
30
|
-
exports.StoreConstants = StoreConstants;
|
31
|
-
(function (StoreConstants) {
|
29
|
+
var StoreConstants = function (StoreConstants) {
|
32
30
|
StoreConstants["LOCALSTORAGE_SETTINGS_KEY"] = "settings";
|
33
|
-
|
31
|
+
return StoreConstants;
|
32
|
+
}({});
|
33
|
+
exports.StoreConstants = StoreConstants;
|
34
34
|
//# sourceMappingURL=RunItSDK.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RunItSDK.js","names":["initRunItSdk","settings","DefaultSettings","base_url","agentTag","options","OAuthConfigProvider","RunItConfigKey","transport","BrowserTransport","session","BrowserSession","sdk","functionalSdk40","trackPerformance","StoreConstants"],"sources":["../../../src/utils/RunItSDK.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IApiSettings } from '@looker/sdk-rtl'\nimport {\n BrowserSession,\n BrowserTransport,\n DefaultSettings,\n} from '@looker/sdk-rtl'\nimport { functionalSdk40 } from '@looker/sdk'\nimport { OAuthConfigProvider } from '@looker/extension-utils'\n\nimport { RunItConfigKey } from '../components'\n\nexport const initRunItSdk = () => {\n const settings = {\n ...DefaultSettings(),\n base_url: 'https://self-signed.looker.com:19999',\n agentTag: 'RunIt 0.8',\n } as IApiSettings\n\n const options = new OAuthConfigProvider(\n settings,\n 'looker.api-explorer',\n RunItConfigKey\n )\n const transport = new BrowserTransport(options)\n const session = new BrowserSession(options, transport)\n const sdk = functionalSdk40(session)\n BrowserTransport.trackPerformance = true\n return sdk\n}\n\nexport enum StoreConstants {\n LOCALSTORAGE_SETTINGS_KEY = 'settings',\n}\n"],"mappings":";;;;;;AA2BA;AAKA;AACA;AAEA;AAA8C;AAAA;AAAA;AAAA;AAAA;AAEvC,
|
1
|
+
{"version":3,"file":"RunItSDK.js","names":["_sdkRtl","require","_sdk","_extensionUtils","_components","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","initRunItSdk","settings","DefaultSettings","base_url","agentTag","options","OAuthConfigProvider","RunItConfigKey","transport","BrowserTransport","session","BrowserSession","sdk","functionalSdk40","trackPerformance","exports","StoreConstants"],"sources":["../../../src/utils/RunItSDK.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IApiSettings } from '@looker/sdk-rtl'\nimport {\n BrowserSession,\n BrowserTransport,\n DefaultSettings,\n} from '@looker/sdk-rtl'\nimport { functionalSdk40 } from '@looker/sdk'\nimport { OAuthConfigProvider } from '@looker/extension-utils'\n\nimport { RunItConfigKey } from '../components'\n\nexport const initRunItSdk = () => {\n const settings = {\n ...DefaultSettings(),\n base_url: 'https://self-signed.looker.com:19999',\n agentTag: 'RunIt 0.8',\n } as IApiSettings\n\n const options = new OAuthConfigProvider(\n settings,\n 'looker.api-explorer',\n RunItConfigKey\n )\n const transport = new BrowserTransport(options)\n const session = new BrowserSession(options, transport)\n const sdk = functionalSdk40(session)\n BrowserTransport.trackPerformance = true\n return sdk\n}\n\nexport enum StoreConstants {\n LOCALSTORAGE_SETTINGS_KEY = 'settings',\n}\n"],"mappings":";;;;;;AA2BA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAA8C,SAAAI,QAAAC,M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":["../../../src/utils/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './RunItSDK'\nexport * from './requestUtils'\n"],"mappings":";;;;;AAyBA;
|
1
|
+
{"version":3,"file":"index.js","names":["_RunItSDK","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_requestUtils"],"sources":["../../../src/utils/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './RunItSDK'\nexport * from './requestUtils'\n"],"mappings":";;;;;AAyBA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,aAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,aAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,aAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,aAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"requestUtils.js","names":["runItNoSet","value","macro","path","vars","replace","_","b","pathify","pathParams","result","includes","prepareInputs","inputs","requestContent","cloneDeep","input","name","location","parsed","JSON","parse","type","e","formValues","adaptor","getEnvAdaptor","formValue","localStorageGetItem","RunItFormKey","localStorageRemoveItem","initRequestContent","content","isEmpty","createRequestParams","keepBody","queryParams","prepped","trimmed","trimInputs","body","Error","runRequest","sdk","basePath","httpMethod","endpoint","authSession","isAuthenticated","ok","login","url","requestStarted","Date","now","raw","transport","rawRequest","props","authenticate","responseCompleted","getTypeDefault","createSampleBody","spec","getSampleValue","IntrinsicType","DelimArrayType","elementType","EnumType","ArrayType","customType","recurse","types","HashType","sampleBody","prop","writeable","sampleValue","undefined","editType","createInputs","method","allParams","map","param","required","description"],"sources":["../../../src/utils/requestUtils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IAPIMethods, IRawResponse } from '@looker/sdk-rtl'\nimport cloneDeep from 'lodash/cloneDeep'\nimport isEmpty from 'lodash/isEmpty'\nimport type { IApiModel, IMethod, IType } from '@looker/sdk-codegen'\nimport {\n ArrayType,\n DelimArrayType,\n EnumType,\n HashType,\n IntrinsicType,\n trimInputs,\n} from '@looker/sdk-codegen'\nimport { getEnvAdaptor } from '@looker/extension-utils'\n\nimport type { RunItHttpMethod, RunItInput, RunItValues } from '../RunIt'\nimport { RunItFormKey } from '../components'\n\n/** Hook to set a URL somewhere else in APIX */\nexport type RunItSetter = (value: any) => any\n\n/**\n * A \"no-op\" function\n * @param value passed through\n */\nexport const runItNoSet: RunItSetter = (value: any) => value\n\n/**\n * Replaces {foo} with vars[foo] in provided path\n * @param path with templatized param names\n * @param vars Collection of path params\n * @returns Path with param names replaced with values\n */\nconst macro = (path: string, vars: RunItValues) =>\n path.replace(/{(\\w+)}/g, (_, b) => vars[b])\n\n/**\n * Construct a full request path including path params\n * @param path A request path with path params in curly braces e.g. /queries/{query_id}/run/{result_format}\n * @param pathParams Collection of path params\n * @returns a full request path\n */\nexport const pathify = (path: string, pathParams?: RunItValues): string => {\n let result = path\n if (pathParams && path.includes('{')) {\n result = macro(path, pathParams)\n }\n return result\n}\n\n/**\n * Prepares the inputs for use with the SDK and other RunIt components\n * @param inputs An array describing RunIt form inputs\n * @param requestContent Current request parameters\n */\nexport const prepareInputs = (\n inputs: RunItInput[],\n requestContent: RunItValues\n) => {\n const result = cloneDeep(requestContent)\n for (const input of inputs) {\n const name = input.name\n if (input.location === 'body') {\n try {\n let parsed\n if (name in requestContent) {\n const value = requestContent[name]\n /** The value is not a string when the user has not interacted with this param and prepareInputs has been\n * called (e.g. if user navigates to the Code tab).\n */\n parsed = typeof value === 'string' ? JSON.parse(value) : value\n } else {\n /** This scenario occurs when RunIt is about to be mounted for a new method */\n parsed = input.type\n }\n result[name] = parsed\n } catch (e) {\n /** Treat as x-www-form-urlencoded */\n result[name] = requestContent[name]\n }\n }\n }\n return result\n}\n\n/**\n * Load and clear any saved form values from the session\n * @param configurator storage service\n */\nexport const formValues = async () => {\n const adaptor = getEnvAdaptor()\n const formValue = await adaptor.localStorageGetItem(RunItFormKey)\n const result = formValue ? JSON.parse(formValue) : {}\n adaptor.localStorageRemoveItem(RunItFormKey)\n return result\n}\n\n/**\n * Initializes the request content object from local storage or input definitions, in that order\n * @param configurator storage service\n * @param inputs\n * @param requestContent the current request content\n */\nexport const initRequestContent = (\n inputs: RunItInput[],\n requestContent = {}\n) => {\n // TODO: Temporarily disabling request form state persistence until RunIt is using redux\n // let content = await formValues()\n let content = {}\n if (isEmpty(content)) {\n content = prepareInputs(inputs, requestContent)\n }\n return content\n}\n\n/**\n * Takes all form input values and categorizes them based on their request location\n * @param inputs RunIt form inputs\n * @param requestContent Form input values\n * @param keepBody true to keep body as is. false trims body values (default)\n * @returns path, query and body param objects\n */\nexport const createRequestParams = (\n inputs: RunItInput[],\n requestContent: RunItValues,\n keepBody = false\n) => {\n const pathParams = {}\n const queryParams = {}\n const prepped = prepareInputs(inputs, requestContent)\n const trimmed = trimInputs(prepped, keepBody)\n let body\n for (const input of inputs) {\n const name = input.name\n switch (input.location) {\n case 'path':\n pathParams[name] = trimmed[name]\n break\n case 'query':\n queryParams[name] = trimmed[name]\n break\n case 'body':\n body = trimmed[name]\n break\n default:\n throw new Error(`Invalid input location: '${input.location}'`)\n }\n }\n return [pathParams, queryParams, body]\n}\n\n/**\n * Makes an http request using the SDK browser transport rawRequest method\n * @param sdk functional SDK that supports rawRequest via its transport\n * @param basePath base path for the URL. For standalone this includes the specKey. Empty for extension.\n * @param httpMethod Request operation\n * @param endpoint Request path with path params in curly braces e.g. /queries/{query_id}/run/{result_format}\n * @param pathParams Collection of path params\n * @param queryParams Collection of query params\n * @param body Collection of body params\n */\nexport const runRequest = async (\n sdk: IAPIMethods,\n basePath: string,\n httpMethod: RunItHttpMethod,\n endpoint: string,\n pathParams: RunItValues,\n queryParams: RunItValues,\n body: any\n): Promise<IRawResponse> => {\n if (!sdk.authSession.isAuthenticated()) {\n await sdk.ok(sdk.authSession.login())\n }\n const url = `${basePath}${pathify(endpoint, pathParams)}`\n const requestStarted = Date.now()\n const raw = await sdk.authSession.transport.rawRequest(\n httpMethod,\n url,\n queryParams,\n body,\n (props) => sdk.authSession.authenticate(props)\n )\n const responseCompleted = Date.now()\n // populate timing info if it's not already provided by the transport\n if (!raw.requestStarted) raw.requestStarted = requestStarted\n if (!raw.responseCompleted) raw.responseCompleted = responseCompleted\n return raw\n}\n\n/**\n * Return a default value for a given type name\n * @param type A type name\n */\nconst getTypeDefault = (type: string) => {\n // TODO: use potential equivalent from sdk-codegen, confirm formats\n switch (type) {\n case 'boolean':\n return false\n case 'int64':\n case 'integer':\n return 0\n case 'float':\n case 'double':\n return 0.0\n case 'hostname':\n case 'ipv4':\n case 'ipv6':\n case 'uuid':\n case 'uri':\n case 'string':\n case 'email':\n return ''\n case 'string[]':\n return []\n case 'object':\n return {}\n case 'datetime':\n return ''\n default:\n return ''\n }\n}\n\n/**\n * Given a type object reduce it to its writeable intrinsic and/or custom type properties and their default values\n * @param spec Api spec\n * @param type A type object\n */\nconst createSampleBody = (spec: IApiModel, type: IType) => {\n /* eslint-disable @typescript-eslint/no-use-before-define */\n const getSampleValue = (type: IType) => {\n if (type instanceof IntrinsicType) return getTypeDefault(type.name)\n if (type instanceof DelimArrayType)\n return getTypeDefault(type.elementType.name)\n if (type instanceof EnumType) return ''\n if (type instanceof ArrayType)\n return type.customType\n ? [recurse(spec.types[type.customType])]\n : getTypeDefault(type.name)\n if (type instanceof HashType)\n return type.customType ? recurse(spec.types[type.customType]) : {}\n\n return recurse(type)\n }\n /* eslint-enable @typescript-eslint/no-use-before-define */\n\n const recurse = (type: IType) => {\n const sampleBody: RunItValues = {}\n for (const prop of type.writeable) {\n const sampleValue = getSampleValue(prop.type)\n if (sampleValue !== undefined) {\n sampleBody[prop.name] = sampleValue\n }\n }\n return sampleBody\n }\n return recurse(type)\n}\n\n/**\n * Convert model type to an editable type\n * @param spec API model for building input editor\n * @param type to convert\n */\nconst editType = (spec: IApiModel, type: IType) => {\n if (type instanceof IntrinsicType) return type.name\n // TODO create a DelimArray editing component as part of the complex type editor\n if (type instanceof DelimArrayType) return 'string'\n return createSampleBody(spec, type)\n}\n\n/**\n * Given an SDK method create and return an array of inputs for the run-it form\n * @param spec Api spec\n * @param method A method object\n */\nexport const createInputs = (spec: IApiModel, method: IMethod): RunItInput[] =>\n method.allParams.map((param) => ({\n name: param.name,\n location: param.location,\n type: editType(spec, param.type),\n required: param.required,\n description: param.description,\n }))\n"],"mappings":";;;;;;AA2BA;AACA;AAEA;AAQA;AAGA;AAA4C;AAAA;AAAA;AASrC,IAAMA,UAAuB,GAAIC,KAAU,IAAKA,KAAK;AAAA;AAQ5D,IAAMC,KAAK,GAAG,CAACC,IAAY,EAAEC,IAAiB,KAC5CD,IAAI,CAACE,OAAO,CAAC,UAAU,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAKH,IAAI,CAACG,CAAC,CAAC,CAAC;AAQtC,IAAMC,OAAO,GAAG,CAACL,IAAY,EAAEM,UAAwB,KAAa;EACzE,IAAIC,MAAM,GAAGP,IAAI;EACjB,IAAIM,UAAU,IAAIN,IAAI,CAACQ,QAAQ,CAAC,GAAG,CAAC,EAAE;IACpCD,MAAM,GAAGR,KAAK,CAACC,IAAI,EAAEM,UAAU,CAAC;EAClC;EACA,OAAOC,MAAM;AACf,CAAC;AAAA;AAOM,IAAME,aAAa,GAAG,CAC3BC,MAAoB,EACpBC,cAA2B,KACxB;EACH,IAAMJ,MAAM,GAAG,IAAAK,kBAAS,EAACD,cAAc,CAAC;EACxC,KAAK,IAAME,KAAK,IAAIH,MAAM,EAAE;IAC1B,IAAMI,IAAI,GAAGD,KAAK,CAACC,IAAI;IACvB,IAAID,KAAK,CAACE,QAAQ,KAAK,MAAM,EAAE;MAC7B,IAAI;QACF,IAAIC,MAAM;QACV,IAAIF,IAAI,IAAIH,cAAc,EAAE;UAC1B,IAAMb,MAAK,GAAGa,cAAc,CAACG,IAAI,CAAC;UAIlCE,MAAM,GAAG,OAAOlB,MAAK,KAAK,QAAQ,GAAGmB,IAAI,CAACC,KAAK,CAACpB,MAAK,CAA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EAAED,KAAK,CAACC,QAAQ;EACxBC,WAAW,EAAEF,KAAK,CAACE;AACrB,CAAC,CAAC,CAAC;AAAA"}
|
1
|
+
{"version":3,"file":"requestUtils.js","names":["_cloneDeep","_interopRequireDefault","require","_isEmpty","_sdkCodegen","_extensionUtils","_components","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","runItNoSet","exports","macro","path","vars","replace","_","b","pathify","pathParams","result","includes","prepareInputs","inputs","requestContent","cloneDeep","input","name","location","parsed","JSON","parse","type","e","formValues","_ref","adaptor","getEnvAdaptor","formValue","localStorageGetItem","RunItFormKey","localStorageRemoveItem","initRequestContent","length","content","isEmpty","createRequestParams","keepBody","queryParams","prepped","trimmed","trimInputs","body","Error","concat","runRequest","_ref2","sdk","basePath","httpMethod","endpoint","authSession","isAuthenticated","ok","login","url","requestStarted","Date","now","raw","transport","rawRequest","props","authenticate","responseCompleted","_x","_x2","_x3","_x4","_x5","_x6","_x7","getTypeDefault","createSampleBody","spec","getSampleValue","IntrinsicType","DelimArrayType","elementType","EnumType","ArrayType","customType","recurse","types","HashType","sampleBody","prop","writeable","sampleValue","editType","createInputs","method","allParams","map","param","required","description"],"sources":["../../../src/utils/requestUtils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IAPIMethods, IRawResponse } from '@looker/sdk-rtl'\nimport cloneDeep from 'lodash/cloneDeep'\nimport isEmpty from 'lodash/isEmpty'\nimport type { IApiModel, IMethod, IType } from '@looker/sdk-codegen'\nimport {\n ArrayType,\n DelimArrayType,\n EnumType,\n HashType,\n IntrinsicType,\n trimInputs,\n} from '@looker/sdk-codegen'\nimport { getEnvAdaptor } from '@looker/extension-utils'\n\nimport type { RunItHttpMethod, RunItInput, RunItValues } from '../RunIt'\nimport { RunItFormKey } from '../components'\n\n/** Hook to set a URL somewhere else in APIX */\nexport type RunItSetter = (value: any) => any\n\n/**\n * A \"no-op\" function\n * @param value passed through\n */\nexport const runItNoSet: RunItSetter = (value: any) => value\n\n/**\n * Replaces {foo} with vars[foo] in provided path\n * @param path with templatized param names\n * @param vars Collection of path params\n * @returns Path with param names replaced with values\n */\nconst macro = (path: string, vars: RunItValues) =>\n path.replace(/{(\\w+)}/g, (_, b) => vars[b])\n\n/**\n * Construct a full request path including path params\n * @param path A request path with path params in curly braces e.g. /queries/{query_id}/run/{result_format}\n * @param pathParams Collection of path params\n * @returns a full request path\n */\nexport const pathify = (path: string, pathParams?: RunItValues): string => {\n let result = path\n if (pathParams && path.includes('{')) {\n result = macro(path, pathParams)\n }\n return result\n}\n\n/**\n * Prepares the inputs for use with the SDK and other RunIt components\n * @param inputs An array describing RunIt form inputs\n * @param requestContent Current request parameters\n */\nexport const prepareInputs = (\n inputs: RunItInput[],\n requestContent: RunItValues\n) => {\n const result = cloneDeep(requestContent)\n for (const input of inputs) {\n const name = input.name\n if (input.location === 'body') {\n try {\n let parsed\n if (name in requestContent) {\n const value = requestContent[name]\n /** The value is not a string when the user has not interacted with this param and prepareInputs has been\n * called (e.g. if user navigates to the Code tab).\n */\n parsed = typeof value === 'string' ? JSON.parse(value) : value\n } else {\n /** This scenario occurs when RunIt is about to be mounted for a new method */\n parsed = input.type\n }\n result[name] = parsed\n } catch (e) {\n /** Treat as x-www-form-urlencoded */\n result[name] = requestContent[name]\n }\n }\n }\n return result\n}\n\n/**\n * Load and clear any saved form values from the session\n * @param configurator storage service\n */\nexport const formValues = async () => {\n const adaptor = getEnvAdaptor()\n const formValue = await adaptor.localStorageGetItem(RunItFormKey)\n const result = formValue ? JSON.parse(formValue) : {}\n adaptor.localStorageRemoveItem(RunItFormKey)\n return result\n}\n\n/**\n * Initializes the request content object from local storage or input definitions, in that order\n * @param configurator storage service\n * @param inputs\n * @param requestContent the current request content\n */\nexport const initRequestContent = (\n inputs: RunItInput[],\n requestContent = {}\n) => {\n // TODO: Temporarily disabling request form state persistence until RunIt is using redux\n // let content = await formValues()\n let content = {}\n if (isEmpty(content)) {\n content = prepareInputs(inputs, requestContent)\n }\n return content\n}\n\n/**\n * Takes all form input values and categorizes them based on their request location\n * @param inputs RunIt form inputs\n * @param requestContent Form input values\n * @param keepBody true to keep body as is. false trims body values (default)\n * @returns path, query and body param objects\n */\nexport const createRequestParams = (\n inputs: RunItInput[],\n requestContent: RunItValues,\n keepBody = false\n) => {\n const pathParams = {}\n const queryParams = {}\n const prepped = prepareInputs(inputs, requestContent)\n const trimmed = trimInputs(prepped, keepBody)\n let body\n for (const input of inputs) {\n const name = input.name\n switch (input.location) {\n case 'path':\n pathParams[name] = trimmed[name]\n break\n case 'query':\n queryParams[name] = trimmed[name]\n break\n case 'body':\n body = trimmed[name]\n break\n default:\n throw new Error(`Invalid input location: '${input.location}'`)\n }\n }\n return [pathParams, queryParams, body]\n}\n\n/**\n * Makes an http request using the SDK browser transport rawRequest method\n * @param sdk functional SDK that supports rawRequest via its transport\n * @param basePath base path for the URL. For standalone this includes the specKey. Empty for extension.\n * @param httpMethod Request operation\n * @param endpoint Request path with path params in curly braces e.g. /queries/{query_id}/run/{result_format}\n * @param pathParams Collection of path params\n * @param queryParams Collection of query params\n * @param body Collection of body params\n */\nexport const runRequest = async (\n sdk: IAPIMethods,\n basePath: string,\n httpMethod: RunItHttpMethod,\n endpoint: string,\n pathParams: RunItValues,\n queryParams: RunItValues,\n body: any\n): Promise<IRawResponse> => {\n if (!sdk.authSession.isAuthenticated()) {\n await sdk.ok(sdk.authSession.login())\n }\n const url = `${basePath}${pathify(endpoint, pathParams)}`\n const requestStarted = Date.now()\n const raw = await sdk.authSession.transport.rawRequest(\n httpMethod,\n url,\n queryParams,\n body,\n (props) => sdk.authSession.authenticate(props)\n )\n const responseCompleted = Date.now()\n // populate timing info if it's not already provided by the transport\n if (!raw.requestStarted) raw.requestStarted = requestStarted\n if (!raw.responseCompleted) raw.responseCompleted = responseCompleted\n return raw\n}\n\n/**\n * Return a default value for a given type name\n * @param type A type name\n */\nconst getTypeDefault = (type: string) => {\n // TODO: use potential equivalent from sdk-codegen, confirm formats\n switch (type) {\n case 'boolean':\n return false\n case 'int64':\n case 'integer':\n return 0\n case 'float':\n case 'double':\n return 0.0\n case 'hostname':\n case 'ipv4':\n case 'ipv6':\n case 'uuid':\n case 'uri':\n case 'string':\n case 'email':\n return ''\n case 'string[]':\n return []\n case 'object':\n return {}\n case 'datetime':\n return ''\n default:\n return ''\n }\n}\n\n/**\n * Given a type object reduce it to its writeable intrinsic and/or custom type properties and their default values\n * @param spec Api spec\n * @param type A type object\n */\nconst createSampleBody = (spec: IApiModel, type: IType) => {\n /* eslint-disable @typescript-eslint/no-use-before-define */\n const getSampleValue = (type: IType) => {\n if (type instanceof IntrinsicType) return getTypeDefault(type.name)\n if (type instanceof DelimArrayType)\n return getTypeDefault(type.elementType.name)\n if (type instanceof EnumType) return ''\n if (type instanceof ArrayType)\n return type.customType\n ? [recurse(spec.types[type.customType])]\n : getTypeDefault(type.name)\n if (type instanceof HashType)\n return type.customType ? recurse(spec.types[type.customType]) : {}\n\n return recurse(type)\n }\n /* eslint-enable @typescript-eslint/no-use-before-define */\n\n const recurse = (type: IType) => {\n const sampleBody: RunItValues = {}\n for (const prop of type.writeable) {\n const sampleValue = getSampleValue(prop.type)\n if (sampleValue !== undefined) {\n sampleBody[prop.name] = sampleValue\n }\n }\n return sampleBody\n }\n return recurse(type)\n}\n\n/**\n * Convert model type to an editable type\n * @param spec API model for building input editor\n * @param type to convert\n */\nconst editType = (spec: IApiModel, type: IType) => {\n if (type instanceof IntrinsicType) return type.name\n // TODO create a DelimArray editing component as part of the complex type editor\n if (type instanceof DelimArrayType) return 'string'\n return createSampleBody(spec, type)\n}\n\n/**\n * Given an SDK method create and return an array of inputs for the run-it form\n * @param spec Api spec\n * @param method A method object\n */\nexport const createInputs = (spec: IApiModel, method: IMethod): RunItInput[] =>\n method.allParams.map((param) => ({\n name: param.name,\n location: param.location,\n type: editType(spec, param.type),\n required: param.required,\n description: param.description,\n }))\n"],"mappings":";;;;;;AA2BA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,eAAA,GAAAH,OAAA;AAGA,IAAAI,WAAA,GAAAJ,OAAA;AAA4C,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,IAAA,GAAAP,GAAA,CAAAK,GAAA,EAAAC,GAAA,OAAAE,KAAA,GAAAD,IAAA,CAAAC,KAAA,WAAAC,KAAA,IAAAP,MAAA,CAAAO,KAAA,iBAAAF,IAAA,CAAAG,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CAAC;EAGD,IAAM4D,OAAO,GAAI5D,IAAW,IAAK;IAC/B,IAAM+D,UAAuB,GAAG,CAAC,CAAC;IAClC,KAAK,IAAMC,IAAI,IAAIhE,IAAI,CAACiE,SAAS,EAAE;MACjC,IAAMC,WAAW,GAAGb,cAAc,CAACW,IAAI,CAAChE,IAAI,CAAC;MAC7C,IAAIkE,WAAW,KAAKzF,SAAS,EAAE;QAC7BsF,UAAU,CAACC,IAAI,CAACrE,IAAI,CAAC,GAAGuE,WAAW;MACrC;IACF;IACA,OAAOH,UAAU;EACnB,CAAC;EACD,OAAOH,OAAO,CAAC5D,IAAI,CAAC;AACtB,CAAC;AAOD,IAAMmE,QAAQ,GAAGA,CAACf,IAAe,EAAEpD,IAAW,KAAK;EACjD,IAAIA,IAAI,YAAYsD,yBAAa,EAAE,OAAOtD,IAAI,CAACL,IAAI;EAEnD,IAAIK,IAAI,YAAYuD,0BAAc,EAAE,OAAO,QAAQ;EACnD,OAAOJ,gBAAgB,CAACC,IAAI,EAAEpD,IAAI,CAAC;AACrC,CAAC;AAOM,IAAMoE,YAAY,GAAGA,CAAChB,IAAe,EAAEiB,MAAe,KAC3DA,MAAM,CAACC,SAAS,CAACC,GAAG,CAAEC,KAAK,KAAM;EAC/B7E,IAAI,EAAE6E,KAAK,CAAC7E,IAAI;EAChBC,QAAQ,EAAE4E,KAAK,CAAC5E,QAAQ;EACxBI,IAAI,EAAEmE,QAAQ,CAACf,IAAI,EAAEoB,KAAK,CAACxE,IAAI,CAAC;EAChCyE,QAAQ,EAAED,KAAK,CAACC,QAAQ;EACxBC,WAAW,EAAEF,KAAK,CAACE;AACrB,CAAC,CAAC,CAAC;AAAA/F,OAAA,CAAAyF,YAAA,GAAAA,YAAA"}
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './RunIt'\nexport * from './RunItProvider'\nexport * from './utils'\nexport * from './components'\n"],"mappings":";;;;;AA0BA;
|
1
|
+
{"version":3,"file":"index.js","names":["_RunIt","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_RunItProvider","_utils","_components"],"sources":["../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './RunIt'\nexport * from './RunItProvider'\nexport * from './utils'\nexport * from './components'\n"],"mappings":";;;;;AA0BA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,cAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,cAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,cAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,cAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,MAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,WAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,WAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,WAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAG,WAAA,CAAAP,GAAA;IAAA;EAAA;AAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/test-data/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport {\n testImageResponse,\n testJsonResponse,\n testSqlResponse,\n testTextResponse,\n testHtmlResponse,\n testUnknownResponse,\n testErrorResponse,\n testBogusJsonResponse,\n testOneRowComplexJson,\n} from './responses'\nexport { api } from './specs'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AAWA"}
|
1
|
+
{"version":3,"file":"index.js","names":["_responses","require","_specs"],"sources":["../../src/test-data/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport {\n testImageResponse,\n testJsonResponse,\n testSqlResponse,\n testTextResponse,\n testHtmlResponse,\n testUnknownResponse,\n testErrorResponse,\n testBogusJsonResponse,\n testOneRowComplexJson,\n} from './responses'\nexport { api } from './specs'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAAA,UAAA,GAAAC,OAAA;AAWA,IAAAC,MAAA,GAAAD,OAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"responses.js","names":["testJsonResponse","method","url","headers","contentType","ok","statusCode","statusMessage","body","Buffer","from","requestStarted","responseCompleted","testOneRowComplexJson","testTextResponse","testHtmlResponse","testSqlResponse","testImageResponse","testUnknownResponse","testErrorResponse","testBogusJsonResponse"],"sources":["../../src/test-data/responses.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IRawResponse } from '@looker/sdk-rtl'\n\nexport const testJsonResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: { 'content-type': 'application/json' },\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('[{\"key1\": \"value1\" }]'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testOneRowComplexJson: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: { 'content-type': 'application/json' },\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(`{\n \"id\": 520,\n \"view\": \"orders\",\n \"fields\": [\n \"orders.id\",\n \"users.age\",\n \"users.city\"\n ],\n \"pivots\": [],\n \"fill_fields\": [],\n \"filters\": null,\n \"filter_expression\": \"\",\n \"sorts\": [],\n \"limit\": \"\",\n \"column_limit\": \"\",\n \"total\": null,\n \"row_total\": \"\",\n \"subtotals\": [],\n \"vis_config\": null,\n \"filter_config\": null,\n \"visible_ui_sections\": \"\",\n \"slug\": \"64zJjJw\",\n \"client_id\": \"zfn3SwIaaHbJTbsXSJ0JO7\",\n \"share_url\": \"https://localhost:9999/x/zfn3SwIaaHbJTbsXSJ0JO7\",\n \"expanded_share_url\": \"https://localhost:9999/explore/thelook/orders?fields=orders.id,users.age,users.city&origin=share-expanded\",\n \"url\": \"/explore/thelook/orders?fields=orders.id,users.age,users.city\",\n \"has_table_calculations\": false,\n \"model\": \"thelook\",\n \"dynamic_fields\": \"\",\n \"query_timezone\": \"\",\n \"quick_calcs\": null,\n \"analysis_config\": null,\n \"can\": {\n \"run\": true,\n \"see_results\": true,\n \"explore\": true,\n \"create\": true,\n \"show\": true,\n \"cost_estimate\": true,\n \"index\": true,\n \"see_lookml\": true,\n \"see_aggregate_table_lookml\": true,\n \"see_derived_table_lookml\": true,\n \"see_sql\": true,\n \"save\": true,\n \"generate_drill_links\": true,\n \"download\": true,\n \"download_unlimited\": true,\n \"use_custom_fields\": true,\n \"schedule\": true\n }\n}`),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testTextResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/text/data',\n headers: { 'content-type': 'text/plain;charset=utf-8' },\n contentType: 'text/plain;charset=utf-8',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some text data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testHtmlResponse: IRawResponse = {\n method: 'GET',\n url: `https://some/html`,\n headers: { 'content-type': 'text/html;charset=utf-8' },\n contentType: 'text/html;charset=utf-8',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(\n '<table>\\n' +\n '<tr><th>Orders Created Date</th><th>Orders Count</th></tr>\\n' +\n '<tr><td>2019-12-22</td><td>39</td></tr>\\n' +\n '</table>'\n ),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testSqlResponse: IRawResponse = {\n method: 'GET',\n url: `https://some/sql`,\n headers: { 'content-type': 'application/sql' },\n contentType: 'application/sql',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(`SELECT\n COUNT(DISTINCT products.id ) AS \\`products.count\\`\nFROM demo_db.inventory_items AS inventory_items\nLEFT JOIN demo_db.products AS products ON inventory_items.product_id = products.id\nLIMIT 500`),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testImageResponse = (contentType = 'image/png'): IRawResponse => ({\n method: 'GET',\n url: `http://${contentType}`,\n headers: { 'content-type': contentType },\n contentType,\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some image data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n})\n\nexport const testUnknownResponse: IRawResponse = {\n method: 'GET',\n url: 'http://bogus',\n headers: {},\n contentType: 'bogus',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testErrorResponse: IRawResponse = {\n method: 'GET',\n url: 'http://error',\n headers: {},\n body: Buffer.from(\n '{\"message\": \"Not found\", \"documentation_url\": \"http://docs.looker.com\"}'\n ),\n contentType: 'text',\n ok: false,\n statusCode: 404,\n statusMessage: 'some status message',\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testBogusJsonResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: {},\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('<html><body>I AM A LYING JSON RESPONSE</body></html>'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n"],"mappings":";;;;;;AA4BO,IAAMA,gBAA8B,GAAG;EAC5CC,MAAM,EAAE,KAAK;EACbC,GAAG,EAAE,wBAAwB;EAC7BC,OAAO,EAAE;IAAE,cAAc,EAAE;EAAmB,CAAC;EAC/CC,WAAW,EAAE,kBAAkB;EAC/BC,EAAE,EAAE,IAAI;EACRC,UAAU,EAAE,GAAG;EACfC,aAAa,EAAE,IAAI;EACnBC,IAAI,EAAEC,MAAM,CAACC,IAAI,CAAC,uBAAuB,CAAC;EAC1CC,cAAc,EAAE,IAAI;EACpBC,iBAAiB,EAAE;AACrB,CAAC;
|
1
|
+
{"version":3,"file":"responses.js","names":["testJsonResponse","method","url","headers","contentType","ok","statusCode","statusMessage","body","Buffer","from","requestStarted","responseCompleted","exports","testOneRowComplexJson","testTextResponse","testHtmlResponse","testSqlResponse","testImageResponse","arguments","length","undefined","concat","testUnknownResponse","testErrorResponse","testBogusJsonResponse"],"sources":["../../src/test-data/responses.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IRawResponse } from '@looker/sdk-rtl'\n\nexport const testJsonResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: { 'content-type': 'application/json' },\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('[{\"key1\": \"value1\" }]'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testOneRowComplexJson: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: { 'content-type': 'application/json' },\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(`{\n \"id\": 520,\n \"view\": \"orders\",\n \"fields\": [\n \"orders.id\",\n \"users.age\",\n \"users.city\"\n ],\n \"pivots\": [],\n \"fill_fields\": [],\n \"filters\": null,\n \"filter_expression\": \"\",\n \"sorts\": [],\n \"limit\": \"\",\n \"column_limit\": \"\",\n \"total\": null,\n \"row_total\": \"\",\n \"subtotals\": [],\n \"vis_config\": null,\n \"filter_config\": null,\n \"visible_ui_sections\": \"\",\n \"slug\": \"64zJjJw\",\n \"client_id\": \"zfn3SwIaaHbJTbsXSJ0JO7\",\n \"share_url\": \"https://localhost:9999/x/zfn3SwIaaHbJTbsXSJ0JO7\",\n \"expanded_share_url\": \"https://localhost:9999/explore/thelook/orders?fields=orders.id,users.age,users.city&origin=share-expanded\",\n \"url\": \"/explore/thelook/orders?fields=orders.id,users.age,users.city\",\n \"has_table_calculations\": false,\n \"model\": \"thelook\",\n \"dynamic_fields\": \"\",\n \"query_timezone\": \"\",\n \"quick_calcs\": null,\n \"analysis_config\": null,\n \"can\": {\n \"run\": true,\n \"see_results\": true,\n \"explore\": true,\n \"create\": true,\n \"show\": true,\n \"cost_estimate\": true,\n \"index\": true,\n \"see_lookml\": true,\n \"see_aggregate_table_lookml\": true,\n \"see_derived_table_lookml\": true,\n \"see_sql\": true,\n \"save\": true,\n \"generate_drill_links\": true,\n \"download\": true,\n \"download_unlimited\": true,\n \"use_custom_fields\": true,\n \"schedule\": true\n }\n}`),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testTextResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/text/data',\n headers: { 'content-type': 'text/plain;charset=utf-8' },\n contentType: 'text/plain;charset=utf-8',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some text data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testHtmlResponse: IRawResponse = {\n method: 'GET',\n url: `https://some/html`,\n headers: { 'content-type': 'text/html;charset=utf-8' },\n contentType: 'text/html;charset=utf-8',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(\n '<table>\\n' +\n '<tr><th>Orders Created Date</th><th>Orders Count</th></tr>\\n' +\n '<tr><td>2019-12-22</td><td>39</td></tr>\\n' +\n '</table>'\n ),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testSqlResponse: IRawResponse = {\n method: 'GET',\n url: `https://some/sql`,\n headers: { 'content-type': 'application/sql' },\n contentType: 'application/sql',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from(`SELECT\n COUNT(DISTINCT products.id ) AS \\`products.count\\`\nFROM demo_db.inventory_items AS inventory_items\nLEFT JOIN demo_db.products AS products ON inventory_items.product_id = products.id\nLIMIT 500`),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testImageResponse = (contentType = 'image/png'): IRawResponse => ({\n method: 'GET',\n url: `http://${contentType}`,\n headers: { 'content-type': contentType },\n contentType,\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some image data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n})\n\nexport const testUnknownResponse: IRawResponse = {\n method: 'GET',\n url: 'http://bogus',\n headers: {},\n contentType: 'bogus',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('some data'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testErrorResponse: IRawResponse = {\n method: 'GET',\n url: 'http://error',\n headers: {},\n body: Buffer.from(\n '{\"message\": \"Not found\", \"documentation_url\": \"http://docs.looker.com\"}'\n ),\n contentType: 'text',\n ok: false,\n statusCode: 404,\n statusMessage: 'some status message',\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n\nexport const testBogusJsonResponse: IRawResponse = {\n method: 'GET',\n url: 'https://some/json/data',\n headers: {},\n contentType: 'application/json',\n ok: true,\n statusCode: 200,\n statusMessage: 'OK',\n body: Buffer.from('<html><body>I AM A LYING JSON RESPONSE</body></html>'),\n requestStarted: 1000,\n responseCompleted: 2000,\n}\n"],"mappings":";;;;;;AA4BO,IAAMA,gBAA8B,GAAG;EAC5CC,MAAM,EAAE,KAAK;EACbC,GAAG,EAAE,wBAAwB;EAC7BC,OAAO,EAAE;IAAE,cAAc,EAAE;EAAmB,CAAC;EAC/CC,WAAW,EAAE,kBAAkB;EAC/BC,EAAE,EAAE,IAAI;EACRC,UAAU,EAAE,GAAG;EACfC,aAAa,EAAE,IAAI;EACnBC,IAAI,EAAEC,MAAM,CAACC,IAAI,CAAC,uBAAuB,CAAC;EAC1CC,cAAc,EAAE,IAAI;EACpBC,iBAAiB,EAAE;AACrB,CAAC;AAAAC,OAAA,CAAAb,gBAAA,GAAAA,gBAAA;AAEM,IAAMc,qBAAmC,GAAG;EACjDb,MAAM,EAAE,KAAK;EACbC,GAAG,EAAE,wBAAwB;EAC7BC,OAAO,EAAE;IAAE,cAAc,EAAE;EAAmB,CAAC;EAC/CC,WAAW,EAAE,kBAAkB;EAC/BC,EAAE,EAAE,IAAI;EACRC,UAAU,EAA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AE,MAAM;EACnBC,EAAE,EAAE,KAAK;EACTC,UAAU,EAAE,GAAG;EACfC,aAAa,EAAE,qBAAqB;EACpCI,cAAc,EAAE,IAAI;EACpBC,iBAAiB,EAAE;AACrB,CAAC;AAAAC,OAAA,CAAAW,iBAAA,GAAAA,iBAAA;AAEM,IAAMC,qBAAmC,GAAG;EACjDxB,MAAM,EAAE,KAAK;EACbC,GAAG,EAAE,wBAAwB;EAC7BC,OAAO,EAAE,CAAC,CAAC;EACXC,WAAW,EAAE,kBAAkB;EAC/BC,EAAE,EAAE,IAAI;EACRC,UAAU,EAAE,GAAG;EACfC,aAAa,EAAE,IAAI;EACnBC,IAAI,EAAEC,MAAM,CAACC,IAAI,CAAC,sDAAsD,CAAC;EACzEC,cAAc,EAAE,IAAI;EACpBC,iBAAiB,EAAE;AACrB,CAAC;AAAAC,OAAA,CAAAY,qBAAA,GAAAA,qBAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"specs.js","names":["
|
1
|
+
{"version":3,"file":"specs.js","names":["_sdkCodegen","require","spec","api","ApiModel","fromJson","exports"],"sources":["../../src/test-data/specs.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nimport { ApiModel } from '@looker/sdk-codegen'\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst spec = require('../../../../spec/Looker.3.1.oas.json')\n\nexport const api = ApiModel.fromJson(spec)\n"],"mappings":";;;;;;AAyBA,IAAAA,WAAA,GAAAC,OAAA;AAGA,IAAMC,IAAI,GAAGD,OAAO,CAAC,sCAAsC,CAAC;AAErD,IAAME,GAAG,GAAGC,oBAAQ,CAACC,QAAQ,CAACH,IAAI,CAAC;AAAAI,OAAA,CAAAH,GAAA,GAAAA,GAAA"}
|
package/lib/utils/RunItSDK.js
CHANGED
@@ -26,9 +26,9 @@ var initRunItSdk = () => {
|
|
26
26
|
return sdk;
|
27
27
|
};
|
28
28
|
exports.initRunItSdk = initRunItSdk;
|
29
|
-
var StoreConstants
|
30
|
-
exports.StoreConstants = StoreConstants;
|
31
|
-
(function (StoreConstants) {
|
29
|
+
var StoreConstants = function (StoreConstants) {
|
32
30
|
StoreConstants["LOCALSTORAGE_SETTINGS_KEY"] = "settings";
|
33
|
-
|
31
|
+
return StoreConstants;
|
32
|
+
}({});
|
33
|
+
exports.StoreConstants = StoreConstants;
|
34
34
|
//# sourceMappingURL=RunItSDK.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RunItSDK.js","names":["initRunItSdk","settings","DefaultSettings","base_url","agentTag","options","OAuthConfigProvider","RunItConfigKey","transport","BrowserTransport","session","BrowserSession","sdk","functionalSdk40","trackPerformance","StoreConstants"],"sources":["../../src/utils/RunItSDK.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IApiSettings } from '@looker/sdk-rtl'\nimport {\n BrowserSession,\n BrowserTransport,\n DefaultSettings,\n} from '@looker/sdk-rtl'\nimport { functionalSdk40 } from '@looker/sdk'\nimport { OAuthConfigProvider } from '@looker/extension-utils'\n\nimport { RunItConfigKey } from '../components'\n\nexport const initRunItSdk = () => {\n const settings = {\n ...DefaultSettings(),\n base_url: 'https://self-signed.looker.com:19999',\n agentTag: 'RunIt 0.8',\n } as IApiSettings\n\n const options = new OAuthConfigProvider(\n settings,\n 'looker.api-explorer',\n RunItConfigKey\n )\n const transport = new BrowserTransport(options)\n const session = new BrowserSession(options, transport)\n const sdk = functionalSdk40(session)\n BrowserTransport.trackPerformance = true\n return sdk\n}\n\nexport enum StoreConstants {\n LOCALSTORAGE_SETTINGS_KEY = 'settings',\n}\n"],"mappings":";;;;;;AA2BA;AAKA;AACA;AAEA;AAA8C;AAAA;AAAA;AAAA;AAAA;AAEvC,
|
1
|
+
{"version":3,"file":"RunItSDK.js","names":["_sdkRtl","require","_sdk","_extensionUtils","_components","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","initRunItSdk","settings","DefaultSettings","base_url","agentTag","options","OAuthConfigProvider","RunItConfigKey","transport","BrowserTransport","session","BrowserSession","sdk","functionalSdk40","trackPerformance","exports","StoreConstants"],"sources":["../../src/utils/RunItSDK.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IApiSettings } from '@looker/sdk-rtl'\nimport {\n BrowserSession,\n BrowserTransport,\n DefaultSettings,\n} from '@looker/sdk-rtl'\nimport { functionalSdk40 } from '@looker/sdk'\nimport { OAuthConfigProvider } from '@looker/extension-utils'\n\nimport { RunItConfigKey } from '../components'\n\nexport const initRunItSdk = () => {\n const settings = {\n ...DefaultSettings(),\n base_url: 'https://self-signed.looker.com:19999',\n agentTag: 'RunIt 0.8',\n } as IApiSettings\n\n const options = new OAuthConfigProvider(\n settings,\n 'looker.api-explorer',\n RunItConfigKey\n )\n const transport = new BrowserTransport(options)\n const session = new BrowserSession(options, transport)\n const sdk = functionalSdk40(session)\n BrowserTransport.trackPerformance = true\n return sdk\n}\n\nexport enum StoreConstants {\n LOCALSTORAGE_SETTINGS_KEY = 'settings',\n}\n"],"mappings":";;;;;;AA2BA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAA8C,SAAAI,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,MAAA,CAAAc,MAAA,OAAAC,OAAA,WAAAC,GAAA,IAAAC,eAAA,CAAAP,MAAA,EAAAM,GAAA,EAAAF,MAAA,CAAAE,GAAA,SAAAhB,MAAA,CAAAkB,yBAAA,GAAAlB,MAAA,CAAAmB,gBAAA,CAAAT,MAAA,EAAAV,MAAA,CAAAkB,yBA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,SAAS,GAAG,IAAIC,wBAAgB,CAACJ,OAAO,CAAC;EAC/C,IAAMK,OAAO,GAAG,IAAIC,sBAAc,CAACN,OAAO,EAAEG,SAAS,CAAC;EACtD,IAAMI,GAAG,GAAG,IAAAC,oBAAe,EAACH,OAAO,CAAC;EACpCD,wBAAgB,CAACK,gBAAgB,GAAG,IAAI;EACxC,OAAOF,GAAG;AACZ,CAAC;AAAAG,OAAA,CAAAf,YAAA,GAAAA,YAAA;AAAA,IAEWgB,cAAc,aAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAAAD,OAAA,CAAAC,cAAA,GAAAA,cAAA"}
|
package/lib/utils/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './RunItSDK'\nexport * from './requestUtils'\n"],"mappings":";;;;;AAyBA;
|
1
|
+
{"version":3,"file":"index.js","names":["_RunItSDK","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_requestUtils"],"sources":["../../src/utils/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './RunItSDK'\nexport * from './requestUtils'\n"],"mappings":";;;;;AAyBA,IAAAA,SAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,SAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,SAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,SAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,aAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,aAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,aAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,aAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
|