@looker/extension-utils 0.1.28 → 0.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/lib/APIErrorDisplay/APIErrorContent.js.map +1 -1
  3. package/lib/APIErrorDisplay/APIErrorDetails.js.map +1 -1
  4. package/lib/APIErrorDisplay/APIErrorDialog.js.map +1 -1
  5. package/lib/APIErrorDisplay/APIErrorDisplay.js.map +1 -1
  6. package/lib/APIErrorDisplay/APIErrorDocLink.js.map +1 -1
  7. package/lib/APIErrorDisplay/utils.js.map +1 -1
  8. package/lib/ExtMarkdown.js.map +1 -1
  9. package/lib/OAuthForm/src/components/CollapserCard.js.map +1 -1
  10. package/lib/OAuthForm/src/components/ConfigHeading.js.map +1 -1
  11. package/lib/OAuthForm/src/components/OAuthForm.js.map +1 -1
  12. package/lib/OAuthForm/src/state/sagas.js.map +1 -1
  13. package/lib/OAuthForm/src/state/slice.js.map +1 -1
  14. package/lib/OAuthForm/src/utils.js.map +1 -1
  15. package/lib/OAuthScene.js.map +1 -1
  16. package/lib/adaptorUtils.js.map +1 -1
  17. package/lib/authUtils.js.map +1 -1
  18. package/lib/browserAdaptor.js.map +1 -1
  19. package/lib/esm/APIErrorDisplay/APIErrorContent.js +16 -25
  20. package/lib/esm/APIErrorDisplay/APIErrorContent.js.map +1 -1
  21. package/lib/esm/APIErrorDisplay/APIErrorDetails.js +13 -21
  22. package/lib/esm/APIErrorDisplay/APIErrorDetails.js.map +1 -1
  23. package/lib/esm/APIErrorDisplay/APIErrorDialog.js +10 -18
  24. package/lib/esm/APIErrorDisplay/APIErrorDialog.js.map +1 -1
  25. package/lib/esm/APIErrorDisplay/APIErrorDisplay.js +7 -15
  26. package/lib/esm/APIErrorDisplay/APIErrorDisplay.js.map +1 -1
  27. package/lib/esm/APIErrorDisplay/APIErrorDocLink.js +7 -15
  28. package/lib/esm/APIErrorDisplay/APIErrorDocLink.js.map +1 -1
  29. package/lib/esm/APIErrorDisplay/index.js +3 -39
  30. package/lib/esm/APIErrorDisplay/index.js.map +1 -1
  31. package/lib/esm/APIErrorDisplay/utils.js +2 -10
  32. package/lib/esm/APIErrorDisplay/utils.js.map +1 -1
  33. package/lib/esm/ExtMarkdown.js +6 -14
  34. package/lib/esm/ExtMarkdown.js.map +1 -1
  35. package/lib/esm/OAuthForm/index.js +1 -16
  36. package/lib/esm/OAuthForm/index.js.map +1 -1
  37. package/lib/esm/OAuthForm/src/components/CollapserCard.js +13 -21
  38. package/lib/esm/OAuthForm/src/components/CollapserCard.js.map +1 -1
  39. package/lib/esm/OAuthForm/src/components/ConfigHeading.js +3 -11
  40. package/lib/esm/OAuthForm/src/components/ConfigHeading.js.map +1 -1
  41. package/lib/esm/OAuthForm/src/components/OAuthForm.js +41 -51
  42. package/lib/esm/OAuthForm/src/components/OAuthForm.js.map +1 -1
  43. package/lib/esm/OAuthForm/src/components/index.js +1 -12
  44. package/lib/esm/OAuthForm/src/components/index.js.map +1 -1
  45. package/lib/esm/OAuthForm/src/index.js +2 -27
  46. package/lib/esm/OAuthForm/src/index.js.map +1 -1
  47. package/lib/esm/OAuthForm/src/state/index.js +1 -12
  48. package/lib/esm/OAuthForm/src/state/index.js.map +1 -1
  49. package/lib/esm/OAuthForm/src/state/sagas.js +38 -44
  50. package/lib/esm/OAuthForm/src/state/sagas.js.map +1 -1
  51. package/lib/esm/OAuthForm/src/state/slice.js +11 -24
  52. package/lib/esm/OAuthForm/src/state/slice.js.map +1 -1
  53. package/lib/esm/OAuthForm/src/utils.js +6 -15
  54. package/lib/esm/OAuthForm/src/utils.js.map +1 -1
  55. package/lib/esm/OAuthScene.js +14 -23
  56. package/lib/esm/OAuthScene.js.map +1 -1
  57. package/lib/esm/adaptorUtils.js +9 -22
  58. package/lib/esm/adaptorUtils.js.map +1 -1
  59. package/lib/esm/authUtils.js +2 -9
  60. package/lib/esm/authUtils.js.map +1 -1
  61. package/lib/esm/browserAdaptor.js +4 -12
  62. package/lib/esm/browserAdaptor.js.map +1 -1
  63. package/lib/esm/extensionAdaptor.js +4 -12
  64. package/lib/esm/extensionAdaptor.js.map +1 -1
  65. package/lib/esm/index.js +8 -93
  66. package/lib/esm/index.js.map +1 -1
  67. package/lib/extensionAdaptor.js.map +1 -1
  68. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"adaptorUtils.js","names":["_browserAdaptor","require","hostedInternally","hostname","endsWith","startsWith","exports","getThemeOverrides","internalTheming","loadGoogleFonts","themeCustomizations","fontFamilies","brand","colors","key","extensionAdaptor","registerEnvAdaptor","adaptor","unregisterEnvAdaptor","undefined","getEnvAdaptor","Error","registerTestEnvAdaptor","mockSdk","BrowserAdaptor","appPath","location","newPath","reactPath","pathname","wloc","window","base","origin","wpath","result","concat","substring","indexOf"],"sources":["../../src/adaptorUtils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ThemeCustomizations } from '@looker/design-tokens'\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type { Location as HLocation } from 'history'\nimport { BrowserAdaptor } from './browserAdaptor'\n\nexport interface IAuthAdaptor {\n /** Method for retrieving an instantiated SDK */\n get sdk(): IAPIMethods\n /** Method for authenticating against the API server. Auth mechanism is dependent on the authSession implementation\n * used for the sdk. */\n login(): Promise<boolean>\n}\n\n/**\n * NOTE: This interface should describe all methods that require an adaptor when running in standalone vs extension mode\n * Examples include: local storage operations and various link navigation functions\n */\nexport interface IEnvironmentAdaptor extends IAuthAdaptor {\n /** Copy page URL to clipboard */\n copyToClipboard: (location?: {\n pathname: string\n search: string\n }) => Promise<void>\n /** Method for determining whether running in a browser or extension environment */\n isExtension(): boolean\n /** Method for retrieving a keyed value from local storage */\n localStorageGetItem(key: string): Promise<string | null>\n /** Method for setting a keyed value in local storage */\n localStorageSetItem(key: string, value: string): void\n /** Method for removing a keyed value from local storage */\n localStorageRemoveItem(key: string): void\n /** Theme settings for extension */\n themeOverrides(): ThemeOverrides\n /** Open a new browser window with the given url and target */\n openBrowserWindow: (url: string, target?: string) => void\n /** error logger */\n logError: (error: Error, componentStack: string) => void\n}\n\n/**\n * Theme overrides used to load google fonts in Google environments only.\n * Google fonts should NOT be used when it is not obvious that a Google\n * system is being used (for example an embedded extension).\n */\nexport interface ThemeOverrides {\n /** Should Google-specific fonts be used for the theme? */\n loadGoogleFonts?: boolean\n /** Property bag overrides for Looker component theming */\n themeCustomizations?: ThemeCustomizations\n}\n\n/**\n * Is this an \"internal\" host that will use internal branding?\n * @param hostname to check\n */\nexport const hostedInternally = (hostname: string): boolean =>\n hostname.endsWith('.looker.com') ||\n hostname.endsWith('.google.com') ||\n hostname === 'localhost' ||\n // Include firebase staging dev portal for now. Can be removed\n // when dev portal gets its own APIX project. Also includes\n // PRs.\n (hostname.startsWith('looker-developer-portal') &&\n hostname.endsWith('.web.app'))\n\n/**\n * Return theme overrides that make apply \"internal\" or external theming\n * @param internalTheming true if \"internal\" theme should be used\n */\nexport const getThemeOverrides = (internalTheming: boolean): ThemeOverrides =>\n internalTheming\n ? {\n loadGoogleFonts: true,\n themeCustomizations: {\n fontFamilies: { brand: 'Google Sans' },\n colors: { key: '#1A73E8' },\n },\n }\n : {\n themeCustomizations: {\n colors: { key: '#1A73E8' },\n },\n }\n\nlet extensionAdaptor: IEnvironmentAdaptor | undefined\n\n/**\n * Register the environment adaptor. Used when initializing the application\n * @param adaptor to register\n */\nexport const registerEnvAdaptor = <T extends IEnvironmentAdaptor>(\n adaptor: T\n) => {\n extensionAdaptor = adaptor\n}\n\n/**\n * Unregister the environment adaptor. Extensions should call this when unmounted\n */\nexport const unregisterEnvAdaptor = () => {\n extensionAdaptor = undefined\n}\n\n/**\n * Global access to the environment adaptor. An error will be thrown if accessed prematurely.\n */\nexport const getEnvAdaptor = () => {\n if (!extensionAdaptor) {\n throw new Error('Environment adaptor not initialized.')\n }\n return extensionAdaptor\n}\n\n/**\n * Used by some unit tests\n * @param adaptor to use for testing\n */\nexport const registerTestEnvAdaptor = <T extends IEnvironmentAdaptor>(\n adaptor?: T\n) => {\n const mockSdk = {} as unknown as IAPIMethods\n registerEnvAdaptor(adaptor || new BrowserAdaptor(mockSdk))\n}\n\n/**\n * Get new application-level base path for react application\n * This function compares the react-based location with the browser window location\n * pathname to ensure that the newPath variable is assigned at the root of the\n * React app path rather than potentially recursive nesting\n *\n * @param location which is usually from useLocation()\n * @param newPath new path to assign, like `/oauth`\n */\nexport const appPath = (location: HLocation, newPath: string) => {\n const reactPath = location.pathname\n const wloc = (window as any).location\n const base = wloc.origin\n const wpath = wloc.pathname\n const result = `${base}${wpath.substring(\n 0,\n wpath.indexOf(reactPath)\n )}${newPath}`\n return result\n}\n"],"mappings":";;;;;;AA6BA,IAAAA,eAAA,GAAAC,OAAA;AAoDO,IAAMC,gBAAgB,GAAIC,QAAgB,IAC/CA,QAAQ,CAACC,QAAQ,CAAC,aAAa,CAAC,IAChCD,QAAQ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O,GAAGA,CAACC,QAAmB,EAAEC,OAAe,KAAK;EAC/D,IAAMC,SAAS,GAAGF,QAAQ,CAACG,QAAQ;EACnC,IAAMC,IAAI,GAAIC,MAAM,CAASL,QAAQ;EACrC,IAAMM,IAAI,GAAGF,IAAI,CAACG,MAAM;EACxB,IAAMC,KAAK,GAAGJ,IAAI,CAACD,QAAQ;EAC3B,IAAMM,MAAM,MAAAC,MAAA,CAAMJ,IAAI,EAAAI,MAAA,CAAGF,KAAK,CAACG,SAAS,CACtC,CAAC,EACDH,KAAK,CAACI,OAAO,CAACV,SAAS,CAAC,CACzB,EAAAQ,MAAA,CAAGT,OAAO,CAAE;EACb,OAAOQ,MAAM;AACf,CAAC;AAAA7B,OAAA,CAAAmB,OAAA,GAAAA,OAAA"}
