@looker/run-it 0.9.43-alpha.1648 → 0.9.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/lib/RunIt.js +12 -28
  3. package/lib/RunIt.js.map +1 -1
  4. package/lib/RunItProvider.js +0 -6
  5. package/lib/RunItProvider.js.map +1 -1
  6. package/lib/components/Collapser/CollapserCard.js +0 -8
  7. package/lib/components/Collapser/CollapserCard.js.map +1 -1
  8. package/lib/components/Collapser/index.js +0 -1
  9. package/lib/components/Collapser/index.js.map +1 -1
  10. package/lib/components/ConfigForm/ConfigForm.js +5 -52
  11. package/lib/components/ConfigForm/ConfigForm.js.map +1 -1
  12. package/lib/components/ConfigForm/index.js +0 -4
  13. package/lib/components/ConfigForm/index.js.map +1 -1
  14. package/lib/components/ConfigForm/utils.js +5 -21
  15. package/lib/components/ConfigForm/utils.js.map +1 -1
  16. package/lib/components/CopyLinkWrapper/CopyLinkWrapper.js +0 -16
  17. package/lib/components/CopyLinkWrapper/CopyLinkWrapper.js.map +1 -1
  18. package/lib/components/CopyLinkWrapper/index.js +0 -1
  19. package/lib/components/CopyLinkWrapper/index.js.map +1 -1
  20. package/lib/components/DataGrid/DataGrid.d.ts +2 -2
  21. package/lib/components/DataGrid/DataGrid.js +1 -9
  22. package/lib/components/DataGrid/DataGrid.js.map +1 -1
  23. package/lib/components/DataGrid/gridUtils.js +1 -22
  24. package/lib/components/DataGrid/gridUtils.js.map +1 -1
  25. package/lib/components/DataGrid/index.js +4 -6
  26. package/lib/components/DataGrid/index.js.map +1 -1
  27. package/lib/components/DocSdkCalls/DocMultiCall.js +0 -6
  28. package/lib/components/DocSdkCalls/DocMultiCall.js.map +1 -1
  29. package/lib/components/DocSdkCalls/DocSdkCalls.d.ts +1 -0
  30. package/lib/components/DocSdkCalls/DocSdkCalls.js +5 -17
  31. package/lib/components/DocSdkCalls/DocSdkCalls.js.map +1 -1
  32. package/lib/components/DocSdkCalls/callUtils.js +0 -5
  33. package/lib/components/DocSdkCalls/callUtils.js.map +1 -1
  34. package/lib/components/DocSdkCalls/index.js +4 -6
  35. package/lib/components/DocSdkCalls/index.js.map +1 -1
  36. package/lib/components/Loading/Loading.js +0 -5
  37. package/lib/components/Loading/Loading.js.map +1 -1
  38. package/lib/components/Loading/index.js +0 -1
  39. package/lib/components/Loading/index.js.map +1 -1
  40. package/lib/components/LoginForm/LoginForm.js +1 -16
  41. package/lib/components/LoginForm/LoginForm.js.map +1 -1
  42. package/lib/components/LoginForm/index.js +0 -1
  43. package/lib/components/LoginForm/index.js.map +1 -1
  44. package/lib/components/MethodBadge/MethodBadge.js +1 -16
  45. package/lib/components/MethodBadge/MethodBadge.js.map +1 -1
  46. package/lib/components/MethodBadge/index.js +0 -1
  47. package/lib/components/MethodBadge/index.js.map +1 -1
  48. package/lib/components/PerfTracker/PerfChart.js +0 -12
  49. package/lib/components/PerfTracker/PerfChart.js.map +1 -1
  50. package/lib/components/PerfTracker/PerfTable.js +0 -9
  51. package/lib/components/PerfTracker/PerfTable.js.map +1 -1
  52. package/lib/components/PerfTracker/PerfTracker.js +0 -18
  53. package/lib/components/PerfTracker/PerfTracker.js.map +1 -1
  54. package/lib/components/PerfTracker/index.js +4 -6
  55. package/lib/components/PerfTracker/index.js.map +1 -1
  56. package/lib/components/PerfTracker/perfTableUtils.d.ts +1 -1
  57. package/lib/components/PerfTracker/perfTableUtils.js +2 -18
  58. package/lib/components/PerfTracker/perfTableUtils.js.map +1 -1
  59. package/lib/components/PerfTracker/perfUtils.js +4 -42
  60. package/lib/components/PerfTracker/perfUtils.js.map +1 -1
  61. package/lib/components/RequestForm/FormItem.js +0 -5
  62. package/lib/components/RequestForm/FormItem.js.map +1 -1
  63. package/lib/components/RequestForm/RequestForm.d.ts +3 -1
  64. package/lib/components/RequestForm/RequestForm.js +25 -23
  65. package/lib/components/RequestForm/RequestForm.js.map +1 -1
  66. package/lib/components/RequestForm/formUtils.d.ts +1 -0
  67. package/lib/components/RequestForm/formUtils.js +9 -47
  68. package/lib/components/RequestForm/formUtils.js.map +1 -1
  69. package/lib/components/RequestForm/index.js +0 -2
  70. package/lib/components/RequestForm/index.js.map +1 -1
  71. package/lib/components/ResponseExplorer/ResponseExplorer.js +2 -22
  72. package/lib/components/ResponseExplorer/ResponseExplorer.js.map +1 -1
  73. package/lib/components/ResponseExplorer/index.js +0 -2
  74. package/lib/components/ResponseExplorer/index.js.map +1 -1
  75. package/lib/components/ShowResponse/ShowResponse.js +0 -7
  76. package/lib/components/ShowResponse/ShowResponse.js.map +1 -1
  77. package/lib/components/ShowResponse/index.js +0 -1
  78. package/lib/components/ShowResponse/index.js.map +1 -1
  79. package/lib/components/ShowResponse/responseUtils.js +4 -49
  80. package/lib/components/ShowResponse/responseUtils.js.map +1 -1
  81. package/lib/components/common/common.d.ts +2 -2
  82. package/lib/components/common/common.js +1 -5
  83. package/lib/components/common/common.js.map +1 -1
  84. package/lib/components/common/index.js +0 -1
  85. package/lib/components/common/index.js.map +1 -1
  86. package/lib/components/index.js +0 -26
  87. package/lib/components/index.js.map +1 -1
  88. package/lib/esm/RunIt.js +65 -62
  89. package/lib/esm/RunIt.js.map +1 -1
  90. package/lib/esm/RunItProvider.js +14 -4
  91. package/lib/esm/RunItProvider.js.map +1 -1
  92. package/lib/esm/components/Collapser/CollapserCard.js +22 -14
  93. package/lib/esm/components/Collapser/CollapserCard.js.map +1 -1
  94. package/lib/esm/components/Collapser/index.js +12 -1
  95. package/lib/esm/components/Collapser/index.js.map +1 -1
  96. package/lib/esm/components/ConfigForm/ConfigForm.js +63 -89
  97. package/lib/esm/components/ConfigForm/ConfigForm.js.map +1 -1
  98. package/lib/esm/components/ConfigForm/index.js +27 -2
  99. package/lib/esm/components/ConfigForm/index.js.map +1 -1
  100. package/lib/esm/components/ConfigForm/utils.js +25 -21
  101. package/lib/esm/components/ConfigForm/utils.js.map +1 -1
  102. package/lib/esm/components/CopyLinkWrapper/CopyLinkWrapper.js +22 -19
  103. package/lib/esm/components/CopyLinkWrapper/CopyLinkWrapper.js.map +1 -1
  104. package/lib/esm/components/CopyLinkWrapper/index.js +12 -1
  105. package/lib/esm/components/CopyLinkWrapper/index.js.map +1 -1
  106. package/lib/esm/components/DataGrid/DataGrid.js +25 -17
  107. package/lib/esm/components/DataGrid/DataGrid.js.map +1 -1
  108. package/lib/esm/components/DataGrid/gridUtils.js +26 -15
  109. package/lib/esm/components/DataGrid/gridUtils.js.map +1 -1
  110. package/lib/esm/components/DataGrid/index.js +25 -2
  111. package/lib/esm/components/DataGrid/index.js.map +1 -1
  112. package/lib/esm/components/DocSdkCalls/DocMultiCall.js +15 -7
  113. package/lib/esm/components/DocSdkCalls/DocMultiCall.js.map +1 -1
  114. package/lib/esm/components/DocSdkCalls/DocSdkCalls.js +30 -22
  115. package/lib/esm/components/DocSdkCalls/DocSdkCalls.js.map +1 -1
  116. package/lib/esm/components/DocSdkCalls/callUtils.js +10 -3
  117. package/lib/esm/components/DocSdkCalls/callUtils.js.map +1 -1
  118. package/lib/esm/components/DocSdkCalls/index.js +19 -2
  119. package/lib/esm/components/DocSdkCalls/index.js.map +1 -1
  120. package/lib/esm/components/Loading/Loading.js +14 -6
  121. package/lib/esm/components/Loading/Loading.js.map +1 -1
  122. package/lib/esm/components/Loading/index.js +12 -1
  123. package/lib/esm/components/Loading/index.js.map +1 -1
  124. package/lib/esm/components/LoginForm/LoginForm.js +21 -18
  125. package/lib/esm/components/LoginForm/LoginForm.js.map +1 -1
  126. package/lib/esm/components/LoginForm/index.js +18 -1
  127. package/lib/esm/components/LoginForm/index.js.map +1 -1
  128. package/lib/esm/components/MethodBadge/MethodBadge.js +19 -13
  129. package/lib/esm/components/MethodBadge/MethodBadge.js.map +1 -1
  130. package/lib/esm/components/MethodBadge/index.js +12 -1
  131. package/lib/esm/components/MethodBadge/index.js.map +1 -1
  132. package/lib/esm/components/PerfTracker/PerfChart.js +18 -16
  133. package/lib/esm/components/PerfTracker/PerfChart.js.map +1 -1
  134. package/lib/esm/components/PerfTracker/PerfTable.js +22 -15
  135. package/lib/esm/components/PerfTracker/PerfTable.js.map +1 -1
  136. package/lib/esm/components/PerfTracker/PerfTracker.js +33 -31
  137. package/lib/esm/components/PerfTracker/PerfTracker.js.map +1 -1
  138. package/lib/esm/components/PerfTracker/index.js +19 -2
  139. package/lib/esm/components/PerfTracker/index.js.map +1 -1
  140. package/lib/esm/components/PerfTracker/perfTableUtils.js +28 -26
  141. package/lib/esm/components/PerfTracker/perfTableUtils.js.map +1 -1
  142. package/lib/esm/components/PerfTracker/perfUtils.js +15 -39
  143. package/lib/esm/components/PerfTracker/perfUtils.js.map +1 -1
  144. package/lib/esm/components/RequestForm/FormItem.js +14 -6
  145. package/lib/esm/components/RequestForm/FormItem.js.map +1 -1
  146. package/lib/esm/components/RequestForm/RequestForm.js +50 -32
  147. package/lib/esm/components/RequestForm/RequestForm.js.map +1 -1
  148. package/lib/esm/components/RequestForm/formUtils.js +47 -53
  149. package/lib/esm/components/RequestForm/formUtils.js.map +1 -1
  150. package/lib/esm/components/RequestForm/index.js +19 -2
  151. package/lib/esm/components/RequestForm/index.js.map +1 -1
  152. package/lib/esm/components/ResponseExplorer/ResponseExplorer.js +41 -35
  153. package/lib/esm/components/ResponseExplorer/ResponseExplorer.js.map +1 -1
  154. package/lib/esm/components/ResponseExplorer/index.js +16 -1
  155. package/lib/esm/components/ResponseExplorer/index.js.map +1 -1
  156. package/lib/esm/components/ShowResponse/ShowResponse.js +14 -8
  157. package/lib/esm/components/ShowResponse/ShowResponse.js.map +1 -1
  158. package/lib/esm/components/ShowResponse/index.js +12 -1
  159. package/lib/esm/components/ShowResponse/index.js.map +1 -1
  160. package/lib/esm/components/ShowResponse/responseUtils.js +43 -61
  161. package/lib/esm/components/ShowResponse/responseUtils.js.map +1 -1
  162. package/lib/esm/components/common/common.js +13 -4
  163. package/lib/esm/components/common/common.js.map +1 -1
  164. package/lib/esm/components/common/index.js +18 -1
  165. package/lib/esm/components/common/index.js.map +1 -1
  166. package/lib/esm/components/index.js +148 -13
  167. package/lib/esm/components/index.js.map +1 -1
  168. package/lib/esm/index.js +49 -4
  169. package/lib/esm/index.js.map +1 -1
  170. package/lib/esm/test-data/index.js +68 -0
  171. package/lib/esm/test-data/index.js.map +1 -0
  172. package/lib/esm/test-data/responses.js +139 -0
  173. package/lib/esm/test-data/responses.js.map +1 -0
  174. package/lib/esm/test-data/specs.js +11 -0
  175. package/lib/esm/test-data/specs.js.map +1 -0
  176. package/lib/esm/utils/RunItSDK.js +25 -20
  177. package/lib/esm/utils/RunItSDK.js.map +1 -1
  178. package/lib/esm/utils/index.js +27 -2
  179. package/lib/esm/utils/index.js.map +1 -1
  180. package/lib/esm/utils/requestUtils.js +42 -64
  181. package/lib/esm/utils/requestUtils.js.map +1 -1
  182. package/lib/index.js +0 -8
  183. package/lib/index.js.map +1 -1
  184. package/lib/test-data/index.js +20 -22
  185. package/lib/test-data/index.js.map +1 -1
  186. package/lib/test-data/responses.js +1 -3
  187. package/lib/test-data/responses.js.map +1 -1
  188. package/lib/test-data/specs.js +0 -4
  189. package/lib/test-data/specs.js.map +1 -1
  190. package/lib/utils/RunItSDK.js +6 -15
  191. package/lib/utils/RunItSDK.js.map +1 -1
  192. package/lib/utils/index.js +0 -4
  193. package/lib/utils/index.js.map +1 -1
  194. package/lib/utils/requestUtils.d.ts +1 -1
  195. package/lib/utils/requestUtils.js +4 -61
  196. package/lib/utils/requestUtils.js.map +1 -1
  197. package/package.json +20 -19
