@looker/extension-sdk 22.20.2-alpha.1650 → 23.2.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 +30 -1
- package/README.md +1 -9
- package/lib/connect/connect_extension_host.js +5 -24
- package/lib/connect/connect_extension_host.js.map +1 -1
- package/lib/connect/extension_host_api.d.ts +3 -14
- package/lib/connect/extension_host_api.js +26 -230
- package/lib/connect/extension_host_api.js.map +1 -1
- package/lib/connect/fetch_proxy.js +0 -13
- package/lib/connect/fetch_proxy.js.map +1 -1
- package/lib/connect/global_listener.js +3 -17
- package/lib/connect/global_listener.js.map +1 -1
- package/lib/connect/index.d.ts +0 -2
- package/lib/connect/index.js +1 -34
- package/lib/connect/index.js.map +1 -1
- package/lib/connect/types.d.ts +7 -51
- package/lib/connect/types.js +1 -33
- package/lib/connect/types.js.map +1 -1
- package/lib/esm/connect/connect_extension_host.js +19 -25
- package/lib/esm/connect/connect_extension_host.js.map +1 -1
- package/lib/esm/connect/extension_host_api.js +71 -256
- package/lib/esm/connect/extension_host_api.js.map +1 -1
- package/lib/esm/connect/fetch_proxy.js +11 -12
- package/lib/esm/connect/fetch_proxy.js.map +1 -1
- package/lib/esm/connect/global_listener.js +11 -12
- package/lib/esm/connect/global_listener.js.map +1 -1
- package/lib/esm/connect/index.js +39 -5
- package/lib/esm/connect/index.js.map +1 -1
- package/lib/esm/connect/types.js +21 -41
- package/lib/esm/connect/types.js.map +1 -1
- package/lib/esm/index.js +82 -10
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/sdk/extension_sdk.js +13 -9
- package/lib/esm/sdk/extension_sdk.js.map +1 -1
- package/lib/esm/sdk/extension_sdk_31.js +12 -6
- package/lib/esm/sdk/extension_sdk_31.js.map +1 -1
- package/lib/esm/sdk/extension_sdk_40.js +12 -6
- package/lib/esm/sdk/extension_sdk_40.js.map +1 -1
- package/lib/esm/sdk/index.js +16 -1
- package/lib/esm/sdk/index.js.map +1 -1
- package/lib/esm/sdk/sdk_connection.js +8 -9
- package/lib/esm/sdk/sdk_connection.js.map +1 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +1 -54
- package/lib/index.js.map +1 -1
- package/lib/sdk/extension_sdk.js +0 -8
- package/lib/sdk/extension_sdk.js.map +1 -1
- package/lib/sdk/extension_sdk_31.js +0 -6
- package/lib/sdk/extension_sdk_31.js.map +1 -1
- package/lib/sdk/extension_sdk_40.js +0 -6
- package/lib/sdk/extension_sdk_40.js.map +1 -1
- package/lib/sdk/index.js +0 -2
- package/lib/sdk/index.js.map +1 -1
- package/lib/sdk/sdk_connection.js +0 -10
- package/lib/sdk/sdk_connection.js.map +1 -1
- package/package.json +4 -4
- package/lib/connect/tile/index.d.ts +0 -1
- package/lib/connect/tile/index.js +0 -19
- package/lib/connect/tile/index.js.map +0 -1
- package/lib/connect/tile/tile_sdk.d.ts +0 -24
- package/lib/connect/tile/tile_sdk.js +0 -153
- package/lib/connect/tile/tile_sdk.js.map +0 -1
- package/lib/connect/tile/types.d.ts +0 -86
- package/lib/connect/tile/types.js +0 -15
- package/lib/connect/tile/types.js.map +0 -1
- package/lib/connect/visualization/index.d.ts +0 -2
- package/lib/connect/visualization/index.js +0 -32
- package/lib/connect/visualization/index.js.map +0 -1
- package/lib/connect/visualization/types.d.ts +0 -62
- package/lib/connect/visualization/types.js +0 -2
- package/lib/connect/visualization/types.js.map +0 -1
- package/lib/connect/visualization/visualization_sdk.d.ts +0 -36
- package/lib/connect/visualization/visualization_sdk.js +0 -166
- package/lib/connect/visualization/visualization_sdk.js.map +0 -1
- package/lib/esm/connect/tile/index.js +0 -2
- package/lib/esm/connect/tile/index.js.map +0 -1
- package/lib/esm/connect/tile/tile_sdk.js +0 -140
- package/lib/esm/connect/tile/tile_sdk.js.map +0 -1
- package/lib/esm/connect/tile/types.js +0 -8
- package/lib/esm/connect/tile/types.js.map +0 -1
- package/lib/esm/connect/visualization/index.js +0 -3
- package/lib/esm/connect/visualization/index.js.map +0 -1
- package/lib/esm/connect/visualization/types.js +0 -2
- package/lib/esm/connect/visualization/types.js.map +0 -1
- package/lib/esm/connect/visualization/visualization_sdk.js +0 -156
- package/lib/esm/connect/visualization/visualization_sdk.js.map +0 -1
- package/lib/esm/util/errors.js +0 -2
- package/lib/esm/util/errors.js.map +0 -1
- package/lib/esm/util/index.js +0 -3
- package/lib/esm/util/index.js.map +0 -1
- package/lib/esm/util/logger.js +0 -15
- package/lib/esm/util/logger.js.map +0 -1
- package/lib/util/errors.d.ts +0 -1
- package/lib/util/errors.js +0 -9
- package/lib/util/errors.js.map +0 -1
- package/lib/util/index.d.ts +0 -2
- package/lib/util/index.js +0 -32
- package/lib/util/index.js.map +0 -1
- package/lib/util/logger.d.ts +0 -2
- package/lib/util/logger.js +0 -27
- package/lib/util/logger.js.map +0 -1
|
@@ -4,40 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SdkConnection = void 0;
|
|
7
|
-
|
|
8
7
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
-
|
|
10
8
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
|
-
|
|
12
9
|
class SdkConnection {
|
|
13
10
|
constructor(hostConnection, apiVersion) {
|
|
14
11
|
this.hostConnection = hostConnection;
|
|
15
12
|
this.apiVersion = apiVersion;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
request(httpMethod, path, body, params, _authenticator, options) {
|
|
19
15
|
var _this = this;
|
|
20
|
-
|
|
21
16
|
return _asyncToGenerator(function* () {
|
|
22
17
|
return _this.hostConnection.invokeCoreSdk(httpMethod, path, params, body, undefined, options, _this.apiVersion);
|
|
23
18
|
})();
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
rawRequest(httpMethod, path, body, params, _authenticator, _options) {
|
|
27
21
|
var _this2 = this;
|
|
28
|
-
|
|
29
22
|
return _asyncToGenerator(function* () {
|
|
30
23
|
return _this2.hostConnection.invokeCoreSdkRaw(httpMethod, path, params, body, _this2.apiVersion);
|
|
31
24
|
})();
|
|
32
25
|
}
|
|
33
|
-
|
|
34
26
|
stream(_callback, _method, _path, _queryParams, _body, _authenticator, _options) {
|
|
35
27
|
return _asyncToGenerator(function* () {
|
|
36
28
|
return Promise.reject(new Error('Not implemented'));
|
|
37
29
|
})();
|
|
38
30
|
}
|
|
39
|
-
|
|
40
31
|
}
|
|
41
|
-
|
|
42
32
|
exports.SdkConnection = SdkConnection;
|
|
43
33
|
//# sourceMappingURL=sdk_connection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,WAAW,CACDC,cAAgC,EAChCC,UAAsB,EAC9B;IAAA,KAFQD,cAAgC,GAAhCA,cAAgC;IAAA,KAChCC,UAAsB,GAAtBA,UAAsB;EAC7B;EAEGC,OAAO,CACXC,UAAkB,EAClBC,IAAY,EACZC,IAAU,EACVC,MAAY,EACZC,cAAoB,EACpBC,OAAa,EACC;IAAA;IAAA;MACd,OAAO,KAAI,CAACR,cAAc,CAACS,aAAa,CACtCN,UAAU,EACVC,IAAI,EACJE,MAAM,EACND,IAAI,EACJK,SAAS,EACTF,OAAO,EACP,KAAI,CAACP,UAAU,CAChB;IAAA;EACH;EAEMU,UAAU,CACdR,UAAkB,EAClBC,IAAY,EACZC,IAAU,EACVC,MAAY,EACZC,cAA8B,EAC9BK,QAAsC,EACxB;IAAA;IAAA;MACd,OAAO,MAAI,CAACZ,cAAc,CAACa,gBAAgB,CACzCV,UAAU,EACVC,IAAI,EACJE,MAAM,EACND,IAAI,EACJ,MAAI,CAACJ,UAAU,CAChB;IAAA;EACH;EAEMa,MAAM,CACVC,SAA6C,EAC7CC,OAAmB,EACnBC,KAAa,EACbC,YAAqB,EACrBC,KAAW,EACXZ,cAA8B,EAC9BK,QAAsC,EACxB;IAAA;MACd,OAAOQ,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAAA;EACrD;AACF;AAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@looker/extension-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.2.0",
|
|
4
4
|
"description": "Looker Extension SDK",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@looker/chatty": "2.3.9",
|
|
43
|
-
"@looker/sdk": "^
|
|
44
|
-
"@looker/sdk-rtl": "^21.
|
|
43
|
+
"@looker/sdk": "^23.2.0",
|
|
44
|
+
"@looker/sdk-rtl": "^21.6.0",
|
|
45
45
|
"deepmerge": "^4.2.2",
|
|
46
46
|
"readable-stream": "^3.4.0",
|
|
47
47
|
"request": "^2.88.0",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"Looker",
|
|
53
53
|
"extension-sdk"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "72979076f633ebded42df7679bbd07813d5d6bbc"
|
|
56
56
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './types';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _types = require("./types");
|
|
8
|
-
|
|
9
|
-
Object.keys(_types).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _types[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/connect/tile/index.ts"],"names":[],"mappings":";;;;;;AAyBA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './types'\n"],"file":"index.js"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { MouseEvent } from 'react';
|
|
2
|
-
import type { ExtensionHostApiImpl } from '../extension_host_api';
|
|
3
|
-
import type { TileSDK, TileError, DrillMenuOptions, TriggerConfig, CrossFilterOptions, Filters, TileHostData } from './types';
|
|
4
|
-
export declare class TileSDKImpl implements TileSDK {
|
|
5
|
-
hostApi: ExtensionHostApiImpl;
|
|
6
|
-
tileHostData: TileHostData;
|
|
7
|
-
constructor(hostApi: ExtensionHostApiImpl);
|
|
8
|
-
tileHostDataChanged(partialHostData: Partial<TileHostData>): void;
|
|
9
|
-
addErrors(...errors: TileError[]): void;
|
|
10
|
-
clearErrors(group?: string): void;
|
|
11
|
-
trigger(message: string, config: TriggerConfig[], event?: MouseEvent): void;
|
|
12
|
-
openDrillMenu(options: DrillMenuOptions, event?: MouseEvent): void;
|
|
13
|
-
toggleCrossFilter(options: CrossFilterOptions, event?: MouseEvent): void;
|
|
14
|
-
runDashboard(): void;
|
|
15
|
-
stopDashboard(): void;
|
|
16
|
-
updateFilters(filters: Filters, runDashboard?: boolean): void;
|
|
17
|
-
openScheduleDialog(): Promise<any>;
|
|
18
|
-
sanitizeEvent(event?: MouseEvent): {
|
|
19
|
-
metaKey: boolean;
|
|
20
|
-
pageX: number;
|
|
21
|
-
pageY: number;
|
|
22
|
-
type: string;
|
|
23
|
-
} | undefined;
|
|
24
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TileSDKImpl = void 0;
|
|
7
|
-
|
|
8
|
-
var _errors = require("../../util/errors");
|
|
9
|
-
|
|
10
|
-
var _types = require("../types");
|
|
11
|
-
|
|
12
|
-
var _types2 = require("./types");
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
-
|
|
18
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
|
|
20
|
-
var defaultHostData = {
|
|
21
|
-
isDashboardEditing: false,
|
|
22
|
-
dashboardRunState: _types2.DashboardRunState.UNKNOWN,
|
|
23
|
-
dashboardFilters: {}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
class TileSDKImpl {
|
|
27
|
-
constructor(hostApi) {
|
|
28
|
-
_defineProperty(this, "hostApi", void 0);
|
|
29
|
-
|
|
30
|
-
_defineProperty(this, "tileHostData", void 0);
|
|
31
|
-
|
|
32
|
-
this.hostApi = hostApi;
|
|
33
|
-
this.tileHostData = _objectSpread({}, defaultHostData);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
tileHostDataChanged(partialHostData) {
|
|
37
|
-
if (this.hostApi.isDashboardMountSupported) {
|
|
38
|
-
this.tileHostData = _objectSpread(_objectSpread({}, this.tileHostData), partialHostData);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
addErrors() {
|
|
43
|
-
if (this.hostApi.isDashboardMountSupported) {
|
|
44
|
-
for (var _len = arguments.length, errors = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
45
|
-
errors[_key] = arguments[_key];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
this.hostApi.send(_types.ExtensionRequestType.TILE_ADD_ERRORS, {
|
|
49
|
-
errors
|
|
50
|
-
});
|
|
51
|
-
} else {
|
|
52
|
-
throw _errors.NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
clearErrors(group) {
|
|
57
|
-
if (this.hostApi.isDashboardMountSupported) {
|
|
58
|
-
this.hostApi.send(_types.ExtensionRequestType.TILE_CLEAR_ERRORS, {
|
|
59
|
-
group
|
|
60
|
-
});
|
|
61
|
-
} else {
|
|
62
|
-
throw _errors.NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
trigger(message, config, event) {
|
|
67
|
-
if (this.hostApi.isDashboardMountSupported) {
|
|
68
|
-
this.hostApi.send(_types.ExtensionRequestType.TILE_TRIGGER, {
|
|
69
|
-
message,
|
|
70
|
-
config,
|
|
71
|
-
event: this.sanitizeEvent(event)
|
|
72
|
-
});
|
|
73
|
-
} else {
|
|
74
|
-
throw _errors.NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
openDrillMenu(options, event) {
|
|
79
|
-
if (this.hostApi.isDashboardMountSupported) {
|
|
80
|
-
this.hostApi.send(_types.ExtensionRequestType.TILE_OPEN_DRILL_MENU, {
|
|
81
|
-
options,
|
|
82
|
-
event: this.sanitizeEvent(event)
|
|
83
|
-
});
|
|
84
|
-
} else {
|
|
85
|
-
throw _errors.NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
toggleCrossFilter(options, event) {
|
|
90
|
-
if (this.hostApi.isDashboardMountSupported) {
|
|
91
|
-
this.hostApi.send(_types.ExtensionRequestType.TILE_TOGGLE_CROSS_FILTER, {
|
|
92
|
-
options,
|
|
93
|
-
event: this.sanitizeEvent(event)
|
|
94
|
-
});
|
|
95
|
-
} else {
|
|
96
|
-
throw _errors.NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
runDashboard() {
|
|
101
|
-
if (this.hostApi.isDashboardMountSupported) {
|
|
102
|
-
this.hostApi.send(_types.ExtensionRequestType.TILE_RUN_DASHBOARD, {});
|
|
103
|
-
} else {
|
|
104
|
-
throw _errors.NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
stopDashboard() {
|
|
109
|
-
if (this.hostApi.isDashboardMountSupported) {
|
|
110
|
-
this.hostApi.send(_types.ExtensionRequestType.TILE_STOP_DASHBOARD, {});
|
|
111
|
-
} else {
|
|
112
|
-
throw _errors.NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
updateFilters(filters) {
|
|
117
|
-
var runDashboard = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
118
|
-
|
|
119
|
-
if (this.hostApi.isDashboardMountSupported) {
|
|
120
|
-
this.hostApi.send(_types.ExtensionRequestType.TILE_UPDATE_FILTERS, {
|
|
121
|
-
filters,
|
|
122
|
-
runDashboard
|
|
123
|
-
});
|
|
124
|
-
} else {
|
|
125
|
-
throw _errors.NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
openScheduleDialog() {
|
|
130
|
-
if (this.hostApi.isDashboardMountSupported) {
|
|
131
|
-
return this.hostApi.sendAndReceive(_types.ExtensionRequestType.TILE_OPEN_SCHEDULE_DIALOG, {});
|
|
132
|
-
} else {
|
|
133
|
-
throw _errors.NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
sanitizeEvent(event) {
|
|
138
|
-
if (event) {
|
|
139
|
-
return {
|
|
140
|
-
metaKey: event.metaKey,
|
|
141
|
-
pageX: event.pageX,
|
|
142
|
-
pageY: event.pageY,
|
|
143
|
-
type: event.type
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return undefined;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
exports.TileSDKImpl = TileSDKImpl;
|
|
153
|
-
//# sourceMappingURL=tile_sdk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/connect/tile/tile_sdk.ts"],"names":["defaultHostData","isDashboardEditing","dashboardRunState","DashboardRunState","UNKNOWN","dashboardFilters","TileSDKImpl","constructor","hostApi","tileHostData","tileHostDataChanged","partialHostData","isDashboardMountSupported","addErrors","errors","send","ExtensionRequestType","TILE_ADD_ERRORS","NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR","clearErrors","group","TILE_CLEAR_ERRORS","trigger","message","config","event","TILE_TRIGGER","sanitizeEvent","openDrillMenu","options","TILE_OPEN_DRILL_MENU","toggleCrossFilter","TILE_TOGGLE_CROSS_FILTER","runDashboard","TILE_RUN_DASHBOARD","stopDashboard","TILE_STOP_DASHBOARD","updateFilters","filters","TILE_UPDATE_FILTERS","openScheduleDialog","sendAndReceive","TILE_OPEN_SCHEDULE_DIALOG","metaKey","pageX","pageY","type","undefined"],"mappings":"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","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { MouseEvent } from 'react'\nimport { NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR } from '../../util/errors'\nimport { ExtensionRequestType } from '../types'\nimport type { ExtensionHostApiImpl } from '../extension_host_api'\nimport type {\n TileSDK,\n TileError,\n DrillMenuOptions,\n TriggerConfig,\n CrossFilterOptions,\n Filters,\n TileHostData,\n} from './types'\nimport { DashboardRunState } from './types'\n\nconst defaultHostData: TileHostData = {\n isDashboardEditing: false,\n dashboardRunState: DashboardRunState.UNKNOWN,\n dashboardFilters: {},\n}\nexport class TileSDKImpl implements TileSDK {\n hostApi: ExtensionHostApiImpl\n tileHostData: TileHostData\n\n constructor(hostApi: ExtensionHostApiImpl) {\n this.hostApi = hostApi\n this.tileHostData = { ...defaultHostData }\n }\n\n tileHostDataChanged(partialHostData: Partial<TileHostData>) {\n // Ignore update messages if dashboard mounts not supported.\n // Should never happen.\n if (this.hostApi.isDashboardMountSupported) {\n this.tileHostData = { ...this.tileHostData, ...partialHostData }\n }\n }\n\n addErrors(...errors: TileError[]) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_ADD_ERRORS, { errors })\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR\n }\n }\n\n clearErrors(group?: string) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_CLEAR_ERRORS, { group })\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR\n }\n }\n\n trigger(message: string, config: TriggerConfig[], event?: MouseEvent) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_TRIGGER, {\n message,\n config,\n event: this.sanitizeEvent(event),\n })\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR\n }\n }\n\n openDrillMenu(options: DrillMenuOptions, event?: MouseEvent) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_OPEN_DRILL_MENU, {\n options,\n event: this.sanitizeEvent(event),\n })\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR\n }\n }\n\n toggleCrossFilter(options: CrossFilterOptions, event?: MouseEvent) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_TOGGLE_CROSS_FILTER, {\n options,\n event: this.sanitizeEvent(event),\n })\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR\n }\n }\n\n runDashboard() {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_RUN_DASHBOARD, {})\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR\n }\n }\n\n stopDashboard() {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_STOP_DASHBOARD, {})\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR\n }\n }\n\n updateFilters(filters: Filters, runDashboard = false) {\n if (this.hostApi.isDashboardMountSupported) {\n this.hostApi.send(ExtensionRequestType.TILE_UPDATE_FILTERS, {\n filters,\n runDashboard,\n })\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR\n }\n }\n\n openScheduleDialog() {\n if (this.hostApi.isDashboardMountSupported) {\n return this.hostApi.sendAndReceive(\n ExtensionRequestType.TILE_OPEN_SCHEDULE_DIALOG,\n {}\n )\n } else {\n throw NOT_DASHBOARD_MOUNT_NOT_SUPPORTED_ERROR\n }\n }\n\n sanitizeEvent(event?: MouseEvent) {\n if (event) {\n return {\n metaKey: event.metaKey,\n pageX: event.pageX,\n pageY: event.pageY,\n type: event.type,\n }\n }\n return undefined\n }\n}\n"],"file":"tile_sdk.js"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { MouseEvent } from 'react';
|
|
2
|
-
export declare type TileHostDataChangedCallback = (tileHostData: Partial<TileHostData>) => void;
|
|
3
|
-
export declare enum DashboardRunState {
|
|
4
|
-
UNKNOWN = "UNKNOWN",
|
|
5
|
-
RUNNING = "RUNNING",
|
|
6
|
-
NOT_RUNNING = "NOT_RUNNING"
|
|
7
|
-
}
|
|
8
|
-
export interface TileHostData {
|
|
9
|
-
isExploring?: boolean;
|
|
10
|
-
dashboardId?: string;
|
|
11
|
-
elementId?: string;
|
|
12
|
-
queryId?: string;
|
|
13
|
-
querySlug?: string;
|
|
14
|
-
dashboardFilters?: Filters;
|
|
15
|
-
dashboardRunState?: DashboardRunState;
|
|
16
|
-
isDashboardEditing?: boolean;
|
|
17
|
-
isDashboardCrossFilteringEnabled?: boolean;
|
|
18
|
-
lastRunSourceElementId?: string;
|
|
19
|
-
lastRunStartTime?: number;
|
|
20
|
-
lastRunEndTime?: number;
|
|
21
|
-
lastRunSuccess?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface Pivot {
|
|
24
|
-
key: string;
|
|
25
|
-
is_total: boolean;
|
|
26
|
-
data: {
|
|
27
|
-
[key: string]: string;
|
|
28
|
-
};
|
|
29
|
-
metadata: {
|
|
30
|
-
[key: string]: {
|
|
31
|
-
[key: string]: string | Link[];
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
labels: {
|
|
35
|
-
[key: string]: string;
|
|
36
|
-
};
|
|
37
|
-
sort_values?: {
|
|
38
|
-
[key: string]: string;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
export interface Cell {
|
|
42
|
-
[key: string]: any;
|
|
43
|
-
value: any;
|
|
44
|
-
rendered?: string;
|
|
45
|
-
html?: string;
|
|
46
|
-
links?: Link[];
|
|
47
|
-
}
|
|
48
|
-
export interface Link {
|
|
49
|
-
label: string;
|
|
50
|
-
type: string;
|
|
51
|
-
type_label: string;
|
|
52
|
-
url: string;
|
|
53
|
-
}
|
|
54
|
-
export interface PivotCell {
|
|
55
|
-
[pivotKey: string]: Cell;
|
|
56
|
-
}
|
|
57
|
-
export interface Row {
|
|
58
|
-
[fieldName: string]: PivotCell | Cell;
|
|
59
|
-
}
|
|
60
|
-
export interface TileError {
|
|
61
|
-
title: string;
|
|
62
|
-
message: string;
|
|
63
|
-
group: string;
|
|
64
|
-
}
|
|
65
|
-
export interface CrossFilterOptions {
|
|
66
|
-
pivot: Pivot;
|
|
67
|
-
row: Row;
|
|
68
|
-
}
|
|
69
|
-
export declare type TriggerConfig = any;
|
|
70
|
-
export declare type DrillMenuOptions = any;
|
|
71
|
-
export interface Filters {
|
|
72
|
-
[key: string]: string;
|
|
73
|
-
}
|
|
74
|
-
export interface TileSDK {
|
|
75
|
-
tileHostData: TileHostData;
|
|
76
|
-
tileHostDataChanged: (hostData: Partial<TileHostData>) => void;
|
|
77
|
-
addErrors: (...errors: TileError[]) => void;
|
|
78
|
-
clearErrors: (group?: string) => void;
|
|
79
|
-
trigger: (message: string, config: TriggerConfig[], event?: MouseEvent) => void;
|
|
80
|
-
openDrillMenu: (options: DrillMenuOptions, event?: MouseEvent) => void;
|
|
81
|
-
toggleCrossFilter: (options: CrossFilterOptions, event?: MouseEvent) => void;
|
|
82
|
-
runDashboard: () => void;
|
|
83
|
-
stopDashboard: () => void;
|
|
84
|
-
updateFilters: (filters: Filters, runDashboard?: boolean) => void;
|
|
85
|
-
openScheduleDialog: () => Promise<void>;
|
|
86
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.DashboardRunState = void 0;
|
|
7
|
-
var DashboardRunState;
|
|
8
|
-
exports.DashboardRunState = DashboardRunState;
|
|
9
|
-
|
|
10
|
-
(function (DashboardRunState) {
|
|
11
|
-
DashboardRunState["UNKNOWN"] = "UNKNOWN";
|
|
12
|
-
DashboardRunState["RUNNING"] = "RUNNING";
|
|
13
|
-
DashboardRunState["NOT_RUNNING"] = "NOT_RUNNING";
|
|
14
|
-
})(DashboardRunState || (exports.DashboardRunState = DashboardRunState = {}));
|
|
15
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/connect/tile/types.ts"],"names":["DashboardRunState"],"mappings":";;;;;;IAuCYA,iB;;;WAAAA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;GAAAA,iB,iCAAAA,iB","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2022 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { MouseEvent } from 'react'\n\n/**\n * Callback that is invoked when a change in the host happens\n * <code>Looker >=22.8</code>\n */\nexport type TileHostDataChangedCallback = (\n tileHostData: Partial<TileHostData>\n) => void\n\n/**\n * Defines the current run state of the dashboard\n */\nexport enum DashboardRunState {\n UNKNOWN = 'UNKNOWN',\n RUNNING = 'RUNNING',\n NOT_RUNNING = 'NOT_RUNNING',\n}\n\nexport interface TileHostData {\n /**\n * When true indicates that the tile is being configured as\n * a visualization inside of an explore.\n */\n isExploring?: boolean\n /**\n * The dashboard id the tile is being rendered in. If the tile\n * is being configured as an explore this will not be populated.\n */\n dashboardId?: string\n /**\n * The element id of the tile being rendered. If the tile\n * is being configured as an explore this will not be populated.\n */\n elementId?: string\n /**\n * The query id of the tile being rendered if it is associated with\n * a visualization. If the tile is being configured as an explore\n * this will not be populated.\n *\n * Note that queryId is that of the query created when the visualization\n * is built in the Looker explore. It does not contain any filters or\n * cross filtering applied to the dashboard. Filters and cross filters\n * will need to be applied and a new query generated in order to reflect\n * the data shown in the QueryResponse. As such the queryId may not be\n * that useful.\n */\n queryId?: string\n /**\n * The query slug of the tile being rendered if it is associated with\n * a visualization. If the tile is being configured as an explore\n * this will not be populated.\n *\n * Note that querySlug is that of the query created when the visualization\n * is built in the Looker explore. It does not contain any filters or\n * cross filtering applied to the dashboard. Filters and cross filters\n * will need to be applied and a new query generated in order to reflect\n * the data shown in the QueryResponse. As such the queryId may not be\n * that useful.\n */\n querySlug?: string\n /**\n * The filters being applied to the dashboard. If the tile\n * is being configured as an explore this will not be populated.\n */\n dashboardFilters?: Filters\n /**\n * Indicates whether the dashboard is running. If the tile\n * is being configured as an explore the state will be UNKNOWN.\n * Note that for dashboard performance reasons, the runstate\n * may NEVER be shown as running. This generally will happen\n * if there no other tiles associated with a query (including\n * the one the extension is associated with).\n * If the extension needs to know for certain that a dashboard\n * has been run, detecting differences in the lastRunStartTime\n * is the reliable way.\n */\n dashboardRunState?: DashboardRunState\n /**\n * When true, the dashboard is being edited. If the tile\n * is being configured as an explore this will not be populated.\n */\n isDashboardEditing?: boolean\n /**\n * When true, cross filtering. If the tile\n * is being configured as an explore this will not be populated.\n */\n isDashboardCrossFilteringEnabled?: boolean\n /**\n * The id of the tile extension element that triggered the last\n * dashboard run. The id will be undefined if the dashboard run\n * was triggered by the dashboard run button or auto run or if\n * the run was triggered using the embed SDK. If the tile\n * is being configured as an explore this will not be populated.\n * Note that the lastRunSourceElementId CAN be the same as the\n * element id of the current extension instance, in other words,\n * if the extension triggers a dashboard run, it will be notified\n * when the dashboard run starts and finishes.\n */\n lastRunSourceElementId?: string\n /**\n * Indicates the last dashboard run start time. If the tile\n * is being configured as an explore this will not be populated.\n * Note that the start and end times reported should not\n * used for capturing performance metrics.\n */\n lastRunStartTime?: number\n /**\n * Indicates the last dashboard run end time. If the tile\n * is being configured as an explore this will not be populated.\n * If the tile is running, this will not be populated.\n * Note that the start and end times reported should not\n * used for capturing performance metrics.\n */\n lastRunEndTime?: number\n /**\n * Indicates whether the last dashboard run was succesful or not.\n * If the tile is being configured as an explore this will not be\n * populated.\n * If the tile is running, this will not be populated.\n */\n lastRunSuccess?: boolean\n}\n\nexport interface Pivot {\n key: string\n is_total: boolean\n data: { [key: string]: string }\n metadata: { [key: string]: { [key: string]: string | Link[] } }\n labels: { [key: string]: string }\n sort_values?: { [key: string]: string }\n}\n\nexport interface Cell {\n [key: string]: any\n value: any\n rendered?: string\n html?: string\n links?: Link[]\n}\n\nexport interface Link {\n label: string\n type: string\n type_label: string\n url: string\n}\n\nexport interface PivotCell {\n [pivotKey: string]: Cell\n}\n\nexport interface Row {\n [fieldName: string]: PivotCell | Cell\n}\n\nexport interface TileError {\n title: string\n message: string\n group: string\n}\n\nexport interface CrossFilterOptions {\n pivot: Pivot\n row: Row\n}\n\n// TODO build out type\nexport type TriggerConfig = any\n\n// TODO build out type\nexport type DrillMenuOptions = any\n\nexport interface Filters {\n [key: string]: string\n}\n\nexport interface TileSDK {\n tileHostData: TileHostData\n tileHostDataChanged: (hostData: Partial<TileHostData>) => void\n addErrors: (...errors: TileError[]) => void\n clearErrors: (group?: string) => void\n trigger: (\n message: string,\n config: TriggerConfig[],\n event?: MouseEvent\n ) => void\n openDrillMenu: (options: DrillMenuOptions, event?: MouseEvent) => void\n toggleCrossFilter: (options: CrossFilterOptions, event?: MouseEvent) => void\n runDashboard: () => void\n stopDashboard: () => void\n updateFilters: (filters: Filters, runDashboard?: boolean) => void\n openScheduleDialog: () => Promise<void>\n}\n"],"file":"types.js"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _types = require("./types");
|
|
8
|
-
|
|
9
|
-
Object.keys(_types).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _types[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
var _visualization_sdk = require("./visualization_sdk");
|
|
21
|
-
|
|
22
|
-
Object.keys(_visualization_sdk).forEach(function (key) {
|
|
23
|
-
if (key === "default" || key === "__esModule") return;
|
|
24
|
-
if (key in exports && exports[key] === _visualization_sdk[key]) return;
|
|
25
|
-
Object.defineProperty(exports, key, {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function get() {
|
|
28
|
-
return _visualization_sdk[key];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/connect/visualization/index.ts"],"names":[],"mappings":";;;;;;AA0BA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nexport * from './types'\nexport * from './visualization_sdk'\n"],"file":"index.js"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { Row } from '../tile';
|
|
2
|
-
export declare type VisualizationDataReceivedCallback = (visualizationData: RawVisualizationData) => void;
|
|
3
|
-
export interface RawVisualizationData {
|
|
4
|
-
visConfig: RawVisConfig;
|
|
5
|
-
queryResponse: RawVisQueryResponse;
|
|
6
|
-
}
|
|
7
|
-
export interface RawVisConfig {
|
|
8
|
-
[key: string]: RawVisConfigValue;
|
|
9
|
-
}
|
|
10
|
-
export declare type RawVisConfigValue = any;
|
|
11
|
-
export interface RawVisQueryResponse {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
data: RawVisData;
|
|
14
|
-
fields: {
|
|
15
|
-
[key: string]: any[];
|
|
16
|
-
};
|
|
17
|
-
pivots: RawPivotConfig[];
|
|
18
|
-
}
|
|
19
|
-
export declare type RawVisData = Row[];
|
|
20
|
-
export interface RawPivotConfig {
|
|
21
|
-
key: string;
|
|
22
|
-
is_total: boolean;
|
|
23
|
-
data: {
|
|
24
|
-
[key: string]: string;
|
|
25
|
-
};
|
|
26
|
-
metadata: {
|
|
27
|
-
[key: string]: {
|
|
28
|
-
[key: string]: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export interface Measure extends RawVisConfig {
|
|
33
|
-
}
|
|
34
|
-
export interface Dimension extends RawVisConfig {
|
|
35
|
-
[key: string]: any;
|
|
36
|
-
}
|
|
37
|
-
export interface TableCalculation {
|
|
38
|
-
}
|
|
39
|
-
export interface PivotConfig extends RawPivotConfig {
|
|
40
|
-
}
|
|
41
|
-
export interface VisualizationConfig {
|
|
42
|
-
queryFieldMeasures: Measure[];
|
|
43
|
-
queryFieldDimensions: Dimension[];
|
|
44
|
-
queryFieldTableCalculations: TableCalculation[];
|
|
45
|
-
queryFieldPivots: PivotConfig[];
|
|
46
|
-
}
|
|
47
|
-
export interface QueryResponse {
|
|
48
|
-
data: Row[];
|
|
49
|
-
fieldMeasures: Measure[];
|
|
50
|
-
fieldDimensions: Dimension[];
|
|
51
|
-
fieldTableCalculations: TableCalculation[];
|
|
52
|
-
fieldPivots: PivotConfig[];
|
|
53
|
-
fieldMeasureLike: Measure[];
|
|
54
|
-
fieldDimensionLike: Dimension[];
|
|
55
|
-
}
|
|
56
|
-
export interface VisualizationSDK {
|
|
57
|
-
visualizationData?: RawVisualizationData;
|
|
58
|
-
visConfig: VisualizationConfig;
|
|
59
|
-
queryResponse: QueryResponse;
|
|
60
|
-
updateVisData: (rawVisData: RawVisualizationData) => void;
|
|
61
|
-
configureVisualization: (options: RawVisConfig) => void;
|
|
62
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ExtensionHostApiImpl } from '../extension_host_api';
|
|
2
|
-
import type { Row } from '../tile';
|
|
3
|
-
import type { VisualizationSDK, RawVisualizationData, RawVisConfig, VisualizationConfig, QueryResponse, Measure, Dimension, TableCalculation, PivotConfig, RawVisQueryResponse } from './types';
|
|
4
|
-
declare class QueryResponseImpl implements QueryResponse {
|
|
5
|
-
_queryResponse?: RawVisQueryResponse;
|
|
6
|
-
constructor(queryResponse?: RawVisQueryResponse);
|
|
7
|
-
update(queryResponse: RawVisQueryResponse): void;
|
|
8
|
-
get fieldMeasures(): Measure[];
|
|
9
|
-
get fieldDimensions(): Dimension[];
|
|
10
|
-
get fieldTableCalculations(): TableCalculation[];
|
|
11
|
-
get fieldPivots(): PivotConfig[];
|
|
12
|
-
get fieldMeasureLike(): Measure[];
|
|
13
|
-
get fieldDimensionLike(): Dimension[];
|
|
14
|
-
get data(): Row[];
|
|
15
|
-
}
|
|
16
|
-
declare class VisualizationConfigImpl implements VisualizationConfig {
|
|
17
|
-
_visConfig?: RawVisConfig;
|
|
18
|
-
constructor(visConfig?: RawVisConfig);
|
|
19
|
-
update(visConfig: RawVisConfig): void;
|
|
20
|
-
get queryFieldMeasures(): Measure[];
|
|
21
|
-
get queryFieldDimensions(): Dimension[];
|
|
22
|
-
get queryFieldTableCalculations(): TableCalculation[];
|
|
23
|
-
get queryFieldPivots(): PivotConfig[];
|
|
24
|
-
}
|
|
25
|
-
export declare class VisualizationSDKImpl implements VisualizationSDK {
|
|
26
|
-
hostApi: ExtensionHostApiImpl;
|
|
27
|
-
visualizationData?: RawVisualizationData;
|
|
28
|
-
_visConfig?: VisualizationConfigImpl;
|
|
29
|
-
_queryResponse?: QueryResponseImpl;
|
|
30
|
-
constructor(hostApi: ExtensionHostApiImpl);
|
|
31
|
-
updateVisData(visualizationData: RawVisualizationData): void;
|
|
32
|
-
configureVisualization(options: RawVisConfig): void;
|
|
33
|
-
get visConfig(): VisualizationConfig;
|
|
34
|
-
get queryResponse(): QueryResponse;
|
|
35
|
-
}
|
|
36
|
-
export {};
|