@thoughtspot/visual-embed-sdk 1.25.0 → 1.26.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/cjs/package.json +1 -1
- package/cjs/src/auth.spec.js +30 -0
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/config.d.ts.map +1 -1
- package/cjs/src/config.js +3 -0
- package/cjs/src/config.js.map +1 -1
- package/cjs/src/config.spec.js +1 -1
- package/cjs/src/config.spec.js.map +1 -1
- package/cjs/src/types.d.ts +7 -1
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +7 -1
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +1 -0
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +4 -1
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.spec.js +5 -1
- package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +2 -2
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/types.d.ts +7 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +1 -0
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +15 -3
- package/dist/tsembed-react.js +15 -3
- package/dist/tsembed.es.js +15 -3
- package/dist/tsembed.js +15 -3
- package/dist/visual-embed-sdk-react-full.d.ts +8 -1
- package/dist/visual-embed-sdk-react.d.ts +8 -1
- package/dist/visual-embed-sdk.d.ts +8 -1
- package/lib/package.json +1 -1
- package/lib/src/auth.spec.js +30 -0
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/config.d.ts.map +1 -1
- package/lib/src/config.js +3 -0
- package/lib/src/config.js.map +1 -1
- package/lib/src/config.spec.js +1 -1
- package/lib/src/config.spec.js.map +1 -1
- package/lib/src/types.d.ts +7 -1
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +7 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +1 -0
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +4 -1
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js +5 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/lib/src/utils/processData.spec.js +2 -2
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +8 -1
- package/package.json +1 -1
- package/src/auth.spec.ts +33 -1
- package/src/config.spec.ts +1 -1
- package/src/config.ts +3 -0
- package/src/types.ts +7 -1
- package/src/utils/graphql/answerService/answerService.spec.ts +13 -1
- package/src/utils/graphql/answerService/answerService.ts +5 -1
- package/src/utils/processData.spec.ts +2 -2
|
@@ -108,7 +108,7 @@ describe('Answer service tests', () => {
|
|
|
108
108
|
expect(data.data.foo).toBe(1);
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
test('fetchCSVBlob should call the right API',
|
|
111
|
+
test('fetchCSVBlob should call the right API', () => {
|
|
112
112
|
fetchMock.once('Bla');
|
|
113
113
|
const answerService = createAnswerService();
|
|
114
114
|
answerService.fetchCSVBlob(undefined, true);
|
|
@@ -116,6 +116,18 @@ describe('Answer service tests', () => {
|
|
|
116
116
|
`https://tshost/prism/download/answer/csv?sessionId=${defaultSession.sessionId}&genNo=${defaultSession.genNo}&userLocale=en-us&exportFileName=data&hideCsvHeader=false`,
|
|
117
117
|
expect.objectContaining({}),
|
|
118
118
|
);
|
|
119
|
+
|
|
120
|
+
answerService.fetchCSVBlob('en-uk', true);
|
|
121
|
+
expect(fetchMock).toHaveBeenCalledWith(
|
|
122
|
+
`https://tshost/prism/download/answer/csv?sessionId=${defaultSession.sessionId}&genNo=${defaultSession.genNo}&userLocale=en-uk&exportFileName=data&hideCsvHeader=false`,
|
|
123
|
+
expect.objectContaining({}),
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
answerService.fetchCSVBlob(undefined, false);
|
|
127
|
+
expect(fetchMock).toHaveBeenCalledWith(
|
|
128
|
+
`https://tshost/prism/download/answer/csv?sessionId=${defaultSession.sessionId}&genNo=${defaultSession.genNo}&userLocale=en-us&exportFileName=data&hideCsvHeader=true`,
|
|
129
|
+
expect.objectContaining({}),
|
|
130
|
+
);
|
|
119
131
|
});
|
|
120
132
|
|
|
121
133
|
test('getUnderlyingDataForPoint should call the right APIs', async () => {
|
|
@@ -102,12 +102,16 @@ export class AnswerService {
|
|
|
102
102
|
* @returns Response
|
|
103
103
|
*/
|
|
104
104
|
public async fetchCSVBlob(userLocale = 'en-us', includeInfo = false): Promise<Response> {
|
|
105
|
-
const fetchUrl =
|
|
105
|
+
const fetchUrl = this.getFetchCSVBlobUrl(userLocale, includeInfo);
|
|
106
106
|
return fetch(fetchUrl, {
|
|
107
107
|
credentials: 'include',
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
public getFetchCSVBlobUrl(userLocale = 'en-us', includeInfo = false): string {
|
|
112
|
+
return `${this.thoughtSpotHost}/prism/download/answer/csv?sessionId=${this.session.sessionId}&genNo=${this.session.genNo}&userLocale=${userLocale}&exportFileName=data&hideCsvHeader=${!includeInfo}`;
|
|
113
|
+
}
|
|
114
|
+
|
|
111
115
|
/**
|
|
112
116
|
* Get underlying data given a point and the output column names.
|
|
113
117
|
*
|
|
@@ -7,7 +7,7 @@ import { EmbedEvent, AuthType } from '../types';
|
|
|
7
7
|
describe('Unit test for process data', () => {
|
|
8
8
|
beforeAll(() => {
|
|
9
9
|
base.init({
|
|
10
|
-
thoughtSpotHost: '',
|
|
10
|
+
thoughtSpotHost: 'https://tshost',
|
|
11
11
|
authType: AuthType.None,
|
|
12
12
|
});
|
|
13
13
|
});
|
|
@@ -153,7 +153,7 @@ describe('Unit test for process data', () => {
|
|
|
153
153
|
base.init({
|
|
154
154
|
loginFailedMessage: 'Hello',
|
|
155
155
|
autoLogin: true,
|
|
156
|
-
thoughtSpotHost: '',
|
|
156
|
+
thoughtSpotHost: 'https://tshost',
|
|
157
157
|
authType: AuthType.None,
|
|
158
158
|
});
|
|
159
159
|
jest.spyOn(base, 'getEmbedConfig').mockRestore();
|