@@ -6,5 +6,6 @@ export interface DocSdkCallsProps {
6
6
  method: IMethod;
7
7
  inputs: RunItValues;
8
8
  sdkLanguage: string;
9
+ keepBody?: boolean;
9
10
  }
10
11
  export declare const DocSdkCalls: FC<DocSdkCallsProps>;
@@ -4,55 +4,44 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DocSdkCalls = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _sdkCodegen = require("@looker/sdk-codegen");
11
-
12
9
  var _components = require("@looker/components");
13
-
14
10
  var _codeEditor = require("@looker/code-editor");
15
-
16
11
  var _common = require("../common");
17
-
18
12
  var _DocMultiCall = require("./DocMultiCall");
19
-
20
13
  var _callUtils = require("./callUtils");
21
-
22
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
16
  var DocSdkCalls = _ref => {
27
17
  var {
28
18
  api,
29
19
  method,
30
20
  inputs,
31
- sdkLanguage = 'All'
21
+ sdkLanguage = 'All',
22
+ keepBody = false
32
23
  } = _ref;
33
- var trimmedInputs = (0, _sdkCodegen.trimInputs)(inputs);
34
24
  var [heading, setHeading] = (0, _react.useState)('');
25
+ var trimmed = (0, _sdkCodegen.trimInputs)(inputs, keepBody);
35
26
  (0, _react.useEffect)(() => {
36
27
  var text = sdkLanguage === 'All' ? 'SDKs call syntax' : "".concat(sdkLanguage, " SDK call syntax");
37
28
  setHeading(text);
38
29
  }, [sdkLanguage]);
39
30
  var calls = {};
40
-
41
31
  try {
42
32
  if (sdkLanguage === 'All') {
43
33
  var generators = (0, _callUtils.getGenerators)(api);
44
34
  Object.entries(generators).forEach(_ref2 => {
45
35
  var [language, gen] = _ref2;
46
- calls[language] = gen.makeTheCall(method, trimmedInputs);
36
+ calls[language] = gen.makeTheCall(method, trimmed);
47
37
  });
48
38
  } else {
49
39
  var gen = (0, _sdkCodegen.getCodeGenerator)(sdkLanguage, api);
50
- calls[sdkLanguage] = gen.makeTheCall(method, trimmedInputs);
40
+ calls[sdkLanguage] = gen.makeTheCall(method, trimmed);
51
41
  }
52
42
  } catch (_unused) {
53
43
  return _react.default.createElement(_common.DarkSpan, null, "Cannot generate SDK call syntax. Ensure all complex structures in the request form are valid.");
54
44
  }
55
-
56
45
  return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_components.Heading, {
57
46
  as: "h4",
58
47
  mb: "medium"
@@ -63,6 +52,5 @@ var DocSdkCalls = _ref => {
63
52
  language: sdkLanguage
64
53
  }));
65
54
  };
66
-
67
55
  exports.DocSdkCalls = DocSdkCalls;
68
56
  //# sourceMappingURL=DocSdkCalls.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DocSdkCalls/DocSdkCalls.tsx"],"names":["DocSdkCalls","api","method","inputs","sdkLanguage","trimmedInputs","heading","setHeading","text","calls","generators","Object","entries","forEach","language","gen","makeTheCall"],"mappings":";;;;;;;AA2BA;;AAEA;;AACA;;AACA;;AAGA;;AACA;;AACA;;;;;;AAgBO,IAAMA,WAAiC,GAAG,QAK3C;AAAA,MAL4C;AAChDC,IAAAA,GADgD;AAEhDC,IAAAA,MAFgD;AAGhDC,IAAAA,MAHgD;AAIhDC,IAAAA,WAAW,GAAG;AAJkC,GAK5C;AACJ,MAAMC,aAAa,GAAG,4BAAWF,MAAX,CAAtB;AACA,MAAM,CAACG,OAAD,EAAUC,UAAV,IAAwB,qBAAS,EAAT,CAA9B;AAEA,wBAAU,MAAM;AACd,QAAMC,IAAI,GACRJ,WAAW,KAAK,KAAhB,GACI,kBADJ,aAEOA,WAFP,qBADF;AAIAG,IAAAA,UAAU,CAACC,IAAD,CAAV;AACD,GAND,EAMG,CAACJ,WAAD,CANH;AAQA,MAAMK,KAAK,GAAG,EAAd;;AACA,MAAI;AACF,QAAIL,WAAW,KAAK,KAApB,EAA2B;AACzB,UAAMM,UAAU,GAAG,8BAAcT,GAAd,CAAnB;AACAU,MAAAA,MAAM,CAACC,OAAP,CAAeF,UAAf,EAA2BG,OAA3B,CAAmC,SAAqB;AAAA,YAApB,CAACC,QAAD,EAAWC,GAAX,CAAoB;AACtDN,QAAAA,KAAK,CAACK,QAAD,CAAL,GAAkBC,GAAG,CAACC,WAAJ,CAAgBd,MAAhB,EAAwBG,aAAxB,CAAlB;AACD,OAFD;AAGD,KALD,MAKO;AACL,UAAMU,GAAG,GAAG,kCAAiBX,WAAjB,EAA8BH,GAA9B,CAAZ;AACAQ,MAAAA,KAAK,CAACL,WAAD,CAAL,GAAqBW,GAAG,CAAEC,WAAL,CAAiBd,MAAjB,EAAyBG,aAAzB,CAArB;AACD;AACF,GAVD,CAUE,gBAAM;AACN,WACE,6BAAC,gBAAD,wGADF;AAMD;;AAED,SACE,4DACE,6BAAC,mBAAD;AAAS,IAAA,EAAE,EAAC,IAAZ;AAAiB,IAAA,EAAE,EAAC;AAApB,KACGC,OADH,CADF,EAIGF,WAAW,KAAK,KAAhB,GACC,6BAAC,0BAAD;AAAc,IAAA,KAAK,EAAEK;AAArB,IADD,GAGC,6BAAC,oBAAD;AAAU,IAAA,IAAI,EAAEA,KAAK,CAACL,WAAD,CAArB;AAAoC,IAAA,QAAQ,EAAEA;AAA9C,IAPJ,CADF;AAYD,CAjDM","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 { FC } from 'react'\nimport React, { useEffect, useState } from 'react'\nimport type { ApiModel, IMethod } from '@looker/sdk-codegen'\nimport { getCodeGenerator, trimInputs } from '@looker/sdk-codegen'\nimport { Heading } from '@looker/components'\nimport { CodeCopy } from '@looker/code-editor'\n\nimport type { RunItValues } from '../../RunIt'\nimport { DarkSpan } from '../common'\nimport { DocMultiCall } from './DocMultiCall'\nimport { getGenerators } from './callUtils'\n\nexport interface DocSdkCallsProps {\n /** API spec */\n api: ApiModel\n /** current method */\n method: IMethod\n /** Entered RunIt form values */\n inputs: RunItValues\n /** Language to generate Sdk calls in*/\n sdkLanguage: string\n}\n\n/**\n * Generates the SDK call syntax for a given language or all supported languages\n */\nexport const DocSdkCalls: FC<DocSdkCallsProps> = ({\n api,\n method,\n inputs,\n sdkLanguage = 'All',\n}) => {\n const trimmedInputs = trimInputs(inputs)\n const [heading, setHeading] = useState('')\n\n useEffect(() => {\n const text =\n sdkLanguage === 'All'\n ? 'SDKs call syntax'\n : `${sdkLanguage} SDK call syntax`\n setHeading(text)\n }, [sdkLanguage])\n\n const calls = {}\n try {\n if (sdkLanguage === 'All') {\n const generators = getGenerators(api)\n Object.entries(generators).forEach(([language, gen]) => {\n calls[language] = gen.makeTheCall(method, trimmedInputs)\n })\n } else {\n const gen = getCodeGenerator(sdkLanguage, api)\n calls[sdkLanguage] = gen!.makeTheCall(method, trimmedInputs)\n }\n } catch {\n return (\n <DarkSpan>\n Cannot generate SDK call syntax. Ensure all complex structures in the\n request form are valid.\n </DarkSpan>\n )\n }\n\n return (\n <>\n <Heading as=\"h4\" mb=\"medium\">\n {heading}\n </Heading>\n {sdkLanguage === 'All' ? (\n <DocMultiCall calls={calls} />\n ) : (\n <CodeCopy code={calls[sdkLanguage]} language={sdkLanguage} />\n )}\n </>\n )\n}\n"],"file":"DocSdkCalls.js"}