1
+ {"version":3,"file":"adaptorUtils.js","names":["BrowserAdaptor","hostedInternally","hostname","endsWith","startsWith","getThemeOverrides","internalTheming","loadGoogleFonts","themeCustomizations","fontFamilies","brand","colors","key","extensionAdaptor","registerEnvAdaptor","adaptor","unregisterEnvAdaptor","undefined","getEnvAdaptor","Error","registerTestEnvAdaptor","mockSdk","appPath","location","newPath","reactPath","pathname","wloc","window","base","origin","wpath","result","concat","substring","indexOf"],"sources":["../../src/adaptorUtils.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ThemeCustomizations } from '@looker/design-tokens'\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type { Location as HLocation } from 'history'\nimport { BrowserAdaptor } from './browserAdaptor'\n\nexport interface IAuthAdaptor {\n /** Method for retrieving an instantiated SDK */\n get sdk(): IAPIMethods\n /** Method for authenticating against the API server. Auth mechanism is dependent on the authSession implementation\n * used for the sdk. */\n login(): Promise<boolean>\n}\n\n/**\n * NOTE: This interface should describe all methods that require an adaptor when running in standalone vs extension mode\n * Examples include: local storage operations and various link navigation functions\n */\nexport interface IEnvironmentAdaptor extends IAuthAdaptor {\n /** Copy page URL to clipboard */\n copyToClipboard: (location?: {\n pathname: string\n search: string\n }) => Promise<void>\n /** Method for determining whether running in a browser or extension environment */\n isExtension(): boolean\n /** Method for retrieving a keyed value from local storage */\n localStorageGetItem(key: string): Promise<string | null>\n /** Method for setting a keyed value in local storage */\n localStorageSetItem(key: string, value: string): void\n /** Method for removing a keyed value from local storage */\n localStorageRemoveItem(key: string): void\n /** Theme settings for extension */\n themeOverrides(): ThemeOverrides\n /** Open a new browser window with the given url and target */\n openBrowserWindow: (url: string, target?: string) => void\n /** error logger */\n logError: (error: Error, componentStack: string) => void\n}\n\n/**\n * Theme overrides used to load google fonts in Google environments only.\n * Google fonts should NOT be used when it is not obvious that a Google\n * system is being used (for example an embedded extension).\n */\nexport interface ThemeOverrides {\n /** Should Google-specific fonts be used for the theme? */\n loadGoogleFonts?: boolean\n /** Property bag overrides for Looker component theming */\n themeCustomizations?: ThemeCustomizations\n}\n\n/**\n * Is this an \"internal\" host that will use internal branding?\n * @param hostname to check\n */\nexport const hostedInternally = (hostname: string): boolean =>\n hostname.endsWith('.looker.com') ||\n hostname.endsWith('.google.com') ||\n hostname === 'localhost' ||\n // Include firebase staging dev portal for now. Can be removed\n // when dev portal gets its own APIX project. Also includes\n // PRs.\n (hostname.startsWith('looker-developer-portal') &&\n hostname.endsWith('.web.app'))\n\n/**\n * Return theme overrides that make apply \"internal\" or external theming\n * @param internalTheming true if \"internal\" theme should be used\n */\nexport const getThemeOverrides = (internalTheming: boolean): ThemeOverrides =>\n internalTheming\n ? {\n loadGoogleFonts: true,\n themeCustomizations: {\n fontFamilies: { brand: 'Google Sans' },\n colors: { key: '#1A73E8' },\n },\n }\n : {\n themeCustomizations: {\n colors: { key: '#1A73E8' },\n },\n }\n\nlet extensionAdaptor: IEnvironmentAdaptor | undefined\n\n/**\n * Register the environment adaptor. Used when initializing the application\n * @param adaptor to register\n */\nexport const registerEnvAdaptor = <T extends IEnvironmentAdaptor>(\n adaptor: T\n) => {\n extensionAdaptor = adaptor\n}\n\n/**\n * Unregister the environment adaptor. Extensions should call this when unmounted\n */\nexport const unregisterEnvAdaptor = () => {\n extensionAdaptor = undefined\n}\n\n/**\n * Global access to the environment adaptor. An error will be thrown if accessed prematurely.\n */\nexport const getEnvAdaptor = () => {\n if (!extensionAdaptor) {\n throw new Error('Environment adaptor not initialized.')\n }\n return extensionAdaptor\n}\n\n/**\n * Used by some unit tests\n * @param adaptor to use for testing\n */\nexport const registerTestEnvAdaptor = <T extends IEnvironmentAdaptor>(\n adaptor?: T\n) => {\n const mockSdk = {} as unknown as IAPIMethods\n registerEnvAdaptor(adaptor || new BrowserAdaptor(mockSdk))\n}\n\n/**\n * Get new application-level base path for react application\n * This function compares the react-based location with the browser window location\n * pathname to ensure that the newPath variable is assigned at the root of the\n * React app path rather than potentially recursive nesting\n *\n * @param location which is usually from useLocation()\n * @param newPath new path to assign, like `/oauth`\n */\nexport const appPath = (location: HLocation, newPath: string) => {\n const reactPath = location.pathname\n const wloc = (window as any).location\n const base = wloc.origin\n const wpath = wloc.pathname\n const result = `${base}${wpath.substring(\n 0,\n wpath.indexOf(reactPath)\n )}${newPath}`\n return result\n}\n"],"mappings":"AA6BA,SAASA,cAAc,QAAQ,kBAAkB;AAoDjD,OAAO,IAAMC,gBAAgB,GAAIC,QAAgB,IAC/CA,QAAQ,CAACC,QAAQ,CAAC,aAAa,CAAC,IAChCD,QAAQ,CAACC,QAAQ,CAAC,aAAa,CAAC,IAChCD,QAAQ,KAAK,WAAW,IAIvBA,QAAQ,CAACE,UAAU,CAAC,yBAAyB,CAAC,IAC7CF,QAAQ,CAACC,QAAQ,CAAC,UAAU,CAAE;AAMlC,OAAO,IAAME,iBAAiB,GAAIC,eAAwB,IACxDA,eAAe,GACX;EACEC,eAAe,EAAE,IAAI;EACrBC,mBAAmB,EAAE;IACnBC,YAAY,EAAE;MAAEC,KAAK,EAAE;IAAc,CAAC;IACtCC,MAAM,EAAE;MAAEC,GAAG,EAAE;IAAU;EAC3B;AACF,CAAC,GACD;EACEJ,mBAAmB,EAAE;IACnBG,MAAM,EAAE;MAAEC,GAAG,EAAE;IAAU;EAC3B;AACF,CAAC;AAEP,IAAIC,gBAAiD;AAMrD,OAAO,IAAMC,kBAAkB,GAC7BC,OAAU,IACP;EACHF,gBAAgB,GAAGE,OAAO;AAC5B,CAAC;AAKD,OAAO,IAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACxCH,gBAAgB,GAAGI,SAAS;AAC9B,CAAC;AAKD,OAAO,IAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,IAAI,CAACL,gBAAgB,EAAE;IACrB,MAAM,IAAIM,KAAK,CAAC,sCAAsC,CAAC;EACzD;EACA,OAAON,gBAAgB;AACzB,CAAC;AAMD,OAAO,IAAMO,sBAAsB,GACjCL,OAAW,IACR;EACH,IAAMM,OAAO,GAAG,CAAC,CAA2B;EAC5CP,kBAAkB,CAACC,OAAO,IAAI,IAAIf,cAAc,CAACqB,OAAO,CAAC,CAAC;AAC5D,CAAC;AAWD,OAAO,IAAMC,OAAO,GAAGA,CAACC,QAAmB,EAAEC,OAAe,KAAK;EAC/D,IAAMC,SAAS,GAAGF,QAAQ,CAACG,QAAQ;EACnC,IAAMC,IAAI,GAAIC,MAAM,CAASL,QAAQ;EACrC,IAAMM,IAAI,GAAGF,IAAI,CAACG,MAAM;EACxB,IAAMC,KAAK,GAAGJ,IAAI,CAACD,QAAQ;EAC3B,IAAMM,MAAM,MAAAC,MAAA,CAAMJ,IAAI,EAAAI,MAAA,CAAGF,KAAK,CAACG,SAAS,CACtC,CAAC,EACDH,KAAK,CAACI,OAAO,CAACV,SAAS,CACzB,CAAC,EAAAQ,MAAA,CAAGT,OAAO,CAAE;EACb,OAAOQ,MAAM;AACf,CAAC"}
@@ -1,16 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.OAuthConfigProvider = void 0;
7
- var _sdkRtl = require("@looker/sdk-rtl");
8
1
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
2
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
4
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
12
5
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
- class OAuthConfigProvider extends _sdkRtl.ApiSettings {
6
+ import { ApiSettings } from '@looker/sdk-rtl';
7
+ export class OAuthConfigProvider extends ApiSettings {
14
8
  constructor(settings, oauthClientId, configKey) {
15
9
  super(settings);
16
10
  this.configKey = configKey;
@@ -85,5 +79,4 @@ class OAuthConfigProvider extends _sdkRtl.ApiSettings {
85
79
  });
86
80
  }
87
81
  }
