@sisense/sdk-pivot-query-client 2.17.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 (189) hide show
  1. package/LICENSE.md +35 -0
  2. package/README.md +2 -0
  3. package/dist/__test-helpers__/testUtils.d.ts +30 -0
  4. package/dist/__test-helpers__/testUtils.js +89 -0
  5. package/dist/builders/index.d.ts +2 -0
  6. package/dist/builders/index.js +2 -0
  7. package/dist/builders/pivot-data-builder.d.ts +34 -0
  8. package/dist/builders/pivot-data-builder.js +182 -0
  9. package/dist/builders/socket-builder.d.ts +18 -0
  10. package/dist/builders/socket-builder.js +72 -0
  11. package/dist/cjs/__test-helpers__/testUtils.d.ts +30 -0
  12. package/dist/cjs/__test-helpers__/testUtils.js +104 -0
  13. package/dist/cjs/builders/index.d.ts +2 -0
  14. package/dist/cjs/builders/index.js +7 -0
  15. package/dist/cjs/builders/pivot-data-builder.d.ts +34 -0
  16. package/dist/cjs/builders/pivot-data-builder.js +186 -0
  17. package/dist/cjs/builders/socket-builder.d.ts +18 -0
  18. package/dist/cjs/builders/socket-builder.js +79 -0
  19. package/dist/cjs/data-handling/DataService.d.ts +672 -0
  20. package/dist/cjs/data-handling/DataService.js +1364 -0
  21. package/dist/cjs/data-handling/DivergenceComparator.d.ts +7 -0
  22. package/dist/cjs/data-handling/DivergenceComparator.js +20 -0
  23. package/dist/cjs/data-handling/constants.d.ts +44 -0
  24. package/dist/cjs/data-handling/constants.js +43 -0
  25. package/dist/cjs/data-handling/index.d.ts +3 -0
  26. package/dist/cjs/data-handling/index.js +23 -0
  27. package/dist/cjs/data-handling/types.d.ts +104 -0
  28. package/dist/cjs/data-handling/types.js +2 -0
  29. package/dist/cjs/data-handling/utils/createPivotTreeNode.d.ts +13 -0
  30. package/dist/cjs/data-handling/utils/createPivotTreeNode.js +21 -0
  31. package/dist/cjs/data-handling/utils/index.d.ts +4 -0
  32. package/dist/cjs/data-handling/utils/index.js +14 -0
  33. package/dist/cjs/data-handling/utils/jaqlProcessor.d.ts +122 -0
  34. package/dist/cjs/data-handling/utils/jaqlProcessor.js +661 -0
  35. package/dist/cjs/data-handling/utils/pivotTransforms.d.ts +74 -0
  36. package/dist/cjs/data-handling/utils/pivotTransforms.js +373 -0
  37. package/dist/cjs/data-handling/utils/plugins/PluginService.d.ts +135 -0
  38. package/dist/cjs/data-handling/utils/plugins/PluginService.js +383 -0
  39. package/dist/cjs/data-handling/utils/plugins/getters.d.ts +23 -0
  40. package/dist/cjs/data-handling/utils/plugins/getters.js +70 -0
  41. package/dist/cjs/data-handling/utils/plugins/types.d.ts +75 -0
  42. package/dist/cjs/data-handling/utils/plugins/types.js +2 -0
  43. package/dist/cjs/data-handling/utils/plugins/validator.d.ts +13 -0
  44. package/dist/cjs/data-handling/utils/plugins/validator.js +169 -0
  45. package/dist/cjs/data-load/AbstractDataLoadService.d.ts +256 -0
  46. package/dist/cjs/data-load/AbstractDataLoadService.js +473 -0
  47. package/dist/cjs/data-load/DataLoadService.d.ts +63 -0
  48. package/dist/cjs/data-load/DataLoadService.js +152 -0
  49. package/dist/cjs/data-load/SisenseDataLoadService.d.ts +44 -0
  50. package/dist/cjs/data-load/SisenseDataLoadService.js +87 -0
  51. package/dist/cjs/data-load/TestDataLoadService.d.ts +27 -0
  52. package/dist/cjs/data-load/TestDataLoadService.js +76 -0
  53. package/dist/cjs/data-load/constants.d.ts +13 -0
  54. package/dist/cjs/data-load/constants.js +28 -0
  55. package/dist/cjs/data-load/index.d.ts +6 -0
  56. package/dist/cjs/data-load/index.js +14 -0
  57. package/dist/cjs/data-load/sockets/SisenseSocket.d.ts +81 -0
  58. package/dist/cjs/data-load/sockets/SisenseSocket.js +162 -0
  59. package/dist/cjs/data-load/sockets/TestSocket.d.ts +61 -0
  60. package/dist/cjs/data-load/sockets/TestSocket.js +90 -0
  61. package/dist/cjs/data-load/sockets/helpers.d.ts +4 -0
  62. package/dist/cjs/data-load/sockets/helpers.js +27 -0
  63. package/dist/cjs/data-load/sockets/index.d.ts +2 -0
  64. package/dist/cjs/data-load/sockets/index.js +8 -0
  65. package/dist/cjs/data-load/types.d.ts +90 -0
  66. package/dist/cjs/data-load/types.js +2 -0
  67. package/dist/cjs/errors/LoadingCanceledError.d.ts +7 -0
  68. package/dist/cjs/errors/LoadingCanceledError.js +24 -0
  69. package/dist/cjs/errors/index.d.ts +1 -0
  70. package/dist/cjs/errors/index.js +6 -0
  71. package/dist/cjs/index.d.ts +17 -0
  72. package/dist/cjs/index.js +32 -0
  73. package/dist/cjs/package.json +12 -0
  74. package/dist/cjs/pivot-query-client.d.ts +13 -0
  75. package/dist/cjs/pivot-query-client.js +26 -0
  76. package/dist/cjs/tree-structure/AbstractTreeService.d.ts +308 -0
  77. package/dist/cjs/tree-structure/AbstractTreeService.js +716 -0
  78. package/dist/cjs/tree-structure/HeaderTreeService.d.ts +180 -0
  79. package/dist/cjs/tree-structure/HeaderTreeService.js +280 -0
  80. package/dist/cjs/tree-structure/TreeCellMap.d.ts +104 -0
  81. package/dist/cjs/tree-structure/TreeCellMap.js +145 -0
  82. package/dist/cjs/tree-structure/TreeService.d.ts +8 -0
  83. package/dist/cjs/tree-structure/TreeService.js +12 -0
  84. package/dist/cjs/tree-structure/constants.d.ts +6 -0
  85. package/dist/cjs/tree-structure/constants.js +10 -0
  86. package/dist/cjs/tree-structure/index.d.ts +5 -0
  87. package/dist/cjs/tree-structure/index.js +10 -0
  88. package/dist/cjs/tree-structure/types.d.ts +93 -0
  89. package/dist/cjs/tree-structure/types.js +2 -0
  90. package/dist/cjs/tree-structure/utils/index.d.ts +1 -0
  91. package/dist/cjs/tree-structure/utils/index.js +9 -0
  92. package/dist/cjs/tree-structure/utils/treeNode.d.ts +147 -0
  93. package/dist/cjs/tree-structure/utils/treeNode.js +534 -0
  94. package/dist/cjs/utils/array.d.ts +13 -0
  95. package/dist/cjs/utils/array.js +25 -0
  96. package/dist/cjs/utils/cloneObject.d.ts +30 -0
  97. package/dist/cjs/utils/cloneObject.js +225 -0
  98. package/dist/cjs/utils/index.d.ts +3 -0
  99. package/dist/cjs/utils/index.js +9 -0
  100. package/dist/cjs/utils/throttle.d.ts +12 -0
  101. package/dist/cjs/utils/throttle.js +39 -0
  102. package/dist/cjs/utils/types.d.ts +12 -0
  103. package/dist/cjs/utils/types.js +2 -0
  104. package/dist/data-handling/DataService.d.ts +672 -0
  105. package/dist/data-handling/DataService.js +1357 -0
  106. package/dist/data-handling/DivergenceComparator.d.ts +7 -0
  107. package/dist/data-handling/DivergenceComparator.js +16 -0
  108. package/dist/data-handling/constants.d.ts +44 -0
  109. package/dist/data-handling/constants.js +40 -0
  110. package/dist/data-handling/index.d.ts +3 -0
  111. package/dist/data-handling/index.js +4 -0
  112. package/dist/data-handling/types.d.ts +104 -0
  113. package/dist/data-handling/types.js +1 -0
  114. package/dist/data-handling/utils/createPivotTreeNode.d.ts +13 -0
  115. package/dist/data-handling/utils/createPivotTreeNode.js +17 -0
  116. package/dist/data-handling/utils/index.d.ts +4 -0
  117. package/dist/data-handling/utils/index.js +4 -0
  118. package/dist/data-handling/utils/jaqlProcessor.d.ts +122 -0
  119. package/dist/data-handling/utils/jaqlProcessor.js +621 -0
  120. package/dist/data-handling/utils/pivotTransforms.d.ts +74 -0
  121. package/dist/data-handling/utils/pivotTransforms.js +335 -0
  122. package/dist/data-handling/utils/plugins/PluginService.d.ts +135 -0
  123. package/dist/data-handling/utils/plugins/PluginService.js +379 -0
  124. package/dist/data-handling/utils/plugins/getters.d.ts +23 -0
  125. package/dist/data-handling/utils/plugins/getters.js +65 -0
  126. package/dist/data-handling/utils/plugins/types.d.ts +75 -0
  127. package/dist/data-handling/utils/plugins/types.js +1 -0
  128. package/dist/data-handling/utils/plugins/validator.d.ts +13 -0
  129. package/dist/data-handling/utils/plugins/validator.js +165 -0
  130. package/dist/data-load/AbstractDataLoadService.d.ts +256 -0
  131. package/dist/data-load/AbstractDataLoadService.js +466 -0
  132. package/dist/data-load/DataLoadService.d.ts +63 -0
  133. package/dist/data-load/DataLoadService.js +148 -0
  134. package/dist/data-load/SisenseDataLoadService.d.ts +44 -0
  135. package/dist/data-load/SisenseDataLoadService.js +83 -0
  136. package/dist/data-load/TestDataLoadService.d.ts +27 -0
  137. package/dist/data-load/TestDataLoadService.js +69 -0
  138. package/dist/data-load/constants.d.ts +13 -0
  139. package/dist/data-load/constants.js +25 -0
  140. package/dist/data-load/index.d.ts +6 -0
  141. package/dist/data-load/index.js +6 -0
  142. package/dist/data-load/sockets/SisenseSocket.d.ts +81 -0
  143. package/dist/data-load/sockets/SisenseSocket.js +155 -0
  144. package/dist/data-load/sockets/TestSocket.d.ts +61 -0
  145. package/dist/data-load/sockets/TestSocket.js +83 -0
  146. package/dist/data-load/sockets/helpers.d.ts +4 -0
  147. package/dist/data-load/sockets/helpers.js +23 -0
  148. package/dist/data-load/sockets/index.d.ts +2 -0
  149. package/dist/data-load/sockets/index.js +3 -0
  150. package/dist/data-load/types.d.ts +90 -0
  151. package/dist/data-load/types.js +1 -0
  152. package/dist/errors/LoadingCanceledError.d.ts +7 -0
  153. package/dist/errors/LoadingCanceledError.js +20 -0
  154. package/dist/errors/index.d.ts +1 -0
  155. package/dist/errors/index.js +2 -0
  156. package/dist/index.d.ts +17 -0
  157. package/dist/index.js +9 -0
  158. package/dist/pivot-query-client.d.ts +13 -0
  159. package/dist/pivot-query-client.js +22 -0
  160. package/dist/tree-structure/AbstractTreeService.d.ts +308 -0
  161. package/dist/tree-structure/AbstractTreeService.js +712 -0
  162. package/dist/tree-structure/HeaderTreeService.d.ts +180 -0
  163. package/dist/tree-structure/HeaderTreeService.js +276 -0
  164. package/dist/tree-structure/TreeCellMap.d.ts +104 -0
  165. package/dist/tree-structure/TreeCellMap.js +141 -0
  166. package/dist/tree-structure/TreeService.d.ts +8 -0
  167. package/dist/tree-structure/TreeService.js +8 -0
  168. package/dist/tree-structure/constants.d.ts +6 -0
  169. package/dist/tree-structure/constants.js +7 -0
  170. package/dist/tree-structure/index.d.ts +5 -0
  171. package/dist/tree-structure/index.js +4 -0
  172. package/dist/tree-structure/types.d.ts +93 -0
  173. package/dist/tree-structure/types.js +1 -0
  174. package/dist/tree-structure/utils/index.d.ts +1 -0
  175. package/dist/tree-structure/utils/index.js +1 -0
  176. package/dist/tree-structure/utils/treeNode.d.ts +147 -0
  177. package/dist/tree-structure/utils/treeNode.js +515 -0
  178. package/dist/tsconfig.prod.cjs.tsbuildinfo +1 -0
  179. package/dist/utils/array.d.ts +13 -0
  180. package/dist/utils/array.js +21 -0
  181. package/dist/utils/cloneObject.d.ts +30 -0
  182. package/dist/utils/cloneObject.js +221 -0
  183. package/dist/utils/index.d.ts +3 -0
  184. package/dist/utils/index.js +3 -0
  185. package/dist/utils/throttle.d.ts +12 -0
  186. package/dist/utils/throttle.js +35 -0
  187. package/dist/utils/types.d.ts +12 -0
  188. package/dist/utils/types.js +1 -0
  189. package/package.json +61 -0
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TestSocket = void 0;
7
+ const events_1 = __importDefault(require("events"));
8
+ class TestSocket {
9
+ constructor() {
10
+ /** @private */
11
+ this.ready = true;
12
+ this.events = new events_1.default();
13
+ this.ready = true;
14
+ }
15
+ /**
16
+ * Checks if socket is ready for sending messages or not
17
+ *
18
+ * @returns {boolean} - true - ready
19
+ */
20
+ isReady() {
21
+ return this.ready;
22
+ }
23
+ /**
24
+ * Attach event handler
25
+ *
26
+ * @param {string} event - event name
27
+ * @param {Function} cb - handler function
28
+ * @returns {void}
29
+ */
30
+ on(event, cb) {
31
+ this.events.on(event, cb);
32
+ }
33
+ /**
34
+ * Detach event handler
35
+ *
36
+ * @param {string} event - event name
37
+ * @param {Function} cb - handler function
38
+ * @returns {void}
39
+ */
40
+ off(event, cb) {
41
+ this.events.removeListener(event, cb);
42
+ }
43
+ /**
44
+ * Send message via socket
45
+ *
46
+ * @param {string} event - message name
47
+ * @param {Array<any>} args - arguments
48
+ * @param {Array<any>} args.0 - message data
49
+ * @returns {void}
50
+ */
51
+ send(event, ...args) {
52
+ const noUsed = event || args;
53
+ this.ready = !!noUsed || true;
54
+ }
55
+ /**
56
+ * Specific message handler
57
+ *
58
+ * @param {string} type - message type
59
+ * @param {string} subType - message subtype (query ID)
60
+ * @param {Function} callback - handler function
61
+ * @returns {Function} - unsubscribe function
62
+ */
63
+ onMessage(type, subType, callback) {
64
+ this.onMessageCallback = callback;
65
+ const handler = () => { };
66
+ this.on('message', handler);
67
+ return () => {
68
+ this.off('message', handler);
69
+ };
70
+ }
71
+ /**
72
+ * Emulate receiving message from socket
73
+ *
74
+ * @param {string} event - message type
75
+ * @param {any} data - message data
76
+ * @returns {Promise} - waiting promise
77
+ */
78
+ trigger(event, data) {
79
+ return new Promise((resolve) => {
80
+ setTimeout(() => {
81
+ if (this.onMessageCallback) {
82
+ this.onMessageCallback(event, data);
83
+ }
84
+ resolve();
85
+ }, 10);
86
+ });
87
+ }
88
+ }
89
+ exports.TestSocket = TestSocket;
90
+ exports.default = TestSocket;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Prepare data for CSRF response
3
+ */
4
+ export declare function getCsrfResponseData(): {};
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCsrfResponseData = void 0;
4
+ /**
5
+ * Get XSRF token from `document.cookie`
6
+ */
7
+ function getCsrfToken(cookie = document.cookie) {
8
+ const csrfCookieName = 'XSRF-TOKEN';
9
+ const match = cookie.match(new RegExp(`(^| )${csrfCookieName}=([^;]+)`));
10
+ if (match !== null && match[2]) {
11
+ return match[2];
12
+ }
13
+ return null;
14
+ }
15
+ /**
16
+ * Prepare data for CSRF response
17
+ */
18
+ function getCsrfResponseData() {
19
+ const csrfToken = getCsrfToken();
20
+ const data = {};
21
+ // The CSRF token is optional, but the domain needs to be added to the whitelist to pass the check without a token
22
+ if (csrfToken) {
23
+ data['X-XSRF-TOKEN'] = csrfToken;
24
+ }
25
+ return data;
26
+ }
27
+ exports.getCsrfResponseData = getCsrfResponseData;
@@ -0,0 +1,2 @@
1
+ export { SisenseSocket } from './SisenseSocket.js';
2
+ export { TestSocket } from './TestSocket.js';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TestSocket = exports.SisenseSocket = void 0;
4
+ /* eslint-disable import/prefer-default-export */
5
+ var SisenseSocket_js_1 = require("./SisenseSocket.js");
6
+ Object.defineProperty(exports, "SisenseSocket", { enumerable: true, get: function () { return SisenseSocket_js_1.SisenseSocket; } });
7
+ var TestSocket_js_1 = require("./TestSocket.js");
8
+ Object.defineProperty(exports, "TestSocket", { enumerable: true, get: function () { return TestSocket_js_1.TestSocket; } });
@@ -0,0 +1,90 @@
1
+ import { type BaseJaql } from '@sisense/sdk-data';
2
+ export declare type MeasurePath = {
3
+ [key: string]: string;
4
+ };
5
+ export declare type SortDetails = {
6
+ field?: number;
7
+ initialized?: boolean;
8
+ sortingLastDimension?: boolean;
9
+ measurePath?: MeasurePath | null;
10
+ dir: string | null;
11
+ isLastApplied?: boolean;
12
+ };
13
+ export declare type Jaql = Omit<BaseJaql, 'sort'> & {
14
+ sortDetails?: SortDetails;
15
+ type?: string;
16
+ sort?: BaseJaql['sort'] | null;
17
+ };
18
+ export declare type JaqlPanel = {
19
+ jaql: Jaql;
20
+ panel: string;
21
+ field?: {
22
+ id?: string;
23
+ index?: number;
24
+ };
25
+ disabled?: boolean;
26
+ hierarchies?: Array<string>;
27
+ format?: {
28
+ subtotal?: boolean;
29
+ width?: number;
30
+ databars?: boolean;
31
+ color?: {
32
+ type: string;
33
+ color?: string;
34
+ conditions?: Array<{
35
+ color: string;
36
+ operator: string;
37
+ expression: string | Record<string, any>;
38
+ }>;
39
+ };
40
+ };
41
+ };
42
+ export declare type JaqlDatasource = {
43
+ id: string;
44
+ title: string;
45
+ address: string;
46
+ database: string;
47
+ fullname: string;
48
+ lastBuildTime: string;
49
+ };
50
+ export declare type JaqlRequest = {
51
+ datasource?: JaqlDatasource;
52
+ metadata: Array<JaqlPanel>;
53
+ queryGuid?: string;
54
+ grandTotals?: null | {
55
+ title: string;
56
+ columns?: boolean;
57
+ rows?: boolean;
58
+ };
59
+ };
60
+ export interface DataLoadServiceI {
61
+ clone(): DataLoadServiceI;
62
+ load(jaql: JaqlRequest): Promise<any>;
63
+ getJaql(): JaqlRequest | undefined;
64
+ isSingleRowTree(): boolean;
65
+ getTotalItemsCount(): number;
66
+ clear(): void;
67
+ on(eventName: string, callback: (payload: any) => void): void;
68
+ off(eventName: string, callback: (payload: any) => void): void;
69
+ offAll(eventName: string): void;
70
+ listenerCount(eventName: string): number;
71
+ emit(eventName: string, ...rest: Array<any>): void;
72
+ isFormattingChanges(jaql?: JaqlRequest, isLimited?: boolean): boolean;
73
+ hasData(): boolean;
74
+ hasError(): boolean;
75
+ destroy(): void;
76
+ cancelQuery(): Promise<void>;
77
+ }
78
+ export interface SocketI {
79
+ isReady(): boolean;
80
+ on(event: string, cb: Function): void;
81
+ off(event: string, cb: Function): void;
82
+ onMessage(type: string | undefined, subType: string | undefined, callback: (type: string, data: any) => void): () => void;
83
+ send(event: string, ...args: any[]): void;
84
+ trigger(event: string, data: any): any;
85
+ }
86
+ export interface SocketQueryOptions {
87
+ token?: string;
88
+ authorization?: string;
89
+ initialiser?: string;
90
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Using for canceling query promises
3
+ */
4
+ export declare class LoadingCanceledError extends Error {
5
+ constructor(message?: string | undefined);
6
+ }
7
+ export default LoadingCanceledError;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /* eslint-disable import/prefer-default-export, no-proto */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.LoadingCanceledError = void 0;
5
+ /**
6
+ * Using for canceling query promises
7
+ */
8
+ class LoadingCanceledError extends Error {
9
+ constructor(message = 'Loading canceled') {
10
+ super(message);
11
+ this.name = 'LoadingCanceledError';
12
+ // restore prototype chain
13
+ const actualProto = new.target.prototype;
14
+ if (Object.setPrototypeOf) {
15
+ Object.setPrototypeOf(this, actualProto);
16
+ }
17
+ else {
18
+ // TODO review this
19
+ // this.__proto__ = actualProto;
20
+ }
21
+ }
22
+ }
23
+ exports.LoadingCanceledError = LoadingCanceledError;
24
+ exports.default = LoadingCanceledError;
@@ -0,0 +1 @@
1
+ export { LoadingCanceledError } from './LoadingCanceledError.js';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoadingCanceledError = void 0;
4
+ /* eslint-disable import/prefer-default-export */
5
+ var LoadingCanceledError_js_1 = require("./LoadingCanceledError.js");
6
+ Object.defineProperty(exports, "LoadingCanceledError", { enumerable: true, get: function () { return LoadingCanceledError_js_1.LoadingCanceledError; } });
@@ -0,0 +1,17 @@
1
+ export { type TreeServiceI } from './tree-structure/types.js';
2
+ export { type TreeNode, type ColumnsCount, type TreeNodeMetadata } from './tree-structure/types.js';
3
+ export { type SocketI, type JaqlRequest, type JaqlPanel, type Jaql, type SortDetails, } from './data-load/types.js';
4
+ export { EVENT_DATA_CELL_FORMAT, EVENT_HEADER_CELL_FORMAT, EVENT_DATA_CHUNK_LOADED, EVENT_GRAND_CHUNK_LOADED, EVENT_PROGRESS_ERROR, EVENT_TOTAL_COLUMNS_COUNT, EVENT_TOTAL_ROWS_COUNT, DataService, } from './data-handling/DataService.js';
5
+ export { UserType, PanelType, SortingDirection, JaqlDataType } from './data-handling/constants.js';
6
+ export type { ListOfSortingDirections, ListOfJaqlDataTypes } from './data-handling/constants.js';
7
+ export { PivotQueryClient } from './pivot-query-client.js';
8
+ export { SocketBuilder } from './builders/socket-builder.js';
9
+ export { SisenseDataLoadService } from './data-load/SisenseDataLoadService.js';
10
+ export type { AllDataInfo, DataServiceI, InitPageData, PivotTreeNode, PivotDataNode, } from './data-handling/types.js';
11
+ export { createPivotTreeNode, jaqlProcessor } from './data-handling/utils/index.js';
12
+ export { LoadingCanceledError } from './errors/index.js';
13
+ export { treeNode } from './tree-structure/utils/index.js';
14
+ export { Position } from './tree-structure/constants.js';
15
+ export type { Metadata } from './data-handling/utils/plugins/types.js';
16
+ export type { SortingSettingsItem } from './data-handling/utils/jaqlProcessor.js';
17
+ export type { InputStyles } from './utils/types.js';
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Position = exports.treeNode = exports.LoadingCanceledError = exports.jaqlProcessor = exports.createPivotTreeNode = exports.SisenseDataLoadService = exports.SocketBuilder = exports.PivotQueryClient = exports.JaqlDataType = exports.SortingDirection = exports.PanelType = exports.UserType = exports.DataService = exports.EVENT_TOTAL_ROWS_COUNT = exports.EVENT_TOTAL_COLUMNS_COUNT = exports.EVENT_PROGRESS_ERROR = exports.EVENT_GRAND_CHUNK_LOADED = exports.EVENT_DATA_CHUNK_LOADED = exports.EVENT_HEADER_CELL_FORMAT = exports.EVENT_DATA_CELL_FORMAT = void 0;
4
+ var DataService_js_1 = require("./data-handling/DataService.js");
5
+ Object.defineProperty(exports, "EVENT_DATA_CELL_FORMAT", { enumerable: true, get: function () { return DataService_js_1.EVENT_DATA_CELL_FORMAT; } });
6
+ Object.defineProperty(exports, "EVENT_HEADER_CELL_FORMAT", { enumerable: true, get: function () { return DataService_js_1.EVENT_HEADER_CELL_FORMAT; } });
7
+ Object.defineProperty(exports, "EVENT_DATA_CHUNK_LOADED", { enumerable: true, get: function () { return DataService_js_1.EVENT_DATA_CHUNK_LOADED; } });
8
+ Object.defineProperty(exports, "EVENT_GRAND_CHUNK_LOADED", { enumerable: true, get: function () { return DataService_js_1.EVENT_GRAND_CHUNK_LOADED; } });
9
+ Object.defineProperty(exports, "EVENT_PROGRESS_ERROR", { enumerable: true, get: function () { return DataService_js_1.EVENT_PROGRESS_ERROR; } });
10
+ Object.defineProperty(exports, "EVENT_TOTAL_COLUMNS_COUNT", { enumerable: true, get: function () { return DataService_js_1.EVENT_TOTAL_COLUMNS_COUNT; } });
11
+ Object.defineProperty(exports, "EVENT_TOTAL_ROWS_COUNT", { enumerable: true, get: function () { return DataService_js_1.EVENT_TOTAL_ROWS_COUNT; } });
12
+ Object.defineProperty(exports, "DataService", { enumerable: true, get: function () { return DataService_js_1.DataService; } });
13
+ var constants_js_1 = require("./data-handling/constants.js");
14
+ Object.defineProperty(exports, "UserType", { enumerable: true, get: function () { return constants_js_1.UserType; } });
15
+ Object.defineProperty(exports, "PanelType", { enumerable: true, get: function () { return constants_js_1.PanelType; } });
16
+ Object.defineProperty(exports, "SortingDirection", { enumerable: true, get: function () { return constants_js_1.SortingDirection; } });
17
+ Object.defineProperty(exports, "JaqlDataType", { enumerable: true, get: function () { return constants_js_1.JaqlDataType; } });
18
+ var pivot_query_client_js_1 = require("./pivot-query-client.js");
19
+ Object.defineProperty(exports, "PivotQueryClient", { enumerable: true, get: function () { return pivot_query_client_js_1.PivotQueryClient; } });
20
+ var socket_builder_js_1 = require("./builders/socket-builder.js");
21
+ Object.defineProperty(exports, "SocketBuilder", { enumerable: true, get: function () { return socket_builder_js_1.SocketBuilder; } });
22
+ var SisenseDataLoadService_js_1 = require("./data-load/SisenseDataLoadService.js");
23
+ Object.defineProperty(exports, "SisenseDataLoadService", { enumerable: true, get: function () { return SisenseDataLoadService_js_1.SisenseDataLoadService; } });
24
+ var index_js_1 = require("./data-handling/utils/index.js");
25
+ Object.defineProperty(exports, "createPivotTreeNode", { enumerable: true, get: function () { return index_js_1.createPivotTreeNode; } });
26
+ Object.defineProperty(exports, "jaqlProcessor", { enumerable: true, get: function () { return index_js_1.jaqlProcessor; } });
27
+ var index_js_2 = require("./errors/index.js");
28
+ Object.defineProperty(exports, "LoadingCanceledError", { enumerable: true, get: function () { return index_js_2.LoadingCanceledError; } });
29
+ var index_js_3 = require("./tree-structure/utils/index.js");
30
+ Object.defineProperty(exports, "treeNode", { enumerable: true, get: function () { return index_js_3.treeNode; } });
31
+ var constants_js_2 = require("./tree-structure/constants.js");
32
+ Object.defineProperty(exports, "Position", { enumerable: true, get: function () { return constants_js_2.Position; } });
@@ -0,0 +1,12 @@
1
+ {
2
+ "main": "./index.js",
3
+ "module": "./index.js",
4
+ "types": "./index.d.ts",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./index.d.ts",
8
+ "require": "./index.js",
9
+ "default": "./index.js"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,13 @@
1
+ import { PivotQueryResultData } from '@sisense/sdk-data';
2
+ import { Authenticator } from '@sisense/sdk-rest-client';
3
+ import { SocketBuilder } from './builders/index.js';
4
+ import { JaqlRequest } from './data-load/types.js';
5
+ export declare class PivotQueryClient {
6
+ /**
7
+ * Builder to create on demand a web socket to the Sisense instance
8
+ * Required by the pivot table service
9
+ */
10
+ socketBuilder: SocketBuilder;
11
+ constructor(url: string, auth: Authenticator, mockSocket?: boolean);
12
+ queryData(jaql: JaqlRequest, isPaginated: boolean, elementsPerPage: number, useCache: boolean): Promise<PivotQueryResultData>;
13
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PivotQueryClient = void 0;
13
+ const sdk_common_1 = require("@sisense/sdk-common");
14
+ const index_js_1 = require("./builders/index.js");
15
+ class PivotQueryClient {
16
+ constructor(url, auth, mockSocket = false) {
17
+ this.socketBuilder = new index_js_1.SocketBuilder((0, sdk_common_1.normalizeUrl)(url), auth, mockSocket);
18
+ }
19
+ queryData(jaql, isPaginated, elementsPerPage, useCache) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const pivotDataBuilder = new index_js_1.PivotDataBuilder(this.socketBuilder.socket);
22
+ return pivotDataBuilder.loadInitData(jaql, isPaginated, elementsPerPage, useCache);
23
+ });
24
+ }
25
+ }
26
+ exports.PivotQueryClient = PivotQueryClient;