1
+ {"version":3,"file":"DocSdkCalls.js","names":["DocSdkCalls","api","method","inputs","sdkLanguage","keepBody","heading","setHeading","useState","trimmed","trimInputs","useEffect","text","calls","generators","getGenerators","Object","entries","forEach","language","gen","makeTheCall","getCodeGenerator"],"sources":["../../../src/components/DocSdkCalls/DocSdkCalls.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 */\n\nimport type { FC } from 'react'\nimport React, { useEffect, useState } from 'react'\nimport type { ApiModel, IMethod } from '@looker/sdk-codegen'\nimport { getCodeGenerator, trimInputs } from '@looker/sdk-codegen'\nimport { Heading } from '@looker/components'\nimport { CodeCopy } from '@looker/code-editor'\n\nimport type { RunItValues } from '../../RunIt'\nimport { DarkSpan } from '../common'\nimport { DocMultiCall } from './DocMultiCall'\nimport { getGenerators } from './callUtils'\n\nexport interface DocSdkCallsProps {\n /** API spec */\n api: ApiModel\n /** current method */\n method: IMethod\n /** Entered RunIt form values */\n inputs: RunItValues\n /** Language to generate Sdk calls in*/\n sdkLanguage: string\n /** true to not trim the body params */\n keepBody?: boolean\n}\n\n/**\n * Generates the SDK call syntax for a given language or all supported languages\n */\nexport const DocSdkCalls: FC<DocSdkCallsProps> = ({\n api,\n method,\n inputs,\n sdkLanguage = 'All',\n keepBody = false,\n}) => {\n const [heading, setHeading] = useState('')\n const trimmed = trimInputs(inputs, keepBody)\n\n useEffect(() => {\n const text =\n sdkLanguage === 'All'\n ? 'SDKs call syntax'\n : `${sdkLanguage} SDK call syntax`\n setHeading(text)\n }, [sdkLanguage])\n\n const calls = {}\n try {\n if (sdkLanguage === 'All') {\n const generators = getGenerators(api)\n Object.entries(generators).forEach(([language, gen]) => {\n calls[language] = gen.makeTheCall(method, trimmed)\n })\n } else {\n const gen = getCodeGenerator(sdkLanguage, api)\n calls[sdkLanguage] = gen!.makeTheCall(method, trimmed)\n }\n } catch {\n return (\n <DarkSpan>\n Cannot generate SDK call syntax. Ensure all complex structures in the\n request form are valid.\n </DarkSpan>\n )\n }\n\n return (\n <>\n <Heading as=\"h4\" mb=\"medium\">\n {heading}\n </Heading>\n {sdkLanguage === 'All' ? (\n <DocMultiCall calls={calls} />\n ) : (\n <CodeCopy code={calls[sdkLanguage]} language={sdkLanguage} />\n )}\n </>\n )\n}\n"],"mappings":";;;;;;AA2BA;AAEA;AACA;AACA;AAGA;AACA;AACA;AAA2C;AAAA;AAkBpC,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AAC,0BAAY;IAAC,KAAK,EAAES;EAAM,EAAG,GAE9B,6BAAC,oBAAQ;IAAC,IAAI,EAAEA,KAAK,CAACT,WAAW,CAAE;IAAC,QAAQ,EAAEA;EAAY,EAC3D,CACA;AAEP,CAAC;AAAA"}
@@ -4,18 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getGenerators = void 0;
7
-
8
7
  var _sdkCodegen = require("@looker/sdk-codegen");
9
-
10
8
  var getGenerators = api => {
11
9
  var codeGens = {};
12
-
13
10
  _sdkCodegen.codeGenerators.filter(x => x.factory !== undefined).forEach(gen => {
14
11
  codeGens[gen.language] = gen.factory(api);
15
12
  });
16
-
17
13
  return codeGens;
18
14
  };
19
-
20
15
  exports.getGenerators = getGenerators;
21
16
  //# sourceMappingURL=callUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DocSdkCalls/callUtils.ts"],"names":["getGenerators","api","codeGens","codeGenerators","filter","x","factory","undefined","forEach","gen","language"],"mappings":";;;;;;;AA0BA;;AAMO,IAAMA,aAAa,GAAIC,GAAD,IAA6C;AACxE,MAAMC,QAAQ,GAAG,EAAjB;;AACAC,6BACGC,MADH,CACWC,CAAD,IAAOA,CAAC,CAACC,OAAF,KAAcC,SAD/B,EAEGC,OAFH,CAEYC,GAAD,IAAS;AAChBP,IAAAA,QAAQ,CAACO,GAAG,CAACC,QAAL,CAAR,GAAyBD,GAAG,CAACH,OAAJ,CAAaL,GAAb,CAAzB;AACD,GAJH;;AAKA,SAAOC,QAAP;AACD,CARM","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 { ApiModel, CodeGen, KeyedCollection } from '@looker/sdk-codegen'\nimport { codeGenerators } from '@looker/sdk-codegen'\n\n/**\n * Returns a collection of generators for all supported (non legacy) languages\n * @param api Api spec\n */\nexport const getGenerators = (api: ApiModel): KeyedCollection<CodeGen> => {\n const codeGens = {}\n codeGenerators\n .filter((x) => x.factory !== undefined)\n .forEach((gen) => {\n codeGens[gen.language] = gen.factory!(api)\n })\n return codeGens\n}\n"],"file":"callUtils.js"}
