@thoughtspot/visual-embed-sdk 1.26.1 → 1.26.2
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 +2 -2
- package/cjs/src/auth.d.ts +0 -12
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +16 -54
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/auth.spec.d.ts.map +1 -1
- package/cjs/src/auth.spec.js +42 -32
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/authToken.d.ts +4 -0
- package/cjs/src/authToken.d.ts.map +1 -0
- package/cjs/src/authToken.js +61 -0
- package/cjs/src/authToken.js.map +1 -0
- package/cjs/src/embed/TsEmbed.d.ts +302 -0
- package/cjs/src/embed/TsEmbed.d.ts.map +1 -0
- package/cjs/src/embed/TsEmbed.js +851 -0
- package/cjs/src/embed/TsEmbed.js.map +1 -0
- package/cjs/src/embed/base.d.ts +0 -9
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +21 -44
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/base.spec.js +15 -14
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.d.ts +18 -0
- package/cjs/src/embed/embedConfig.d.ts.map +1 -0
- package/cjs/src/embed/embedConfig.js +25 -0
- package/cjs/src/embed/embedConfig.js.map +1 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +3 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js +3 -2
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +5 -3
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +58 -49
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +2 -1
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/tokenizedFetch.d.ts +2 -0
- package/cjs/src/tokenizedFetch.d.ts.map +1 -0
- package/cjs/src/tokenizedFetch.js +20 -0
- package/cjs/src/tokenizedFetch.js.map +1 -0
- package/cjs/src/types.d.ts +6 -0
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/answerService.d.ts +10 -0
- package/cjs/src/utils/answerService.d.ts.map +1 -0
- package/cjs/src/utils/answerService.js +61 -0
- package/cjs/src/utils/answerService.js.map +1 -0
- package/cjs/src/utils/answerService.spec.d.ts +2 -0
- package/cjs/src/utils/answerService.spec.d.ts.map +1 -0
- package/cjs/src/utils/answerService.spec.js +31 -0
- package/cjs/src/utils/answerService.spec.js.map +1 -0
- package/cjs/src/utils/authService/authService.d.ts +45 -0
- package/cjs/src/utils/authService/authService.d.ts.map +1 -0
- package/cjs/src/utils/authService/authService.js +115 -0
- package/cjs/src/utils/authService/authService.js.map +1 -0
- package/cjs/src/utils/authService/authService.spec.d.ts +2 -0
- package/cjs/src/utils/authService/authService.spec.d.ts.map +1 -0
- package/cjs/src/utils/authService/authService.spec.js +82 -0
- package/cjs/src/utils/authService/authService.spec.js.map +1 -0
- package/cjs/src/utils/authService/index.d.ts +3 -0
- package/cjs/src/utils/authService/index.d.ts.map +1 -0
- package/cjs/src/utils/authService/index.js +14 -0
- package/cjs/src/utils/authService/index.js.map +1 -0
- package/cjs/src/utils/authService/tokenisedAuthSerice.d.ts +11 -0
- package/cjs/src/utils/authService/tokenisedAuthSerice.d.ts.map +1 -0
- package/cjs/src/utils/authService/tokenisedAuthSerice.js +44 -0
- package/cjs/src/utils/authService/tokenisedAuthSerice.js.map +1 -0
- package/cjs/src/utils/authService/tokenizedAuthService.d.ts +11 -0
- package/cjs/src/utils/authService/tokenizedAuthService.d.ts.map +1 -0
- package/cjs/src/utils/authService/tokenizedAuthService.js +44 -0
- package/cjs/src/utils/authService/tokenizedAuthService.js.map +1 -0
- package/cjs/src/utils/authService.d.ts +12 -1
- package/cjs/src/utils/authService.d.ts.map +1 -1
- package/cjs/src/utils/authService.js +32 -16
- package/cjs/src/utils/authService.js.map +1 -1
- package/cjs/src/utils/authService.spec.js +3 -4
- package/cjs/src/utils/authService.spec.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +2 -1
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.spec.js +15 -3
- package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/cjs/src/utils/graphql/graphql-request.spec.d.ts +2 -0
- package/cjs/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
- package/cjs/src/utils/graphql/graphql-request.spec.js +39 -0
- package/cjs/src/utils/graphql/graphql-request.spec.js.map +1 -0
- package/cjs/src/utils/logger.d.ts +28 -0
- package/cjs/src/utils/logger.d.ts.map +1 -0
- package/cjs/src/utils/logger.js +82 -0
- package/cjs/src/utils/logger.js.map +1 -0
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +5 -4
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +8 -7
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/dist/src/auth.d.ts +0 -12
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/auth.spec.d.ts.map +1 -1
- package/dist/src/authToken.d.ts +4 -0
- package/dist/src/authToken.d.ts.map +1 -0
- package/dist/src/embed/base.d.ts +0 -9
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/embedConfig.d.ts +18 -0
- package/dist/src/embed/embedConfig.d.ts.map +1 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/tokenizedFetch.d.ts +2 -0
- package/dist/src/tokenizedFetch.d.ts.map +1 -0
- package/dist/src/types.d.ts +6 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/answerService.d.ts +10 -0
- package/dist/src/utils/answerService.d.ts.map +1 -0
- package/dist/src/utils/answerService.spec.d.ts +2 -0
- package/dist/src/utils/answerService.spec.d.ts.map +1 -0
- package/dist/src/utils/authService/authService.d.ts +45 -0
- package/dist/src/utils/authService/authService.d.ts.map +1 -0
- package/dist/src/utils/authService/authService.spec.d.ts +2 -0
- package/dist/src/utils/authService/authService.spec.d.ts.map +1 -0
- package/dist/src/utils/authService/index.d.ts +3 -0
- package/dist/src/utils/authService/index.d.ts.map +1 -0
- package/dist/src/utils/authService/tokenisedAuthSerice.d.ts +11 -0
- package/dist/src/utils/authService/tokenisedAuthSerice.d.ts.map +1 -0
- package/dist/src/utils/authService/tokenizedAuthService.d.ts +11 -0
- package/dist/src/utils/authService/tokenizedAuthService.d.ts.map +1 -0
- package/dist/src/utils/authService.d.ts +12 -1
- package/dist/src/utils/authService.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils/graphql/graphql-request.spec.d.ts +2 -0
- package/dist/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
- package/dist/src/utils/logger.d.ts +28 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +201 -140
- package/dist/tsembed-react.js +201 -140
- package/dist/tsembed.es.js +230 -171
- package/dist/tsembed.js +230 -171
- package/dist/visual-embed-sdk-react-full.d.ts +23 -21
- package/dist/visual-embed-sdk-react.d.ts +23 -21
- package/dist/visual-embed-sdk.d.ts +23 -21
- package/lib/package.json +2 -2
- package/lib/src/auth.d.ts +0 -12
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +11 -48
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.d.ts.map +1 -1
- package/lib/src/auth.spec.js +42 -32
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/authToken.d.ts +4 -0
- package/lib/src/authToken.d.ts.map +1 -0
- package/lib/src/authToken.js +56 -0
- package/lib/src/authToken.js.map +1 -0
- package/lib/src/embed/TsEmbed.d.ts +302 -0
- package/lib/src/embed/TsEmbed.d.ts.map +1 -0
- package/lib/src/embed/TsEmbed.js +847 -0
- package/lib/src/embed/TsEmbed.js.map +1 -0
- package/lib/src/embed/base.d.ts +0 -9
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +21 -43
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +15 -14
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.d.ts +18 -0
- package/lib/src/embed/embedConfig.d.ts.map +1 -0
- package/lib/src/embed/embedConfig.js +20 -0
- package/lib/src/embed/embedConfig.js.map +1 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +4 -2
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.js +3 -2
- package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +4 -2
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +58 -49
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/tokenizedFetch.d.ts +2 -0
- package/lib/src/tokenizedFetch.d.ts.map +1 -0
- package/lib/src/tokenizedFetch.js +16 -0
- package/lib/src/tokenizedFetch.js.map +1 -0
- package/lib/src/types.d.ts +6 -0
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/answerService.d.ts +10 -0
- package/lib/src/utils/answerService.d.ts.map +1 -0
- package/lib/src/utils/answerService.js +57 -0
- package/lib/src/utils/answerService.js.map +1 -0
- package/lib/src/utils/answerService.spec.d.ts +2 -0
- package/lib/src/utils/answerService.spec.d.ts.map +1 -0
- package/lib/src/utils/answerService.spec.js +29 -0
- package/lib/src/utils/answerService.spec.js.map +1 -0
- package/lib/src/utils/authService/authService.d.ts +45 -0
- package/lib/src/utils/authService/authService.d.ts.map +1 -0
- package/lib/src/utils/authService/authService.js +107 -0
- package/lib/src/utils/authService/authService.js.map +1 -0
- package/lib/src/utils/authService/authService.spec.d.ts +2 -0
- package/lib/src/utils/authService/authService.spec.d.ts.map +1 -0
- package/lib/src/utils/authService/authService.spec.js +80 -0
- package/lib/src/utils/authService/authService.spec.js.map +1 -0
- package/lib/src/utils/authService/index.d.ts +3 -0
- package/lib/src/utils/authService/index.d.ts.map +1 -0
- package/lib/src/utils/authService/index.js +3 -0
- package/lib/src/utils/authService/index.js.map +1 -0
- package/lib/src/utils/authService/tokenisedAuthSerice.d.ts +11 -0
- package/lib/src/utils/authService/tokenisedAuthSerice.d.ts.map +1 -0
- package/lib/src/utils/authService/tokenisedAuthSerice.js +39 -0
- package/lib/src/utils/authService/tokenisedAuthSerice.js.map +1 -0
- package/lib/src/utils/authService/tokenizedAuthService.d.ts +11 -0
- package/lib/src/utils/authService/tokenizedAuthService.d.ts.map +1 -0
- package/lib/src/utils/authService/tokenizedAuthService.js +39 -0
- package/lib/src/utils/authService/tokenizedAuthService.js.map +1 -0
- package/lib/src/utils/authService.d.ts +12 -1
- package/lib/src/utils/authService.d.ts.map +1 -1
- package/lib/src/utils/authService.js +26 -10
- package/lib/src/utils/authService.js.map +1 -1
- package/lib/src/utils/authService.spec.js +1 -2
- package/lib/src/utils/authService.spec.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +2 -1
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js +14 -3
- package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/lib/src/utils/graphql/graphql-request.spec.d.ts +2 -0
- package/lib/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
- package/lib/src/utils/graphql/graphql-request.spec.js +36 -0
- package/lib/src/utils/graphql/graphql-request.spec.js.map +1 -0
- package/lib/src/utils/logger.d.ts +28 -0
- package/lib/src/utils/logger.d.ts.map +1 -0
- package/lib/src/utils/logger.js +75 -0
- package/lib/src/utils/logger.js.map +1 -0
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +4 -3
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js +8 -7
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +28 -22
- package/package.json +2 -2
- package/src/auth.spec.ts +77 -63
- package/src/auth.ts +12 -55
- package/src/authToken.ts +66 -0
- package/src/embed/base.spec.ts +18 -17
- package/src/embed/base.ts +26 -51
- package/src/embed/embedConfig.ts +23 -0
- package/src/embed/search.ts +10 -10
- package/src/embed/searchEmbed-basic-auth.spec.ts +3 -2
- package/src/embed/ts-embed.spec.ts +87 -75
- package/src/embed/ts-embed.ts +11 -20
- package/src/index.ts +8 -2
- package/src/tokenizedFetch.ts +18 -0
- package/src/types.ts +34 -23
- package/src/utils/{authService.spec.ts → authService/authService.spec.ts} +2 -3
- package/src/utils/{authService.ts → authService/authService.ts} +29 -34
- package/src/utils/authService/index.ts +9 -0
- package/src/utils/authService/tokenizedAuthService.ts +40 -0
- package/src/utils/graphql/answerService/answerService.spec.ts +16 -4
- package/src/utils/graphql/answerService/answerService.ts +2 -1
- package/src/utils/processData.spec.ts +19 -16
- package/src/utils/processData.ts +3 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as processDataInstance from './processData';
|
|
2
2
|
import * as auth from '../auth';
|
|
3
3
|
import * as base from '../embed/base';
|
|
4
|
+
import * as embedConfigInstance from '../embed/embedConfig';
|
|
4
5
|
import { EmbedEvent, AuthType } from '../types';
|
|
5
6
|
describe('Unit test for process data', () => {
|
|
6
7
|
beforeAll(() => {
|
|
@@ -56,7 +57,7 @@ describe('Unit test for process data', () => {
|
|
|
56
57
|
test('NoCookieAccess no suppress alert', () => {
|
|
57
58
|
const e = { type: EmbedEvent.NoCookieAccess };
|
|
58
59
|
jest.spyOn(base, 'notifyAuthFailure');
|
|
59
|
-
jest.spyOn(
|
|
60
|
+
jest.spyOn(embedConfigInstance, 'getEmbedConfig').mockReturnValue({
|
|
60
61
|
loginFailedMessage: 'Hello',
|
|
61
62
|
suppressNoCookieAccessAlert: false,
|
|
62
63
|
});
|
|
@@ -72,7 +73,7 @@ describe('Unit test for process data', () => {
|
|
|
72
73
|
test('NoCookieAccess suppressAlert=true', () => {
|
|
73
74
|
const e = { type: EmbedEvent.NoCookieAccess };
|
|
74
75
|
jest.spyOn(base, 'notifyAuthFailure');
|
|
75
|
-
jest.spyOn(
|
|
76
|
+
jest.spyOn(embedConfigInstance, 'getEmbedConfig').mockReturnValue({
|
|
76
77
|
loginFailedMessage: 'Hello',
|
|
77
78
|
suppressNoCookieAccessAlert: true,
|
|
78
79
|
});
|
|
@@ -89,7 +90,7 @@ describe('Unit test for process data', () => {
|
|
|
89
90
|
test('NoCookieAccess ignoreNoCookieAccess=true', () => {
|
|
90
91
|
const e = { type: EmbedEvent.NoCookieAccess };
|
|
91
92
|
jest.spyOn(base, 'notifyAuthFailure');
|
|
92
|
-
jest.spyOn(
|
|
93
|
+
jest.spyOn(embedConfigInstance, 'getEmbedConfig').mockReturnValue({
|
|
93
94
|
loginFailedMessage: 'Hello',
|
|
94
95
|
ignoreNoCookieAccess: true,
|
|
95
96
|
});
|
|
@@ -106,7 +107,7 @@ describe('Unit test for process data', () => {
|
|
|
106
107
|
test('process authFailure', () => {
|
|
107
108
|
const e = { type: EmbedEvent.AuthFailure };
|
|
108
109
|
jest.spyOn(base, 'notifyAuthFailure');
|
|
109
|
-
jest.spyOn(
|
|
110
|
+
jest.spyOn(embedConfigInstance, 'getEmbedConfig').mockReturnValue({
|
|
110
111
|
loginFailedMessage: 'Hello',
|
|
111
112
|
});
|
|
112
113
|
const el = {};
|
|
@@ -119,7 +120,7 @@ describe('Unit test for process data', () => {
|
|
|
119
120
|
test('process authFailure AuthType=None', () => {
|
|
120
121
|
const e = { type: EmbedEvent.AuthFailure };
|
|
121
122
|
jest.spyOn(base, 'notifyAuthFailure');
|
|
122
|
-
jest.spyOn(
|
|
123
|
+
jest.spyOn(embedConfigInstance, 'getEmbedConfig').mockReturnValue({
|
|
123
124
|
loginFailedMessage: 'Hello',
|
|
124
125
|
authType: AuthType.None,
|
|
125
126
|
});
|
|
@@ -131,13 +132,13 @@ describe('Unit test for process data', () => {
|
|
|
131
132
|
expect(el.innerHTML).not.toBe('Hello');
|
|
132
133
|
});
|
|
133
134
|
test('process authLogout', () => {
|
|
135
|
+
jest.spyOn(embedConfigInstance, 'getEmbedConfig').mockRestore();
|
|
134
136
|
base.init({
|
|
135
137
|
loginFailedMessage: 'Hello',
|
|
136
138
|
autoLogin: true,
|
|
137
139
|
thoughtSpotHost: 'https://tshost',
|
|
138
140
|
authType: AuthType.None,
|
|
139
141
|
});
|
|
140
|
-
jest.spyOn(base, 'getEmbedConfig').mockRestore();
|
|
141
142
|
const e = { type: EmbedEvent.AuthLogout };
|
|
142
143
|
jest.spyOn(base, 'notifyLogout');
|
|
143
144
|
const el = {};
|
|
@@ -146,7 +147,7 @@ describe('Unit test for process data', () => {
|
|
|
146
147
|
});
|
|
147
148
|
expect(base.notifyLogout).toBeCalled();
|
|
148
149
|
expect(el.innerHTML).toBe('Hello');
|
|
149
|
-
expect(
|
|
150
|
+
expect(embedConfigInstance.getEmbedConfig().autoLogin).toBe(false);
|
|
150
151
|
});
|
|
151
152
|
});
|
|
152
153
|
//# sourceMappingURL=processData.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processData.spec.js","sourceRoot":"","sources":["../../../src/utils/processData.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,mBAAmB,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEhD,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,IAAI,CAAC;YACN,eAAe,EAAE,gBAAgB;YACjC,QAAQ,EAAE,QAAQ,CAAC,IAAI;SAC1B,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,kBAAkB,CAAC;IAE3C,IAAI,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,aAAa,GAAG;YAClB,IAAI,EAAE,UAAU,CAAC,YAAY;YAC7B,IAAI,EAAE,EAAE;SACX,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAAC,kBAAkB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5F,MAAM,CACF,mBAAmB,CAAC,gBAAgB,CAChC,UAAU,CAAC,YAAY,EACvB,aAAa,EACb,eAAe,EACf,IAAI,CACP,CACJ,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"processData.spec.js","sourceRoot":"","sources":["../../../src/utils/processData.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,mBAAmB,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,IAAI,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BAAmB,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YACpE,IAAI,EAAE,CAAC,CAAC,IAAI;SACf,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,UAAU,EAAE,CAAC;QACvC,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,MAAM,CAAC,mBAAmB,CAAC,cAAc,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -13,7 +13,7 @@ declare module '@thoughtspot/visual-embed-sdk' {
|
|
|
13
13
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
14
14
|
*/
|
|
15
15
|
import { AppEmbed, Page, AppViewConfig } from '@thoughtspot/visual-embed-sdk/embed/app';
|
|
16
|
-
import { init, prefetch, logout,
|
|
16
|
+
import { init, prefetch, logout, executeTML, exportTML, executeTMLInput, exportTMLInput } from '@thoughtspot/visual-embed-sdk/embed/base';
|
|
17
17
|
import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from '@thoughtspot/visual-embed-sdk/embed/liveboard';
|
|
18
18
|
import { SearchEmbed, SearchViewConfig } from '@thoughtspot/visual-embed-sdk/embed/search';
|
|
19
19
|
import { SearchBarEmbed, SearchBarViewConfig } from '@thoughtspot/visual-embed-sdk/embed/search-bar';
|
|
@@ -22,6 +22,7 @@ declare module '@thoughtspot/visual-embed-sdk' {
|
|
|
22
22
|
import { CustomCssVariables } from '@thoughtspot/visual-embed-sdk/css-variables';
|
|
23
23
|
import { SageEmbed, SageViewConfig } from '@thoughtspot/visual-embed-sdk/embed/sage';
|
|
24
24
|
import { AnswerService } from '@thoughtspot/visual-embed-sdk/utils/graphql/answerService/answerService';
|
|
25
|
+
import { getEmbedConfig } from '@thoughtspot/visual-embed-sdk/embed/embedConfig';
|
|
25
26
|
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, };
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -274,14 +275,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/base' {
|
|
|
274
275
|
edoc_format?: 'YAML' | 'JSON';
|
|
275
276
|
}
|
|
276
277
|
export let authPromise: Promise<boolean>;
|
|
277
|
-
/**
|
|
278
|
-
* Gets the configuration embed was initialized with.
|
|
279
|
-
*
|
|
280
|
-
* @returns {@link EmbedConfig} The configuration embed was initialized with.
|
|
281
|
-
* @version SDK: 1.19.0 | ThoughtSpot: *
|
|
282
|
-
* @group Global methods
|
|
283
|
-
*/
|
|
284
|
-
export const getEmbedConfig: () => EmbedConfig;
|
|
285
278
|
export const getAuthPromise: () => Promise<boolean>;
|
|
286
279
|
export { notifyAuthFailure, notifyAuthSDKSuccess, notifyAuthSuccess, notifyLogout, };
|
|
287
280
|
/**
|
|
@@ -396,7 +389,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/base' {
|
|
|
396
389
|
console.error(error);
|
|
397
390
|
});
|
|
398
391
|
* ```
|
|
399
|
-
*
|
|
400
392
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
401
393
|
* @group Global methods
|
|
402
394
|
*/
|
|
@@ -777,17 +769,6 @@ declare module '@thoughtspot/visual-embed-sdk/auth' {
|
|
|
777
769
|
export let samlAuthWindow: Window;
|
|
778
770
|
export let samlCompletionPromise: Promise<void>;
|
|
779
771
|
export const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
|
|
780
|
-
export const EndPoints: {
|
|
781
|
-
AUTH_VERIFICATION: string;
|
|
782
|
-
SAML_LOGIN_TEMPLATE: (targetUrl: string) => string;
|
|
783
|
-
OIDC_LOGIN_TEMPLATE: (targetUrl: string) => string;
|
|
784
|
-
TOKEN_LOGIN: string;
|
|
785
|
-
BASIC_LOGIN: string;
|
|
786
|
-
LOGOUT: string;
|
|
787
|
-
EXECUTE_TML: string;
|
|
788
|
-
EXPORT_TML: string;
|
|
789
|
-
IS_ACTIVE: string;
|
|
790
|
-
};
|
|
791
772
|
interface sessionInfoInterface {
|
|
792
773
|
userGUID: any;
|
|
793
774
|
isPublicUser: any;
|
|
@@ -919,7 +900,6 @@ declare module '@thoughtspot/visual-embed-sdk/auth' {
|
|
|
919
900
|
* @group Global methods
|
|
920
901
|
*/
|
|
921
902
|
export function getSessionInfo(): Promise<sessionInfoInterface>;
|
|
922
|
-
export const getAuthenticationToken: (embedConfig: EmbedConfig) => Promise<any>;
|
|
923
903
|
/**
|
|
924
904
|
* Perform token based authentication
|
|
925
905
|
*
|
|
@@ -1467,6 +1447,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
1467
1447
|
* @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl
|
|
1468
1448
|
*/
|
|
1469
1449
|
pendoTrackingKey?: string;
|
|
1450
|
+
/**
|
|
1451
|
+
* If passed as true all alerts will be suppressed in the embedded app.
|
|
1452
|
+
*
|
|
1453
|
+
* @version SDK: 1.26.2 | ThoughtSpot: *
|
|
1454
|
+
*/
|
|
1455
|
+
suppressErrorAlerts?: boolean;
|
|
1470
1456
|
}
|
|
1471
1457
|
export interface LayoutConfig {
|
|
1472
1458
|
}
|
|
@@ -4714,6 +4700,26 @@ declare module '@thoughtspot/visual-embed-sdk/utils/graphql/answerService/answer
|
|
|
4714
4700
|
export {};
|
|
4715
4701
|
}
|
|
4716
4702
|
|
|
4703
|
+
declare module '@thoughtspot/visual-embed-sdk/embed/embedConfig' {
|
|
4704
|
+
import { EmbedConfig } from '@thoughtspot/visual-embed-sdk/types';
|
|
4705
|
+
/**
|
|
4706
|
+
* Gets the configuration embed was initialized with.
|
|
4707
|
+
*
|
|
4708
|
+
* @returns {@link EmbedConfig} The configuration embed was initialized with.
|
|
4709
|
+
* @version SDK: 1.19.0 | ThoughtSpot: *
|
|
4710
|
+
* @group Global methods
|
|
4711
|
+
*/
|
|
4712
|
+
export const getEmbedConfig: () => EmbedConfig;
|
|
4713
|
+
/**
|
|
4714
|
+
* Sets the configuration embed was initialized with.
|
|
4715
|
+
*
|
|
4716
|
+
* @param newConfig The configuration to set.
|
|
4717
|
+
* @version SDK: 1.27.0 | ThoughtSpot: *
|
|
4718
|
+
* @group Global methods
|
|
4719
|
+
*/
|
|
4720
|
+
export const setEmbedConfig: (newConfig: EmbedConfig) => void;
|
|
4721
|
+
}
|
|
4722
|
+
|
|
4717
4723
|
declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
4718
4724
|
/**
|
|
4719
4725
|
* Copyright (c) 2022
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.2",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"size-limit": [
|
|
39
39
|
{
|
|
40
40
|
"path": "dist/tsembed.js",
|
|
41
|
-
"limit": "
|
|
41
|
+
"limit": "44 kB"
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
package/src/auth.spec.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as authInstance from './auth';
|
|
2
|
-
import * as authService from './utils/authService';
|
|
2
|
+
import * as authService from './utils/authService/authService';
|
|
3
|
+
import * as tokenAuthService from './utils/authService/tokenizedAuthService';
|
|
3
4
|
import * as checkReleaseVersionInBetaInstance from './utils';
|
|
4
5
|
import * as mixPanelService from './mixpanel-service';
|
|
5
6
|
import { AuthType, EmbedEvent } from './types';
|
|
6
7
|
import { executeAfterWait } from './test/test-utils';
|
|
8
|
+
import { resetCachedAuthToken } from './authToken';
|
|
7
9
|
|
|
8
10
|
const thoughtSpotHost = 'http://localhost:3000';
|
|
9
11
|
const username = 'tsuser';
|
|
@@ -94,7 +96,6 @@ export const embedConfig: any = {
|
|
|
94
96
|
authType: AuthType.TrustedAuthTokenCookieless,
|
|
95
97
|
getAuthToken: jest.fn(() => Promise.resolve(token)),
|
|
96
98
|
}),
|
|
97
|
-
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
const originalWindow = window;
|
|
@@ -114,9 +115,11 @@ describe('Unit test for auth', () => {
|
|
|
114
115
|
beforeEach(() => {
|
|
115
116
|
global.fetch = window.fetch;
|
|
116
117
|
});
|
|
117
|
-
|
|
118
|
+
afterEach(() => {
|
|
119
|
+
resetCachedAuthToken();
|
|
120
|
+
});
|
|
118
121
|
test('endpoints, SAML_LOGIN_TEMPLATE', () => {
|
|
119
|
-
const ssoTemplateUrl =
|
|
122
|
+
const ssoTemplateUrl = authService.EndPoints.SAML_LOGIN_TEMPLATE(thoughtSpotHost);
|
|
120
123
|
expect(ssoTemplateUrl).toBe(`/callosum/v1/saml/login?targetURLPath=${thoughtSpotHost}`);
|
|
121
124
|
});
|
|
122
125
|
|
|
@@ -150,31 +153,28 @@ describe('Unit test for auth', () => {
|
|
|
150
153
|
});
|
|
151
154
|
|
|
152
155
|
test('doTokenAuth: when user is loggedIn', async () => {
|
|
153
|
-
jest.spyOn(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}),
|
|
158
|
-
);
|
|
156
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(async () => ({
|
|
157
|
+
json: () => mockSessionInfo,
|
|
158
|
+
status: 200,
|
|
159
|
+
}));
|
|
159
160
|
jest.spyOn(authInstance, 'getSessionDetails').mockReturnValue(mockSessionInfo);
|
|
160
161
|
jest.spyOn(authInstance, 'initSession').mockReturnValue(null);
|
|
161
|
-
await authInstance.doTokenAuth(
|
|
162
|
-
|
|
163
|
-
);
|
|
164
|
-
expect(authService.fetchSessionInfoService).toBeCalled();
|
|
162
|
+
await authInstance.doTokenAuth(embedConfig.doTokenAuthSuccess('authToken'));
|
|
163
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
165
164
|
expect(authInstance.loggedInStatus).toBe(true);
|
|
166
165
|
});
|
|
167
166
|
|
|
168
167
|
test('doTokenAuth: when user is not loggedIn & getAuthToken have response', async () => {
|
|
169
|
-
jest.spyOn(
|
|
168
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(() => false);
|
|
170
169
|
jest.spyOn(authService, 'fetchAuthTokenService').mockImplementation(() => ({
|
|
171
170
|
text: () => Promise.resolve('abc'),
|
|
172
171
|
}));
|
|
173
172
|
jest.spyOn(authService, 'fetchAuthService').mockImplementation(() => Promise.resolve({
|
|
174
173
|
status: 200,
|
|
175
174
|
}));
|
|
175
|
+
jest.spyOn(authService, 'verifyTokenService').mockResolvedValueOnce(true);
|
|
176
176
|
await authInstance.doTokenAuth(embedConfig.doTokenAuthSuccess('authToken2'));
|
|
177
|
-
expect(
|
|
177
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
178
178
|
expect(authService.fetchAuthService).toBeCalledWith(
|
|
179
179
|
thoughtSpotHost,
|
|
180
180
|
username,
|
|
@@ -183,22 +183,27 @@ describe('Unit test for auth', () => {
|
|
|
183
183
|
});
|
|
184
184
|
|
|
185
185
|
test('doTokenAuth: when user is not loggedIn & getAuthToken not present, isLoggedIn should called', async () => {
|
|
186
|
-
jest.spyOn(
|
|
186
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(() => false);
|
|
187
187
|
jest.spyOn(authService, 'fetchAuthTokenService').mockImplementation(() => Promise.resolve({ text: () => Promise.resolve('abc') }));
|
|
188
188
|
jest.spyOn(authService, 'fetchAuthService').mockImplementation(() => Promise.resolve({
|
|
189
189
|
status: 200,
|
|
190
190
|
ok: true,
|
|
191
191
|
}));
|
|
192
|
+
jest.spyOn(authService, 'verifyTokenService').mockResolvedValueOnce(true);
|
|
192
193
|
await authInstance.doTokenAuth(embedConfig.doTokenAuthFailureWithoutGetAuthToken);
|
|
193
194
|
await executeAfterWait(() => {
|
|
194
195
|
expect(authInstance.loggedInStatus).toBe(true);
|
|
195
|
-
expect(
|
|
196
|
-
expect(authService.fetchAuthService).toBeCalledWith(
|
|
196
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
197
|
+
expect(authService.fetchAuthService).toBeCalledWith(
|
|
198
|
+
thoughtSpotHost,
|
|
199
|
+
username,
|
|
200
|
+
'authToken2',
|
|
201
|
+
);
|
|
197
202
|
});
|
|
198
203
|
});
|
|
199
204
|
|
|
200
205
|
test('doTokenAuth: Should raise error when duplicate token is used', async () => {
|
|
201
|
-
jest.spyOn(
|
|
206
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockResolvedValue({
|
|
202
207
|
status: 401,
|
|
203
208
|
});
|
|
204
209
|
jest.spyOn(window, 'alert').mockClear();
|
|
@@ -208,9 +213,11 @@ describe('Unit test for auth', () => {
|
|
|
208
213
|
status: 200,
|
|
209
214
|
ok: true,
|
|
210
215
|
}));
|
|
216
|
+
jest.spyOn(authService, 'verifyTokenService').mockResolvedValueOnce(true);
|
|
211
217
|
await authInstance.doTokenAuth(embedConfig.doTokenAuthSuccess('authToken3'));
|
|
212
218
|
|
|
213
219
|
try {
|
|
220
|
+
jest.spyOn(authService, 'verifyTokenService').mockResolvedValueOnce(false);
|
|
214
221
|
await authInstance.doTokenAuth(embedConfig.doTokenAuthSuccess('authToken3'));
|
|
215
222
|
expect(false).toBe(true);
|
|
216
223
|
} catch (e) {
|
|
@@ -224,7 +231,7 @@ describe('Unit test for auth', () => {
|
|
|
224
231
|
});
|
|
225
232
|
|
|
226
233
|
test('doTokenAuth: Should set loggedInStatus if detectThirdPartyCookieAccess is true and the second info call fails', async () => {
|
|
227
|
-
jest.spyOn(
|
|
234
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService')
|
|
228
235
|
.mockResolvedValue({
|
|
229
236
|
status: 401,
|
|
230
237
|
})
|
|
@@ -236,14 +243,15 @@ describe('Unit test for auth', () => {
|
|
|
236
243
|
status: 200,
|
|
237
244
|
ok: true,
|
|
238
245
|
}));
|
|
246
|
+
jest.spyOn(authService, 'verifyTokenService').mockResolvedValueOnce(true);
|
|
239
247
|
const isLoggedIn = await authInstance.doTokenAuth(embedConfig.doTokenAuthWithCookieDetect);
|
|
240
|
-
expect(
|
|
248
|
+
expect(tokenAuthService.fetchSessionInfoService).toHaveBeenCalledTimes(2);
|
|
241
249
|
expect(isLoggedIn).toBe(false);
|
|
242
250
|
});
|
|
243
251
|
|
|
244
252
|
test('doTokenAuth: when user is not loggedIn & fetchAuthPostService failed than fetchAuthService should call', async () => {
|
|
245
253
|
jest.spyOn(window, 'alert').mockImplementation(() => undefined);
|
|
246
|
-
jest.spyOn(
|
|
254
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(() => false);
|
|
247
255
|
jest.spyOn(authService, 'fetchAuthTokenService').mockImplementation(() => ({
|
|
248
256
|
text: () => Promise.resolve('abc'),
|
|
249
257
|
}));
|
|
@@ -256,10 +264,11 @@ describe('Unit test for auth', () => {
|
|
|
256
264
|
status: 200,
|
|
257
265
|
type: 'opaqueredirect',
|
|
258
266
|
}));
|
|
267
|
+
jest.spyOn(authService, 'verifyTokenService').mockResolvedValueOnce(true);
|
|
259
268
|
expect(await authInstance.doTokenAuth(embedConfig.doTokenAuthSuccess('authToken2'))).toBe(
|
|
260
269
|
true,
|
|
261
270
|
);
|
|
262
|
-
expect(
|
|
271
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
263
272
|
expect(authService.fetchAuthPostService).toBeCalledWith(
|
|
264
273
|
thoughtSpotHost,
|
|
265
274
|
username,
|
|
@@ -278,35 +287,31 @@ describe('Unit test for auth', () => {
|
|
|
278
287
|
});
|
|
279
288
|
|
|
280
289
|
it('when user is loggedIn', async () => {
|
|
281
|
-
spyOn(
|
|
282
|
-
checkReleaseVersionInBetaInstance,
|
|
283
|
-
'checkReleaseVersionInBeta',
|
|
284
|
-
);
|
|
290
|
+
spyOn(checkReleaseVersionInBetaInstance, 'checkReleaseVersionInBeta');
|
|
285
291
|
jest.spyOn(authInstance, 'getSessionDetails').mockReturnValue(mockSessionInfo);
|
|
286
292
|
jest.spyOn(authInstance, 'initSession').mockReturnValue(null);
|
|
287
|
-
jest.spyOn(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}));
|
|
293
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(
|
|
294
|
+
async () => ({
|
|
295
|
+
json: () => mockSessionInfo,
|
|
296
|
+
status: 200,
|
|
297
|
+
}),
|
|
298
|
+
);
|
|
294
299
|
await authInstance.doBasicAuth(embedConfig.doBasicAuth);
|
|
295
|
-
expect(
|
|
300
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
296
301
|
expect(authInstance.loggedInStatus).toBe(true);
|
|
297
302
|
expect(authInstance.getSessionDetails).toBeCalled();
|
|
298
303
|
expect(authInstance.initSession).toBeCalled();
|
|
299
304
|
});
|
|
300
305
|
|
|
301
306
|
it('when user is not loggedIn', async () => {
|
|
302
|
-
jest.spyOn(
|
|
307
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(() => Promise.reject());
|
|
303
308
|
jest.spyOn(authService, 'fetchBasicAuthService').mockImplementation(() => ({
|
|
304
309
|
status: 200,
|
|
305
310
|
ok: true,
|
|
306
311
|
}));
|
|
307
312
|
|
|
308
313
|
await authInstance.doBasicAuth(embedConfig.doBasicAuth);
|
|
309
|
-
expect(
|
|
314
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
310
315
|
expect(authService.fetchBasicAuthService).toBeCalled();
|
|
311
316
|
expect(authInstance.loggedInStatus).toBe(true);
|
|
312
317
|
});
|
|
@@ -328,22 +333,24 @@ describe('Unit test for auth', () => {
|
|
|
328
333
|
hash: '',
|
|
329
334
|
},
|
|
330
335
|
});
|
|
331
|
-
jest.spyOn(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
336
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(
|
|
337
|
+
async () => ({
|
|
338
|
+
json: () => mockSessionInfo,
|
|
339
|
+
status: 200,
|
|
340
|
+
}),
|
|
341
|
+
);
|
|
335
342
|
jest.spyOn(authInstance, 'getSessionDetails').mockReturnValue(mockSessionInfo);
|
|
336
343
|
jest.spyOn(authInstance, 'initSession').mockReturnValue(null);
|
|
337
344
|
await authInstance.doSamlAuth(embedConfig.doSamlAuth);
|
|
338
|
-
expect(
|
|
345
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
339
346
|
expect(window.location.hash).toBe('');
|
|
340
347
|
expect(authInstance.loggedInStatus).toBe(true);
|
|
341
348
|
});
|
|
342
349
|
|
|
343
350
|
it('when user is not loggedIn & isAtSSORedirectUrl is true', async () => {
|
|
344
|
-
jest.spyOn(
|
|
351
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(() => Promise.reject());
|
|
345
352
|
await authInstance.doSamlAuth(embedConfig.doSamlAuth);
|
|
346
|
-
expect(
|
|
353
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
347
354
|
expect(window.location.hash).toBe('');
|
|
348
355
|
expect(authInstance.loggedInStatus).toBe(false);
|
|
349
356
|
});
|
|
@@ -355,9 +362,9 @@ describe('Unit test for auth', () => {
|
|
|
355
362
|
hash: '',
|
|
356
363
|
},
|
|
357
364
|
});
|
|
358
|
-
jest.spyOn(
|
|
365
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(() => Promise.reject());
|
|
359
366
|
await authInstance.doSamlAuth(embedConfig.doSamlAuth);
|
|
360
|
-
expect(
|
|
367
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
361
368
|
expect(global.window.location.href).toBe(samalLoginUrl);
|
|
362
369
|
});
|
|
363
370
|
|
|
@@ -370,7 +377,7 @@ describe('Unit test for auth', () => {
|
|
|
370
377
|
});
|
|
371
378
|
spyOn(authInstance, 'samlCompletionPromise');
|
|
372
379
|
global.window.open = jest.fn();
|
|
373
|
-
jest.spyOn(
|
|
380
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService')
|
|
374
381
|
.mockImplementationOnce(() => Promise.reject())
|
|
375
382
|
.mockImplementationOnce(async () => ({
|
|
376
383
|
json: () => mockSessionInfo,
|
|
@@ -387,7 +394,7 @@ describe('Unit test for auth', () => {
|
|
|
387
394
|
document.getElementById('ts-auth-btn').click();
|
|
388
395
|
window.postMessage({ type: EmbedEvent.SAMLComplete }, '*');
|
|
389
396
|
await authInstance.samlCompletionPromise;
|
|
390
|
-
expect(
|
|
397
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
391
398
|
expect(authInstance.getSessionDetails).toBeCalled();
|
|
392
399
|
expect(authInstance.initSession).toBeCalled();
|
|
393
400
|
});
|
|
@@ -395,6 +402,7 @@ describe('Unit test for auth', () => {
|
|
|
395
402
|
|
|
396
403
|
describe('doOIDCAuth', () => {
|
|
397
404
|
afterEach(() => {
|
|
405
|
+
resetCachedAuthToken();
|
|
398
406
|
delete global.window;
|
|
399
407
|
global.window = Object.create(originalWindow);
|
|
400
408
|
global.window.open = jest.fn();
|
|
@@ -402,9 +410,9 @@ describe('Unit test for auth', () => {
|
|
|
402
410
|
});
|
|
403
411
|
|
|
404
412
|
it('when user is not loggedIn & isAtSSORedirectUrl is true', async () => {
|
|
405
|
-
jest.spyOn(
|
|
413
|
+
jest.spyOn(tokenAuthService, 'fetchSessionInfoService').mockImplementation(() => Promise.reject());
|
|
406
414
|
await authInstance.doOIDCAuth(embedConfig.doOidcAuth);
|
|
407
|
-
expect(
|
|
415
|
+
expect(tokenAuthService.fetchSessionInfoService).toBeCalled();
|
|
408
416
|
expect(window.location.hash).toBe('');
|
|
409
417
|
expect(authInstance.loggedInStatus).toBe(false);
|
|
410
418
|
});
|
|
@@ -463,16 +471,18 @@ describe('Unit test for auth', () => {
|
|
|
463
471
|
});
|
|
464
472
|
|
|
465
473
|
it('doCookielessTokenAuth should resolve to true if valid token is passed', async () => {
|
|
466
|
-
jest.spyOn(authService, '
|
|
467
|
-
|
|
468
|
-
|
|
474
|
+
jest.spyOn(authService, 'verifyTokenService').mockResolvedValueOnce(true);
|
|
475
|
+
const isLoggedIn = await authInstance.doCookielessTokenAuth(
|
|
476
|
+
embedConfig.doCookielessAuth('testToken'),
|
|
477
|
+
);
|
|
469
478
|
expect(isLoggedIn).toBe(true);
|
|
470
479
|
});
|
|
471
480
|
|
|
472
481
|
it('doCookielessTokenAuth should resolve to false if valid token is not passed', async () => {
|
|
473
|
-
jest.spyOn(authService, '
|
|
474
|
-
|
|
475
|
-
|
|
482
|
+
jest.spyOn(authService, 'verifyTokenService').mockResolvedValueOnce(false);
|
|
483
|
+
const isLoggedIn = await authInstance.doCookielessTokenAuth(
|
|
484
|
+
embedConfig.doCookielessAuth('testToken'),
|
|
485
|
+
);
|
|
476
486
|
expect(isLoggedIn).toBe(false);
|
|
477
487
|
});
|
|
478
488
|
it('get AuthEE should return proper value', () => {
|
|
@@ -495,9 +505,11 @@ describe('Unit test for auth', () => {
|
|
|
495
505
|
},
|
|
496
506
|
},
|
|
497
507
|
});
|
|
498
|
-
expect(details).toEqual(
|
|
499
|
-
|
|
500
|
-
|
|
508
|
+
expect(details).toEqual(
|
|
509
|
+
expect.objectContaining({
|
|
510
|
+
mixpanelToken: 'devKey',
|
|
511
|
+
}),
|
|
512
|
+
);
|
|
501
513
|
|
|
502
514
|
const details2 = authInstance.getSessionDetails({
|
|
503
515
|
configInfo: {
|
|
@@ -508,8 +520,10 @@ describe('Unit test for auth', () => {
|
|
|
508
520
|
},
|
|
509
521
|
},
|
|
510
522
|
});
|
|
511
|
-
expect(details2).toEqual(
|
|
512
|
-
|
|
513
|
-
|
|
523
|
+
expect(details2).toEqual(
|
|
524
|
+
expect.objectContaining({
|
|
525
|
+
mixpanelToken: 'prodKey',
|
|
526
|
+
}),
|
|
527
|
+
);
|
|
514
528
|
});
|
|
515
529
|
});
|