@thoughtspot/visual-embed-sdk 1.40.1-alpha.3 → 1.40.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/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +13 -2
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +124 -2
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +11 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +12 -1
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/index.d.ts +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +2 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/types.d.ts +94 -3
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +22 -11
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/custom-actions.d.ts +12 -0
- package/cjs/src/utils/custom-actions.d.ts.map +1 -0
- package/cjs/src/utils/custom-actions.js +191 -0
- package/cjs/src/utils/custom-actions.js.map +1 -0
- package/cjs/src/utils/custom-actions.spec.d.ts +2 -0
- package/cjs/src/utils/custom-actions.spec.d.ts.map +1 -0
- package/cjs/src/utils/custom-actions.spec.js +437 -0
- package/cjs/src/utils/custom-actions.spec.js.map +1 -0
- package/cjs/src/utils.d.ts +7 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +11 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +28 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-B0uCTBbm.js → index-Dx5UP5Ip.js} +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +11 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +94 -3
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/custom-actions.d.ts +12 -0
- package/dist/src/utils/custom-actions.d.ts.map +1 -0
- package/dist/src/utils/custom-actions.spec.d.ts +2 -0
- package/dist/src/utils/custom-actions.spec.d.ts.map +1 -0
- package/dist/src/utils.d.ts +7 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +1684 -201
- package/dist/tsembed-react.js +1683 -200
- package/dist/tsembed.es.js +1636 -153
- package/dist/tsembed.js +1635 -152
- package/dist/visual-embed-sdk-react-full.d.ts +95 -4
- package/dist/visual-embed-sdk-react.d.ts +95 -4
- package/dist/visual-embed-sdk.d.ts +95 -4
- package/lib/package.json +2 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +13 -2
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +125 -3
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +11 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +11 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/index.d.ts +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +1 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +94 -3
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +21 -10
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/custom-actions.d.ts +12 -0
- package/lib/src/utils/custom-actions.d.ts.map +1 -0
- package/lib/src/utils/custom-actions.js +186 -0
- package/lib/src/utils/custom-actions.js.map +1 -0
- package/lib/src/utils/custom-actions.spec.d.ts +2 -0
- package/lib/src/utils/custom-actions.spec.d.ts.map +1 -0
- package/lib/src/utils/custom-actions.spec.js +435 -0
- package/lib/src/utils/custom-actions.spec.js.map +1 -0
- package/lib/src/utils.d.ts +7 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +9 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +29 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +96 -5
- package/package.json +2 -2
- package/src/embed/ts-embed.spec.ts +137 -3
- package/src/embed/ts-embed.ts +13 -1
- package/src/errors.ts +12 -0
- package/src/index.ts +4 -0
- package/src/react/index.tsx +1 -0
- package/src/types.ts +110 -15
- package/src/utils/custom-actions.spec.ts +471 -0
- package/src/utils/custom-actions.ts +228 -0
- package/src/utils.spec.ts +34 -0
- package/src/utils.ts +10 -0
- package/dist/es/index-BwesxE_h.js +0 -7369
- package/dist/es/index.js +0 -17539
- package/dist/es/react/index.js +0 -24039
- package/dist/es/react/src/auth.d.ts +0 -171
- package/dist/es/react/src/auth.d.ts.map +0 -1
- package/dist/es/react/src/auth.spec.d.ts +0 -15
- package/dist/es/react/src/auth.spec.d.ts.map +0 -1
- package/dist/es/react/src/authToken.d.ts +0 -17
- package/dist/es/react/src/authToken.d.ts.map +0 -1
- package/dist/es/react/src/authToken.spec.d.ts +0 -2
- package/dist/es/react/src/authToken.spec.d.ts.map +0 -1
- package/dist/es/react/src/config.d.ts +0 -21
- package/dist/es/react/src/config.d.ts.map +0 -1
- package/dist/es/react/src/config.spec.d.ts +0 -5
- package/dist/es/react/src/config.spec.d.ts.map +0 -1
- package/dist/es/react/src/css-variables.d.ts +0 -384
- package/dist/es/react/src/css-variables.d.ts.map +0 -1
- package/dist/es/react/src/embed/app.d.ts +0 -478
- package/dist/es/react/src/embed/app.d.ts.map +0 -1
- package/dist/es/react/src/embed/app.spec.d.ts +0 -2
- package/dist/es/react/src/embed/app.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/base.d.ts +0 -136
- package/dist/es/react/src/embed/base.d.ts.map +0 -1
- package/dist/es/react/src/embed/base.spec.d.ts +0 -2
- package/dist/es/react/src/embed/base.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/bodyless-conversation.d.ts +0 -26
- package/dist/es/react/src/embed/bodyless-conversation.d.ts.map +0 -1
- package/dist/es/react/src/embed/bodyless-conversation.spec.d.ts +0 -2
- package/dist/es/react/src/embed/bodyless-conversation.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/conversation.d.ts +0 -43
- package/dist/es/react/src/embed/conversation.d.ts.map +0 -1
- package/dist/es/react/src/embed/conversation.spec.d.ts +0 -2
- package/dist/es/react/src/embed/conversation.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/embed.spec.d.ts +0 -2
- package/dist/es/react/src/embed/embed.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/embedConfig.d.ts +0 -17
- package/dist/es/react/src/embed/embedConfig.d.ts.map +0 -1
- package/dist/es/react/src/embed/events.spec.d.ts +0 -2
- package/dist/es/react/src/embed/events.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/liveboard.d.ts +0 -379
- package/dist/es/react/src/embed/liveboard.d.ts.map +0 -1
- package/dist/es/react/src/embed/liveboard.spec.d.ts +0 -2
- package/dist/es/react/src/embed/liveboard.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/pinboard.spec.d.ts +0 -2
- package/dist/es/react/src/embed/pinboard.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/sage.d.ts +0 -148
- package/dist/es/react/src/embed/sage.d.ts.map +0 -1
- package/dist/es/react/src/embed/sage.spec.d.ts +0 -2
- package/dist/es/react/src/embed/sage.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/search-bar.d.ts +0 -93
- package/dist/es/react/src/embed/search-bar.d.ts.map +0 -1
- package/dist/es/react/src/embed/search.d.ts +0 -282
- package/dist/es/react/src/embed/search.d.ts.map +0 -1
- package/dist/es/react/src/embed/search.spec.d.ts +0 -2
- package/dist/es/react/src/embed/search.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/ts-embed-trigger.spec.d.ts +0 -2
- package/dist/es/react/src/embed/ts-embed-trigger.spec.d.ts.map +0 -1
- package/dist/es/react/src/embed/ts-embed.d.ts +0 -374
- package/dist/es/react/src/embed/ts-embed.d.ts.map +0 -1
- package/dist/es/react/src/embed/ts-embed.spec.d.ts +0 -2
- package/dist/es/react/src/embed/ts-embed.spec.d.ts.map +0 -1
- package/dist/es/react/src/errors.d.ts +0 -19
- package/dist/es/react/src/errors.d.ts.map +0 -1
- package/dist/es/react/src/index.d.ts +0 -29
- package/dist/es/react/src/index.d.ts.map +0 -1
- package/dist/es/react/src/mixpanel-service.d.ts +0 -35
- package/dist/es/react/src/mixpanel-service.d.ts.map +0 -1
- package/dist/es/react/src/mixpanel-service.spec.d.ts +0 -2
- package/dist/es/react/src/mixpanel-service.spec.d.ts.map +0 -1
- package/dist/es/react/src/react/all-types-export.d.ts +0 -3
- package/dist/es/react/src/react/all-types-export.d.ts.map +0 -1
- package/dist/es/react/src/react/all-types-export.spec.d.ts +0 -2
- package/dist/es/react/src/react/all-types-export.spec.d.ts.map +0 -1
- package/dist/es/react/src/react/index.d.ts +0 -254
- package/dist/es/react/src/react/index.d.ts.map +0 -1
- package/dist/es/react/src/react/index.spec.d.ts +0 -3
- package/dist/es/react/src/react/index.spec.d.ts.map +0 -1
- package/dist/es/react/src/react/util.d.ts +0 -19
- package/dist/es/react/src/react/util.d.ts.map +0 -1
- package/dist/es/react/src/test/test-utils.d.ts +0 -61
- package/dist/es/react/src/test/test-utils.d.ts.map +0 -1
- package/dist/es/react/src/tokenizedFetch.d.ts +0 -18
- package/dist/es/react/src/tokenizedFetch.d.ts.map +0 -1
- package/dist/es/react/src/types.d.ts +0 -4363
- package/dist/es/react/src/types.d.ts.map +0 -1
- package/dist/es/react/src/utils/authService/authService.d.ts +0 -45
- package/dist/es/react/src/utils/authService/authService.d.ts.map +0 -1
- package/dist/es/react/src/utils/authService/authService.spec.d.ts +0 -2
- package/dist/es/react/src/utils/authService/authService.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/authService/index.d.ts +0 -3
- package/dist/es/react/src/utils/authService/index.d.ts.map +0 -1
- package/dist/es/react/src/utils/authService/tokenizedAuthService.d.ts +0 -22
- package/dist/es/react/src/utils/authService/tokenizedAuthService.d.ts.map +0 -1
- package/dist/es/react/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
- package/dist/es/react/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/global-styles.d.ts +0 -2
- package/dist/es/react/src/utils/global-styles.d.ts.map +0 -1
- package/dist/es/react/src/utils/global-styles.spec.d.ts +0 -2
- package/dist/es/react/src/utils/global-styles.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/answerService/answer-queries.d.ts +0 -10
- package/dist/es/react/src/utils/graphql/answerService/answer-queries.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/answerService/answerService.d.ts +0 -180
- package/dist/es/react/src/utils/graphql/answerService/answerService.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/answerService/answerService.spec.d.ts +0 -2
- package/dist/es/react/src/utils/graphql/answerService/answerService.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/graphql-request.d.ts +0 -15
- package/dist/es/react/src/utils/graphql/graphql-request.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/graphql-request.spec.d.ts +0 -2
- package/dist/es/react/src/utils/graphql/graphql-request.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/nlsService/conversation-queries.d.ts +0 -3
- package/dist/es/react/src/utils/graphql/nlsService/conversation-queries.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/nlsService/conversation-service.d.ts +0 -12
- package/dist/es/react/src/utils/graphql/nlsService/conversation-service.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/nlsService/nls-answer-queries.d.ts +0 -2
- package/dist/es/react/src/utils/graphql/nlsService/nls-answer-queries.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/nlsService/nls-answer-service.d.ts +0 -17
- package/dist/es/react/src/utils/graphql/nlsService/nls-answer-service.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/nlsService/nls-answer-service.spec.d.ts +0 -2
- package/dist/es/react/src/utils/graphql/nlsService/nls-answer-service.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/preview-service.d.ts +0 -9
- package/dist/es/react/src/utils/graphql/preview-service.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/preview-service.spec.d.ts +0 -2
- package/dist/es/react/src/utils/graphql/preview-service.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/sourceService.d.ts +0 -8
- package/dist/es/react/src/utils/graphql/sourceService.d.ts.map +0 -1
- package/dist/es/react/src/utils/graphql/sourceService.spec.d.ts +0 -2
- package/dist/es/react/src/utils/graphql/sourceService.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/liveboardService/liveboardService.d.ts +0 -16
- package/dist/es/react/src/utils/liveboardService/liveboardService.d.ts.map +0 -1
- package/dist/es/react/src/utils/liveboardService/liveboardService.spec.d.ts +0 -2
- package/dist/es/react/src/utils/liveboardService/liveboardService.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/logger.d.ts +0 -18
- package/dist/es/react/src/utils/logger.d.ts.map +0 -1
- package/dist/es/react/src/utils/logger.spec.d.ts +0 -25
- package/dist/es/react/src/utils/logger.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/processData.d.ts +0 -22
- package/dist/es/react/src/utils/processData.d.ts.map +0 -1
- package/dist/es/react/src/utils/processData.spec.d.ts +0 -2
- package/dist/es/react/src/utils/processData.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/processTrigger.d.ts +0 -16
- package/dist/es/react/src/utils/processTrigger.d.ts.map +0 -1
- package/dist/es/react/src/utils/processTrigger.spec.d.ts +0 -2
- package/dist/es/react/src/utils/processTrigger.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/reporting.d.ts +0 -16
- package/dist/es/react/src/utils/reporting.d.ts.map +0 -1
- package/dist/es/react/src/utils/reporting.spec.d.ts +0 -2
- package/dist/es/react/src/utils/reporting.spec.d.ts.map +0 -1
- package/dist/es/react/src/utils/sessionInfoService.d.ts +0 -66
- package/dist/es/react/src/utils/sessionInfoService.d.ts.map +0 -1
- package/dist/es/react/src/utils.d.ts +0 -104
- package/dist/es/react/src/utils.d.ts.map +0 -1
- package/dist/es/react/src/utils.spec.d.ts +0 -2
- package/dist/es/react/src/utils.spec.d.ts.map +0 -1
- package/dist/es/src/auth.d.ts +0 -171
- package/dist/es/src/auth.d.ts.map +0 -1
- package/dist/es/src/auth.spec.d.ts +0 -15
- package/dist/es/src/auth.spec.d.ts.map +0 -1
- package/dist/es/src/authToken.d.ts +0 -17
- package/dist/es/src/authToken.d.ts.map +0 -1
- package/dist/es/src/authToken.spec.d.ts +0 -2
- package/dist/es/src/authToken.spec.d.ts.map +0 -1
- package/dist/es/src/config.d.ts +0 -21
- package/dist/es/src/config.d.ts.map +0 -1
- package/dist/es/src/config.spec.d.ts +0 -5
- package/dist/es/src/config.spec.d.ts.map +0 -1
- package/dist/es/src/css-variables.d.ts +0 -384
- package/dist/es/src/css-variables.d.ts.map +0 -1
- package/dist/es/src/embed/app.d.ts +0 -478
- package/dist/es/src/embed/app.d.ts.map +0 -1
- package/dist/es/src/embed/app.spec.d.ts +0 -2
- package/dist/es/src/embed/app.spec.d.ts.map +0 -1
- package/dist/es/src/embed/base.d.ts +0 -136
- package/dist/es/src/embed/base.d.ts.map +0 -1
- package/dist/es/src/embed/base.spec.d.ts +0 -2
- package/dist/es/src/embed/base.spec.d.ts.map +0 -1
- package/dist/es/src/embed/bodyless-conversation.d.ts +0 -26
- package/dist/es/src/embed/bodyless-conversation.d.ts.map +0 -1
- package/dist/es/src/embed/bodyless-conversation.spec.d.ts +0 -2
- package/dist/es/src/embed/bodyless-conversation.spec.d.ts.map +0 -1
- package/dist/es/src/embed/conversation.d.ts +0 -43
- package/dist/es/src/embed/conversation.d.ts.map +0 -1
- package/dist/es/src/embed/conversation.spec.d.ts +0 -2
- package/dist/es/src/embed/conversation.spec.d.ts.map +0 -1
- package/dist/es/src/embed/embed.spec.d.ts +0 -2
- package/dist/es/src/embed/embed.spec.d.ts.map +0 -1
- package/dist/es/src/embed/embedConfig.d.ts +0 -17
- package/dist/es/src/embed/embedConfig.d.ts.map +0 -1
- package/dist/es/src/embed/events.spec.d.ts +0 -2
- package/dist/es/src/embed/events.spec.d.ts.map +0 -1
- package/dist/es/src/embed/liveboard.d.ts +0 -379
- package/dist/es/src/embed/liveboard.d.ts.map +0 -1
- package/dist/es/src/embed/liveboard.spec.d.ts +0 -2
- package/dist/es/src/embed/liveboard.spec.d.ts.map +0 -1
- package/dist/es/src/embed/pinboard.spec.d.ts +0 -2
- package/dist/es/src/embed/pinboard.spec.d.ts.map +0 -1
- package/dist/es/src/embed/sage.d.ts +0 -148
- package/dist/es/src/embed/sage.d.ts.map +0 -1
- package/dist/es/src/embed/sage.spec.d.ts +0 -2
- package/dist/es/src/embed/sage.spec.d.ts.map +0 -1
- package/dist/es/src/embed/search-bar.d.ts +0 -93
- package/dist/es/src/embed/search-bar.d.ts.map +0 -1
- package/dist/es/src/embed/search.d.ts +0 -282
- package/dist/es/src/embed/search.d.ts.map +0 -1
- package/dist/es/src/embed/search.spec.d.ts +0 -2
- package/dist/es/src/embed/search.spec.d.ts.map +0 -1
- package/dist/es/src/embed/ts-embed-trigger.spec.d.ts +0 -2
- package/dist/es/src/embed/ts-embed-trigger.spec.d.ts.map +0 -1
- package/dist/es/src/embed/ts-embed.d.ts +0 -374
- package/dist/es/src/embed/ts-embed.d.ts.map +0 -1
- package/dist/es/src/embed/ts-embed.spec.d.ts +0 -2
- package/dist/es/src/embed/ts-embed.spec.d.ts.map +0 -1
- package/dist/es/src/errors.d.ts +0 -19
- package/dist/es/src/errors.d.ts.map +0 -1
- package/dist/es/src/index.d.ts +0 -29
- package/dist/es/src/index.d.ts.map +0 -1
- package/dist/es/src/mixpanel-service.d.ts +0 -35
- package/dist/es/src/mixpanel-service.d.ts.map +0 -1
- package/dist/es/src/mixpanel-service.spec.d.ts +0 -2
- package/dist/es/src/mixpanel-service.spec.d.ts.map +0 -1
- package/dist/es/src/react/all-types-export.d.ts +0 -3
- package/dist/es/src/react/all-types-export.d.ts.map +0 -1
- package/dist/es/src/react/all-types-export.spec.d.ts +0 -2
- package/dist/es/src/react/all-types-export.spec.d.ts.map +0 -1
- package/dist/es/src/react/index.d.ts +0 -254
- package/dist/es/src/react/index.d.ts.map +0 -1
- package/dist/es/src/react/index.spec.d.ts +0 -3
- package/dist/es/src/react/index.spec.d.ts.map +0 -1
- package/dist/es/src/react/util.d.ts +0 -19
- package/dist/es/src/react/util.d.ts.map +0 -1
- package/dist/es/src/test/test-utils.d.ts +0 -61
- package/dist/es/src/test/test-utils.d.ts.map +0 -1
- package/dist/es/src/tokenizedFetch.d.ts +0 -18
- package/dist/es/src/tokenizedFetch.d.ts.map +0 -1
- package/dist/es/src/types.d.ts +0 -4363
- package/dist/es/src/types.d.ts.map +0 -1
- package/dist/es/src/utils/authService/authService.d.ts +0 -45
- package/dist/es/src/utils/authService/authService.d.ts.map +0 -1
- package/dist/es/src/utils/authService/authService.spec.d.ts +0 -2
- package/dist/es/src/utils/authService/authService.spec.d.ts.map +0 -1
- package/dist/es/src/utils/authService/index.d.ts +0 -3
- package/dist/es/src/utils/authService/index.d.ts.map +0 -1
- package/dist/es/src/utils/authService/tokenizedAuthService.d.ts +0 -22
- package/dist/es/src/utils/authService/tokenizedAuthService.d.ts.map +0 -1
- package/dist/es/src/utils/authService/tokenizedAuthService.spec.d.ts +0 -2
- package/dist/es/src/utils/authService/tokenizedAuthService.spec.d.ts.map +0 -1
- package/dist/es/src/utils/global-styles.d.ts +0 -2
- package/dist/es/src/utils/global-styles.d.ts.map +0 -1
- package/dist/es/src/utils/global-styles.spec.d.ts +0 -2
- package/dist/es/src/utils/global-styles.spec.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/answerService/answer-queries.d.ts +0 -10
- package/dist/es/src/utils/graphql/answerService/answer-queries.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/answerService/answerService.d.ts +0 -180
- package/dist/es/src/utils/graphql/answerService/answerService.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/answerService/answerService.spec.d.ts +0 -2
- package/dist/es/src/utils/graphql/answerService/answerService.spec.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/graphql-request.d.ts +0 -15
- package/dist/es/src/utils/graphql/graphql-request.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/graphql-request.spec.d.ts +0 -2
- package/dist/es/src/utils/graphql/graphql-request.spec.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/nlsService/conversation-queries.d.ts +0 -3
- package/dist/es/src/utils/graphql/nlsService/conversation-queries.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/nlsService/conversation-service.d.ts +0 -12
- package/dist/es/src/utils/graphql/nlsService/conversation-service.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/nlsService/nls-answer-queries.d.ts +0 -2
- package/dist/es/src/utils/graphql/nlsService/nls-answer-queries.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/nlsService/nls-answer-service.d.ts +0 -17
- package/dist/es/src/utils/graphql/nlsService/nls-answer-service.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/nlsService/nls-answer-service.spec.d.ts +0 -2
- package/dist/es/src/utils/graphql/nlsService/nls-answer-service.spec.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/preview-service.d.ts +0 -9
- package/dist/es/src/utils/graphql/preview-service.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/preview-service.spec.d.ts +0 -2
- package/dist/es/src/utils/graphql/preview-service.spec.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/sourceService.d.ts +0 -8
- package/dist/es/src/utils/graphql/sourceService.d.ts.map +0 -1
- package/dist/es/src/utils/graphql/sourceService.spec.d.ts +0 -2
- package/dist/es/src/utils/graphql/sourceService.spec.d.ts.map +0 -1
- package/dist/es/src/utils/liveboardService/liveboardService.d.ts +0 -16
- package/dist/es/src/utils/liveboardService/liveboardService.d.ts.map +0 -1
- package/dist/es/src/utils/liveboardService/liveboardService.spec.d.ts +0 -2
- package/dist/es/src/utils/liveboardService/liveboardService.spec.d.ts.map +0 -1
- package/dist/es/src/utils/logger.d.ts +0 -18
- package/dist/es/src/utils/logger.d.ts.map +0 -1
- package/dist/es/src/utils/logger.spec.d.ts +0 -25
- package/dist/es/src/utils/logger.spec.d.ts.map +0 -1
- package/dist/es/src/utils/processData.d.ts +0 -22
- package/dist/es/src/utils/processData.d.ts.map +0 -1
- package/dist/es/src/utils/processData.spec.d.ts +0 -2
- package/dist/es/src/utils/processData.spec.d.ts.map +0 -1
- package/dist/es/src/utils/processTrigger.d.ts +0 -16
- package/dist/es/src/utils/processTrigger.d.ts.map +0 -1
- package/dist/es/src/utils/processTrigger.spec.d.ts +0 -2
- package/dist/es/src/utils/processTrigger.spec.d.ts.map +0 -1
- package/dist/es/src/utils/reporting.d.ts +0 -16
- package/dist/es/src/utils/reporting.d.ts.map +0 -1
- package/dist/es/src/utils/reporting.spec.d.ts +0 -2
- package/dist/es/src/utils/reporting.spec.d.ts.map +0 -1
- package/dist/es/src/utils/sessionInfoService.d.ts +0 -66
- package/dist/es/src/utils/sessionInfoService.d.ts.map +0 -1
- package/dist/es/src/utils.d.ts +0 -104
- package/dist/es/src/utils.d.ts.map +0 -1
- package/dist/es/src/utils.spec.d.ts +0 -2
- package/dist/es/src/utils.spec.d.ts.map +0 -1
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.40.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.40.2 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -217,7 +217,6 @@
|
|
|
217
217
|
* the embedded app
|
|
218
218
|
* @group Authentication / Init
|
|
219
219
|
*/
|
|
220
|
-
// eslint-disable-next-line no-shadow
|
|
221
220
|
var AuthType;
|
|
222
221
|
(function (AuthType) {
|
|
223
222
|
/**
|
|
@@ -431,7 +430,6 @@
|
|
|
431
430
|
/**
|
|
432
431
|
* A map of the supported runtime filter operations
|
|
433
432
|
*/
|
|
434
|
-
// eslint-disable-next-line no-shadow
|
|
435
433
|
exports.RuntimeFilterOp = void 0;
|
|
436
434
|
(function (RuntimeFilterOp) {
|
|
437
435
|
/**
|
|
@@ -502,7 +500,6 @@
|
|
|
502
500
|
* `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
|
|
503
501
|
* @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
|
|
504
502
|
*/
|
|
505
|
-
// eslint-disable-next-line no-shadow
|
|
506
503
|
exports.HomepageModule = void 0;
|
|
507
504
|
(function (HomepageModule) {
|
|
508
505
|
/**
|
|
@@ -535,7 +532,6 @@
|
|
|
535
532
|
* **Note**: This option is applicable to full app embedding only.
|
|
536
533
|
* @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
|
|
537
534
|
*/
|
|
538
|
-
// eslint-disable-next-line no-shadow
|
|
539
535
|
exports.ListPageColumns = void 0;
|
|
540
536
|
(function (ListPageColumns) {
|
|
541
537
|
/**
|
|
@@ -598,7 +594,6 @@
|
|
|
598
594
|
* ```
|
|
599
595
|
* @group Events
|
|
600
596
|
*/
|
|
601
|
-
// eslint-disable-next-line no-shadow
|
|
602
597
|
exports.EmbedEvent = void 0;
|
|
603
598
|
(function (EmbedEvent) {
|
|
604
599
|
/**
|
|
@@ -1778,7 +1773,6 @@
|
|
|
1778
1773
|
* ```
|
|
1779
1774
|
* @group Events
|
|
1780
1775
|
*/
|
|
1781
|
-
// eslint-disable-next-line no-shadow
|
|
1782
1776
|
exports.HostEvent = void 0;
|
|
1783
1777
|
(function (HostEvent) {
|
|
1784
1778
|
/**
|
|
@@ -2993,7 +2987,6 @@
|
|
|
2993
2987
|
* The different visual modes that the data sources panel within
|
|
2994
2988
|
* search could appear in, such as hidden, collapsed, or expanded.
|
|
2995
2989
|
*/
|
|
2996
|
-
// eslint-disable-next-line no-shadow
|
|
2997
2990
|
var DataSourceVisualMode;
|
|
2998
2991
|
(function (DataSourceVisualMode) {
|
|
2999
2992
|
/**
|
|
@@ -3013,7 +3006,6 @@
|
|
|
3013
3006
|
* The query params passed down to the embedded ThoughtSpot app
|
|
3014
3007
|
* containing configuration and/or visual information.
|
|
3015
3008
|
*/
|
|
3016
|
-
// eslint-disable-next-line no-shadow
|
|
3017
3009
|
var Param;
|
|
3018
3010
|
(function (Param) {
|
|
3019
3011
|
Param["EmbedApp"] = "embedApp";
|
|
@@ -3164,7 +3156,6 @@
|
|
|
3164
3156
|
* ```
|
|
3165
3157
|
* See also link:https://developers.thoughtspot.com/docs/actions[Action IDs in the SDK]
|
|
3166
3158
|
*/
|
|
3167
|
-
// eslint-disable-next-line no-shadow
|
|
3168
3159
|
exports.Action = void 0;
|
|
3169
3160
|
(function (Action) {
|
|
3170
3161
|
/**
|
|
@@ -3709,7 +3700,7 @@
|
|
|
3709
3700
|
* The Favorites icon (*) for Answers,
|
|
3710
3701
|
* Liveboard, and data objects like Worksheet, Model,
|
|
3711
3702
|
* Tables and Views.
|
|
3712
|
-
* Allows adding an object to the user
|
|
3703
|
+
* Allows adding an object to the user's favorites list.
|
|
3713
3704
|
* @example
|
|
3714
3705
|
* ```js
|
|
3715
3706
|
* disabledActions: [Action.AddToFavorites]
|
|
@@ -4436,6 +4427,26 @@
|
|
|
4436
4427
|
ContextMenuTriggerOptions["RIGHT_CLICK"] = "right-click";
|
|
4437
4428
|
ContextMenuTriggerOptions["BOTH_CLICKS"] = "both-clicks";
|
|
4438
4429
|
})(ContextMenuTriggerOptions || (ContextMenuTriggerOptions = {}));
|
|
4430
|
+
/**
|
|
4431
|
+
* Enum options to show custom actions at different
|
|
4432
|
+
* positions in the application.
|
|
4433
|
+
*/
|
|
4434
|
+
exports.CustomActionsPosition = void 0;
|
|
4435
|
+
(function (CustomActionsPosition) {
|
|
4436
|
+
CustomActionsPosition["PRIMARY"] = "PRIMARY";
|
|
4437
|
+
CustomActionsPosition["MENU"] = "MENU";
|
|
4438
|
+
CustomActionsPosition["CONTEXTMENU"] = "CONTEXTMENU";
|
|
4439
|
+
})(exports.CustomActionsPosition || (exports.CustomActionsPosition = {}));
|
|
4440
|
+
/**
|
|
4441
|
+
* Enum options to mention the target of the custom action.
|
|
4442
|
+
*/
|
|
4443
|
+
var CustomActionTarget;
|
|
4444
|
+
(function (CustomActionTarget) {
|
|
4445
|
+
CustomActionTarget["LIVEBOARD"] = "LIVEBOARD";
|
|
4446
|
+
CustomActionTarget["VIZ"] = "VIZ";
|
|
4447
|
+
CustomActionTarget["ANSWER"] = "ANSWER";
|
|
4448
|
+
CustomActionTarget["SPOTTER"] = "SPOTTER";
|
|
4449
|
+
})(CustomActionTarget || (CustomActionTarget = {}));
|
|
4439
4450
|
/**
|
|
4440
4451
|
* Enum options to show or suppress Visual Embed SDK and
|
|
4441
4452
|
* ThoughtSpot application logs in the console output.
|
|
@@ -4896,6 +4907,15 @@
|
|
|
4896
4907
|
* @returns The stored value or `undefined` if the key is not found.
|
|
4897
4908
|
*/
|
|
4898
4909
|
const getValueFromWindow = (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key]; };
|
|
4910
|
+
/**
|
|
4911
|
+
* Check if an array includes a string value
|
|
4912
|
+
* @param arr - The array to check
|
|
4913
|
+
* @param key - The string to search for
|
|
4914
|
+
* @returns boolean indicating if the string is found in the array
|
|
4915
|
+
*/
|
|
4916
|
+
const arrayIncludesString = (arr, key) => {
|
|
4917
|
+
return arr.some(item => typeof item === 'string' && item === key);
|
|
4918
|
+
};
|
|
4899
4919
|
/**
|
|
4900
4920
|
* Check if the document is currently in fullscreen mode
|
|
4901
4921
|
*/
|
|
@@ -5980,8 +6000,8 @@
|
|
|
5980
6000
|
var _cacheHas = cacheHas;
|
|
5981
6001
|
|
|
5982
6002
|
/** Used to compose bitmasks for value comparisons. */
|
|
5983
|
-
var COMPARE_PARTIAL_FLAG$
|
|
5984
|
-
COMPARE_UNORDERED_FLAG$
|
|
6003
|
+
var COMPARE_PARTIAL_FLAG$5 = 1,
|
|
6004
|
+
COMPARE_UNORDERED_FLAG$3 = 2;
|
|
5985
6005
|
|
|
5986
6006
|
/**
|
|
5987
6007
|
* A specialized version of `baseIsEqualDeep` for arrays with support for
|
|
@@ -5997,7 +6017,7 @@
|
|
|
5997
6017
|
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
|
5998
6018
|
*/
|
|
5999
6019
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
6000
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$
|
|
6020
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
|
|
6001
6021
|
arrLength = array.length,
|
|
6002
6022
|
othLength = other.length;
|
|
6003
6023
|
|
|
@@ -6012,7 +6032,7 @@
|
|
|
6012
6032
|
}
|
|
6013
6033
|
var index = -1,
|
|
6014
6034
|
result = true,
|
|
6015
|
-
seen = (bitmask & COMPARE_UNORDERED_FLAG$
|
|
6035
|
+
seen = (bitmask & COMPARE_UNORDERED_FLAG$3) ? new _SetCache : undefined;
|
|
6016
6036
|
|
|
6017
6037
|
stack.set(array, other);
|
|
6018
6038
|
stack.set(other, array);
|
|
@@ -6104,8 +6124,8 @@
|
|
|
6104
6124
|
var _setToArray = setToArray;
|
|
6105
6125
|
|
|
6106
6126
|
/** Used to compose bitmasks for value comparisons. */
|
|
6107
|
-
var COMPARE_PARTIAL_FLAG$
|
|
6108
|
-
COMPARE_UNORDERED_FLAG = 2;
|
|
6127
|
+
var COMPARE_PARTIAL_FLAG$4 = 1,
|
|
6128
|
+
COMPARE_UNORDERED_FLAG$2 = 2;
|
|
6109
6129
|
|
|
6110
6130
|
/** `Object#toString` result references. */
|
|
6111
6131
|
var boolTag$2 = '[object Boolean]',
|
|
@@ -6116,14 +6136,14 @@
|
|
|
6116
6136
|
regexpTag$1 = '[object RegExp]',
|
|
6117
6137
|
setTag$3 = '[object Set]',
|
|
6118
6138
|
stringTag$1 = '[object String]',
|
|
6119
|
-
symbolTag = '[object Symbol]';
|
|
6139
|
+
symbolTag$1 = '[object Symbol]';
|
|
6120
6140
|
|
|
6121
6141
|
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
6122
6142
|
dataViewTag$2 = '[object DataView]';
|
|
6123
6143
|
|
|
6124
6144
|
/** Used to convert symbols to primitives and strings. */
|
|
6125
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
6126
|
-
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
6145
|
+
var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
|
|
6146
|
+
symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
|
|
6127
6147
|
|
|
6128
6148
|
/**
|
|
6129
6149
|
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
|
@@ -6180,7 +6200,7 @@
|
|
|
6180
6200
|
var convert = _mapToArray;
|
|
6181
6201
|
|
|
6182
6202
|
case setTag$3:
|
|
6183
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$
|
|
6203
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
|
|
6184
6204
|
convert || (convert = _setToArray);
|
|
6185
6205
|
|
|
6186
6206
|
if (object.size != other.size && !isPartial) {
|
|
@@ -6191,7 +6211,7 @@
|
|
|
6191
6211
|
if (stacked) {
|
|
6192
6212
|
return stacked == other;
|
|
6193
6213
|
}
|
|
6194
|
-
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
6214
|
+
bitmask |= COMPARE_UNORDERED_FLAG$2;
|
|
6195
6215
|
|
|
6196
6216
|
// Recursively compare objects (susceptible to call stack limits).
|
|
6197
6217
|
stack.set(object, other);
|
|
@@ -6199,7 +6219,7 @@
|
|
|
6199
6219
|
stack['delete'](object);
|
|
6200
6220
|
return result;
|
|
6201
6221
|
|
|
6202
|
-
case symbolTag:
|
|
6222
|
+
case symbolTag$1:
|
|
6203
6223
|
if (symbolValueOf) {
|
|
6204
6224
|
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
6205
6225
|
}
|
|
@@ -6890,7 +6910,7 @@
|
|
|
6890
6910
|
var _getAllKeys = getAllKeys;
|
|
6891
6911
|
|
|
6892
6912
|
/** Used to compose bitmasks for value comparisons. */
|
|
6893
|
-
var COMPARE_PARTIAL_FLAG$
|
|
6913
|
+
var COMPARE_PARTIAL_FLAG$3 = 1;
|
|
6894
6914
|
|
|
6895
6915
|
/** Used for built-in method references. */
|
|
6896
6916
|
var objectProto$2 = Object.prototype;
|
|
@@ -6912,7 +6932,7 @@
|
|
|
6912
6932
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
6913
6933
|
*/
|
|
6914
6934
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
6915
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$
|
|
6935
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
|
|
6916
6936
|
objProps = _getAllKeys(object),
|
|
6917
6937
|
objLength = objProps.length,
|
|
6918
6938
|
othProps = _getAllKeys(other),
|
|
@@ -7050,7 +7070,7 @@
|
|
|
7050
7070
|
var _getTag = getTag;
|
|
7051
7071
|
|
|
7052
7072
|
/** Used to compose bitmasks for value comparisons. */
|
|
7053
|
-
var COMPARE_PARTIAL_FLAG = 1;
|
|
7073
|
+
var COMPARE_PARTIAL_FLAG$2 = 1;
|
|
7054
7074
|
|
|
7055
7075
|
/** `Object#toString` result references. */
|
|
7056
7076
|
var argsTag = '[object Arguments]',
|
|
@@ -7103,7 +7123,7 @@
|
|
|
7103
7123
|
? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
|
7104
7124
|
: _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
7105
7125
|
}
|
|
7106
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
7126
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
|
|
7107
7127
|
var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, '__wrapped__'),
|
|
7108
7128
|
othIsWrapped = othIsObj && hasOwnProperty$2.call(other, '__wrapped__');
|
|
7109
7129
|
|
|
@@ -7273,6 +7293,17 @@
|
|
|
7273
7293
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7274
7294
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
7275
7295
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7296
|
+
};
|
|
7297
|
+
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7298
|
+
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
7299
|
+
MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
|
|
7300
|
+
UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
|
|
7301
|
+
INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
|
|
7302
|
+
MULTIPLE_PRIMARY_ACTIONS: (targetType, existingName, newName) => `Multiple primary actions found for ${targetType.toLowerCase()}-level custom actions: '${existingName}' and '${newName}'. Only the first action will be shown.`,
|
|
7303
|
+
INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
|
|
7304
|
+
INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
|
|
7305
|
+
INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
|
|
7306
|
+
DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
|
|
7276
7307
|
};
|
|
7277
7308
|
|
|
7278
7309
|
const EndPoints = {
|
|
@@ -8070,196 +8101,1638 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
8070
8101
|
getFetchCSVBlobUrl(userLocale = 'en-us', includeInfo = false) {
|
|
8071
8102
|
return `${this.thoughtSpotHost}/prism/download/answer/csv?sessionId=${this.session.sessionId}&genNo=${this.session.genNo}&userLocale=${userLocale}&exportFileName=data&hideCsvHeader=${!includeInfo}`;
|
|
8072
8103
|
}
|
|
8073
|
-
/**
|
|
8074
|
-
* Just get the internal URL for this answer's data
|
|
8075
|
-
* as a PNG blob.
|
|
8076
|
-
* @param userLocale
|
|
8077
|
-
* @param omitBackground
|
|
8078
|
-
* @param deviceScaleFactor
|
|
8079
|
-
*/
|
|
8080
|
-
getFetchPNGBlobUrl(userLocale = 'en-us', omitBackground = false, deviceScaleFactor = 2) {
|
|
8081
|
-
return `${this.thoughtSpotHost}/prism/download/answer/png?sessionId=${this.session.sessionId}&deviceScaleFactor=${deviceScaleFactor}&omitBackground=${omitBackground}&genNo=${this.session.genNo}&userLocale=${userLocale}&exportFileName=data`;
|
|
8104
|
+
/**
|
|
8105
|
+
* Just get the internal URL for this answer's data
|
|
8106
|
+
* as a PNG blob.
|
|
8107
|
+
* @param userLocale
|
|
8108
|
+
* @param omitBackground
|
|
8109
|
+
* @param deviceScaleFactor
|
|
8110
|
+
*/
|
|
8111
|
+
getFetchPNGBlobUrl(userLocale = 'en-us', omitBackground = false, deviceScaleFactor = 2) {
|
|
8112
|
+
return `${this.thoughtSpotHost}/prism/download/answer/png?sessionId=${this.session.sessionId}&deviceScaleFactor=${deviceScaleFactor}&omitBackground=${omitBackground}&genNo=${this.session.genNo}&userLocale=${userLocale}&exportFileName=data`;
|
|
8113
|
+
}
|
|
8114
|
+
/**
|
|
8115
|
+
* Get underlying data given a point and the output column names.
|
|
8116
|
+
* In case of a context menu action, the selectedPoints are
|
|
8117
|
+
* automatically passed.
|
|
8118
|
+
* @param outputColumnNames
|
|
8119
|
+
* @param selectedPoints
|
|
8120
|
+
* @example
|
|
8121
|
+
* ```js
|
|
8122
|
+
* embed.on(EmbedEvent.CustomAction, e => {
|
|
8123
|
+
* const underlying = await e.answerService.getUnderlyingDataForPoint([
|
|
8124
|
+
* 'col name 1' // The column should exist in the data source.
|
|
8125
|
+
* ]);
|
|
8126
|
+
* const data = await underlying.fetchData(0, 100);
|
|
8127
|
+
* })
|
|
8128
|
+
* ```
|
|
8129
|
+
* @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
|
|
8130
|
+
*/
|
|
8131
|
+
async getUnderlyingDataForPoint(outputColumnNames, selectedPoints) {
|
|
8132
|
+
if (!selectedPoints && !this.selectedPoints) {
|
|
8133
|
+
throw new Error('Needs to be triggered in context of a point');
|
|
8134
|
+
}
|
|
8135
|
+
if (!selectedPoints) {
|
|
8136
|
+
selectedPoints = getSelectedPointsForUnderlyingDataQuery(this.selectedPoints);
|
|
8137
|
+
}
|
|
8138
|
+
const sourceDetail = await this.getSourceDetail();
|
|
8139
|
+
const ouputColumnGuids = getGuidsFromColumnNames(sourceDetail, outputColumnNames);
|
|
8140
|
+
const unAggAnswer = await graphqlQuery({
|
|
8141
|
+
query: getUnaggregatedAnswerSession,
|
|
8142
|
+
variables: {
|
|
8143
|
+
session: this.session,
|
|
8144
|
+
columns: selectedPoints,
|
|
8145
|
+
},
|
|
8146
|
+
thoughtSpotHost: this.thoughtSpotHost,
|
|
8147
|
+
});
|
|
8148
|
+
const unaggAnswerSession = new AnswerService(unAggAnswer.id, unAggAnswer.answer, this.thoughtSpotHost);
|
|
8149
|
+
const currentColumns = new Set(unAggAnswer.answer.visualizations[0].columns
|
|
8150
|
+
.map((c) => c.column.referencedColumns[0].guid));
|
|
8151
|
+
const columnsToAdd = [...ouputColumnGuids].filter((col) => !currentColumns.has(col));
|
|
8152
|
+
if (columnsToAdd.length) {
|
|
8153
|
+
await unaggAnswerSession.addColumns(columnsToAdd);
|
|
8154
|
+
}
|
|
8155
|
+
const columnsToRemove = [...currentColumns].filter((col) => !ouputColumnGuids.has(col));
|
|
8156
|
+
if (columnsToRemove.length) {
|
|
8157
|
+
await unaggAnswerSession.removeColumns(columnsToRemove);
|
|
8158
|
+
}
|
|
8159
|
+
return unaggAnswerSession;
|
|
8160
|
+
}
|
|
8161
|
+
/**
|
|
8162
|
+
* Execute a custom graphql query in the context of the answer.
|
|
8163
|
+
* @param query graphql query
|
|
8164
|
+
* @param variables graphql variables
|
|
8165
|
+
* @returns
|
|
8166
|
+
*/
|
|
8167
|
+
async executeQuery(query, variables) {
|
|
8168
|
+
const data = await graphqlQuery({
|
|
8169
|
+
query,
|
|
8170
|
+
variables: {
|
|
8171
|
+
session: this.session,
|
|
8172
|
+
...variables,
|
|
8173
|
+
},
|
|
8174
|
+
thoughtSpotHost: this.thoughtSpotHost,
|
|
8175
|
+
isCompositeQuery: false,
|
|
8176
|
+
});
|
|
8177
|
+
this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
|
|
8178
|
+
return data;
|
|
8179
|
+
}
|
|
8180
|
+
/**
|
|
8181
|
+
* Get the internal session details for the answer.
|
|
8182
|
+
* @returns
|
|
8183
|
+
*/
|
|
8184
|
+
getSession() {
|
|
8185
|
+
return this.session;
|
|
8186
|
+
}
|
|
8187
|
+
async getAnswer() {
|
|
8188
|
+
if (this.answer) {
|
|
8189
|
+
return this.answer;
|
|
8190
|
+
}
|
|
8191
|
+
this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
|
|
8192
|
+
return this.answer;
|
|
8193
|
+
}
|
|
8194
|
+
async getTML() {
|
|
8195
|
+
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8196
|
+
const edoc = object[0].edoc;
|
|
8197
|
+
const YAML = await Promise.resolve().then(function () { return index; });
|
|
8198
|
+
const parsedDoc = YAML.parse(edoc);
|
|
8199
|
+
return {
|
|
8200
|
+
answer: {
|
|
8201
|
+
...parsedDoc.answer,
|
|
8202
|
+
...this.tmlOverride,
|
|
8203
|
+
},
|
|
8204
|
+
};
|
|
8205
|
+
}
|
|
8206
|
+
async addDisplayedVizToLiveboard(liveboardId) {
|
|
8207
|
+
const { displayMode, visualizations } = await this.getAnswer();
|
|
8208
|
+
const viz = getDisplayedViz(visualizations, displayMode);
|
|
8209
|
+
return this.executeQuery(addVizToLiveboard, {
|
|
8210
|
+
liveboardId,
|
|
8211
|
+
vizId: viz.id,
|
|
8212
|
+
});
|
|
8213
|
+
}
|
|
8214
|
+
setTMLOverride(override) {
|
|
8215
|
+
this.tmlOverride = override;
|
|
8216
|
+
}
|
|
8217
|
+
}
|
|
8218
|
+
/**
|
|
8219
|
+
*
|
|
8220
|
+
* @param sourceDetail
|
|
8221
|
+
* @param colNames
|
|
8222
|
+
*/
|
|
8223
|
+
function getGuidsFromColumnNames(sourceDetail, colNames) {
|
|
8224
|
+
const cols = sourceDetail.columns.reduce((colSet, col) => {
|
|
8225
|
+
colSet[col.name.toLowerCase()] = col;
|
|
8226
|
+
return colSet;
|
|
8227
|
+
}, {});
|
|
8228
|
+
return new Set(colNames.map((colName) => {
|
|
8229
|
+
const col = cols[colName.toLowerCase()];
|
|
8230
|
+
return col.id;
|
|
8231
|
+
}));
|
|
8232
|
+
}
|
|
8233
|
+
/**
|
|
8234
|
+
*
|
|
8235
|
+
* @param selectedPoints
|
|
8236
|
+
*/
|
|
8237
|
+
function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
|
|
8238
|
+
const underlyingDataPoint = [];
|
|
8239
|
+
/**
|
|
8240
|
+
*
|
|
8241
|
+
* @param colVal
|
|
8242
|
+
*/
|
|
8243
|
+
function addPointFromColVal(colVal) {
|
|
8244
|
+
var _a;
|
|
8245
|
+
const dataType = colVal.column.dataType;
|
|
8246
|
+
colVal.column.id;
|
|
8247
|
+
let dataValue;
|
|
8248
|
+
if (dataType === 'DATE') {
|
|
8249
|
+
if (Number.isFinite(colVal.value)) {
|
|
8250
|
+
dataValue = [{
|
|
8251
|
+
epochRange: {
|
|
8252
|
+
startEpoch: colVal.value,
|
|
8253
|
+
},
|
|
8254
|
+
}];
|
|
8255
|
+
// Case for custom calendar.
|
|
8256
|
+
}
|
|
8257
|
+
else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
|
|
8258
|
+
dataValue = [{
|
|
8259
|
+
epochRange: {
|
|
8260
|
+
startEpoch: colVal.value.v.s,
|
|
8261
|
+
endEpoch: colVal.value.v.e,
|
|
8262
|
+
},
|
|
8263
|
+
}];
|
|
8264
|
+
}
|
|
8265
|
+
}
|
|
8266
|
+
else {
|
|
8267
|
+
dataValue = [{ value: colVal.value }];
|
|
8268
|
+
}
|
|
8269
|
+
underlyingDataPoint.push({
|
|
8270
|
+
columnId: colVal.column.id,
|
|
8271
|
+
dataValue,
|
|
8272
|
+
});
|
|
8273
|
+
}
|
|
8274
|
+
selectedPoints.forEach((p) => {
|
|
8275
|
+
p.selectedAttributes.forEach(addPointFromColVal);
|
|
8276
|
+
});
|
|
8277
|
+
return underlyingDataPoint;
|
|
8278
|
+
}
|
|
8279
|
+
/**
|
|
8280
|
+
*
|
|
8281
|
+
* @param visualizations
|
|
8282
|
+
* @param displayMode
|
|
8283
|
+
*/
|
|
8284
|
+
function getDisplayedViz(visualizations, displayMode) {
|
|
8285
|
+
if (displayMode === 'CHART_MODE') {
|
|
8286
|
+
return visualizations.find(
|
|
8287
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
8288
|
+
(viz) => viz.__typename === 'ChartViz');
|
|
8289
|
+
}
|
|
8290
|
+
return visualizations.find(
|
|
8291
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
8292
|
+
(viz) => viz.__typename === 'TableViz');
|
|
8293
|
+
}
|
|
8294
|
+
|
|
8295
|
+
/** Built-in value references. */
|
|
8296
|
+
var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
|
|
8297
|
+
|
|
8298
|
+
/**
|
|
8299
|
+
* Checks if `value` is a flattenable `arguments` object or array.
|
|
8300
|
+
*
|
|
8301
|
+
* @private
|
|
8302
|
+
* @param {*} value The value to check.
|
|
8303
|
+
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
|
|
8304
|
+
*/
|
|
8305
|
+
function isFlattenable(value) {
|
|
8306
|
+
return isArray_1(value) || isArguments_1(value) ||
|
|
8307
|
+
!!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
8308
|
+
}
|
|
8309
|
+
|
|
8310
|
+
var _isFlattenable = isFlattenable;
|
|
8311
|
+
|
|
8312
|
+
/**
|
|
8313
|
+
* The base implementation of `_.flatten` with support for restricting flattening.
|
|
8314
|
+
*
|
|
8315
|
+
* @private
|
|
8316
|
+
* @param {Array} array The array to flatten.
|
|
8317
|
+
* @param {number} depth The maximum recursion depth.
|
|
8318
|
+
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
|
|
8319
|
+
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
|
|
8320
|
+
* @param {Array} [result=[]] The initial result value.
|
|
8321
|
+
* @returns {Array} Returns the new flattened array.
|
|
8322
|
+
*/
|
|
8323
|
+
function baseFlatten(array, depth, predicate, isStrict, result) {
|
|
8324
|
+
var index = -1,
|
|
8325
|
+
length = array.length;
|
|
8326
|
+
|
|
8327
|
+
predicate || (predicate = _isFlattenable);
|
|
8328
|
+
result || (result = []);
|
|
8329
|
+
|
|
8330
|
+
while (++index < length) {
|
|
8331
|
+
var value = array[index];
|
|
8332
|
+
if (depth > 0 && predicate(value)) {
|
|
8333
|
+
if (depth > 1) {
|
|
8334
|
+
// Recursively flatten arrays (susceptible to call stack limits).
|
|
8335
|
+
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
|
8336
|
+
} else {
|
|
8337
|
+
_arrayPush(result, value);
|
|
8338
|
+
}
|
|
8339
|
+
} else if (!isStrict) {
|
|
8340
|
+
result[result.length] = value;
|
|
8341
|
+
}
|
|
8342
|
+
}
|
|
8343
|
+
return result;
|
|
8344
|
+
}
|
|
8345
|
+
|
|
8346
|
+
var _baseFlatten = baseFlatten;
|
|
8347
|
+
|
|
8348
|
+
/**
|
|
8349
|
+
* A specialized version of `_.map` for arrays without support for iteratee
|
|
8350
|
+
* shorthands.
|
|
8351
|
+
*
|
|
8352
|
+
* @private
|
|
8353
|
+
* @param {Array} [array] The array to iterate over.
|
|
8354
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
8355
|
+
* @returns {Array} Returns the new mapped array.
|
|
8356
|
+
*/
|
|
8357
|
+
function arrayMap(array, iteratee) {
|
|
8358
|
+
var index = -1,
|
|
8359
|
+
length = array == null ? 0 : array.length,
|
|
8360
|
+
result = Array(length);
|
|
8361
|
+
|
|
8362
|
+
while (++index < length) {
|
|
8363
|
+
result[index] = iteratee(array[index], index, array);
|
|
8364
|
+
}
|
|
8365
|
+
return result;
|
|
8366
|
+
}
|
|
8367
|
+
|
|
8368
|
+
var _arrayMap = arrayMap;
|
|
8369
|
+
|
|
8370
|
+
/** `Object#toString` result references. */
|
|
8371
|
+
var symbolTag = '[object Symbol]';
|
|
8372
|
+
|
|
8373
|
+
/**
|
|
8374
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
8375
|
+
*
|
|
8376
|
+
* @static
|
|
8377
|
+
* @memberOf _
|
|
8378
|
+
* @since 4.0.0
|
|
8379
|
+
* @category Lang
|
|
8380
|
+
* @param {*} value The value to check.
|
|
8381
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
8382
|
+
* @example
|
|
8383
|
+
*
|
|
8384
|
+
* _.isSymbol(Symbol.iterator);
|
|
8385
|
+
* // => true
|
|
8386
|
+
*
|
|
8387
|
+
* _.isSymbol('abc');
|
|
8388
|
+
* // => false
|
|
8389
|
+
*/
|
|
8390
|
+
function isSymbol(value) {
|
|
8391
|
+
return typeof value == 'symbol' ||
|
|
8392
|
+
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
8393
|
+
}
|
|
8394
|
+
|
|
8395
|
+
var isSymbol_1 = isSymbol;
|
|
8396
|
+
|
|
8397
|
+
/** Used to match property names within property paths. */
|
|
8398
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
8399
|
+
reIsPlainProp = /^\w*$/;
|
|
8400
|
+
|
|
8401
|
+
/**
|
|
8402
|
+
* Checks if `value` is a property name and not a property path.
|
|
8403
|
+
*
|
|
8404
|
+
* @private
|
|
8405
|
+
* @param {*} value The value to check.
|
|
8406
|
+
* @param {Object} [object] The object to query keys on.
|
|
8407
|
+
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
8408
|
+
*/
|
|
8409
|
+
function isKey(value, object) {
|
|
8410
|
+
if (isArray_1(value)) {
|
|
8411
|
+
return false;
|
|
8412
|
+
}
|
|
8413
|
+
var type = typeof value;
|
|
8414
|
+
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
8415
|
+
value == null || isSymbol_1(value)) {
|
|
8416
|
+
return true;
|
|
8417
|
+
}
|
|
8418
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
8419
|
+
(object != null && value in Object(object));
|
|
8420
|
+
}
|
|
8421
|
+
|
|
8422
|
+
var _isKey = isKey;
|
|
8423
|
+
|
|
8424
|
+
/** Error message constants. */
|
|
8425
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
8426
|
+
|
|
8427
|
+
/**
|
|
8428
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
8429
|
+
* provided, it determines the cache key for storing the result based on the
|
|
8430
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
8431
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
8432
|
+
* is invoked with the `this` binding of the memoized function.
|
|
8433
|
+
*
|
|
8434
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
8435
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
8436
|
+
* constructor with one whose instances implement the
|
|
8437
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
8438
|
+
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
8439
|
+
*
|
|
8440
|
+
* @static
|
|
8441
|
+
* @memberOf _
|
|
8442
|
+
* @since 0.1.0
|
|
8443
|
+
* @category Function
|
|
8444
|
+
* @param {Function} func The function to have its output memoized.
|
|
8445
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
8446
|
+
* @returns {Function} Returns the new memoized function.
|
|
8447
|
+
* @example
|
|
8448
|
+
*
|
|
8449
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
8450
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
8451
|
+
*
|
|
8452
|
+
* var values = _.memoize(_.values);
|
|
8453
|
+
* values(object);
|
|
8454
|
+
* // => [1, 2]
|
|
8455
|
+
*
|
|
8456
|
+
* values(other);
|
|
8457
|
+
* // => [3, 4]
|
|
8458
|
+
*
|
|
8459
|
+
* object.a = 2;
|
|
8460
|
+
* values(object);
|
|
8461
|
+
* // => [1, 2]
|
|
8462
|
+
*
|
|
8463
|
+
* // Modify the result cache.
|
|
8464
|
+
* values.cache.set(object, ['a', 'b']);
|
|
8465
|
+
* values(object);
|
|
8466
|
+
* // => ['a', 'b']
|
|
8467
|
+
*
|
|
8468
|
+
* // Replace `_.memoize.Cache`.
|
|
8469
|
+
* _.memoize.Cache = WeakMap;
|
|
8470
|
+
*/
|
|
8471
|
+
function memoize(func, resolver) {
|
|
8472
|
+
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
8473
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
8474
|
+
}
|
|
8475
|
+
var memoized = function() {
|
|
8476
|
+
var args = arguments,
|
|
8477
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
8478
|
+
cache = memoized.cache;
|
|
8479
|
+
|
|
8480
|
+
if (cache.has(key)) {
|
|
8481
|
+
return cache.get(key);
|
|
8482
|
+
}
|
|
8483
|
+
var result = func.apply(this, args);
|
|
8484
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
8485
|
+
return result;
|
|
8486
|
+
};
|
|
8487
|
+
memoized.cache = new (memoize.Cache || _MapCache);
|
|
8488
|
+
return memoized;
|
|
8489
|
+
}
|
|
8490
|
+
|
|
8491
|
+
// Expose `MapCache`.
|
|
8492
|
+
memoize.Cache = _MapCache;
|
|
8493
|
+
|
|
8494
|
+
var memoize_1 = memoize;
|
|
8495
|
+
|
|
8496
|
+
/** Used as the maximum memoize cache size. */
|
|
8497
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
8498
|
+
|
|
8499
|
+
/**
|
|
8500
|
+
* A specialized version of `_.memoize` which clears the memoized function's
|
|
8501
|
+
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
8502
|
+
*
|
|
8503
|
+
* @private
|
|
8504
|
+
* @param {Function} func The function to have its output memoized.
|
|
8505
|
+
* @returns {Function} Returns the new memoized function.
|
|
8506
|
+
*/
|
|
8507
|
+
function memoizeCapped(func) {
|
|
8508
|
+
var result = memoize_1(func, function(key) {
|
|
8509
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
8510
|
+
cache.clear();
|
|
8511
|
+
}
|
|
8512
|
+
return key;
|
|
8513
|
+
});
|
|
8514
|
+
|
|
8515
|
+
var cache = result.cache;
|
|
8516
|
+
return result;
|
|
8517
|
+
}
|
|
8518
|
+
|
|
8519
|
+
var _memoizeCapped = memoizeCapped;
|
|
8520
|
+
|
|
8521
|
+
/** Used to match property names within property paths. */
|
|
8522
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
8523
|
+
|
|
8524
|
+
/** Used to match backslashes in property paths. */
|
|
8525
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
8526
|
+
|
|
8527
|
+
/**
|
|
8528
|
+
* Converts `string` to a property path array.
|
|
8529
|
+
*
|
|
8530
|
+
* @private
|
|
8531
|
+
* @param {string} string The string to convert.
|
|
8532
|
+
* @returns {Array} Returns the property path array.
|
|
8533
|
+
*/
|
|
8534
|
+
var stringToPath = _memoizeCapped(function(string) {
|
|
8535
|
+
var result = [];
|
|
8536
|
+
if (string.charCodeAt(0) === 46 /* . */) {
|
|
8537
|
+
result.push('');
|
|
8538
|
+
}
|
|
8539
|
+
string.replace(rePropName, function(match, number, quote, subString) {
|
|
8540
|
+
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
8541
|
+
});
|
|
8542
|
+
return result;
|
|
8543
|
+
});
|
|
8544
|
+
|
|
8545
|
+
var _stringToPath = stringToPath;
|
|
8546
|
+
|
|
8547
|
+
/** Used as references for various `Number` constants. */
|
|
8548
|
+
var INFINITY$1 = 1 / 0;
|
|
8549
|
+
|
|
8550
|
+
/** Used to convert symbols to primitives and strings. */
|
|
8551
|
+
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
8552
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
8553
|
+
|
|
8554
|
+
/**
|
|
8555
|
+
* The base implementation of `_.toString` which doesn't convert nullish
|
|
8556
|
+
* values to empty strings.
|
|
8557
|
+
*
|
|
8558
|
+
* @private
|
|
8559
|
+
* @param {*} value The value to process.
|
|
8560
|
+
* @returns {string} Returns the string.
|
|
8561
|
+
*/
|
|
8562
|
+
function baseToString(value) {
|
|
8563
|
+
// Exit early for strings to avoid a performance hit in some environments.
|
|
8564
|
+
if (typeof value == 'string') {
|
|
8565
|
+
return value;
|
|
8566
|
+
}
|
|
8567
|
+
if (isArray_1(value)) {
|
|
8568
|
+
// Recursively convert values (susceptible to call stack limits).
|
|
8569
|
+
return _arrayMap(value, baseToString) + '';
|
|
8570
|
+
}
|
|
8571
|
+
if (isSymbol_1(value)) {
|
|
8572
|
+
return symbolToString ? symbolToString.call(value) : '';
|
|
8573
|
+
}
|
|
8574
|
+
var result = (value + '');
|
|
8575
|
+
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
8576
|
+
}
|
|
8577
|
+
|
|
8578
|
+
var _baseToString = baseToString;
|
|
8579
|
+
|
|
8580
|
+
/**
|
|
8581
|
+
* Converts `value` to a string. An empty string is returned for `null`
|
|
8582
|
+
* and `undefined` values. The sign of `-0` is preserved.
|
|
8583
|
+
*
|
|
8584
|
+
* @static
|
|
8585
|
+
* @memberOf _
|
|
8586
|
+
* @since 4.0.0
|
|
8587
|
+
* @category Lang
|
|
8588
|
+
* @param {*} value The value to convert.
|
|
8589
|
+
* @returns {string} Returns the converted string.
|
|
8590
|
+
* @example
|
|
8591
|
+
*
|
|
8592
|
+
* _.toString(null);
|
|
8593
|
+
* // => ''
|
|
8594
|
+
*
|
|
8595
|
+
* _.toString(-0);
|
|
8596
|
+
* // => '-0'
|
|
8597
|
+
*
|
|
8598
|
+
* _.toString([1, 2, 3]);
|
|
8599
|
+
* // => '1,2,3'
|
|
8600
|
+
*/
|
|
8601
|
+
function toString$1(value) {
|
|
8602
|
+
return value == null ? '' : _baseToString(value);
|
|
8603
|
+
}
|
|
8604
|
+
|
|
8605
|
+
var toString_1 = toString$1;
|
|
8606
|
+
|
|
8607
|
+
/**
|
|
8608
|
+
* Casts `value` to a path array if it's not one.
|
|
8609
|
+
*
|
|
8610
|
+
* @private
|
|
8611
|
+
* @param {*} value The value to inspect.
|
|
8612
|
+
* @param {Object} [object] The object to query keys on.
|
|
8613
|
+
* @returns {Array} Returns the cast property path array.
|
|
8614
|
+
*/
|
|
8615
|
+
function castPath(value, object) {
|
|
8616
|
+
if (isArray_1(value)) {
|
|
8617
|
+
return value;
|
|
8618
|
+
}
|
|
8619
|
+
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
8620
|
+
}
|
|
8621
|
+
|
|
8622
|
+
var _castPath = castPath;
|
|
8623
|
+
|
|
8624
|
+
/** Used as references for various `Number` constants. */
|
|
8625
|
+
var INFINITY = 1 / 0;
|
|
8626
|
+
|
|
8627
|
+
/**
|
|
8628
|
+
* Converts `value` to a string key if it's not a string or symbol.
|
|
8629
|
+
*
|
|
8630
|
+
* @private
|
|
8631
|
+
* @param {*} value The value to inspect.
|
|
8632
|
+
* @returns {string|symbol} Returns the key.
|
|
8633
|
+
*/
|
|
8634
|
+
function toKey(value) {
|
|
8635
|
+
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
8636
|
+
return value;
|
|
8637
|
+
}
|
|
8638
|
+
var result = (value + '');
|
|
8639
|
+
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
8640
|
+
}
|
|
8641
|
+
|
|
8642
|
+
var _toKey = toKey;
|
|
8643
|
+
|
|
8644
|
+
/**
|
|
8645
|
+
* The base implementation of `_.get` without support for default values.
|
|
8646
|
+
*
|
|
8647
|
+
* @private
|
|
8648
|
+
* @param {Object} object The object to query.
|
|
8649
|
+
* @param {Array|string} path The path of the property to get.
|
|
8650
|
+
* @returns {*} Returns the resolved value.
|
|
8651
|
+
*/
|
|
8652
|
+
function baseGet(object, path) {
|
|
8653
|
+
path = _castPath(path, object);
|
|
8654
|
+
|
|
8655
|
+
var index = 0,
|
|
8656
|
+
length = path.length;
|
|
8657
|
+
|
|
8658
|
+
while (object != null && index < length) {
|
|
8659
|
+
object = object[_toKey(path[index++])];
|
|
8660
|
+
}
|
|
8661
|
+
return (index && index == length) ? object : undefined;
|
|
8662
|
+
}
|
|
8663
|
+
|
|
8664
|
+
var _baseGet = baseGet;
|
|
8665
|
+
|
|
8666
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
8667
|
+
var COMPARE_PARTIAL_FLAG$1 = 1,
|
|
8668
|
+
COMPARE_UNORDERED_FLAG$1 = 2;
|
|
8669
|
+
|
|
8670
|
+
/**
|
|
8671
|
+
* The base implementation of `_.isMatch` without support for iteratee shorthands.
|
|
8672
|
+
*
|
|
8673
|
+
* @private
|
|
8674
|
+
* @param {Object} object The object to inspect.
|
|
8675
|
+
* @param {Object} source The object of property values to match.
|
|
8676
|
+
* @param {Array} matchData The property names, values, and compare flags to match.
|
|
8677
|
+
* @param {Function} [customizer] The function to customize comparisons.
|
|
8678
|
+
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
|
|
8679
|
+
*/
|
|
8680
|
+
function baseIsMatch(object, source, matchData, customizer) {
|
|
8681
|
+
var index = matchData.length,
|
|
8682
|
+
length = index,
|
|
8683
|
+
noCustomizer = !customizer;
|
|
8684
|
+
|
|
8685
|
+
if (object == null) {
|
|
8686
|
+
return !length;
|
|
8687
|
+
}
|
|
8688
|
+
object = Object(object);
|
|
8689
|
+
while (index--) {
|
|
8690
|
+
var data = matchData[index];
|
|
8691
|
+
if ((noCustomizer && data[2])
|
|
8692
|
+
? data[1] !== object[data[0]]
|
|
8693
|
+
: !(data[0] in object)
|
|
8694
|
+
) {
|
|
8695
|
+
return false;
|
|
8696
|
+
}
|
|
8697
|
+
}
|
|
8698
|
+
while (++index < length) {
|
|
8699
|
+
data = matchData[index];
|
|
8700
|
+
var key = data[0],
|
|
8701
|
+
objValue = object[key],
|
|
8702
|
+
srcValue = data[1];
|
|
8703
|
+
|
|
8704
|
+
if (noCustomizer && data[2]) {
|
|
8705
|
+
if (objValue === undefined && !(key in object)) {
|
|
8706
|
+
return false;
|
|
8707
|
+
}
|
|
8708
|
+
} else {
|
|
8709
|
+
var stack = new _Stack;
|
|
8710
|
+
if (customizer) {
|
|
8711
|
+
var result = customizer(objValue, srcValue, key, object, source, stack);
|
|
8712
|
+
}
|
|
8713
|
+
if (!(result === undefined
|
|
8714
|
+
? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack)
|
|
8715
|
+
: result
|
|
8716
|
+
)) {
|
|
8717
|
+
return false;
|
|
8718
|
+
}
|
|
8719
|
+
}
|
|
8720
|
+
}
|
|
8721
|
+
return true;
|
|
8722
|
+
}
|
|
8723
|
+
|
|
8724
|
+
var _baseIsMatch = baseIsMatch;
|
|
8725
|
+
|
|
8726
|
+
/**
|
|
8727
|
+
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
|
|
8728
|
+
*
|
|
8729
|
+
* @private
|
|
8730
|
+
* @param {*} value The value to check.
|
|
8731
|
+
* @returns {boolean} Returns `true` if `value` if suitable for strict
|
|
8732
|
+
* equality comparisons, else `false`.
|
|
8733
|
+
*/
|
|
8734
|
+
function isStrictComparable(value) {
|
|
8735
|
+
return value === value && !isObject_1(value);
|
|
8736
|
+
}
|
|
8737
|
+
|
|
8738
|
+
var _isStrictComparable = isStrictComparable;
|
|
8739
|
+
|
|
8740
|
+
/**
|
|
8741
|
+
* Gets the property names, values, and compare flags of `object`.
|
|
8742
|
+
*
|
|
8743
|
+
* @private
|
|
8744
|
+
* @param {Object} object The object to query.
|
|
8745
|
+
* @returns {Array} Returns the match data of `object`.
|
|
8746
|
+
*/
|
|
8747
|
+
function getMatchData(object) {
|
|
8748
|
+
var result = keys_1(object),
|
|
8749
|
+
length = result.length;
|
|
8750
|
+
|
|
8751
|
+
while (length--) {
|
|
8752
|
+
var key = result[length],
|
|
8753
|
+
value = object[key];
|
|
8754
|
+
|
|
8755
|
+
result[length] = [key, value, _isStrictComparable(value)];
|
|
8756
|
+
}
|
|
8757
|
+
return result;
|
|
8758
|
+
}
|
|
8759
|
+
|
|
8760
|
+
var _getMatchData = getMatchData;
|
|
8761
|
+
|
|
8762
|
+
/**
|
|
8763
|
+
* A specialized version of `matchesProperty` for source values suitable
|
|
8764
|
+
* for strict equality comparisons, i.e. `===`.
|
|
8765
|
+
*
|
|
8766
|
+
* @private
|
|
8767
|
+
* @param {string} key The key of the property to get.
|
|
8768
|
+
* @param {*} srcValue The value to match.
|
|
8769
|
+
* @returns {Function} Returns the new spec function.
|
|
8770
|
+
*/
|
|
8771
|
+
function matchesStrictComparable(key, srcValue) {
|
|
8772
|
+
return function(object) {
|
|
8773
|
+
if (object == null) {
|
|
8774
|
+
return false;
|
|
8775
|
+
}
|
|
8776
|
+
return object[key] === srcValue &&
|
|
8777
|
+
(srcValue !== undefined || (key in Object(object)));
|
|
8778
|
+
};
|
|
8779
|
+
}
|
|
8780
|
+
|
|
8781
|
+
var _matchesStrictComparable = matchesStrictComparable;
|
|
8782
|
+
|
|
8783
|
+
/**
|
|
8784
|
+
* The base implementation of `_.matches` which doesn't clone `source`.
|
|
8785
|
+
*
|
|
8786
|
+
* @private
|
|
8787
|
+
* @param {Object} source The object of property values to match.
|
|
8788
|
+
* @returns {Function} Returns the new spec function.
|
|
8789
|
+
*/
|
|
8790
|
+
function baseMatches(source) {
|
|
8791
|
+
var matchData = _getMatchData(source);
|
|
8792
|
+
if (matchData.length == 1 && matchData[0][2]) {
|
|
8793
|
+
return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
|
8794
|
+
}
|
|
8795
|
+
return function(object) {
|
|
8796
|
+
return object === source || _baseIsMatch(object, source, matchData);
|
|
8797
|
+
};
|
|
8798
|
+
}
|
|
8799
|
+
|
|
8800
|
+
var _baseMatches = baseMatches;
|
|
8801
|
+
|
|
8802
|
+
/**
|
|
8803
|
+
* Gets the value at `path` of `object`. If the resolved value is
|
|
8804
|
+
* `undefined`, the `defaultValue` is returned in its place.
|
|
8805
|
+
*
|
|
8806
|
+
* @static
|
|
8807
|
+
* @memberOf _
|
|
8808
|
+
* @since 3.7.0
|
|
8809
|
+
* @category Object
|
|
8810
|
+
* @param {Object} object The object to query.
|
|
8811
|
+
* @param {Array|string} path The path of the property to get.
|
|
8812
|
+
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
8813
|
+
* @returns {*} Returns the resolved value.
|
|
8814
|
+
* @example
|
|
8815
|
+
*
|
|
8816
|
+
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
8817
|
+
*
|
|
8818
|
+
* _.get(object, 'a[0].b.c');
|
|
8819
|
+
* // => 3
|
|
8820
|
+
*
|
|
8821
|
+
* _.get(object, ['a', '0', 'b', 'c']);
|
|
8822
|
+
* // => 3
|
|
8823
|
+
*
|
|
8824
|
+
* _.get(object, 'a.b.c', 'default');
|
|
8825
|
+
* // => 'default'
|
|
8826
|
+
*/
|
|
8827
|
+
function get(object, path, defaultValue) {
|
|
8828
|
+
var result = object == null ? undefined : _baseGet(object, path);
|
|
8829
|
+
return result === undefined ? defaultValue : result;
|
|
8830
|
+
}
|
|
8831
|
+
|
|
8832
|
+
var get_1 = get;
|
|
8833
|
+
|
|
8834
|
+
/**
|
|
8835
|
+
* The base implementation of `_.hasIn` without support for deep paths.
|
|
8836
|
+
*
|
|
8837
|
+
* @private
|
|
8838
|
+
* @param {Object} [object] The object to query.
|
|
8839
|
+
* @param {Array|string} key The key to check.
|
|
8840
|
+
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
|
8841
|
+
*/
|
|
8842
|
+
function baseHasIn(object, key) {
|
|
8843
|
+
return object != null && key in Object(object);
|
|
8844
|
+
}
|
|
8845
|
+
|
|
8846
|
+
var _baseHasIn = baseHasIn;
|
|
8847
|
+
|
|
8848
|
+
/**
|
|
8849
|
+
* Checks if `path` exists on `object`.
|
|
8850
|
+
*
|
|
8851
|
+
* @private
|
|
8852
|
+
* @param {Object} object The object to query.
|
|
8853
|
+
* @param {Array|string} path The path to check.
|
|
8854
|
+
* @param {Function} hasFunc The function to check properties.
|
|
8855
|
+
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
|
8856
|
+
*/
|
|
8857
|
+
function hasPath(object, path, hasFunc) {
|
|
8858
|
+
path = _castPath(path, object);
|
|
8859
|
+
|
|
8860
|
+
var index = -1,
|
|
8861
|
+
length = path.length,
|
|
8862
|
+
result = false;
|
|
8863
|
+
|
|
8864
|
+
while (++index < length) {
|
|
8865
|
+
var key = _toKey(path[index]);
|
|
8866
|
+
if (!(result = object != null && hasFunc(object, key))) {
|
|
8867
|
+
break;
|
|
8868
|
+
}
|
|
8869
|
+
object = object[key];
|
|
8870
|
+
}
|
|
8871
|
+
if (result || ++index != length) {
|
|
8872
|
+
return result;
|
|
8873
|
+
}
|
|
8874
|
+
length = object == null ? 0 : object.length;
|
|
8875
|
+
return !!length && isLength_1(length) && _isIndex(key, length) &&
|
|
8876
|
+
(isArray_1(object) || isArguments_1(object));
|
|
8877
|
+
}
|
|
8878
|
+
|
|
8879
|
+
var _hasPath = hasPath;
|
|
8880
|
+
|
|
8881
|
+
/**
|
|
8882
|
+
* Checks if `path` is a direct or inherited property of `object`.
|
|
8883
|
+
*
|
|
8884
|
+
* @static
|
|
8885
|
+
* @memberOf _
|
|
8886
|
+
* @since 4.0.0
|
|
8887
|
+
* @category Object
|
|
8888
|
+
* @param {Object} object The object to query.
|
|
8889
|
+
* @param {Array|string} path The path to check.
|
|
8890
|
+
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
|
8891
|
+
* @example
|
|
8892
|
+
*
|
|
8893
|
+
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
|
|
8894
|
+
*
|
|
8895
|
+
* _.hasIn(object, 'a');
|
|
8896
|
+
* // => true
|
|
8897
|
+
*
|
|
8898
|
+
* _.hasIn(object, 'a.b');
|
|
8899
|
+
* // => true
|
|
8900
|
+
*
|
|
8901
|
+
* _.hasIn(object, ['a', 'b']);
|
|
8902
|
+
* // => true
|
|
8903
|
+
*
|
|
8904
|
+
* _.hasIn(object, 'b');
|
|
8905
|
+
* // => false
|
|
8906
|
+
*/
|
|
8907
|
+
function hasIn(object, path) {
|
|
8908
|
+
return object != null && _hasPath(object, path, _baseHasIn);
|
|
8909
|
+
}
|
|
8910
|
+
|
|
8911
|
+
var hasIn_1 = hasIn;
|
|
8912
|
+
|
|
8913
|
+
/** Used to compose bitmasks for value comparisons. */
|
|
8914
|
+
var COMPARE_PARTIAL_FLAG = 1,
|
|
8915
|
+
COMPARE_UNORDERED_FLAG = 2;
|
|
8916
|
+
|
|
8917
|
+
/**
|
|
8918
|
+
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
|
|
8919
|
+
*
|
|
8920
|
+
* @private
|
|
8921
|
+
* @param {string} path The path of the property to get.
|
|
8922
|
+
* @param {*} srcValue The value to match.
|
|
8923
|
+
* @returns {Function} Returns the new spec function.
|
|
8924
|
+
*/
|
|
8925
|
+
function baseMatchesProperty(path, srcValue) {
|
|
8926
|
+
if (_isKey(path) && _isStrictComparable(srcValue)) {
|
|
8927
|
+
return _matchesStrictComparable(_toKey(path), srcValue);
|
|
8928
|
+
}
|
|
8929
|
+
return function(object) {
|
|
8930
|
+
var objValue = get_1(object, path);
|
|
8931
|
+
return (objValue === undefined && objValue === srcValue)
|
|
8932
|
+
? hasIn_1(object, path)
|
|
8933
|
+
: _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
8934
|
+
};
|
|
8935
|
+
}
|
|
8936
|
+
|
|
8937
|
+
var _baseMatchesProperty = baseMatchesProperty;
|
|
8938
|
+
|
|
8939
|
+
/**
|
|
8940
|
+
* This method returns the first argument it receives.
|
|
8941
|
+
*
|
|
8942
|
+
* @static
|
|
8943
|
+
* @since 0.1.0
|
|
8944
|
+
* @memberOf _
|
|
8945
|
+
* @category Util
|
|
8946
|
+
* @param {*} value Any value.
|
|
8947
|
+
* @returns {*} Returns `value`.
|
|
8948
|
+
* @example
|
|
8949
|
+
*
|
|
8950
|
+
* var object = { 'a': 1 };
|
|
8951
|
+
*
|
|
8952
|
+
* console.log(_.identity(object) === object);
|
|
8953
|
+
* // => true
|
|
8954
|
+
*/
|
|
8955
|
+
function identity(value) {
|
|
8956
|
+
return value;
|
|
8957
|
+
}
|
|
8958
|
+
|
|
8959
|
+
var identity_1 = identity;
|
|
8960
|
+
|
|
8961
|
+
/**
|
|
8962
|
+
* The base implementation of `_.property` without support for deep paths.
|
|
8963
|
+
*
|
|
8964
|
+
* @private
|
|
8965
|
+
* @param {string} key The key of the property to get.
|
|
8966
|
+
* @returns {Function} Returns the new accessor function.
|
|
8967
|
+
*/
|
|
8968
|
+
function baseProperty(key) {
|
|
8969
|
+
return function(object) {
|
|
8970
|
+
return object == null ? undefined : object[key];
|
|
8971
|
+
};
|
|
8972
|
+
}
|
|
8973
|
+
|
|
8974
|
+
var _baseProperty = baseProperty;
|
|
8975
|
+
|
|
8976
|
+
/**
|
|
8977
|
+
* A specialized version of `baseProperty` which supports deep paths.
|
|
8978
|
+
*
|
|
8979
|
+
* @private
|
|
8980
|
+
* @param {Array|string} path The path of the property to get.
|
|
8981
|
+
* @returns {Function} Returns the new accessor function.
|
|
8982
|
+
*/
|
|
8983
|
+
function basePropertyDeep(path) {
|
|
8984
|
+
return function(object) {
|
|
8985
|
+
return _baseGet(object, path);
|
|
8986
|
+
};
|
|
8987
|
+
}
|
|
8988
|
+
|
|
8989
|
+
var _basePropertyDeep = basePropertyDeep;
|
|
8990
|
+
|
|
8991
|
+
/**
|
|
8992
|
+
* Creates a function that returns the value at `path` of a given object.
|
|
8993
|
+
*
|
|
8994
|
+
* @static
|
|
8995
|
+
* @memberOf _
|
|
8996
|
+
* @since 2.4.0
|
|
8997
|
+
* @category Util
|
|
8998
|
+
* @param {Array|string} path The path of the property to get.
|
|
8999
|
+
* @returns {Function} Returns the new accessor function.
|
|
9000
|
+
* @example
|
|
9001
|
+
*
|
|
9002
|
+
* var objects = [
|
|
9003
|
+
* { 'a': { 'b': 2 } },
|
|
9004
|
+
* { 'a': { 'b': 1 } }
|
|
9005
|
+
* ];
|
|
9006
|
+
*
|
|
9007
|
+
* _.map(objects, _.property('a.b'));
|
|
9008
|
+
* // => [2, 1]
|
|
9009
|
+
*
|
|
9010
|
+
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
|
|
9011
|
+
* // => [1, 2]
|
|
9012
|
+
*/
|
|
9013
|
+
function property(path) {
|
|
9014
|
+
return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);
|
|
9015
|
+
}
|
|
9016
|
+
|
|
9017
|
+
var property_1 = property;
|
|
9018
|
+
|
|
9019
|
+
/**
|
|
9020
|
+
* The base implementation of `_.iteratee`.
|
|
9021
|
+
*
|
|
9022
|
+
* @private
|
|
9023
|
+
* @param {*} [value=_.identity] The value to convert to an iteratee.
|
|
9024
|
+
* @returns {Function} Returns the iteratee.
|
|
9025
|
+
*/
|
|
9026
|
+
function baseIteratee(value) {
|
|
9027
|
+
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
|
|
9028
|
+
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
|
|
9029
|
+
if (typeof value == 'function') {
|
|
9030
|
+
return value;
|
|
9031
|
+
}
|
|
9032
|
+
if (value == null) {
|
|
9033
|
+
return identity_1;
|
|
9034
|
+
}
|
|
9035
|
+
if (typeof value == 'object') {
|
|
9036
|
+
return isArray_1(value)
|
|
9037
|
+
? _baseMatchesProperty(value[0], value[1])
|
|
9038
|
+
: _baseMatches(value);
|
|
9039
|
+
}
|
|
9040
|
+
return property_1(value);
|
|
9041
|
+
}
|
|
9042
|
+
|
|
9043
|
+
var _baseIteratee = baseIteratee;
|
|
9044
|
+
|
|
9045
|
+
/**
|
|
9046
|
+
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
9047
|
+
*
|
|
9048
|
+
* @private
|
|
9049
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
9050
|
+
* @returns {Function} Returns the new base function.
|
|
9051
|
+
*/
|
|
9052
|
+
function createBaseFor(fromRight) {
|
|
9053
|
+
return function(object, iteratee, keysFunc) {
|
|
9054
|
+
var index = -1,
|
|
9055
|
+
iterable = Object(object),
|
|
9056
|
+
props = keysFunc(object),
|
|
9057
|
+
length = props.length;
|
|
9058
|
+
|
|
9059
|
+
while (length--) {
|
|
9060
|
+
var key = props[fromRight ? length : ++index];
|
|
9061
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
9062
|
+
break;
|
|
9063
|
+
}
|
|
9064
|
+
}
|
|
9065
|
+
return object;
|
|
9066
|
+
};
|
|
9067
|
+
}
|
|
9068
|
+
|
|
9069
|
+
var _createBaseFor = createBaseFor;
|
|
9070
|
+
|
|
9071
|
+
/**
|
|
9072
|
+
* The base implementation of `baseForOwn` which iterates over `object`
|
|
9073
|
+
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
9074
|
+
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
9075
|
+
*
|
|
9076
|
+
* @private
|
|
9077
|
+
* @param {Object} object The object to iterate over.
|
|
9078
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9079
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
9080
|
+
* @returns {Object} Returns `object`.
|
|
9081
|
+
*/
|
|
9082
|
+
var baseFor = _createBaseFor();
|
|
9083
|
+
|
|
9084
|
+
var _baseFor = baseFor;
|
|
9085
|
+
|
|
9086
|
+
/**
|
|
9087
|
+
* The base implementation of `_.forOwn` without support for iteratee shorthands.
|
|
9088
|
+
*
|
|
9089
|
+
* @private
|
|
9090
|
+
* @param {Object} object The object to iterate over.
|
|
9091
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9092
|
+
* @returns {Object} Returns `object`.
|
|
9093
|
+
*/
|
|
9094
|
+
function baseForOwn(object, iteratee) {
|
|
9095
|
+
return object && _baseFor(object, iteratee, keys_1);
|
|
9096
|
+
}
|
|
9097
|
+
|
|
9098
|
+
var _baseForOwn = baseForOwn;
|
|
9099
|
+
|
|
9100
|
+
/**
|
|
9101
|
+
* Creates a `baseEach` or `baseEachRight` function.
|
|
9102
|
+
*
|
|
9103
|
+
* @private
|
|
9104
|
+
* @param {Function} eachFunc The function to iterate over a collection.
|
|
9105
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
9106
|
+
* @returns {Function} Returns the new base function.
|
|
9107
|
+
*/
|
|
9108
|
+
function createBaseEach(eachFunc, fromRight) {
|
|
9109
|
+
return function(collection, iteratee) {
|
|
9110
|
+
if (collection == null) {
|
|
9111
|
+
return collection;
|
|
9112
|
+
}
|
|
9113
|
+
if (!isArrayLike_1(collection)) {
|
|
9114
|
+
return eachFunc(collection, iteratee);
|
|
9115
|
+
}
|
|
9116
|
+
var length = collection.length,
|
|
9117
|
+
index = fromRight ? length : -1,
|
|
9118
|
+
iterable = Object(collection);
|
|
9119
|
+
|
|
9120
|
+
while ((fromRight ? index-- : ++index < length)) {
|
|
9121
|
+
if (iteratee(iterable[index], index, iterable) === false) {
|
|
9122
|
+
break;
|
|
9123
|
+
}
|
|
9124
|
+
}
|
|
9125
|
+
return collection;
|
|
9126
|
+
};
|
|
9127
|
+
}
|
|
9128
|
+
|
|
9129
|
+
var _createBaseEach = createBaseEach;
|
|
9130
|
+
|
|
9131
|
+
/**
|
|
9132
|
+
* The base implementation of `_.forEach` without support for iteratee shorthands.
|
|
9133
|
+
*
|
|
9134
|
+
* @private
|
|
9135
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9136
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9137
|
+
* @returns {Array|Object} Returns `collection`.
|
|
9138
|
+
*/
|
|
9139
|
+
var baseEach = _createBaseEach(_baseForOwn);
|
|
9140
|
+
|
|
9141
|
+
var _baseEach = baseEach;
|
|
9142
|
+
|
|
9143
|
+
/**
|
|
9144
|
+
* The base implementation of `_.map` without support for iteratee shorthands.
|
|
9145
|
+
*
|
|
9146
|
+
* @private
|
|
9147
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9148
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
9149
|
+
* @returns {Array} Returns the new mapped array.
|
|
9150
|
+
*/
|
|
9151
|
+
function baseMap(collection, iteratee) {
|
|
9152
|
+
var index = -1,
|
|
9153
|
+
result = isArrayLike_1(collection) ? Array(collection.length) : [];
|
|
9154
|
+
|
|
9155
|
+
_baseEach(collection, function(value, key, collection) {
|
|
9156
|
+
result[++index] = iteratee(value, key, collection);
|
|
9157
|
+
});
|
|
9158
|
+
return result;
|
|
9159
|
+
}
|
|
9160
|
+
|
|
9161
|
+
var _baseMap = baseMap;
|
|
9162
|
+
|
|
9163
|
+
/**
|
|
9164
|
+
* The base implementation of `_.sortBy` which uses `comparer` to define the
|
|
9165
|
+
* sort order of `array` and replaces criteria objects with their corresponding
|
|
9166
|
+
* values.
|
|
9167
|
+
*
|
|
9168
|
+
* @private
|
|
9169
|
+
* @param {Array} array The array to sort.
|
|
9170
|
+
* @param {Function} comparer The function to define sort order.
|
|
9171
|
+
* @returns {Array} Returns `array`.
|
|
9172
|
+
*/
|
|
9173
|
+
function baseSortBy(array, comparer) {
|
|
9174
|
+
var length = array.length;
|
|
9175
|
+
|
|
9176
|
+
array.sort(comparer);
|
|
9177
|
+
while (length--) {
|
|
9178
|
+
array[length] = array[length].value;
|
|
9179
|
+
}
|
|
9180
|
+
return array;
|
|
9181
|
+
}
|
|
9182
|
+
|
|
9183
|
+
var _baseSortBy = baseSortBy;
|
|
9184
|
+
|
|
9185
|
+
/**
|
|
9186
|
+
* Compares values to sort them in ascending order.
|
|
9187
|
+
*
|
|
9188
|
+
* @private
|
|
9189
|
+
* @param {*} value The value to compare.
|
|
9190
|
+
* @param {*} other The other value to compare.
|
|
9191
|
+
* @returns {number} Returns the sort order indicator for `value`.
|
|
9192
|
+
*/
|
|
9193
|
+
function compareAscending(value, other) {
|
|
9194
|
+
if (value !== other) {
|
|
9195
|
+
var valIsDefined = value !== undefined,
|
|
9196
|
+
valIsNull = value === null,
|
|
9197
|
+
valIsReflexive = value === value,
|
|
9198
|
+
valIsSymbol = isSymbol_1(value);
|
|
9199
|
+
|
|
9200
|
+
var othIsDefined = other !== undefined,
|
|
9201
|
+
othIsNull = other === null,
|
|
9202
|
+
othIsReflexive = other === other,
|
|
9203
|
+
othIsSymbol = isSymbol_1(other);
|
|
9204
|
+
|
|
9205
|
+
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
|
|
9206
|
+
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
|
|
9207
|
+
(valIsNull && othIsDefined && othIsReflexive) ||
|
|
9208
|
+
(!valIsDefined && othIsReflexive) ||
|
|
9209
|
+
!valIsReflexive) {
|
|
9210
|
+
return 1;
|
|
9211
|
+
}
|
|
9212
|
+
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
|
|
9213
|
+
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
|
|
9214
|
+
(othIsNull && valIsDefined && valIsReflexive) ||
|
|
9215
|
+
(!othIsDefined && valIsReflexive) ||
|
|
9216
|
+
!othIsReflexive) {
|
|
9217
|
+
return -1;
|
|
9218
|
+
}
|
|
9219
|
+
}
|
|
9220
|
+
return 0;
|
|
9221
|
+
}
|
|
9222
|
+
|
|
9223
|
+
var _compareAscending = compareAscending;
|
|
9224
|
+
|
|
9225
|
+
/**
|
|
9226
|
+
* Used by `_.orderBy` to compare multiple properties of a value to another
|
|
9227
|
+
* and stable sort them.
|
|
9228
|
+
*
|
|
9229
|
+
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
|
|
9230
|
+
* specify an order of "desc" for descending or "asc" for ascending sort order
|
|
9231
|
+
* of corresponding values.
|
|
9232
|
+
*
|
|
9233
|
+
* @private
|
|
9234
|
+
* @param {Object} object The object to compare.
|
|
9235
|
+
* @param {Object} other The other object to compare.
|
|
9236
|
+
* @param {boolean[]|string[]} orders The order to sort by for each property.
|
|
9237
|
+
* @returns {number} Returns the sort order indicator for `object`.
|
|
9238
|
+
*/
|
|
9239
|
+
function compareMultiple(object, other, orders) {
|
|
9240
|
+
var index = -1,
|
|
9241
|
+
objCriteria = object.criteria,
|
|
9242
|
+
othCriteria = other.criteria,
|
|
9243
|
+
length = objCriteria.length,
|
|
9244
|
+
ordersLength = orders.length;
|
|
9245
|
+
|
|
9246
|
+
while (++index < length) {
|
|
9247
|
+
var result = _compareAscending(objCriteria[index], othCriteria[index]);
|
|
9248
|
+
if (result) {
|
|
9249
|
+
if (index >= ordersLength) {
|
|
9250
|
+
return result;
|
|
9251
|
+
}
|
|
9252
|
+
var order = orders[index];
|
|
9253
|
+
return result * (order == 'desc' ? -1 : 1);
|
|
9254
|
+
}
|
|
9255
|
+
}
|
|
9256
|
+
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
|
|
9257
|
+
// that causes it, under certain circumstances, to provide the same value for
|
|
9258
|
+
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
|
|
9259
|
+
// for more details.
|
|
9260
|
+
//
|
|
9261
|
+
// This also ensures a stable sort in V8 and other engines.
|
|
9262
|
+
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
|
|
9263
|
+
return object.index - other.index;
|
|
9264
|
+
}
|
|
9265
|
+
|
|
9266
|
+
var _compareMultiple = compareMultiple;
|
|
9267
|
+
|
|
9268
|
+
/**
|
|
9269
|
+
* The base implementation of `_.orderBy` without param guards.
|
|
9270
|
+
*
|
|
9271
|
+
* @private
|
|
9272
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9273
|
+
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
|
|
9274
|
+
* @param {string[]} orders The sort orders of `iteratees`.
|
|
9275
|
+
* @returns {Array} Returns the new sorted array.
|
|
9276
|
+
*/
|
|
9277
|
+
function baseOrderBy(collection, iteratees, orders) {
|
|
9278
|
+
if (iteratees.length) {
|
|
9279
|
+
iteratees = _arrayMap(iteratees, function(iteratee) {
|
|
9280
|
+
if (isArray_1(iteratee)) {
|
|
9281
|
+
return function(value) {
|
|
9282
|
+
return _baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
|
9283
|
+
}
|
|
9284
|
+
}
|
|
9285
|
+
return iteratee;
|
|
9286
|
+
});
|
|
9287
|
+
} else {
|
|
9288
|
+
iteratees = [identity_1];
|
|
9289
|
+
}
|
|
9290
|
+
|
|
9291
|
+
var index = -1;
|
|
9292
|
+
iteratees = _arrayMap(iteratees, _baseUnary(_baseIteratee));
|
|
9293
|
+
|
|
9294
|
+
var result = _baseMap(collection, function(value, key, collection) {
|
|
9295
|
+
var criteria = _arrayMap(iteratees, function(iteratee) {
|
|
9296
|
+
return iteratee(value);
|
|
9297
|
+
});
|
|
9298
|
+
return { 'criteria': criteria, 'index': ++index, 'value': value };
|
|
9299
|
+
});
|
|
9300
|
+
|
|
9301
|
+
return _baseSortBy(result, function(object, other) {
|
|
9302
|
+
return _compareMultiple(object, other, orders);
|
|
9303
|
+
});
|
|
9304
|
+
}
|
|
9305
|
+
|
|
9306
|
+
var _baseOrderBy = baseOrderBy;
|
|
9307
|
+
|
|
9308
|
+
/**
|
|
9309
|
+
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
9310
|
+
* with the `this` binding of `thisArg` and the arguments of `args`.
|
|
9311
|
+
*
|
|
9312
|
+
* @private
|
|
9313
|
+
* @param {Function} func The function to invoke.
|
|
9314
|
+
* @param {*} thisArg The `this` binding of `func`.
|
|
9315
|
+
* @param {Array} args The arguments to invoke `func` with.
|
|
9316
|
+
* @returns {*} Returns the result of `func`.
|
|
9317
|
+
*/
|
|
9318
|
+
function apply(func, thisArg, args) {
|
|
9319
|
+
switch (args.length) {
|
|
9320
|
+
case 0: return func.call(thisArg);
|
|
9321
|
+
case 1: return func.call(thisArg, args[0]);
|
|
9322
|
+
case 2: return func.call(thisArg, args[0], args[1]);
|
|
9323
|
+
case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
9324
|
+
}
|
|
9325
|
+
return func.apply(thisArg, args);
|
|
9326
|
+
}
|
|
9327
|
+
|
|
9328
|
+
var _apply = apply;
|
|
9329
|
+
|
|
9330
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
9331
|
+
var nativeMax = Math.max;
|
|
9332
|
+
|
|
9333
|
+
/**
|
|
9334
|
+
* A specialized version of `baseRest` which transforms the rest array.
|
|
9335
|
+
*
|
|
9336
|
+
* @private
|
|
9337
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
9338
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
9339
|
+
* @param {Function} transform The rest array transform.
|
|
9340
|
+
* @returns {Function} Returns the new function.
|
|
9341
|
+
*/
|
|
9342
|
+
function overRest(func, start, transform) {
|
|
9343
|
+
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
|
9344
|
+
return function() {
|
|
9345
|
+
var args = arguments,
|
|
9346
|
+
index = -1,
|
|
9347
|
+
length = nativeMax(args.length - start, 0),
|
|
9348
|
+
array = Array(length);
|
|
9349
|
+
|
|
9350
|
+
while (++index < length) {
|
|
9351
|
+
array[index] = args[start + index];
|
|
9352
|
+
}
|
|
9353
|
+
index = -1;
|
|
9354
|
+
var otherArgs = Array(start + 1);
|
|
9355
|
+
while (++index < start) {
|
|
9356
|
+
otherArgs[index] = args[index];
|
|
9357
|
+
}
|
|
9358
|
+
otherArgs[start] = transform(array);
|
|
9359
|
+
return _apply(func, this, otherArgs);
|
|
9360
|
+
};
|
|
9361
|
+
}
|
|
9362
|
+
|
|
9363
|
+
var _overRest = overRest;
|
|
9364
|
+
|
|
9365
|
+
/**
|
|
9366
|
+
* Creates a function that returns `value`.
|
|
9367
|
+
*
|
|
9368
|
+
* @static
|
|
9369
|
+
* @memberOf _
|
|
9370
|
+
* @since 2.4.0
|
|
9371
|
+
* @category Util
|
|
9372
|
+
* @param {*} value The value to return from the new function.
|
|
9373
|
+
* @returns {Function} Returns the new constant function.
|
|
9374
|
+
* @example
|
|
9375
|
+
*
|
|
9376
|
+
* var objects = _.times(2, _.constant({ 'a': 1 }));
|
|
9377
|
+
*
|
|
9378
|
+
* console.log(objects);
|
|
9379
|
+
* // => [{ 'a': 1 }, { 'a': 1 }]
|
|
9380
|
+
*
|
|
9381
|
+
* console.log(objects[0] === objects[1]);
|
|
9382
|
+
* // => true
|
|
9383
|
+
*/
|
|
9384
|
+
function constant(value) {
|
|
9385
|
+
return function() {
|
|
9386
|
+
return value;
|
|
9387
|
+
};
|
|
9388
|
+
}
|
|
9389
|
+
|
|
9390
|
+
var constant_1 = constant;
|
|
9391
|
+
|
|
9392
|
+
var defineProperty = (function() {
|
|
9393
|
+
try {
|
|
9394
|
+
var func = _getNative(Object, 'defineProperty');
|
|
9395
|
+
func({}, '', {});
|
|
9396
|
+
return func;
|
|
9397
|
+
} catch (e) {}
|
|
9398
|
+
}());
|
|
9399
|
+
|
|
9400
|
+
var _defineProperty = defineProperty;
|
|
9401
|
+
|
|
9402
|
+
/**
|
|
9403
|
+
* The base implementation of `setToString` without support for hot loop shorting.
|
|
9404
|
+
*
|
|
9405
|
+
* @private
|
|
9406
|
+
* @param {Function} func The function to modify.
|
|
9407
|
+
* @param {Function} string The `toString` result.
|
|
9408
|
+
* @returns {Function} Returns `func`.
|
|
9409
|
+
*/
|
|
9410
|
+
var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
|
|
9411
|
+
return _defineProperty(func, 'toString', {
|
|
9412
|
+
'configurable': true,
|
|
9413
|
+
'enumerable': false,
|
|
9414
|
+
'value': constant_1(string),
|
|
9415
|
+
'writable': true
|
|
9416
|
+
});
|
|
9417
|
+
};
|
|
9418
|
+
|
|
9419
|
+
var _baseSetToString = baseSetToString;
|
|
9420
|
+
|
|
9421
|
+
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
|
9422
|
+
var HOT_COUNT = 800,
|
|
9423
|
+
HOT_SPAN = 16;
|
|
9424
|
+
|
|
9425
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
9426
|
+
var nativeNow = Date.now;
|
|
9427
|
+
|
|
9428
|
+
/**
|
|
9429
|
+
* Creates a function that'll short out and invoke `identity` instead
|
|
9430
|
+
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
|
|
9431
|
+
* milliseconds.
|
|
9432
|
+
*
|
|
9433
|
+
* @private
|
|
9434
|
+
* @param {Function} func The function to restrict.
|
|
9435
|
+
* @returns {Function} Returns the new shortable function.
|
|
9436
|
+
*/
|
|
9437
|
+
function shortOut(func) {
|
|
9438
|
+
var count = 0,
|
|
9439
|
+
lastCalled = 0;
|
|
9440
|
+
|
|
9441
|
+
return function() {
|
|
9442
|
+
var stamp = nativeNow(),
|
|
9443
|
+
remaining = HOT_SPAN - (stamp - lastCalled);
|
|
9444
|
+
|
|
9445
|
+
lastCalled = stamp;
|
|
9446
|
+
if (remaining > 0) {
|
|
9447
|
+
if (++count >= HOT_COUNT) {
|
|
9448
|
+
return arguments[0];
|
|
9449
|
+
}
|
|
9450
|
+
} else {
|
|
9451
|
+
count = 0;
|
|
9452
|
+
}
|
|
9453
|
+
return func.apply(undefined, arguments);
|
|
9454
|
+
};
|
|
9455
|
+
}
|
|
9456
|
+
|
|
9457
|
+
var _shortOut = shortOut;
|
|
9458
|
+
|
|
9459
|
+
/**
|
|
9460
|
+
* Sets the `toString` method of `func` to return `string`.
|
|
9461
|
+
*
|
|
9462
|
+
* @private
|
|
9463
|
+
* @param {Function} func The function to modify.
|
|
9464
|
+
* @param {Function} string The `toString` result.
|
|
9465
|
+
* @returns {Function} Returns `func`.
|
|
9466
|
+
*/
|
|
9467
|
+
var setToString = _shortOut(_baseSetToString);
|
|
9468
|
+
|
|
9469
|
+
var _setToString = setToString;
|
|
9470
|
+
|
|
9471
|
+
/**
|
|
9472
|
+
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
9473
|
+
*
|
|
9474
|
+
* @private
|
|
9475
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
9476
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
9477
|
+
* @returns {Function} Returns the new function.
|
|
9478
|
+
*/
|
|
9479
|
+
function baseRest(func, start) {
|
|
9480
|
+
return _setToString(_overRest(func, start, identity_1), func + '');
|
|
9481
|
+
}
|
|
9482
|
+
|
|
9483
|
+
var _baseRest = baseRest;
|
|
9484
|
+
|
|
9485
|
+
/**
|
|
9486
|
+
* Checks if the given arguments are from an iteratee call.
|
|
9487
|
+
*
|
|
9488
|
+
* @private
|
|
9489
|
+
* @param {*} value The potential iteratee value argument.
|
|
9490
|
+
* @param {*} index The potential iteratee index or key argument.
|
|
9491
|
+
* @param {*} object The potential iteratee object argument.
|
|
9492
|
+
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
9493
|
+
* else `false`.
|
|
9494
|
+
*/
|
|
9495
|
+
function isIterateeCall(value, index, object) {
|
|
9496
|
+
if (!isObject_1(object)) {
|
|
9497
|
+
return false;
|
|
9498
|
+
}
|
|
9499
|
+
var type = typeof index;
|
|
9500
|
+
if (type == 'number'
|
|
9501
|
+
? (isArrayLike_1(object) && _isIndex(index, object.length))
|
|
9502
|
+
: (type == 'string' && index in object)
|
|
9503
|
+
) {
|
|
9504
|
+
return eq_1(object[index], value);
|
|
9505
|
+
}
|
|
9506
|
+
return false;
|
|
9507
|
+
}
|
|
9508
|
+
|
|
9509
|
+
var _isIterateeCall = isIterateeCall;
|
|
9510
|
+
|
|
9511
|
+
/**
|
|
9512
|
+
* Creates an array of elements, sorted in ascending order by the results of
|
|
9513
|
+
* running each element in a collection thru each iteratee. This method
|
|
9514
|
+
* performs a stable sort, that is, it preserves the original sort order of
|
|
9515
|
+
* equal elements. The iteratees are invoked with one argument: (value).
|
|
9516
|
+
*
|
|
9517
|
+
* @static
|
|
9518
|
+
* @memberOf _
|
|
9519
|
+
* @since 0.1.0
|
|
9520
|
+
* @category Collection
|
|
9521
|
+
* @param {Array|Object} collection The collection to iterate over.
|
|
9522
|
+
* @param {...(Function|Function[])} [iteratees=[_.identity]]
|
|
9523
|
+
* The iteratees to sort by.
|
|
9524
|
+
* @returns {Array} Returns the new sorted array.
|
|
9525
|
+
* @example
|
|
9526
|
+
*
|
|
9527
|
+
* var users = [
|
|
9528
|
+
* { 'user': 'fred', 'age': 48 },
|
|
9529
|
+
* { 'user': 'barney', 'age': 36 },
|
|
9530
|
+
* { 'user': 'fred', 'age': 30 },
|
|
9531
|
+
* { 'user': 'barney', 'age': 34 }
|
|
9532
|
+
* ];
|
|
9533
|
+
*
|
|
9534
|
+
* _.sortBy(users, [function(o) { return o.user; }]);
|
|
9535
|
+
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
|
|
9536
|
+
*
|
|
9537
|
+
* _.sortBy(users, ['user', 'age']);
|
|
9538
|
+
* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
|
|
9539
|
+
*/
|
|
9540
|
+
var sortBy = _baseRest(function(collection, iteratees) {
|
|
9541
|
+
if (collection == null) {
|
|
9542
|
+
return [];
|
|
9543
|
+
}
|
|
9544
|
+
var length = iteratees.length;
|
|
9545
|
+
if (length > 1 && _isIterateeCall(collection, iteratees[0], iteratees[1])) {
|
|
9546
|
+
iteratees = [];
|
|
9547
|
+
} else if (length > 2 && _isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
|
|
9548
|
+
iteratees = [iteratees[0]];
|
|
9549
|
+
}
|
|
9550
|
+
return _baseOrderBy(collection, _baseFlatten(iteratees, 1), []);
|
|
9551
|
+
});
|
|
9552
|
+
|
|
9553
|
+
var sortBy_1 = sortBy;
|
|
9554
|
+
|
|
9555
|
+
/**
|
|
9556
|
+
* Configuration for custom action validation rules.
|
|
9557
|
+
* Defines allowed positions, metadata IDs, data model IDs, and fields for each target
|
|
9558
|
+
* type.
|
|
9559
|
+
*
|
|
9560
|
+
*/
|
|
9561
|
+
const customActionValidationConfig = {
|
|
9562
|
+
[CustomActionTarget.LIVEBOARD]: {
|
|
9563
|
+
positions: [exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.MENU],
|
|
9564
|
+
allowedMetadataIds: ['liveboardIds'],
|
|
9565
|
+
allowedDataModelIds: [],
|
|
9566
|
+
allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds'],
|
|
9567
|
+
},
|
|
9568
|
+
[CustomActionTarget.VIZ]: {
|
|
9569
|
+
positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.CONTEXTMENU],
|
|
9570
|
+
allowedMetadataIds: ['liveboardIds', 'vizIds', 'answerIds'],
|
|
9571
|
+
allowedDataModelIds: ['modelIds', 'modelColumnNames'],
|
|
9572
|
+
allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
|
|
9573
|
+
},
|
|
9574
|
+
[CustomActionTarget.ANSWER]: {
|
|
9575
|
+
positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.PRIMARY, exports.CustomActionsPosition.CONTEXTMENU],
|
|
9576
|
+
allowedMetadataIds: ['answerIds'],
|
|
9577
|
+
allowedDataModelIds: ['modelIds', 'modelColumnNames'],
|
|
9578
|
+
allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
|
|
9579
|
+
},
|
|
9580
|
+
[CustomActionTarget.SPOTTER]: {
|
|
9581
|
+
positions: [exports.CustomActionsPosition.MENU, exports.CustomActionsPosition.CONTEXTMENU],
|
|
9582
|
+
allowedMetadataIds: [],
|
|
9583
|
+
allowedDataModelIds: ['modelIds'],
|
|
9584
|
+
allowedFields: ['name', 'id', 'position', 'target', 'orgIds', 'groupIds', 'dataModelIds'],
|
|
9585
|
+
},
|
|
9586
|
+
};
|
|
9587
|
+
/**
|
|
9588
|
+
* Validates a single custom action based on its target type
|
|
9589
|
+
* @param action - The custom action to validate
|
|
9590
|
+
* @param primaryActionsPerTarget - Map to track primary actions per target
|
|
9591
|
+
* @returns CustomActionValidation with isValid flag and reason string
|
|
9592
|
+
*
|
|
9593
|
+
* @hidden
|
|
9594
|
+
*/
|
|
9595
|
+
const validateCustomAction = (action, primaryActionsPerTarget) => {
|
|
9596
|
+
const { id: actionId, target: targetType, position, metadataIds, dataModelIds } = action;
|
|
9597
|
+
// Check if target type is supported
|
|
9598
|
+
if (!customActionValidationConfig[targetType]) {
|
|
9599
|
+
const errorMessage = CUSTOM_ACTIONS_ERROR_MESSAGE.UNSUPPORTED_TARGET(actionId, targetType);
|
|
9600
|
+
return { isValid: false, errors: [errorMessage] };
|
|
9601
|
+
}
|
|
9602
|
+
const config = customActionValidationConfig[targetType];
|
|
9603
|
+
const errors = [];
|
|
9604
|
+
// Validate position
|
|
9605
|
+
if (!arrayIncludesString(config.positions, position)) {
|
|
9606
|
+
const supportedPositions = config.positions.join(', ');
|
|
9607
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_POSITION(position, targetType, supportedPositions));
|
|
8082
9608
|
}
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
* @example
|
|
8090
|
-
* ```js
|
|
8091
|
-
* embed.on(EmbedEvent.CustomAction, e => {
|
|
8092
|
-
* const underlying = await e.answerService.getUnderlyingDataForPoint([
|
|
8093
|
-
* 'col name 1' // The column should exist in the data source.
|
|
8094
|
-
* ]);
|
|
8095
|
-
* const data = await underlying.fetchData(0, 100);
|
|
8096
|
-
* })
|
|
8097
|
-
* ```
|
|
8098
|
-
* @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
|
|
8099
|
-
*/
|
|
8100
|
-
async getUnderlyingDataForPoint(outputColumnNames, selectedPoints) {
|
|
8101
|
-
if (!selectedPoints && !this.selectedPoints) {
|
|
8102
|
-
throw new Error('Needs to be triggered in context of a point');
|
|
8103
|
-
}
|
|
8104
|
-
if (!selectedPoints) {
|
|
8105
|
-
selectedPoints = getSelectedPointsForUnderlyingDataQuery(this.selectedPoints);
|
|
8106
|
-
}
|
|
8107
|
-
const sourceDetail = await this.getSourceDetail();
|
|
8108
|
-
const ouputColumnGuids = getGuidsFromColumnNames(sourceDetail, outputColumnNames);
|
|
8109
|
-
const unAggAnswer = await graphqlQuery({
|
|
8110
|
-
query: getUnaggregatedAnswerSession,
|
|
8111
|
-
variables: {
|
|
8112
|
-
session: this.session,
|
|
8113
|
-
columns: selectedPoints,
|
|
8114
|
-
},
|
|
8115
|
-
thoughtSpotHost: this.thoughtSpotHost,
|
|
8116
|
-
});
|
|
8117
|
-
const unaggAnswerSession = new AnswerService(unAggAnswer.id, unAggAnswer.answer, this.thoughtSpotHost);
|
|
8118
|
-
const currentColumns = new Set(unAggAnswer.answer.visualizations[0].columns
|
|
8119
|
-
.map((c) => c.column.referencedColumns[0].guid));
|
|
8120
|
-
const columnsToAdd = [...ouputColumnGuids].filter((col) => !currentColumns.has(col));
|
|
8121
|
-
if (columnsToAdd.length) {
|
|
8122
|
-
await unaggAnswerSession.addColumns(columnsToAdd);
|
|
9609
|
+
// Check for primary action conflicts (this is a warning, not a validation
|
|
9610
|
+
// failure)
|
|
9611
|
+
if (position === exports.CustomActionsPosition.PRIMARY) {
|
|
9612
|
+
const existingPrimaryAction = primaryActionsPerTarget.get(targetType);
|
|
9613
|
+
if (existingPrimaryAction) {
|
|
9614
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.MULTIPLE_PRIMARY_ACTIONS(targetType, existingPrimaryAction.name, action.name));
|
|
8123
9615
|
}
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
await unaggAnswerSession.removeColumns(columnsToRemove);
|
|
9616
|
+
else {
|
|
9617
|
+
primaryActionsPerTarget.set(targetType, action);
|
|
8127
9618
|
}
|
|
8128
|
-
return unaggAnswerSession;
|
|
8129
|
-
}
|
|
8130
|
-
/**
|
|
8131
|
-
* Execute a custom graphql query in the context of the answer.
|
|
8132
|
-
* @param query graphql query
|
|
8133
|
-
* @param variables graphql variables
|
|
8134
|
-
* @returns
|
|
8135
|
-
*/
|
|
8136
|
-
async executeQuery(query, variables) {
|
|
8137
|
-
const data = await graphqlQuery({
|
|
8138
|
-
query,
|
|
8139
|
-
variables: {
|
|
8140
|
-
session: this.session,
|
|
8141
|
-
...variables,
|
|
8142
|
-
},
|
|
8143
|
-
thoughtSpotHost: this.thoughtSpotHost,
|
|
8144
|
-
isCompositeQuery: false,
|
|
8145
|
-
});
|
|
8146
|
-
this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
|
|
8147
|
-
return data;
|
|
8148
|
-
}
|
|
8149
|
-
/**
|
|
8150
|
-
* Get the internal session details for the answer.
|
|
8151
|
-
* @returns
|
|
8152
|
-
*/
|
|
8153
|
-
getSession() {
|
|
8154
|
-
return this.session;
|
|
8155
9619
|
}
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
9620
|
+
// Validate metadata IDs
|
|
9621
|
+
if (metadataIds) {
|
|
9622
|
+
const invalidMetadataIds = Object.keys(metadataIds).filter((key) => !arrayIncludesString(config.allowedMetadataIds, key));
|
|
9623
|
+
if (invalidMetadataIds.length > 0) {
|
|
9624
|
+
const supportedMetadataIds = config.allowedMetadataIds.length > 0 ? config.allowedMetadataIds.join(', ') : 'none';
|
|
9625
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_METADATA_IDS(targetType, invalidMetadataIds, supportedMetadataIds));
|
|
8159
9626
|
}
|
|
8160
|
-
this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
|
|
8161
|
-
return this.answer;
|
|
8162
|
-
}
|
|
8163
|
-
async getTML() {
|
|
8164
|
-
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8165
|
-
const edoc = object[0].edoc;
|
|
8166
|
-
const YAML = await Promise.resolve().then(function () { return index; });
|
|
8167
|
-
const parsedDoc = YAML.parse(edoc);
|
|
8168
|
-
return {
|
|
8169
|
-
answer: {
|
|
8170
|
-
...parsedDoc.answer,
|
|
8171
|
-
...this.tmlOverride,
|
|
8172
|
-
},
|
|
8173
|
-
};
|
|
8174
9627
|
}
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
const
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
}
|
|
9628
|
+
// Validate data model IDs
|
|
9629
|
+
if (dataModelIds) {
|
|
9630
|
+
const invalidDataModelIds = Object.keys(dataModelIds).filter((key) => !arrayIncludesString(config.allowedDataModelIds, key));
|
|
9631
|
+
if (invalidDataModelIds.length > 0) {
|
|
9632
|
+
const supportedDataModelIds = config.allowedDataModelIds.length > 0 ? config.allowedDataModelIds.join(', ') : 'none';
|
|
9633
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_DATA_MODEL_IDS(targetType, invalidDataModelIds, supportedDataModelIds));
|
|
9634
|
+
}
|
|
8182
9635
|
}
|
|
8183
|
-
|
|
8184
|
-
|
|
9636
|
+
// Validate allowed fields
|
|
9637
|
+
const actionKeys = Object.keys(action);
|
|
9638
|
+
const invalidFields = actionKeys.filter((key) => !arrayIncludesString(config.allowedFields, key));
|
|
9639
|
+
if (invalidFields.length > 0) {
|
|
9640
|
+
const supportedFields = config.allowedFields.join(', ');
|
|
9641
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_FIELDS(targetType, invalidFields, supportedFields));
|
|
8185
9642
|
}
|
|
8186
|
-
|
|
9643
|
+
return {
|
|
9644
|
+
isValid: errors.length === 0,
|
|
9645
|
+
errors,
|
|
9646
|
+
};
|
|
9647
|
+
};
|
|
8187
9648
|
/**
|
|
9649
|
+
* Validates basic action structure and required fields
|
|
9650
|
+
* @param action - The action to validate
|
|
9651
|
+
* @returns Object containing validation result and missing fields
|
|
8188
9652
|
*
|
|
8189
|
-
* @
|
|
8190
|
-
* @param colNames
|
|
9653
|
+
* @hidden
|
|
8191
9654
|
*/
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
}));
|
|
8201
|
-
}
|
|
9655
|
+
const validateActionStructure = (action) => {
|
|
9656
|
+
if (!action || typeof action !== 'object') {
|
|
9657
|
+
return { isValid: false, missingFields: [] };
|
|
9658
|
+
}
|
|
9659
|
+
// Check for all missing required fields
|
|
9660
|
+
const missingFields = ['id', 'name', 'target', 'position'].filter(field => !action[field]);
|
|
9661
|
+
return { isValid: missingFields.length === 0, missingFields };
|
|
9662
|
+
};
|
|
8202
9663
|
/**
|
|
9664
|
+
* Checks for duplicate IDs among actions
|
|
9665
|
+
* @param actions - Array of actions to check
|
|
9666
|
+
* @returns Object containing filtered actions and duplicate errors
|
|
8203
9667
|
*
|
|
8204
|
-
* @
|
|
9668
|
+
* @hidden
|
|
8205
9669
|
*/
|
|
8206
|
-
|
|
8207
|
-
const
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
let dataValue;
|
|
8217
|
-
if (dataType === 'DATE') {
|
|
8218
|
-
if (Number.isFinite(colVal.value)) {
|
|
8219
|
-
dataValue = [{
|
|
8220
|
-
epochRange: {
|
|
8221
|
-
startEpoch: colVal.value,
|
|
8222
|
-
},
|
|
8223
|
-
}];
|
|
8224
|
-
// Case for custom calendar.
|
|
8225
|
-
}
|
|
8226
|
-
else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
|
|
8227
|
-
dataValue = [{
|
|
8228
|
-
epochRange: {
|
|
8229
|
-
startEpoch: colVal.value.v.s,
|
|
8230
|
-
endEpoch: colVal.value.v.e,
|
|
8231
|
-
},
|
|
8232
|
-
}];
|
|
8233
|
-
}
|
|
9670
|
+
const filterDuplicateIds = (actions) => {
|
|
9671
|
+
const idMap = actions.reduce((map, action) => {
|
|
9672
|
+
const list = map.get(action.id) || [];
|
|
9673
|
+
list.push(action);
|
|
9674
|
+
map.set(action.id, list);
|
|
9675
|
+
return map;
|
|
9676
|
+
}, new Map());
|
|
9677
|
+
const { actions: actionsWithUniqueIds, errors } = Array.from(idMap.entries()).reduce((acc, [id, actionsWithSameId]) => {
|
|
9678
|
+
if (actionsWithSameId.length === 1) {
|
|
9679
|
+
acc.actions.push(actionsWithSameId[0]);
|
|
8234
9680
|
}
|
|
8235
9681
|
else {
|
|
8236
|
-
|
|
9682
|
+
// Keep the first action and add error for duplicates
|
|
9683
|
+
acc.actions.push(actionsWithSameId[0]);
|
|
9684
|
+
const duplicateNames = actionsWithSameId.slice(1).map(action => action.name);
|
|
9685
|
+
acc.errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.DUPLICATE_IDS(id, duplicateNames, actionsWithSameId[0].name));
|
|
8237
9686
|
}
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
}
|
|
8243
|
-
selectedPoints.forEach((p) => {
|
|
8244
|
-
p.selectedAttributes.forEach(addPointFromColVal);
|
|
8245
|
-
});
|
|
8246
|
-
return underlyingDataPoint;
|
|
8247
|
-
}
|
|
9687
|
+
return acc;
|
|
9688
|
+
}, { actions: [], errors: [] });
|
|
9689
|
+
return { actions: actionsWithUniqueIds, errors };
|
|
9690
|
+
};
|
|
8248
9691
|
/**
|
|
8249
|
-
*
|
|
8250
|
-
* @param
|
|
8251
|
-
* @
|
|
9692
|
+
* Validates and processes custom actions
|
|
9693
|
+
* @param customActions - Array of custom actions to validate
|
|
9694
|
+
* @returns Object containing valid actions and any validation errors
|
|
8252
9695
|
*/
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
9696
|
+
const getCustomActions = (customActions) => {
|
|
9697
|
+
const errors = [];
|
|
9698
|
+
const primaryActionsPerTarget = new Map();
|
|
9699
|
+
if (!customActions || !Array.isArray(customActions)) {
|
|
9700
|
+
return { actions: [], errors: [] };
|
|
8258
9701
|
}
|
|
8259
|
-
|
|
8260
|
-
//
|
|
8261
|
-
|
|
8262
|
-
|
|
9702
|
+
// Step 1: Handle invalid actions first (null, undefined, missing required
|
|
9703
|
+
// fields)
|
|
9704
|
+
const validActions = customActions.filter(action => {
|
|
9705
|
+
const validation = validateActionStructure(action);
|
|
9706
|
+
if (!validation.isValid) {
|
|
9707
|
+
if (!action || typeof action !== 'object') {
|
|
9708
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_ACTION_OBJECT);
|
|
9709
|
+
}
|
|
9710
|
+
else {
|
|
9711
|
+
errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.MISSING_REQUIRED_FIELDS(action.id, validation.missingFields));
|
|
9712
|
+
}
|
|
9713
|
+
return false;
|
|
9714
|
+
}
|
|
9715
|
+
return true;
|
|
9716
|
+
});
|
|
9717
|
+
// Step 2: Check for duplicate IDs among valid actions
|
|
9718
|
+
const { actions: actionsWithUniqueIds, errors: duplicateErrors } = filterDuplicateIds(validActions);
|
|
9719
|
+
// Add duplicate errors to the errors array
|
|
9720
|
+
duplicateErrors.forEach(error => errors.push(error));
|
|
9721
|
+
// Step 3: Validate actions with unique IDs
|
|
9722
|
+
const finalValidActions = [];
|
|
9723
|
+
actionsWithUniqueIds.forEach((action) => {
|
|
9724
|
+
const { isValid, errors: validationErrors } = validateCustomAction(action, primaryActionsPerTarget);
|
|
9725
|
+
validationErrors.forEach(error => errors.push(error));
|
|
9726
|
+
if (isValid) {
|
|
9727
|
+
finalValidActions.push(action);
|
|
9728
|
+
}
|
|
9729
|
+
});
|
|
9730
|
+
const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
|
|
9731
|
+
return {
|
|
9732
|
+
actions: sortedActions,
|
|
9733
|
+
errors: errors,
|
|
9734
|
+
};
|
|
9735
|
+
};
|
|
8263
9736
|
|
|
8264
9737
|
/**
|
|
8265
9738
|
* Copyright (c) 2023
|
|
@@ -15906,7 +17379,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15906
17379
|
return e;
|
|
15907
17380
|
}
|
|
15908
17381
|
|
|
15909
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.
|
|
17382
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15910
17383
|
|
|
15911
17384
|
/**
|
|
15912
17385
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -16344,8 +17817,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16344
17817
|
// - cached auth may not reflect current user permissions
|
|
16345
17818
|
const isDisabled = (this.viewConfig.overrideOrgId !== undefined
|
|
16346
17819
|
|| this.embedConfig.disablePreauthCache === true
|
|
16347
|
-
|
|
16348
|
-
);
|
|
17820
|
+
|| this.isFullAppEmbedWithVisiblePrimaryNavbar());
|
|
16349
17821
|
return !isDisabled;
|
|
16350
17822
|
}
|
|
16351
17823
|
/**
|
|
@@ -16432,6 +17904,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16432
17904
|
async getDefaultAppInitData() {
|
|
16433
17905
|
var _a, _b;
|
|
16434
17906
|
const authToken = await this.getAuthTokenForCookielessInit();
|
|
17907
|
+
const customActionsResult = getCustomActions([
|
|
17908
|
+
...(this.viewConfig.customActions || []),
|
|
17909
|
+
...(this.embedConfig.customActions || [])
|
|
17910
|
+
]);
|
|
17911
|
+
if (customActionsResult.errors.length > 0) {
|
|
17912
|
+
this.handleError({
|
|
17913
|
+
type: 'CUSTOM_ACTION_VALIDATION',
|
|
17914
|
+
message: customActionsResult.errors,
|
|
17915
|
+
});
|
|
17916
|
+
}
|
|
16435
17917
|
return {
|
|
16436
17918
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
16437
17919
|
authToken,
|
|
@@ -16449,6 +17931,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16449
17931
|
: [],
|
|
16450
17932
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
16451
17933
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
17934
|
+
customActions: customActionsResult.actions,
|
|
16452
17935
|
};
|
|
16453
17936
|
}
|
|
16454
17937
|
async getAppInitData() {
|