1
+ {"version":3,"file":"callUtils.js","names":["getGenerators","api","codeGens","codeGenerators","filter","x","factory","undefined","forEach","gen","language"],"sources":["../../../src/components/DocSdkCalls/callUtils.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 type { ApiModel, CodeGen, KeyedCollection } from '@looker/sdk-codegen'\nimport { codeGenerators } from '@looker/sdk-codegen'\n\n/**\n * Returns a collection of generators for all supported (non legacy) languages\n * @param api Api spec\n */\nexport const getGenerators = (api: ApiModel): KeyedCollection<CodeGen> => {\n const codeGens = {}\n codeGenerators\n .filter((x) => x.factory !== undefined)\n .forEach((gen) => {\n codeGens[gen.language] = gen.factory!(api)\n })\n return codeGens\n}\n"],"mappings":";;;;;;AA0BA;AAMO,IAAMA,aAAa,GAAIC,GAAa,IAA+B;EACxE,IAAMC,QAAQ,GAAG,CAAC,CAAC;EACnBC,0BAAc,CACXC,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAKC,SAAS,CAAC,CACtCC,OAAO,CAAEC,GAAG,IAAK;IAChBP,QAAQ,CAACO,GAAG,CAACC,QAAQ,CAAC,GAAGD,GAAG,CAACH,OAAO,CAAEL,GAAG,CAAC;EAC5C,CAAC,CAAC;EACJ,OAAOC,QAAQ;AACjB,CAAC;AAAA"}
@@ -3,20 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "getGenerators", {
6
+ Object.defineProperty(exports, "DocSdkCalls", {
7
7
  enumerable: true,
8
8
  get: function get() {
9
- return _callUtils.getGenerators;
9
+ return _DocSdkCalls.DocSdkCalls;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "DocSdkCalls", {
12
+ Object.defineProperty(exports, "getGenerators", {
13
13
  enumerable: true,
14
14
  get: function get() {
15
- return _DocSdkCalls.DocSdkCalls;
15
+ return _callUtils.getGenerators;
16
16
  }
17
17
  });
18
-
19
18
  var _callUtils = require("./callUtils");
20
-
21
19
  var _DocSdkCalls = require("./DocSdkCalls");
22
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DocSdkCalls/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA0BA;;AACA","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 { getGenerators } from './callUtils'\nexport { DocSdkCalls } from './DocSdkCalls'\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/DocSdkCalls/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 { getGenerators } from './callUtils'\nexport { DocSdkCalls } from './DocSdkCalls'\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA;AACA"}
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Loading = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _components = require("@looker/components");
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  var Loading = _ref => {
15
11
  var {
16
12
  loading,
@@ -24,6 +20,5 @@ var Loading = _ref => {
24
20
  color: "text"
25
21
  }, message)));
26
22
  };
27
-
28
23
  exports.Loading = Loading;
29
24
  //# sourceMappingURL=Loading.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Loading/Loading.tsx"],"names":["Loading","loading","message"],"mappings":";;;;;;;AA2BA;;AACA;;;;AAOO,IAAMA,OAAyB,GAAG;AAAA,MAAC;AACxCC,IAAAA,OADwC;AAExCC,IAAAA,OAAO,GAAG;AAF8B,GAAD;AAAA,SAIvC,4DACGD,OAAO,IACN,6BAAC,iBAAD;AAAO,IAAA,GAAG,EAAC;AAAX,KACE,6BAAC,4BAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,IADF,EAEE,6BAAC,gBAAD;AAAM,IAAA,KAAK,EAAC;AAAZ,KAAoBC,OAApB,CAFF,CAFJ,CAJuC;AAAA,CAAlC","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 { FC } from 'react'\nimport React from 'react'\nimport { Space, ProgressCircular, Text } from '@looker/components'\n\ninterface LoadingProps {\n loading: boolean\n message?: string\n}\n\nexport const Loading: FC<LoadingProps> = ({\n loading,\n message = 'Loading ...',\n}) => (\n <>\n {loading && (\n <Space gap=\"small\">\n <ProgressCircular size=\"small\" />\n <Text color=\"text\">{message}</Text>\n </Space>\n )}\n </>\n)\n"],"file":"Loading.js"}
1
+ {"version":3,"file":"Loading.js","names":["Loading","loading","message"],"sources":["../../../src/components/Loading/Loading.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 */\n\nimport type { FC } from 'react'\nimport React from 'react'\nimport { Space, ProgressCircular, Text } from '@looker/components'\n\ninterface LoadingProps {\n loading: boolean\n message?: string\n}\n\nexport const Loading: FC<LoadingProps> = ({\n loading,\n message = 'Loading ...',\n}) => (\n <>\n {loading && (\n <Space gap=\"small\">\n <ProgressCircular size=\"small\" />\n <Text color=\"text\">{message}</Text>\n </Space>\n )}\n </>\n)\n"],"mappings":";;;;;;AA2BA;AACA;AAAkE;AAO3D,IAAMA,OAAyB,GAAG;EAAA,IAAC;IACxCC,OAAO;IACPC,OAAO,GAAG;EACZ,CAAC;EAAA,OACC,4DACGD,OAAO,IACN,6BAAC,iBAAK;IAAC,GAAG,EAAC;EAAO,GAChB,6BAAC,4BAAgB;IAAC,IAAI,EAAC;EAAO,EAAG,EACjC,6BAAC,gBAAI;IAAC,KAAK,EAAC;EAAM,GAAEC,OAAO,CAAQ,CAEtC,CACA;AAAA,CACJ;AAAA"}
@@ -9,6 +9,5 @@ Object.defineProperty(exports, "Loading", {
9
9
  return _Loading.Loading;
10
10
  }
11
11
  });
12
-
13
12
  var _Loading = require("./Loading");
14
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Loading/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AA0BA","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 { Loading } from './Loading'\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Loading/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 { Loading } from './Loading'\n"],"mappings":";;;;;;;;;;;AA0BA"}
@@ -3,55 +3,40 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.LoginForm = exports.notReadyToLogin = exports.readyToLogin = void 0;
7
-
6
+ exports.readyToLogin = exports.notReadyToLogin = exports.LoginForm = void 0;
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _components = require("@looker/components");
11
-
12
9
  var _extensionUtils = require("@looker/extension-utils");
13
-
14
10
  var _ConfigForm = require("../ConfigForm");
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
12
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
19
-
20
13
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
21
-
22
14
  var readyToLogin = 'OAuth is configured but your browser session is not authenticated. Click Login to enable RunIt.';
23
15
  exports.readyToLogin = readyToLogin;
24
16
  var notReadyToLogin = 'OAuth is not configured. Configure it to be able to Login.';
25
17
  exports.notReadyToLogin = notReadyToLogin;
26
-
27
18
  var LoginForm = _ref => {
28
19
  var {
29
20
  requestContent
30
21
  } = _ref;
31
22
  var adaptor = (0, _extensionUtils.getEnvAdaptor)();
32
-
33
23
  var handleLogin = function () {
34
24
  var _ref2 = _asyncToGenerator(function* (e) {
35
25
  e.preventDefault();
36
-
37
26
  if (requestContent) {
38
27
  adaptor.localStorageSetItem(_ConfigForm.RunItFormKey, JSON.stringify(requestContent));
39
28
  }
40
-
41
29
  yield adaptor.login();
42
30
  });
43
-
44
31
  return function handleLogin(_x) {
45
32
  return _ref2.apply(this, arguments);
46
33
  };
47
34
  }();
48
-
49
35
  return _react.default.createElement(_components.Tooltip, {
50
36
  content: adaptor.sdk.authSession.settings.authIsConfigured() ? readyToLogin : notReadyToLogin
51
37
  }, _react.default.createElement(_components.Button, {
52
38
  onClick: handleLogin
53
39
  }, "Login"));
54
40
  };
55
-
56
41
  exports.LoginForm = LoginForm;
57
42
  //# sourceMappingURL=LoginForm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/LoginForm/LoginForm.tsx"],"names":["readyToLogin","notReadyToLogin","LoginForm","requestContent","adaptor","handleLogin","e","preventDefault","localStorageSetItem","RunItFormKey","JSON","stringify","login","sdk","authSession","settings","authIsConfigured"],"mappings":";;;;;;;AA2BA;;AACA;;AAEA;;AAEA;;;;;;;;AAOO,IAAMA,YAAY,GACvB,iGADK;;AAGA,IAAMC,eAAe,GAC1B,4DADK;;;AAGA,IAAMC,SAA6B,GAAG,QAAwB;AAAA,MAAvB;AAAEC,IAAAA;AAAF,GAAuB;AACnE,MAAMC,OAAO,GAAG,oCAAhB;;AACA,MAAMC,WAAW;AAAA,kCAAG,WAAOC,CAAP,EAAiC;AACnDA,MAAAA,CAAC,CAACC,cAAF;;AACA,UAAIJ,cAAJ,EAAoB;AAClBC,QAAAA,OAAO,CAACI,mBAAR,CAA4BC,wBAA5B,EAA0CC,IAAI,CAACC,SAAL,CAAeR,cAAf,CAA1C;AACD;;AAED,YAAMC,OAAO,CAACQ,KAAR,EAAN;AACD,KAPgB;;AAAA,oBAAXP,WAAW;AAAA;AAAA;AAAA,KAAjB;;AASA,SACE,6BAAC,mBAAD;AACE,IAAA,OAAO,EAEHD,OAAO,CAACS,GAAR,CAAYC,WAAZ,CAAwBC,QAD1B,CAEEC,gBAFF,KAGIhB,YAHJ,GAIIC;AANR,KASE,6BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAEI;AAAjB,aATF,CADF;AAaD,CAxBM","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 { BaseSyntheticEvent, FC } from 'react'\nimport React from 'react'\nimport { Button, Tooltip } from '@looker/components'\nimport type { OAuthConfigProvider } from '@looker/extension-utils'\nimport { getEnvAdaptor } from '@looker/extension-utils'\n\nimport { RunItFormKey } from '../ConfigForm'\nimport type { RunItValues } from '../..'\n\ninterface LoginFormProps {\n requestContent: RunItValues\n}\n\nexport const readyToLogin =\n 'OAuth is configured but your browser session is not authenticated. Click Login to enable RunIt.'\n\nexport const notReadyToLogin =\n 'OAuth is not configured. Configure it to be able to Login.'\n\nexport const LoginForm: FC<LoginFormProps> = ({ requestContent }) => {\n const adaptor = getEnvAdaptor()\n const handleLogin = async (e: BaseSyntheticEvent) => {\n e.preventDefault()\n if (requestContent) {\n adaptor.localStorageSetItem(RunItFormKey, JSON.stringify(requestContent))\n }\n // This will set storage variables and return to OAuthScene when successful\n await adaptor.login()\n }\n\n return (\n <Tooltip\n content={\n (\n adaptor.sdk.authSession.settings as OAuthConfigProvider\n ).authIsConfigured()\n ? readyToLogin\n : notReadyToLogin\n }\n >\n <Button onClick={handleLogin}>Login</Button>\n </Tooltip>\n )\n}\n"],"file":"LoginForm.js"}
1
+ {"version":3,"file":"LoginForm.js","names":["readyToLogin","notReadyToLogin","LoginForm","requestContent","adaptor","getEnvAdaptor","handleLogin","e","preventDefault","localStorageSetItem","RunItFormKey","JSON","stringify","login","sdk","authSession","settings","authIsConfigured"],"sources":["../../../src/components/LoginForm/LoginForm.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 */\n\nimport type { BaseSyntheticEvent, FC } from 'react'\nimport React from 'react'\nimport { Button, Tooltip } from '@looker/components'\nimport type { OAuthConfigProvider } from '@looker/extension-utils'\nimport { getEnvAdaptor } from '@looker/extension-utils'\n\nimport { RunItFormKey } from '../ConfigForm'\nimport type { RunItValues } from '../..'\n\ninterface LoginFormProps {\n requestContent: RunItValues\n}\n\nexport const readyToLogin =\n 'OAuth is configured but your browser session is not authenticated. Click Login to enable RunIt.'\n\nexport const notReadyToLogin =\n 'OAuth is not configured. Configure it to be able to Login.'\n\nexport const LoginForm: FC<LoginFormProps> = ({ requestContent }) => {\n const adaptor = getEnvAdaptor()\n const handleLogin = async (e: BaseSyntheticEvent) => {\n e.preventDefault()\n if (requestContent) {\n adaptor.localStorageSetItem(RunItFormKey, JSON.stringify(requestContent))\n }\n // This will set storage variables and return to OAuthScene when successful\n await adaptor.login()\n }\n\n return (\n <Tooltip\n content={\n (\n adaptor.sdk.authSession.settings as OAuthConfigProvider\n ).authIsConfigured()\n ? readyToLogin\n : notReadyToLogin\n }\n >\n <Button onClick={handleLogin}>Login</Button>\n </Tooltip>\n )\n}\n"],"mappings":";;;;;;AA2BA;AACA;AAEA;AAEA;AAA4C;AAAA;AAAA;AAOrC,IAAMA,YAAY,GACvB,iGAAiG;AAAA;AAE5F,IAAMC,eAAe,GAC1B,4DAA4D;AAAA;AAEvD,IAAMC,SAA6B,GAAG,QAAwB;EAAA,IAAvB;IAAEC;EAAe,CAAC;EAC9D,IAAMC,OAAO,GAAG,IAAAC,6BAAa,GAAE;EAC/B,IAAMC,WAAW;IAAA,8BAAG,WAAOC,CAAqB,EAAK;MACnDA,CAAC,CAACC,cAAc,EAAE;MAClB,IAAIL,cAAc,EAAE;QAClBC,OAAO,CAACK,mBAAmB,CAACC,wBAAY,EAAEC,IAAI,CAACC,SAAS,CAACT,cAAc,CAAC,CAAC;MAC3E;MAEA,MAAMC,OAAO,CAACS,KAAK,EAAE;IACvB,CAAC;IAAA,gBAPKP,WAAW;MAAA;IAAA;EAAA,GAOhB;EAED,OACE,6BAAC,mBAAO;IACN,OAAO,EAEHF,OAAO,CAACU,GAAG,CAACC,WAAW,CAACC,QAAQ,CAChCC,gBAAgB,EAAE,GAChBjB,YAAY,GACZC;EACL,GAED,6BAAC,kBAAM;IAAC,OAAO,EAAEK;EAAY,GAAC,OAAK,CAAS,CACpC;AAEd,CAAC;AAAA"}
@@ -15,6 +15,5 @@ Object.defineProperty(exports, "readyToLogin", {
15
15
  return _LoginForm.readyToLogin;
16
16
  }
17
17
  });
18
-
19
18
  var _LoginForm = require("./LoginForm");
20
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/LoginForm/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA0BA","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 { LoginForm, readyToLogin } from './LoginForm'\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/LoginForm/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 { LoginForm, readyToLogin } from './LoginForm'\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA"}
@@ -3,57 +3,43 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.MethodBadge = exports.cssForIntent = exports.pickBadgeIntent = void 0;
7
-
6
+ exports.pickBadgeIntent = exports.cssForIntent = exports.MethodBadge = void 0;
8
7
  var _designTokens = require("@looker/design-tokens");
9
-
10
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
-
12
9
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
-
14
10
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
11
  var pickBadgeIntent = type => {
17
12
  switch (type) {
18
13
  case 'alpha':
19
14
  case 'DELETE':
20
15
  case 'deprecated':
21
16
  return 'critical';
22
-
23
17
  case 'HEAD':
24
18
  return 'neutral';
25
-
26
19
  case 'PATCH':
27
20
  case 'TRACE':
28
21
  case 'experimental':
29
22
  case 'undocumented':
30
23
  return 'warn';
31
-
32
24
  case 'POST':
33
25
  case 'stable':
34
26
  return 'positive';
35
-
36
27
  case 'PUT':
37
28
  case 'beta':
38
29
  return 'key';
39
-
40
30
  case 'GET':
41
31
  default:
42
32
  return 'inform';
43
33
  }
44
34
  };
45
-
46
35
  exports.pickBadgeIntent = pickBadgeIntent;
47
-
48
36
  var cssForIntent = intent => (0, _styledComponents.css)(["background:", ";color:", ";"], (0, _designTokens.intentUIBlend)(intent, 1), _ref => {
49
37
  var {
50
38
  theme
51
39
  } = _ref;
52
40
  return (0, _designTokens.generatePressed)(theme.colors[intent]);
53
41
  });
54
-
55
42
  exports.cssForIntent = cssForIntent;
56
-
57
43
  var MethodBadge = _styledComponents.default.div.attrs(_ref2 => {
58
44
  var {
59
45
  fontSize = 'xsmall',
@@ -108,6 +94,5 @@ var MethodBadge = _styledComponents.default.div.attrs(_ref2 => {
108
94
  } = _ref8;
109
95
  return "".concat(space.xxsmall, " ").concat(compact ? space.none : space.xsmall);
110
96
  });
111
-
112
97
  exports.MethodBadge = MethodBadge;
113
98
  //# sourceMappingURL=MethodBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MethodBadge/MethodBadge.tsx"],"names":["pickBadgeIntent","type","cssForIntent","intent","css","theme","colors","MethodBadge","styled","div","attrs","fontSize","fontWeight","minWidth","typography","titleStatus","ui1","radii","medium","compact","space","xxsmall","none","xsmall"],"mappings":";;;;;;;AA8BA;;AAMA;;;;;;AAmCO,IAAMA,eAAe,GAAIC,IAAD,IAA8C;AAC3E,UAAQA,IAAR;AACE,SAAK,OAAL;AACA,SAAK,QAAL;AACA,SAAK,YAAL;AACE,aAAO,UAAP;;AACF,SAAK,MAAL;AACE,aAAO,SAAP;;AACF,SAAK,OAAL;AACA,SAAK,OAAL;AACA,SAAK,cAAL;AACA,SAAK,cAAL;AACE,aAAO,MAAP;;AACF,SAAK,MAAL;AACA,SAAK,QAAL;AACE,aAAO,UAAP;;AACF,SAAK,KAAL;AACA,SAAK,MAAL;AACE,aAAO,KAAP;;AACF,SAAK,KAAL;AACA;AACE,aAAO,QAAP;AApBJ;AAsBD,CAvBM;;;;AAyBA,IAAMC,YAAY,GAAIC,MAAD,QAC1BC,qBAD0B,mCAEV,iCAAcD,MAAd,EAAsB,CAAtB,CAFU,EAGf;AAAA,MAAC;AAAEE,IAAAA;AAAF,GAAD;AAAA,SAAe,mCAAgBA,KAAK,CAACC,MAAN,CAAaH,MAAb,CAAhB,CAAf;AAAA,CAHe,CAArB;;;;AAMA,IAAMI,WAAW,GAAGC,0BAAOC,GAAP,CAAWC,KAAX,CACzB;AAAA,MAAC;AACCC,IAAAA,QAAQ,GAAG,QADZ;AAECC,IAAAA,UAAU,GAAG,UAFd;AAGCC,IAAAA,QAAQ,GAAG;AAHZ,GAAD;AAAA,SAIyB;AACvBF,IAAAA,QADuB;AAEvBC,IAAAA,UAFuB;AAGvBC,IAAAA;AAHuB,GAJzB;AAAA,CADyB,CAAH;AAAA;AAAA;AAAA,oHAWpBC,wBAXoB,EAapB;AAAA,MAAC;AAAEb,IAAAA;AAAF,GAAD;AAAA,SAAcC,YAAY,CAACF,eAAe,CAACC,IAAD,CAAhB,CAA1B;AAAA,CAboB,EAeR;AAAA,MAAC;AAAEA,IAAAA,IAAF;AAAQc,IAAAA,WAAR;AAAqBV,IAAAA,KAAK,EAAE;AAAEC,MAAAA;AAAF;AAA5B,GAAD;AAAA,SACZS,WAAW,GAAGT,MAAM,CAACU,GAAV,GAAgB,iCAAchB,eAAe,CAACC,IAAD,CAA7B,EAAqC,CAArC,CADf;AAAA,CAfQ,EAkBL;AAAA,MAAC;AAAEI,IAAAA,KAAK,EAAE;AAAEY,MAAAA;AAAF;AAAT,GAAD;AAAA,SAA0BA,KAAK,CAACC,MAAhC;AAAA,CAlBK,EAqBpB;AAAA,MAAC;AAAEC,IAAAA;AAAF,GAAD;AAAA,SAAiBA,OAAO,qBAAxB;AAAA,CArBoB,EAuBT;AAAA,MAAC;AAAEN,IAAAA;AAAF,GAAD;AAAA,SAAkBA,QAAlB;AAAA,CAvBS,EAwBX;AAAA,MAAC;AAAEM,IAAAA,OAAF;AAAWd,IAAAA,KAAK,EAAE;AAAEe,MAAAA;AAAF;AAAlB,GAAD;AAAA,mBACNA,KAAK,CAACC,OADA,cACWF,OAAO,GAAGC,KAAK,CAACE,IAAT,GAAgBF,KAAK,CAACG,MADxC;AAAA,CAxBW,CAAjB","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 {\n CompatibleHTMLProps,\n TypographyProps,\n} from '@looker/design-tokens'\nimport {\n generatePressed,\n intentUIBlend,\n typography,\n} from '@looker/design-tokens'\nimport type { HttpMethod } from '@looker/sdk-rtl'\nimport styled, { css } from 'styled-components'\n\n/**\n * Status of endpoint method.\n */\ntype MethodStatus =\n | 'alpha'\n | 'beta'\n | 'stable'\n | 'experimental'\n | 'deprecated'\n | 'inform'\n | 'undocumented'\n\ninterface MethodBadgeProps\n extends CompatibleHTMLProps<HTMLDivElement>,\n TypographyProps {\n /** Determines background color */\n type: HttpMethod | MethodStatus | string\n compact?: boolean\n minWidth?: string\n titleStatus?: boolean\n}\n\n/**\n * Intent names to display the correct color for the badge based on the HTTP method or method status.\n */\ntype ApixIntentNames =\n | 'critical'\n | 'inform'\n | 'key'\n | 'neutral'\n | 'positive'\n | 'warn'\n\nexport const pickBadgeIntent = (type: HttpMethod | MethodStatus | string) => {\n switch (type) {\n case 'alpha':\n case 'DELETE':\n case 'deprecated':\n return 'critical'\n case 'HEAD':\n return 'neutral'\n case 'PATCH':\n case 'TRACE':\n case 'experimental':\n case 'undocumented':\n return 'warn'\n case 'POST':\n case 'stable':\n return 'positive'\n case 'PUT':\n case 'beta':\n return 'key'\n case 'GET':\n default:\n return 'inform'\n }\n}\n\nexport const cssForIntent = (intent: ApixIntentNames) =>\n css`\n background: ${intentUIBlend(intent, 1)};\n color: ${({ theme }) => generatePressed(theme.colors[intent])};\n `\n\nexport const MethodBadge = styled.div.attrs(\n ({\n fontSize = 'xsmall',\n fontWeight = 'semiBold',\n minWidth = '2.5rem',\n }: MethodBadgeProps) => ({\n fontSize,\n fontWeight,\n minWidth,\n })\n)<MethodBadgeProps>`\n ${typography}\n\n ${({ type }) => cssForIntent(pickBadgeIntent(type))};\n\n background: ${({ type, titleStatus, theme: { colors } }) =>\n titleStatus ? colors.ui1 : intentUIBlend(pickBadgeIntent(type), 1)};\n border: 1px solid transparent;\n border-radius: ${({ theme: { radii } }) => radii.medium};\n\n /** NOTE: This is below minimum accessibility threshold font-size */\n ${({ compact }) => compact && `font-size: 9px;`}\n\n min-width: ${({ minWidth }) => minWidth};\n padding: ${({ compact, theme: { space } }) =>\n `${space.xxsmall} ${compact ? space.none : space.xsmall}`};\n`\n"],"file":"MethodBadge.js"}
1
+ {"version":3,"file":"MethodBadge.js","names":["pickBadgeIntent","type","cssForIntent","intent","css","intentUIBlend","theme","generatePressed","colors","MethodBadge","styled","div","attrs","fontSize","fontWeight","minWidth","typography","titleStatus","ui1","radii","medium","compact","space","xxsmall","none","xsmall"],"sources":["../../../src/components/MethodBadge/MethodBadge.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 */\n\nimport type {\n CompatibleHTMLProps,\n TypographyProps,\n} from '@looker/design-tokens'\nimport {\n generatePressed,\n intentUIBlend,\n typography,\n} from '@looker/design-tokens'\nimport type { HttpMethod } from '@looker/sdk-rtl'\nimport styled, { css } from 'styled-components'\n\n/**\n * Status of endpoint method.\n */\ntype MethodStatus =\n | 'alpha'\n | 'beta'\n | 'stable'\n | 'experimental'\n | 'deprecated'\n | 'inform'\n | 'undocumented'\n\ninterface MethodBadgeProps\n extends CompatibleHTMLProps<HTMLDivElement>,\n TypographyProps {\n /** Determines background color */\n type: HttpMethod | MethodStatus | string\n compact?: boolean\n minWidth?: string\n titleStatus?: boolean\n}\n\n/**\n * Intent names to display the correct color for the badge based on the HTTP method or method status.\n */\ntype ApixIntentNames =\n | 'critical'\n | 'inform'\n | 'key'\n | 'neutral'\n | 'positive'\n | 'warn'\n\nexport const pickBadgeIntent = (type: HttpMethod | MethodStatus | string) => {\n switch (type) {\n case 'alpha':\n case 'DELETE':\n case 'deprecated':\n return 'critical'\n case 'HEAD':\n return 'neutral'\n case 'PATCH':\n case 'TRACE':\n case 'experimental':\n case 'undocumented':\n return 'warn'\n case 'POST':\n case 'stable':\n return 'positive'\n case 'PUT':\n case 'beta':\n return 'key'\n case 'GET':\n default:\n return 'inform'\n }\n}\n\nexport const cssForIntent = (intent: ApixIntentNames) =>\n css`\n background: ${intentUIBlend(intent, 1)};\n color: ${({ theme }) => generatePressed(theme.colors[intent])};\n `\n\nexport const MethodBadge = styled.div.attrs(\n ({\n fontSize = 'xsmall',\n fontWeight = 'semiBold',\n minWidth = '2.5rem',\n }: MethodBadgeProps) => ({\n fontSize,\n fontWeight,\n minWidth,\n })\n)<MethodBadgeProps>`\n ${typography}\n\n ${({ type }) => cssForIntent(pickBadgeIntent(type))};\n\n background: ${({ type, titleStatus, theme: { colors } }) =>\n titleStatus ? colors.ui1 : intentUIBlend(pickBadgeIntent(type), 1)};\n border: 1px solid transparent;\n border-radius: ${({ theme: { radii } }) => radii.medium};\n\n /** NOTE: This is below minimum accessibility threshold font-size */\n ${({ compact }) => compact && `font-size: 9px;`}\n\n min-width: ${({ minWidth }) => minWidth};\n padding: ${({ compact, theme: { space } }) =>\n `${space.xxsmall} ${compact ? space.none : space.xsmall}`};\n`\n"],"mappings":";;;;;;AA8BA;AAMA;AAA+C;AAAA;AAmCxC,IAAMA,eAAe,GAAIC,IAAwC,IAAK;EAC3E,QAAQA,IAAI;IACV,KAAK,OAAO;IACZ,KAAK,QAAQ;IACb,KAAK,YAAY;MACf,OAAO,UAAU;IACnB,KAAK,MAAM;MACT,OAAO,SAAS;IAClB,KAAK,OAAO;IACZ,KAAK,OAAO;IACZ,KAAK,cAAc;IACnB,KAAK,cAAc;MACjB,OAAO,MAAM;IACf,KAAK,MAAM;IACX,KAAK,QAAQ;MACX,OAAO,UAAU;IACnB,KAAK,KAAK;IACV,KAAK,MAAM;MACT,OAAO,KAAK;IACd,KAAK,KAAK;IACV;MACE,OAAO,QAAQ;EAAA;AAErB,CAAC;AAAA;AAEM,IAAMC,YAAY,GAAIC,MAAuB,QAClDC,qBAAG,mCACa,IAAAC,2BAAa,EAACF,MAAM,EAAE,CAAC,CAAC,EAC7B;EAAA,IAAC;IAAEG;EAAM,CAAC;EAAA,OAAK,IAAAC,6BAAe,EAACD,KAAK,CAACE,MAAM,CAACL,MAAM,CAAC,CAAC;AAAA,EAC9D;AAAA;AAEI,IAAMM,WAAW,GAAGC,yBAAM,CAACC,GAAG,CAACC,KAAK,CACzC;EAAA,IAAC;IACCC,QAAQ,GAAG,QAAQ;IACnBC,UAAU,GAAG,UAAU;IACvBC,QAAQ,GAAG;EACK,CAAC;EAAA,OAAM;IACvBF,QAAQ;IACRC,UAAU;IACVC;EACF,CAAC;AAAA,CAAC,CACH;EAAA;EAAA;AAAA,oHACGC,wBAAU,EAEV;EAAA,IAAC;IAAEf;EAAK,CAAC;EAAA,OAAKC,YAAY,CAACF,eAAe,CAACC,IAAI,CAAC,CAAC;AAAA,GAErC;EAAA,IAAC;IAAEA,IAAI;IAAEgB,WAAW;IAAEX,KAAK,EAAE;MAAEE;IAAO;EAAE,CAAC;EAAA,OACrDS,WAAW,GAAGT,MAAM,CAACU,GAAG,GAAG,IAAAb,2BAAa,EAACL,eAAe,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;AAAA,GAEnD;EAAA,IAAC;IAAEK,KAAK,EAAE;MAAEa;IAAM;EAAE,CAAC;EAAA,OAAKA,KAAK,CAACC,MAAM;AAAA,GAGrD;EAAA,IAAC;IAAEC;EAAQ,CAAC;EAAA,OAAKA,OAAO,qBAAqB;AAAA,GAElC;EAAA,IAAC;IAAEN;EAAS,CAAC;EAAA,OAAKA,QAAQ;AAAA,GAC5B;EAAA,IAAC;IAAEM,OAAO;IAAEf,KAAK,EAAE;MAAEgB;IAAM;EAAE,CAAC;EAAA,iBACpCA,KAAK,CAACC,OAAO,cAAIF,OAAO,GAAGC,KAAK,CAACE,IAAI,GAAGF,KAAK,CAACG,MAAM;AAAA,CAAE,CAC5D;AAAA"}
@@ -9,6 +9,5 @@ Object.defineProperty(exports, "MethodBadge", {
9
9
  return _MethodBadge.MethodBadge;
10
10
  }
11
11
  });
12
-
13
12
  var _MethodBadge = require("./MethodBadge");
14
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MethodBadge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAyBA","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 { MethodBadge } from './MethodBadge'\n"],"file":"index.js"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/MethodBadge/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 { MethodBadge } from './MethodBadge'\n"],"mappings":";;;;;;;;;;;AAyBA"}
@@ -4,22 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PerfChart = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _reactGoogleCharts = require("react-google-charts");
11
-
12
9
  var _components = require("@looker/components");
