Publish Action to dismiss Insights

Here's a Typescript example to show Insights, considering recordContext as the current browser tab's active record:

 const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID', 'V1');
const tabContext: ITabContext = await frameworkProvider.getCurrentBrowserTabContext()
let recordContext: IRecordContext = await tabContext.getActiveRecord();
let insightContext: IInsightsContext = await recordContext.getInsightsContext();
const payload: IShowInsightsRequest = frameworkProvider.requestHelper.createPublishRequest('DismissInsights') as IShowInsightsRequest;
payload.setId('insightsId1');
insightContext.publish(payload).then((response: IOperationResponse) => {
    const insightsOperationResponse = response as IInsightsOperationResponse;
    console.log((insightsOperationResponse.getResponseData() as IInsightsOperationResponseData).getInsightsId());
});

Here's a JavaScript example to show Insights, considering recordContext as the current browser tab's active record:

 const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID', 'V1');
const tabContext = await frameworkProvider.getCurrentBrowserTabContext();
let recordContext = await tabContext.getActiveRecord();
let insightContext = await recordContext.getInsightsContext();
const payload = frameworkProvider.requestHelper.createPublishRequest('DismissInsights');
payload.setId('insightsId1');
insightContext.publish(payload).then((response) => {
    const insightsOperationResponse = response;
    console.log(insightsOperationResponse.getResponseData().getInsightsId());
});