88
- exports.OAuthConfigProvider = OAuthConfigProvider;
89
82
  //# sourceMappingURL=authUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authUtils.js","names":["_sdkRtl","require","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","OAuthConfigProvider","ApiSettings","constructor","settings","oauthClientId","configKey","getStorage","defaultValue","sessionStorage","getItem","location","localStorage","isConfigured","getStoredConfig","storage","config","base_url","looker_url","client_id","redirect_uri","JSON","parse","authIsConfigured","readConfig","_section","url","URL","authServer","concat","protocol","hostname","window","origin","exports"],"sources":["../../src/authUtils.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 { IApiSection, IApiSettings } from '@looker/sdk-rtl'\nimport { ApiSettings } from '@looker/sdk-rtl'\n\nexport type StorageLocation = 'session' | 'local'\n\n/** Object returned from storage service */\nexport interface IStorageValue {\n /** Location of the stored object */\n location: StorageLocation\n /** Stored string representation of the value (usually JSON) */\n value: string\n}\n\n/**\n * An OAuth Session configuration provider\n */\nexport class OAuthConfigProvider extends ApiSettings {\n oauthClientId: string\n constructor(\n settings: Partial<IApiSettings>,\n oauthClientId: string,\n private readonly configKey: string\n ) {\n super(settings)\n this.oauthClientId = oauthClientId\n }\n\n private getStorage(key: string, defaultValue = ''): IStorageValue {\n let value = sessionStorage.getItem(key)\n if (value) {\n return {\n location: 'session',\n value,\n }\n }\n value = localStorage.getItem(key)\n if (value) {\n return {\n location: 'local',\n value,\n }\n }\n return {\n location: 'session',\n value: defaultValue,\n }\n }\n\n isConfigured(): boolean {\n // Required to be true otherwise SDK initialization fails\n return true\n }\n\n getStoredConfig() {\n const storage = this.getStorage(this.configKey)\n let config = {\n base_url: '',\n looker_url: '',\n client_id: '',\n redirect_uri: '',\n }\n if (storage.value) {\n config = JSON.parse(storage.value)\n }\n return config\n }\n\n authIsConfigured(): boolean {\n const config = this.getStoredConfig()\n return config.base_url !== '' && config.looker_url !== ''\n }\n\n readConfig(_section?: string): IApiSection {\n // Read server url values from storage\n let config = this.getStoredConfig()\n if (!this.authIsConfigured()) {\n // derive Looker server URL from base_url\n const url = new URL(this.base_url)\n const authServer = `${url.protocol}//${url.hostname}`\n config = {\n base_url: this.base_url,\n looker_url: `${authServer}:9999`,\n client_id: this.oauthClientId,\n redirect_uri: `${window.location.origin}/oauth`,\n }\n }\n\n const { base_url, looker_url, client_id, redirect_uri } = config\n /* update base_url to the dynamically determined value for standard transport requests */\n this.base_url = base_url\n return {\n ...super.readConfig(_section),\n ...{\n base_url,\n looker_url,\n client_id,\n redirect_uri,\n },\n }\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,OAAA,GAAAC,OAAA;AAA6C,SAAAC,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,MAAA,CAAAc,MAAA,OAAAC,OAAA,WAAAC,GAAA,IAAAC,eAAA,CAAAP,MAAA,EAAAM,GAAA,EAAAF,MAAA,CAAAE,GAAA,SAAAhB,MAAA,CAAAkB,yBAAA,GAAAlB,MAAA,CAAAmB,gBAAA,CAAAT,MAAA,EAAAV,MAAA,CAAAkB,yBAA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CAAC,IAAI,CAACV,QAAQ,CAAC;MAClC,IAAMW,UAAU,MAAAC,MAAA,CAAMH,GAAG,CAACI,QAAQ,QAAAD,MAAA,CAAKH,GAAG,CAACK,QAAQ,CAAE;MACrDf,MAAM,GAAG;QACPC,QAAQ,EAAE,IAAI,CAACA,QAAQ;QACvBC,UAAU,KAAAW,MAAA,CAAKD,UAAU,UAAO;QAChCT,SAAS,EAAE,IAAI,CAACd,aAAa;QAC7Be,YAAY,KAAAS,MAAA,CAAKG,MAAM,CAACrB,QAAQ,CAACsB,MAAM;MACzC,CAAC;IACH;IAEA,IAAM;MAAEhB,QAAQ;MAAEC,UAAU;MAAEC,SAAS;MAAEC;IAAa,CAAC,GAAGJ,MAAM;IAEhE,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,OAAA9C,aAAA,CAAAA,aAAA,KACK,KAAK,CAACqD,UAAU,CAACC,QAAQ,CAAC,GAC1B;MACDR,QAAQ;MACRC,UAAU;MACVC,SAAS;MACTC;IACF,CAAC;EAEL;AACF;AAACc,OAAA,CAAAjC,mBAAA,GAAAA,mBAAA"}