13
-
14
10
  var _Loading = require("../Loading");
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
12
  var chartItem = (list, desc, offset, start, end) => {
19
13
  if (start > 0) list.push([desc, desc, start - offset, end - offset]);
20
14
  return list;
21
15
  };
22
-
23
16
  var chartData = timings => {
24
17
  var item = timings.entry;
25
18
  var offset = item.startTime;
@@ -47,7 +40,6 @@ var chartData = timings => {
47
40
  chartItem(result, 'processDuration', offset, timings.processStart, timings.processEnd);
48
41
  return result;
49
42
  };
50
-
51
43
  var PerfChart = _ref => {
52
44
  var {
53
45
  loadTimes
@@ -83,13 +75,10 @@ var PerfChart = _ref => {
83
75
  chartWrapper
84
76
  } = _ref2;
85
77
  var container = document.getElementById(chartWrapper.getContainerId());
86
-
87
78
  if (container) {
88
79
  var labels = container.getElementsByTagName('text');
89
-
90
80
  for (var n = 0; n < labels.length; n++) {
91
81
  var textEl = labels.item(n);
92
-
93
82
  if (textEl && parseInt(textEl.innerHTML, 10) > -1) {
94
83
  textEl.innerHTML = '';
95
84
  }
@@ -99,6 +88,5 @@ var PerfChart = _ref => {
99
88
  }]
100
89
  }));
101
90
  };
