@looker/extension-sdk 22.4.3-alpha.1522 → 22.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/lib/connect/extension_host_api.d.ts +3 -12
  3. package/lib/connect/extension_host_api.js +20 -98
  4. package/lib/connect/extension_host_api.js.map +1 -1
  5. package/lib/connect/global_listener.js +2 -4
  6. package/lib/connect/global_listener.js.map +1 -1
  7. package/lib/connect/index.d.ts +0 -2
  8. package/lib/connect/index.js +1 -29
  9. package/lib/connect/index.js.map +1 -1
  10. package/lib/connect/types.d.ts +7 -47
  11. package/lib/connect/types.js +1 -23
  12. package/lib/connect/types.js.map +1 -1
  13. package/lib/esm/connect/extension_host_api.js +21 -96
  14. package/lib/esm/connect/extension_host_api.js.map +1 -1
  15. package/lib/esm/connect/global_listener.js +2 -4
  16. package/lib/esm/connect/global_listener.js.map +1 -1
  17. package/lib/esm/connect/index.js +0 -2
  18. package/lib/esm/connect/index.js.map +1 -1
  19. package/lib/esm/connect/types.js +0 -21
  20. package/lib/esm/connect/types.js.map +1 -1
  21. package/lib/esm/index.js +0 -3
  22. package/lib/esm/index.js.map +1 -1
  23. package/lib/index.d.ts +0 -3
  24. package/lib/index.js +1 -40
  25. package/lib/index.js.map +1 -1
  26. package/package.json +4 -4
  27. package/lib/connect/tile/index.d.ts +0 -1
  28. package/lib/connect/tile/index.js +0 -19
  29. package/lib/connect/tile/index.js.map +0 -1
  30. package/lib/connect/tile/tile_sdk.d.ts +0 -24
  31. package/lib/connect/tile/tile_sdk.js +0 -110
  32. package/lib/connect/tile/tile_sdk.js.map +0 -1
  33. package/lib/connect/tile/types.d.ts +0 -78
  34. package/lib/connect/tile/types.js +0 -16
  35. package/lib/connect/tile/types.js.map +0 -1
  36. package/lib/connect/visualization/index.d.ts +0 -2
  37. package/lib/connect/visualization/index.js +0 -32
  38. package/lib/connect/visualization/index.js.map +0 -1
  39. package/lib/connect/visualization/types.d.ts +0 -62
  40. package/lib/connect/visualization/types.js +0 -2
  41. package/lib/connect/visualization/types.js.map +0 -1
  42. package/lib/connect/visualization/visualization_sdk.d.ts +0 -36
  43. package/lib/connect/visualization/visualization_sdk.js +0 -158
  44. package/lib/connect/visualization/visualization_sdk.js.map +0 -1
  45. package/lib/esm/connect/tile/index.js +0 -2
  46. package/lib/esm/connect/tile/index.js.map +0 -1
  47. package/lib/esm/connect/tile/tile_sdk.js +0 -98
  48. package/lib/esm/connect/tile/tile_sdk.js.map +0 -1
  49. package/lib/esm/connect/tile/types.js +0 -9
  50. package/lib/esm/connect/tile/types.js.map +0 -1
  51. package/lib/esm/connect/visualization/index.js +0 -3
  52. package/lib/esm/connect/visualization/index.js.map +0 -1
  53. package/lib/esm/connect/visualization/types.js +0 -2
  54. package/lib/esm/connect/visualization/types.js.map +0 -1
  55. package/lib/esm/connect/visualization/visualization_sdk.js +0 -149
  56. package/lib/esm/connect/visualization/visualization_sdk.js.map +0 -1
  57. package/lib/esm/util/index.js +0 -2
  58. package/lib/esm/util/index.js.map +0 -1
  59. package/lib/esm/util/logger.js +0 -18
  60. package/lib/esm/util/logger.js.map +0 -1
  61. package/lib/util/index.d.ts +0 -1
  62. package/lib/util/index.js +0 -19
  63. package/lib/util/index.js.map +0 -1
  64. package/lib/util/logger.d.ts +0 -3
  65. package/lib/util/logger.js +0 -33
  66. package/lib/util/logger.js.map +0 -1