1
+ {"version":3,"file":"authUtils.js","names":["ApiSettings","OAuthConfigProvider","constructor","settings","oauthClientId","configKey","_defineProperty","getStorage","key","defaultValue","arguments","length","undefined","value","sessionStorage","getItem","location","localStorage","isConfigured","getStoredConfig","storage","config","base_url","looker_url","client_id","redirect_uri","JSON","parse","authIsConfigured","readConfig","_section","url","URL","authServer","concat","protocol","hostname","window","origin","_objectSpread"],"sources":["../../src/authUtils.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 { IApiSection, IApiSettings } from '@looker/sdk-rtl'\nimport { ApiSettings } from '@looker/sdk-rtl'\n\nexport type StorageLocation = 'session' | 'local'\n\n/** Object returned from storage service */\nexport interface IStorageValue {\n /** Location of the stored object */\n location: StorageLocation\n /** Stored string representation of the value (usually JSON) */\n value: string\n}\n\n/**\n * An OAuth Session configuration provider\n */\nexport class OAuthConfigProvider extends ApiSettings {\n oauthClientId: string\n constructor(\n settings: Partial<IApiSettings>,\n oauthClientId: string,\n private readonly configKey: string\n ) {\n super(settings)\n this.oauthClientId = oauthClientId\n }\n\n private getStorage(key: string, defaultValue = ''): IStorageValue {\n let value = sessionStorage.getItem(key)\n if (value) {\n return {\n location: 'session',\n value,\n }\n }\n value = localStorage.getItem(key)\n if (value) {\n return {\n location: 'local',\n value,\n }\n }\n return {\n location: 'session',\n value: defaultValue,\n }\n }\n\n isConfigured(): boolean {\n // Required to be true otherwise SDK initialization fails\n return true\n }\n\n getStoredConfig() {\n const storage = this.getStorage(this.configKey)\n let config = {\n base_url: '',\n looker_url: '',\n client_id: '',\n redirect_uri: '',\n }\n if (storage.value) {\n config = JSON.parse(storage.value)\n }\n return config\n }\n\n authIsConfigured(): boolean {\n const config = this.getStoredConfig()\n return config.base_url !== '' && config.looker_url !== ''\n }\n\n readConfig(_section?: string): IApiSection {\n // Read server url values from storage\n let config = this.getStoredConfig()\n if (!this.authIsConfigured()) {\n // derive Looker server URL from base_url\n const url = new URL(this.base_url)\n const authServer = `${url.protocol}//${url.hostname}`\n config = {\n base_url: this.base_url,\n looker_url: `${authServer}:9999`,\n client_id: this.oauthClientId,\n redirect_uri: `${window.location.origin}/oauth`,\n }\n }\n\n const { base_url, looker_url, client_id, redirect_uri } = config\n /* update base_url to the dynamically determined value for standard transport requests */\n this.base_url = base_url\n return {\n ...super.readConfig(_section),\n ...{\n base_url,\n looker_url,\n client_id,\n redirect_uri,\n },\n }\n }\n}\n"],"mappings":";;;;;AA0BA,SAASA,WAAW,QAAQ,iBAAiB;AAe7C,OAAO,MAAMC,mBAAmB,SAASD,WAAW,CAAC;EAEnDE,WAAWA,CACTC,QAA+B,EAC/BC,aAAqB,EACJC,SAAiB,EAClC;IACA,KAAK,CAACF,QAAQ,CAAC;IAAA,KAFEE,SAAiB,GAAjBA,SAAiB;IAAAC,eAAA;IAGlC,IAAI,CAACF,aAAa,GAAGA,aAAa;EACpC;EAEQG,UAAUA,CAACC,GAAW,EAAoC;IAAA,IAAlCC,YAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IAC/C,IAAIG,KAAK,GAAGC,cAAc,CAACC,OAAO,CAACP,GAAG,CAAC;IACvC,IAAIK,KAAK,EAAE;MACT,OAAO;QACLG,QAAQ,EAAE,SAAS;QACnBH;MACF,CAAC;IACH;IACAA,KAAK,GAAGI,YAAY,CAACF,OAAO,CAACP,GAAG,CAAC;IACjC,IAAIK,KAAK,EAAE;MACT,OAAO;QACLG,QAAQ,EAAE,OAAO;QACjBH;MACF,CAAC;IACH;IACA,OAAO;MACLG,QAAQ,EAAE,SAAS;MACnBH,KAAK,EAAEJ;IACT,CAAC;EACH;EAEAS,YAAYA,CAAA,EAAY;IAEtB,OAAO,IAAI;EACb;EAEAC,eAAeA,CAAA,EAAG;IAChB,IAAMC,OAAO,GAAG,IA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Q,CAAC,GAC1B;MACDR,QAAQ;MACRC,UAAU;MACVC,SAAS;MACTC;IACF,CAAC;EAEL;AACF"}
@@ -1,16 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BrowserAuthAdaptor = exports.BrowserAdaptor = void 0;
7
- var _adaptorUtils = require("./adaptorUtils");
8
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
2
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
3
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
4
  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); } }
12
5
  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); }); }; }
13
- class BrowserAuthAdaptor {
6
+ import { getThemeOverrides, hostedInternally } from './adaptorUtils';
7
+ export class BrowserAuthAdaptor {
14
8
  constructor(sdk) {
15
9
  this.sdk = sdk;
16
10
  }
@@ -26,15 +20,14 @@ class BrowserAuthAdaptor {
26
20
  })();
27
21
  }
28
22
  }