102
-
103
91
  exports.PerfChart = PerfChart;
104
92
  //# sourceMappingURL=PerfChart.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PerfTracker/PerfChart.tsx"],"names":["chartItem","list","desc","offset","start","end","push","chartData","timings","item","entry","startTime","result","type","id","role","redirectStart","redirectEnd","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","responseStart","responseEnd","fetchStart","requestStart","processStart","processEnd","PerfChart","loadTimes","data","name","transferSize","encodedBodySize","decodedBodySize","eventName","callback","chartWrapper","container","document","getElementById","getContainerId","labels","getElementsByTagName","n","length","textEl","parseInt","innerHTML"],"mappings":";;;;;;;AA2BA;;AACA;;AACA;;AACA;;;;AASA,IAAMA,SAAS,GAAG,CAChBC,IADgB,EAEhBC,IAFgB,EAGhBC,MAHgB,EAIhBC,KAJgB,EAKhBC,GALgB,KAMb;AACH,MAAID,KAAK,GAAG,CAAZ,EAAeH,IAAI,CAACK,IAAL,CAAU,CAACJ,IAAD,EAAOA,IAAP,EAAaE,KAAK,GAAGD,MAArB,EAA6BE,GAAG,GAAGF,MAAnC,CAAV;AACf,SAAOF,IAAP;AACD,CATD;;AAWA,IAAMM,SAAS,GAAIC,OAAD,IAAiC;AACjD,MAAMC,IAAI,GAAGD,OAAO,CAACE,KAArB;AACA,MAAMP,MAAM,GAAGM,IAAI,CAACE,SAApB;AACA,MAAMC,MAAM,GAAG,CACb,CACE;AAAEC,IAAAA,IAAI,EAAE,QAAR;AAAkBC,IAAAA,EAAE,EAAE;AAAtB,GADF,EAEE;AAAED,IAAAA,IAAI,EAAE,QAAR;AAAkBE,IAAAA,IAAI,EAAE;AAAxB,GAFF,EAGE;AAAEF,IAAAA,IAAI,EAAE,QAAR;AAAkBC,IAAAA,EAAE,EAAE;AAAtB,GAHF,EAIE;AAAED,IAAAA,IAAI,EAAE,QAAR;AAAkBC,IAAAA,EAAE,EAAE;AAAtB,GAJF,CADa,CA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+B,MAA/B,CAAf;;AACA,eAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGF,MAAM,CAACG,MAA3B,EAAmCD,CAAC,EAApC,EAAwC;AACtC,gBAAME,MAAM,GAAGJ,MAAM,CAAClC,IAAP,CAAYoC,CAAZ,CAAf;;AAEA,gBAAIE,MAAM,IAAIC,QAAQ,CAACD,MAAM,CAACE,SAAR,EAAmB,EAAnB,CAAR,GAAiC,CAAC,CAAhD,EAAmD;AACjDF,cAAAA,MAAM,CAACE,SAAP,GAAmB,EAAnB;AACD;AACF;AACF;AACF;AAhBH,KADW;AANf,IAzBF,CADF;AAuDD,CA1DM","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 { FC } from 'react'\nimport React from 'react'\nimport { Chart } from 'react-google-charts'\nimport { Heading, Space, Tooltip } from '@looker/components'\nimport { Loading } from '../Loading'\nimport type { IResourceLoadTimes } from './perfUtils'\n\ninterface PerfChartProps {\n /** Performance Resource timing data */\n loadTimes: IResourceLoadTimes\n}\n\n// https://react-google-charts.com/timeline-chart#putting-bars-on-one-row\nconst chartItem = (\n list: any[],\n desc: string,\n offset: number,\n start: number,\n end: number\n) => {\n if (start > 0) list.push([desc, desc, start - offset, end - offset])\n return list\n}\n\nconst chartData = (timings: IResourceLoadTimes) => {\n const item = timings.entry as PerformanceResourceTiming\n const offset = item.startTime\n const result = [\n [\n { type: 'string', id: 'Metric' },\n { type: 'string', role: 'tooltip' },\n { type: 'number', id: 'Start' },\n { type: 'number', id: 'End' },\n ],\n ]\n chartItem(result, 'redirect', offset, item.redirectStart, item.redirectEnd)\n chartItem(\n result,\n 'domainLookup',\n offset,\n item.domainLookupStart,\n item.domainLookupEnd\n )\n chartItem(result, 'connect', offset, item.connectStart, item.connectEnd)\n chartItem(\n result,\n 'secureConnection',\n offset,\n item.secureConnectionStart,\n item.connectEnd\n )\n chartItem(\n result,\n 'responseTime',\n offset,\n item.responseStart,\n item.responseEnd\n )\n chartItem(\n result,\n 'fetchUntilResponseEnd',\n offset,\n item.fetchStart,\n item.responseEnd\n )\n chartItem(\n result,\n 'requestUntilResponseEnd',\n offset,\n item.requestStart,\n item.responseEnd\n )\n chartItem(\n result,\n 'startUntilResponseEnd',\n offset,\n item.startTime,\n item.responseEnd\n )\n chartItem(\n result,\n 'processDuration',\n offset,\n timings.processStart,\n timings.processEnd\n )\n return result\n}\n\nexport const PerfChart: FC<PerfChartProps> = ({ loadTimes }) => {\n const entry = loadTimes.entry as PerformanceResourceTiming\n const data = chartData(loadTimes)\n return (\n <>\n <Heading as=\"h4\">{loadTimes.name}</Heading>\n <Space>\n <Tooltip\n content={`The size (${entry.transferSize} octets) of the fetched resource. The size includes the response header fields plus the response payload body`}\n placement=\"right\"\n textAlign=\"left\"\n >\n <span>Transfer: {entry.transferSize}</span>\n </Tooltip>\n <Tooltip\n content={`The size (${entry.encodedBodySize} octets) received from the fetch (HTTP or cache), of the payload body, before removing any applied content-codings`}\n placement=\"right\"\n textAlign=\"left\"\n >\n <span>Encoded body: {entry.encodedBodySize}</span>\n </Tooltip>\n <Tooltip\n content={`The size (${entry.decodedBodySize} octets) received from the fetch (HTTP or cache) of the message body, after removing any applied content-codings`}\n placement=\"right\"\n textAlign=\"left\"\n >\n <span>Decoded body: {entry.decodedBodySize}</span>\n </Tooltip>\n </Space>\n <Chart\n width={'100%'}\n height={`${8 * 41 + 15}px`}\n chartType=\"Timeline\"\n loader={<Loading loading={true} />}\n data={data}\n chartEvents={[\n {\n eventName: 'ready',\n callback: ({ chartWrapper }) => {\n const container = document.getElementById(\n chartWrapper.getContainerId()\n )\n if (container) {\n const labels = container.getElementsByTagName('text')\n for (let n = 0; n < labels.length; n++) {\n const textEl = labels.item(n)\n // clear any numeric ticks at the bottom of the chart\n if (textEl && parseInt(textEl.innerHTML, 10) > -1) {\n textEl.innerHTML = ''\n }\n }\n }\n },\n },\n ]}\n />\n </>\n )\n}\n"],"file":"PerfChart.js"}