@@ -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,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=types.js.map
@@ -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 {};
@@ -1,158 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.VisualizationSDKImpl = void 0;
7
-
8
- var _types = require("../types");
9
-
10
- 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; }
11
-
12
- class QueryResponseImpl {
13
- constructor(queryResponse) {
14
- _defineProperty(this, "_queryResponse", void 0);
15
-
16
- this._queryResponse = queryResponse;
17
- }
18
-
19
- update(queryResponse) {
20
- this._queryResponse = queryResponse;
21
- }
22
-
23
- get fieldMeasures() {
24
- var _this$_queryResponse, _this$_queryResponse$;
25
-
26
- return ((_this$_queryResponse = this._queryResponse) === null || _this$_queryResponse === void 0 ? void 0 : (_this$_queryResponse$ = _this$_queryResponse.fields) === null || _this$_queryResponse$ === void 0 ? void 0 : _this$_queryResponse$.measures) || [];
27
- }
28
-
29
- get fieldDimensions() {
30
- var _this$_queryResponse2, _this$_queryResponse3;
31
-
32
- return ((_this$_queryResponse2 = this._queryResponse) === null || _this$_queryResponse2 === void 0 ? void 0 : (_this$_queryResponse3 = _this$_queryResponse2.fields) === null || _this$_queryResponse3 === void 0 ? void 0 : _this$_queryResponse3.dimensions) || [];
33
- }
34
-
35
- get fieldTableCalculations() {
36
- var _this$_queryResponse4, _this$_queryResponse5;
37
-
38
- return ((_this$_queryResponse4 = this._queryResponse) === null || _this$_queryResponse4 === void 0 ? void 0 : (_this$_queryResponse5 = _this$_queryResponse4.fields) === null || _this$_queryResponse5 === void 0 ? void 0 : _this$_queryResponse5.table_calculations) || [];
39
- }
40
-
41
- get fieldPivots() {
42
- var _this$_queryResponse6, _this$_queryResponse7;
43
-
44
- return ((_this$_queryResponse6 = this._queryResponse) === null || _this$_queryResponse6 === void 0 ? void 0 : (_this$_queryResponse7 = _this$_queryResponse6.fields) === null || _this$_queryResponse7 === void 0 ? void 0 : _this$_queryResponse7.pivots) || [];
45
- }
46
-
47
- get fieldMeasureLike() {
48
- var _this$_queryResponse8, _this$_queryResponse9;
49
-
50
- return ((_this$_queryResponse8 = this._queryResponse) === null || _this$_queryResponse8 === void 0 ? void 0 : (_this$_queryResponse9 = _this$_queryResponse8.fields) === null || _this$_queryResponse9 === void 0 ? void 0 : _this$_queryResponse9.measure_like) || [];
51
- }
52
-
53
- get fieldDimensionLike() {
54
- var _this$_queryResponse10, _this$_queryResponse11;
55
-
56
- return ((_this$_queryResponse10 = this._queryResponse) === null || _this$_queryResponse10 === void 0 ? void 0 : (_this$_queryResponse11 = _this$_queryResponse10.fields) === null || _this$_queryResponse11 === void 0 ? void 0 : _this$_queryResponse11.dimension_like) || [];
57
- }
58
-
59
- get data() {
60
- var _this$_queryResponse12;
61
-
62
- return ((_this$_queryResponse12 = this._queryResponse) === null || _this$_queryResponse12 === void 0 ? void 0 : _this$_queryResponse12.data) || [];
63
- }
64
-
65
- }
66
-
67
- class VisualizationConfigImpl {
68
- constructor(visConfig) {
69
- _defineProperty(this, "_visConfig", void 0);
70
-
71
- this._visConfig = visConfig;
72
- }
73
-
74
- update(visConfig) {
75
- this._visConfig = visConfig;
76
- }
77
-
78
- get queryFieldMeasures() {
79
- var _this$_visConfig, _this$_visConfig$quer;
80
-
81
- return ((_this$_visConfig = this._visConfig) === null || _this$_visConfig === void 0 ? void 0 : (_this$_visConfig$quer = _this$_visConfig.query_fields) === null || _this$_visConfig$quer === void 0 ? void 0 : _this$_visConfig$quer.measures) || [];
82
- }
83
-
84
- get queryFieldDimensions() {
85
- var _this$_visConfig2, _this$_visConfig2$que;
86
-
87
- return ((_this$_visConfig2 = this._visConfig) === null || _this$_visConfig2 === void 0 ? void 0 : (_this$_visConfig2$que = _this$_visConfig2.query_fields) === null || _this$_visConfig2$que === void 0 ? void 0 : _this$_visConfig2$que.dimensions) || [];
88
- }
89
-
90
- get queryFieldTableCalculations() {
91
- var _this$_visConfig3, _this$_visConfig3$que;
92
-
93
- return ((_this$_visConfig3 = this._visConfig) === null || _this$_visConfig3 === void 0 ? void 0 : (_this$_visConfig3$que = _this$_visConfig3.query_fields) === null || _this$_visConfig3$que === void 0 ? void 0 : _this$_visConfig3$que.table_calculations) || [];
94
- }
95
-
96
- get queryFieldPivots() {
97
- var _this$_visConfig4, _this$_visConfig4$que;
98
-
99
- return ((_this$_visConfig4 = this._visConfig) === null || _this$_visConfig4 === void 0 ? void 0 : (_this$_visConfig4$que = _this$_visConfig4.query_fields) === null || _this$_visConfig4$que === void 0 ? void 0 : _this$_visConfig4$que.pivots) || [];
100
- }
101
-
102
- }
103
-
104
- class VisualizationSDKImpl {
105
- constructor(hostApi) {
106
- _defineProperty(this, "hostApi", void 0);
107
-
108
- _defineProperty(this, "visualizationData", void 0);
109
-
110
- _defineProperty(this, "_visConfig", void 0);
111
-
112
- _defineProperty(this, "_queryResponse", void 0);
113
-
114
- this.hostApi = hostApi;
115
- }
116
-
117
- updateVisData(visualizationData) {
118
- this.visualizationData = visualizationData;
119
-
120
- if (this._visConfig) {
121
- this._visConfig.update(this.visualizationData.visConfig);
122
- }
123
-
124
- if (this._queryResponse) {
125
- this._queryResponse.update(this.visualizationData.queryResponse);
126
- }
127
- }
128
-
129
- configureVisualization(options) {
130
- this.hostApi.send(_types.ExtensionRequestType.VIS_DEFAULT_CONFIG, {
131
- options
132
- });
133
- }
134
-
135
- get visConfig() {
136
- if (!this._visConfig) {
137
- var _this$visualizationDa;
138
-
139
- this._visConfig = new VisualizationConfigImpl((_this$visualizationDa = this.visualizationData) === null || _this$visualizationDa === void 0 ? void 0 : _this$visualizationDa.visConfig);
140
- }
141
-
142
- return this._visConfig;
143
- }
144
-
145
- get queryResponse() {
146
- if (!this._queryResponse) {
147
- var _this$visualizationDa2;
148
-
149
- this._queryResponse = new QueryResponseImpl((_this$visualizationDa2 = this.visualizationData) === null || _this$visualizationDa2 === void 0 ? void 0 : _this$visualizationDa2.queryResponse);
150
- }
151
-
152
- return this._queryResponse;
153
- }
154
-
155
- }
156
-
157
- exports.VisualizationSDKImpl = VisualizationSDKImpl;
158
- //# sourceMappingURL=visualization_sdk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/connect/visualization/visualization_sdk.ts"],"names":["QueryResponseImpl","constructor","queryResponse","_queryResponse","update","fieldMeasures","fields","measures","fieldDimensions","dimensions","fieldTableCalculations","table_calculations","fieldPivots","pivots","fieldMeasureLike","measure_like","fieldDimensionLike","dimension_like","data","VisualizationConfigImpl","visConfig","_visConfig","queryFieldMeasures","query_fields","queryFieldDimensions","queryFieldTableCalculations","queryFieldPivots","VisualizationSDKImpl","hostApi","updateVisData","visualizationData","configureVisualization","options","send","ExtensionRequestType","VIS_DEFAULT_CONFIG"],"mappings":";;;;;;;AA2BA;;;;AAeA,MAAMA,iBAAN,CAAiD;AAG/CC,EAAAA,WAAW,CAACC,aAAD,EAAsC;AAAA;;AAC/C,SAAKC,cAAL,GAAsBD,aAAtB;AACD;;AAEDE,EAAAA,MAA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AAJ,2BACpB,KAAK8B,iBADe,2DACpB,uBAAwB5B,aADJ,CAAtB;AAGD;;AACD,WAAO,KAAKC,cAAZ;AACD;;AAxC2D","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 { ExtensionHostApiImpl } from '../extension_host_api'\nimport { ExtensionRequestType } from '../types'\nimport type { Row } from '../tile'\nimport type {\n VisualizationSDK,\n RawVisualizationData,\n RawVisConfig,\n VisualizationConfig,\n QueryResponse,\n Measure,\n Dimension,\n TableCalculation,\n PivotConfig,\n RawVisQueryResponse,\n} from './types'\n\nclass QueryResponseImpl implements QueryResponse {\n _queryResponse?: RawVisQueryResponse\n\n constructor(queryResponse?: RawVisQueryResponse) {\n this._queryResponse = queryResponse\n }\n\n update(queryResponse: RawVisQueryResponse) {\n this._queryResponse = queryResponse\n }\n\n get fieldMeasures(): Measure[] {\n return this._queryResponse?.fields?.measures || []\n }\n\n get fieldDimensions(): Dimension[] {\n return this._queryResponse?.fields?.dimensions || []\n }\n\n get fieldTableCalculations(): TableCalculation[] {\n return this._queryResponse?.fields?.table_calculations || []\n }\n\n get fieldPivots(): PivotConfig[] {\n return this._queryResponse?.fields?.pivots || []\n }\n\n get fieldMeasureLike(): Measure[] {\n return this._queryResponse?.fields?.measure_like || []\n }\n\n get fieldDimensionLike(): Dimension[] {\n return this._queryResponse?.fields?.dimension_like || []\n }\n\n get data(): Row[] {\n return this._queryResponse?.data || []\n }\n}\n\nclass VisualizationConfigImpl implements VisualizationConfig {\n _visConfig?: RawVisConfig\n\n constructor(visConfig?: RawVisConfig) {\n this._visConfig = visConfig\n }\n\n update(visConfig: RawVisConfig) {\n this._visConfig = visConfig\n }\n\n get queryFieldMeasures(): Measure[] {\n return this._visConfig?.query_fields?.measures || []\n }\n\n get queryFieldDimensions(): Dimension[] {\n return this._visConfig?.query_fields?.dimensions || []\n }\n\n get queryFieldTableCalculations(): TableCalculation[] {\n return this._visConfig?.query_fields?.table_calculations || []\n }\n\n get queryFieldPivots(): PivotConfig[] {\n return this._visConfig?.query_fields?.pivots || []\n }\n}\n\nexport class VisualizationSDKImpl implements VisualizationSDK {\n hostApi: ExtensionHostApiImpl\n visualizationData?: RawVisualizationData\n _visConfig?: VisualizationConfigImpl\n _queryResponse?: QueryResponseImpl\n\n constructor(hostApi: ExtensionHostApiImpl) {\n this.hostApi = hostApi\n }\n\n updateVisData(visualizationData: RawVisualizationData) {\n this.visualizationData = visualizationData\n if (this._visConfig) {\n this._visConfig.update(this.visualizationData.visConfig)\n }\n if (this._queryResponse) {\n this._queryResponse.update(this.visualizationData.queryResponse)\n }\n }\n\n configureVisualization(options: RawVisConfig): void {\n this.hostApi.send(ExtensionRequestType.VIS_DEFAULT_CONFIG, { options })\n }\n\n get visConfig(): VisualizationConfig {\n if (!this._visConfig) {\n this._visConfig = new VisualizationConfigImpl(\n this.visualizationData?.visConfig\n )\n }\n return this._visConfig\n }\n\n get queryResponse(): QueryResponse {\n if (!this._queryResponse) {\n this._queryResponse = new QueryResponseImpl(\n this.visualizationData?.queryResponse\n )\n }\n return this._queryResponse\n }\n}\n"],"file":"visualization_sdk.js"}
@@ -1,2 +0,0 @@
1
- export * from './types';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/connect/tile/index.ts"],"names":[],"mappings":"AAyBA,cAAc,SAAd","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,98 +0,0 @@
1
- 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; }
2
-
3
- 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; }
4
-
5
- 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; }
6
-
7
- import { ExtensionRequestType } from '../types';
8
- import { DashboardRunState } from './types';
9
- var defaultHostData = {
10
- isEditing: false,
11
- dashboardRunState: DashboardRunState.UNKNOWN,
12
- filters: {}
13
- };
14
- export class TileSDKImpl {
15
- constructor(hostApi) {
16
- _defineProperty(this, "hostApi", void 0);
17
-
18
- _defineProperty(this, "tileHostData", void 0);
19
-
20
- this.hostApi = hostApi;
21
- this.tileHostData = _objectSpread({}, defaultHostData);
22
- }
23
-
24
- tileHostDataChanged(partialHostData) {
25
- this.tileHostData = _objectSpread(_objectSpread({}, this.tileHostData), partialHostData);
26
- }
27
-
28
- addErrors() {
29
- for (var _len = arguments.length, errors = new Array(_len), _key = 0; _key < _len; _key++) {
30
- errors[_key] = arguments[_key];
31
- }
32
-
33
- this.hostApi.send(ExtensionRequestType.TILE_ADD_ERRORS, {
34
- errors
35
- });
36
- }
37
-
38
- clearErrors(group) {
39
- this.hostApi.send(ExtensionRequestType.TILE_CLEAR_ERRORS, {
40
- group
41
- });
42
- }
43
-
44
- trigger(message, config, event) {
45
- this.hostApi.send(ExtensionRequestType.TILE_TRIGGER, {
46
- message,
47
- config,
48
- event: this.sanitizeEvent(event)
49
- });
50
- }
51
-
52
- openDrillMenu(options, event) {
53
- this.hostApi.send(ExtensionRequestType.TILE_OPEN_DRILL_MENU, {
54
- options,
55
- event: this.sanitizeEvent(event)
56
- });
57
- }
58
-
59
- toggleCrossFilter(options, event) {
60
- this.hostApi.send(ExtensionRequestType.TILE_TOGGLE_CROSS_FILTER, {
61
- options,
62
- event: this.sanitizeEvent(event)
63
- });
64
- }
65
-
66
- runDashboard() {
67
- this.hostApi.send(ExtensionRequestType.TILE_RUN_DASHBOARD, {});
68
- }
69
-
70
- stopDashboard() {
71
- this.hostApi.send(ExtensionRequestType.TILE_STOP_DASHBOARD, {});
72
- }
73
-
74
- updateFilters(filters) {
75
- this.hostApi.send(ExtensionRequestType.TILE_UPDATE_FILTERS, {
76
- filters
77
- });
78
- }
79
-
80
- openScheduleDialog() {
81
- return this.hostApi.sendAndReceive(ExtensionRequestType.TILE_OPEN_SCHEDULE_DIALOG, {});
82
- }
83
-
84
- sanitizeEvent(event) {
85
- if (event) {
86
- return {
87
- metaKey: event.metaKey,
88
- pageX: event.pageX,
89
- pageY: event.pageY,
90
- type: event.type
91
- };
92
- }
93
-
94
- return undefined;
95
- }
96
-
97
- }
98
- //# sourceMappingURL=tile_sdk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/connect/tile/tile_sdk.ts"],"names":["ExtensionRequestType","DashboardRunState","defaultHostData","isEditing","dashboardRunState","UNKNOWN","filters","TileSDKImpl","constructor","hostApi","tileHostData","tileHostDataChanged","partialHostData","addErrors","errors","send","TILE_ADD_ERRORS","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","TILE_UPDATE_FILTERS","openScheduleDialog","sendAndReceive","TILE_OPEN_SCHEDULE_DIALOG","metaKey","pageX","pageY","type","undefined"],"mappings":";;;;;;AA2BA,SAASA,oBAAT,QAAqC,UAArC;AAWA,SAASC,iBAAT,QAAkC,SAAlC;AAEA,IAAMC,eAA6B,GAAG;AACpCC,EAAAA,SAAS,EAAE,KADyB;AAEpCC,EAAAA,iBAAiB,EAAEH,iBAAi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,IAAb,CAAkBf,oBAAoB,CAAC8B,wBAAvC,EAAiE;AAC/DH,MAAAA,OAD+D;AAE/DJ,MAAAA,KAAK,EAAE,KAAKE,aAAL,CAAmBF,KAAnB;AAFwD,KAAjE;AAID;;AAEDQ,EAAAA,YAAY,GAAG;AACb,SAAKtB,OAAL,CAAaM,IAAb,CAAkBf,oBAAoB,CAACgC,kBAAvC,EAA2D,EAA3D;AACD;;AAEDC,EAAAA,aAAa,GAAG;AACd,SAAKxB,OAAL,CAAaM,IAAb,CAAkBf,oBAAoB,CAACkC,mBAAvC,EAA4D,EAA5D;AACD;;AAEDC,EAAAA,aAAa,CAAC7B,OAAD,EAAmB;AAC9B,SAAKG,OAAL,CAAaM,IAAb,CAAkBf,oBAAoB,CAACoC,mBAAvC,EAA4D;AAC1D9B,MAAAA;AAD0D,KAA5D;AAGD;;AAED+B,EAAAA,kBAAkB,GAAG;AACnB,WAAO,KAAK5B,OAAL,CAAa6B,cAAb,CACLtC,oBAAoB,CAACuC,yBADhB,EAEL,EAFK,CAAP;AAID;;AAEDd,EAAAA,aAAa,CAACF,KAAD,EAAqB;AAChC,QAAIA,KAAJ,EAAW;AACT,aAAO;AACLiB,QAAAA,OAAO,EAAEjB,KAAK,CAACiB,OADV;AAELC,QAAAA,KAAK,EAAElB,KAAK,CAACkB,KAFR;AAGLC,QAAAA,KAAK,EAAEnB,KAAK,CAACmB,KAHR;AAILC,QAAAA,IAAI,EAAEpB,KAAK,CAACoB;AAJP,OAAP;AAMD;;AACD,WAAOC,SAAP;AACD;;AA1EyC","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 { 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 isEditing: false,\n dashboardRunState: DashboardRunState.UNKNOWN,\n filters: {},\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 this.tileHostData = { ...this.tileHostData, ...partialHostData }\n }\n\n addErrors(...errors: TileError[]) {\n this.hostApi.send(ExtensionRequestType.TILE_ADD_ERRORS, { errors })\n }\n\n clearErrors(group?: string) {\n this.hostApi.send(ExtensionRequestType.TILE_CLEAR_ERRORS, { group })\n }\n\n trigger(message: string, config: TriggerConfig[], event?: MouseEvent) {\n this.hostApi.send(ExtensionRequestType.TILE_TRIGGER, {\n message,\n config,\n event: this.sanitizeEvent(event),\n })\n }\n\n openDrillMenu(options: DrillMenuOptions, event?: MouseEvent) {\n this.hostApi.send(ExtensionRequestType.TILE_OPEN_DRILL_MENU, {\n options,\n event: this.sanitizeEvent(event),\n })\n }\n\n toggleCrossFilter(options: CrossFilterOptions, event?: MouseEvent) {\n this.hostApi.send(ExtensionRequestType.TILE_TOGGLE_CROSS_FILTER, {\n options,\n event: this.sanitizeEvent(event),\n })\n }\n\n runDashboard() {\n this.hostApi.send(ExtensionRequestType.TILE_RUN_DASHBOARD, {})\n }\n\n stopDashboard() {\n this.hostApi.send(ExtensionRequestType.TILE_STOP_DASHBOARD, {})\n }\n\n updateFilters(filters: Filters) {\n this.hostApi.send(ExtensionRequestType.TILE_UPDATE_FILTERS, {\n filters,\n })\n }\n\n openScheduleDialog() {\n return this.hostApi.sendAndReceive(\n ExtensionRequestType.TILE_OPEN_SCHEDULE_DIALOG,\n {}\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,9 +0,0 @@
1
- export var DashboardRunState;
2
-
3
- (function (DashboardRunState) {
4
- DashboardRunState["UNKNOWN"] = "UNKNOWN";
5
- DashboardRunState["LOADED"] = "LOADED";
6
- DashboardRunState["RUNNING"] = "RUNNING";
7
- DashboardRunState["COMPLETE"] = "COMPLETE";
8
- })(DashboardRunState || (DashboardRunState = {}));
9
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/connect/tile/types.ts"],"names":["DashboardRunState"],"mappings":"AAoCA,WAAYA,iBAAZ;;WAAYA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;GAAAA,iB,KAAAA,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\nexport enum DashboardRunState {\n UNKNOWN = 'UNKNOWN',\n LOADED = 'LOADED',\n RUNNING = 'RUNNING',\n COMPLETE = 'COMPLETE',\n}\nexport interface TileHostData {\n isEditing: boolean\n dashboardRunState: DashboardRunState\n filters: Filters\n isCrossFiltersEnabled?: 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) => void\n openScheduleDialog: () => Promise<void>\n}\n"],"file":"types.js"}
@@ -1,3 +0,0 @@
1
- export * from './types';
2
- export * from './visualization_sdk';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/connect/visualization/index.ts"],"names":[],"mappings":"AA0BA,cAAc,SAAd;AACA,cAAc,qBAAd","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,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
@@ -1,149 +0,0 @@
1
- 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; }
2
-
3
- import { ExtensionRequestType } from '../types';
4
-
5
- class QueryResponseImpl {
6
- constructor(queryResponse) {
7
- _defineProperty(this, "_queryResponse", void 0);
8
-
9
- this._queryResponse = queryResponse;
10
- }
11
-
12
- update(queryResponse) {
13
- this._queryResponse = queryResponse;
14
- }
15
-
16
- get fieldMeasures() {
17
- var _this$_queryResponse, _this$_queryResponse$;
18
-
19
- return ((_this$_queryResponse = this._queryResponse) === null || _this$_queryResponse === void 0 ? void 0 : (_this$_queryResponse$ = _this$_queryResponse.fields) === null || _this$_queryResponse$ === void 0 ? void 0 : _this$_queryResponse$.measures) || [];
20
- }
21
-
22
- get fieldDimensions() {
23
- var _this$_queryResponse2, _this$_queryResponse3;
24
-
25
- return ((_this$_queryResponse2 = this._queryResponse) === null || _this$_queryResponse2 === void 0 ? void 0 : (_this$_queryResponse3 = _this$_queryResponse2.fields) === null || _this$_queryResponse3 === void 0 ? void 0 : _this$_queryResponse3.dimensions) || [];
26
- }
27
-
28
- get fieldTableCalculations() {
29
- var _this$_queryResponse4, _this$_queryResponse5;
30
-
31
- return ((_this$_queryResponse4 = this._queryResponse) === null || _this$_queryResponse4 === void 0 ? void 0 : (_this$_queryResponse5 = _this$_queryResponse4.fields) === null || _this$_queryResponse5 === void 0 ? void 0 : _this$_queryResponse5.table_calculations) || [];
32
- }
33
-
34
- get fieldPivots() {
35
- var _this$_queryResponse6, _this$_queryResponse7;
36
-
37
- return ((_this$_queryResponse6 = this._queryResponse) === null || _this$_queryResponse6 === void 0 ? void 0 : (_this$_queryResponse7 = _this$_queryResponse6.fields) === null || _this$_queryResponse7 === void 0 ? void 0 : _this$_queryResponse7.pivots) || [];
38
- }
39
-
40
- get fieldMeasureLike() {
41
- var _this$_queryResponse8, _this$_queryResponse9;
42
-
43
- return ((_this$_queryResponse8 = this._queryResponse) === null || _this$_queryResponse8 === void 0 ? void 0 : (_this$_queryResponse9 = _this$_queryResponse8.fields) === null || _this$_queryResponse9 === void 0 ? void 0 : _this$_queryResponse9.measure_like) || [];
44
- }
45
-
46
- get fieldDimensionLike() {
47
- var _this$_queryResponse10, _this$_queryResponse11;
48
-
49
- return ((_this$_queryResponse10 = this._queryResponse) === null || _this$_queryResponse10 === void 0 ? void 0 : (_this$_queryResponse11 = _this$_queryResponse10.fields) === null || _this$_queryResponse11 === void 0 ? void 0 : _this$_queryResponse11.dimension_like) || [];
50
- }
51
-
52
- get data() {
53
- var _this$_queryResponse12;
54
-
55
- return ((_this$_queryResponse12 = this._queryResponse) === null || _this$_queryResponse12 === void 0 ? void 0 : _this$_queryResponse12.data) || [];
56
- }
57
-
58
- }
59
-
60
- class VisualizationConfigImpl {
61
- constructor(visConfig) {
62
- _defineProperty(this, "_visConfig", void 0);
63
-
64
- this._visConfig = visConfig;
65
- }
66
-
67
- update(visConfig) {
68
- this._visConfig = visConfig;
69
- }
70
-
71
- get queryFieldMeasures() {
72
- var _this$_visConfig, _this$_visConfig$quer;
73
-
74
- return ((_this$_visConfig = this._visConfig) === null || _this$_visConfig === void 0 ? void 0 : (_this$_visConfig$quer = _this$_visConfig.query_fields) === null || _this$_visConfig$quer === void 0 ? void 0 : _this$_visConfig$quer.measures) || [];
75
- }
76
-
77
- get queryFieldDimensions() {
78
- var _this$_visConfig2, _this$_visConfig2$que;
79
-
80
- return ((_this$_visConfig2 = this._visConfig) === null || _this$_visConfig2 === void 0 ? void 0 : (_this$_visConfig2$que = _this$_visConfig2.query_fields) === null || _this$_visConfig2$que === void 0 ? void 0 : _this$_visConfig2$que.dimensions) || [];
81
- }
82
-
83
- get queryFieldTableCalculations() {
84
- var _this$_visConfig3, _this$_visConfig3$que;
85
-
86
- return ((_this$_visConfig3 = this._visConfig) === null || _this$_visConfig3 === void 0 ? void 0 : (_this$_visConfig3$que = _this$_visConfig3.query_fields) === null || _this$_visConfig3$que === void 0 ? void 0 : _this$_visConfig3$que.table_calculations) || [];
87
- }
88
-
89
- get queryFieldPivots() {
90
- var _this$_visConfig4, _this$_visConfig4$que;
91
-
92
- return ((_this$_visConfig4 = this._visConfig) === null || _this$_visConfig4 === void 0 ? void 0 : (_this$_visConfig4$que = _this$_visConfig4.query_fields) === null || _this$_visConfig4$que === void 0 ? void 0 : _this$_visConfig4$que.pivots) || [];
93
- }
94
-
95
- }
96
-
97
- export class VisualizationSDKImpl {
98
- constructor(hostApi) {
99
- _defineProperty(this, "hostApi", void 0);
100
-
101
- _defineProperty(this, "visualizationData", void 0);
102
-
103
- _defineProperty(this, "_visConfig", void 0);
104
-
105
- _defineProperty(this, "_queryResponse", void 0);
106
-
107
- this.hostApi = hostApi;
108
- }
109
-
110
- updateVisData(visualizationData) {
111
- this.visualizationData = visualizationData;
112
-
113
- if (this._visConfig) {
114
- this._visConfig.update(this.visualizationData.visConfig);
115
- }
116
-
117
- if (this._queryResponse) {
118
- this._queryResponse.update(this.visualizationData.queryResponse);
119
- }
120
- }
121
-
122
- configureVisualization(options) {
123
- this.hostApi.send(ExtensionRequestType.VIS_DEFAULT_CONFIG, {
124
- options
125
- });
126
- }
127
-
128
- get visConfig() {
129
- if (!this._visConfig) {
130
- var _this$visualizationDa;
131
-
132
- this._visConfig = new VisualizationConfigImpl((_this$visualizationDa = this.visualizationData) === null || _this$visualizationDa === void 0 ? void 0 : _this$visualizationDa.visConfig);
133
- }
134
-
135
- return this._visConfig;
136
- }
137
-
138
- get queryResponse() {
139
- if (!this._queryResponse) {
140
- var _this$visualizationDa2;
141
-
142
- this._queryResponse = new QueryResponseImpl((_this$visualizationDa2 = this.visualizationData) === null || _this$visualizationDa2 === void 0 ? void 0 : _this$visualizationDa2.queryResponse);
143
- }
144
-
145
- return this._queryResponse;
146
- }
147
-
148
- }
149
- //# sourceMappingURL=visualization_sdk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/connect/visualization/visualization_sdk.ts"],"names":["ExtensionRequestType","QueryResponseImpl","constructor","queryResponse","_queryResponse","update","fieldMeasures","fields","measures","fieldDimensions","dimensions","fieldTableCalculations","table_calculations","fieldPivots","pivots","fieldMeasureLike","measure_like","fieldDimensionLike","dimension_like","data","VisualizationConfigImpl","visConfig","_visConfig","queryFieldMeasures","query_fields","queryFieldDimensions","queryFieldTableCalculations","queryFieldPivots","VisualizationSDKImpl","hostApi","updateVisData","visualizationData","configureVisualization","options","send","VIS_DEFAULT_CONFIG"],"mappings":";;AA2BA,SAASA,oBAAT,QAAqC,UAArC;;AAeA,MAAMC,iBAAN,CAAiD;AAG/CC,EAAAA,WAAW,CAACC,aAAD,EAAsC;AAAA;;AAC/C,SAAKC,cAAL,GAAsBD,aAAtB;AACD;;AAEDE,EAAAA,MAAM,CAACF,aAAD,EAAqC;AACzC,SAAKC,cAAL,GAAsBD,aAAtB;AACD;;AAEgB,MAAbG,aAAa,GAAc;AAAA;;AAC7B,WAAO,8BAAKF,cAAL,uGAAqBG,MAArB,gFAA6BC,QAA7B,KAAyC,EAAhD;AACD;;AAEkB,MAAfC,eAAe,GAAgB;AAAA;;AACjC,WAAO,+BAAKL,cAAL,yGAAqBG,MAArB,gFAA6BG,UAA7B,KAA2C,EAAlD;AACD;;AAEyB,MAAtBC,sBAAsB,GAAuB;AAAA;;AAC/C,WAAO,+BAAKP,cAAL,yGAAqBG,MAArB,gFAA6BK,kBAA7B,KAAmD,EAA1D;AACD;;AAEc,MAAXC,WAAW,GAAkB;AAAA;;AAC/B,WAAO,+BAAKT,cAAL,yGAAqBG,MAArB,gFAA6BO,MAA7B,KAAuC,EAA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ACrD,SAAKA,iBAAL,GAAyBA,iBAAzB;;AACA,QAAI,KAAKT,UAAT,EAAqB;AACnB,WAAKA,UAAL,CAAgBjB,MAAhB,CAAuB,KAAK0B,iBAAL,CAAuBV,SAA9C;AACD;;AACD,QAAI,KAAKjB,cAAT,EAAyB;AACvB,WAAKA,cAAL,CAAoBC,MAApB,CAA2B,KAAK0B,iBAAL,CAAuB5B,aAAlD;AACD;AACF;;AAED6B,EAAAA,sBAAsB,CAACC,OAAD,EAA8B;AAClD,SAAKJ,OAAL,CAAaK,IAAb,CAAkBlC,oBAAoB,CAACmC,kBAAvC,EAA2D;AAAEF,MAAAA;AAAF,KAA3D;AACD;;AAEY,MAATZ,SAAS,GAAwB;AACnC,QAAI,CAAC,KAAKC,UAAV,EAAsB;AAAA;;AACpB,WAAKA,UAAL,GAAkB,IAAIF,uBAAJ,0BAChB,KAAKW,iBADW,0DAChB,sBAAwBV,SADR,CAAlB;AAGD;;AACD,WAAO,KAAKC,UAAZ;AACD;;AAEgB,MAAbnB,aAAa,GAAkB;AACjC,QAAI,CAAC,KAAKC,cAAV,EAA0B;AAAA;;AACxB,WAAKA,cAAL,GAAsB,IAAIH,iBAAJ,2BACpB,KAAK8B,iBADe,2DACpB,uBAAwB5B,aADJ,CAAtB;AAGD;;AACD,WAAO,KAAKC,cAAZ;AACD;;AAxC2D","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 { ExtensionHostApiImpl } from '../extension_host_api'\nimport { ExtensionRequestType } from '../types'\nimport type { Row } from '../tile'\nimport type {\n VisualizationSDK,\n RawVisualizationData,\n RawVisConfig,\n VisualizationConfig,\n QueryResponse,\n Measure,\n Dimension,\n TableCalculation,\n PivotConfig,\n RawVisQueryResponse,\n} from './types'\n\nclass QueryResponseImpl implements QueryResponse {\n _queryResponse?: RawVisQueryResponse\n\n constructor(queryResponse?: RawVisQueryResponse) {\n this._queryResponse = queryResponse\n }\n\n update(queryResponse: RawVisQueryResponse) {\n this._queryResponse = queryResponse\n }\n\n get fieldMeasures(): Measure[] {\n return this._queryResponse?.fields?.measures || []\n }\n\n get fieldDimensions(): Dimension[] {\n return this._queryResponse?.fields?.dimensions || []\n }\n\n get fieldTableCalculations(): TableCalculation[] {\n return this._queryResponse?.fields?.table_calculations || []\n }\n\n get fieldPivots(): PivotConfig[] {\n return this._queryResponse?.fields?.pivots || []\n }\n\n get fieldMeasureLike(): Measure[] {\n return this._queryResponse?.fields?.measure_like || []\n }\n\n get fieldDimensionLike(): Dimension[] {\n return this._queryResponse?.fields?.dimension_like || []\n }\n\n get data(): Row[] {\n return this._queryResponse?.data || []\n }\n}\n\nclass VisualizationConfigImpl implements VisualizationConfig {\n _visConfig?: RawVisConfig\n\n constructor(visConfig?: RawVisConfig) {\n this._visConfig = visConfig\n }\n\n update(visConfig: RawVisConfig) {\n this._visConfig = visConfig\n }\n\n get queryFieldMeasures(): Measure[] {\n return this._visConfig?.query_fields?.measures || []\n }\n\n get queryFieldDimensions(): Dimension[] {\n return this._visConfig?.query_fields?.dimensions || []\n }\n\n get queryFieldTableCalculations(): TableCalculation[] {\n return this._visConfig?.query_fields?.table_calculations || []\n }\n\n get queryFieldPivots(): PivotConfig[] {\n return this._visConfig?.query_fields?.pivots || []\n }\n}\n\nexport class VisualizationSDKImpl implements VisualizationSDK {\n hostApi: ExtensionHostApiImpl\n visualizationData?: RawVisualizationData\n _visConfig?: VisualizationConfigImpl\n _queryResponse?: QueryResponseImpl\n\n constructor(hostApi: ExtensionHostApiImpl) {\n this.hostApi = hostApi\n }\n\n updateVisData(visualizationData: RawVisualizationData) {\n this.visualizationData = visualizationData\n if (this._visConfig) {\n this._visConfig.update(this.visualizationData.visConfig)\n }\n if (this._queryResponse) {\n this._queryResponse.update(this.visualizationData.queryResponse)\n }\n }\n\n configureVisualization(options: RawVisConfig): void {\n this.hostApi.send(ExtensionRequestType.VIS_DEFAULT_CONFIG, { options })\n }\n\n get visConfig(): VisualizationConfig {\n if (!this._visConfig) {\n this._visConfig = new VisualizationConfigImpl(\n this.visualizationData?.visConfig\n )\n }\n return this._visConfig\n }\n\n get queryResponse(): QueryResponse {\n if (!this._queryResponse) {\n this._queryResponse = new QueryResponseImpl(\n this.visualizationData?.queryResponse\n )\n }\n return this._queryResponse\n }\n}\n"],"file":"visualization_sdk.js"}
@@ -1,2 +0,0 @@
1
- export * from './logger';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/util/index.ts"],"names":[],"mappings":"AAyBA,cAAc,UAAd","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport * from './logger'\n"],"file":"index.js"}
@@ -1,18 +0,0 @@
1
- export var logError = function logError(message) {
2
- for (var _len = arguments.length, optionalParams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3
- optionalParams[_key - 1] = arguments[_key];
4
- }
5
-
6
- console.error(message, optionalParams);
7
- };
8
- export var logWarn = function logWarn(message) {
9
- for (var _len2 = arguments.length, optionalParams = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
10
- optionalParams[_key2 - 1] = arguments[_key2];
11
- }
12
-
13
- console.warn(message, optionalParams);
14
- };
15
- export var dummyExtensionSdk = () => {
16
- return 'dummy';
17
- };
18
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/util/logger.ts"],"names":["logError","message","optionalParams","console","error","logWarn","warn","dummyExtensionSdk"],"mappings":"AAyBA,OAAO,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,OAAD,EAA6C;AAAA,oCAA1BC,cAA0B;AAA1BA,IAAAA,cAA0B;AAAA;;AAEnEC,EAAAA,OAAO,CAACC,KAAR,CAAcH,OAAd,EAAuBC,cAAvB;AACD,CAHM;AAKP,OAAO,IAAMG,OAAO,GAAG,SAAVA,OAAU,CAACJ,OAAD,EAA6C;AAAA,qCAA1BC,cAA0B;AAA1BA,IAAAA,cAA0B;AAAA;;AAElEC,EAAAA,OAAO,CAACG,IAAR,CAAaL,OAAb,EAAsBC,cAAtB;AACD,CAHM;AAKP,OAAO,IAAMK,iBAAiB,GAAG,MAAM;AAErC,SAAO,OAAP;AACD,CAHM","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\nexport const logError = (message?: any, ...optionalParams: any[]) => {\n // eslint-disable-next-line no-console\n console.error(message, optionalParams)\n}\n\nexport const logWarn = (message?: any, ...optionalParams: any[]) => {\n // eslint-disable-next-line no-console\n console.warn(message, optionalParams)\n}\n\nexport const dummyExtensionSdk = () => {\n // Force publish - to be deleted\n return 'dummy'\n}\n"],"file":"logger.js"}