@looker/extension-sdk 26.6.0 → 26.8.0

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 (54) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/lib/connect/connect_extension_host.js +66 -65
  3. package/lib/connect/connect_extension_host.js.map +1 -1
  4. package/lib/connect/extension_host_api.js +40 -40
  5. package/lib/connect/extension_host_api.js.map +1 -1
  6. package/lib/connect/fetch_proxy.js +3 -3
  7. package/lib/connect/fetch_proxy.js.map +1 -1
  8. package/lib/connect/global_listener.js.map +1 -1
  9. package/lib/connect/index.js.map +1 -1
  10. package/lib/connect/tile/index.js.map +1 -1
  11. package/lib/connect/tile/tile_sdk.js +2 -2
  12. package/lib/connect/tile/tile_sdk.js.map +1 -1
  13. package/lib/connect/tile/types.js.map +1 -1
  14. package/lib/connect/types.js.map +1 -1
  15. package/lib/connect/visualization/index.js.map +1 -1
  16. package/lib/connect/visualization/types.js +4 -0
  17. package/lib/connect/visualization/types.js.map +1 -1
  18. package/lib/connect/visualization/visualization_sdk.js +6 -6
  19. package/lib/connect/visualization/visualization_sdk.js.map +1 -1
  20. package/lib/esm/connect/connect_extension_host.js +66 -65
  21. package/lib/esm/connect/connect_extension_host.js.map +1 -1
  22. package/lib/esm/connect/extension_host_api.js +39 -39
  23. package/lib/esm/connect/extension_host_api.js.map +1 -1
  24. package/lib/esm/connect/fetch_proxy.js +2 -2
  25. package/lib/esm/connect/fetch_proxy.js.map +1 -1
  26. package/lib/esm/connect/global_listener.js.map +1 -1
  27. package/lib/esm/connect/index.js.map +1 -1
  28. package/lib/esm/connect/tile/index.js.map +1 -1
  29. package/lib/esm/connect/tile/tile_sdk.js +2 -2
  30. package/lib/esm/connect/tile/tile_sdk.js.map +1 -1
  31. package/lib/esm/connect/tile/types.js.map +1 -1
  32. package/lib/esm/connect/types.js.map +1 -1
  33. package/lib/esm/connect/visualization/index.js.map +1 -1
  34. package/lib/esm/connect/visualization/types.js +1 -1
  35. package/lib/esm/connect/visualization/types.js.map +1 -1
  36. package/lib/esm/connect/visualization/visualization_sdk.js +6 -6
  37. package/lib/esm/connect/visualization/visualization_sdk.js.map +1 -1
  38. package/lib/esm/index.js.map +1 -1
  39. package/lib/esm/sdk/extension_sdk.js.map +1 -1
  40. package/lib/esm/sdk/index.js.map +1 -1
  41. package/lib/esm/sdk/sdk_connection.js +2 -2
  42. package/lib/esm/sdk/sdk_connection.js.map +1 -1
  43. package/lib/esm/util/errors.js.map +1 -1
  44. package/lib/esm/util/index.js.map +1 -1
  45. package/lib/esm/util/logger.js.map +1 -1
  46. package/lib/index.js.map +1 -1
  47. package/lib/sdk/extension_sdk.js.map +1 -1
  48. package/lib/sdk/index.js.map +1 -1
  49. package/lib/sdk/sdk_connection.js +2 -2
  50. package/lib/sdk/sdk_connection.js.map +1 -1
  51. package/lib/util/errors.js.map +1 -1
  52. package/lib/util/index.js.map +1 -1
  53. package/lib/util/logger.js.map +1 -1
  54. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"extension_host_api.js","names":["_intersects","_interopRequireDefault","require","_util","_visualization_sdk","_tile_sdk","_fetch_proxy","_types","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","_defineProperty","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","EXTENSION_SDK_VERSION","exports","ExtensionHostApiImpl","constructor","configuration","_configuration","chattyHost","setInitialRoute","hostChangedRoute","visualizationDataReceivedCallback","tileHostDataChangedCallback","isDashboardMountSupported","_this$_lookerHostData","_this$lookerHostData","_this$lookerHostData2","_this$lookerHostData3","_lookerHostData","extensionDashboardTileEnabled","lookerHostData","mountPoint","MountPoint","dashboardTile","dashboardVisualization","dashboardTilePopup","visualizationSDK","_visualizationSDK","VisualizationSDKImpl","tileSDK","_tileSDK","TileSDKImpl","handleNotification","message","type","ExtensionNotificationType","ROUTE_CHANGED","payload","route","routeState","VISUALIZATION_DATA","updateVisData","TILE_HOST_DATA","tileHostDataChanged","INITIALIZE","standalone","contextData","errorMessage","requiredLookerVersion","lookerVersion","verifyLookerVersion","logError","extensionSdkVersion","Error","concat","createSecretKeyTag","keyName","match","extensionId","replace","verifyHostConnection","_this","sendAndReceive","ExtensionRequestType","VERIFY_HOST","invokeCoreSdk","httpMethod","path","params","body","authenticator","options","apiVersion","_this2","INVOKE_CORE_SDK","invokeCoreSdkRaw","_this3","RAW_INVOKE_CORE_SDK","updateTitle","title","send","UPDATE_TITLE","updateLocation","url","state","target","UPDATE_LOCATION","spartanLogout","SPARTAN_LOGOUT","openBrowserWindow","closeHostPopovers","CLOSE_HOST_POPOVERS","clientRouteChanged","localStorageSetItem","name","_arguments","_this4","length","LOCAL_STORAGE","localStorageGetItem","_this5","localStorageRemoveItem","_this6","clipboardWrite","_this7","CLIPBOARD","userAttributeSetItem","_arguments2","_this8","USER_ATTRIBUTE","userAttributeGetItem","_this9","userAttributeResetItem","_this10","getContextData","JSON","parse","saveContextData","context","_this11","stringify","CONTEXT_DATA","refreshContextData","_this12","track","trackAction","attributes","TRACK_ACTION","errorEvent","filename","lineno","colno","ERROR_EVENT","toString","unloaded","EXTENSION_UNLOADED","createFetchProxy","baseUrl","init","responseBodyType","FetchProxyImpl","fetchProxy","resource","_this13","INVOKE_EXTERNAL_API","serverProxy","_this14","oauth2Authenticate","authEndpoint","authParameters","_arguments3","_this15","validateAuthParameters","signal","AbortController","oauth2ExchangeCodeForToken","_this16","rendered","failureMessage","RENDERED","_this17","messagePayload","chattyPayload","ExtensionEvent","EXTENSION_API_REQUEST","values","version","intersects","client_id","redirect_uri","response_type"],"sources":["../../src/connect/extension_host_api.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 { ChattyHostConnection, Options } from '@looker/chatty';\nimport intersects from 'semver/ranges/intersects';\nimport { logError } from '../util';\nimport type {\n VisualizationDataReceivedCallback,\n VisualizationSDK,\n VisualizationSDKInternal,\n} from './visualization';\nimport { VisualizationSDKImpl } from './visualization/visualization_sdk';\nimport type {\n TileHostDataChangedCallback,\n TileSDK,\n TileSDKInternal,\n} from './tile';\nimport { TileSDKImpl } from './tile/tile_sdk';\nimport { FetchProxyImpl } from './fetch_proxy';\nimport type {\n ApiVersion,\n ExtensionHostApi,\n ExtensionHostApiConfiguration,\n ExtensionInitializationResponse,\n ExtensionNotification,\n FetchCustomParameters,\n FetchResponseBodyType,\n LookerHostData,\n} from './types';\nimport {\n ExtensionEvent,\n ExtensionNotificationType,\n ExtensionRequestType,\n MountPoint,\n} from './types';\n\nexport const EXTENSION_SDK_VERSION = '0.10.5';\n\nexport class ExtensionHostApiImpl implements ExtensionHostApi {\n private _configuration: ExtensionHostApiConfiguration;\n private _lookerHostData?: Readonly<LookerHostData>;\n private chattyHost: ChattyHostConnection;\n private setInitialRoute?: (route: string, routeState?: any) => void;\n private hostChangedRoute?: (route: string, routeState?: any) => void;\n private visualizationDataReceivedCallback?: VisualizationDataReceivedCallback;\n private tileHostDataChangedCallback?: TileHostDataChangedCallback;\n private _visualizationSDK?: VisualizationSDKInternal;\n private _tileSDK?: TileSDKInternal;\n\n private contextData?: string;\n\n constructor(configuration: ExtensionHostApiConfiguration) {\n this._configuration = configuration;\n const {\n chattyHost,\n setInitialRoute,\n hostChangedRoute,\n visualizationDataReceivedCallback,\n tileHostDataChangedCallback,\n } = this._configuration;\n this.chattyHost = chattyHost;\n this.setInitialRoute = setInitialRoute;\n this.hostChangedRoute = hostChangedRoute;\n this.visualizationDataReceivedCallback = visualizationDataReceivedCallback;\n this.tileHostDataChangedCallback = tileHostDataChangedCallback;\n }\n\n get isDashboardMountSupported(): boolean {\n return (\n !!this._lookerHostData?.extensionDashboardTileEnabled &&\n (this.lookerHostData?.mountPoint === MountPoint.dashboardTile ||\n this.lookerHostData?.mountPoint === MountPoint.dashboardVisualization ||\n this.lookerHostData?.mountPoint === MountPoint.dashboardTilePopup)\n );\n }\n\n get visualizationSDK(): VisualizationSDK {\n if (!this._visualizationSDK) {\n this._visualizationSDK = new VisualizationSDKImpl(this);\n }\n return this._visualizationSDK;\n }\n\n get tileSDK(): TileSDK {\n if (!this._tileSDK) {\n this._tileSDK = new TileSDKImpl(this);\n }\n return this._tileSDK;\n }\n\n get lookerHostData() {\n return this._lookerHostData;\n }\n\n handleNotification(\n message: ExtensionNotification\n ): ExtensionInitializationResponse | undefined {\n const { type } = message;\n switch (type) {\n case ExtensionNotificationType.ROUTE_CHANGED: {\n const { payload } = message;\n if (this.hostChangedRoute && payload) {\n const { route, routeState } = payload;\n if (route) {\n this.hostChangedRoute(route, routeState);\n }\n }\n return undefined;\n }\n case ExtensionNotificationType.VISUALIZATION_DATA: {\n const { payload } = message;\n (this.visualizationSDK as VisualizationSDKInternal).updateVisData(\n payload\n );\n if (this.visualizationDataReceivedCallback) {\n this.visualizationDataReceivedCallback(payload);\n }\n return undefined;\n }\n case ExtensionNotificationType.TILE_HOST_DATA: {\n const { payload } = message;\n (this.tileSDK as TileSDKInternal).tileHostDataChanged(payload);\n if (this.tileHostDataChangedCallback) {\n this.tileHostDataChangedCallback(payload);\n }\n return undefined;\n }\n case ExtensionNotificationType.INITIALIZE: {\n const { payload } = message;\n const lookerHostData = payload || {};\n if (!lookerHostData.mountPoint) {\n lookerHostData.mountPoint = MountPoint.standalone;\n }\n this._lookerHostData = lookerHostData;\n this.contextData = lookerHostData.contextData;\n let errorMessage;\n if (\n this._configuration.requiredLookerVersion &&\n lookerHostData.lookerVersion\n ) {\n errorMessage = this.verifyLookerVersion(\n this._configuration.requiredLookerVersion\n );\n if (errorMessage) {\n logError(errorMessage);\n }\n }\n if (this.setInitialRoute && payload) {\n const { route, routeState } = payload;\n if (route) {\n this.setInitialRoute(route, routeState);\n }\n }\n return {\n extensionSdkVersion: EXTENSION_SDK_VERSION,\n errorMessage,\n };\n }\n default:\n logError('Unrecognized extension notification', message);\n throw new Error(`Unrecognized extension notification type ${type}`);\n }\n }\n\n createSecretKeyTag(keyName: string): string {\n const errorMessage = this.verifyLookerVersion('>=7.11');\n if (errorMessage) {\n throw new Error(errorMessage);\n }\n if (!keyName.match(/^[A-Za-z0-9_.]+$/)) {\n throw new Error('Unsupported characters in key name');\n }\n return `{{${(this._lookerHostData as LookerHostData).extensionId.replace(\n /::|-/g,\n '_'\n )}_${keyName}}}`;\n }\n\n async verifyHostConnection() {\n return this.sendAndReceive(ExtensionRequestType.VERIFY_HOST);\n }\n\n async invokeCoreSdk(\n httpMethod: string,\n path: string,\n params?: any,\n body?: any,\n authenticator?: any,\n options?: any,\n apiVersion?: ApiVersion\n ): Promise<any> {\n return this.sendAndReceive(ExtensionRequestType.INVOKE_CORE_SDK, {\n httpMethod,\n path,\n params,\n body,\n authenticator,\n options,\n apiVersion,\n });\n }\n\n async invokeCoreSdkRaw(\n httpMethod: string,\n path: string,\n params?: any,\n body?: any,\n apiVersion?: ApiVersion\n ): Promise<any> {\n return this.sendAndReceive(ExtensionRequestType.RAW_INVOKE_CORE_SDK, {\n httpMethod,\n path,\n params,\n body,\n apiVersion,\n });\n }\n\n updateTitle(title: string) {\n this.send(ExtensionRequestType.UPDATE_TITLE, { title });\n }\n\n updateLocation(url: string, state?: any, target?: string) {\n this.send(ExtensionRequestType.UPDATE_LOCATION, { url, state, target });\n }\n\n spartanLogout() {\n this.send(ExtensionRequestType.SPARTAN_LOGOUT);\n }\n\n openBrowserWindow(url: string, target?: string) {\n this.send(ExtensionRequestType.UPDATE_LOCATION, {\n url,\n undefined,\n target: target || '_blank',\n });\n }\n\n closeHostPopovers() {\n this.send(ExtensionRequestType.CLOSE_HOST_POPOVERS);\n }\n\n clientRouteChanged(route: string, routeState?: any) {\n this.send(ExtensionRequestType.ROUTE_CHANGED, {\n route,\n routeState,\n });\n }\n\n async localStorageSetItem(name: string, value = ''): Promise<boolean> {\n if (this._lookerHostData && !this._lookerHostData.lookerVersion) {\n return Promise.reject(\n new Error(\n 'localStorageSetItem not supported by the current Looker host'\n )\n );\n }\n return this.sendAndReceive(ExtensionRequestType.LOCAL_STORAGE, {\n type: 'set',\n name,\n value,\n });\n }\n\n async localStorageGetItem(name: string): Promise<string | null> {\n if (this._lookerHostData && !this._lookerHostData.lookerVersion) {\n return Promise.reject(\n new Error(\n 'localStorageGetItem not supported by the current Looker host'\n )\n );\n }\n return this.sendAndReceive(ExtensionRequestType.LOCAL_STORAGE, {\n type: 'get',\n name,\n });\n }\n\n async localStorageRemoveItem(name: string): Promise<boolean> {\n if (this._lookerHostData && !this._lookerHostData.lookerVersion) {\n return Promise.reject(\n new Error(\n 'localStorageRemoveItem not supported by the current Looker host'\n )\n );\n }\n return this.sendAndReceive(ExtensionRequestType.LOCAL_STORAGE, {\n type: 'remove',\n name,\n });\n }\n\n async clipboardWrite(value: string): Promise<void> {\n const errorMessage = this.verifyLookerVersion('>=21.7');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.CLIPBOARD, {\n type: 'write',\n value,\n });\n }\n\n async userAttributeSetItem(name: string, value = ''): Promise<boolean> {\n // User attributes added in Looker version 7.13, updated in 7.15\n const errorMessage = this.verifyLookerVersion('>=7.15');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.USER_ATTRIBUTE, {\n type: 'set',\n name,\n value,\n });\n }\n\n async userAttributeGetItem(name: string): Promise<string | null> {\n // User attributes added in Looker version 7.13, updated in 7.15\n const errorMessage = this.verifyLookerVersion('>=7.15');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.USER_ATTRIBUTE, {\n type: 'get',\n name,\n });\n }\n\n async userAttributeResetItem(name: string): Promise<void> {\n // User attributes added in Looker version 7.13, updated in 7.15\n const errorMessage = this.verifyLookerVersion('>=7.15');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.USER_ATTRIBUTE, {\n type: 'reset',\n name,\n });\n }\n\n getContextData() {\n const errorMessage = this.verifyLookerVersion('>=7.13');\n if (errorMessage) {\n throw new Error(errorMessage);\n }\n if (this.contextData) {\n return JSON.parse(this.contextData);\n } else {\n return undefined;\n }\n }\n\n async saveContextData(context: any): Promise<any> {\n const errorMessage = this.verifyLookerVersion('>=7.13');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n let contextData: string | undefined;\n if (context) {\n try {\n contextData = JSON.stringify(context);\n } catch (err) {\n return Promise.reject(new Error('context cannot be serialized'));\n }\n } else {\n contextData = undefined;\n }\n await this.sendAndReceive(ExtensionRequestType.CONTEXT_DATA, {\n type: 'save',\n contextData,\n });\n return this.getContextData();\n }\n\n async refreshContextData(): Promise<any> {\n const errorMessage = this.verifyLookerVersion('>=7.13');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n this.contextData = await this.sendAndReceive(\n ExtensionRequestType.CONTEXT_DATA,\n {\n type: 'refresh',\n }\n );\n return this.getContextData();\n }\n\n track(name: string, trackAction: string, attributes?: Record<string, any>) {\n this.send(ExtensionRequestType.TRACK_ACTION, {\n name,\n trackAction,\n attributes,\n });\n }\n\n error(errorEvent: ErrorEvent) {\n if (this._lookerHostData) {\n const { message, filename, lineno, colno, error } = errorEvent || {};\n this.send(ExtensionRequestType.ERROR_EVENT, {\n message,\n filename,\n lineno,\n colno,\n error: error && error.toString ? error.toString() : error,\n });\n } else {\n logError(\n 'Unhandled error but Looker host connection not established',\n errorEvent\n );\n }\n }\n\n unloaded() {\n this.send(ExtensionRequestType.EXTENSION_UNLOADED, {});\n }\n\n createFetchProxy(\n baseUrl?: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ) {\n return new FetchProxyImpl(this, baseUrl, init, responseBodyType);\n }\n\n async fetchProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ) {\n // Fetch proxy support added to Looker 7.9\n const errorMessage = this.verifyLookerVersion('>=7.9');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.INVOKE_EXTERNAL_API, {\n type: 'fetch',\n payload: {\n resource,\n init,\n responseBodyType,\n },\n });\n }\n\n async serverProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ) {\n // Server proxy support added to Looker 7.11\n const errorMessage = this.verifyLookerVersion('>=7.11');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.INVOKE_EXTERNAL_API, {\n type: 'server-proxy',\n payload: {\n resource,\n init,\n responseBodyType,\n },\n });\n }\n\n async oauth2Authenticate(\n authEndpoint: string,\n authParameters: Record<string, string>,\n httpMethod = 'POST'\n ) {\n // oauth2Authenticate proxy support added to Looker 7.9\n let errorMessage = this.verifyLookerVersion('>=7.9');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n errorMessage = this.validateAuthParameters(authParameters);\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(\n ExtensionRequestType.INVOKE_EXTERNAL_API,\n {\n type: 'oauth2_authenticate',\n payload: {\n authEndpoint,\n authParameters,\n httpMethod,\n },\n },\n // Adding the signal disables the default timeout\n { signal: new AbortController().signal }\n );\n }\n\n async oauth2ExchangeCodeForToken(\n authEndpoint: string,\n authParameters: Record<string, string>\n ) {\n const errorMessage = this.verifyLookerVersion('>=7.11');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.INVOKE_EXTERNAL_API, {\n type: 'oauth2_exchange_code',\n payload: {\n authEndpoint,\n authParameters,\n },\n });\n }\n\n rendered(failureMessage?: string) {\n this.send(ExtensionRequestType.RENDERED, { failureMessage });\n }\n\n async sendAndReceive(\n type: string,\n payload?: any,\n options?: Options\n ): Promise<any> {\n if (!this._lookerHostData) {\n return Promise.reject(\n new Error('Looker host connection not established')\n );\n }\n const messagePayload = {\n type,\n payload,\n };\n const chattyPayload = options\n ? [messagePayload, options]\n : [messagePayload];\n return this.chattyHost\n .sendAndReceive(ExtensionEvent.EXTENSION_API_REQUEST, ...chattyPayload)\n .then(values => values[0]);\n }\n\n send(type: string, payload?: any) {\n if (!this._lookerHostData) {\n throw new Error('Looker host connection not established');\n }\n this.chattyHost.send(ExtensionEvent.EXTENSION_API_REQUEST, {\n type,\n payload,\n });\n }\n\n private verifyLookerVersion(version: string): string | undefined {\n // Default version to 7.0 as that's the first Looker version that officially\n // supported extensions. Version 6.24 has some support for extensions but most\n // likely will fail before reaching this point\n const lookerVersion = this._lookerHostData\n ? this._lookerHostData.lookerVersion || '7.0'\n : '7.0';\n if (!this._lookerHostData || !intersects(version, lookerVersion, true)) {\n return `Extension requires Looker version ${version}, got ${lookerVersion}`;\n }\n return undefined;\n }\n\n private validateAuthParameters(authParameters: Record<string, string>) {\n if (!authParameters.client_id) {\n return 'client_id missing';\n }\n if (authParameters.redirect_uri) {\n return 'redirect_uri must NOT be included';\n }\n if (\n authParameters.response_type !== 'token' &&\n authParameters.response_type !== 'id_token' &&\n authParameters.response_type !== 'code'\n ) {\n return `invalid response_type, must be token, id_token or code, ${authParameters.response_type}`;\n }\n return undefined;\n }\n}\n"],"mappings":";;;;;;AA2BA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,kBAAA,GAAAF,OAAA;AAMA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAWA,IAAAK,MAAA,GAAAL,OAAA;AAKiB,SAAAD,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,IAAA,GAAAP,GAAA,CAAAK,GAAA,EAAAC,GAAA,OAAAE,KAAA,GAAAD,IAAA,CAAAC,KAAA,WAAAC,KAAA,IAAAP,MAAA,CAAAO,KAAA,iBAAAF,IAAA,CAAAG,IAAA,IAAAT,OAAA,CAAAO,KAAA,YAAAG,OAAA,CAAAV,OAAA,CAAAO,KAAA,EAAAI,IAAA,CAAAT,KAAA,EAAAC,MAAA;AAAA,SAAAS,kBAAAC,EAAA,6BAAAC,IAAA,SAAAC,IAAA,GAAAC,SAAA,aAAAN,OAAA,WAAAV,OAAA,EAAAC,MAAA,QAAAF,GAAA,GAAAc,EAAA,CAAAI,KAAA,CAAAH,IAAA,EAAAC,IAAA,YAAAb,MAAAK,KAAA,IAAAT,kBAAA,CAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,UAAAI,K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AAC,CACtE3L,IAAI,CAAC8L,MAAM,IAAIA,MAAM,CAAC,CAAC,CAAC,CAAC;IAAC;EAC/B;EAEArF,IAAIA,CAAC9C,IAAY,EAAEG,OAAa,EAAE;IAChC,IAAI,CAAC,IAAI,CAACnB,eAAe,EAAE;MACzB,MAAM,IAAImC,KAAK,CAAC,wCAAwC,CAAC;IAC3D;IACA,IAAI,CAAC7C,UAAU,CAACwE,IAAI,CAACmF,qBAAc,CAACC,qBAAqB,EAAE;MACzDlI,IAAI;MACJG;IACF,CAAC,CAAC;EACJ;EAEQa,mBAAmBA,CAACoH,OAAe,EAAsB;IAI/D,IAAMrH,aAAa,GAAG,IAAI,CAAC/B,eAAe,GACtC,IAAI,CAACA,eAAe,CAAC+B,aAAa,IAAI,KAAK,GAC3C,KAAK;IACT,IAAI,CAAC,IAAI,CAAC/B,eAAe,IAAI,CAAC,IAAAqJ,mBAAU,EAACD,OAAO,EAAErH,aAAa,EAAE,IAAI,CAAC,EAAE;MACtE,4CAAAK,MAAA,CAA4CgH,OAAO,YAAAhH,MAAA,CAASL,aAAa;IAC3E;IACA,OAAOlE,SAAS;EAClB;EAEQyK,sBAAsBA,CAACH,cAAsC,EAAE;IACrE,IAAI,CAACA,cAAc,CAACmB,SAAS,EAAE;MAC7B,OAAO,mBAAmB;IAC5B;IACA,IAAInB,cAAc,CAACoB,YAAY,EAAE;MAC/B,OAAO,mCAAmC;IAC5C;IACA,IACEpB,cAAc,CAACqB,aAAa,KAAK,OAAO,IACxCrB,cAAc,CAACqB,aAAa,KAAK,UAAU,IAC3CrB,cAAc,CAACqB,aAAa,KAAK,MAAM,EACvC;MACA,kEAAApH,MAAA,CAAkE+F,cAAc,CAACqB,aAAa;IAChG;IACA,OAAO3L,SAAS;EAClB;AACF;AAACoB,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