1
+ {"version":3,"file":"PerfChart.js","names":["chartItem","list","desc","offset","start","end","push","chartData","timings","item","entry","startTime","result","type","id","role","redirectStart","redirectEnd","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","responseStart","responseEnd","fetchStart","requestStart","processStart","processEnd","PerfChart","loadTimes","data","name","transferSize","encodedBodySize","decodedBodySize","eventName","callback","chartWrapper","container","document","getElementById","getContainerId","labels","getElementsByTagName","n","length","textEl","parseInt","innerHTML"],"sources":["../../../src/components/PerfTracker/PerfChart.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 */\n\nimport type { FC } from 'react'\nimport React from 'react'\nimport { Chart } from 'react-google-charts'\nimport { Heading, Space, Tooltip } from '@looker/components'\nimport { Loading } from '../Loading'\nimport type { IResourceLoadTimes } from './perfUtils'\n\ninterface PerfChartProps {\n /** Performance Resource timing data */\n loadTimes: IResourceLoadTimes\n}\n\n// https://react-google-charts.com/timeline-chart#putting-bars-on-one-row\nconst chartItem = (\n list: any[],\n desc: string,\n offset: number,\n start: number,\n end: number\n) => {\n if (start > 0) list.push([desc, desc, start - offset, end - offset])\n return list\n}\n\nconst chartData = (timings: IResourceLoadTimes) => {\n const item = timings.entry as PerformanceResourceTiming\n const offset = item.startTime\n const result = [\n [\n { type: 'string', id: 'Metric' },\n { type: 'string', role: 'tooltip' },\n { type: 'number', id: 'Start' },\n { type: 'number', id: 'End' },\n ],\n ]\n chartItem(result, 'redirect', offset, item.redirectStart, item.redirectEnd)\n chartItem(\n result,\n 'domainLookup',\n offset,\n item.domainLookupStart,\n item.domainLookupEnd\n )\n chartItem(result, 'connect', offset, item.connectStart, item.connectEnd)\n chartItem(\n result,\n 'secureConnection',\n offset,\n item.secureConnectionStart,\n item.connectEnd\n )\n chartItem(\n result,\n 'responseTime',\n offset,\n item.responseStart,\n item.responseEnd\n )\n chartItem(\n result,\n 'fetchUntilResponseEnd',\n offset,\n item.fetchStart,\n item.responseEnd\n )\n chartItem(\n result,\n 'requestUntilResponseEnd',\n offset,\n item.requestStart,\n item.responseEnd\n )\n chartItem(\n result,\n 'startUntilResponseEnd',\n offset,\n item.startTime,\n item.responseEnd\n )\n chartItem(\n result,\n 'processDuration',\n offset,\n timings.processStart,\n timings.processEnd\n )\n return result\n}\n\nexport const PerfChart: FC<PerfChartProps> = ({ loadTimes }) => {\n const entry = loadTimes.entry as PerformanceResourceTiming\n const data = chartData(loadTimes)\n return (\n <>\n <Heading as=\"h4\">{loadTimes.name}</Heading>\n <Space>\n <Tooltip\n content={`The size (${entry.transferSize} octets) of the fetched resource. The size includes the response header fields plus the response payload body`}\n placement=\"right\"\n textAlign=\"left\"\n >\n <span>Transfer: {entry.transferSize}</span>\n </Tooltip>\n <Tooltip\n content={`The size (${entry.encodedBodySize} octets) received from the fetch (HTTP or cache), of the payload body, before removing any applied content-codings`}\n placement=\"right\"\n textAlign=\"left\"\n >\n <span>Encoded body: {entry.encodedBodySize}</span>\n </Tooltip>\n <Tooltip\n content={`The size (${entry.decodedBodySize} octets) received from the fetch (HTTP or cache) of the message body, after removing any applied content-codings`}\n placement=\"right\"\n textAlign=\"left\"\n >\n <span>Decoded body: {entry.decodedBodySize}</span>\n </Tooltip>\n </Space>\n <Chart\n width={'100%'}\n height={`${8 * 41 + 15}px`}\n chartType=\"Timeline\"\n loader={<Loading loading={true} />}\n data={data}\n chartEvents={[\n {\n eventName: 'ready',\n callback: ({ chartWrapper }) => {\n const container = document.getElementById(\n chartWrapper.getContainerId()\n )\n if (container) {\n const labels = container.getElementsByTagName('text')\n for (let n = 0; n < labels.length; n++) {\n const textEl = labels.item(n)\n // clear any numeric ticks at the bottom of the chart\n if (textEl && parseInt(textEl.innerHTML, 10) > -1) {\n textEl.innerHTML = ''\n }\n }\n }\n },\n },\n ]}\n />\n </>\n )\n}\n"],"mappings":";;;;;;AA2BA;AACA;AACA;AACA;AAAoC;AASpC,IAAMA,SAAS,GAAG,CAChBC,IAAW,EACXC,IAAY,EACZ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ACR,6BAAC,wBAAK;IACJ,KAAK,EAAE,MAAO;IACd,MAAM,YAAK,CAAC,GAAG,EAAE,GAAG,EAAE,OAAK;IAC3B,SAAS,EAAC,UAAU;IACpB,MAAM,EAAE,6BAAC,gBAAO;MAAC,OAAO,EAAE;IAAK,EAAI;IACnC,IAAI,EAAEJ,IAAK;IACX,WAAW,EAAE,CACX;MACEK,SAAS,EAAE,OAAO;MAClBC,QAAQ,EAAE,SAAsB;QAAA,IAArB;UAAEC;QAAa,CAAC;QACzB,IAAMC,SAAS,GAAGC,QAAQ,CAACC,cAAc,CACvCH,YAAY,CAACI,cAAc,EAAE,CAC9B;QACD,IAAIH,SAAS,EAAE;UACb,IAAMI,MAAM,GAAGJ,SAAS,CAACK,oBAAoB,CAAC,MAAM,CAAC;UACrD,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;YACtC,IAAME,MAAM,GAAGJ,MAAM,CAAClC,IAAI,CAACoC,CAAC,CAAC;YAE7B,IAAIE,MAAM,IAAIC,QAAQ,CAACD,MAAM,CAACE,SAAS,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;cACjDF,MAAM,CAACE,SAAS,GAAG,EAAE;YACvB;UACF;QACF;MACF;IACF,CAAC;EACD,EACF,CACD;AAEP,CAAC;AAAA"}
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PerfTable = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _components = require("@looker/components");
11
-
12
9
  var _perfTableUtils = require("./perfTableUtils");
