@sisense/sdk-ui-angular 1.31.0 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/ai/lib/component-wrapper-helpers/context-connectors.d.ts +10 -0
  2. package/dist/ai/lib/component-wrapper-helpers/index.d.ts +2 -0
  3. package/dist/ai/lib/component-wrapper-helpers/template.d.ts +2 -0
  4. package/dist/ai/lib/components/chatbot.component.d.ts +132 -0
  5. package/dist/ai/lib/components/get-nlg-insights.component.d.ts +141 -0
  6. package/dist/ai/lib/components/index.d.ts +2 -0
  7. package/dist/ai/lib/sdk-ai.module.d.ts +40 -5
  8. package/dist/ai/lib/sdk-ui-core-exports.d.ts +1 -0
  9. package/dist/ai/lib/services/ai.service.d.ts +88 -0
  10. package/dist/ai/lib/services/index.d.ts +1 -0
  11. package/dist/ai/public-api.d.ts +6 -0
  12. package/dist/esm2020/ai/lib/component-wrapper-helpers/context-connectors.mjs +20 -0
  13. package/dist/esm2020/ai/lib/component-wrapper-helpers/index.mjs +3 -0
  14. package/dist/esm2020/ai/lib/component-wrapper-helpers/template.mjs +5 -0
  15. package/dist/esm2020/ai/lib/components/chatbot.component.mjs +138 -0
  16. package/dist/esm2020/ai/lib/components/get-nlg-insights.component.mjs +145 -0
  17. package/dist/esm2020/ai/lib/components/index.mjs +3 -0
  18. package/dist/esm2020/ai/lib/sdk-ai.module.mjs +40 -6
  19. package/dist/esm2020/ai/lib/sdk-ui-core-exports.mjs +3 -0
  20. package/dist/esm2020/ai/lib/services/ai.service.mjs +137 -0
  21. package/dist/esm2020/ai/lib/services/index.mjs +2 -0
  22. package/dist/esm2020/ai/public-api.mjs +7 -1
  23. package/dist/esm2020/lib/component-wrapper-helpers/index.mjs +2 -1
  24. package/dist/esm2020/lib/components/charts/area-chart.component.mjs +1 -1
  25. package/dist/esm2020/lib/components/charts/area-range-chart.component.mjs +1 -1
  26. package/dist/esm2020/lib/components/charts/areamap-chart.component.mjs +1 -1
  27. package/dist/esm2020/lib/components/charts/bar-chart.component.mjs +1 -1
  28. package/dist/esm2020/lib/components/charts/boxplot-chart.component.mjs +1 -1
  29. package/dist/esm2020/lib/components/charts/chart.component.mjs +1 -1
  30. package/dist/esm2020/lib/components/charts/column-chart.component.mjs +1 -1
  31. package/dist/esm2020/lib/components/charts/funnel-chart.component.mjs +1 -1
  32. package/dist/esm2020/lib/components/charts/indicator-chart.component.mjs +1 -1
  33. package/dist/esm2020/lib/components/charts/line-chart.component.mjs +1 -1
  34. package/dist/esm2020/lib/components/charts/pie-chart.component.mjs +1 -1
  35. package/dist/esm2020/lib/components/charts/pivot-table.component.mjs +1 -1
  36. package/dist/esm2020/lib/components/charts/polar-chart.component.mjs +1 -1
  37. package/dist/esm2020/lib/components/charts/scatter-chart.component.mjs +1 -1
  38. package/dist/esm2020/lib/components/charts/scattermap-chart.component.mjs +1 -1
  39. package/dist/esm2020/lib/components/charts/sunburst-chart.component.mjs +1 -1
  40. package/dist/esm2020/lib/components/charts/table.component.mjs +1 -1
  41. package/dist/esm2020/lib/components/charts/treemap-chart.component.mjs +1 -1
  42. package/dist/esm2020/lib/components/dashboard/dashboard-by-id.component.mjs +4 -4
  43. package/dist/esm2020/lib/components/dashboard/dashboard.component.mjs +1 -1
  44. package/dist/esm2020/lib/components/drilldown-breadcrumbs.component.mjs +1 -1
  45. package/dist/esm2020/lib/components/filters/criteria-filter-tile.component.mjs +1 -1
  46. package/dist/esm2020/lib/components/filters/date-range-filter-tile.component.mjs +1 -1
  47. package/dist/esm2020/lib/components/filters/member-filter-tile.component.mjs +1 -1
  48. package/dist/esm2020/lib/components/filters/relative-date-filter-tile.component.mjs +1 -1
  49. package/dist/esm2020/lib/components/widgets/chart-widget.component.mjs +1 -1
  50. package/dist/esm2020/lib/components/widgets/index.mjs +2 -1
  51. package/dist/esm2020/lib/components/widgets/pivot-table-widget.component.mjs +127 -0
  52. package/dist/esm2020/lib/components/widgets/table-widget.component.mjs +1 -1
  53. package/dist/esm2020/lib/components/widgets/widget-by-id.component.mjs +1 -1
  54. package/dist/esm2020/lib/decorators/index.mjs +3 -0
  55. package/dist/esm2020/lib/decorators/trackable.decorator.mjs +2 -1
  56. package/dist/esm2020/lib/sdk-ui-core-exports.mjs +2 -2
  57. package/dist/esm2020/lib/sdk-ui.module.mjs +10 -6
  58. package/dist/esm2020/lib/services/query.service.mjs +31 -5
  59. package/dist/esm2020/lib/services/sisense-context.service.mjs +3 -3
  60. package/dist/esm2020/lib/services/theme.service.mjs +3 -3
  61. package/dist/esm2020/lib/types/dashboard-config.mjs +2 -0
  62. package/dist/esm2020/lib/types/index.mjs +2 -1
  63. package/dist/esm2020/lib/utilities/dashboard-helpers.mjs +119 -0
  64. package/dist/esm2020/lib/utilities/dashboard-model-translator.mjs +49 -0
  65. package/dist/esm2020/lib/utilities/index.mjs +7 -0
  66. package/dist/esm2020/lib/utilities/widget-model-translator.mjs +304 -0
  67. package/dist/esm2020/public-api.mjs +6 -25
  68. package/dist/esm2020/version.mjs +2 -2
  69. package/dist/fesm2015/sisense-sdk-ui-angular-ai.mjs +471 -8
  70. package/dist/fesm2015/sisense-sdk-ui-angular-ai.mjs.map +1 -1
  71. package/dist/fesm2015/sisense-sdk-ui-angular.mjs +671 -43
  72. package/dist/fesm2015/sisense-sdk-ui-angular.mjs.map +1 -1
  73. package/dist/fesm2020/sisense-sdk-ui-angular-ai.mjs +466 -8
  74. package/dist/fesm2020/sisense-sdk-ui-angular-ai.mjs.map +1 -1
  75. package/dist/fesm2020/sisense-sdk-ui-angular.mjs +668 -42
  76. package/dist/fesm2020/sisense-sdk-ui-angular.mjs.map +1 -1
  77. package/dist/lib/component-wrapper-helpers/index.d.ts +1 -0
  78. package/dist/lib/components/charts/area-chart.component.d.ts +3 -0
  79. package/dist/lib/components/charts/area-range-chart.component.d.ts +3 -0
  80. package/dist/lib/components/charts/areamap-chart.component.d.ts +3 -0
  81. package/dist/lib/components/charts/bar-chart.component.d.ts +3 -0
  82. package/dist/lib/components/charts/boxplot-chart.component.d.ts +3 -0
  83. package/dist/lib/components/charts/chart.component.d.ts +3 -0
  84. package/dist/lib/components/charts/column-chart.component.d.ts +3 -0
  85. package/dist/lib/components/charts/funnel-chart.component.d.ts +3 -0
  86. package/dist/lib/components/charts/indicator-chart.component.d.ts +3 -0
  87. package/dist/lib/components/charts/line-chart.component.d.ts +3 -0
  88. package/dist/lib/components/charts/pie-chart.component.d.ts +3 -0
  89. package/dist/lib/components/charts/pivot-table.component.d.ts +3 -0
  90. package/dist/lib/components/charts/polar-chart.component.d.ts +3 -0
  91. package/dist/lib/components/charts/scatter-chart.component.d.ts +3 -0
  92. package/dist/lib/components/charts/scattermap-chart.component.d.ts +3 -0
  93. package/dist/lib/components/charts/sunburst-chart.component.d.ts +3 -0
  94. package/dist/lib/components/charts/table.component.d.ts +3 -2
  95. package/dist/lib/components/charts/treemap-chart.component.d.ts +3 -0
  96. package/dist/lib/components/dashboard/dashboard-by-id.component.d.ts +11 -5
  97. package/dist/lib/components/dashboard/dashboard.component.d.ts +8 -2
  98. package/dist/lib/components/drilldown-breadcrumbs.component.d.ts +3 -0
  99. package/dist/lib/components/filters/criteria-filter-tile.component.d.ts +3 -0
  100. package/dist/lib/components/filters/date-range-filter-tile.component.d.ts +3 -0
  101. package/dist/lib/components/filters/member-filter-tile.component.d.ts +3 -0
  102. package/dist/lib/components/filters/relative-date-filter-tile.component.d.ts +3 -0
  103. package/dist/lib/components/widgets/chart-widget.component.d.ts +3 -0
  104. package/dist/lib/components/widgets/index.d.ts +1 -0
  105. package/dist/lib/components/widgets/pivot-table-widget.component.d.ts +127 -0
  106. package/dist/lib/components/widgets/table-widget.component.d.ts +5 -0
  107. package/dist/lib/components/widgets/widget-by-id.component.d.ts +3 -2
  108. package/dist/lib/decorators/index.d.ts +2 -0
  109. package/dist/lib/decorators/trackable.decorator.d.ts +1 -0
  110. package/dist/lib/sdk-ui-core-exports.d.ts +2 -2
  111. package/dist/lib/sdk-ui.module.d.ts +6 -5
  112. package/dist/lib/services/plugins.service.d.ts +1 -1
  113. package/dist/lib/services/query.service.d.ts +29 -3
  114. package/dist/lib/services/sisense-context.service.d.ts +2 -2
  115. package/dist/lib/services/theme.service.d.ts +2 -2
  116. package/dist/lib/types/dashboard-config.d.ts +24 -0
  117. package/dist/lib/types/index.d.ts +1 -0
  118. package/dist/lib/utilities/dashboard-helpers.d.ts +105 -0
  119. package/dist/lib/utilities/dashboard-model-translator.d.ts +47 -0
  120. package/dist/lib/utilities/index.d.ts +23 -0
  121. package/dist/lib/utilities/widget-model-translator.d.ts +289 -0
  122. package/dist/package.json +1 -1
  123. package/dist/public-api.d.ts +5 -22
  124. package/dist/version.d.ts +1 -1
  125. package/package.json +4 -4
