@thoughtspot/visual-embed-sdk 1.29.1-alpha.1 → 1.29.1
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/README.md +1 -1
- package/cjs/package.json +2 -1
- package/cjs/src/auth.d.ts +16 -28
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +56 -53
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/auth.spec.d.ts +0 -12
- package/cjs/src/auth.spec.d.ts.map +1 -1
- package/cjs/src/auth.spec.js +67 -89
- package/cjs/src/auth.spec.js.map +1 -1
- package/cjs/src/authToken.d.ts +2 -3
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +12 -13
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/authToken.spec.d.ts +2 -0
- package/cjs/src/authToken.spec.d.ts.map +1 -0
- package/cjs/src/authToken.spec.js +29 -0
- package/cjs/src/authToken.spec.js.map +1 -0
- package/cjs/src/config.d.ts +0 -1
- package/cjs/src/config.d.ts.map +1 -1
- package/cjs/src/config.js +0 -2
- package/cjs/src/config.js.map +1 -1
- package/cjs/src/embed/app.d.ts +73 -43
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +45 -12
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +23 -4
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +1 -7
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +9 -17
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/base.spec.js +3 -2
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/embed.spec.js +0 -3
- package/cjs/src/embed/embed.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.d.ts +0 -2
- package/cjs/src/embed/embedConfig.d.ts.map +1 -1
- package/cjs/src/embed/embedConfig.js +0 -2
- package/cjs/src/embed/embedConfig.js.map +1 -1
- package/cjs/src/embed/events.spec.js +0 -3
- package/cjs/src/embed/events.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +14 -28
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +8 -8
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +79 -6
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/pinboard.spec.js +0 -3
- package/cjs/src/embed/pinboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +5 -21
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +2 -23
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/sage.spec.js +20 -34
- package/cjs/src/embed/sage.spec.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +0 -11
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +0 -2
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +60 -29
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +43 -9
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +34 -1
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed-trigger.spec.js +0 -3
- package/cjs/src/embed/ts-embed-trigger.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +1 -31
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +34 -44
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +83 -16
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.js +1 -1
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +1 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +1 -3
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts +1 -3
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +0 -2
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/mixpanel-service.spec.js +0 -7
- package/cjs/src/mixpanel-service.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts +2 -13
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +2 -13
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +15 -9
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/test/test-utils.d.ts +0 -2
- package/cjs/src/test/test-utils.d.ts.map +1 -1
- package/cjs/src/test/test-utils.js +0 -2
- package/cjs/src/test/test-utils.js.map +1 -1
- package/cjs/src/tokenizedFetch.d.ts +0 -1
- package/cjs/src/tokenizedFetch.d.ts.map +1 -1
- package/cjs/src/tokenizedFetch.js +0 -1
- package/cjs/src/tokenizedFetch.js.map +1 -1
- package/cjs/src/types.d.ts +246 -367
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +197 -297
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/authService/authService.d.ts +0 -2
- package/cjs/src/utils/authService/authService.d.ts.map +1 -1
- package/cjs/src/utils/authService/authService.js +0 -2
- package/cjs/src/utils/authService/authService.js.map +1 -1
- package/cjs/src/utils/authService/authService.spec.js +5 -18
- package/cjs/src/utils/authService/authService.spec.js.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.d.ts +2 -15
- package/cjs/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
- package/cjs/src/utils/authService/tokenizedAuthService.js +9 -39
- package/cjs/src/utils/authService/tokenizedAuthService.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +2 -0
- package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.js +57 -1
- package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +37 -12
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +70 -14
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.spec.js +78 -0
- package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/cjs/src/utils/logger.d.ts.map +1 -1
- package/cjs/src/utils/logger.js +3 -5
- package/cjs/src/utils/logger.js.map +1 -1
- package/cjs/src/utils/processData.js +3 -3
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js +3 -4
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +0 -1
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js +0 -2
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils.d.ts +2 -10
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +19 -13
- package/cjs/src/utils.js.map +1 -1
- package/dist/src/auth.d.ts +16 -28
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/auth.spec.d.ts +0 -12
- package/dist/src/auth.spec.d.ts.map +1 -1
- package/dist/src/authToken.d.ts +2 -3
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/authToken.spec.d.ts +2 -0
- package/dist/src/authToken.spec.d.ts.map +1 -0
- package/dist/src/config.d.ts +0 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +73 -43
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +1 -7
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/embedConfig.d.ts +0 -2
- package/dist/src/embed/embedConfig.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +14 -28
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +5 -21
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +0 -11
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +60 -29
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +1 -31
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts +1 -3
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +2 -13
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/test/test-utils.d.ts +0 -2
- package/dist/src/test/test-utils.d.ts.map +1 -1
- package/dist/src/tokenizedFetch.d.ts +0 -1
- package/dist/src/tokenizedFetch.d.ts.map +1 -1
- package/dist/src/types.d.ts +246 -367
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/authService/authService.d.ts +0 -2
- package/dist/src/utils/authService/authService.d.ts.map +1 -1
- package/dist/src/utils/authService/tokenizedAuthService.d.ts +2 -15
- package/dist/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts +2 -0
- package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +37 -12
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils/logger.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +0 -1
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/src/utils.d.ts +2 -10
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +6902 -7009
- package/dist/tsembed-react.js +6896 -7000
- package/dist/tsembed.es.js +3832 -4141
- package/dist/tsembed.js +15218 -15519
- package/dist/visual-embed-sdk-react-full.d.ts +450 -646
- package/dist/visual-embed-sdk-react.d.ts +450 -646
- package/dist/visual-embed-sdk.d.ts +449 -634
- package/lib/package.json +2 -1
- package/lib/src/auth.d.ts +16 -28
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +53 -52
- package/lib/src/auth.js.map +1 -1
- package/lib/src/auth.spec.d.ts +0 -12
- package/lib/src/auth.spec.d.ts.map +1 -1
- package/lib/src/auth.spec.js +66 -88
- package/lib/src/auth.spec.js.map +1 -1
- package/lib/src/authToken.d.ts +2 -3
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +12 -13
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/authToken.spec.d.ts +2 -0
- package/lib/src/authToken.spec.d.ts.map +1 -0
- package/lib/src/authToken.spec.js +26 -0
- package/lib/src/authToken.spec.js.map +1 -0
- package/lib/src/config.d.ts +0 -1
- package/lib/src/config.d.ts.map +1 -1
- package/lib/src/config.js +0 -2
- package/lib/src/config.js.map +1 -1
- package/lib/src/embed/app.d.ts +73 -43
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +44 -11
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +24 -5
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +1 -7
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +8 -16
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +4 -3
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/embed.spec.js +0 -2
- package/lib/src/embed/embed.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.d.ts +0 -2
- package/lib/src/embed/embedConfig.d.ts.map +1 -1
- package/lib/src/embed/embedConfig.js +0 -2
- package/lib/src/embed/embedConfig.js.map +1 -1
- package/lib/src/embed/events.spec.js +0 -2
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +14 -28
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +9 -9
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +79 -6
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/pinboard.spec.js +0 -2
- package/lib/src/embed/pinboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +5 -21
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +2 -23
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/sage.spec.js +20 -33
- package/lib/src/embed/sage.spec.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +0 -11
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +0 -2
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +60 -29
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +43 -9
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +35 -2
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed-trigger.spec.js +0 -2
- package/lib/src/embed/ts-embed-trigger.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +1 -31
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +37 -47
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +83 -16
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.js +1 -1
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +1 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +1 -3
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +1 -3
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +0 -2
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/mixpanel-service.spec.js +0 -7
- package/lib/src/mixpanel-service.spec.js.map +1 -1
- package/lib/src/react/index.d.ts +2 -13
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +2 -12
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +16 -10
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/test/test-utils.d.ts +0 -2
- package/lib/src/test/test-utils.d.ts.map +1 -1
- package/lib/src/test/test-utils.js +0 -2
- package/lib/src/test/test-utils.js.map +1 -1
- package/lib/src/tokenizedFetch.d.ts +0 -1
- package/lib/src/tokenizedFetch.d.ts.map +1 -1
- package/lib/src/tokenizedFetch.js +0 -1
- package/lib/src/tokenizedFetch.js.map +1 -1
- package/lib/src/types.d.ts +246 -367
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +197 -297
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService/authService.d.ts +0 -2
- package/lib/src/utils/authService/authService.d.ts.map +1 -1
- package/lib/src/utils/authService/authService.js +0 -2
- package/lib/src/utils/authService/authService.js.map +1 -1
- package/lib/src/utils/authService/authService.spec.js +6 -19
- package/lib/src/utils/authService/authService.spec.js.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.d.ts +2 -15
- package/lib/src/utils/authService/tokenizedAuthService.d.ts.map +1 -1
- package/lib/src/utils/authService/tokenizedAuthService.js +8 -37
- package/lib/src/utils/authService/tokenizedAuthService.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts +2 -0
- package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answer-queries.js +56 -0
- package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +37 -12
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +71 -15
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.spec.js +80 -2
- package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
- package/lib/src/utils/logger.d.ts.map +1 -1
- package/lib/src/utils/logger.js +2 -3
- package/lib/src/utils/logger.js.map +1 -1
- package/lib/src/utils/processData.js +4 -4
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js +3 -4
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +0 -1
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +0 -2
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils.d.ts +2 -10
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +17 -12
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +456 -645
- package/package.json +2 -1
- package/src/auth.spec.ts +72 -92
- package/src/auth.ts +62 -57
- package/src/authToken.spec.ts +31 -0
- package/src/authToken.ts +12 -12
- package/src/config.ts +0 -2
- package/src/embed/app.spec.ts +39 -5
- package/src/embed/app.ts +108 -50
- package/src/embed/base.spec.ts +5 -4
- package/src/embed/base.ts +30 -36
- package/src/embed/embed.spec.ts +0 -2
- package/src/embed/embedConfig.ts +0 -2
- package/src/embed/events.spec.ts +0 -2
- package/src/embed/liveboard.spec.ts +104 -11
- package/src/embed/liveboard.ts +25 -38
- package/src/embed/pinboard.spec.ts +0 -2
- package/src/embed/sage.spec.ts +20 -38
- package/src/embed/sage.ts +5 -38
- package/src/embed/search-bar.tsx +0 -11
- package/src/embed/search.spec.ts +48 -2
- package/src/embed/search.ts +94 -38
- package/src/embed/ts-embed-trigger.spec.ts +0 -3
- package/src/embed/ts-embed.spec.ts +109 -32
- package/src/embed/ts-embed.ts +68 -79
- package/src/errors.ts +1 -1
- package/src/index.ts +1 -3
- package/src/mixpanel-service.spec.ts +3 -12
- package/src/mixpanel-service.ts +1 -4
- package/src/react/index.spec.tsx +48 -67
- package/src/react/index.tsx +1 -13
- package/src/test/test-utils.ts +0 -2
- package/src/tokenizedFetch.ts +0 -1
- package/src/types.ts +246 -366
- package/src/utils/authService/authService.spec.ts +9 -22
- package/src/utils/authService/authService.ts +0 -2
- package/src/utils/authService/tokenizedAuthService.ts +8 -38
- package/src/utils/graphql/answerService/answer-queries.ts +58 -0
- package/src/utils/graphql/answerService/answerService.spec.ts +88 -2
- package/src/utils/graphql/answerService/answerService.ts +87 -16
- package/src/utils/logger.ts +2 -3
- package/src/utils/processData.spec.ts +3 -4
- package/src/utils/processData.ts +4 -4
- package/src/utils/processTrigger.ts +0 -2
- package/src/utils.ts +21 -13
- package/cjs/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
- package/cjs/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js +0 -32
- package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +0 -1
- package/cjs/src/utils/sessionInfoService.d.ts +0 -66
- package/cjs/src/utils/sessionInfoService.d.ts.map +0 -1
- package/cjs/src/utils/sessionInfoService.js +0 -92
- package/cjs/src/utils/sessionInfoService.js.map +0 -1
- package/dist/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
- package/dist/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
- package/dist/src/utils/sessionInfoService.d.ts +0 -66
- package/dist/src/utils/sessionInfoService.d.ts.map +0 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
- package/lib/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
- package/lib/src/utils/authService/tokenizedAuthService.spec.js +0 -29
- package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +0 -1
- package/lib/src/utils/sessionInfoService.d.ts +0 -66
- package/lib/src/utils/sessionInfoService.d.ts.map +0 -1
- package/lib/src/utils/sessionInfoService.js +0 -85
- package/lib/src/utils/sessionInfoService.js.map +0 -1
- package/src/utils/authService/tokenizedAuthService.spec.ts +0 -36
- package/src/utils/sessionInfoService.ts +0 -101
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { getAuthenticationToken, resetCachedAuthToken } from './authToken';
|
|
2
|
+
import * as authServiceInstance from './utils/authService/authService';
|
|
3
|
+
import { EmbedConfig } from './types';
|
|
4
|
+
|
|
5
|
+
describe('AuthToken Unit tests', () => {
|
|
6
|
+
test('getAuthenticationToken: When verification is disabled', async () => {
|
|
7
|
+
jest.spyOn(authServiceInstance, 'verifyTokenService');
|
|
8
|
+
|
|
9
|
+
const token = await getAuthenticationToken({
|
|
10
|
+
getAuthToken: async () => 'abc3',
|
|
11
|
+
disableTokenVerification: true,
|
|
12
|
+
} as EmbedConfig);
|
|
13
|
+
|
|
14
|
+
expect(token).toBe('abc3');
|
|
15
|
+
expect(authServiceInstance.verifyTokenService).not.toBeCalled();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test.only('getAuthenticationToken: When verification is enabled', async () => {
|
|
19
|
+
resetCachedAuthToken();
|
|
20
|
+
jest.clearAllMocks();
|
|
21
|
+
jest.spyOn(authServiceInstance, 'verifyTokenService').mockImplementation(() => true);
|
|
22
|
+
const token = await getAuthenticationToken({
|
|
23
|
+
thoughtSpotHost: 'test',
|
|
24
|
+
getAuthToken: async () => 'abc2',
|
|
25
|
+
disableTokenVerification: false,
|
|
26
|
+
} as EmbedConfig);
|
|
27
|
+
|
|
28
|
+
expect(token).toBe('abc2');
|
|
29
|
+
expect(authServiceInstance.verifyTokenService).toBeCalledWith('test', 'abc2');
|
|
30
|
+
});
|
|
31
|
+
});
|
package/src/authToken.ts
CHANGED
|
@@ -10,8 +10,10 @@ const INVALID_TOKEN_ERR = 'Invalid token received form token callback or authTok
|
|
|
10
10
|
let cachedAuthToken: string | null = null;
|
|
11
11
|
|
|
12
12
|
// This method can be used to get the authToken using the embedConfig
|
|
13
|
-
export async
|
|
14
|
-
if
|
|
13
|
+
export const getAuthenticationToken = async (embedConfig: EmbedConfig): Promise<string> => {
|
|
14
|
+
// Since we don't have token validation enabled , we cannot tell if the
|
|
15
|
+
// cached token is valid or not. So we will always fetch a new token.
|
|
16
|
+
if (cachedAuthToken && !embedConfig.disableTokenVerification) {
|
|
15
17
|
let isCachedTokenStillValid;
|
|
16
18
|
try {
|
|
17
19
|
isCachedTokenStillValid = await validateAuthToken(embedConfig, cachedAuthToken, true);
|
|
@@ -32,23 +34,22 @@ export async function getAuthenticationToken(embedConfig: EmbedConfig): Promise<
|
|
|
32
34
|
authToken = await response.text();
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
await validateAuthToken(embedConfig, authToken);
|
|
38
|
-
} catch (e) {
|
|
39
|
-
logger.error(`Received invalid token from getAuthToken callback or authToken endpoint. Error : ${e.message}`);
|
|
40
|
-
throw e;
|
|
41
|
-
}
|
|
37
|
+
// this will throw error if the token is not valid
|
|
38
|
+
await validateAuthToken(embedConfig, authToken);
|
|
42
39
|
|
|
43
40
|
cachedAuthToken = authToken;
|
|
44
41
|
return authToken;
|
|
45
|
-
}
|
|
42
|
+
};
|
|
46
43
|
|
|
47
44
|
const validateAuthToken = async (
|
|
48
45
|
embedConfig: EmbedConfig,
|
|
49
46
|
authToken: string,
|
|
50
47
|
suppressAlert?: boolean,
|
|
51
48
|
): Promise<boolean> => {
|
|
49
|
+
if (embedConfig.disableTokenVerification) {
|
|
50
|
+
logger.info('Token verification is disabled. Assuming token is valid.');
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
52
53
|
try {
|
|
53
54
|
const isTokenValid = await verifyTokenService(embedConfig.thoughtSpotHost, authToken);
|
|
54
55
|
if (isTokenValid) return true;
|
|
@@ -69,12 +70,11 @@ const validateAuthToken = async (
|
|
|
69
70
|
|
|
70
71
|
/**
|
|
71
72
|
* Resets the auth token and a new token will be fetched on the next request.
|
|
72
|
-
*
|
|
73
73
|
* @example
|
|
74
74
|
* ```js
|
|
75
75
|
* resetCachedAuthToken();
|
|
76
76
|
* ```
|
|
77
|
-
* @version SDK: 1.28.
|
|
77
|
+
* @version SDK: 1.28.2 | ThoughtSpot: *
|
|
78
78
|
* @group Authentication / Init
|
|
79
79
|
*/
|
|
80
80
|
export const resetCachedAuthToken = (): void => {
|
package/src/config.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { EmbedConfig } from './types';
|
|
|
5
5
|
* Copyright (c) 2023
|
|
6
6
|
*
|
|
7
7
|
* Utilities related to reading configuration objects
|
|
8
|
-
*
|
|
9
8
|
* @summary Config-related utils
|
|
10
9
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
11
10
|
*/
|
|
@@ -23,7 +22,6 @@ const urlRegex = new RegExp(
|
|
|
23
22
|
/**
|
|
24
23
|
* Parse and construct the ThoughtSpot hostname or IP address
|
|
25
24
|
* from the embed configuration object.
|
|
26
|
-
*
|
|
27
25
|
* @param config
|
|
28
26
|
*/
|
|
29
27
|
export const getThoughtSpotHost = (config: EmbedConfig): string => {
|
package/src/embed/app.spec.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AppEmbed,
|
|
3
|
+
AppViewConfig,
|
|
4
|
+
DataPanelCustomColumnGroupsAccordionState,
|
|
5
|
+
Page,
|
|
6
|
+
} from './app';
|
|
2
7
|
import { init } from '../index';
|
|
3
8
|
import {
|
|
4
9
|
Action, AuthType, EmbedEvent, HostEvent, RuntimeFilterOp,
|
|
@@ -19,7 +24,6 @@ import { version } from '../../package.json';
|
|
|
19
24
|
import * as config from '../config';
|
|
20
25
|
import { TsEmbed, V1Embed } from './ts-embed';
|
|
21
26
|
import { logger } from '../utils/logger';
|
|
22
|
-
import * as auth from '../auth';
|
|
23
27
|
|
|
24
28
|
const defaultViewConfig = {
|
|
25
29
|
frameParams: {
|
|
@@ -36,7 +40,6 @@ beforeAll(() => {
|
|
|
36
40
|
thoughtSpotHost,
|
|
37
41
|
authType: AuthType.None,
|
|
38
42
|
});
|
|
39
|
-
jest.spyOn(auth, 'postLoginService').mockImplementation(() => Promise.resolve({}));
|
|
40
43
|
(window as any).ResizeObserver = window.ResizeObserver
|
|
41
44
|
|| jest.fn().mockImplementation(() => ({
|
|
42
45
|
disconnect: jest.fn(),
|
|
@@ -69,13 +72,13 @@ describe('App embed tests', () => {
|
|
|
69
72
|
test('should hide the primary nav bar', async () => {
|
|
70
73
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
71
74
|
...defaultViewConfig,
|
|
72
|
-
showPrimaryNavbar:
|
|
75
|
+
showPrimaryNavbar: true,
|
|
73
76
|
} as AppViewConfig);
|
|
74
77
|
appEmbed.render();
|
|
75
78
|
await executeAfterWait(() => {
|
|
76
79
|
expectUrlMatchesWithParams(
|
|
77
80
|
getIFrameSrc(),
|
|
78
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=
|
|
81
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=false&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
|
|
79
82
|
);
|
|
80
83
|
});
|
|
81
84
|
});
|
|
@@ -291,6 +294,21 @@ describe('App embed tests', () => {
|
|
|
291
294
|
});
|
|
292
295
|
});
|
|
293
296
|
|
|
297
|
+
test('should set enable2ColumnLayout to true in url', async () => {
|
|
298
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
299
|
+
...defaultViewConfig,
|
|
300
|
+
enable2ColumnLayout: true,
|
|
301
|
+
} as AppViewConfig);
|
|
302
|
+
|
|
303
|
+
appEmbed.render();
|
|
304
|
+
await executeAfterWait(() => {
|
|
305
|
+
expectUrlMatchesWithParams(
|
|
306
|
+
getIFrameSrc(),
|
|
307
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enable2ColumnLayout=true${defaultParamsPost}#/home`,
|
|
308
|
+
);
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
|
|
294
312
|
test('Should add the tag to the iframe src', async () => {
|
|
295
313
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
296
314
|
...defaultViewConfig,
|
|
@@ -411,6 +429,22 @@ describe('App embed tests', () => {
|
|
|
411
429
|
});
|
|
412
430
|
});
|
|
413
431
|
|
|
432
|
+
test('Should add dataPanelCustomGroupsAccordionInitialState flag to the iframe src', async () => {
|
|
433
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
434
|
+
...defaultViewConfig,
|
|
435
|
+
// eslint-disable-next-line max-len
|
|
436
|
+
dataPanelCustomGroupsAccordionInitialState: DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST,
|
|
437
|
+
} as AppViewConfig);
|
|
438
|
+
|
|
439
|
+
appEmbed.render();
|
|
440
|
+
await executeAfterWait(() => {
|
|
441
|
+
expectUrlMatchesWithParams(
|
|
442
|
+
getIFrameSrc(),
|
|
443
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST${defaultParams}${defaultParamsPost}#/home`,
|
|
444
|
+
);
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
|
|
414
448
|
test('should register event handlers to adjust iframe height', async () => {
|
|
415
449
|
const onSpy = jest.spyOn(AppEmbed.prototype, 'on')
|
|
416
450
|
.mockImplementation((event, callback) => {
|
package/src/embed/app.ts
CHANGED
|
@@ -3,22 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Full application embedding
|
|
5
5
|
* https://developers.thoughtspot.com/docs/?pageid=full-embed
|
|
6
|
-
*
|
|
7
6
|
* @summary Full app embed
|
|
8
7
|
* @module
|
|
9
8
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
|
-
import { logger } from '../utils/logger';
|
|
13
|
-
import { getQueryParamString } from '../utils';
|
|
14
11
|
import {
|
|
15
|
-
Param,
|
|
16
|
-
DOMSelector,
|
|
17
|
-
HostEvent,
|
|
18
|
-
ViewConfig,
|
|
19
|
-
EmbedEvent,
|
|
20
|
-
MessagePayload,
|
|
12
|
+
DOMSelector, EmbedEvent, HostEvent, MessagePayload, Param, ViewConfig,
|
|
21
13
|
} from '../types';
|
|
14
|
+
import { getQueryParamString } from '../utils';
|
|
15
|
+
import { logger } from '../utils/logger';
|
|
22
16
|
import { V1Embed } from './ts-embed';
|
|
23
17
|
|
|
24
18
|
/**
|
|
@@ -56,9 +50,27 @@ export enum Page {
|
|
|
56
50
|
SpotIQ = 'insights',
|
|
57
51
|
}
|
|
58
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Define the initial state os column custom group accordions
|
|
55
|
+
* in data panel v2.
|
|
56
|
+
*/
|
|
57
|
+
export enum DataPanelCustomColumnGroupsAccordionState {
|
|
58
|
+
/**
|
|
59
|
+
* Expand all the accordion initially in data panel v2.
|
|
60
|
+
*/
|
|
61
|
+
EXPAND_ALL = 'EXPAND_ALL',
|
|
62
|
+
/**
|
|
63
|
+
* Collapse all the accordions initially in data panel v2.
|
|
64
|
+
*/
|
|
65
|
+
COLLAPSE_ALL = 'COLLAPSE_ALL',
|
|
66
|
+
/**
|
|
67
|
+
* Expand the first accordion and collapse the rest.
|
|
68
|
+
*/
|
|
69
|
+
EXPAND_FIRST = 'EXPAND_FIRST',
|
|
70
|
+
}
|
|
71
|
+
|
|
59
72
|
/**
|
|
60
73
|
* The view configuration for full app embedding.
|
|
61
|
-
*
|
|
62
74
|
* @group Embed components
|
|
63
75
|
*/
|
|
64
76
|
export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
@@ -66,10 +78,8 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
66
78
|
* If true, the top navigation bar within the ThoughtSpot app
|
|
67
79
|
* is displayed. By default, the navigation bar is hidden.
|
|
68
80
|
* This flag also controls the homepage left navigation bar.
|
|
69
|
-
*
|
|
70
81
|
* @default true
|
|
71
82
|
* @version SDK: 1.2.0 | Thoughtspot: 8.4.0.cl
|
|
72
|
-
*
|
|
73
83
|
* @example
|
|
74
84
|
* ```js
|
|
75
85
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -85,13 +95,12 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
85
95
|
* nav-bars are visible, this flag will only hide the homepage left nav-bar.
|
|
86
96
|
* The showPrimaryNavbar flag takes precedence over the hideHomepageLeftNav.
|
|
87
97
|
*
|
|
98
|
+
*
|
|
88
99
|
* **Note**: This option does not apply to the classic homepage.
|
|
89
100
|
* To access the updated modular homepage, set
|
|
90
101
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
91
|
-
*
|
|
92
102
|
* @default false
|
|
93
103
|
* @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
|
|
94
|
-
*
|
|
95
104
|
* @example
|
|
96
105
|
* ```js
|
|
97
106
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -106,7 +115,6 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
106
115
|
* Global nav-bar. By default, these buttons are visible on the nav-bar.
|
|
107
116
|
* @default false
|
|
108
117
|
* @version SDK: 1.2.0 | Thoughtspot: 8.4.0.cl
|
|
109
|
-
*
|
|
110
118
|
* @example
|
|
111
119
|
* ```js
|
|
112
120
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -120,13 +128,12 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
120
128
|
* Control the visibility of the application switcher button on the nav-bar.
|
|
121
129
|
* By default, the application switcher is shown.
|
|
122
130
|
*
|
|
131
|
+
*
|
|
123
132
|
* **Note**: This option does not apply to the classic homepage.
|
|
124
133
|
* To access the updated modular homepage, set
|
|
125
134
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
126
|
-
*
|
|
127
135
|
* @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
|
|
128
136
|
* @default false
|
|
129
|
-
*
|
|
130
137
|
* @example
|
|
131
138
|
* ```js
|
|
132
139
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -140,13 +147,12 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
140
147
|
* Control the visibility of the Org switcher button on the nav-bar.
|
|
141
148
|
* By default, the Org switcher button is shown.
|
|
142
149
|
*
|
|
150
|
+
*
|
|
143
151
|
* **Note**: This option does not apply to the classic homepage.
|
|
144
152
|
* To access the updated modular homepage, set
|
|
145
153
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
146
|
-
*
|
|
147
154
|
* @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
|
|
148
155
|
* @default true
|
|
149
|
-
*
|
|
150
156
|
* @example
|
|
151
157
|
* ```js
|
|
152
158
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -164,9 +170,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
164
170
|
*
|
|
165
171
|
* For eg, if you want the component to open to a specific Liveboard
|
|
166
172
|
* you could set the path to `pinboard/<liveboardId>/tab/<tabId>`.
|
|
167
|
-
*
|
|
168
173
|
* @version SDK: 1.1.0 | Thoughtspot: 9.4.0.cl
|
|
169
|
-
*
|
|
170
174
|
* @example
|
|
171
175
|
* ```js
|
|
172
176
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -182,9 +186,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
182
186
|
*
|
|
183
187
|
* Use this to open to particular page in the app. To open to a specific
|
|
184
188
|
* path within the app, use the `path` attribute which is more flexible.
|
|
185
|
-
*
|
|
186
189
|
* @version SDK: 1.1.0 | Thoughtspot: 9.4.0.cl
|
|
187
|
-
*
|
|
188
190
|
* @example
|
|
189
191
|
* ```js
|
|
190
192
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -198,7 +200,6 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
198
200
|
* This puts a filter tag on the application. All metadata lists in the
|
|
199
201
|
* application, such as Liveboards and answers, would be filtered by this
|
|
200
202
|
* tag.
|
|
201
|
-
*
|
|
202
203
|
* @version SDK: 1.1.0 | Thoughtspot: 9.4.0.cl
|
|
203
204
|
* @example
|
|
204
205
|
* ```js
|
|
@@ -211,9 +212,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
211
212
|
tag?: string;
|
|
212
213
|
/**
|
|
213
214
|
* The array of GUIDs to be hidden
|
|
214
|
-
*
|
|
215
215
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
216
|
-
*
|
|
217
216
|
* @example
|
|
218
217
|
* ```js
|
|
219
218
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -229,7 +228,6 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
229
228
|
/**
|
|
230
229
|
* Render liveboards using the new v2 rendering mode
|
|
231
230
|
* This is a transient flag which is primarily meant for internal use
|
|
232
|
-
*
|
|
233
231
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
234
232
|
* @hidden
|
|
235
233
|
*/
|
|
@@ -237,9 +235,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
237
235
|
/**
|
|
238
236
|
* If set to true, the Search Assist feature is enabled.
|
|
239
237
|
* @default true
|
|
240
|
-
*
|
|
241
238
|
* @version SDK: 1.13.0 | ThoughtSpot: 8.5.0.cl, 8.8.1-sw
|
|
242
|
-
*
|
|
243
239
|
* @example
|
|
244
240
|
* ```js
|
|
245
241
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -252,9 +248,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
252
248
|
/**
|
|
253
249
|
* If set to true, the embedded object container dynamically resizes
|
|
254
250
|
* according to the height of the pages which support fullHeight mode.
|
|
255
|
-
*
|
|
256
251
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.4.0.cl, 9.4.0-sw
|
|
257
|
-
*
|
|
258
252
|
* @example
|
|
259
253
|
* ```js
|
|
260
254
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -266,7 +260,6 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
266
260
|
fullHeight?: boolean;
|
|
267
261
|
/**
|
|
268
262
|
* Flag to control Data panel experience
|
|
269
|
-
*
|
|
270
263
|
* @default false
|
|
271
264
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
272
265
|
* @hidden
|
|
@@ -274,10 +267,8 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
274
267
|
dataPanelV2?: boolean;
|
|
275
268
|
/**
|
|
276
269
|
* Show or hide Liveboard header
|
|
277
|
-
*
|
|
278
270
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
279
271
|
* @default false
|
|
280
|
-
*
|
|
281
272
|
* @example
|
|
282
273
|
* ```js
|
|
283
274
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -289,10 +280,8 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
289
280
|
hideLiveboardHeader?: boolean;
|
|
290
281
|
/**
|
|
291
282
|
* Show or hide Liveboard title
|
|
292
|
-
*
|
|
293
283
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
294
284
|
* @default false
|
|
295
|
-
*
|
|
296
285
|
* @example
|
|
297
286
|
* ```js
|
|
298
287
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -304,10 +293,8 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
304
293
|
showLiveboardTitle?: boolean;
|
|
305
294
|
/**
|
|
306
295
|
* Show or hide Liveboard description
|
|
307
|
-
*
|
|
308
296
|
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
309
297
|
* @default false
|
|
310
|
-
*
|
|
311
298
|
* @example
|
|
312
299
|
* ```js
|
|
313
300
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -319,10 +306,8 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
319
306
|
showLiveboardDescription?: boolean;
|
|
320
307
|
/**
|
|
321
308
|
* Flag to control new Modular Home experience.
|
|
322
|
-
*
|
|
323
309
|
* @default false
|
|
324
310
|
* @version SDK: 1.28.0 | Thoughtspot: 9.12.5.cl
|
|
325
|
-
*
|
|
326
311
|
* @example
|
|
327
312
|
* ```js
|
|
328
313
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
@@ -334,7 +319,6 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
334
319
|
modularHomeExperience?: boolean;
|
|
335
320
|
/**
|
|
336
321
|
* Boolean to control if Liveboard header is sticky or not.
|
|
337
|
-
*
|
|
338
322
|
* @example
|
|
339
323
|
* ```js
|
|
340
324
|
* const embed = new AppEmbed('#embed', {
|
|
@@ -347,23 +331,71 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
347
331
|
isLiveboardHeaderSticky?: boolean;
|
|
348
332
|
/**
|
|
349
333
|
* enable or disable ask sage
|
|
350
|
-
*
|
|
351
334
|
* @version SDK: 1.29.0 | Thoughtspot: 9.12.0.cl
|
|
352
335
|
* @default false
|
|
353
336
|
*/
|
|
354
337
|
enableAskSage?: boolean;
|
|
355
338
|
/**
|
|
356
339
|
* To set the initial state of the search bar in case of saved-answers.
|
|
357
|
-
*
|
|
358
340
|
* @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
|
|
359
341
|
* @default false
|
|
360
342
|
*/
|
|
361
343
|
collapseSearchBarInitially?: boolean;
|
|
344
|
+
/**
|
|
345
|
+
* To enable custom column groups in data panel v2.
|
|
346
|
+
* @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
|
|
347
|
+
* @default false
|
|
348
|
+
* @example
|
|
349
|
+
* ```js
|
|
350
|
+
* const embed = new AppEmbed('#embed', {
|
|
351
|
+
* ... // other app view config
|
|
352
|
+
* enableCustomColumnGroups: true,
|
|
353
|
+
* });
|
|
354
|
+
* ```
|
|
355
|
+
*/
|
|
356
|
+
enableCustomColumnGroups?: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* This controls the initial behaviour of custom column groups accordion.
|
|
359
|
+
* It takes DataPanelCustomColumnGroupsAccordionState enum values as input.
|
|
360
|
+
* List of different enum values:-
|
|
361
|
+
* - EXPAND_ALL: Expand all the accordion initially in data panel v2.
|
|
362
|
+
* - COLLAPSE_ALL: Collapse all the accordions initially in data panel v2.
|
|
363
|
+
* - EXPAND_FIRST: Expand the first accordion and collapse the rest.
|
|
364
|
+
* @version SDK: 1.32.0 | Thoughtspot: 10.0.0.cl
|
|
365
|
+
* @default DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL
|
|
366
|
+
* @example
|
|
367
|
+
* ```js
|
|
368
|
+
* const embed = new AppEmbed('#embed', {
|
|
369
|
+
* ... // other app view config
|
|
370
|
+
* dataPanelCustomGroupsAccordionInitialState:
|
|
371
|
+
* DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL,
|
|
372
|
+
* });
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
dataPanelCustomGroupsAccordionInitialState?: DataPanelCustomColumnGroupsAccordionState;
|
|
376
|
+
/**
|
|
377
|
+
* This flag is used to enable the 2 column layout in liveboard
|
|
378
|
+
* @type {boolean}
|
|
379
|
+
* @default false
|
|
380
|
+
* @version SDK: 1.32.0 | ThoughtSpot:10.1.0.cl
|
|
381
|
+
* @example
|
|
382
|
+
* ```js
|
|
383
|
+
* const embed = new LiveboardEmbed('#embed-container', {
|
|
384
|
+
* ... // other options
|
|
385
|
+
* enable2ColumnLayout: true,
|
|
386
|
+
* })
|
|
387
|
+
* ```
|
|
388
|
+
*/
|
|
389
|
+
enable2ColumnLayout?: boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Flag to use OnBeforeSearchExecute embed event
|
|
392
|
+
* @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
|
|
393
|
+
*/
|
|
394
|
+
isOnBeforeGetVizDataInterceptEnabled?: boolean;
|
|
362
395
|
}
|
|
363
396
|
|
|
364
397
|
/**
|
|
365
398
|
* Embeds full ThoughtSpot experience in a host application.
|
|
366
|
-
*
|
|
367
399
|
* @group Embed components
|
|
368
400
|
*/
|
|
369
401
|
export class AppEmbed extends V1Embed {
|
|
@@ -406,6 +438,11 @@ export class AppEmbed extends V1Embed {
|
|
|
406
438
|
isLiveboardHeaderSticky = true,
|
|
407
439
|
enableAskSage,
|
|
408
440
|
collapseSearchBarInitially = false,
|
|
441
|
+
enable2ColumnLayout,
|
|
442
|
+
enableCustomColumnGroups = false,
|
|
443
|
+
isOnBeforeGetVizDataInterceptEnabled = false,
|
|
444
|
+
/* eslint-disable-next-line max-len */
|
|
445
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL,
|
|
409
446
|
} = this.viewConfig;
|
|
410
447
|
|
|
411
448
|
let params = {};
|
|
@@ -418,6 +455,7 @@ export class AppEmbed extends V1Embed {
|
|
|
418
455
|
params[Param.ShowLiveboardTitle] = showLiveboardTitle;
|
|
419
456
|
params[Param.ShowLiveboardDescription] = !!showLiveboardDescription;
|
|
420
457
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
458
|
+
params[Param.IsFullAppEmbed] = true;
|
|
421
459
|
|
|
422
460
|
params = this.getBaseQueryParams(params);
|
|
423
461
|
|
|
@@ -439,14 +477,40 @@ export class AppEmbed extends V1Embed {
|
|
|
439
477
|
params[Param.EnableSearchAssist] = enableSearchAssist;
|
|
440
478
|
}
|
|
441
479
|
|
|
480
|
+
if (enable2ColumnLayout !== undefined) {
|
|
481
|
+
params[Param.Enable2ColumnLayout] = enable2ColumnLayout;
|
|
482
|
+
}
|
|
483
|
+
|
|
442
484
|
if (enableAskSage) {
|
|
443
485
|
params[Param.enableAskSage] = enableAskSage;
|
|
444
486
|
}
|
|
445
487
|
|
|
488
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
489
|
+
/* eslint-disable-next-line max-len */
|
|
490
|
+
params[
|
|
491
|
+
Param.IsOnBeforeGetVizDataInterceptEnabled
|
|
492
|
+
] = isOnBeforeGetVizDataInterceptEnabled;
|
|
493
|
+
}
|
|
494
|
+
|
|
446
495
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
447
496
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
448
497
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
449
498
|
params[Param.CollapseSearchBarInitially] = collapseSearchBarInitially;
|
|
499
|
+
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
500
|
+
if (
|
|
501
|
+
dataPanelCustomGroupsAccordionInitialState
|
|
502
|
+
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
503
|
+
|| dataPanelCustomGroupsAccordionInitialState
|
|
504
|
+
=== DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST
|
|
505
|
+
) {
|
|
506
|
+
/* eslint-disable-next-line max-len */
|
|
507
|
+
params[
|
|
508
|
+
Param.DataPanelCustomGroupsAccordionInitialState
|
|
509
|
+
] = dataPanelCustomGroupsAccordionInitialState;
|
|
510
|
+
} else {
|
|
511
|
+
/* eslint-disable-next-line max-len */
|
|
512
|
+
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
513
|
+
}
|
|
450
514
|
const queryParams = getQueryParamString(params, true);
|
|
451
515
|
|
|
452
516
|
return queryParams;
|
|
@@ -454,7 +518,6 @@ export class AppEmbed extends V1Embed {
|
|
|
454
518
|
|
|
455
519
|
/**
|
|
456
520
|
* Constructs the URL of the ThoughtSpot app page to be rendered.
|
|
457
|
-
*
|
|
458
521
|
* @param pageId The ID of the page to be embedded.
|
|
459
522
|
*/
|
|
460
523
|
public getIFrameSrc(): string {
|
|
@@ -471,7 +534,6 @@ export class AppEmbed extends V1Embed {
|
|
|
471
534
|
/**
|
|
472
535
|
* Set the iframe height as per the computed height received
|
|
473
536
|
* from the ThoughtSpot app.
|
|
474
|
-
*
|
|
475
537
|
* @param data The event payload
|
|
476
538
|
*/
|
|
477
539
|
protected updateIFrameHeight = (data: MessagePayload) => {
|
|
@@ -492,7 +554,6 @@ export class AppEmbed extends V1Embed {
|
|
|
492
554
|
|
|
493
555
|
/**
|
|
494
556
|
* Gets the ThoughtSpot route of the page for a particular page ID.
|
|
495
|
-
*
|
|
496
557
|
* @param pageId The identifier for a page in the ThoughtSpot app.
|
|
497
558
|
* @param modularHomeExperience
|
|
498
559
|
*/
|
|
@@ -518,7 +579,6 @@ export class AppEmbed extends V1Embed {
|
|
|
518
579
|
|
|
519
580
|
/**
|
|
520
581
|
* Formats the path provided by the user.
|
|
521
|
-
*
|
|
522
582
|
* @param path The URL path.
|
|
523
583
|
* @returns The URL path that the embedded app understands.
|
|
524
584
|
*/
|
|
@@ -539,7 +599,6 @@ export class AppEmbed extends V1Embed {
|
|
|
539
599
|
* Navigate to particular page for app embed. eg:answers/pinboards/home
|
|
540
600
|
* This is used for embedding answers, pinboards, visualizations and full application
|
|
541
601
|
* only.
|
|
542
|
-
*
|
|
543
602
|
* @param path string | number The string, set to iframe src and navigate to new page
|
|
544
603
|
* eg: appEmbed.navigateToPage('pinboards')
|
|
545
604
|
* When used with `noReload` (default: true) this can also be a number
|
|
@@ -571,7 +630,6 @@ export class AppEmbed extends V1Embed {
|
|
|
571
630
|
|
|
572
631
|
/**
|
|
573
632
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
574
|
-
*
|
|
575
633
|
* @param renderOptions An object containing the page ID
|
|
576
634
|
* to be embedded.
|
|
577
635
|
*/
|
package/src/embed/base.spec.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
3
3
|
import EventEmitter from 'eventemitter3';
|
|
4
|
-
import { EmbedConfig } from '../index';
|
|
5
4
|
import * as auth from '../auth';
|
|
6
|
-
import * as authService from '../utils/authService/authService';
|
|
7
5
|
import * as authTokenService from '../authToken';
|
|
8
6
|
import * as index from '../index';
|
|
7
|
+
import { EmbedConfig } from '../index';
|
|
8
|
+
import * as authService from '../utils/authService/authService';
|
|
9
9
|
import * as base from './base';
|
|
10
10
|
import * as embedConfigInstance from './embedConfig';
|
|
11
11
|
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
executeAfterWait,
|
|
14
14
|
getAllIframeEl,
|
|
15
15
|
getDocumentBody,
|
|
16
|
-
getRootEl,
|
|
17
16
|
getIFrameSrc,
|
|
17
|
+
getRootEl,
|
|
18
18
|
} from '../test/test-utils';
|
|
19
19
|
import * as tokenizedFetchInstance from '../tokenizedFetch';
|
|
20
20
|
import { logger } from '../utils/logger';
|
|
@@ -28,7 +28,6 @@ describe('Base TS Embed', () => {
|
|
|
28
28
|
thoughtSpotHost,
|
|
29
29
|
authType: index.AuthType.None,
|
|
30
30
|
}) as EventEmitter;
|
|
31
|
-
jest.spyOn(auth, 'postLoginService').mockImplementation(() => Promise.resolve({}));
|
|
32
31
|
});
|
|
33
32
|
|
|
34
33
|
beforeEach(() => {
|
|
@@ -260,6 +259,8 @@ describe('Base TS Embed', () => {
|
|
|
260
259
|
expect(prefetchIframe.length).toBe(1);
|
|
261
260
|
const firstIframe = <HTMLIFrameElement>prefetchIframe[0];
|
|
262
261
|
expect(firstIframe.src).toBe(url);
|
|
262
|
+
expect(firstIframe.style.width).toBe('0px');
|
|
263
|
+
expect(firstIframe.classList.contains('prefetchIframeNum-0')).toBe(true);
|
|
263
264
|
});
|
|
264
265
|
|
|
265
266
|
test('Should add the prefetch iframe when prefetch is called with multiple options', async () => {
|