29
- exports.BrowserAuthAdaptor = BrowserAuthAdaptor;
30
- class BrowserAdaptor extends BrowserAuthAdaptor {
23
+ export class BrowserAdaptor extends BrowserAuthAdaptor {
31
24
  constructor(sdk) {
32
25
  super(sdk);
33
26
  _defineProperty(this, "_themeOverrides", void 0);
34
27
  var {
35
28
  hostname
36
29
  } = location;
37
- this._themeOverrides = (0, _adaptorUtils.getThemeOverrides)((0, _adaptorUtils.hostedInternally)(hostname));
30
+ this._themeOverrides = getThemeOverrides(hostedInternally(hostname));
38
31
  }
39
32
  copyToClipboard() {
40
33
  return _asyncToGenerator(function* () {
@@ -67,5 +60,4 @@ class BrowserAdaptor extends BrowserAuthAdaptor {
67
60
  }
68
61
  logError(_error, _componentStack) {}
69
62
  }
70
- exports.BrowserAdaptor = BrowserAdaptor;
71
63
  //# sourceMappingURL=browserAdaptor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browserAdaptor.js","names":["_adaptorUtils","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","asyncGeneratorStep","gen","resolve","reject","_next","_throw","info","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","BrowserAuthAdaptor","constructor","sdk","login","_this","token","settings","authSession","authIsConfigured","exports","BrowserAdaptor","hostname","location","_themeOverrides","getThemeOverrides","hostedInternally","copyToClipboard","navigator","clipboard","writeText","href","isExtension","localStorageGetItem","localStorage","getItem","localStorageSetItem","setItem","localStorageRemoveItem","removeItem","themeOverrides","openBrowserWindow","url","target","window","open","logError","_error","_componentStack"],"sources":["../../src/browserAdaptor.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type {\n IAuthAdaptor,\n IEnvironmentAdaptor,\n ThemeOverrides,\n} from './adaptorUtils'\nimport { getThemeOverrides, hostedInternally } from './adaptorUtils'\nimport type { OAuthConfigProvider } from './authUtils'\n\nexport class BrowserAuthAdaptor implements IAuthAdaptor {\n constructor(public readonly sdk: IAPIMethods) {}\n\n async login() {\n let token\n const settings = this.sdk.authSession.settings as OAuthConfigProvider\n if (settings.authIsConfigured()) {\n token = await this.sdk.authSession.login()\n }\n return !!token\n }\n}\n\n/**\n * An adaptor class for interacting with browser APIs when not running in an extension\n */\nexport class BrowserAdaptor\n extends BrowserAuthAdaptor\n implements IEnvironmentAdaptor\n{\n private _themeOverrides: ThemeOverrides\n\n constructor(sdk: IAPIMethods) {\n super(sdk)\n const { hostname } = location\n this._themeOverrides = getThemeOverrides(hostedInternally(hostname))\n }\n\n async copyToClipboard() {\n await navigator.clipboard.writeText(location.href)\n }\n\n isExtension() {\n return false\n }\n\n async localStorageGetItem(key: string) {\n return localStorage.getItem(key)\n }\n\n async localStorageSetItem(key: string, value: string) {\n await localStorage.setItem(key, value)\n }\n\n async localStorageRemoveItem(key: string) {\n await localStorage.removeItem(key)\n }\n\n themeOverrides() {\n return this._themeOverrides\n }\n\n openBrowserWindow(url: string, target?: string) {\n window.open(url, target)\n }\n\n logError(_error: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AMwB,SAAS,CAACC,SAAS,CAACC,SAAS,CAACP,QAAQ,CAACQ,IAAI,CAAC;IAAA;EACpD;EAEAC,WAAWA,CAAA,EAAG;IACZ,OAAO,KAAK;EACd;EAEMC,mBAAmBA,CAAC7D,GAAW,EAAE;IAAA,OAAAgC,iBAAA;MACrC,OAAO8B,YAAY,CAACC,OAAO,CAAC/D,GAAG,CAAC;IAAA;EAClC;EAEMgE,mBAAmBA,CAAChE,GAAW,EAAEC,KAAa,EAAE;IAAA,OAAA+B,iBAAA;MACpD,MAAM8B,YAAY,CAACG,OAAO,CAACjE,GAAG,EAAEC,KAAK,CAAC;IAAA;EACxC;EAEMiE,sBAAsBA,CAAClE,GAAW,EAAE;IAAA,OAAAgC,iBAAA;MACxC,MAAM8B,YAAY,CAACK,UAAU,CAACnE,GAAG,CAAC;IAAA;EACpC;EAEAoE,cAAcA,CAAA,EAAG;IACf,OAAO,IAAI,CAAChB,eAAe;EAC7B;EAEAiB,iBAAiBA,CAACC,GAAW,EAAEC,MAAe,EAAE;IAC9CC,MAAM,CAACC,IAAI,CAACH,GAAG,EAAEC,MAAM,CAAC;EAC1B;EAEAG,QAAQA,CAACC,MAAa,EAAEC,eAAuB,EAAQ,CAEvD;AACF;AAAC5B,OAAA,CAAAC,cAAA,GAAAA,cAAA"}
1
+ {"version":3,"file":"browserAdaptor.js","names":["getThemeOverrides","hostedInternally","BrowserAuthAdaptor","constructor","sdk","login","_this","_asyncToGenerator","token","settings","authSession","authIsConfigured","BrowserAdaptor","_defineProperty","hostname","location","_themeOverrides","copyToClipboard","navigator","clipboard","writeText","href","isExtension","localStorageGetItem","key","localStorage","getItem","localStorageSetItem","value","setItem","localStorageRemoveItem","removeItem","themeOverrides","openBrowserWindow","url","target","window","open","logError","_error","_componentStack"],"sources":["../../src/browserAdaptor.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type {\n IAuthAdaptor,\n IEnvironmentAdaptor,\n ThemeOverrides,\n} from './adaptorUtils'\nimport { getThemeOverrides, hostedInternally } from './adaptorUtils'\nimport type { OAuthConfigProvider } from './authUtils'\n\nexport class BrowserAuthAdaptor implements IAuthAdaptor {\n constructor(public readonly sdk: IAPIMethods) {}\n\n async login() {\n let token\n const settings = this.sdk.authSession.settings as OAuthConfigProvider\n if (settings.authIsConfigured()) {\n token = await this.sdk.authSession.login()\n }\n return !!token\n }\n}\n\n/**\n * An adaptor class for interacting with browser APIs when not running in an extension\n */\nexport class BrowserAdaptor\n extends BrowserAuthAdaptor\n implements IEnvironmentAdaptor\n{\n private _themeOverrides: ThemeOverrides\n\n constructor(sdk: IAPIMethods) {\n super(sdk)\n const { hostname } = location\n this._themeOverrides = getThemeOverrides(hostedInternally(hostname))\n }\n\n async copyToClipboard() {\n await navigator.clipboard.writeText(location.href)\n }\n\n isExtension() {\n return false\n }\n\n async localStorageGetItem(key: string) {\n return localStorage.getItem(key)\n }\n\n async localStorageSetItem(key: string, value: string) {\n await localStorage.setItem(key, value)\n }\n\n async localStorageRemoveItem(key: string) {\n await localStorage.removeItem(key)\n }\n\n themeOverrides() {\n return this._themeOverrides\n }\n\n openBrowserWindow(url: string, target?: string) {\n window.open(url, target)\n }\n\n logError(_error: Error, _componentStack: string): void {\n // noop - error logging for standalone applications TBD\n }\n}\n"],"mappings":";;;;;AAgCA,SAASA,iBAAiB,EAAEC,gBAAgB,QAAQ,gBAAgB;AAGpE,OAAO,MAAMC,kBAAkB,CAAyB;EACtDC,WAAWA,CAAiBC,GAAgB,EAAE;IAAA,KAAlBA,GAAgB,GAAhBA,GAAgB;EAAG;EAEzCC,KAAKA,CAAA,EAAG;IAAA,IAAAC,KAAA;IAAA,OAAAC,iBAAA;MACZ,IAAIC,KAAK;MACT,IAAMC,QAAQ,GAAGH,KAAI,CAACF,GAAG,CAACM,WAAW,CAACD,QAA+B;MACrE,IAAIA,QAAQ,CAACE,gBAAgB,CAAC,CAAC,EAAE;QAC/BH,KAAK,SAASF,KAAI,CAACF,GAAG,CAACM,WAAW,CAACL,KAAK,CAAC,CAAC;MAC5C;MACA,OAAO,CAAC,CAACG,KAAK;IAAA;EAChB;AACF;AAKA,OAAO,MAAMI,cAAc,SACjBV,kBAAkB,CAE5B;EAGEC,WAAWA,CAACC,GAAgB,EAAE;IAC5B,KAAK,CAACA,GAAG,CAAC;IAAAS,eAAA;IACV,IAAM;MAAEC;IAAS,CAAC,GAAGC,QAAQ;IAC7B,IAAI,CAACC,eAAe,GAAGhB,iBAAiB,CAACC,gBAAgB,CAACa,QAAQ,CAAC,CAAC;EACtE;EAEMG,eAAeA,CAAA,EAAG;IAAA,OAAAV,iBAAA;MACtB,MAAMW,SAAS,CAACC,SAAS,CAACC,SAAS,CAACL,QAAQ,CAACM,IAAI,CAAC;IAAA;EACpD;EAEAC,WAAWA,CAAA,EAAG;IACZ,OAAO,KAAK;EACd;EAEMC,mBAAmBA,CAACC,GAAW,EAAE;IAAA,OAAAjB,iBAAA;MACrC,OAAOkB,YAAY,CAACC,OAAO,CAACF,GAAG,CAAC;IAAA;EAClC;EAEMG,mBAAmBA,CAACH,GAAW,EAAEI,KAAa,EAAE;IAAA,OAAArB,iBAAA;MACpD,MAAMkB,YAAY,CAACI,OAAO,CAACL,GAAG,EAAEI,KAAK,CAAC;IAAA;EACxC;EAEME,sBAAsBA,CAACN,GAAW,EAAE;IAAA,OAAAjB,iBAAA;MACxC,MAAMkB,YAAY,CAACM,UAAU,CAACP,GAAG,CAAC;IAAA;EACpC;EAEAQ,cAAcA,CAAA,EAAG;IACf,OAAO,IAAI,CAAChB,eAAe;EAC7B;EAEAiB,iBAAiBA,CAACC,GAAW,EAAEC,MAAe,EAAE;IAC9CC,MAAM,CAACC,IAAI,CAACH,GAAG,EAAEC,MAAM,CAAC;EAC1B;EAEAG,QAAQA,CAACC,MAAa,EAAEC,eAAuB,EAAQ,CAEvD;AACF"}
@@ -1,16 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ExtensionAuthAdaptor = exports.ExtensionAdaptor = void 0;
7
- var _adaptorUtils = require("./adaptorUtils");
8
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
2
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
3
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
4
  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); } }
12
5
  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); }); }; }