@@ -0,0 +1,10 @@
1
+ import { ContextConnector } from '@sisense/sdk-ui-preact';
2
+ import { CustomAiContext } from '@sisense/sdk-ui-preact/ai';
3
+ import { AiService } from '../services/ai.service';
4
+ /**
5
+ * Creates AI context connector
6
+ *
7
+ * @param aiService - The AI service
8
+ * @internal
9
+ */
10
+ export declare const createAiContextConnector: (aiService: AiService) => ContextConnector<CustomAiContext>;
@@ -0,0 +1,2 @@
1
+ export * from './context-connectors';
2
+ export * from './template';
@@ -0,0 +1,2 @@
1
+ export declare const rootId = "preact";
2
+ export declare const template: string;
@@ -0,0 +1,132 @@
1
+ import { AfterViewInit, ElementRef, OnChanges, OnDestroy } from '@angular/core';
2
+ import { type ChatbotProps as ChatbotPropsPreact } from '@sisense/sdk-ui-preact/ai';
3
+ import { SisenseContextService, ThemeService } from '@sisense/sdk-ui-angular';
4
+ import { AiService } from '../services/ai.service';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Props of the {@link ChatbotComponent}.
8
+ */
9
+ export interface ChatbotProps extends ChatbotPropsPreact {
10
+ }
11
+ /**
12
+ * An Angular component that renders a chatbot with data topic selection.
13
+ *
14
+ * ::: warning Note
15
+ * This component is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
16
+ * :::
17
+ *
18
+ * @example
19
+ * An example of using the `ChatbotComponent`:
20
+ *
21
+ * ```html
22
+ <!--Component HTML template in example.component.html-->
23
+ <csdk-chatbot
24
+ [width]="chatbot.width"
25
+ [height]="chatbot.height"
26
+ [config]="chatbot.config"
27
+ />
28
+ * ```
29
+ *
30
+ * ```ts
31
+ // Component behavior in example.component.ts
32
+ import { Component } from '@angular/core';
33
+
34
+ @Component({
35
+ selector: 'example',
36
+ templateUrl: './example.component.html',
37
+ styleUrls: ['./example.component.scss'],
38
+ })
39
+ export class ExampleComponent {
40
+ chatbot = {
41
+ width: '500px',
42
+ height: '700px',
43
+ config: {
44
+ numOfRecommendations: 5,
45
+ },
46
+ };
47
+ }
48
+ * ```
49
+ *
50
+ * <img src="media://angular-chatbot-example.png" width="500px" />
51
+ *
52
+ * @group Generative AI
53
+ * @beta
54
+ */
55
+ export declare class ChatbotComponent implements AfterViewInit, OnChanges, OnDestroy {
56
+ /**
57
+ * Sisense context service
58
+ *
59
+ * @category Constructor
60
+ */
61
+ sisenseContextService: SisenseContextService;
62
+ /**
63
+ * Theme service
64
+ *
65
+ * @category Constructor
66
+ */
67
+ themeService: ThemeService;
68
+ /**
69
+ * AI service
70
+ *
71
+ * @category Constructor
72
+ */
73
+ aiService: AiService;
74
+ /**
75
+ * @internal
76
+ */
77
+ preactRef: ElementRef<HTMLDivElement>;
78
+ /**
79
+ * {@inheritDoc @sisense/sdk-ui!ChatbotProps.width}
80
+ */
81
+ width: ChatbotProps['width'];
82
+ /**
83
+ * {@inheritDoc @sisense/sdk-ui!ChatbotProps.height}
84
+ */
85
+ height: ChatbotProps['height'];
86
+ /**
87
+ * {@inheritDoc @sisense/sdk-ui!ChatbotProps.config}
88
+ */
89
+ config: ChatbotProps['config'];
90
+ private componentAdapter;
91
+ /**
92
+ * Constructor for the `ChatbotComponent`.
93
+ *
94
+ * @param sisenseContextService - Sisense context service
95
+ * @param themeService - Theme service
96
+ * @param aiService - AI service
97
+ */
98
+ constructor(
99
+ /**
100
+ * Sisense context service
101
+ *
102
+ * @category Constructor
103
+ */
104
+ sisenseContextService: SisenseContextService,
105
+ /**
106
+ * Theme service
107
+ *
108
+ * @category Constructor
109
+ */
110
+ themeService: ThemeService,
111
+ /**
112
+ * AI service
113
+ *
114
+ * @category Constructor
115
+ */
116
+ aiService: AiService);
117
+ /**
118
+ * @internal
119
+ */
120
+ ngAfterViewInit(): void;
121
+ /**
122
+ * @internal
123
+ */
124
+ ngOnChanges(): void;
125
+ private createPreactComponent;
126
+ /**
127
+ * @internal
128
+ */
129
+ ngOnDestroy(): void;
130
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotComponent, never>;
131
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatbotComponent, "csdk-chatbot", never, { "width": "width"; "height": "height"; "config": "config"; }, {}, never, never, false, never>;
132
+ }
@@ -0,0 +1,141 @@
1
+ import { AfterViewInit, ElementRef, OnChanges, OnDestroy } from '@angular/core';
2
+ import { type GetNlgInsightsProps as GetNlgInsightsPropsPreact } from '@sisense/sdk-ui-preact/ai';
3
+ import { SisenseContextService, ThemeService } from '@sisense/sdk-ui-angular';
4
+ import { AiService } from '../services/ai.service';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Props of the {@link GetNlgInsightsComponent}.
8
+ */
9
+ export interface GetNlgInsightsProps extends GetNlgInsightsPropsPreact {
10
+ }
11
+ /**
12
+ * An Angular component that fetches and displays a collapsible analysis of the provided query using natural language generation (NLG).
13
+ * Specifying NLG parameters is similar to providing parameters to the {@link QueryService.executeQuery} service method, using dimensions, measures, and filters.
14
+ *
15
+ * ::: warning Note
16
+ * This component is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
17
+ * :::
18
+ *
19
+ * @example
20
+ * An example of using the `GetNlgInsightsComponent`:
21
+ *
22
+ * ```html
23
+ <!--Component HTML template in example.component.html-->
24
+ <csdk-get-nlg-insights
25
+ [dataSource]="nlgParams.dataSource"
26
+ [dimensions]="nlgParams.dimensions"
27
+ [measures]="nlgParams.measures"
28
+ />
29
+ * ```
30
+ *
31
+ * ```ts
32
+ // Component behavior in example.component.ts
33
+ import { Component } from '@angular/core';
34
+ import { measureFactory } from '@sisense/sdk-data';
35
+ import * as DM from '../../assets/sample-healthcare-model';
36
+
37
+ @Component({
38
+ selector: 'example',
39
+ templateUrl: './example.component.html',
40
+ styleUrls: ['./example.component.scss'],
41
+ })
42
+ export class ExampleComponent {
43
+ nlgParams = {
44
+ dataSource: DM.DataSource.title,
45
+ dimensions: [DM.Divisions.Divison_name],
46
+ measures: [measureFactory.sum(DM.Admissions.Cost_of_admission)],
47
+ };
48
+ }
49
+ * ```
50
+ *
51
+ * <img src="media://angular-get-nlg-insights-example.png" width="700px" />
52
+ *
53
+ * @group Generative AI
54
+ * @beta
55
+ */
56
+ export declare class GetNlgInsightsComponent implements AfterViewInit, OnChanges, OnDestroy {
57
+ /**
58
+ * Sisense context service
59
+ *
60
+ * @category Constructor
61
+ */
62
+ sisenseContextService: SisenseContextService;
63
+ /**
64
+ * Theme service
65
+ *
66
+ * @category Constructor
67
+ */
68
+ themeService: ThemeService;
69
+ /**
70
+ * AI service
71
+ *
72
+ * @category Constructor
73
+ */
74
+ aiService: AiService;
75
+ /**
76
+ * @internal
77
+ */
78
+ preactRef: ElementRef<HTMLDivElement>;
79
+ /**
80
+ * {@inheritDoc @sisense/sdk-ui!GetNlgInsightsProps.dataSource}
81
+ */
82
+ dataSource: GetNlgInsightsProps['dataSource'];
83
+ /**
84
+ * {@inheritDoc @sisense/sdk-ui!GetNlgInsightsProps.dimensions}
85
+ */
86
+ dimensions: GetNlgInsightsProps['dimensions'];
87
+ /**
88
+ * {@inheritDoc @sisense/sdk-ui!GetNlgInsightsProps.measures}
89
+ */
90
+ measures: GetNlgInsightsProps['measures'];
91
+ /**
92
+ * {@inheritDoc @sisense/sdk-ui!GetNlgInsightsProps.filters}
93
+ */
94
+ filters: GetNlgInsightsProps['filters'];
95
+ /**
96
+ * {@inheritDoc @sisense/sdk-ui!GetNlgInsightsProps.verbosity}
97
+ */
98
+ verbosity: GetNlgInsightsProps['verbosity'];
99
+ private componentAdapter;
100
+ /**
101
+ * Constructor for the `GetNlgInsightsProps`.
102
+ *
103
+ * @param sisenseContextService - Sisense context service
104
+ * @param themeService - Theme service
105
+ * @param aiService - AI service
106
+ */
107
+ constructor(
108
+ /**
109
+ * Sisense context service
110
+ *
111
+ * @category Constructor
112
+ */
113
+ sisenseContextService: SisenseContextService,
114
+ /**
115
+ * Theme service
116
+ *
117
+ * @category Constructor
118
+ */
119
+ themeService: ThemeService,
120
+ /**
121
+ * AI service
122
+ *
123
+ * @category Constructor
124
+ */
125
+ aiService: AiService);
126
+ /**
127
+ * @internal
128
+ */
129
+ ngAfterViewInit(): void;
130
+ /**
131
+ * @internal
132
+ */
133
+ ngOnChanges(): void;
134
+ private createPreactComponent;
135
+ /**
136
+ * @internal
137
+ */
138
+ ngOnDestroy(): void;
139
+ static ɵfac: i0.ɵɵFactoryDeclaration<GetNlgInsightsComponent, never>;
140
+ static ɵcmp: i0.ɵɵComponentDeclaration<GetNlgInsightsComponent, "csdk-get-nlg-insights", never, { "dataSource": "dataSource"; "dimensions": "dimensions"; "measures": "measures"; "filters": "filters"; "verbosity": "verbosity"; }, {}, never, never, false, never>;
141
+ }
@@ -0,0 +1,2 @@
1
+ export * from './chatbot.component';
2
+ export * from './get-nlg-insights.component';
@@ -1,14 +1,49 @@
1
1
  import * as i0 from "@angular/core";