13
-
14
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
-
16
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
-
18
12
  var PerfTable = _ref => {
19
13
  var {
20
14
  data,
@@ -23,7 +17,6 @@ var PerfTable = _ref => {
23
17
  } = _ref;
24
18
  var [columns, setColumns] = (0, _react.useState)((0, _perfTableUtils.perfTableColumns)(showAllColumns));
25
19
  var [rows, setRows] = (0, _react.useState)((0, _perfTableUtils.createTableRows)(data, onSelect, showAllColumns));
26
-
27
20
  var handleSort = (id, sortDirection) => {
28
21
  var {
29
22
  columns: sortedColumns,
@@ -32,7 +25,6 @@ var PerfTable = _ref => {
32
25
  setRows((0, _perfTableUtils.createTableRows)(sortedData, onSelect, showAllColumns));
33
26
  setColumns(sortedColumns);
34
27
  };
35
-
36
28
  (0, _react.useEffect)(() => {
37
29
  setColumns((0, _perfTableUtils.perfTableColumns)(showAllColumns));
38
30
  }, [showAllColumns]);
@@ -45,6 +37,5 @@ var PerfTable = _ref => {
45
37
  caption: "Performance load times"
46
38
  }, rows);
47
39
  };
48
-
49
40
  exports.PerfTable = PerfTable;
50
41
  //# sourceMappingURL=PerfTable.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PerfTracker/PerfTable.tsx"],"names":["PerfTable","data","onSelect","showAllColumns","columns","setColumns","rows","setRows","handleSort","id","sortDirection","sortedColumns","sortedData"],"mappings":";;;;;;;AA2BA;;AACA;;AAGA;;;;;;AAeO,IAAMA,SAA6B,GAAG,QAIvC;AAAA,MAJwC;AAC5CC,IAAAA,IAD4C;AAE5CC,IAAAA,QAF4C;AAG5CC,IAAAA,cAAc,GAAG;AAH2B,GAIxC;AACJ,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,qBAAS,sCAAiBF,cAAjB,CAAT,CAA9B;AACA,MAAM,CAACG,IAAD,EAAOC,OAAP,IAAkB,qBACtB,qCAAgBN,IAAhB,EAAsBC,QAAtB,EAAgCC,cAAhC,CADsB,CAAxB;;AAGA,MAAMK,UAAU,GAAG,CAACC,EAAD,EAAaC,aAAb,KAA+C;AAChE,QAAM;AAAEN,MAAAA,OAAO,EAAEO,aAAX;AAA0BV,MAAAA,IAAI,EAAEW;AAAhC,QAA+C,iCACnDX,IADmD,EAEnDG,OAFmD,EAGnDK,EAHmD,EAInDC,aAJmD,CAArD;AAMAH,IAAAA,OAAO,CACL,qCAAgBK,UAAhB,EAA2CV,QAA3C,EAAqDC,cAArD,CADK,CAAP;AAGAE,IAAAA,UAAU,CAACM,aAAD,CAAV;AACD,GAXD;;AAaA,wBAAU,MAAM;AACdN,IAAAA,UAAU,CAAC,sCAAiBF,cAAjB,CAAD,CAAV;AACD,GAFD,EAEG,CAACA,cAAD,CAFH;AAGA,wBAAU,MAAM;AACdI,IAAAA,OAAO,CAAC,qCAAgBN,IAAhB,EAAsBC,QAAtB,EAAgCC,cAAhC,CAAD,CAAP;AACD,GAFD,EAEG,CAACF,IAAD,EAAOC,QAAP,EAAiBC,cAAjB,CAFH;AAGA,SACE,6BAAC,qBAAD;AACE,IAAA,MAAM,EAAEK,UADV;AAEE,IAAA,OAAO,EAAEJ,OAFX;AAGE,IAAA,OAAO,EAAC;AAHV,KAKGE,IALH,CADF;AASD,CArCM","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 { FC } from 'react'\nimport React, { useEffect, useState } from 'react'\nimport { DataTable, doDataTableSort } from '@looker/components'\n\nimport type { LoadTimes } from './perfUtils'\nimport { createTableRows, perfTableColumns } from './perfTableUtils'\n\ninterface PerfTableProps {\n /** An array of performance load times */\n data: LoadTimes[]\n /** A row select action handler */\n onSelect: (item: LoadTimes) => void\n /** Show all columns, or just \"important\" ones */\n showAllColumns?: boolean\n}\n\n/**\n * Creates a sortable table from an array of performance load times. Each row corresponds to a resource and clicking it\n * generates its performance chart.\n */\nexport const PerfTable: FC<PerfTableProps> = ({\n data,\n onSelect,\n showAllColumns = false,\n}) => {\n const [columns, setColumns] = useState(perfTableColumns(showAllColumns))\n const [rows, setRows] = useState(\n createTableRows(data, onSelect, showAllColumns)\n )\n const handleSort = (id: string, sortDirection: 'asc' | 'desc') => {\n const { columns: sortedColumns, data: sortedData } = doDataTableSort(\n data,\n columns,\n id,\n sortDirection\n )\n setRows(\n createTableRows(sortedData as LoadTimes[], onSelect, showAllColumns)\n )\n setColumns(sortedColumns)\n }\n\n useEffect(() => {\n setColumns(perfTableColumns(showAllColumns))\n }, [showAllColumns])\n useEffect(() => {\n setRows(createTableRows(data, onSelect, showAllColumns))\n }, [data, onSelect, showAllColumns])\n return (\n <DataTable\n onSort={handleSort}\n columns={columns}\n caption=\"Performance load times\"\n >\n {rows}\n </DataTable>\n )\n}\n"],"file":"PerfTable.js"}
1
+ {"version":3,"file":"PerfTable.js","names":["PerfTable","data","onSelect","showAllColumns","columns","setColumns","useState","perfTableColumns","rows","setRows","createTableRows","handleSort","id","sortDirection","sortedColumns","sortedData","doDataTableSort","useEffect"],"sources":["../../../src/components/PerfTracker/PerfTable.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 */\n\nimport type { FC } from 'react'\nimport React, { useEffect, useState } from 'react'\nimport { DataTable, doDataTableSort } from '@looker/components'\n\nimport type { LoadTimes } from './perfUtils'\nimport { createTableRows, perfTableColumns } from './perfTableUtils'\n\ninterface PerfTableProps {\n /** An array of performance load times */\n data: LoadTimes[]\n /** A row select action handler */\n onSelect: (item: LoadTimes) => void\n /** Show all columns, or just \"important\" ones */\n showAllColumns?: boolean\n}\n\n/**\n * Creates a sortable table from an array of performance load times. Each row corresponds to a resource and clicking it\n * generates its performance chart.\n */\nexport const PerfTable: FC<PerfTableProps> = ({\n data,\n onSelect,\n showAllColumns = false,\n}) => {\n const [columns, setColumns] = useState(perfTableColumns(showAllColumns))\n const [rows, setRows] = useState(\n createTableRows(data, onSelect, showAllColumns)\n )\n const handleSort = (id: string, sortDirection: 'asc' | 'desc') => {\n const { columns: sortedColumns, data: sortedData } = doDataTableSort(\n data,\n columns,\n id,\n sortDirection\n )\n setRows(\n createTableRows(sortedData as LoadTimes[], onSelect, showAllColumns)\n )\n setColumns(sortedColumns)\n }\n\n useEffect(() => {\n setColumns(perfTableColumns(showAllColumns))\n }, [showAllColumns])\n useEffect(() => {\n setRows(createTableRows(data, onSelect, showAllColumns))\n }, [data, onSelect, showAllColumns])\n return (\n <DataTable\n onSort={handleSort}\n columns={columns}\n caption=\"Performance load times\"\n >\n {rows}\n </DataTable>\n )\n}\n"],"mappings":";;;;;;AA2BA;AACA;AAGA;AAAoE;AAAA;AAe7D,IAAMA,SAA6B,GAAG,QAIvC;EAAA,IAJwC;IAC5CC,IAAI;IACJC,QAAQ;IACRC,cAAc,GAAG;EACnB,CAAC;EACC,IAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAAC,IAAAC,gCAAgB,EAACJ,cAAc,CAAC,CAAC;EACxE,IAAM,CAACK,IAAI,EAAEC,OAAO,CAAC,GAAG,IAAAH,eAAQ,EAC9B,IAAAI,+BAAe,EAACT,IAAI,EAAEC,QAAQ,EAAEC,cAAc,CAAC,CAChD;EACD,IAAMQ,UAAU,GAAG,CAACC,EAAU,EAAEC,aAA6B,KAAK;IAChE,IAAM;MAAET,OAAO,EAAEU,aAAa;MAAEb,IAAI,EAAEc;IAAW,CAAC,GAAG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