@looker/extension-sdk 23.6.0 → 23.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.
- package/CHANGELOG.md +14 -0
- package/README.md +2 -2
- package/lib/connect/connect_extension_host.js.map +1 -1
- package/lib/connect/extension_host_api.js.map +1 -1
- package/lib/connect/fetch_proxy.js.map +1 -1
- package/lib/connect/global_listener.js.map +1 -1
- package/lib/connect/index.js.map +1 -1
- package/lib/connect/types.js +20 -20
- package/lib/connect/types.js.map +1 -1
- package/lib/esm/connect/connect_extension_host.js.map +1 -1
- package/lib/esm/connect/extension_host_api.js.map +1 -1
- package/lib/esm/connect/fetch_proxy.js.map +1 -1
- package/lib/esm/connect/global_listener.js.map +1 -1
- package/lib/esm/connect/index.js.map +1 -1
- package/lib/esm/connect/types.js +20 -20
- package/lib/esm/connect/types.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/sdk/extension_sdk.js.map +1 -1
- package/lib/esm/sdk/extension_sdk_31.js.map +1 -1
- package/lib/esm/sdk/extension_sdk_40.js.map +1 -1
- package/lib/esm/sdk/index.js.map +1 -1
- package/lib/esm/sdk/sdk_connection.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/sdk/extension_sdk.js.map +1 -1
- package/lib/sdk/extension_sdk_31.js.map +1 -1
- package/lib/sdk/extension_sdk_40.js.map +1 -1
- package/lib/sdk/index.js.map +1 -1
- package/lib/sdk/sdk_connection.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension_host_api.js","names":["EXTENSION_SDK_VERSION","ExtensionHostApiImpl","constructor","configuration","_configuration","chattyHost","setInitialRoute","hostChangedRoute","lookerHostData","_lookerHostData","handleNotification","message","type","payload","ExtensionNotificationType","ROUTE_CHANGED","route","routeState","undefined","INITIALIZE","contextData","errorMessage","requiredLookerVersion","lookerVersion","verifyLookerVersion","console","error","extensionSdkVersion","Error","createSecretKeyTag","keyName","match","extensionId","replace","verifyHostConnection","sendAndReceive","ExtensionRequestType","VERIFY_HOST","invokeCoreSdk","httpMethod","path","params","body","authenticator","options","apiVersion","INVOKE_CORE_SDK","invokeCoreSdkRaw","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","value","Promise","reject","LOCAL_STORAGE","localStorageGetItem","localStorageRemoveItem","clipboardWrite","CLIPBOARD","userAttributeSetItem","USER_ATTRIBUTE","userAttributeGetItem","userAttributeResetItem","getContextData","JSON","parse","saveContextData","context","stringify","err","CONTEXT_DATA","refreshContextData","track","trackAction","attributes","TRACK_ACTION","errorEvent","filename","lineno","colno","ERROR_EVENT","toString","unloaded","EXTENSION_UNLOADED","createFetchProxy","baseUrl","init","responseBodyType","FetchProxyImpl","fetchProxy","resource","INVOKE_EXTERNAL_API","serverProxy","oauth2Authenticate","authEndpoint","authParameters","validateAuthParameters","signal","AbortController","oauth2ExchangeCodeForToken","messagePayload","chattyPayload","ExtensionEvent","EXTENSION_API_REQUEST","then","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 { FetchProxyImpl } from './fetch_proxy'\nimport type {\n ExtensionInitializationResponse,\n ExtensionHostApi,\n ExtensionHostApiConfiguration,\n ExtensionNotification,\n FetchCustomParameters,\n FetchResponseBodyType,\n LookerHostData,\n ApiVersion,\n RouteChangeData,\n} from './types'\nimport {\n ExtensionEvent,\n ExtensionNotificationType,\n ExtensionRequestType,\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 contextData?: string\n\n constructor(configuration: ExtensionHostApiConfiguration) {\n this._configuration = configuration\n const { chattyHost, setInitialRoute, hostChangedRoute } =\n this._configuration\n this.chattyHost = chattyHost\n this.setInitialRoute = setInitialRoute\n this.hostChangedRoute = hostChangedRoute\n }\n\n get lookerHostData() {\n return this._lookerHostData\n }\n\n handleNotification(\n message?: ExtensionNotification\n ): ExtensionInitializationResponse | undefined {\n const { type, payload } = message || {}\n switch (type) {\n case ExtensionNotificationType.ROUTE_CHANGED:\n if (this.hostChangedRoute && payload) {\n const { route, routeState } = payload as RouteChangeData\n if (route) {\n this.hostChangedRoute(route, routeState)\n }\n }\n return undefined\n case ExtensionNotificationType.INITIALIZE: {\n this._lookerHostData = payload as LookerHostData\n if (this._lookerHostData) {\n this.contextData = this._lookerHostData.contextData\n }\n let errorMessage\n if (\n this._configuration.requiredLookerVersion &&\n this._lookerHostData &&\n this._lookerHostData.lookerVersion\n ) {\n errorMessage = this.verifyLookerVersion(\n this._configuration.requiredLookerVersion\n )\n if (errorMessage) {\n console.error(errorMessage)\n }\n }\n if (this.setInitialRoute && payload) {\n const { route, routeState } = payload as LookerHostData\n if (route) {\n this.setInitialRoute(route, routeState)\n }\n }\n return {\n extensionSdkVersion: EXTENSION_SDK_VERSION,\n errorMessage,\n }\n }\n default:\n console.error('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!.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 console.error(\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 private async sendAndReceive(\n type: string,\n payload?: any,\n options?: Options\n ): Promise<any> {\n if (!this._lookerHostData) {\n return Promise.reject(new Error('Looker host connection not established'))\n }\n const messagePayload = {\n type,\n payload,\n }\n const chattyPayload = options ? [messagePayload, options] : [messagePayload]\n return this.chattyHost\n .sendAndReceive(ExtensionEvent.EXTENSION_API_REQUEST, ...chattyPayload)\n .then((values) => values[0])\n }\n\n private 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;AACA;AAYA;AAIgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAET,IAAMA,qBAAqB,GAAG,QAAQ;AAAA;AAEtC,MAAMC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C;IACF,CAAC,CAAC;EACJ;EAEQW,mBAAmB,CAACiG,OAAe,EAAsB;IAI/D,IAAMlG,aAAa,GAAG,IAAI,CAACd,eAAe,GACtC,IAAI,CAACA,eAAe,CAACc,aAAa,IAAI,KAAK,GAC3C,KAAK;IACT,IAAI,CAAC,IAAI,CAACd,eAAe,IAAI,CAAC,IAAAiH,mBAAU,EAACD,OAAO,EAAElG,aAAa,EAAE,IAAI,CAAC,EAAE;MACtE,mDAA4CkG,OAAO,mBAASlG,aAAa;IAC3E;IACA,OAAOL,SAAS;EAClB;EAEQ6F,sBAAsB,CAACD,cAAsC,EAAE;IACrE,IAAI,CAACA,cAAc,CAACa,SAAS,EAAE;MAC7B,OAAO,mBAAmB;IAC5B;IACA,IAAIb,cAAc,CAACc,YAAY,EAAE;MAC/B,OAAO,mCAAmC;IAC5C;IACA,IACEd,cAAc,CAACe,aAAa,KAAK,OAAO,IACxCf,cAAc,CAACe,aAAa,KAAK,UAAU,IAC3Cf,cAAc,CAACe,aAAa,KAAK,MAAM,EACvC;MACA,yEAAkEf,cAAc,CAACe,aAAa;IAChG;IACA,OAAO3G,SAAS;EAClB;AACF;AAAC"}
|
|
1
|
+
{"version":3,"file":"extension_host_api.js","names":["_intersects","_interopRequireDefault","require","_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","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","res","call","TypeError","Number","EXTENSION_SDK_VERSION","exports","ExtensionHostApiImpl","constructor","configuration","_configuration","chattyHost","setInitialRoute","hostChangedRoute","lookerHostData","_lookerHostData","handleNotification","message","type","payload","ExtensionNotificationType","ROUTE_CHANGED","route","routeState","INITIALIZE","contextData","errorMessage","requiredLookerVersion","lookerVersion","verifyLookerVersion","console","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","_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 { FetchProxyImpl } from './fetch_proxy'\nimport type {\n ExtensionInitializationResponse,\n ExtensionHostApi,\n ExtensionHostApiConfiguration,\n ExtensionNotification,\n FetchCustomParameters,\n FetchResponseBodyType,\n LookerHostData,\n ApiVersion,\n RouteChangeData,\n} from './types'\nimport {\n ExtensionEvent,\n ExtensionNotificationType,\n ExtensionRequestType,\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 contextData?: string\n\n constructor(configuration: ExtensionHostApiConfiguration) {\n this._configuration = configuration\n const { chattyHost, setInitialRoute, hostChangedRoute } =\n this._configuration\n this.chattyHost = chattyHost\n this.setInitialRoute = setInitialRoute\n this.hostChangedRoute = hostChangedRoute\n }\n\n get lookerHostData() {\n return this._lookerHostData\n }\n\n handleNotification(\n message?: ExtensionNotification\n ): ExtensionInitializationResponse | undefined {\n const { type, payload } = message || {}\n switch (type) {\n case ExtensionNotificationType.ROUTE_CHANGED:\n if (this.hostChangedRoute && payload) {\n const { route, routeState } = payload as RouteChangeData\n if (route) {\n this.hostChangedRoute(route, routeState)\n }\n }\n return undefined\n case ExtensionNotificationType.INITIALIZE: {\n this._lookerHostData = payload as LookerHostData\n if (this._lookerHostData) {\n this.contextData = this._lookerHostData.contextData\n }\n let errorMessage\n if (\n this._configuration.requiredLookerVersion &&\n this._lookerHostData &&\n this._lookerHostData.lookerVersion\n ) {\n errorMessage = this.verifyLookerVersion(\n this._configuration.requiredLookerVersion\n )\n if (errorMessage) {\n console.error(errorMessage)\n }\n }\n if (this.setInitialRoute && payload) {\n const { route, routeState } = payload as LookerHostData\n if (route) {\n this.setInitialRoute(route, routeState)\n }\n }\n return {\n extensionSdkVersion: EXTENSION_SDK_VERSION,\n errorMessage,\n }\n }\n default:\n console.error('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!.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 console.error(\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 private async sendAndReceive(\n type: string,\n payload?: any,\n options?: Options\n ): Promise<any> {\n if (!this._lookerHostData) {\n return Promise.reject(new Error('Looker host connection not established'))\n }\n const messagePayload = {\n type,\n payload,\n }\n const chattyPayload = options ? [messagePayload, options] : [messagePayload]\n return this.chattyHost\n .sendAndReceive(ExtensionEvent.EXTENSION_API_REQUEST, ...chattyPayload)\n .then((values) => values[0])\n }\n\n private 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,GAA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;IACA,OAAOhK,SAAS;EAClB;AACF;AAACoB,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch_proxy.js","names":["FetchProxyImpl","constructor","extensionHost","baseUrl","init","responseBodyType","fetchProxy","resource","getResource","getInit","getResponseBodyType","deepmerge","
|
|
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 FetchProxy,\n FetchCustomParameters,\n FetchResponseBodyType,\n FetchProxyDataResponse,\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;AAAiC,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,MA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AAS;EAClB;EAEQY,mBAAmBA,CAACN,gBAAwC,EAAE;IACpE,OAAOA,gBAAgB,IAAI,IAAI,CAACA,gBAAgB;EAClD;AACF;AAACQ,OAAA,CAAAb,cAAA,GAAAA,cAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global_listener.js","names":["_hostApi","errorListener","event","error","_looker_reported","console","beforeUnloadListener","unloaded","warn","setupGlobalListeners","window","addEventListener","registerHostApi","hostApi","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 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 console.error(\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 console.warn('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":";;;;;;AA4BA,IAAIA,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;IACLG,OAAO,CAACF,KAAK,CACX,wFAAwF,EACxFD,KAAK,CACN;EACH;AACF,CAAC;AAOD,IAAMI,oBAAoB,
|
|
1
|
+
{"version":3,"file":"global_listener.js","names":["_hostApi","errorListener","event","error","_looker_reported","console","beforeUnloadListener","unloaded","warn","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 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 console.error(\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 console.warn('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":";;;;;;AA4BA,IAAIA,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;IACLG,OAAO,CAACF,KAAK,CACX,wFAAwF,EACxFD,KAAK,CACN;EACH;AACF,CAAC;AAOD,IAAMI,oBAAoB,GAAGA,CAAA,KAAM;EACjC,IAAIN,QAAQ,EAAE;IACZA,QAAQ,CAACO,QAAQ,EAAE;IACnBF,OAAO,CAACG,IAAI,CAAC,6BAA6B,CAAC;EAC7C;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,EAAE;AAKf,IAAMG,eAAe,GAAIC,OAAyB,IAAK;EAC5Db,QAAQ,GAAGa,OAAO;AACpB,CAAC;AAAAC,OAAA,CAAAF,eAAA,GAAAA,eAAA;AAMM,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;AAAAH,OAAA,CAAAC,eAAA,GAAAA,eAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"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 './types'\nexport * from './connect_extension_host'\nexport { getExtensionSDK } from './global_listener'\n"],"mappings":";;;;;;;;;;;;;;AA0BA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_types","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_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 './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,uBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,uBAAA,EAAAV,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,MAAAS,uBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,uBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,gBAAA,GAAAd,OAAA"}
|
package/lib/esm/connect/types.js
CHANGED
|
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.FetchResponseBodyType = exports.ExtensionRequestType = exports.ExtensionNotificationType = exports.ExtensionEvent = exports.ApiVersion = void 0;
|
|
7
|
-
var ExtensionEvent
|
|
8
|
-
exports.ExtensionEvent = ExtensionEvent;
|
|
9
|
-
(function (ExtensionEvent) {
|
|
7
|
+
var ExtensionEvent = function (ExtensionEvent) {
|
|
10
8
|
ExtensionEvent["EXTENSION_HOST_NOTIFICATION"] = "EXTENSION_NOTIFICATION";
|
|
11
9
|
ExtensionEvent["EXTENSION_API_REQUEST"] = "EXTENSION_API_REQUEST";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports.
|
|
15
|
-
|
|
10
|
+
return ExtensionEvent;
|
|
11
|
+
}({});
|
|
12
|
+
exports.ExtensionEvent = ExtensionEvent;
|
|
13
|
+
var ExtensionRequestType = function (ExtensionRequestType) {
|
|
16
14
|
ExtensionRequestType["CONTEXT_DATA"] = "CONTEXT_DATA";
|
|
17
15
|
ExtensionRequestType["VERIFY_HOST"] = "VERIFY_HOST";
|
|
18
16
|
ExtensionRequestType["INVOKE_CORE_SDK"] = "INVOKE_CORE_SDK";
|
|
@@ -29,23 +27,25 @@ exports.ExtensionRequestType = ExtensionRequestType;
|
|
|
29
27
|
ExtensionRequestType["INVOKE_EXTERNAL_API"] = "INVOKE_EXTERNAL_API";
|
|
30
28
|
ExtensionRequestType["EXTENSION_UNLOADED"] = "EXTENSION_UNLOADED";
|
|
31
29
|
ExtensionRequestType["SPARTAN_LOGOUT"] = "SPARTAN_LOGOUT";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
exports.
|
|
35
|
-
|
|
30
|
+
return ExtensionRequestType;
|
|
31
|
+
}({});
|
|
32
|
+
exports.ExtensionRequestType = ExtensionRequestType;
|
|
33
|
+
var ApiVersion = function (ApiVersion) {
|
|
36
34
|
ApiVersion["sdk31"] = "3.1";
|
|
37
35
|
ApiVersion["sdk40"] = "4.0";
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
exports.
|
|
41
|
-
|
|
36
|
+
return ApiVersion;
|
|
37
|
+
}({});
|
|
38
|
+
exports.ApiVersion = ApiVersion;
|
|
39
|
+
var FetchResponseBodyType = function (FetchResponseBodyType) {
|
|
42
40
|
FetchResponseBodyType["json"] = "json";
|
|
43
41
|
FetchResponseBodyType["text"] = "text";
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
exports.
|
|
47
|
-
|
|
42
|
+
return FetchResponseBodyType;
|
|
43
|
+
}({});
|
|
44
|
+
exports.FetchResponseBodyType = FetchResponseBodyType;
|
|
45
|
+
var ExtensionNotificationType = function (ExtensionNotificationType) {
|
|
48
46
|
ExtensionNotificationType["ROUTE_CHANGED"] = "ROUTE_CHANGED";
|
|
49
47
|
ExtensionNotificationType["INITIALIZE"] = "INITIALIZE";
|
|
50
|
-
|
|
48
|
+
return ExtensionNotificationType;
|
|
49
|
+
}({});
|
|
50
|
+
exports.ExtensionNotificationType = ExtensionNotificationType;
|
|
51
51
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["ExtensionEvent","ExtensionRequestType","ApiVersion","FetchResponseBodyType","ExtensionNotificationType"],"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'\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\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 sdk31 = '3.1',\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 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\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 */\nexport type MountType = 'fullscreen'\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 context data\n */\n contextData?: string\n}\n\n/**\n * Extension notification\n */\nexport interface ExtensionNotification {\n type: ExtensionNotificationType\n payload?: LookerHostData | RouteChangeData | undefined\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\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 */\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 */\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"],"mappings":";;;;;;IA+BYA,cAAc;AAAA;AAAA,WAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;AAAA,GAAdA,cAAc,8BAAdA,cAAc;AAAA,IAedC,oBAAoB;AAAA;AAAA,WAApBA,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;AAAA,GAApBA,oBAAoB,oCAApBA,oBAAoB;AAAA,IAqFpBC,UAAU;AAAA;AAAA,WAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,0BAAVA,UAAU;AAAA,IAiFVC,qBAAqB;AAAA;AAAA,WAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;AAAA,GAArBA,qBAAqB,qCAArBA,qBAAqB;AAAA,IAcrBC,yBAAyB;AAAA;AAAA,WAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;AAAA,GAAzBA,yBAAyB,yCAAzBA,yBAAyB"}
|
|
1
|
+
{"version":3,"file":"types.js","names":["ExtensionEvent","exports","ExtensionRequestType","ApiVersion","FetchResponseBodyType","ExtensionNotificationType"],"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'\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\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 sdk31 = '3.1',\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 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\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 */\nexport type MountType = 'fullscreen'\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 context data\n */\n contextData?: string\n}\n\n/**\n * Extension notification\n */\nexport interface ExtensionNotification {\n type: ExtensionNotificationType\n payload?: LookerHostData | RouteChangeData | undefined\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\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 */\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 */\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"],"mappings":";;;;;;IA+BYA,cAAc,aAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAAAC,OAAA,CAAAD,cAAA,GAAAA,cAAA;AAAA,IAedE,oBAAoB,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;EAAA,OAApBA,oBAAoB;AAAA;AAAAD,OAAA,CAAAC,oBAAA,GAAAA,oBAAA;AAAA,IAqFpBC,UAAU,aAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAAF,OAAA,CAAAE,UAAA,GAAAA,UAAA;AAAA,IAiFVC,qBAAqB,aAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;AAAAH,OAAA,CAAAG,qBAAA,GAAAA,qBAAA;AAAA,IAcrBC,yBAAyB,aAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AAAAJ,OAAA,CAAAI,yBAAA,GAAAA,yBAAA"}
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './connect/connect_extension_host'\nexport * from './connect/global_listener'\nexport * from './connect/types'\nexport * from './sdk/extension_sdk'\nexport * from './sdk/extension_sdk_31'\nexport * from './sdk/extension_sdk_40'\nexport * from './sdk/sdk_connection'\n"],"mappings":";;;;;AA0BA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_connect_extension_host","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_global_listener","_types","_extension_sdk","_extension_sdk_","_extension_sdk_2","_sdk_connection"],"sources":["../../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './connect/connect_extension_host'\nexport * from './connect/global_listener'\nexport * from './connect/types'\nexport * from './sdk/extension_sdk'\nexport * from './sdk/extension_sdk_31'\nexport * from './sdk/extension_sdk_40'\nexport * from './sdk/sdk_connection'\n"],"mappings":";;;;;AA0BA,IAAAA,uBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,uBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,uBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,uBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,gBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,gBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,gBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,gBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,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OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,gBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAK,gBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,eAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,eAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,eAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAM,eAAA,CAAAV,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension_sdk.js","names":["LookerExtensionSDK","create31Client","hostConnection","_LookerExtensionSDK","createClient","SdkConnection","ApiVersion","sdk31","Looker31SDK","create40Client","sdk40","Looker40SDK"],"sources":["../../../src/sdk/extension_sdk.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker31SDK,\n Looker40SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK {\n /**\n * Create an SDK client that uses SDK 3.1\n * @param hostConnection extension host API\n */\n static create31Client(hostConnection: ExtensionHostApi): Looker31SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk31),\n Looker31SDK\n )\n }\n\n /**\n * Create an SDK client that uses SDK 4.0\n * @param hostConnection extension host API\n */\n static create40Client(hostConnection: ExtensionHostApi): Looker40SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk40),\n Looker40SDK\n )\n }\n\n /**\n * Creates a [[LookerSDK]] object.\n */\n static createClient(hostConnection: ExtensionHostApi) {\n return LookerExtensionSDK.create31Client(hostConnection)\n }\n}\n"],"mappings":";;;;;;AA0BA;AAMA;AAEA;AAEO,
|
|
1
|
+
{"version":3,"file":"extension_sdk.js","names":["_sdk","require","_connect","_sdk_connection","LookerExtensionSDK","create31Client","hostConnection","_LookerExtensionSDK","createClient","SdkConnection","ApiVersion","sdk31","Looker31SDK","create40Client","sdk40","Looker40SDK","exports"],"sources":["../../../src/sdk/extension_sdk.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker31SDK,\n Looker40SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK {\n /**\n * Create an SDK client that uses SDK 3.1\n * @param hostConnection extension host API\n */\n static create31Client(hostConnection: ExtensionHostApi): Looker31SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk31),\n Looker31SDK\n )\n }\n\n /**\n * Create an SDK client that uses SDK 4.0\n * @param hostConnection extension host API\n */\n static create40Client(hostConnection: ExtensionHostApi): Looker40SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk40),\n Looker40SDK\n )\n }\n\n /**\n * Creates a [[LookerSDK]] object.\n */\n static createClient(hostConnection: ExtensionHostApi) {\n return LookerExtensionSDK.create31Client(hostConnection)\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,IAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAEO,MAAMG,kBAAkB,CAAC;EAK9B,OAAOC,cAAcA,CAACC,cAAgC,EAAe;IACnE,OAAOC,uBAAmB,CAACC,YAAY,CACrC,IAAIC,6BAAa,CAACH,cAAc,EAAEI,mBAAU,CAACC,KAAK,CAAC,EACnDC,gBAAW,CACZ;EACH;EAMA,OAAOC,cAAcA,CAACP,cAAgC,EAAe;IACnE,OAAOC,uBAAmB,CAACC,YAAY,CACrC,IAAIC,6BAAa,CAACH,cAAc,EAAEI,mBAAU,CAACI,KAAK,CAAC,EACnDC,gBAAW,CACZ;EACH;EAKA,OAAOP,YAAYA,CAACF,cAAgC,EAAE;IACpD,OAAOF,kBAAkB,CAACC,cAAc,CAACC,cAAc,CAAC;EAC1D;AACF;AAACU,OAAA,CAAAZ,kBAAA,GAAAA,kBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension_sdk_31.js","names":["LookerExtensionSDK31","createClient","hostConnection","_LookerExtensionSDK","SdkConnection","ApiVersion","sdk31","Looker31SDK"],"sources":["../../../src/sdk/extension_sdk_31.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker31SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK31 {\n /**\n * Create an SDK client that uses SDK 3.1\n * @param hostConnection extension host API\n */\n static createClient(hostConnection: ExtensionHostApi): Looker31SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk31),\n Looker31SDK\n )\n }\n}\n"],"mappings":";;;;;;AA0BA;AAKA;AAEA;AAEO,
|
|
1
|
+
{"version":3,"file":"extension_sdk_31.js","names":["_sdk","require","_connect","_sdk_connection","LookerExtensionSDK31","createClient","hostConnection","_LookerExtensionSDK","SdkConnection","ApiVersion","sdk31","Looker31SDK","exports"],"sources":["../../../src/sdk/extension_sdk_31.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker31SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK31 {\n /**\n * Create an SDK client that uses SDK 3.1\n * @param hostConnection extension host API\n */\n static createClient(hostConnection: ExtensionHostApi): Looker31SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk31),\n Looker31SDK\n )\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,IAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAEO,MAAMG,oBAAoB,CAAC;EAKhC,OAAOC,YAAYA,CAACC,cAAgC,EAAe;IACjE,OAAOC,uBAAmB,CAACF,YAAY,CACrC,IAAIG,6BAAa,CAACF,cAAc,EAAEG,mBAAU,CAACC,KAAK,CAAC,EACnDC,gBAAW,CACZ;EACH;AACF;AAACC,OAAA,CAAAR,oBAAA,GAAAA,oBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension_sdk_40.js","names":["LookerExtensionSDK40","createClient","hostConnection","_LookerExtensionSDK","SdkConnection","ApiVersion","sdk40","Looker40SDK"],"sources":["../../../src/sdk/extension_sdk_40.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker40SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK40 {\n /**\n * Create an SDK client that uses SDK 4.0\n * @param hostConnection extension host API\n */\n static createClient(hostConnection: ExtensionHostApi): Looker40SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk40),\n Looker40SDK\n )\n }\n}\n"],"mappings":";;;;;;AA0BA;AAKA;AAEA;AAEO,
|
|
1
|
+
{"version":3,"file":"extension_sdk_40.js","names":["_sdk","require","_connect","_sdk_connection","LookerExtensionSDK40","createClient","hostConnection","_LookerExtensionSDK","SdkConnection","ApiVersion","sdk40","Looker40SDK","exports"],"sources":["../../../src/sdk/extension_sdk_40.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker40SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK40 {\n /**\n * Create an SDK client that uses SDK 4.0\n * @param hostConnection extension host API\n */\n static createClient(hostConnection: ExtensionHostApi): Looker40SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk40),\n Looker40SDK\n )\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,IAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAEO,MAAMG,oBAAoB,CAAC;EAKhC,OAAOC,YAAYA,CAACC,cAAgC,EAAe;IACjE,OAAOC,uBAAmB,CAACF,YAAY,CACrC,IAAIG,6BAAa,CAACF,cAAc,EAAEG,mBAAU,CAACC,KAAK,CAAC,EACnDC,gBAAW,CACZ;EACH;AACF;AAACC,OAAA,CAAAR,oBAAA,GAAAA,oBAAA"}
|
package/lib/esm/sdk/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/sdk/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 './extension_sdk'\n"],"mappings":";;;;;AA0BA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_extension_sdk","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/sdk/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 './extension_sdk'\n"],"mappings":";;;;;AA0BA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk_connection.js","names":["SdkConnection","constructor","hostConnection","apiVersion","request","httpMethod","path","body","params","_authenticator","options","invokeCoreSdk","undefined","rawRequest","_options","invokeCoreSdkRaw","stream","_callback","_method","_path","_queryParams","_body","Promise","reject","Error"],"sources":["../../../src/sdk/sdk_connection.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 { Readable } from 'readable-stream'\nimport type {\n HttpMethod,\n Values,\n Authenticator,\n ITransportSettings,\n IHostConnection,\n} from '@looker/sdk-rtl'\n\nimport type { ExtensionHostApi, ApiVersion } from '../connect'\n\nexport class SdkConnection implements IHostConnection {\n constructor(\n private hostConnection: ExtensionHostApi,\n private apiVersion: ApiVersion\n ) {}\n\n async request(\n httpMethod: string,\n path: string,\n body?: any,\n params?: any,\n _authenticator?: any,\n options?: any\n ): Promise<any> {\n return this.hostConnection.invokeCoreSdk(\n httpMethod,\n path,\n params,\n body,\n undefined,\n options,\n this.apiVersion\n )\n }\n\n async rawRequest(\n httpMethod: string,\n path: string,\n body?: any,\n params?: any,\n _authenticator?: Authenticator,\n _options?: Partial<ITransportSettings>\n ): Promise<any> {\n return this.hostConnection.invokeCoreSdkRaw(\n httpMethod,\n path,\n params,\n body,\n this.apiVersion\n )\n }\n\n async stream<T>(\n _callback: (readable: Readable) => Promise<T>,\n _method: HttpMethod,\n _path: string,\n _queryParams?: Values,\n _body?: any,\n _authenticator?: Authenticator,\n _options?: Partial<ITransportSettings>\n ): Promise<any> {\n return Promise.reject(new Error('Not implemented'))\n }\n}\n"],"mappings":";;;;;;;;AAqCO,MAAMA,aAAa,CAA4B;EACpDC,
|
|
1
|
+
{"version":3,"file":"sdk_connection.js","names":["SdkConnection","constructor","hostConnection","apiVersion","request","httpMethod","path","body","params","_authenticator","options","_this","_asyncToGenerator","invokeCoreSdk","undefined","rawRequest","_options","_this2","invokeCoreSdkRaw","stream","_callback","_method","_path","_queryParams","_body","Promise","reject","Error","exports"],"sources":["../../../src/sdk/sdk_connection.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 { Readable } from 'readable-stream'\nimport type {\n HttpMethod,\n Values,\n Authenticator,\n ITransportSettings,\n IHostConnection,\n} from '@looker/sdk-rtl'\n\nimport type { ExtensionHostApi, ApiVersion } from '../connect'\n\nexport class SdkConnection implements IHostConnection {\n constructor(\n private hostConnection: ExtensionHostApi,\n private apiVersion: ApiVersion\n ) {}\n\n async request(\n httpMethod: string,\n path: string,\n body?: any,\n params?: any,\n _authenticator?: any,\n options?: any\n ): Promise<any> {\n return this.hostConnection.invokeCoreSdk(\n httpMethod,\n path,\n params,\n body,\n undefined,\n options,\n this.apiVersion\n )\n }\n\n async rawRequest(\n httpMethod: string,\n path: string,\n body?: any,\n params?: any,\n _authenticator?: Authenticator,\n _options?: Partial<ITransportSettings>\n ): Promise<any> {\n return this.hostConnection.invokeCoreSdkRaw(\n httpMethod,\n path,\n params,\n body,\n this.apiVersion\n )\n }\n\n async stream<T>(\n _callback: (readable: Readable) => Promise<T>,\n _method: HttpMethod,\n _path: string,\n _queryParams?: Values,\n _body?: any,\n _authenticator?: Authenticator,\n _options?: Partial<ITransportSettings>\n ): Promise<any> {\n return Promise.reject(new Error('Not implemented'))\n }\n}\n"],"mappings":";;;;;;;;AAqCO,MAAMA,aAAa,CAA4B;EACpDC,WAAWA,CACDC,cAAgC,EAChCC,UAAsB,EAC9B;IAAA,KAFQD,cAAgC,GAAhCA,cAAgC;IAAA,KAChCC,UAAsB,GAAtBA,UAAsB;EAC7B;EAEGC,OAAOA,CACXC,UAAkB,EAClBC,IAAY,EACZC,IAAU,EACVC,MAAY,EACZC,cAAoB,EACpBC,OAAa,EACC;IAAA,IAAAC,KAAA;IAAA,OAAAC,iBAAA;MACd,OAAOD,KAAI,CAACT,cAAc,CAACW,aAAa,CACtCR,UAAU,EACVC,IAAI,EACJE,MAAM,EACND,IAAI,EACJO,SAAS,EACTJ,OAAO,EACPC,KAAI,CAACR,UAAU,CAChB;IAAA;EACH;EAEMY,UAAUA,CACdV,UAAkB,EAClBC,IAAY,EACZC,IAAU,EACVC,MAAY,EACZC,cAA8B,EAC9BO,QAAsC,EACxB;IAAA,IAAAC,MAAA;IAAA,OAAAL,iBAAA;MACd,OAAOK,MAAI,CAACf,cAAc,CAACgB,gBAAgB,CACzCb,UAAU,EACVC,IAAI,EACJE,MAAM,EACND,IAAI,EACJU,MAAI,CAACd,UAAU,CAChB;IAAA;EACH;EAEMgB,MAAMA,CACVC,SAA6C,EAC7CC,OAAmB,EACnBC,KAAa,EACbC,YAAqB,EACrBC,KAAW,EACXf,cAA8B,EAC9BO,QAAsC,EACxB;IAAA,OAAAJ,iBAAA;MACd,OAAOa,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAAA;EACrD;AACF;AAACC,OAAA,CAAA5B,aAAA,GAAAA,aAAA"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './connect/connect_extension_host'\nexport * from './connect/global_listener'\nexport * from './connect/types'\nexport * from './sdk/extension_sdk'\nexport * from './sdk/extension_sdk_31'\nexport * from './sdk/extension_sdk_40'\nexport * from './sdk/sdk_connection'\n"],"mappings":";;;;;AA0BA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_connect_extension_host","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_global_listener","_types","_extension_sdk","_extension_sdk_","_extension_sdk_2","_sdk_connection"],"sources":["../src/index.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './connect/connect_extension_host'\nexport * from './connect/global_listener'\nexport * from './connect/types'\nexport * from './sdk/extension_sdk'\nexport * from './sdk/extension_sdk_31'\nexport * from './sdk/extension_sdk_40'\nexport * from './sdk/sdk_connection'\n"],"mappings":";;;;;AA0BA,IAAAA,uBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,uBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,uBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,uBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,gBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,gBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,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IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAI,eAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,gBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,gBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,gBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAK,gBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,eAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,eAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,eAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAM,eAAA,CAAAV,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension_sdk.js","names":["LookerExtensionSDK","create31Client","hostConnection","_LookerExtensionSDK","createClient","SdkConnection","ApiVersion","sdk31","Looker31SDK","create40Client","sdk40","Looker40SDK"],"sources":["../../src/sdk/extension_sdk.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker31SDK,\n Looker40SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK {\n /**\n * Create an SDK client that uses SDK 3.1\n * @param hostConnection extension host API\n */\n static create31Client(hostConnection: ExtensionHostApi): Looker31SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk31),\n Looker31SDK\n )\n }\n\n /**\n * Create an SDK client that uses SDK 4.0\n * @param hostConnection extension host API\n */\n static create40Client(hostConnection: ExtensionHostApi): Looker40SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk40),\n Looker40SDK\n )\n }\n\n /**\n * Creates a [[LookerSDK]] object.\n */\n static createClient(hostConnection: ExtensionHostApi) {\n return LookerExtensionSDK.create31Client(hostConnection)\n }\n}\n"],"mappings":";;;;;;AA0BA;AAMA;AAEA;AAEO,
|
|
1
|
+
{"version":3,"file":"extension_sdk.js","names":["_sdk","require","_connect","_sdk_connection","LookerExtensionSDK","create31Client","hostConnection","_LookerExtensionSDK","createClient","SdkConnection","ApiVersion","sdk31","Looker31SDK","create40Client","sdk40","Looker40SDK","exports"],"sources":["../../src/sdk/extension_sdk.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker31SDK,\n Looker40SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK {\n /**\n * Create an SDK client that uses SDK 3.1\n * @param hostConnection extension host API\n */\n static create31Client(hostConnection: ExtensionHostApi): Looker31SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk31),\n Looker31SDK\n )\n }\n\n /**\n * Create an SDK client that uses SDK 4.0\n * @param hostConnection extension host API\n */\n static create40Client(hostConnection: ExtensionHostApi): Looker40SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk40),\n Looker40SDK\n )\n }\n\n /**\n * Creates a [[LookerSDK]] object.\n */\n static createClient(hostConnection: ExtensionHostApi) {\n return LookerExtensionSDK.create31Client(hostConnection)\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,IAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAEO,MAAMG,kBAAkB,CAAC;EAK9B,OAAOC,cAAcA,CAACC,cAAgC,EAAe;IACnE,OAAOC,uBAAmB,CAACC,YAAY,CACrC,IAAIC,6BAAa,CAACH,cAAc,EAAEI,mBAAU,CAACC,KAAK,CAAC,EACnDC,gBAAW,CACZ;EACH;EAMA,OAAOC,cAAcA,CAACP,cAAgC,EAAe;IACnE,OAAOC,uBAAmB,CAACC,YAAY,CACrC,IAAIC,6BAAa,CAACH,cAAc,EAAEI,mBAAU,CAACI,KAAK,CAAC,EACnDC,gBAAW,CACZ;EACH;EAKA,OAAOP,YAAYA,CAACF,cAAgC,EAAE;IACpD,OAAOF,kBAAkB,CAACC,cAAc,CAACC,cAAc,CAAC;EAC1D;AACF;AAACU,OAAA,CAAAZ,kBAAA,GAAAA,kBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension_sdk_31.js","names":["LookerExtensionSDK31","createClient","hostConnection","_LookerExtensionSDK","SdkConnection","ApiVersion","sdk31","Looker31SDK"],"sources":["../../src/sdk/extension_sdk_31.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker31SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK31 {\n /**\n * Create an SDK client that uses SDK 3.1\n * @param hostConnection extension host API\n */\n static createClient(hostConnection: ExtensionHostApi): Looker31SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk31),\n Looker31SDK\n )\n }\n}\n"],"mappings":";;;;;;AA0BA;AAKA;AAEA;AAEO,
|
|
1
|
+
{"version":3,"file":"extension_sdk_31.js","names":["_sdk","require","_connect","_sdk_connection","LookerExtensionSDK31","createClient","hostConnection","_LookerExtensionSDK","SdkConnection","ApiVersion","sdk31","Looker31SDK","exports"],"sources":["../../src/sdk/extension_sdk_31.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker31SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK31 {\n /**\n * Create an SDK client that uses SDK 3.1\n * @param hostConnection extension host API\n */\n static createClient(hostConnection: ExtensionHostApi): Looker31SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk31),\n Looker31SDK\n )\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,IAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAEO,MAAMG,oBAAoB,CAAC;EAKhC,OAAOC,YAAYA,CAACC,cAAgC,EAAe;IACjE,OAAOC,uBAAmB,CAACF,YAAY,CACrC,IAAIG,6BAAa,CAACF,cAAc,EAAEG,mBAAU,CAACC,KAAK,CAAC,EACnDC,gBAAW,CACZ;EACH;AACF;AAACC,OAAA,CAAAR,oBAAA,GAAAA,oBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension_sdk_40.js","names":["LookerExtensionSDK40","createClient","hostConnection","_LookerExtensionSDK","SdkConnection","ApiVersion","sdk40","Looker40SDK"],"sources":["../../src/sdk/extension_sdk_40.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker40SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK40 {\n /**\n * Create an SDK client that uses SDK 4.0\n * @param hostConnection extension host API\n */\n static createClient(hostConnection: ExtensionHostApi): Looker40SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk40),\n Looker40SDK\n )\n }\n}\n"],"mappings":";;;;;;AA0BA;AAKA;AAEA;AAEO,
|
|
1
|
+
{"version":3,"file":"extension_sdk_40.js","names":["_sdk","require","_connect","_sdk_connection","LookerExtensionSDK40","createClient","hostConnection","_LookerExtensionSDK","SdkConnection","ApiVersion","sdk40","Looker40SDK","exports"],"sources":["../../src/sdk/extension_sdk_40.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 {\n LookerExtensionSDK as _LookerExtensionSDK,\n Looker40SDK,\n} from '@looker/sdk'\nimport type { ExtensionHostApi } from '../connect'\nimport { ApiVersion } from '../connect'\n\nimport { SdkConnection } from './sdk_connection'\n\nexport class LookerExtensionSDK40 {\n /**\n * Create an SDK client that uses SDK 4.0\n * @param hostConnection extension host API\n */\n static createClient(hostConnection: ExtensionHostApi): Looker40SDK {\n return _LookerExtensionSDK.createClient(\n new SdkConnection(hostConnection, ApiVersion.sdk40),\n Looker40SDK\n )\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAAA,IAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAEO,MAAMG,oBAAoB,CAAC;EAKhC,OAAOC,YAAYA,CAACC,cAAgC,EAAe;IACjE,OAAOC,uBAAmB,CAACF,YAAY,CACrC,IAAIG,6BAAa,CAACF,cAAc,EAAEG,mBAAU,CAACC,KAAK,CAAC,EACnDC,gBAAW,CACZ;EACH;AACF;AAACC,OAAA,CAAAR,oBAAA,GAAAA,oBAAA"}
|
package/lib/sdk/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/sdk/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 './extension_sdk'\n"],"mappings":";;;;;AA0BA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_extension_sdk","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../src/sdk/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 './extension_sdk'\n"],"mappings":";;;;;AA0BA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
|