@looker/run-it 0.9.46 → 0.9.49

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/lib/RunIt.js.map +1 -1
  3. package/lib/RunItProvider.js.map +1 -1
  4. package/lib/components/Collapser/CollapserCard.js.map +1 -1
  5. package/lib/components/Collapser/index.js.map +1 -1
  6. package/lib/components/ConfigForm/ConfigForm.js.map +1 -1
  7. package/lib/components/ConfigForm/index.js.map +1 -1
  8. package/lib/components/ConfigForm/utils.js.map +1 -1
  9. package/lib/components/CopyLinkWrapper/CopyLinkWrapper.js.map +1 -1
  10. package/lib/components/CopyLinkWrapper/index.js.map +1 -1
  11. package/lib/components/DataGrid/DataGrid.js.map +1 -1
  12. package/lib/components/DataGrid/gridUtils.js.map +1 -1
  13. package/lib/components/DataGrid/index.js.map +1 -1
  14. package/lib/components/DocSdkCalls/DocMultiCall.js.map +1 -1
  15. package/lib/components/DocSdkCalls/DocSdkCalls.js.map +1 -1
  16. package/lib/components/DocSdkCalls/callUtils.js.map +1 -1
  17. package/lib/components/DocSdkCalls/index.js.map +1 -1
  18. package/lib/components/Loading/Loading.js.map +1 -1
  19. package/lib/components/Loading/index.js.map +1 -1
  20. package/lib/components/LoginForm/LoginForm.js.map +1 -1
  21. package/lib/components/LoginForm/index.js.map +1 -1
  22. package/lib/components/MethodBadge/MethodBadge.js.map +1 -1
  23. package/lib/components/MethodBadge/index.js.map +1 -1
  24. package/lib/components/PerfTracker/PerfChart.js.map +1 -1
  25. package/lib/components/PerfTracker/PerfTable.js.map +1 -1
  26. package/lib/components/PerfTracker/PerfTracker.js.map +1 -1
  27. package/lib/components/PerfTracker/index.js.map +1 -1
  28. package/lib/components/PerfTracker/perfTableUtils.js.map +1 -1
  29. package/lib/components/PerfTracker/perfUtils.js.map +1 -1
  30. package/lib/components/RequestForm/FormItem.js.map +1 -1
  31. package/lib/components/RequestForm/RequestForm.js.map +1 -1
  32. package/lib/components/RequestForm/formUtils.js.map +1 -1
  33. package/lib/components/RequestForm/index.js.map +1 -1
  34. package/lib/components/ResponseExplorer/ResponseExplorer.js.map +1 -1
  35. package/lib/components/ResponseExplorer/index.js.map +1 -1
  36. package/lib/components/ShowResponse/ShowResponse.js.map +1 -1
  37. package/lib/components/ShowResponse/index.js.map +1 -1
  38. package/lib/components/ShowResponse/responseUtils.js +3 -3
  39. package/lib/components/ShowResponse/responseUtils.js.map +1 -1
  40. package/lib/components/common/common.js.map +1 -1
  41. package/lib/components/common/index.js.map +1 -1
  42. package/lib/components/index.js.map +1 -1
  43. package/lib/esm/RunIt.js.map +1 -1
  44. package/lib/esm/RunItProvider.js.map +1 -1
  45. package/lib/esm/components/Collapser/CollapserCard.js.map +1 -1
  46. package/lib/esm/components/Collapser/index.js.map +1 -1
  47. package/lib/esm/components/ConfigForm/ConfigForm.js.map +1 -1
  48. package/lib/esm/components/ConfigForm/index.js.map +1 -1
  49. package/lib/esm/components/ConfigForm/utils.js.map +1 -1
  50. package/lib/esm/components/CopyLinkWrapper/CopyLinkWrapper.js.map +1 -1
  51. package/lib/esm/components/CopyLinkWrapper/index.js.map +1 -1
  52. package/lib/esm/components/DataGrid/DataGrid.js.map +1 -1
  53. package/lib/esm/components/DataGrid/gridUtils.js.map +1 -1
  54. package/lib/esm/components/DataGrid/index.js.map +1 -1
  55. package/lib/esm/components/DocSdkCalls/DocMultiCall.js.map +1 -1
  56. package/lib/esm/components/DocSdkCalls/DocSdkCalls.js.map +1 -1
  57. package/lib/esm/components/DocSdkCalls/callUtils.js.map +1 -1
  58. package/lib/esm/components/DocSdkCalls/index.js.map +1 -1
  59. package/lib/esm/components/Loading/Loading.js.map +1 -1
  60. package/lib/esm/components/Loading/index.js.map +1 -1
  61. package/lib/esm/components/LoginForm/LoginForm.js.map +1 -1
  62. package/lib/esm/components/LoginForm/index.js.map +1 -1
  63. package/lib/esm/components/MethodBadge/MethodBadge.js.map +1 -1
  64. package/lib/esm/components/MethodBadge/index.js.map +1 -1
  65. package/lib/esm/components/PerfTracker/PerfChart.js.map +1 -1
  66. package/lib/esm/components/PerfTracker/PerfTable.js.map +1 -1
  67. package/lib/esm/components/PerfTracker/PerfTracker.js.map +1 -1
  68. package/lib/esm/components/PerfTracker/index.js.map +1 -1
  69. package/lib/esm/components/PerfTracker/perfTableUtils.js.map +1 -1
  70. package/lib/esm/components/PerfTracker/perfUtils.js.map +1 -1
  71. package/lib/esm/components/RequestForm/FormItem.js.map +1 -1
  72. package/lib/esm/components/RequestForm/RequestForm.js.map +1 -1
  73. package/lib/esm/components/RequestForm/formUtils.js.map +1 -1
  74. package/lib/esm/components/RequestForm/index.js.map +1 -1
  75. package/lib/esm/components/ResponseExplorer/ResponseExplorer.js.map +1 -1
  76. package/lib/esm/components/ResponseExplorer/index.js.map +1 -1
  77. package/lib/esm/components/ShowResponse/ShowResponse.js.map +1 -1
  78. package/lib/esm/components/ShowResponse/index.js.map +1 -1
  79. package/lib/esm/components/ShowResponse/responseUtils.js +3 -3
  80. package/lib/esm/components/ShowResponse/responseUtils.js.map +1 -1
  81. package/lib/esm/components/common/common.js.map +1 -1
  82. package/lib/esm/components/common/index.js.map +1 -1
  83. package/lib/esm/components/index.js.map +1 -1
  84. package/lib/esm/index.js.map +1 -1
  85. package/lib/esm/test-data/index.js.map +1 -1
  86. package/lib/esm/test-data/responses.js.map +1 -1
  87. package/lib/esm/test-data/specs.js.map +1 -1
  88. package/lib/esm/utils/RunItSDK.js +4 -4
  89. package/lib/esm/utils/RunItSDK.js.map +1 -1
  90. package/lib/esm/utils/index.js.map +1 -1
  91. package/lib/esm/utils/requestUtils.js.map +1 -1
  92. package/lib/index.js.map +1 -1
  93. package/lib/test-data/index.js.map +1 -1
  94. package/lib/test-data/responses.js.map +1 -1
  95. package/lib/test-data/specs.js.map +1 -1
  96. package/lib/utils/RunItSDK.js +4 -4
  97. package/lib/utils/RunItSDK.js.map +1 -1
  98. package/lib/utils/index.js.map +1 -1
  99. package/lib/utils/requestUtils.js.map +1 -1
  100. package/package.json +7 -7