2
- import * as i1 from "@angular/common";
3
- import * as i2 from "@sisense/sdk-ui-angular";
2
+ import * as i1 from "./components/chatbot.component";
3
+ import * as i2 from "./components/get-nlg-insights.component";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@sisense/sdk-ui-angular";
4
6
  /**
5
- * SDK AI Module
7
+ * SDK AI Module, which is a container for generative AI components and services.
6
8
  *
7
- * @internal
9
+ * @example
10
+ * Example of importing {@link SdkAiModule} and injecting {@link AiContextConfig} into your application,
11
+ * along with importing dependency {@link SdkUiModule} and injecting {@link SisenseContextConfig} to connect to a Sisense instance:
12
+ *
13
+ * ```ts
14
+ * import { SdkUiModule, SisenseContextConfig } from '@sisense/sdk-ui-angular';
15
+ * import { SdkAiModule, AI_CONTEXT_CONFIG_TOKEN, AiContextConfig } from '@sisense/sdk-ui-angular/ai';
16
+ *
17
+ * const AI_CONTEXT_CONFIG: AiContextConfig = {
18
+ * volatile: true,
19
+ * };
20
+ * const SISENSE_CONTEXT_CONFIG: SisenseContextConfig = {
21
+ * url: "<instance url>", // replace with the URL of your Sisense instance
22
+ * token: "<api token>", // replace with the API token of your user account
23
+ * defaultDataSource: DM.DataSource,
24
+ * };
25
+ *
26
+ * @NgModule({
27
+ * imports: [
28
+ * BrowserModule,
29
+ * SdkUiModule,
30
+ * SdkAiModule,
31
+ * ],
32
+ * declarations: [AppComponent],
33
+ * providers: [
34
+ * { provide: AI_CONTEXT_CONFIG_TOKEN, useValue: AI_CONTEXT_CONFIG },
35
+ * { provide: SISENSE_CONTEXT_CONFIG_TOKEN, useValue: SISENSE_CONTEXT_CONFIG },
36
+ * ],
37
+ * bootstrap: [AppComponent],
38
+ * })
39
+ * ```
40
+ *
41
+ * @group Generative AI
42
+ * @beta
8
43
  */