1
+ {"version":3,"file":"extension_host_api.js","names":["_intersects","_interopRequireDefault","require","_util","_visualization_sdk","_tile_sdk","_fetch_proxy","_types","e","__esModule","default","asyncGeneratorStep","n","t","r","o","a","c","i","u","value","done","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","_defineProperty","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","EXTENSION_SDK_VERSION","exports","ExtensionHostApiImpl","constructor","configuration","_configuration","chattyHost","setInitialRoute","hostChangedRoute","visualizationDataReceivedCallback","tileHostDataChangedCallback","isDashboardMountSupported","_this$_lookerHostData","_this$lookerHostData","_this$lookerHostData2","_this$lookerHostData3","_lookerHostData","extensionDashboardTileEnabled","lookerHostData","mountPoint","MountPoint","dashboardTile","dashboardVisualization","dashboardTilePopup","visualizationSDK","_visualizationSDK","VisualizationSDKImpl","tileSDK","_tileSDK","TileSDKImpl","handleNotification","message","type","ExtensionNotificationType","ROUTE_CHANGED","payload","route","routeState","undefined","VISUALIZATION_DATA","updateVisData","TILE_HOST_DATA","tileHostDataChanged","INITIALIZE","standalone","contextData","errorMessage","requiredLookerVersion","lookerVersion","verifyLookerVersion","logError","extensionSdkVersion","Error","concat","createSecretKeyTag","keyName","match","extensionId","replace","verifyHostConnection","_this","sendAndReceive","ExtensionRequestType","VERIFY_HOST","invokeCoreSdk","httpMethod","path","params","body","authenticator","options","apiVersion","_this2","INVOKE_CORE_SDK","invokeCoreSdkRaw","_this3","RAW_INVOKE_CORE_SDK","updateTitle","title","send","UPDATE_TITLE","updateLocation","url","state","target","UPDATE_LOCATION","spartanLogout","SPARTAN_LOGOUT","openBrowserWindow","closeHostPopovers","CLOSE_HOST_POPOVERS","clientRouteChanged","localStorageSetItem","name","_arguments","_this4","length","reject","LOCAL_STORAGE","localStorageGetItem","_this5","localStorageRemoveItem","_this6","clipboardWrite","_this7","CLIPBOARD","userAttributeSetItem","_arguments2","_this8","USER_ATTRIBUTE","userAttributeGetItem","_this9","userAttributeResetItem","_this0","getContextData","JSON","parse","saveContextData","context","_this1","stringify","err","CONTEXT_DATA","refreshContextData","_this10","track","trackAction","attributes","TRACK_ACTION","error","errorEvent","filename","lineno","colno","ERROR_EVENT","toString","unloaded","EXTENSION_UNLOADED","createFetchProxy","baseUrl","init","responseBodyType","FetchProxyImpl","fetchProxy","resource","_this11","INVOKE_EXTERNAL_API","serverProxy","_this12","oauth2Authenticate","authEndpoint","authParameters","_arguments3","_this13","validateAuthParameters","signal","AbortController","oauth2ExchangeCodeForToken","_this14","rendered","failureMessage","RENDERED","_this15","messagePayload","chattyPayload","ExtensionEvent","EXTENSION_API_REQUEST","values","version","intersects","client_id","redirect_uri","response_type"],"sources":["../../src/connect/extension_host_api.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 { ChattyHostConnection, Options } from '@looker/chatty';\nimport intersects from 'semver/ranges/intersects';\nimport { logError } from '../util';\nimport type {\n VisualizationDataReceivedCallback,\n VisualizationSDK,\n VisualizationSDKInternal,\n} from './visualization';\nimport { VisualizationSDKImpl } from './visualization/visualization_sdk';\nimport type {\n TileHostDataChangedCallback,\n TileSDK,\n TileSDKInternal,\n} from './tile';\nimport { TileSDKImpl } from './tile/tile_sdk';\nimport { FetchProxyImpl } from './fetch_proxy';\nimport type {\n ApiVersion,\n ExtensionHostApi,\n ExtensionHostApiConfiguration,\n ExtensionInitializationResponse,\n ExtensionNotification,\n FetchCustomParameters,\n FetchResponseBodyType,\n LookerHostData,\n} from './types';\nimport {\n ExtensionEvent,\n ExtensionNotificationType,\n ExtensionRequestType,\n MountPoint,\n} from './types';\n\nexport const EXTENSION_SDK_VERSION = '0.10.5';\n\nexport class ExtensionHostApiImpl implements ExtensionHostApi {\n private _configuration: ExtensionHostApiConfiguration;\n private _lookerHostData?: Readonly<LookerHostData>;\n private chattyHost: ChattyHostConnection;\n private setInitialRoute?: (route: string, routeState?: any) => void;\n private hostChangedRoute?: (route: string, routeState?: any) => void;\n private visualizationDataReceivedCallback?: VisualizationDataReceivedCallback;\n private tileHostDataChangedCallback?: TileHostDataChangedCallback;\n private _visualizationSDK?: VisualizationSDKInternal;\n private _tileSDK?: TileSDKInternal;\n\n private contextData?: string;\n\n constructor(configuration: ExtensionHostApiConfiguration) {\n this._configuration = configuration;\n const {\n chattyHost,\n setInitialRoute,\n hostChangedRoute,\n visualizationDataReceivedCallback,\n tileHostDataChangedCallback,\n } = this._configuration;\n this.chattyHost = chattyHost;\n this.setInitialRoute = setInitialRoute;\n this.hostChangedRoute = hostChangedRoute;\n this.visualizationDataReceivedCallback = visualizationDataReceivedCallback;\n this.tileHostDataChangedCallback = tileHostDataChangedCallback;\n }\n\n get isDashboardMountSupported(): boolean {\n return (\n !!this._lookerHostData?.extensionDashboardTileEnabled &&\n (this.lookerHostData?.mountPoint === MountPoint.dashboardTile ||\n this.lookerHostData?.mountPoint === MountPoint.dashboardVisualization ||\n this.lookerHostData?.mountPoint === MountPoint.dashboardTilePopup)\n );\n }\n\n get visualizationSDK(): VisualizationSDK {\n if (!this._visualizationSDK) {\n this._visualizationSDK = new VisualizationSDKImpl(this);\n }\n return this._visualizationSDK;\n }\n\n get tileSDK(): TileSDK {\n if (!this._tileSDK) {\n this._tileSDK = new TileSDKImpl(this);\n }\n return this._tileSDK;\n }\n\n get lookerHostData() {\n return this._lookerHostData;\n }\n\n handleNotification(\n message: ExtensionNotification\n ): ExtensionInitializationResponse | undefined {\n const { type } = message;\n switch (type) {\n case ExtensionNotificationType.ROUTE_CHANGED: {\n const { payload } = message;\n if (this.hostChangedRoute && payload) {\n const { route, routeState } = payload;\n if (route) {\n this.hostChangedRoute(route, routeState);\n }\n }\n return undefined;\n }\n case ExtensionNotificationType.VISUALIZATION_DATA: {\n const { payload } = message;\n (this.visualizationSDK as VisualizationSDKInternal).updateVisData(\n payload\n );\n if (this.visualizationDataReceivedCallback) {\n this.visualizationDataReceivedCallback(payload);\n }\n return undefined;\n }\n case ExtensionNotificationType.TILE_HOST_DATA: {\n const { payload } = message;\n (this.tileSDK as TileSDKInternal).tileHostDataChanged(payload);\n if (this.tileHostDataChangedCallback) {\n this.tileHostDataChangedCallback(payload);\n }\n return undefined;\n }\n case ExtensionNotificationType.INITIALIZE: {\n const { payload } = message;\n const lookerHostData = payload || {};\n if (!lookerHostData.mountPoint) {\n lookerHostData.mountPoint = MountPoint.standalone;\n }\n this._lookerHostData = lookerHostData;\n this.contextData = lookerHostData.contextData;\n let errorMessage;\n if (\n this._configuration.requiredLookerVersion &&\n lookerHostData.lookerVersion\n ) {\n errorMessage = this.verifyLookerVersion(\n this._configuration.requiredLookerVersion\n );\n if (errorMessage) {\n logError(errorMessage);\n }\n }\n if (this.setInitialRoute && payload) {\n const { route, routeState } = payload;\n if (route) {\n this.setInitialRoute(route, routeState);\n }\n }\n return {\n extensionSdkVersion: EXTENSION_SDK_VERSION,\n errorMessage,\n };\n }\n default:\n logError('Unrecognized extension notification', message);\n throw new Error(`Unrecognized extension notification type ${type}`);\n }\n }\n\n createSecretKeyTag(keyName: string): string {\n const errorMessage = this.verifyLookerVersion('>=7.11');\n if (errorMessage) {\n throw new Error(errorMessage);\n }\n if (!keyName.match(/^[A-Za-z0-9_.]+$/)) {\n throw new Error('Unsupported characters in key name');\n }\n return `{{${(this._lookerHostData as LookerHostData).extensionId.replace(\n /::|-/g,\n '_'\n )}_${keyName}}}`;\n }\n\n async verifyHostConnection() {\n return this.sendAndReceive(ExtensionRequestType.VERIFY_HOST);\n }\n\n async invokeCoreSdk(\n httpMethod: string,\n path: string,\n params?: any,\n body?: any,\n authenticator?: any,\n options?: any,\n apiVersion?: ApiVersion\n ): Promise<any> {\n return this.sendAndReceive(ExtensionRequestType.INVOKE_CORE_SDK, {\n httpMethod,\n path,\n params,\n body,\n authenticator,\n options,\n apiVersion,\n });\n }\n\n async invokeCoreSdkRaw(\n httpMethod: string,\n path: string,\n params?: any,\n body?: any,\n apiVersion?: ApiVersion\n ): Promise<any> {\n return this.sendAndReceive(ExtensionRequestType.RAW_INVOKE_CORE_SDK, {\n httpMethod,\n path,\n params,\n body,\n apiVersion,\n });\n }\n\n updateTitle(title: string) {\n this.send(ExtensionRequestType.UPDATE_TITLE, { title });\n }\n\n updateLocation(url: string, state?: any, target?: string) {\n this.send(ExtensionRequestType.UPDATE_LOCATION, { url, state, target });\n }\n\n spartanLogout() {\n this.send(ExtensionRequestType.SPARTAN_LOGOUT);\n }\n\n openBrowserWindow(url: string, target?: string) {\n this.send(ExtensionRequestType.UPDATE_LOCATION, {\n url,\n undefined,\n target: target || '_blank',\n });\n }\n\n closeHostPopovers() {\n this.send(ExtensionRequestType.CLOSE_HOST_POPOVERS);\n }\n\n clientRouteChanged(route: string, routeState?: any) {\n this.send(ExtensionRequestType.ROUTE_CHANGED, {\n route,\n routeState,\n });\n }\n\n async localStorageSetItem(name: string, value = ''): Promise<boolean> {\n if (this._lookerHostData && !this._lookerHostData.lookerVersion) {\n return Promise.reject(\n new Error(\n 'localStorageSetItem not supported by the current Looker host'\n )\n );\n }\n return this.sendAndReceive(ExtensionRequestType.LOCAL_STORAGE, {\n type: 'set',\n name,\n value,\n });\n }\n\n async localStorageGetItem(name: string): Promise<string | null> {\n if (this._lookerHostData && !this._lookerHostData.lookerVersion) {\n return Promise.reject(\n new Error(\n 'localStorageGetItem not supported by the current Looker host'\n )\n );\n }\n return this.sendAndReceive(ExtensionRequestType.LOCAL_STORAGE, {\n type: 'get',\n name,\n });\n }\n\n async localStorageRemoveItem(name: string): Promise<boolean> {\n if (this._lookerHostData && !this._lookerHostData.lookerVersion) {\n return Promise.reject(\n new Error(\n 'localStorageRemoveItem not supported by the current Looker host'\n )\n );\n }\n return this.sendAndReceive(ExtensionRequestType.LOCAL_STORAGE, {\n type: 'remove',\n name,\n });\n }\n\n async clipboardWrite(value: string): Promise<void> {\n const errorMessage = this.verifyLookerVersion('>=21.7');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.CLIPBOARD, {\n type: 'write',\n value,\n });\n }\n\n async userAttributeSetItem(name: string, value = ''): Promise<boolean> {\n // User attributes added in Looker version 7.13, updated in 7.15\n const errorMessage = this.verifyLookerVersion('>=7.15');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.USER_ATTRIBUTE, {\n type: 'set',\n name,\n value,\n });\n }\n\n async userAttributeGetItem(name: string): Promise<string | null> {\n // User attributes added in Looker version 7.13, updated in 7.15\n const errorMessage = this.verifyLookerVersion('>=7.15');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.USER_ATTRIBUTE, {\n type: 'get',\n name,\n });\n }\n\n async userAttributeResetItem(name: string): Promise<void> {\n // User attributes added in Looker version 7.13, updated in 7.15\n const errorMessage = this.verifyLookerVersion('>=7.15');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.USER_ATTRIBUTE, {\n type: 'reset',\n name,\n });\n }\n\n getContextData() {\n const errorMessage = this.verifyLookerVersion('>=7.13');\n if (errorMessage) {\n throw new Error(errorMessage);\n }\n if (this.contextData) {\n return JSON.parse(this.contextData);\n } else {\n return undefined;\n }\n }\n\n async saveContextData(context: any): Promise<any> {\n const errorMessage = this.verifyLookerVersion('>=7.13');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n let contextData: string | undefined;\n if (context) {\n try {\n contextData = JSON.stringify(context);\n } catch (err) {\n return Promise.reject(new Error('context cannot be serialized'));\n }\n } else {\n contextData = undefined;\n }\n await this.sendAndReceive(ExtensionRequestType.CONTEXT_DATA, {\n type: 'save',\n contextData,\n });\n return this.getContextData();\n }\n\n async refreshContextData(): Promise<any> {\n const errorMessage = this.verifyLookerVersion('>=7.13');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n this.contextData = await this.sendAndReceive(\n ExtensionRequestType.CONTEXT_DATA,\n {\n type: 'refresh',\n }\n );\n return this.getContextData();\n }\n\n track(name: string, trackAction: string, attributes?: Record<string, any>) {\n this.send(ExtensionRequestType.TRACK_ACTION, {\n name,\n trackAction,\n attributes,\n });\n }\n\n error(errorEvent: ErrorEvent) {\n if (this._lookerHostData) {\n const { message, filename, lineno, colno, error } = errorEvent || {};\n this.send(ExtensionRequestType.ERROR_EVENT, {\n message,\n filename,\n lineno,\n colno,\n error: error && error.toString ? error.toString() : error,\n });\n } else {\n logError(\n 'Unhandled error but Looker host connection not established',\n errorEvent\n );\n }\n }\n\n unloaded() {\n this.send(ExtensionRequestType.EXTENSION_UNLOADED, {});\n }\n\n createFetchProxy(\n baseUrl?: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ) {\n return new FetchProxyImpl(this, baseUrl, init, responseBodyType);\n }\n\n async fetchProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ) {\n // Fetch proxy support added to Looker 7.9\n const errorMessage = this.verifyLookerVersion('>=7.9');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.INVOKE_EXTERNAL_API, {\n type: 'fetch',\n payload: {\n resource,\n init,\n responseBodyType,\n },\n });\n }\n\n async serverProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ) {\n // Server proxy support added to Looker 7.11\n const errorMessage = this.verifyLookerVersion('>=7.11');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.INVOKE_EXTERNAL_API, {\n type: 'server-proxy',\n payload: {\n resource,\n init,\n responseBodyType,\n },\n });\n }\n\n async oauth2Authenticate(\n authEndpoint: string,\n authParameters: Record<string, string>,\n httpMethod = 'POST'\n ) {\n // oauth2Authenticate proxy support added to Looker 7.9\n let errorMessage = this.verifyLookerVersion('>=7.9');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n errorMessage = this.validateAuthParameters(authParameters);\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(\n ExtensionRequestType.INVOKE_EXTERNAL_API,\n {\n type: 'oauth2_authenticate',\n payload: {\n authEndpoint,\n authParameters,\n httpMethod,\n },\n },\n // Adding the signal disables the default timeout\n { signal: new AbortController().signal }\n );\n }\n\n async oauth2ExchangeCodeForToken(\n authEndpoint: string,\n authParameters: Record<string, string>\n ) {\n const errorMessage = this.verifyLookerVersion('>=7.11');\n if (errorMessage) {\n return Promise.reject(new Error(errorMessage));\n }\n return this.sendAndReceive(ExtensionRequestType.INVOKE_EXTERNAL_API, {\n type: 'oauth2_exchange_code',\n payload: {\n authEndpoint,\n authParameters,\n },\n });\n }\n\n rendered(failureMessage?: string) {\n this.send(ExtensionRequestType.RENDERED, { failureMessage });\n }\n\n async sendAndReceive(\n type: string,\n payload?: any,\n options?: Options\n ): Promise<any> {\n if (!this._lookerHostData) {\n return Promise.reject(\n new Error('Looker host connection not established')\n );\n }\n const messagePayload = {\n type,\n payload,\n };\n const chattyPayload = options\n ? [messagePayload, options]\n : [messagePayload];\n return this.chattyHost\n .sendAndReceive(ExtensionEvent.EXTENSION_API_REQUEST, ...chattyPayload)\n .then(values => values[0]);\n }\n\n send(type: string, payload?: any) {\n if (!this._lookerHostData) {\n throw new Error('Looker host connection not established');\n }\n this.chattyHost.send(ExtensionEvent.EXTENSION_API_REQUEST, {\n type,\n payload,\n });\n }\n\n private verifyLookerVersion(version: string): string | undefined {\n // Default version to 7.0 as that's the first Looker version that officially\n // supported extensions. Version 6.24 has some support for extensions but most\n // likely will fail before reaching this point\n const lookerVersion = this._lookerHostData\n ? this._lookerHostData.lookerVersion || '7.0'\n : '7.0';\n if (!this._lookerHostData || !intersects(version, lookerVersion, true)) {\n return `Extension requires Looker version ${version}, got ${lookerVersion}`;\n }\n return undefined;\n }\n\n private validateAuthParameters(authParameters: Record<string, string>) {\n if (!authParameters.client_id) {\n return 'client_id missing';\n }\n if (authParameters.redirect_uri) {\n return 'redirect_uri must NOT be included';\n }\n if (\n authParameters.response_type !== 'token' &&\n authParameters.response_type !== 'id_token' &&\n authParameters.response_type !== 'code'\n ) {\n return `invalid response_type, must be token, id_token or code, ${authParameters.response_type}`;\n }\n return undefined;\n }\n}\n"],"mappings":";;;;;;AA2BA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,kBAAA,GAAAF,OAAA;AAMA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAWA,IAAAK,MAAA,GAAAL,OAAA;AAKiB,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,mBAAAC,CAAA,EAAAC,CAAA,EAAAL,CAAA,EAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,cAAAC,CAAA,GAAAN,CAAA,CAAAI,CAAA,EAAAC,CAAA,GAAAE,CA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AAmB;IAC5B;IACA,IAAInB,cAAc,CAACoB,YAAY,EAAE;MAC/B,OAAO,mCAAmC;IAC5C;IACA,IACEpB,cAAc,CAACqB,aAAa,KAAK,OAAO,IACxCrB,cAAc,CAACqB,aAAa,KAAK,UAAU,IAC3CrB,cAAc,CAACqB,aAAa,KAAK,MAAM,EACvC;MACA,kEAAAvH,MAAA,CAAkEkG,cAAc,CAACqB,aAAa;IAChG;IACA,OAAOtI,SAAS;EAClB;AACF;AAACrC,OAAA,CAAAC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.FetchProxyImpl = void 0;
7
7
  var _deepmerge = _interopRequireDefault(require("deepmerge"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- 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); } }