13
- class ExtensionAuthAdaptor {
6
+ import { getThemeOverrides } from './adaptorUtils';
7
+ export class ExtensionAuthAdaptor {
14
8
  constructor(sdk) {
15
9
  this.sdk = sdk;
16
10
  }
@@ -20,13 +14,12 @@ class ExtensionAuthAdaptor {
20
14
  })();
21
15
  }
22
16
  }
23
- exports.ExtensionAuthAdaptor = ExtensionAuthAdaptor;
24
- class ExtensionAdaptor extends ExtensionAuthAdaptor {
17
+ export class ExtensionAdaptor extends ExtensionAuthAdaptor {
25
18
  constructor(extensionSdk, sdk) {
26
19
  super(sdk);
27
20
  this.extensionSdk = extensionSdk;
28
21
  _defineProperty(this, "_themeOverrides", void 0);
29
- this._themeOverrides = (0, _adaptorUtils.getThemeOverrides)((this.extensionSdk.lookerHostData || {
22
+ this._themeOverrides = getThemeOverrides((this.extensionSdk.lookerHostData || {
30
23
  hostType: 'standard'
31
24
  }).hostType === 'standard');
32
25
  }
@@ -84,5 +77,4 @@ class ExtensionAdaptor extends ExtensionAuthAdaptor {
84
77
  });
85
78
  }
86
79
  }
87
- exports.ExtensionAdaptor = ExtensionAdaptor;
88
80
  //# sourceMappingURL=extensionAdaptor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensionAdaptor.js","names":["_adaptorUtils","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","asyncGeneratorStep","gen","resolve","reject","_next","_throw","info","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","ExtensionAuthAdaptor","constructor","sdk","login","exports","ExtensionAdaptor","extensionSdk","_themeOverrides","getThemeOverrides","lookerHostData","hostType","copyToClipboard","location","_this","hostOrigin","extensionId","pathname","search","url","concat","clipboardWrite","isExtension","localStorageGetItem","_this2","localStorageSetItem","_this3","localStorageRemoveItem","_this4","themeOverrides","openBrowserWindow","target","logError","componentStack","message"],"sources":["../../src/extensionAdaptor.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ExtensionSDK } from '@looker/extension-sdk'\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type {\n IEnvironmentAdaptor,\n ThemeOverrides,\n IAuthAdaptor,\n} from './adaptorUtils'\nimport { getThemeOverrides } from './adaptorUtils'\n\nexport class ExtensionAuthAdaptor implements IAuthAdaptor {\n constructor(public readonly sdk: IAPIMethods) {}\n\n async login() {\n // Noop for extensions. Authentication is not required in an extension context\n return true\n }\n}\n\n/**\n * An adaptor class for interacting with browser APIs when running as an extension\n */\nexport class ExtensionAdaptor\n extends ExtensionAuthAdaptor\n implements IEnvironmentAdaptor\n{\n _themeOverrides: ThemeOverrides\n\n constructor(public extensionSdk: ExtensionSDK, sdk: IAPIMethods) {\n super(sdk)\n this._themeOverrides = getThemeOverrides(\n (this.extensionSdk.lookerHostData || { hostType: 'standard' })\n .hostType === 'standard'\n )\n }\n\n async copyToClipboard(location?: { pathname: string; search: string }) {\n const { lookerHostData } = this.extensionSdk\n if (lookerHostData && location) {\n const { hostOrigin, extensionId } = lookerHostData\n const { pathname, search } = location\n const url = `${hostOrigin}/extensions/${extensionId}${pathname}${search}`\n await this.extensionSdk.clipboardWrite(url)\n }\n }\n\n isExtension() {\n return true\n }\n\n async localStorageGetItem(key: string) {\n return await this.extensionSdk.localStorageGetItem(key)\n }\n\n async localStorageSetItem(key: string, value: string) {\n await this.extensionSdk.localStorageSetItem(key, value)\n }\n\n async localStorageRemoveItem(key: string) {\n await this.extensionSdk.localStorageRemoveItem(key)\n }\n\n themeOverrides(): ThemeOverrides {\n return this._themeOverrides\n }\n\n openBrowserWindow(url: string, target?: string) {\n this.extensionSdk.openBrowserWindow(url, target)\n }\n\n logError(error: Error, componentStack: string): void {\n this.extensionSdk.error({\n error: error,\n message: componentStack,\n } as ErrorEvent)\n }\n}\n"],"mappings":";;;;;;AAiCA,IAAAA,aAAA,GAAAC,OAAA;AAAkD,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,S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,GAAW,EAAEC,KAAa,EAAE;IAAA,IAAA+D,MAAA;IAAA,OAAAhC,iBAAA;MACpD,MAAMgC,MAAI,CAACnB,YAAY,CAACkB,mBAAmB,CAAC/D,GAAG,EAAEC,KAAK,CAAC;IAAA;EACzD;EAEMgE,sBAAsBA,CAACjE,GAAW,EAAE;IAAA,IAAAkE,MAAA;IAAA,OAAAlC,iBAAA;MACxC,MAAMkC,MAAI,CAACrB,YAAY,CAACoB,sBAAsB,CAACjE,GAAG,CAAC;IAAA;EACrD;EAEAmE,cAAcA,CAAA,EAAmB;IAC/B,OAAO,IAAI,CAACrB,eAAe;EAC7B;EAEAsB,iBAAiBA,CAACX,GAAW,EAAEY,MAAe,EAAE;IAC9C,IAAI,CAACxB,YAAY,CAACuB,iBAAiB,CAACX,GAAG,EAAEY,MAAM,CAAC;EAClD;EAEAC,QAAQA,CAAC1C,KAAY,EAAE2C,cAAsB,EAAQ;IACnD,IAAI,CAAC1B,YAAY,CAACjB,KAAK,CAAC;MACtBA,KAAK,EAAEA,KAAK;MACZ4C,OAAO,EAAED;IACX,CAAC,CAAe;EAClB;AACF;AAAC5B,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"file":"extensionAdaptor.js","names":["getThemeOverrides","ExtensionAuthAdaptor","constructor","sdk","login","_asyncToGenerator","ExtensionAdaptor","extensionSdk","_defineProperty","_themeOverrides","lookerHostData","hostType","copyToClipboard","location","_this","hostOrigin","extensionId","pathname","search","url","concat","clipboardWrite","isExtension","localStorageGetItem","key","_this2","localStorageSetItem","value","_this3","localStorageRemoveItem","_this4","themeOverrides","openBrowserWindow","target","logError","error","componentStack","message"],"sources":["../../src/extensionAdaptor.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ExtensionSDK } from '@looker/extension-sdk'\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type {\n IEnvironmentAdaptor,\n ThemeOverrides,\n IAuthAdaptor,\n} from './adaptorUtils'\nimport { getThemeOverrides } from './adaptorUtils'\n\nexport class ExtensionAuthAdaptor implements IAuthAdaptor {\n constructor(public readonly sdk: IAPIMethods) {}\n\n async login() {\n // Noop for extensions. Authentication is not required in an extension context\n return true\n }\n}\n\n/**\n * An adaptor class for interacting with browser APIs when running as an extension\n */\nexport class ExtensionAdaptor\n extends ExtensionAuthAdaptor\n implements IEnvironmentAdaptor\n{\n _themeOverrides: ThemeOverrides\n\n constructor(public extensionSdk: ExtensionSDK, sdk: IAPIMethods) {\n super(sdk)\n this._themeOverrides = getThemeOverrides(\n (this.extensionSdk.lookerHostData || { hostType: 'standard' })\n .hostType === 'standard'\n )\n }\n\n async copyToClipboard(location?: { pathname: string; search: string }) {\n const { lookerHostData } = this.extensionSdk\n if (lookerHostData && location) {\n const { hostOrigin, extensionId } = lookerHostData\n const { pathname, search } = location\n const url = `${hostOrigin}/extensions/${extensionId}${pathname}${search}`\n await this.extensionSdk.clipboardWrite(url)\n }\n }\n\n isExtension() {\n return true\n }\n\n async localStorageGetItem(key: string) {\n return await this.extensionSdk.localStorageGetItem(key)\n }\n\n async localStorageSetItem(key: string, value: string) {\n await this.extensionSdk.localStorageSetItem(key, value)\n }\n\n async localStorageRemoveItem(key: string) {\n await this.extensionSdk.localStorageRemoveItem(key)\n }\n\n themeOverrides(): ThemeOverrides {\n return this._themeOverrides\n }\n\n openBrowserWindow(url: string, target?: string) {\n this.extensionSdk.openBrowserWindow(url, target)\n }\n\n logError(error: Error, componentStack: string): void {\n this.extensionSdk.error({\n error: error,\n message: componentStack,\n } as ErrorEvent)\n }\n}\n"],"mappings":";;;;;AAiCA,SAASA,iBAAiB,QAAQ,gBAAgB;AAElD,OAAO,MAAMC,oBAAoB,CAAyB;EACxDC,WAAWA,CAAiBC,GAAgB,EAAE;IAAA,KAAlBA,GAAgB,GAAhBA,GAAgB;EAAG;EAEzCC,KAAKA,CAAA,EAAG;IAAA,OAAAC,iBAAA;MAEZ,OAAO,IAAI;IAAA;EACb;AACF;AAKA,OAAO,MAAMC,gBAAgB,SACnBL,oBAAoB,CAE9B;EAGEC,WAAWA,CAAQK,YAA0B,EAAEJ,GAAgB,EAAE;IAC/D,KAAK,CAACA,GAAG,CAAC;IAAA,KADOI,YAA0B,GAA1BA,YAA0B;IAAAC,eAAA;IAE3C,IAAI,CAACC,eAAe,GAAGT,iBAAiB,CACtC,CAAC,IAAI,CAACO,YAAY,CAACG,cAAc,IAAI;MAAEC,QAAQ,EAAE;IAAW,CAAC,EAC1DA,QAAQ,KAAK,UAClB,CAAC;EACH;EAEMC,eAAeA,CAACC,QAA+C,EAAE;IAAA,IAAAC,KAAA;IAAA,OAAAT,iBAAA;MACrE,IAAM;QAAEK;MAAe,CAAC,GAAGI,KAAI,CAACP,YAAY;MAC5C,IAAIG,cAAc,IAAIG,QAAQ,EAAE;QAC9B,IAAM;UAAEE,UAAU;UAAEC;QAAY,CAAC,GAAGN,cAAc;QAClD,IAAM;UAAEO,QAAQ;U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{
4
- value: true
5
- });
6
- var _adaptorUtils = require("./adaptorUtils");
7
- Object.keys(_adaptorUtils).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _adaptorUtils[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function get() {
13
- return _adaptorUtils[key];
14
- }
15
- });
16
- });
17
- var _APIErrorDisplay = require("./APIErrorDisplay");
18
- Object.keys(_APIErrorDisplay).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _APIErrorDisplay[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function get() {
24
- return _APIErrorDisplay[key];
25
- }
26
- });
27
- });
28
- var _browserAdaptor = require("./browserAdaptor");
29
- Object.keys(_browserAdaptor).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _browserAdaptor[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function get() {
35
- return _browserAdaptor[key];
36
- }
37
- });
38
- });
39
- var _extensionAdaptor = require("./extensionAdaptor");
40
- Object.keys(_extensionAdaptor).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _extensionAdaptor[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function get() {
46
- return _extensionAdaptor[key];
47
- }
48
- });
49
- });
50
- var _ExtMarkdown = require("./ExtMarkdown");
51
- Object.keys(_ExtMarkdown).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _ExtMarkdown[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function get() {
57
- return _ExtMarkdown[key];
58
- }
59
- });
60
- });
61
- var _authUtils = require("./authUtils");
62
- Object.keys(_authUtils).forEach(function (key) {
63
- if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _authUtils[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function get() {
68
- return _authUtils[key];
69
- }
70
- });
71
- });
72
- var _OAuthScene = require("./OAuthScene");
73
- Object.keys(_OAuthScene).forEach(function (key) {
74
- if (key === "default" || key === "__esModule") return;
75
- if (key in exports && exports[key] === _OAuthScene[key]) return;
76
- Object.defineProperty(exports, key, {
77
- enumerable: true,
78
- get: function get() {
79
- return _OAuthScene[key];
80
- }
81
- });
82
- });
83
- var _OAuthForm = require("./OAuthForm");
84
- Object.keys(_OAuthForm).forEach(function (key) {
85
- if (key === "default" || key === "__esModule") return;
86
- if (key in exports && exports[key] === _OAuthForm[key]) return;
87
- Object.defineProperty(exports, key, {
88
- enumerable: true,
89
- get: function get() {
90
- return _OAuthForm[key];
91
- }
92
- });
93
- });
1
+ export * from './adaptorUtils';
2
+ export * from './APIErrorDisplay';
3
+ export * from './browserAdaptor';
4
+ export * from './extensionAdaptor';
5
+ export * from './ExtMarkdown';
6
+ export * from './authUtils';
7
+ export * from './OAuthScene';
8
+ export * from './OAuthForm';
94
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_adaptorUtils","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_APIErrorDisplay","_browserAdaptor","_extensionAdaptor","_ExtMarkdown","_authUtils","_OAuthScene","_OAuthForm"],"sources":["../../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './adaptorUtils'\nexport * from './APIErrorDisplay'\nexport * from './browserAdaptor'\nexport * from './extensionAdaptor'\nexport * from './ExtMarkdown'\nexport * from './authUtils'\nexport * from './OAuthScene'\nexport * from './OAuthForm'\n"],"mappings":";;;;;AA0BA,IAAAA,aAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,aAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,aAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,aAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,gBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,gBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,gBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,gBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,eAAA,GAAAV,OAAA;AAAAC,MAAA,CAA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AAAS,UAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAK,UAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,WAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,WAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,WAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAM,WAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,UAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,UAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAW,UAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAO,UAAA,CAAAX,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './adaptorUtils'\nexport * from './APIErrorDisplay'\nexport * from './browserAdaptor'\nexport * from './extensionAdaptor'\nexport * from './ExtMarkdown'\nexport * from './authUtils'\nexport * from './OAuthScene'\nexport * from './OAuthForm'\n"],"mappings":"AA0BA,cAAc,gBAAgB;AAC9B,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,oBAAoB;AAClC,cAAc,eAAe;AAC7B,cAAc,aAAa;AAC3B,cAAc,cAAc;AAC5B,cAAc,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"extensionAdaptor.js","names":["_adaptorUtils","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","asyncGeneratorStep","gen","resolve","reject","_next","_throw","info","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","ExtensionAuthAdaptor","constructor","sdk","login","exports","ExtensionAdaptor","extensionSdk","_themeOverrides","getThemeOverrides","lookerHostData","hostType","copyToClipboard","location","_this","hostOrigin","extensionId","pathname","search","url","concat","clipboardWrite","isExtension","localStorageGetItem","_this2","localStorageSetItem","_this3","localStorageRemoveItem","_this4","themeOverrides","openBrowserWindow","target","logError","componentStack","message"],"sources":["../src/extensionAdaptor.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ExtensionSDK } from '@looker/extension-sdk'\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type {\n IEnvironmentAdaptor,\n ThemeOverrides,\n IAuthAdaptor,\n} from './adaptorUtils'\nimport { getThemeOverrides } from './adaptorUtils'\n\nexport class ExtensionAuthAdaptor implements IAuthAdaptor {\n constructor(public readonly sdk: IAPIMethods) {}\n\n async login() {\n // Noop for extensions. Authentication is not required in an extension context\n return true\n }\n}\n\n/**\n * An adaptor class for interacting with browser APIs when running as an extension\n */\nexport class ExtensionAdaptor\n extends ExtensionAuthAdaptor\n implements IEnvironmentAdaptor\n{\n _themeOverrides: ThemeOverrides\n\n constructor(public extensionSdk: ExtensionSDK, sdk: IAPIMethods) {\n super(sdk)\n this._themeOverrides = getThemeOverrides(\n (this.extensionSdk.lookerHostData || { hostType: 'standard' })\n .hostType === 'standard'\n )\n }\n\n async copyToClipboard(location?: { pathname: string; search: string }) {\n const { lookerHostData } = this.extensionSdk\n if (lookerHostData && location) {\n const { hostOrigin, extensionId } = lookerHostData\n const { pathname, search } = location\n const url = `${hostOrigin}/extensions/${extensionId}${pathname}${search}`\n await this.extensionSdk.clipboardWrite(url)\n }\n }\n\n isExtension() {\n return true\n }\n\n async localStorageGetItem(key: string) {\n return await this.extensionSdk.localStorageGetItem(key)\n }\n\n async localStorageSetItem(key: string, value: string) {\n await this.extensionSdk.localStorageSetItem(key, value)\n }\n\n async localStorageRemoveItem(key: string) {\n await this.extensionSdk.localStorageRemoveItem(key)\n }\n\n themeOverrides(): ThemeOverrides {\n return this._themeOverrides\n }\n\n openBrowserWindow(url: string, target?: string) {\n this.extensionSdk.openBrowserWindow(url, target)\n }\n\n logError(error: Error, componentStack: string): void {\n this.extensionSdk.error({\n error: error,\n message: componentStack,\n } as ErrorEvent)\n }\n}\n"],"mappings":";;;;;;AAiCA,IAAAA,aAAA,GAAAC,OAAA;AAAkD,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA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;IAAA,OAAAlC,iBAAA;MACxC,MAAMkC,MAAI,CAACrB,YAAY,CAACoB,sBAAsB,CAACjE,GAAG,CAAC;IAAA;EACrD;EAEAmE,cAAcA,CAAA,EAAmB;IAC/B,OAAO,IAAI,CAACrB,eAAe;EAC7B;EAEAsB,iBAAiBA,CAACX,GAAW,EAAEY,MAAe,EAAE;IAC9C,IAAI,CAACxB,YAAY,CAACuB,iBAAiB,CAACX,GAAG,EAAEY,MAAM,CAAC;EAClD;EAEAC,QAAQA,CAAC1C,KAAY,EAAE2C,cAAsB,EAAQ;IACnD,IAAI,CAAC1B,YAAY,CAACjB,KAAK,CAAC;MACtBA,KAAK,EAAEA,KAAK;MACZ4C,OAAO,EAAED;IACX,CAAC,CAAe;EAClB;AACF;AAAC5B,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"file":"extensionAdaptor.js","names":["_adaptorUtils","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","asyncGeneratorStep","gen","resolve","reject","_next","_throw","info","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","ExtensionAuthAdaptor","constructor","sdk","login","exports","ExtensionAdaptor","extensionSdk","_themeOverrides","getThemeOverrides","lookerHostData","hostType","copyToClipboard","location","_this","hostOrigin","extensionId","pathname","search","url","concat","clipboardWrite","isExtension","localStorageGetItem","_this2","localStorageSetItem","_this3","localStorageRemoveItem","_this4","themeOverrides","openBrowserWindow","target","logError","componentStack","message"],"sources":["../src/extensionAdaptor.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ExtensionSDK } from '@looker/extension-sdk'\nimport type { IAPIMethods } from '@looker/sdk-rtl'\nimport type {\n IEnvironmentAdaptor,\n ThemeOverrides,\n IAuthAdaptor,\n} from './adaptorUtils'\nimport { getThemeOverrides } from './adaptorUtils'\n\nexport class ExtensionAuthAdaptor implements IAuthAdaptor {\n constructor(public readonly sdk: IAPIMethods) {}\n\n async login() {\n // Noop for extensions. Authentication is not required in an extension context\n return true\n }\n}\n\n/**\n * An adaptor class for interacting with browser APIs when running as an extension\n */\nexport class ExtensionAdaptor\n extends ExtensionAuthAdaptor\n implements IEnvironmentAdaptor\n{\n _themeOverrides: ThemeOverrides\n\n constructor(public extensionSdk: ExtensionSDK, sdk: IAPIMethods) {\n super(sdk)\n this._themeOverrides = getThemeOverrides(\n (this.extensionSdk.lookerHostData || { hostType: 'standard' })\n .hostType === 'standard'\n )\n }\n\n async copyToClipboard(location?: { pathname: string; search: string }) {\n const { lookerHostData } = this.extensionSdk\n if (lookerHostData && location) {\n const { hostOrigin, extensionId } = lookerHostData\n const { pathname, search } = location\n const url = `${hostOrigin}/extensions/${extensionId}${pathname}${search}`\n await this.extensionSdk.clipboardWrite(url)\n }\n }\n\n isExtension() {\n return true\n }\n\n async localStorageGetItem(key: string) {\n return await this.extensionSdk.localStorageGetItem(key)\n }\n\n async localStorageSetItem(key: string, value: string) {\n await this.extensionSdk.localStorageSetItem(key, value)\n }\n\n async localStorageRemoveItem(key: string) {\n await this.extensionSdk.localStorageRemoveItem(key)\n }\n\n themeOverrides(): ThemeOverrides {\n return this._themeOverrides\n }\n\n openBrowserWindow(url: string, target?: string) {\n this.extensionSdk.openBrowserWindow(url, target)\n }\n\n logError(error: Error, componentStack: string): void {\n this.extensionSdk.error({\n error: error,\n message: componentStack,\n } as ErrorEvent)\n }\n}\n"],"mappings":";;;;;;AAiCA,IAAAA,aAAA,GAAAC,OAAA;AAAkD,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAAA,SAAAU,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAA1B,GAAA,E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GAAW,EAAEY,MAAe,EAAE;IAC9C,IAAI,CAACxB,YAAY,CAACuB,iBAAiB,CAACX,GAAG,EAAEY,MAAM,CAAC;EAClD;EAEAC,QAAQA,CAAC1C,KAAY,EAAE2C,cAAsB,EAAQ;IACnD,IAAI,CAAC1B,YAAY,CAACjB,KAAK,CAAC;MACtBA,KAAK,EAAEA,KAAK;MACZ4C,OAAO,EAAED;IACX,CAAe,CAAC;EAClB;AACF;AAAC5B,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@looker/extension-utils",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "description": "Looker Extension Utilities",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -25,12 +25,12 @@
25
25
  "watch": "yarn lerna exec --scope @looker/extension-utils --stream 'BABEL_ENV=build babel src --root-mode upward --out-dir lib/esm --source-maps --extensions .ts,.tsx --no-comments --watch'"
26
26
  },
27
27
  "dependencies": {
28
- "@looker/code-editor": "^0.1.29",
28
+ "@looker/code-editor": "^0.1.30",
29
29
  "@looker/components": "^4.1.1",
30
- "@looker/extension-sdk": "^23.14.1",
31
- "@looker/extension-sdk-react": "^23.14.1",
30
+ "@looker/extension-sdk": "^23.18.0",
31
+ "@looker/extension-sdk-react": "^23.18.0",
32
32
  "@looker/redux": "^0.0.1",
33
- "@looker/sdk": "^23.14.1",
33
+ "@looker/sdk": "^23.18.0",
34
34
  "@looker/sdk-rtl": "^21.6.1",
35
35
  "@reduxjs/toolkit": "^1.9.3",
36
36
  "@styled-icons/material": "^10.47.0",
@@ -53,5 +53,5 @@
53
53
  "webpack-cli": "^4.6.0",
54
54
  "webpack-merge": "^5.7.3"
55
55
  },
56
- "gitHead": "b0eb564b795672de7e734264c7687ed4d4ef9a0c"
56
+ "gitHead": "008b8386e4019bb33465e513c022a929282b30d1"
57
57
  }