9
44
  export declare class SdkAiModule {
10
45
  constructor();
11
46
  static ɵfac: i0.ɵɵFactoryDeclaration<SdkAiModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<SdkAiModule, never, [typeof i1.CommonModule, typeof i2.SdkUiModule], never>;
47
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SdkAiModule, [typeof i1.ChatbotComponent, typeof i2.GetNlgInsightsComponent], [typeof i3.CommonModule, typeof i4.SdkUiModule], [typeof i1.ChatbotComponent, typeof i2.GetNlgInsightsComponent]>;
13
48
  static ɵinj: i0.ɵɵInjectorDeclaration<SdkAiModule>;
14
49
  }
@@ -0,0 +1 @@
1
+ export type { ChatConfig, GetQueryRecommendationsParams, QueryRecommendation, GetNlqResultParams, } from '@sisense/sdk-ui-preact/ai';
@@ -0,0 +1,88 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { ChatRestApi, UseGetNlgInsightsParams, GetQueryRecommendationsParams, AiContextProviderProps, QueryRecommendation, GetNlqResultParams } from '@sisense/sdk-ui-preact/ai';
3
+ import { SisenseContextService, WidgetProps } from '@sisense/sdk-ui-angular';
4
+ import * as i0 from "@angular/core";
5
+ export interface AiContextConfig extends Omit<AiContextProviderProps, 'children'> {
6
+ }
7
+ export interface GetNlgInsightsParams extends Omit<UseGetNlgInsightsParams, 'enabled'> {
8
+ }
9
+ /**
10
+ * Token used to inject {@link AiContextConfig} into your application.
11
+ *
12
+ * @example
13
+ * Example of importing {@link SdkAiModule} and injecting {@link AiContextConfig} into your application,
14
+ * along with importing dependency {@link SdkUiModule} and injecting {@link SisenseContextConfig} to connect to a Sisense instance:
15
+ *
16
+ * ```ts
17
+ * import { SdkUiModule, SisenseContextConfig } from '@sisense/sdk-ui-angular';
18
+ * import { SdkAiModule, AI_CONTEXT_CONFIG_TOKEN, AiContextConfig } from '@sisense/sdk-ui-angular/ai';
19
+ *
20
+ * const AI_CONTEXT_CONFIG: AiContextConfig = {
21
+ * volatile: true,
22
+ * };
23
+ * const SISENSE_CONTEXT_CONFIG: SisenseContextConfig = {
24
+ * url: "<instance url>", // replace with the URL of your Sisense instance
25
+ * token: "<api token>", // replace with the API token of your user account
26
+ * defaultDataSource: DM.DataSource,
27
+ * };
28
+ *
29
+ * @NgModule({
30
+ * imports: [
31
+ * BrowserModule,
32
+ * SdkUiModule,
33
+ * SdkAiModule,
34
+ * ],
35
+ * declarations: [AppComponent],
36
+ * providers: [
37
+ * { provide: AI_CONTEXT_CONFIG_TOKEN, useValue: AI_CONTEXT_CONFIG },
38
+ * { provide: SISENSE_CONTEXT_CONFIG_TOKEN, useValue: SISENSE_CONTEXT_CONFIG },
39
+ * ],
40
+ * bootstrap: [AppComponent],
41
+ * })
42
+ * ```
43
+ *
44
+ * @group Generative AI
45
+ * @beta
46
+ */
47
+ export declare const AI_CONTEXT_CONFIG_TOKEN: InjectionToken<AiContextConfig>;
48
+ /**
49
+ * Service for working with Sisense Fusion Generative AI.
50
+ *
51
+ * ::: warning Note
52
+ * This service is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
53
+ * :::
54
+ *
55
+ * @group Generative AI
56
+ * @beta
57
+ */
58
+ export declare class AiService {
59
+ private sisenseContextService;
60
+ private apiPromise;
61
+ constructor(sisenseContextService: SisenseContextService, aiContextConfig?: AiContextConfig);
62
+ /** @internal */
63
+ getApi(): Promise<ChatRestApi>;
64
+ /**
65
+ * Fetches an analysis of the provided query using natural language generation (NLG).
66
+ * Specifying NLG parameters is similar to providing parameters to the {@link QueryService.executeQuery} service method, using dimensions, measures, and filters.
67
+ *
68
+ * @param params - Parameters for getting NLG insights
69
+ * @returns NLG insights text summary
70
+ */
71
+ getNlgInsights(params: GetNlgInsightsParams): Promise<string | undefined>;
72
+ /**
73
+ * Fetches recommended questions for a data model or perspective.
74
+ *
75
+ * @param params - Parameters for recommendations
76
+ * @returns An array of objects, each containing recommended question text and its corresponding `widgetProps`
77
+ */
78
+ getQueryRecommendations(params: GetQueryRecommendationsParams): Promise<QueryRecommendation[]>;
79
+ /**
80
+ * Executes a natural language query (NLQ) against a data model or perspective
81
+ *
82
+ * @param params - NLQ query parameters
83
+ * @returns The result as WidgetProps
84
+ */
85
+ getNlqResult(params: GetNlqResultParams): Promise<WidgetProps | undefined>;
86
+ static ɵfac: i0.ɵɵFactoryDeclaration<AiService, [null, { optional: true; }]>;
87
+ static ɵprov: i0.ɵɵInjectableDeclaration<AiService>;
88
+ }
@@ -0,0 +1 @@
1
+ export * from './ai.service';
@@ -1 +1,7 @@
1
+ /**
2
+ * Public API Surface of @sisense/sdk-ui-angular/ai
3
+ */
1
4
  export * from './lib/sdk-ai.module';