10
- 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); }); }; }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
10
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
11
11
  class FetchProxyImpl {
12
12
  constructor(extensionHost, baseUrl, init, responseBodyType) {
13
13
  this.extensionHost = extensionHost;
@@ -1 +1 @@
1
- {"version":3,"file":"fetch_proxy.js","names":["_deepmerge","_interopRequireDefault","require","obj","__esModule","default","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","FetchProxyImpl","constructor","extensionHost","baseUrl","init","responseBodyType","fetchProxy","resource","_this","getResource","getInit","getResponseBodyType","deepmerge","exports"],"sources":["../../src/connect/fetch_proxy.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 deepmerge from 'deepmerge';\nimport type {\n FetchCustomParameters,\n FetchProxy,\n FetchProxyDataResponse,\n FetchResponseBodyType,\n} from './types';\nimport type { ExtensionHostApiImpl } from './extension_host_api';\n\nexport class FetchProxyImpl implements FetchProxy {\n constructor(\n private extensionHost: ExtensionHostApiImpl,\n private baseUrl?: string,\n private init?: FetchCustomParameters,\n private responseBodyType?: FetchResponseBodyType\n ) {}\n\n async fetchProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ): Promise<FetchProxyDataResponse> {\n return this.extensionHost.fetchProxy(\n this.getResource(resource),\n this.getInit(init),\n this.getResponseBodyType(responseBodyType)\n );\n }\n\n private getResource(resource: string) {\n return this.baseUrl ? this.baseUrl + resource : resource;\n }\n\n private getInit(init?: FetchCustomParameters) {\n if (init || this.init) {\n return deepmerge(this.init || {}, init || {});\n }\n return undefined;\n }\n\n private getResponseBodyType(responseBodyType?: FetchResponseBodyType) {\n return responseBodyType || this.responseBodyType;\n }\n}\n"],"mappings":";;;;;;AAyBA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAkC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,IAAA,GAAAP,GAAA,CAAAK,GAAA,EAAAC,GAAA,OAAAE,KAAA,GAAAD,IAAA,CAAAC,KAAA,WAAAC,KAAA,IAAAP,MAAA,CAAAO,KAAA,iBAAAF,IAAA,CAAAG,IAAA,IAAAT,OAAA,CAAAO,KAAA,YAAAG,OAAA,CAAAV,OAAA,CAAAO,KAAA,EAAAI,IAAA,CAAAT,KAAA,EAAAC,MAAA;AAAA,SAAAS,kBAAAC,EAAA,6BAAAC,IAAA,SAAAC,IAAA,GAAAC,SAAA,aAAAN,OAAA,WAAAV,OAAA,EAAAC,MAAA,QAAAF,GAAA,GAAAc,EAAA,CAAAI,KAAA,CAAAH,IAAA,EAAAC,IAAA,YAAAb,MAAAK,KAAA,IAAAT,kBAAA,CAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,UAAAI,KAAA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_deepmerge","_interopRequireDefault","require","e","__esModule","default","asyncGeneratorStep","n","t","r","o","a","c","i","u","value","done","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","FetchProxyImpl","constructor","extensionHost","baseUrl","init","responseBodyType","fetchProxy","resource","_this","getResource","getInit","getResponseBodyType","deepmerge","undefined","exports"],"sources":["../../src/connect/fetch_proxy.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 deepmerge from 'deepmerge';\nimport type {\n FetchCustomParameters,\n FetchProxy,\n FetchProxyDataResponse,\n FetchResponseBodyType,\n} from './types';\nimport type { ExtensionHostApiImpl } from './extension_host_api';\n\nexport class FetchProxyImpl implements FetchProxy {\n constructor(\n private extensionHost: ExtensionHostApiImpl,\n private baseUrl?: string,\n private init?: FetchCustomParameters,\n private responseBodyType?: FetchResponseBodyType\n ) {}\n\n async fetchProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ): Promise<FetchProxyDataResponse> {\n return this.extensionHost.fetchProxy(\n this.getResource(resource),\n this.getInit(init),\n this.getResponseBodyType(responseBodyType)\n );\n }\n\n private getResource(resource: string) {\n return this.baseUrl ? this.baseUrl + resource : resource;\n }\n\n private getInit(init?: FetchCustomParameters) {\n if (init || this.init) {\n return deepmerge(this.init || {}, init || {});\n }\n return undefined;\n }\n\n private getResponseBodyType(responseBodyType?: FetchResponseBodyType) {\n return responseBodyType || this.responseBodyType;\n }\n}\n"],"mappings":";;;;;;AAyBA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAkC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,mBAAAC,CAAA,EAAAC,CAAA,EAAAL,CAAA,EAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,cAAAC,CAAA,GAAAN,CAAA,CAAAI,CAAA,EAAAC,CAAA,GAAAE,CAAA,GAAAD,CAAA,CAAAE,KAAA,WAAAR,CAAA,gBAAAJ,CAAA,CAAAI,CAAA,KAAAM,CAAA,CAAAG,IAAA,GAAAR,CAAA,CAAAM,CAAA,IAAAG,OAAA,CAAAC,OAAA,CAAAJ,CAAA,EAAAK,IAAA,CAAAV,CAAA,EAAAC,CAAA;AAAA,SAAAU,kBAAAb,CAAA,6BAAAC,CAAA,SAAAL,CAAA,GAAAkB,SAAA,aAAAJ,OAAA,WAAAR,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAJ,CAAA,CAAAe,KAAA,CAAAd,CAAA,EAAAL,CAAA,YAAAoB,MAAAhB,CAAA,IAAAD,kBAAA,CAAAK,CAAA,EAAAF,CAAA,EAAAC,CAAA,EAAAa,KAAA,EAAAC,MAAA,UAAAjB,CAAA,cAAAiB,OAAAjB,CAAA,IAAAD,kBAAA,CAAAK,CAAA,EAAAF,CAAA,EAAAC,CAAA,EAAAa,KAAA,EAAAC,MAAA,WAAAjB,CAAA,KAAAgB,KAAA;AAS3B,MAAME,cAAc,CAAuB;EAChDC,WAAWA,CACDC,aAAmC,EACnCC,OAAgB,EAChBC,IAA4B,EAC5BC,gBAAwC,EAChD;IAAA,KAJQH,aAAmC,GAAnCA,aAAmC;IAAA,KACnCC,OAAgB,GAAhBA,OAAgB;IAAA,KAChBC,IAA4B,GAA5BA,IAA4B;IAAA,KAC5BC,gBAAwC,GAAxCA,gBAAwC;EAC/C;EAEGC,UAAUA,CACdC,QAAgB,EAChBH,IAA4B,EAC5BC,gBAAwC,EACP;IAAA,IAAAG,KAAA;IAAA,OAAAb,iBAAA;MACjC,OAAOa,KAAI,CAACN,aAAa,CAACI,UAAU,CAClCE,KAAI,CAACC,WAAW,CAACF,QAAQ,CAAC,EAC1BC,KAAI,CAACE,OAAO,CAACN,IAAI,CAAC,EAClBI,KAAI,CAACG,mBAAmB,CAACN,gBAAgB,CAC3C,CAAC;IAAC;EACJ;EAEQI,WAAWA,CAACF,QAAgB,EAAE;IACpC,OAAO,IAAI,CAACJ,OAAO,GAAG,IAAI,CAACA,OAAO,GAAGI,QAAQ,GAAGA,QAAQ;EAC1D;EAEQG,OAAOA,CAACN,IAA4B,EAAE;IAC5C,IAAIA,IAAI,IAAI,IAAI,CAACA,IAAI,EAAE;MACrB,OAAO,IAAAQ,kBAAS,EAAC,IAAI,CAACR,IAAI,IAAI,CAAC,CAAC,EAAEA,IAAI,IAAI,CAAC,CAAC,CAAC;IAC/C;IACA,OAAOS,SAAS;EAClB;EAEQF,mBAAmBA,CAACN,gBAAwC,EAAE;IACpE,OAAOA,gBAAgB,IAAI,IAAI,CAACA,gBAAgB;EAClD;AACF;AAACS,OAAA,CAAAd,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"global_listener.js","names":["_util","require","_hostApi","errorListener","event","error","_looker_reported","logError","beforeUnloadListener","unloaded","logWarn","setupGlobalListeners","window","addEventListener","registerHostApi","hostApi","exports","getExtensionSDK","lookerHostData","Error"],"sources":["../../src/connect/global_listener.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 { logError, logWarn } from '../util';\nimport type { ExtensionHostApi, ExtensionSDK } from './types';\n\nlet _hostApi: ExtensionHostApi | undefined;\n\nconst errorListener = (event: ErrorEvent) => {\n if (_hostApi) {\n // in development mode errors get reported twice. Suspect react\n // development code re-reporting the error. Before error reporting\n // was working correctly in sandboxed iframe there were two distinct\n // errors on two separate events. After the fix the same error is\n // reported twice on two events. A \"looker\" property is set on the\n // error object. The second time the listener is called, the error\n // is ignored as it has already been reported.\n if (event.error) {\n if (!event.error._looker_reported) {\n _hostApi.error(event);\n event.error._looker_reported = true;\n }\n } else {\n _hostApi.error(event);\n }\n } else {\n logError(\n 'Extension has unhandled error. Reporting on console as Looker host api not initialized',\n event\n );\n }\n};\n\n/**\n * Listen for unload events and send message to host.\n * Host will reload the extension. Stops new pages being\n * loaded using form submission.\n */\nconst beforeUnloadListener = () => {\n if (_hostApi) {\n _hostApi.unloaded();\n logWarn('Extension is being unloaded');\n }\n};\n\nconst setupGlobalListeners = () => {\n window.addEventListener('error', errorListener);\n window.addEventListener('beforeunload', beforeUnloadListener);\n};\n\nsetupGlobalListeners();\n\n/**\n * Register the api with the error listener.\n */\nexport const registerHostApi = (hostApi: ExtensionHostApi) => {\n _hostApi = hostApi;\n};\n\n/**\n * Static reference to extension SDK.\n * Will throw an error if the extensionSDK has not been initialized\n */\nexport const getExtensionSDK = (): ExtensionSDK => {\n if (_hostApi && _hostApi.lookerHostData) {\n return _hostApi;\n }\n throw new Error('ExtensionSDK not initialized');\n};\n"],"mappings":";;;;;;AA0BA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAIC,QAAsC;AAE1C,IAAMC,aAAa,GAAIC,KAAiB,IAAK;EAC3C,IAAIF,QAAQ,EAAE;IAQZ,IAAIE,KAAK,CAACC,KAAK,EAAE;MACf,IAAI,CAACD,KAAK,CAACC,KAAK,CAACC,gBAAgB,EAAE;QACjCJ,QAAQ,CAACG,KAAK,CAACD,KAAK,CAAC;QACrBA,KAAK,CAACC,KAAK,CAACC,gBAAgB,GAAG,IAAI;MACrC;IACF,CAAC,MAAM;MACLJ,QAAQ,CAACG,KAAK,CAACD,KAAK,CAAC;IACvB;EACF,CAAC,MAAM;IACL,IAAAG,cAAQ,EACN,wFAAwF,EACxFH,KACF,CAAC;EACH;AACF,CAAC;AAOD,IAAMI,oBAAoB,GAAGA,CAAA,KAAM;EACjC,IAAIN,QAAQ,EAAE;IACZA,QAAQ,CAACO,QAAQ,CAAC,CAAC;IACnB,IAAAC,aAAO,EAAC,6BAA6B,CAAC;EACxC;AACF,CAAC;AAED,IAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACjCC,MAAM,CAACC,gBAAgB,CAAC,OAAO,EAAEV,aAAa,CAAC;EAC/CS,MAAM,CAACC,gBAAgB,CAAC,cAAc,EAAEL,oBAAoB,CAAC;AAC/D,CAAC;AAEDG,oBAAoB,CAAC,CAAC;AAKf,IAAMG,eAAe,GAAIC,OAAyB,IAAK;EAC5Db,QAAQ,GAAGa,OAAO;AACpB,CAAC;AAACC,OAAA,CAAAF,eAAA,GAAAA,eAAA;AAMK,IAAMG,eAAe,GAAGA,CAAA,KAAoB;EACjD,IAAIf,QAAQ,IAAIA,QAAQ,CAACgB,cAAc,EAAE;IACvC,OAAOhB,QAAQ;EACjB;EACA,MAAM,IAAIiB,KAAK,CAAC,8BAA8B,CAAC;AACjD,CAAC;AAACH,OAAA,CAAAC,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"file":"global_listener.js","names":["_util","require","_hostApi","errorListener","event","error","_looker_reported","logError","beforeUnloadListener","unloaded","logWarn","setupGlobalListeners","window","addEventListener","registerHostApi","hostApi","exports","getExtensionSDK","lookerHostData","Error"],"sources":["../../src/connect/global_listener.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 { logError, logWarn } from '../util';\nimport type { ExtensionHostApi, ExtensionSDK } from './types';\n\nlet _hostApi: ExtensionHostApi | undefined;\n\nconst errorListener = (event: ErrorEvent) => {\n if (_hostApi) {\n // in development mode errors get reported twice. Suspect react\n // development code re-reporting the error. Before error reporting\n // was working correctly in sandboxed iframe there were two distinct\n // errors on two separate events. After the fix the same error is\n // reported twice on two events. A \"looker\" property is set on the\n // error object. The second time the listener is called, the error\n // is ignored as it has already been reported.\n if (event.error) {\n if (!event.error._looker_reported) {\n _hostApi.error(event);\n event.error._looker_reported = true;\n }\n } else {\n _hostApi.error(event);\n }\n } else {\n logError(\n 'Extension has unhandled error. Reporting on console as Looker host api not initialized',\n event\n );\n }\n};\n\n/**\n * Listen for unload events and send message to host.\n * Host will reload the extension. Stops new pages being\n * loaded using form submission.\n */\nconst beforeUnloadListener = () => {\n if (_hostApi) {\n _hostApi.unloaded();\n logWarn('Extension is being unloaded');\n }\n};\n\nconst setupGlobalListeners = () => {\n window.addEventListener('error', errorListener);\n window.addEventListener('beforeunload', beforeUnloadListener);\n};\n\nsetupGlobalListeners();\n\n/**\n * Register the api with the error listener.\n */\nexport const registerHostApi = (hostApi: ExtensionHostApi) => {\n _hostApi = hostApi;\n};\n\n/**\n * Static reference to extension SDK.\n * Will throw an error if the extensionSDK has not been initialized\n */\nexport const getExtensionSDK = (): ExtensionSDK => {\n if (_hostApi && _hostApi.lookerHostData) {\n return _hostApi;\n }\n throw new Error('ExtensionSDK not initialized');\n};\n"],"mappings":";;;;;;AA0BA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAIC,QAAsC;AAE1C,IAAMC,aAAa,GAAIC,KAAiB,IAAK;EAC3C,IAAIF,QAAQ,EAAE;IAQZ,IAAIE,KAAK,CAACC,KAAK,EAAE;MACf,IAAI,CAACD,KAAK,CAACC,KAAK,CAACC,gBAAgB,EAAE;QACjCJ,QAAQ,CAACG,KAAK,CAACD,KAAK,CAAC;QACrBA,KAAK,CAACC,KAAK,CAACC,gBAAgB,GAAG,IAAI;MACrC;IACF,CAAC,MAAM;MACLJ,QAAQ,CAACG,KAAK,CAACD,KAAK,CAAC;IACvB;EACF,CAAC,MAAM;IACL,IAAAG,cAAQ,EACN,wFAAwF,EACxFH,KACF,CAAC;EACH;AACF,CAAC;AAOD,IAAMI,oBAAoB,GAAGA,CAAA,KAAM;EACjC,IAAIN,QAAQ,EAAE;IACZA,QAAQ,CAACO,QAAQ,CAAC,CAAC;IACnB,IAAAC,aAAO,EAAC,6BAA6B,CAAC;EACxC;AACF,CAAC;AAED,IAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACjCC,MAAM,CAACC,gBAAgB,CAAC,OAAO,EAAEV,aAAa,CAAC;EAC/CS,MAAM,CAACC,gBAAgB,CAAC,cAAc,EAAEL,oBAAoB,CAAC;AAC/D,CAAC;AAEDG,oBAAoB,CAAC,CAAC;AAKf,IAAMG,eAAe,GAAIC,OAAyB,IAAK;EAC5Db,QAAQ,GAAGa,OAAO;AACpB,CAAC;AAACC,OAAA,CAAAF,eAAA,GAAAA,eAAA;AAMK,IAAMG,eAAe,GAAGA,CAAA,KAAoB;EACjD,IAAIf,QAAQ,IAAIA,QAAQ,CAACgB,cAAc,EAAE;IACvC,OAAOhB,QAAQ;EACjB;EACA,MAAM,IAAIiB,KAAK,CAAC,8BAA8B,CAAC;AACjD,CAAC;AAACH,OAAA,CAAAC,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_types","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_types2","_types3","_connect_extension_host","_global_listener"],"sources":["../../src/connect/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 './visualization/types';\nexport * from './tile/types';\nexport * from './types';\nexport * from './connect_extension_host';\nexport { getExtensionSDK } from './global_listener';\n"],"mappings":";;;;;;;;;;;;;;AA0BA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAb,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,OAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,OAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAA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OAAA"}
1
+ {"version":3,"file":"index.js","names":["_types","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_types2","_types3","_connect_extension_host","_global_listener"],"sources":["../../src/connect/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 './visualization/types';\nexport * from './tile/types';\nexport * from './types';\nexport * from './connect_extension_host';\nexport { getExtensionSDK } from './global_listener';\n"],"mappings":";;;;;;;;;;;;;;AA0BA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,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AAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAW,uBAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAG,uBAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AACA,IAAAY,gBAAA,GAAAhB,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_types","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/connect/tile/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './types';\n"],"mappings":";;;;;AAyBA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_types","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/connect/tile/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './types';\n"],"mappings":";;;;;AAyBA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -9,8 +9,8 @@ var _types = require("../types");
9
9
  var _types2 = require("./types");
10
10
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
11
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
- 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; }
13
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
12
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
14
14
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
15
  var defaultHostData = {
16
16
  isDashboardEditing: false,
@@ -1 +1 @@
1
- {"version":3,"file":"tile_sdk.js","names":["_errors","require","_types","_types2","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","defaultHostData","isDashboardEditing","dashboardRunState","DashboardRunState","UNKNOWN","dashboardFilters","TileSDKImpl","constructor","hostApi","tileHostData","tileHostDataChanged","partialHostData","isDashboardMountSupported","addError","error","send","ExtensionRequestType","TILE_ADD_ERRORS","errors","NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR","clearError","TILE_CLEAR_ERRORS","group","undefined","addErrors","_len","Array","_key","clearErrors","openDrillMenu","options","event","TILE_OPEN_DRILL_MENU","sanitizeEvent","toggleCrossFilter","TILE_TOGGLE_CROSS_FILTER","runDashboard","TILE_RUN_DASHBOARD","stopDashboard","TILE_STOP_DASHBOARD","updateFilters","filters","run","TILE_UPDATE_FILTERS","openScheduleDialog","sendAndReceive","TILE_OPEN_SCHEDULE_DIALOG","metaKey","pageX","pageY","type","exports"],"sources":["../../../src/connect/tile/tile_sdk.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 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 { NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR } from '../../util/errors';\nimport { ExtensionRequestType } from '../types';\nimport type { ExtensionHostApiImpl } from '../extension_host_api';\nimport type {\n CrossFilterOptions,\n DrillMenuOptions,\n Filters,\n TileError,\n TileHostData,\n TileSDKInternal,\n} from './types';\nimport { DashboardRunState } from './types';\n\nconst defaultHostData: TileHostData = {\n isDashboardEditing: false,\n dashboardRunState: DashboardRunState.UNKNOWN,\n dashboardFilters: {},\n};\nexport class TileSDKImpl implements TileSDKInternal {\n hostApi: ExtensionHostApiImpl;\n tileHostData: TileHostData;\n\n constructor(hostApi: ExtensionHostApiImpl) {\n this.hostApi = hostApi;\n this.tileHostData = { ...defaultHostData };\n }\n\n tileHostDataChanged(partialHostData: Partial<TileHostData>) {\n // Ignore update messages if dashboard mounts not supported.\n // Should never happen.\n if (this.hostApi.isDashboardMountSupported) {\n this.tileHostData = { ...this.tileHostData, ...partialHostData };\n }\n }\n\n addError(error: TileError) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_ADD_ERRORS, {\n errors: [error],\n });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n clearError() {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_CLEAR_ERRORS, {\n group: undefined,\n });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n addErrors(...errors: TileError[]) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_ADD_ERRORS, { errors });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n clearErrors(group?: string) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_CLEAR_ERRORS, { group });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n openDrillMenu(options: DrillMenuOptions, event?: MouseEvent) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_OPEN_DRILL_MENU, {\n options,\n event: this.sanitizeEvent(event),\n });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n toggleCrossFilter(options: CrossFilterOptions, event?: MouseEvent) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_TOGGLE_CROSS_FILTER, {\n options,\n event: this.sanitizeEvent(event),\n });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n runDashboard() {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_RUN_DASHBOARD, {});\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n stopDashboard() {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_STOP_DASHBOARD, {});\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n updateFilters(filters: Filters, run = false) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_UPDATE_FILTERS, {\n filters,\n run,\n });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n openScheduleDialog() {\n if (this.hostApi.isDashboardMountSupported) {\n return this.hostApi.sendAndReceive(\n ExtensionRequestType.TILE_OPEN_SCHEDULE_DIALOG,\n {}\n );\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n sanitizeEvent(event?: MouseEvent) {\n if (event) {\n return {\n metaKey: event.metaKey,\n pageX: event.pageX,\n pageY: event.pageY,\n type: event.type,\n };\n }\n return undefined;\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAUA,IAAAE,OAAA,GAAAF,OAAA;AAA4C,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,CAAA,KAAAH,OAAA,CAAAI,MAAA,CAAAD,CAAA,GAAAa,OAAA,WAAAd,CAAA,IAAAE,MAAA,CAAAgB,cAAA,CAAAnB,CAA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5C,SAAA,MAAG,KAAK;IACzC,IAAI,IAAI,CAAC6B,OAAO,CAACI,yBAAyB,EAAE;MAC1C,IAAI,CAACJ,OAAO,CAACO,IAAI,CAACC,2BAAoB,CAAC2B,mBAAmB,EAAE;QAC1DF,OAAO;QACPC;MACF,CAAC,CAAC;IACJ,CAAC,MAAM;MACL,MAAMvB,+CAAuC;IAC/C;EACF;EAEAyB,kBAAkBA,CAAA,EAAG;IACnB,IAAI,IAAI,CAACpC,OAAO,CAACI,yBAAyB,EAAE;MAC1C,OAAO,IAAI,CAACJ,OAAO,CAACqC,cAAc,CAChC7B,2BAAoB,CAAC8B,yBAAyB,EAC9C,CAAC,CACH,CAAC;IACH,CAAC,MAAM;MACL,MAAM3B,+CAAuC;IAC/C;EACF;EAEAc,aAAaA,CAACF,KAAkB,EAAE;IAChC,IAAIA,KAAK,EAAE;MACT,OAAO;QACLgB,OAAO,EAAEhB,KAAK,CAACgB,OAAO;QACtBC,KAAK,EAAEjB,KAAK,CAACiB,KAAK;QAClBC,KAAK,EAAElB,KAAK,CAACkB,KAAK;QAClBC,IAAI,EAAEnB,KAAK,CAACmB;MACd,CAAC;IACH;IACA,OAAO3B,SAAS;EAClB;AACF;AAAC4B,OAAA,CAAA7C,WAAA,GAAAA,WAAA"}
1
+ {"version":3,"file":"tile_sdk.js","names":["_errors","require","_types","_types2","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","defaultHostData","isDashboardEditing","dashboardRunState","DashboardRunState","UNKNOWN","dashboardFilters","TileSDKImpl","constructor","hostApi","tileHostData","tileHostDataChanged","partialHostData","isDashboardMountSupported","addError","error","send","ExtensionRequestType","TILE_ADD_ERRORS","errors","NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR","clearError","TILE_CLEAR_ERRORS","group","undefined","addErrors","_len","Array","_key","clearErrors","openDrillMenu","options","event","TILE_OPEN_DRILL_MENU","sanitizeEvent","toggleCrossFilter","TILE_TOGGLE_CROSS_FILTER","runDashboard","TILE_RUN_DASHBOARD","stopDashboard","TILE_STOP_DASHBOARD","updateFilters","filters","run","TILE_UPDATE_FILTERS","openScheduleDialog","sendAndReceive","TILE_OPEN_SCHEDULE_DIALOG","metaKey","pageX","pageY","type","exports"],"sources":["../../../src/connect/tile/tile_sdk.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 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 { NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR } from '../../util/errors';\nimport { ExtensionRequestType } from '../types';\nimport type { ExtensionHostApiImpl } from '../extension_host_api';\nimport type {\n CrossFilterOptions,\n DrillMenuOptions,\n Filters,\n TileError,\n TileHostData,\n TileSDKInternal,\n} from './types';\nimport { DashboardRunState } from './types';\n\nconst defaultHostData: TileHostData = {\n isDashboardEditing: false,\n dashboardRunState: DashboardRunState.UNKNOWN,\n dashboardFilters: {},\n};\nexport class TileSDKImpl implements TileSDKInternal {\n hostApi: ExtensionHostApiImpl;\n tileHostData: TileHostData;\n\n constructor(hostApi: ExtensionHostApiImpl) {\n this.hostApi = hostApi;\n this.tileHostData = { ...defaultHostData };\n }\n\n tileHostDataChanged(partialHostData: Partial<TileHostData>) {\n // Ignore update messages if dashboard mounts not supported.\n // Should never happen.\n if (this.hostApi.isDashboardMountSupported) {\n this.tileHostData = { ...this.tileHostData, ...partialHostData };\n }\n }\n\n addError(error: TileError) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_ADD_ERRORS, {\n errors: [error],\n });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n clearError() {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_CLEAR_ERRORS, {\n group: undefined,\n });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n addErrors(...errors: TileError[]) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_ADD_ERRORS, { errors });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n clearErrors(group?: string) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_CLEAR_ERRORS, { group });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n openDrillMenu(options: DrillMenuOptions, event?: MouseEvent) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_OPEN_DRILL_MENU, {\n options,\n event: this.sanitizeEvent(event),\n });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n toggleCrossFilter(options: CrossFilterOptions, event?: MouseEvent) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_TOGGLE_CROSS_FILTER, {\n options,\n event: this.sanitizeEvent(event),\n });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n runDashboard() {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_RUN_DASHBOARD, {});\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n stopDashboard() {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_STOP_DASHBOARD, {});\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n updateFilters(filters: Filters, run = false) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_UPDATE_FILTERS, {\n filters,\n run,\n });\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n openScheduleDialog() {\n if (this.hostApi.isDashboardMountSupported) {\n return this.hostApi.sendAndReceive(\n ExtensionRequestType.TILE_OPEN_SCHEDULE_DIALOG,\n {}\n );\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;\n }\n }\n\n sanitizeEvent(event?: MouseEvent) {\n if (event) {\n return {\n metaKey: event.metaKey,\n pageX: event.pageX,\n pageY: event.pageY,\n type: event.type,\n };\n }\n return undefined;\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAUA,IAAAE,OAAA,GAAAF,OAAA;AAA4C,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAA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Ac,aAAaA,CAACF,KAAkB,EAAE;IAChC,IAAIA,KAAK,EAAE;MACT,OAAO;QACLgB,OAAO,EAAEhB,KAAK,CAACgB,OAAO;QACtBC,KAAK,EAAEjB,KAAK,CAACiB,KAAK;QAClBC,KAAK,EAAElB,KAAK,CAACkB,KAAK;QAClBC,IAAI,EAAEnB,KAAK,CAACmB;MACd,CAAC;IACH;IACA,OAAO3B,SAAS;EAClB;AACF;AAAC4B,OAAA,CAAA7C,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["DashboardRunState","exports"],"sources":["../../../src/connect/tile/types.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 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 { IQuery } from '@looker/sdk';\n\n/**\n * Callback that is invoked when a change in the host happens\n * <code>Looker >=22.8</code>\n */\nexport type TileHostDataChangedCallback = (\n tileHostData: Partial<TileHostData>\n) => void;\n\n/**\n * Defines the current run state of the dashboard\n */\nexport enum DashboardRunState {\n UNKNOWN = 'UNKNOWN',\n RUNNING = 'RUNNING',\n NOT_RUNNING = 'NOT_RUNNING',\n}\n\nexport interface TileHostData {\n /**\n * When true indicates that the tile is being configured as\n * a visualization inside of an explore.\n */\n isExploring?: boolean;\n /**\n * The dashboard id the tile is being rendered in. If the tile\n * is being configured as an explore this will not be populated.\n */\n dashboardId?: string;\n /**\n * The element id of the tile being rendered. If the tile\n * is being configured as an explore this will not be populated.\n */\n elementId?: string;\n /**\n * The query id of the tile being rendered if it is associated with\n * a visualization. If the tile is being configured as an explore\n * this will not be populated.\n *\n * Note that queryId is that of the query created when the visualization\n * is built in the Looker explore. It does not contain any filters or\n * cross filtering applied to the dashboard. Filters and cross filters\n * will need to be applied and a new query generated in order to reflect\n * the data shown in the QueryResponse. As such the queryId may not be\n * that useful. See filteredQuery for query object with filters applied.\n */\n queryId?: string;\n /**\n * The query slug of the tile being rendered if it is associated with\n * a visualization. If the tile is being configured as an explore\n * this will not be populated.\n *\n * Note that querySlug is that of the query created when the visualization\n * is built in the Looker explore. It does not contain any filters or\n * cross filtering applied to the dashboard. Filters and cross filters\n * will need to be applied and a new query generated in order to reflect\n * the data shown in the QueryResponse. As such the queryId may not be\n * that useful. See filteredQuery for query object with filters applied.\n */\n querySlug?: string;\n /**\n * The filters being applied to the dashboard. If the tile\n * is being configured as an explore this will not be populated.\n */\n dashboardFilters?: Filters;\n /**\n * Indicates whether the dashboard is running. If the tile\n * is being configured as an explore the state will be UNKNOWN.\n * Note that for dashboard performance reasons, the runstate\n * may NEVER be shown as running. This generally will happen\n * if there are no other tiles associated with a query (including\n * the one the extension is associated with).\n * If the extension needs to know for certain that a dashboard\n * has been run, detecting differences in the lastRunStartTime\n * is the reliable way.\n */\n dashboardRunState?: DashboardRunState;\n /**\n * When true, the dashboard is being edited. If the tile\n * is being configured as an explore this will not be populated.\n */\n isDashboardEditing?: boolean;\n /**\n * When true, cross filtering. If the tile\n * is being configured as an explore this will not be populated.\n */\n isDashboardCrossFilteringEnabled?: boolean;\n /**\n * A query object that matches the query ID associated with the\n * underlying dashboard element with any dashboard filters and\n * timezone changes made at the dashboard level applied.\n */\n filteredQuery?: IQuery;\n /**\n * The id of the tile extension element that triggered the last\n * dashboard run. The id will be undefined if the dashboard run\n * was triggered by the dashboard run button or auto run or if\n * the run was triggered using the embed SDK. If the tile\n * is being configured as an explore this will not be populated.\n * Note that the lastRunSourceElementId CAN be the same as the\n * element id of the current extension instance, in other words,\n * if the extension triggers a dashboard run, it will be notified\n * when the dashboard run starts and finishes.\n */\n lastRunSourceElementId?: string;\n /**\n * Indicates the last dashboard run start time. If the tile\n * is being configured as an explore this will not be populated.\n * Note that the start and end times reported should not\n * used for capturing performance metrics.\n */\n lastRunStartTime?: number;\n /**\n * Indicates the last dashboard run end time. If the tile\n * is being configured as an explore this will not be populated.\n * If the tile is running, this will not be populated.\n * Note that the start and end times reported should not\n * used for capturing performance metrics.\n */\n lastRunEndTime?: number;\n /**\n * Indicates whether the last dashboard run was succesful or not.\n * If the tile is being configured as an explore this will not be\n * populated.\n * If the tile is running, this will not be populated.\n */\n lastRunSuccess?: boolean;\n}\n\nexport interface Pivot {\n key: string;\n is_total: boolean;\n data: { [key: string]: string };\n metadata: { [key: string]: { [key: string]: string | Link[] } };\n labels: { [key: string]: string };\n sort_values?: { [key: string]: string };\n}\n\nexport interface Cell {\n [key: string]: any;\n value: any;\n rendered?: string;\n html?: string;\n links?: Link[];\n}\n\nexport interface Link {\n label: string;\n type: string;\n type_label: string;\n url: string;\n}\n\nexport interface PivotCell {\n [pivotKey: string]: Cell;\n}\n\nexport interface Row {\n [fieldName: string]: PivotCell | Cell;\n}\n\nexport interface TileError {\n title: string;\n message: string;\n group: string;\n}\n\nexport interface CrossFilterOptions {\n pivot: Pivot;\n row: Row;\n}\n\nexport type DrillMenuOptions = any;\n\nexport interface Filters {\n [key: string]: string;\n}\n\n/**\n * For internal use only\n */\nexport interface TileSDKInternal extends TileSDK {\n tileHostDataChanged: (hostData: Partial<TileHostData>) => void;\n}\n\n/**\n * Extension tile SDK\n */\nexport interface TileSDK {\n /**\n * Tile host data.\n */\n tileHostData: TileHostData;\n /**\n * Display an error beneath the tile extension.\n */\n addError: (error: TileError) => void;\n /**\n * Clear an error beneath the tile extension.\n */\n clearError: () => void;\n /**\n * Display an error beneath the tile extension.\n * @deprecated\n */\n addErrors: (...errors: TileError[]) => void;\n /**\n * Clear an error beneath the tile extension.\n * @deprecated\n */\n clearErrors: (group?: string) => void;\n /**\n * Open a drill menu. The event controls positioning of the drill menu.\n * Set the pageX and pageY properties on the event to control the\n * positioning (all other properties are ignored).\n */\n openDrillMenu: (options: DrillMenuOptions, event?: MouseEvent) => void;\n /**\n * Toggle cross filters. This is ignored when running in an explore.\n */\n toggleCrossFilter: (options: CrossFilterOptions, event?: MouseEvent) => void;\n /**\n * Run the current dashboard. This is ignored when running in an explore.\n */\n runDashboard: () => void;\n /**\n * Stop the current dashboard. This is ignored when running in an explore.\n */\n stopDashboard: () => void;\n /**\n * Update the current filters.\n */\n updateFilters: (filters: Filters, run?: boolean) => void;\n /**\n * Open the schedule dialog. This is ignored when running in an explore.\n */\n openScheduleDialog: () => Promise<void>;\n}\n"],"mappings":";;;;;;IAuCYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,aAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA"}
1
+ {"version":3,"file":"types.js","names":["DashboardRunState","exports"],"sources":["../../../src/connect/tile/types.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 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 { IQuery } from '@looker/sdk';\n\n/**\n * Callback that is invoked when a change in the host happens\n * <code>Looker >=22.8</code>\n */\nexport type TileHostDataChangedCallback = (\n tileHostData: Partial<TileHostData>\n) => void;\n\n/**\n * Defines the current run state of the dashboard\n */\nexport enum DashboardRunState {\n UNKNOWN = 'UNKNOWN',\n RUNNING = 'RUNNING',\n NOT_RUNNING = 'NOT_RUNNING',\n}\n\nexport interface TileHostData {\n /**\n * When true indicates that the tile is being configured as\n * a visualization inside of an explore.\n */\n isExploring?: boolean;\n /**\n * The dashboard id the tile is being rendered in. If the tile\n * is being configured as an explore this will not be populated.\n */\n dashboardId?: string;\n /**\n * The element id of the tile being rendered. If the tile\n * is being configured as an explore this will not be populated.\n */\n elementId?: string;\n /**\n * The query id of the tile being rendered if it is associated with\n * a visualization. If the tile is being configured as an explore\n * this will not be populated.\n *\n * Note that queryId is that of the query created when the visualization\n * is built in the Looker explore. It does not contain any filters or\n * cross filtering applied to the dashboard. Filters and cross filters\n * will need to be applied and a new query generated in order to reflect\n * the data shown in the QueryResponse. As such the queryId may not be\n * that useful. See filteredQuery for query object with filters applied.\n */\n queryId?: string;\n /**\n * The query slug of the tile being rendered if it is associated with\n * a visualization. If the tile is being configured as an explore\n * this will not be populated.\n *\n * Note that querySlug is that of the query created when the visualization\n * is built in the Looker explore. It does not contain any filters or\n * cross filtering applied to the dashboard. Filters and cross filters\n * will need to be applied and a new query generated in order to reflect\n * the data shown in the QueryResponse. As such the queryId may not be\n * that useful. See filteredQuery for query object with filters applied.\n */\n querySlug?: string;\n /**\n * The filters being applied to the dashboard. If the tile\n * is being configured as an explore this will not be populated.\n */\n dashboardFilters?: Filters;\n /**\n * Indicates whether the dashboard is running. If the tile\n * is being configured as an explore the state will be UNKNOWN.\n * Note that for dashboard performance reasons, the runstate\n * may NEVER be shown as running. This generally will happen\n * if there are no other tiles associated with a query (including\n * the one the extension is associated with).\n * If the extension needs to know for certain that a dashboard\n * has been run, detecting differences in the lastRunStartTime\n * is the reliable way.\n */\n dashboardRunState?: DashboardRunState;\n /**\n * When true, the dashboard is being edited. If the tile\n * is being configured as an explore this will not be populated.\n */\n isDashboardEditing?: boolean;\n /**\n * When true, cross filtering. If the tile\n * is being configured as an explore this will not be populated.\n */\n isDashboardCrossFilteringEnabled?: boolean;\n /**\n * A query object that matches the query ID associated with the\n * underlying dashboard element with any dashboard filters and\n * timezone changes made at the dashboard level applied.\n */\n filteredQuery?: IQuery;\n /**\n * The id of the tile extension element that triggered the last\n * dashboard run. The id will be undefined if the dashboard run\n * was triggered by the dashboard run button or auto run or if\n * the run was triggered using the embed SDK. If the tile\n * is being configured as an explore this will not be populated.\n * Note that the lastRunSourceElementId CAN be the same as the\n * element id of the current extension instance, in other words,\n * if the extension triggers a dashboard run, it will be notified\n * when the dashboard run starts and finishes.\n */\n lastRunSourceElementId?: string;\n /**\n * Indicates the last dashboard run start time. If the tile\n * is being configured as an explore this will not be populated.\n * Note that the start and end times reported should not\n * used for capturing performance metrics.\n */\n lastRunStartTime?: number;\n /**\n * Indicates the last dashboard run end time. If the tile\n * is being configured as an explore this will not be populated.\n * If the tile is running, this will not be populated.\n * Note that the start and end times reported should not\n * used for capturing performance metrics.\n */\n lastRunEndTime?: number;\n /**\n * Indicates whether the last dashboard run was succesful or not.\n * If the tile is being configured as an explore this will not be\n * populated.\n * If the tile is running, this will not be populated.\n */\n lastRunSuccess?: boolean;\n}\n\nexport interface Pivot {\n key: string;\n is_total: boolean;\n data: { [key: string]: string };\n metadata: { [key: string]: { [key: string]: string | Link[] } };\n labels: { [key: string]: string };\n sort_values?: { [key: string]: string };\n}\n\nexport interface Cell {\n [key: string]: any;\n value: any;\n rendered?: string;\n html?: string;\n links?: Link[];\n}\n\nexport interface Link {\n label: string;\n type: string;\n type_label: string;\n url: string;\n}\n\nexport interface PivotCell {\n [pivotKey: string]: Cell;\n}\n\nexport interface Row {\n [fieldName: string]: PivotCell | Cell;\n}\n\nexport interface TileError {\n title: string;\n message: string;\n group: string;\n}\n\nexport interface CrossFilterOptions {\n pivot: Pivot;\n row: Row;\n}\n\nexport type DrillMenuOptions = any;\n\nexport interface Filters {\n [key: string]: string;\n}\n\n/**\n * For internal use only\n */\nexport interface TileSDKInternal extends TileSDK {\n tileHostDataChanged: (hostData: Partial<TileHostData>) => void;\n}\n\n/**\n * Extension tile SDK\n */\nexport interface TileSDK {\n /**\n * Tile host data.\n */\n tileHostData: TileHostData;\n /**\n * Display an error beneath the tile extension.\n */\n addError: (error: TileError) => void;\n /**\n * Clear an error beneath the tile extension.\n */\n clearError: () => void;\n /**\n * Display an error beneath the tile extension.\n * @deprecated\n */\n addErrors: (...errors: TileError[]) => void;\n /**\n * Clear an error beneath the tile extension.\n * @deprecated\n */\n clearErrors: (group?: string) => void;\n /**\n * Open a drill menu. The event controls positioning of the drill menu.\n * Set the pageX and pageY properties on the event to control the\n * positioning (all other properties are ignored).\n */\n openDrillMenu: (options: DrillMenuOptions, event?: MouseEvent) => void;\n /**\n * Toggle cross filters. This is ignored when running in an explore.\n */\n toggleCrossFilter: (options: CrossFilterOptions, event?: MouseEvent) => void;\n /**\n * Run the current dashboard. This is ignored when running in an explore.\n */\n runDashboard: () => void;\n /**\n * Stop the current dashboard. This is ignored when running in an explore.\n */\n stopDashboard: () => void;\n /**\n * Update the current filters.\n */\n updateFilters: (filters: Filters, run?: boolean) => void;\n /**\n * Open the schedule dialog. This is ignored when running in an explore.\n */\n openScheduleDialog: () => Promise<void>;\n}\n"],"mappings":";;;;;;IAuCYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,aAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["ExtensionEvent","exports","ExtensionRequestType","ApiVersion","FetchResponseBodyType","ExtensionNotificationType","MountPoint"],"sources":["../../src/connect/types.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 { ChattyHostConnection } from '@looker/chatty';\nimport type {\n RawVisualizationData,\n VisualizationDataReceivedCallback,\n VisualizationSDK,\n} from './visualization';\nimport type {\n TileHostData,\n TileHostDataChangedCallback,\n TileSDK,\n} from './tile';\n\n/**\n * Extension event used for chatty communication\n */\nexport enum ExtensionEvent {\n /**\n * Notification from host to client\n */\n EXTENSION_HOST_NOTIFICATION = 'EXTENSION_NOTIFICATION',\n /**\n * Process request from client.\n */\n EXTENSION_API_REQUEST = 'EXTENSION_API_REQUEST',\n}\n\n/**\n * Request types used by the underlying API. The ENTENSION_API_REQUEST delegates\n * work based upon the request type\n */\nexport enum ExtensionRequestType {\n /**\n * Context data request\n */\n CONTEXT_DATA = 'CONTEXT_DATA',\n /**\n * Verify that the host exists and is working correctly. Host is the Looker window\n * instance that owns the client IFRAME.\n */\n VERIFY_HOST = 'VERIFY_HOST',\n /**\n * Execute a call on the Looker CORE SDK\n */\n INVOKE_CORE_SDK = 'INVOKE_CORE_SDK',\n /**\n * Execute a raw request on the Looker CORE SDK\n */\n RAW_INVOKE_CORE_SDK = 'RAW_INVOKE_CORE_SDK',\n /**\n * Update title\n */\n UPDATE_TITLE = 'UPDATE_TITLE',\n /**\n * Update location\n */\n UPDATE_LOCATION = 'UPDATE_LOCATION',\n /**\n * Location route changed\n */\n ROUTE_CHANGED = 'ROUTE_CHANGED',\n /**\n * Close popovers in the looker host\n */\n CLOSE_HOST_POPOVERS = 'CLOSE_HOST_POPOVERS',\n /**\n * Clipboard request\n */\n CLIPBOARD = 'CLIPBOARD',\n /**\n * Local storage request\n */\n LOCAL_STORAGE = 'LOCAL_STORAGE',\n /**\n * Read user attribute action\n */\n USER_ATTRIBUTE = 'USER_ATTRIBUTE',\n /**\n * Track action\n */\n TRACK_ACTION = 'TRACK_ACTION',\n /**\n * Error event\n */\n ERROR_EVENT = 'ERROR_EVENT',\n /**\n * Invoke external API\n */\n INVOKE_EXTERNAL_API = 'INVOKE_EXTERNAL_API',\n /**\n * Extension unloaded\n */\n EXTENSION_UNLOADED = 'EXTENSION_UNLOADED',\n /**\n * Log out of Looker from /spartan extension\n *\n * Only works from within the /spartan context. It will not work for\n * extensions running under /extensions\n */\n SPARTAN_LOGOUT = 'SPARTAN_LOGOUT',\n /**\n * Extension rendered\n */\n RENDERED = 'RENDERED',\n /**\n * Set up the visConfig options that should be present in an explore\n */\n VIS_DEFAULT_CONFIG = 'VIS_DEFAULT_CONFIG',\n /**\n * Change visualization configuration after intial load\n */\n VIS_CONFIG_UPDATE = 'VIS_CONFIG_UPDATE',\n /**\n * Tile add error messages\n */\n TILE_ADD_ERRORS = 'TILE_ADD_ERRORS',\n /**\n * Tile clear error messages\n */\n TILE_CLEAR_ERRORS = 'TILE_CLEAR_ERRORS',\n /**\n * Tile open drill menu\n */\n TILE_OPEN_DRILL_MENU = 'TILE_OPEN_DRILL_MENU',\n /**\n * Tile toggle cross filter\n */\n TILE_TOGGLE_CROSS_FILTER = 'TILE_TOGGLE_CROSS_FILTER',\n /**\n * Tile update row limit\n */\n TILE_ROW_LIMIT_UPDATE = 'TILE_ROW_LIMIT_UPDATE',\n /**\n * Tile run dashboard. Indicates that the dashboard queries should be run.\n */\n TILE_RUN_DASHBOARD = 'TILE_RUN_DASHBOARD',\n /**\n * Tile stop dashboard. Indicates to a dashboard that a queries should be stopped\n */\n TILE_STOP_DASHBOARD = 'TILE_STOP_DASHBOARD',\n /**\n * Tile update filters. Update the filters of the dashboard.\n */\n TILE_UPDATE_FILTERS = 'TILE_UPDATE_FILTERS',\n /**\n * Open schedule dialog.\n */\n TILE_OPEN_SCHEDULE_DIALOG = 'TILE_OPEN_SCHEDULE_DIALOG',\n}\n\n/**\n * The message that is associated with the Chatty EXTENSION_API_REQUEST event\n */\nexport interface ExtensionRequest {\n /**\n * Extension request type\n */\n type: ExtensionRequestType;\n /**\n * Optional payload associated with extension request type\n */\n payload?: InvokeCoreSdkRequest | undefined;\n}\n\nexport enum ApiVersion {\n sdk40 = '4.0',\n}\n\nexport interface InvokeCoreSdkRequest {\n apiMethodName?: string;\n httpMethod?: string;\n path?: string;\n body?: any;\n params?: any;\n options?: any;\n apiVersion?: ApiVersion;\n}\n\nexport interface UpdateTitleRequest {\n title: string;\n}\n\nexport interface UpdateLocationRequest {\n url: string;\n state?: any;\n}\n\nexport interface ExtensionHostApi extends ExtensionSDK {\n isDashboardMountSupported: boolean;\n handleNotification(\n message: ExtensionNotification\n ): ExtensionInitializationResponse | undefined;\n invokeCoreSdk(\n httpMethod: string,\n path: string,\n body?: any,\n params?: any,\n authenticator?: any,\n options?: any,\n apiVersion?: ApiVersion\n ): Promise<any>;\n invokeCoreSdkRaw(\n httpMethod: string,\n path: string,\n body?: any,\n params?: any,\n apiVersion?: ApiVersion\n ): Promise<any>;\n unloaded(): void;\n}\n\nexport interface ExtensionClientApi {\n handleRequest(message: ExtensionRequest): any | void;\n}\n\nexport interface ContextDataRequest {\n type: 'save' | 'refresh';\n contextData?: string;\n}\n\nexport interface RouteChangeRequest {\n route: string;\n}\n\nexport interface ClipboardRequest {\n type: 'write';\n value: string;\n}\n\nexport interface LocalStorageRequest {\n type: 'get' | 'set' | 'remove';\n name: string;\n value?: string;\n}\n\nexport interface TrackActionRequest {\n name: string;\n trackAction: string;\n attributes?: Record<string, any>;\n}\n\nexport interface ErrorEventRequest {\n errorEvent: ErrorEvent;\n}\n\nexport enum FetchResponseBodyType {\n json = 'json',\n text = 'text',\n}\n\nexport interface FetchDataRequest {\n resource: string;\n init?: Extract<RequestInit, 'method' | 'headers' | 'body' | 'credentials'>;\n responseBodyType?: FetchResponseBodyType;\n}\n\n/**\n * Notification type\n */\nexport enum ExtensionNotificationType {\n /**\n * Route change message sent when the route changes in the host\n * (browser forward or back buttons)\n */\n ROUTE_CHANGED = 'ROUTE_CHANGED',\n /**\n * Initialize message sent when chatty host and client have established\n * communication\n */\n INITIALIZE = 'INITIALIZE',\n /**\n * Visualization data\n */\n VISUALIZATION_DATA = 'VISUALIZATION_DATA',\n /**\n * Tile host data changed\n */\n TILE_HOST_DATA = 'TILE_HOST_DATA',\n}\n\n/**\n * Extension initialize message. Will be received once\n * when the extension is first instantiated\n */\nexport interface ExtensionInitializeMessage {\n type: ExtensionNotificationType.INITIALIZE;\n payload: LookerHostData;\n}\n\n/**\n * Route changed message. Received when the host route changes.\n * This happens when the user clicks the browser backward or\n * forward button.\n */\nexport interface ExtensionRouteChangedMessage {\n type: ExtensionNotificationType.ROUTE_CHANGED;\n payload: RouteChangeData;\n}\n\n/**\n * Visualization data. Only received by extensions visualizations.\n * <code>Looker >=22.8</code>\n */\nexport interface ExtensionVisualizationDataMessage {\n type: ExtensionNotificationType.VISUALIZATION_DATA;\n payload: RawVisualizationData;\n}\n\n/**\n * Tile Host Data Changed notificaction\n * <code>Looker >=22.8</code>\n */\nexport interface TileHostDataChangedMessage {\n type: ExtensionNotificationType.TILE_HOST_DATA;\n payload: Partial<TileHostData>;\n}\n\n/**\n * Extension notification\n */\nexport type ExtensionNotification =\n | ExtensionInitializeMessage\n | ExtensionRouteChangedMessage\n | ExtensionVisualizationDataMessage\n | TileHostDataChangedMessage;\n\n/**\n * Route change data\n */\nexport interface RouteChangeData {\n /**\n * Changed route for the extension\n */\n route?: string;\n /**\n * Changed route state\n */\n routeState?: any;\n}\n\n/**\n * Looker host type.\n * standard - Standard Looker host with the navigation bar.\n * embed - Embedded Looker host.\n * spartan - Spartan Looker host.\n */\nexport type HostType = 'standard' | 'embed' | 'spartan';\n\n/**\n * Extension mount type.\n * Fullscreen mount.\n * @deprecated <code>Looker >=22.8</code>. Use MountPoint (fullscreen is equivalent of standalone)\n */\nexport type MountType = 'fullscreen' | undefined;\n\n/**\n * Extension mount point\n * <code>Looker >=22.8</code>\n */\nexport enum MountPoint {\n standalone = 'standalone',\n dashboardVisualization = 'dashboard-visualization',\n dashboardTile = 'dashboard-tile',\n dashboardTilePopup = 'dashboard-tile-popup',\n}\n\n/**\n * Initialization data. Looker host data.\n */\nexport interface LookerHostData {\n /**\n * Extension id\n */\n extensionId: string;\n /**\n * Version of looker\n */\n lookerVersion: string;\n /**\n * Initial route for the extension\n */\n route?: string;\n /**\n * route state\n */\n routeState?: any;\n /**\n * Origin of Looker host\n * @deprecated\n */\n hostUrl?: string;\n /**\n * Origin of Looker host\n * <code>Looker >=21.8</code>\n */\n hostOrigin?: string;\n /**\n * Looker host type (standard, embed, spartan)\n * <code>Looker >=21.8</code>\n */\n hostType?: HostType;\n /**\n * Extension mount type.\n * <code>Looker >=21.8</code>\n */\n mountType?: MountType;\n /**\n * Extension mount point.\n * <code>Looker >=22.8</code>\n */\n mountPoint: MountPoint;\n /**\n * Extension context data\n */\n contextData?: string;\n /**\n * The extension is rendering to a PDF or image.\n * <code>Looker >=22.8</code>\n */\n isRendering?: boolean;\n /**\n * When true the dashboard tile has been enabled.\n * <code>Looker >=22.8</code>\n */\n extensionDashboardTileEnabled: boolean;\n}\n\n/**\n * Response returned from initialization\n */\nexport interface ExtensionInitializationResponse {\n /**\n * Version of the SDK\n */\n extensionSdkVersion: string;\n /**\n * initialization error message\n */\n errorMessage?: string;\n}\n\n/**\n * Extension host configuration\n */\nexport interface ExtensionHostConfiguration {\n /**\n * Callback once extension initialized\n * @param errorMessage details of any errors that have\n * occured during initialization\n */\n initializedCallback?: (errorMessage?: string) => void;\n /**\n * Callback to set the initial route to be restored. Ignored if\n * route tracking off\n */\n setInitialRoute?: (route: string, routeState?: any) => void;\n /**\n * Required looker version. An error will be thrown if the host\n * Looker is not at the version specified.\n */\n requiredLookerVersion?: string;\n /**\n * Callback to notify extension that host has changed the route.\n * The host changes the route when browser back or forward button\n * pressed.\n */\n hostChangedRoute?: (route: string, routeState?: any) => void;\n /**\n * Timeout for messages sent via chatty. Defaults to 30000 milliseconds.\n * Set to -1 for no timeout.\n */\n chattyTimeout?: number;\n /**\n * Callback called when visualization data received\n */\n visualizationDataReceivedCallback?: VisualizationDataReceivedCallback;\n\n /**\n * Callback called when the host is updated\n */\n tileHostDataChangedCallback?: TileHostDataChangedCallback;\n}\n\nexport interface ExtensionHostApiConfiguration\n extends ExtensionHostConfiguration {\n chattyHost: ChattyHostConnection;\n}\n\n/**\n * Custom parameters for fetch proxy\n */\nexport interface FetchCustomParameters {\n /**\n * Http method\n */\n method?: 'POST' | 'GET' | 'DELETE' | 'PATCH' | 'PUT' | 'HEAD';\n /**\n * Request headers\n */\n headers?: Record<string, string>;\n /**\n * Request body\n */\n body?: string;\n /**\n * Credentials. Controls how cookies are sent to the external API server.\n * For external APIs this should be set to include if cookies suppor is\n * credentials are or omitted or the init object is omitted, the credentials\n * desired.\n */\n credentials?: 'omit' | 'same-origin' | 'include';\n}\n\n/**\n * Fetch proxy response\n */\nexport interface FetchProxyDataResponse {\n /**\n * true if status in the 200 range\n */\n ok: boolean;\n /**\n * http response status\n */\n status: number;\n /**\n * description of the status\n */\n statusText?: string;\n /**\n * response headers\n */\n headers: Record<string, string>;\n /**\n * response body\n */\n body?: any;\n}\n\n/**\n * Fetch proxy instance. A fetch proxy can be created with a base URL and prepopulated\n * init and response body type. This allows init header setup to be centralized rather\n * than duplicating code for each fetch proxy call\n */\nexport interface FetchProxy {\n /**\n * External API proxy to the browser fetch API. Merges arguments with arguments specified\n * when the fetch proxy was created. The arguments in the call override the arguments specified\n * when the proxy was created.\n * @param resource url to call. will be concatenated to base URL is base URL was specified.\n * @param init. object containing custom parameters for fetch. Will be merged with init\n * object defined when the proxy was created.\n * @param responseBodyType indicates how to handle the response body. Overrides responseBodyType\n * specifed when proxy created.\n */\n fetchProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ): Promise<FetchProxyDataResponse>;\n}\n\n/**\n * Public extension SDK\n */\nexport interface ExtensionSDK {\n /**\n * Looker host data\n */\n lookerHostData?: Readonly<LookerHostData>;\n\n /**\n * Create a tag that the Looker server will recognize as a\n * secret key to evaluated and replaced. The tag is name spaced\n * to the extension.\n * @param keyName for which a tag is required\n */\n createSecretKeyTag(keyName: string): string;\n\n /**\n * Verify that looker host is available\n */\n verifyHostConnection(): Promise<boolean>;\n\n /**\n * Update window title (if allowed)\n * @param title new window title\n */\n updateTitle(title: string): void;\n\n /**\n * Update location of current window (if allowed). Navigating to\n * a new host is NOT allowed\n * @param url - new url - should begin with '/'\n * @param state push state\n * @param target when set opens new browser window. Use\n * openBrowserWindow instead.\n */\n updateLocation(url: string, state?: any, target?: string): void;\n\n /**\n * Open new browser window with URL\n * @param url for window\n * @param target name of window. Defaults to _blank\n */\n openBrowserWindow(url: string, target?: string): void;\n\n /**\n * Close currently opened popovers (menus for example)\n */\n closeHostPopovers(): void;\n\n /**\n * Store an item in local storage. Note that local storage is name\n * spaced to the extension. It is not necessary to include the extension\n * name in the name of the item.\n * @param name of item\n * @param value to store in local storage\n */\n localStorageSetItem(name: string, value?: string): Promise<boolean>;\n\n /**\n * Get an item from local storage. Note that local storage is name\n * spaced to the extension. It is not necessary to include the extension\n * name in the name of the item.\n * @param name of item\n */\n localStorageRemoveItem(name: string): Promise<boolean>;\n\n /**\n * Remove an item from local storage. Note that local storage is name\n * spaced to the extension. It is not necessary to include the extension\n * name in the name of the item.\n * @param name of item\n */\n localStorageGetItem(name: string): Promise<string | null>;\n\n /**\n * Write string to clipboard.\n * @param value to write to clipboard.\n */\n clipboardWrite(value: string): Promise<void>;\n\n /**\n * Set a user attribute value.\n * @param name of item\n * @param value to store in local storage\n */\n userAttributeSetItem(name: string, value?: string): Promise<boolean>;\n /**\n * Get a user attribute value.\n * @param name of item\n */\n userAttributeGetItem(name: string): Promise<string | null>;\n /**\n * Reset a user attribute value to the default\n * @param name of item\n */\n userAttributeResetItem(name: string): Promise<void>;\n /**\n * Track some kind of action.\n * @param name of action\n * @param trackAction of action\n * @param attributes associated with action\n */\n track(\n name: string,\n trackAction: string,\n attributes?: Record<string, any>\n ): void;\n\n /**\n * Error event details. Report error details to the Looker host\n * Notes:\n * 1. Because crossorigin is not set on the script tag that loads the extension\n * details of the error cannot be determined.\n * 2. In development mode (at least if react is being used), an error will\n * be recorded twice. This is because react reports the failure to get\n * details of the error as an error.\n */\n error(errorEvent: ErrorEvent): void;\n\n /**\n * Notify host that client route has changed\n * @param route\n * @param routeState state of route\n */\n clientRouteChanged(route: string, routeState?: any): void;\n\n /**\n * Get the context associated with the extension. The context can be of any\n * JSON serializable type.\n *\n * Note that a separate copy of the context will be returned each time getContext\n * is called so an update to context object will not be reflected in subsequent\n * calls UNLESS saveContext is called.\n */\n getContextData(): any;\n\n /**\n * Save the context data in the Looker server and return a copy of the context data.\n * Subsequent calls to getContext will return the updated context data.\n *\n * Note that context data is shared amongst all users of the extension regardless of\n * role (in otherwords context does not support permissions). Care should be taken when\n * updating context data as the last write wins and extensions generally read the context data\n * once on extension load (see refreshContext for exception). The context should only be used\n * for data that rarely changes.\n *\n * @param contextData to save\n * @return current context data\n */\n saveContextData(contextData: any): Promise<any>;\n\n /**\n * Get the lastest version of context data from the Looker server.\n *\n * Should another user update the context data this method can be used to get the lastest data\n * without reloading the extension. Note that there is not a mechanism to indicate\n * that the context data has been modified.\n */\n refreshContextData(): Promise<any>;\n\n /**\n * Create a fetch proxy instance. Allows set up init parameter to be centalized into one place\n * @param baseUrl root URL to call. The resource on the fetch call will be appended to the baseUrl\n * @param init. object containing custom parameters for fetch.\n * @param responseBodyType indicates how to handle the response body. If omitted an attempt will be made\n * to determine how to handle the response body based upon the content type of the\n * response. Ultimately it defaults to a text response.\n * @return current context data\n */\n createFetchProxy(\n baseUrl?: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ): FetchProxy;\n\n /**\n * External API proxy to the browser fetch API.\n * Do not attempt to call internal Looker APIs. Any attempt to do so will be rejected.\n * Protocol MUST be https.\n * Entitlements must be defined for the extension in the manifest application in order to use this feature.\n * At a minimum, the domain and top level domain must be specified in the entitlements.\n * @param resource url to call\n * @param init. object containing custom parameters for fetch.\n * @param responseBodyType indicates how to handle the response body. If omitted an attempt will be made\n * to determine how to handle the response body based upon the content type of the\n * response. Ultimately it defaults to a text response.\n */\n fetchProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ): Promise<FetchProxyDataResponse>;\n\n /**\n * External API server proxy. Similar to fetch proxy except that external API calls are made\n * through the Looker instance. This allows the request to be embedded with secret keys stored\n * in the Looker server. This method should only be used for secret key/token exchange calls\n * as it adds additional overhead to the external API (network and competing for resources on\n * the Looker server). Note that there is no server proxy equivalent to createFetchProxy.\n * Entitlements must be defined for the extension in the manifest application in order to use this feature.\n * At a minimum, the domain and top level domain must be specified in the entitlements.\n * The Looker server will examine the request URL, headers amd body for handlebar ({{ KEY_NAME }}) expressions.\n * If found, the expression will be substituted with key values obtained from user attributes where the user\n * attribute is a combination of EXTENSION_ID::KEY_NAME.\n * @param resource url to call\n * @param init. object containing custom parameters for server call.\n * @param responseBodyType indicates how to handle the response body. If omitted an attempt will be made\n * to determine how to handle the response body based upon the content type of the\n * response. Ultimately it defaults to a text response.\n */\n serverProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ): Promise<FetchProxyDataResponse>;\n\n /**\n * Oauth2 authentication. Authentication relies on a new window being\n * created and a form being submitted. The authParameters become inputs\n * to the form submission.\n * @param authEndpoint endpoint responsible for the authentication.\n * An oauth2 url entitlement MUST be defined for\n * the end point.\n * @param authParameters parameters to be included in the request.\n * client_id MUST be included\n * scope MUST be included\n * redirect_uri MUST NOT be included - will be set by host\n * response_type MUST NOT be included - will be set to 'token' by host\n * state OPTIONAL - If omitted will be generated by host.\n * code_challenge_method optional - set to 'S256' to use code challenge\n * rather than secret key.\n * @param httpMethod used for submission. Defaults to 'POST'.\n * @deprecated\n */\n oauth2Authenticate(\n authEndpoint: string,\n authParameters: Record<string, string>,\n httpMethod?: string\n ): Promise<any>;\n\n /**\n * Oauth2 exchange code for token. This is actually a wrapper around\n * serverProxy or fetch with some specialized processing. If the code_challenge_method\n * was used in the oauth2Authenticate call then fetch is used otherwise serverProxy is\n * used. It is expected that this method is called immediately after oauth2Authenticate.\n * The state, redirect url and code verifier (code_challenge_method only)\n * are saved from the oauth2Authenticate call and included in the exchange\n * for token call.\n * Note, currently code_challenge_method and secret key usage are mutually exclusive.\n * @param authEndpoint endpoint responsible for the code exchange\n * An oauth2 url entitlement MUST be defined for\n * the end point.\n * @param authParameters parameters to be included in the request.\n * Note that state and redirect_uri parameters\n * will automatically be added to this object.\n * If code challenge is not being used a client secret tag\n * must be added to the request. The client\n * secret tag is generated using the createSecretKeyTag\n * method.\n * If code challenge is being used the code_verifier is added\n * to the message.\n * @deprecated\n */\n oauth2ExchangeCodeForToken(\n authEndpoint: string,\n authParameters: Record<string, string>\n ): Promise<any>;\n\n /**\n * Log user out of Looker. Only works when running under /spartan\n */\n spartanLogout(): void;\n\n /**\n * Indicate that an extension has been rendered.\n * <code>Looker >=22.8</code>\n */\n rendered(failureMessage?: string): void;\n\n /**\n * Visualization API.\n */\n visualizationSDK: VisualizationSDK;\n\n /**\n * Tile API.\n */\n tileSDK: TileSDK;\n\n /**\n * Returns true if dashboard mount is supported. There are two\n * checks involved:\n * 1. The extension mount point is configured correctly\n * 2. The Looker host system supports it.\n */\n isDashboardMountSupported: boolean;\n}\n"],"mappings":";;;;;;IAyCYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,aAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAAA,IAedE,oBAAoB,GAAAD,OAAA,CAAAC,oBAAA,aAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAAA,IAqIpBC,UAAU,GAAAF,OAAA,CAAAE,UAAA,aAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAiFVC,qBAAqB,GAAAH,OAAA,CAAAG,qBAAA,aAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAAA,IAcrBC,yBAAyB,GAAAJ,OAAA,CAAAI,yBAAA,aAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AAAA,IAoGzBC,UAAU,GAAAL,OAAA,CAAAK,UAAA,aAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA"}
1
+ {"version":3,"file":"types.js","names":["ExtensionEvent","exports","ExtensionRequestType","ApiVersion","FetchResponseBodyType","ExtensionNotificationType","MountPoint"],"sources":["../../src/connect/types.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 { ChattyHostConnection } from '@looker/chatty';\nimport type {\n RawVisualizationData,\n VisualizationDataReceivedCallback,\n VisualizationSDK,\n} from './visualization';\nimport type {\n TileHostData,\n TileHostDataChangedCallback,\n TileSDK,\n} from './tile';\n\n/**\n * Extension event used for chatty communication\n */\nexport enum ExtensionEvent {\n /**\n * Notification from host to client\n */\n EXTENSION_HOST_NOTIFICATION = 'EXTENSION_NOTIFICATION',\n /**\n * Process request from client.\n */\n EXTENSION_API_REQUEST = 'EXTENSION_API_REQUEST',\n}\n\n/**\n * Request types used by the underlying API. The ENTENSION_API_REQUEST delegates\n * work based upon the request type\n */\nexport enum ExtensionRequestType {\n /**\n * Context data request\n */\n CONTEXT_DATA = 'CONTEXT_DATA',\n /**\n * Verify that the host exists and is working correctly. Host is the Looker window\n * instance that owns the client IFRAME.\n */\n VERIFY_HOST = 'VERIFY_HOST',\n /**\n * Execute a call on the Looker CORE SDK\n */\n INVOKE_CORE_SDK = 'INVOKE_CORE_SDK',\n /**\n * Execute a raw request on the Looker CORE SDK\n */\n RAW_INVOKE_CORE_SDK = 'RAW_INVOKE_CORE_SDK',\n /**\n * Update title\n */\n UPDATE_TITLE = 'UPDATE_TITLE',\n /**\n * Update location\n */\n UPDATE_LOCATION = 'UPDATE_LOCATION',\n /**\n * Location route changed\n */\n ROUTE_CHANGED = 'ROUTE_CHANGED',\n /**\n * Close popovers in the looker host\n */\n CLOSE_HOST_POPOVERS = 'CLOSE_HOST_POPOVERS',\n /**\n * Clipboard request\n */\n CLIPBOARD = 'CLIPBOARD',\n /**\n * Local storage request\n */\n LOCAL_STORAGE = 'LOCAL_STORAGE',\n /**\n * Read user attribute action\n */\n USER_ATTRIBUTE = 'USER_ATTRIBUTE',\n /**\n * Track action\n */\n TRACK_ACTION = 'TRACK_ACTION',\n /**\n * Error event\n */\n ERROR_EVENT = 'ERROR_EVENT',\n /**\n * Invoke external API\n */\n INVOKE_EXTERNAL_API = 'INVOKE_EXTERNAL_API',\n /**\n * Extension unloaded\n */\n EXTENSION_UNLOADED = 'EXTENSION_UNLOADED',\n /**\n * Log out of Looker from /spartan extension\n *\n * Only works from within the /spartan context. It will not work for\n * extensions running under /extensions\n */\n SPARTAN_LOGOUT = 'SPARTAN_LOGOUT',\n /**\n * Extension rendered\n */\n RENDERED = 'RENDERED',\n /**\n * Set up the visConfig options that should be present in an explore\n */\n VIS_DEFAULT_CONFIG = 'VIS_DEFAULT_CONFIG',\n /**\n * Change visualization configuration after intial load\n */\n VIS_CONFIG_UPDATE = 'VIS_CONFIG_UPDATE',\n /**\n * Tile add error messages\n */\n TILE_ADD_ERRORS = 'TILE_ADD_ERRORS',\n /**\n * Tile clear error messages\n */\n TILE_CLEAR_ERRORS = 'TILE_CLEAR_ERRORS',\n /**\n * Tile open drill menu\n */\n TILE_OPEN_DRILL_MENU = 'TILE_OPEN_DRILL_MENU',\n /**\n * Tile toggle cross filter\n */\n TILE_TOGGLE_CROSS_FILTER = 'TILE_TOGGLE_CROSS_FILTER',\n /**\n * Tile update row limit\n */\n TILE_ROW_LIMIT_UPDATE = 'TILE_ROW_LIMIT_UPDATE',\n /**\n * Tile run dashboard. Indicates that the dashboard queries should be run.\n */\n TILE_RUN_DASHBOARD = 'TILE_RUN_DASHBOARD',\n /**\n * Tile stop dashboard. Indicates to a dashboard that a queries should be stopped\n */\n TILE_STOP_DASHBOARD = 'TILE_STOP_DASHBOARD',\n /**\n * Tile update filters. Update the filters of the dashboard.\n */\n TILE_UPDATE_FILTERS = 'TILE_UPDATE_FILTERS',\n /**\n * Open schedule dialog.\n */\n TILE_OPEN_SCHEDULE_DIALOG = 'TILE_OPEN_SCHEDULE_DIALOG',\n}\n\n/**\n * The message that is associated with the Chatty EXTENSION_API_REQUEST event\n */\nexport interface ExtensionRequest {\n /**\n * Extension request type\n */\n type: ExtensionRequestType;\n /**\n * Optional payload associated with extension request type\n */\n payload?: InvokeCoreSdkRequest | undefined;\n}\n\nexport enum ApiVersion {\n sdk40 = '4.0',\n}\n\nexport interface InvokeCoreSdkRequest {\n apiMethodName?: string;\n httpMethod?: string;\n path?: string;\n body?: any;\n params?: any;\n options?: any;\n apiVersion?: ApiVersion;\n}\n\nexport interface UpdateTitleRequest {\n title: string;\n}\n\nexport interface UpdateLocationRequest {\n url: string;\n state?: any;\n}\n\nexport interface ExtensionHostApi extends ExtensionSDK {\n isDashboardMountSupported: boolean;\n handleNotification(\n message: ExtensionNotification\n ): ExtensionInitializationResponse | undefined;\n invokeCoreSdk(\n httpMethod: string,\n path: string,\n body?: any,\n params?: any,\n authenticator?: any,\n options?: any,\n apiVersion?: ApiVersion\n ): Promise<any>;\n invokeCoreSdkRaw(\n httpMethod: string,\n path: string,\n body?: any,\n params?: any,\n apiVersion?: ApiVersion\n ): Promise<any>;\n unloaded(): void;\n}\n\nexport interface ExtensionClientApi {\n handleRequest(message: ExtensionRequest): any | void;\n}\n\nexport interface ContextDataRequest {\n type: 'save' | 'refresh';\n contextData?: string;\n}\n\nexport interface RouteChangeRequest {\n route: string;\n}\n\nexport interface ClipboardRequest {\n type: 'write';\n value: string;\n}\n\nexport interface LocalStorageRequest {\n type: 'get' | 'set' | 'remove';\n name: string;\n value?: string;\n}\n\nexport interface TrackActionRequest {\n name: string;\n trackAction: string;\n attributes?: Record<string, any>;\n}\n\nexport interface ErrorEventRequest {\n errorEvent: ErrorEvent;\n}\n\nexport enum FetchResponseBodyType {\n json = 'json',\n text = 'text',\n}\n\nexport interface FetchDataRequest {\n resource: string;\n init?: Extract<RequestInit, 'method' | 'headers' | 'body' | 'credentials'>;\n responseBodyType?: FetchResponseBodyType;\n}\n\n/**\n * Notification type\n */\nexport enum ExtensionNotificationType {\n /**\n * Route change message sent when the route changes in the host\n * (browser forward or back buttons)\n */\n ROUTE_CHANGED = 'ROUTE_CHANGED',\n /**\n * Initialize message sent when chatty host and client have established\n * communication\n */\n INITIALIZE = 'INITIALIZE',\n /**\n * Visualization data\n */\n VISUALIZATION_DATA = 'VISUALIZATION_DATA',\n /**\n * Tile host data changed\n */\n TILE_HOST_DATA = 'TILE_HOST_DATA',\n}\n\n/**\n * Extension initialize message. Will be received once\n * when the extension is first instantiated\n */\nexport interface ExtensionInitializeMessage {\n type: ExtensionNotificationType.INITIALIZE;\n payload: LookerHostData;\n}\n\n/**\n * Route changed message. Received when the host route changes.\n * This happens when the user clicks the browser backward or\n * forward button.\n */\nexport interface ExtensionRouteChangedMessage {\n type: ExtensionNotificationType.ROUTE_CHANGED;\n payload: RouteChangeData;\n}\n\n/**\n * Visualization data. Only received by extensions visualizations.\n * <code>Looker >=22.8</code>\n */\nexport interface ExtensionVisualizationDataMessage {\n type: ExtensionNotificationType.VISUALIZATION_DATA;\n payload: RawVisualizationData;\n}\n\n/**\n * Tile Host Data Changed notificaction\n * <code>Looker >=22.8</code>\n */\nexport interface TileHostDataChangedMessage {\n type: ExtensionNotificationType.TILE_HOST_DATA;\n payload: Partial<TileHostData>;\n}\n\n/**\n * Extension notification\n */\nexport type ExtensionNotification =\n | ExtensionInitializeMessage\n | ExtensionRouteChangedMessage\n | ExtensionVisualizationDataMessage\n | TileHostDataChangedMessage;\n\n/**\n * Route change data\n */\nexport interface RouteChangeData {\n /**\n * Changed route for the extension\n */\n route?: string;\n /**\n * Changed route state\n */\n routeState?: any;\n}\n\n/**\n * Looker host type.\n * standard - Standard Looker host with the navigation bar.\n * embed - Embedded Looker host.\n * spartan - Spartan Looker host.\n */\nexport type HostType = 'standard' | 'embed' | 'spartan';\n\n/**\n * Extension mount type.\n * Fullscreen mount.\n * @deprecated <code>Looker >=22.8</code>. Use MountPoint (fullscreen is equivalent of standalone)\n */\nexport type MountType = 'fullscreen' | undefined;\n\n/**\n * Extension mount point\n * <code>Looker >=22.8</code>\n */\nexport enum MountPoint {\n standalone = 'standalone',\n dashboardVisualization = 'dashboard-visualization',\n dashboardTile = 'dashboard-tile',\n dashboardTilePopup = 'dashboard-tile-popup',\n}\n\n/**\n * Initialization data. Looker host data.\n */\nexport interface LookerHostData {\n /**\n * Extension id\n */\n extensionId: string;\n /**\n * Version of looker\n */\n lookerVersion: string;\n /**\n * Initial route for the extension\n */\n route?: string;\n /**\n * route state\n */\n routeState?: any;\n /**\n * Origin of Looker host\n * @deprecated\n */\n hostUrl?: string;\n /**\n * Origin of Looker host\n * <code>Looker >=21.8</code>\n */\n hostOrigin?: string;\n /**\n * Looker host type (standard, embed, spartan)\n * <code>Looker >=21.8</code>\n */\n hostType?: HostType;\n /**\n * Extension mount type.\n * <code>Looker >=21.8</code>\n */\n mountType?: MountType;\n /**\n * Extension mount point.\n * <code>Looker >=22.8</code>\n */\n mountPoint: MountPoint;\n /**\n * Extension context data\n */\n contextData?: string;\n /**\n * The extension is rendering to a PDF or image.\n * <code>Looker >=22.8</code>\n */\n isRendering?: boolean;\n /**\n * When true the dashboard tile has been enabled.\n * <code>Looker >=22.8</code>\n */\n extensionDashboardTileEnabled: boolean;\n}\n\n/**\n * Response returned from initialization\n */\nexport interface ExtensionInitializationResponse {\n /**\n * Version of the SDK\n */\n extensionSdkVersion: string;\n /**\n * initialization error message\n */\n errorMessage?: string;\n}\n\n/**\n * Extension host configuration\n */\nexport interface ExtensionHostConfiguration {\n /**\n * Callback once extension initialized\n * @param errorMessage details of any errors that have\n * occured during initialization\n */\n initializedCallback?: (errorMessage?: string) => void;\n /**\n * Callback to set the initial route to be restored. Ignored if\n * route tracking off\n */\n setInitialRoute?: (route: string, routeState?: any) => void;\n /**\n * Required looker version. An error will be thrown if the host\n * Looker is not at the version specified.\n */\n requiredLookerVersion?: string;\n /**\n * Callback to notify extension that host has changed the route.\n * The host changes the route when browser back or forward button\n * pressed.\n */\n hostChangedRoute?: (route: string, routeState?: any) => void;\n /**\n * Timeout for messages sent via chatty. Defaults to 30000 milliseconds.\n * Set to -1 for no timeout.\n */\n chattyTimeout?: number;\n /**\n * Callback called when visualization data received\n */\n visualizationDataReceivedCallback?: VisualizationDataReceivedCallback;\n\n /**\n * Callback called when the host is updated\n */\n tileHostDataChangedCallback?: TileHostDataChangedCallback;\n}\n\nexport interface ExtensionHostApiConfiguration\n extends ExtensionHostConfiguration {\n chattyHost: ChattyHostConnection;\n}\n\n/**\n * Custom parameters for fetch proxy\n */\nexport interface FetchCustomParameters {\n /**\n * Http method\n */\n method?: 'POST' | 'GET' | 'DELETE' | 'PATCH' | 'PUT' | 'HEAD';\n /**\n * Request headers\n */\n headers?: Record<string, string>;\n /**\n * Request body\n */\n body?: string;\n /**\n * Credentials. Controls how cookies are sent to the external API server.\n * For external APIs this should be set to include if cookies suppor is\n * credentials are or omitted or the init object is omitted, the credentials\n * desired.\n */\n credentials?: 'omit' | 'same-origin' | 'include';\n}\n\n/**\n * Fetch proxy response\n */\nexport interface FetchProxyDataResponse {\n /**\n * true if status in the 200 range\n */\n ok: boolean;\n /**\n * http response status\n */\n status: number;\n /**\n * description of the status\n */\n statusText?: string;\n /**\n * response headers\n */\n headers: Record<string, string>;\n /**\n * response body\n */\n body?: any;\n}\n\n/**\n * Fetch proxy instance. A fetch proxy can be created with a base URL and prepopulated\n * init and response body type. This allows init header setup to be centralized rather\n * than duplicating code for each fetch proxy call\n */\nexport interface FetchProxy {\n /**\n * External API proxy to the browser fetch API. Merges arguments with arguments specified\n * when the fetch proxy was created. The arguments in the call override the arguments specified\n * when the proxy was created.\n * @param resource url to call. will be concatenated to base URL is base URL was specified.\n * @param init. object containing custom parameters for fetch. Will be merged with init\n * object defined when the proxy was created.\n * @param responseBodyType indicates how to handle the response body. Overrides responseBodyType\n * specifed when proxy created.\n */\n fetchProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ): Promise<FetchProxyDataResponse>;\n}\n\n/**\n * Public extension SDK\n */\nexport interface ExtensionSDK {\n /**\n * Looker host data\n */\n lookerHostData?: Readonly<LookerHostData>;\n\n /**\n * Create a tag that the Looker server will recognize as a\n * secret key to evaluated and replaced. The tag is name spaced\n * to the extension.\n * @param keyName for which a tag is required\n */\n createSecretKeyTag(keyName: string): string;\n\n /**\n * Verify that looker host is available\n */\n verifyHostConnection(): Promise<boolean>;\n\n /**\n * Update window title (if allowed)\n * @param title new window title\n */\n updateTitle(title: string): void;\n\n /**\n * Update location of current window (if allowed). Navigating to\n * a new host is NOT allowed\n * @param url - new url - should begin with '/'\n * @param state push state\n * @param target when set opens new browser window. Use\n * openBrowserWindow instead.\n */\n updateLocation(url: string, state?: any, target?: string): void;\n\n /**\n * Open new browser window with URL\n * @param url for window\n * @param target name of window. Defaults to _blank\n */\n openBrowserWindow(url: string, target?: string): void;\n\n /**\n * Close currently opened popovers (menus for example)\n */\n closeHostPopovers(): void;\n\n /**\n * Store an item in local storage. Note that local storage is name\n * spaced to the extension. It is not necessary to include the extension\n * name in the name of the item.\n * @param name of item\n * @param value to store in local storage\n */\n localStorageSetItem(name: string, value?: string): Promise<boolean>;\n\n /**\n * Get an item from local storage. Note that local storage is name\n * spaced to the extension. It is not necessary to include the extension\n * name in the name of the item.\n * @param name of item\n */\n localStorageRemoveItem(name: string): Promise<boolean>;\n\n /**\n * Remove an item from local storage. Note that local storage is name\n * spaced to the extension. It is not necessary to include the extension\n * name in the name of the item.\n * @param name of item\n */\n localStorageGetItem(name: string): Promise<string | null>;\n\n /**\n * Write string to clipboard.\n * @param value to write to clipboard.\n */\n clipboardWrite(value: string): Promise<void>;\n\n /**\n * Set a user attribute value.\n * @param name of item\n * @param value to store in local storage\n */\n userAttributeSetItem(name: string, value?: string): Promise<boolean>;\n /**\n * Get a user attribute value.\n * @param name of item\n */\n userAttributeGetItem(name: string): Promise<string | null>;\n /**\n * Reset a user attribute value to the default\n * @param name of item\n */\n userAttributeResetItem(name: string): Promise<void>;\n /**\n * Track some kind of action.\n * @param name of action\n * @param trackAction of action\n * @param attributes associated with action\n */\n track(\n name: string,\n trackAction: string,\n attributes?: Record<string, any>\n ): void;\n\n /**\n * Error event details. Report error details to the Looker host\n * Notes:\n * 1. Because crossorigin is not set on the script tag that loads the extension\n * details of the error cannot be determined.\n * 2. In development mode (at least if react is being used), an error will\n * be recorded twice. This is because react reports the failure to get\n * details of the error as an error.\n */\n error(errorEvent: ErrorEvent): void;\n\n /**\n * Notify host that client route has changed\n * @param route\n * @param routeState state of route\n */\n clientRouteChanged(route: string, routeState?: any): void;\n\n /**\n * Get the context associated with the extension. The context can be of any\n * JSON serializable type.\n *\n * Note that a separate copy of the context will be returned each time getContext\n * is called so an update to context object will not be reflected in subsequent\n * calls UNLESS saveContext is called.\n */\n getContextData(): any;\n\n /**\n * Save the context data in the Looker server and return a copy of the context data.\n * Subsequent calls to getContext will return the updated context data.\n *\n * Note that context data is shared amongst all users of the extension regardless of\n * role (in otherwords context does not support permissions). Care should be taken when\n * updating context data as the last write wins and extensions generally read the context data\n * once on extension load (see refreshContext for exception). The context should only be used\n * for data that rarely changes.\n *\n * @param contextData to save\n * @return current context data\n */\n saveContextData(contextData: any): Promise<any>;\n\n /**\n * Get the lastest version of context data from the Looker server.\n *\n * Should another user update the context data this method can be used to get the lastest data\n * without reloading the extension. Note that there is not a mechanism to indicate\n * that the context data has been modified.\n */\n refreshContextData(): Promise<any>;\n\n /**\n * Create a fetch proxy instance. Allows set up init parameter to be centalized into one place\n * @param baseUrl root URL to call. The resource on the fetch call will be appended to the baseUrl\n * @param init. object containing custom parameters for fetch.\n * @param responseBodyType indicates how to handle the response body. If omitted an attempt will be made\n * to determine how to handle the response body based upon the content type of the\n * response. Ultimately it defaults to a text response.\n * @return current context data\n */\n createFetchProxy(\n baseUrl?: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ): FetchProxy;\n\n /**\n * External API proxy to the browser fetch API.\n * Do not attempt to call internal Looker APIs. Any attempt to do so will be rejected.\n * Protocol MUST be https.\n * Entitlements must be defined for the extension in the manifest application in order to use this feature.\n * At a minimum, the domain and top level domain must be specified in the entitlements.\n * @param resource url to call\n * @param init. object containing custom parameters for fetch.\n * @param responseBodyType indicates how to handle the response body. If omitted an attempt will be made\n * to determine how to handle the response body based upon the content type of the\n * response. Ultimately it defaults to a text response.\n */\n fetchProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ): Promise<FetchProxyDataResponse>;\n\n /**\n * External API server proxy. Similar to fetch proxy except that external API calls are made\n * through the Looker instance. This allows the request to be embedded with secret keys stored\n * in the Looker server. This method should only be used for secret key/token exchange calls\n * as it adds additional overhead to the external API (network and competing for resources on\n * the Looker server). Note that there is no server proxy equivalent to createFetchProxy.\n * Entitlements must be defined for the extension in the manifest application in order to use this feature.\n * At a minimum, the domain and top level domain must be specified in the entitlements.\n * The Looker server will examine the request URL, headers amd body for handlebar ({{ KEY_NAME }}) expressions.\n * If found, the expression will be substituted with key values obtained from user attributes where the user\n * attribute is a combination of EXTENSION_ID::KEY_NAME.\n * @param resource url to call\n * @param init. object containing custom parameters for server call.\n * @param responseBodyType indicates how to handle the response body. If omitted an attempt will be made\n * to determine how to handle the response body based upon the content type of the\n * response. Ultimately it defaults to a text response.\n */\n serverProxy(\n resource: string,\n init?: FetchCustomParameters,\n responseBodyType?: FetchResponseBodyType\n ): Promise<FetchProxyDataResponse>;\n\n /**\n * Oauth2 authentication. Authentication relies on a new window being\n * created and a form being submitted. The authParameters become inputs\n * to the form submission.\n * @param authEndpoint endpoint responsible for the authentication.\n * An oauth2 url entitlement MUST be defined for\n * the end point.\n * @param authParameters parameters to be included in the request.\n * client_id MUST be included\n * scope MUST be included\n * redirect_uri MUST NOT be included - will be set by host\n * response_type MUST NOT be included - will be set to 'token' by host\n * state OPTIONAL - If omitted will be generated by host.\n * code_challenge_method optional - set to 'S256' to use code challenge\n * rather than secret key.\n * @param httpMethod used for submission. Defaults to 'POST'.\n * @deprecated\n */\n oauth2Authenticate(\n authEndpoint: string,\n authParameters: Record<string, string>,\n httpMethod?: string\n ): Promise<any>;\n\n /**\n * Oauth2 exchange code for token. This is actually a wrapper around\n * serverProxy or fetch with some specialized processing. If the code_challenge_method\n * was used in the oauth2Authenticate call then fetch is used otherwise serverProxy is\n * used. It is expected that this method is called immediately after oauth2Authenticate.\n * The state, redirect url and code verifier (code_challenge_method only)\n * are saved from the oauth2Authenticate call and included in the exchange\n * for token call.\n * Note, currently code_challenge_method and secret key usage are mutually exclusive.\n * @param authEndpoint endpoint responsible for the code exchange\n * An oauth2 url entitlement MUST be defined for\n * the end point.\n * @param authParameters parameters to be included in the request.\n * Note that state and redirect_uri parameters\n * will automatically be added to this object.\n * If code challenge is not being used a client secret tag\n * must be added to the request. The client\n * secret tag is generated using the createSecretKeyTag\n * method.\n * If code challenge is being used the code_verifier is added\n * to the message.\n * @deprecated\n */\n oauth2ExchangeCodeForToken(\n authEndpoint: string,\n authParameters: Record<string, string>\n ): Promise<any>;\n\n /**\n * Log user out of Looker. Only works when running under /spartan\n */\n spartanLogout(): void;\n\n /**\n * Indicate that an extension has been rendered.\n * <code>Looker >=22.8</code>\n */\n rendered(failureMessage?: string): void;\n\n /**\n * Visualization API.\n */\n visualizationSDK: VisualizationSDK;\n\n /**\n * Tile API.\n */\n tileSDK: TileSDK;\n\n /**\n * Returns true if dashboard mount is supported. There are two\n * checks involved:\n * 1. The extension mount point is configured correctly\n * 2. The Looker host system supports it.\n */\n isDashboardMountSupported: boolean;\n}\n"],"mappings":";;;;;;IAyCYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,aAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAAA,IAedE,oBAAoB,GAAAD,OAAA,CAAAC,oBAAA,aAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAAA,IAqIpBC,UAAU,GAAAF,OAAA,CAAAE,UAAA,aAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAiFVC,qBAAqB,GAAAH,OAAA,CAAAG,qBAAA,aAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAAA,IAcrBC,yBAAyB,GAAAJ,OAAA,CAAAI,yBAAA,aAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AAAA,IAoGzBC,UAAU,GAAAL,OAAA,CAAAK,UAAA,aAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_types","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_visualization_sdk"],"sources":["../../../src/connect/visualization/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 './types';\nexport * from './visualization_sdk';\n"],"mappings":";;;;;AA0BA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,kBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,kBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,kBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,kBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["_types","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_visualization_sdk"],"sources":["../../../src/connect/visualization/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 './types';\nexport * from './visualization_sdk';\n"],"mappings":";;;;;AA0BA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,kBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,kBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,kBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,kBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1,2 +1,6 @@
1
+ "use strict";
1
2
 
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
2
6
  //# sourceMappingURL=types.js.map