@@ -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;U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IAAI;EAChBC,QAAQ,EAAEkE,KAAK,CAAClE,QAAQ;EACxBI,IAAI,EAAEyD,QAAQ,CAAChB,IAAI,EAAEqB,KAAK,CAAC9D,IAAI,CAAC;EAChC+D,QAAQ,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,GAAA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6 +1,6 @@
1
1
  {
2
2
  "name": "@looker/run-it",
3
- "version": "0.9.46",
3
+ "version": "0.9.49",
4
4
  "description": "A dynamic REST request input form and response visualizer",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -53,15 +53,15 @@
53
53
  "webpack-dev-server": "^4.11.1"
54
54
  },
55
55
  "dependencies": {
56
- "@looker/code-editor": "^0.1.28",
56
+ "@looker/code-editor": "^0.1.29",
57
57
  "@looker/components": "^4.1.1",
58
58
  "@looker/design-tokens": "^3.1.0",
59
- "@looker/extension-utils": "^0.1.23",
59
+ "@looker/extension-utils": "^0.1.26",
60
60
  "@looker/icons": "^1.5.21",
61
- "@looker/sdk": "^23.6.0",
62
- "@looker/sdk-codegen": "^21.8.0",
61
+ "@looker/sdk": "^23.10.0",
62
+ "@looker/sdk-codegen": "^21.8.1",
63
63
  "@looker/sdk-codegen-utils": "^21.0.11",
64
- "@looker/sdk-rtl": "^21.6.0",
64
+ "@looker/sdk-rtl": "^21.6.1",
65
65
  "@styled-icons/material": "^10.28.0",
66
66
  "@styled-icons/material-outlined": "^10.28.0",
67
67
  "@styled-icons/material-rounded": "^10.28.0",
@@ -73,5 +73,5 @@
73
73
  "react-is": "^16.13.1",
74
74
  "styled-components": "^5.2.1"
75
75
  },
76
- "gitHead": "3c3b027b71bced8fb05d5b0d88b15f71c12b97bd"
76
+ "gitHead": "03f443d0eedb8cd7b06f6e501bd4f28a37db5069"
77
77
  }