5
+ export * from './lib/components';
6
+ export * from './lib/services';
7
+ export * from './lib/sdk-ui-core-exports';
@@ -0,0 +1,20 @@
1
+ import { createContextProviderRenderer } from '@sisense/sdk-ui-preact';
2
+ import { CustomAiContextProvider } from '@sisense/sdk-ui-preact/ai';
3
+ /**
4
+ * Creates AI context connector
5
+ *
6
+ * @param aiService - The AI service
7
+ * @internal
8
+ */
9
+ export const createAiContextConnector = (aiService) => {
10
+ return {
11
+ async prepareContext() {
12
+ const api = await aiService.getApi();
13
+ return {
14
+ api,
15
+ };
16
+ },
17
+ renderContextProvider: createContextProviderRenderer(CustomAiContextProvider),
18
+ };
19
+ };
20
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC1jb25uZWN0b3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2FpL2xpYi9jb21wb25lbnQtd3JhcHBlci1oZWxwZXJzL2NvbnRleHQtY29ubmVjdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQW9CLDZCQUE2QixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDekYsT0FBTyxFQUFFLHVCQUF1QixFQUFtQixNQUFNLDJCQUEyQixDQUFDO0FBR3JGOzs7OztHQUtHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sd0JBQXdCLEdBQUcsQ0FDdEMsU0FBb0IsRUFDZSxFQUFFO0lBQ3JDLE9BQU87UUFDTCxLQUFLLENBQUMsY0FBYztZQUNsQixNQUFNLEdBQUcsR0FBRyxNQUFNLFNBQVMsQ0FBQyxNQUFNLEVBQUUsQ0FBQztZQUNyQyxPQUFPO2dCQUNMLEdBQUc7YUFDSixDQUFDO1FBQ0osQ0FBQztRQUNELHFCQUFxQixFQUFFLDZCQUE2QixDQUFDLHVCQUF1QixDQUFDO0tBQzlFLENBQUM7QUFDSixDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDb250ZXh0Q29ubmVjdG9yLCBjcmVhdGVDb250ZXh0UHJvdmlkZXJSZW5kZXJlciB9IGZyb20gJ0BzaXNlbnNlL3Nkay11aS1wcmVhY3QnO1xuaW1wb3J0IHsgQ3VzdG9tQWlDb250ZXh0UHJvdmlkZXIsIEN1c3RvbUFpQ29udGV4dCB9IGZyb20gJ0BzaXNlbnNlL3Nkay11aS1wcmVhY3QvYWknO1xuaW1wb3J0IHsgQWlTZXJ2aWNlIH0gZnJvbSAnLi4vc2VydmljZXMvYWkuc2VydmljZSc7XG5cbi8qKlxuICogQ3JlYXRlcyBBSSBjb250ZXh0IGNvbm5lY3RvclxuICpcbiAqIEBwYXJhbSBhaVNlcnZpY2UgLSBUaGUgQUkgc2VydmljZVxuICogQGludGVybmFsXG4gKi9cbmV4cG9ydCBjb25zdCBjcmVhdGVBaUNvbnRleHRDb25uZWN0b3IgPSAoXG4gIGFpU2VydmljZTogQWlTZXJ2aWNlLFxuKTogQ29udGV4dENvbm5lY3RvcjxDdXN0b21BaUNvbnRleHQ+ID0+IHtcbiAgcmV0dXJuIHtcbiAgICBhc3luYyBwcmVwYXJlQ29udGV4dCgpIHtcbiAgICAgIGNvbnN0IGFwaSA9IGF3YWl0IGFpU2VydmljZS5nZXRBcGkoKTtcbiAgICAgIHJldHVybiB7XG4gICAgICAgIGFwaSxcbiAgICAgIH07XG4gICAgfSxcbiAgICByZW5kZXJDb250ZXh0UHJvdmlkZXI6IGNyZWF0ZUNvbnRleHRQcm92aWRlclJlbmRlcmVyKEN1c3RvbUFpQ29udGV4dFByb3ZpZGVyKSxcbiAgfTtcbn07XG4iXX0=
@@ -0,0 +1,3 @@
1
+ export * from './context-connectors';
2
+ export * from './template';
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvYWkvbGliL2NvbXBvbmVudC13cmFwcGVyLWhlbHBlcnMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLFlBQVksQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vY29udGV4dC1jb25uZWN0b3JzJztcbmV4cG9ydCAqIGZyb20gJy4vdGVtcGxhdGUnO1xuIl19
@@ -0,0 +1,5 @@
1
+ export const rootId = 'preact';
2
+ export const template = `
3
+ <div #${rootId} style="width: 100%; height: 100%"></div>
4
+ `;
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVtcGxhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvYWkvbGliL2NvbXBvbmVudC13cmFwcGVyLWhlbHBlcnMvdGVtcGxhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHLFFBQVEsQ0FBQztBQUMvQixNQUFNLENBQUMsTUFBTSxRQUFRLEdBQUc7WUFDWixNQUFNO0NBQ2pCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3Qgcm9vdElkID0gJ3ByZWFjdCc7XG5leHBvcnQgY29uc3QgdGVtcGxhdGUgPSBgXG4gICAgPGRpdiAjJHtyb290SWR9IHN0eWxlPVwid2lkdGg6IDEwMCU7IGhlaWdodDogMTAwJVwiPjwvZGl2PlxuYDtcbiJdfQ==
@@ -0,0 +1,138 @@
1
+ import { Component, Input, ViewChild, } from '@angular/core';
2
+ import { ComponentAdapter, createElement } from '@sisense/sdk-ui-preact';
3
+ import { Chatbot } from '@sisense/sdk-ui-preact/ai';
4
+ // eslint-disable-next-line import/no-extraneous-dependencies
5
+ import { createSisenseContextConnector, createThemeContextConnector, } from '@sisense/sdk-ui-angular';
6
+ import { template, rootId } from '../component-wrapper-helpers/template';
7
+ import { createAiContextConnector } from '../component-wrapper-helpers';
8
+ import * as i0 from "@angular/core";
9
+ import * as i1 from "@sisense/sdk-ui-angular";
10
+ import * as i2 from "../services/ai.service";
11
+ /**
12
+ * An Angular component that renders a chatbot with data topic selection.
13
+ *
14
+ * ::: warning Note
15
+ * This component is currently under beta release for our managed cloud customers on version L2024.2 or above. It is subject to changes as we make fixes and improvements.
16
+ * :::
17
+ *
18
+ * @example
19
+ * An example of using the `ChatbotComponent`:
20
+ *
21
+ * ```html
22
+ <!--Component HTML template in example.component.html-->
23
+ <csdk-chatbot
24
+ [width]="chatbot.width"
25
+ [height]="chatbot.height"
26
+ [config]="chatbot.config"
27
+ />
28
+ * ```
29
+ *
30
+ * ```ts
31
+ // Component behavior in example.component.ts
32
+ import { Component } from '@angular/core';
33
+
34
+ @Component({
35
+ selector: 'example',
36
+ templateUrl: './example.component.html',
37
+ styleUrls: ['./example.component.scss'],
38
+ })
39
+ export class ExampleComponent {
40
+ chatbot = {
41
+ width: '500px',
42
+ height: '700px',
43
+ config: {
44
+ numOfRecommendations: 5,
45
+ },
46
+ };
47
+ }
48
+ * ```
49
+ *
50
+ * <img src="media://angular-chatbot-example.png" width="500px" />
51
+ *
52
+ * @group Generative AI
53
+ * @beta
54
+ */
55
+ export class ChatbotComponent {
56
+ /**
57
+ * Constructor for the `ChatbotComponent`.
58
+ *
59
+ * @param sisenseContextService - Sisense context service
60
+ * @param themeService - Theme service
61
+ * @param aiService - AI service
62
+ */
63
+ constructor(
64
+ /**
65
+ * Sisense context service
66
+ *
67
+ * @category Constructor
68
+ */
69
+ sisenseContextService,
70
+ /**
71
+ * Theme service
72
+ *
73
+ * @category Constructor
74
+ */
75
+ themeService,
76
+ /**
77
+ * AI service
78
+ *
79
+ * @category Constructor
80
+ */
81
+ aiService) {
82
+ this.sisenseContextService = sisenseContextService;
83
+ this.themeService = themeService;
84
+ this.aiService = aiService;
85
+ this.componentAdapter = new ComponentAdapter(() => this.createPreactComponent(), [
86
+ createSisenseContextConnector(this.sisenseContextService),
87
+ createThemeContextConnector(this.themeService),
88
+ createAiContextConnector(this.aiService),
89
+ ]);
90
+ }
91
+ /**
92
+ * @internal
93
+ */
94
+ ngAfterViewInit() {
95
+ this.componentAdapter.render(this.preactRef.nativeElement);
96
+ }
97
+ /**
98
+ * @internal
99
+ */
100
+ ngOnChanges() {
101
+ if (this.preactRef) {
102
+ this.componentAdapter.render(this.preactRef.nativeElement);
103
+ }
104
+ }
105
+ createPreactComponent() {
106
+ const props = {
107
+ width: this.width,
108
+ height: this.height,
109
+ config: this.config,
110
+ };
111
+ return createElement(Chatbot, props);
112
+ }
113
+ /**
114
+ * @internal
115
+ */
116
+ ngOnDestroy() {
117
+ this.componentAdapter.destroy();
118
+ }
119
+ }
120
+ ChatbotComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ChatbotComponent, deps: [{ token: i1.SisenseContextService }, { token: i1.ThemeService }, { token: i2.AiService }], target: i0.ɵɵFactoryTarget.Component });
121
+ ChatbotComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ChatbotComponent, selector: "csdk-chatbot", inputs: { width: "width", height: "height", config: "config" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact style=\"width: 100%; height: 100%\"></div>\n", isInline: true });
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ChatbotComponent, decorators: [{
123
+ type: Component,
124
+ args: [{
125
+ selector: 'csdk-chatbot',
126
+ template,
127
+ }]
128
+ }], ctorParameters: function () { return [{ type: i1.SisenseContextService }, { type: i1.ThemeService }, { type: i2.AiService }]; }, propDecorators: { preactRef: [{
129
+ type: ViewChild,
130
+ args: [rootId]
131
+ }], width: [{
132
+ type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