@hivegpt/hiveai-angular 0.0.381 → 0.0.383

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 (87) hide show
  1. package/bundles/hivegpt-hiveai-angular.umd.js +3145 -0
  2. package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -0
  3. package/bundles/hivegpt-hiveai-angular.umd.min.js +2 -0
  4. package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -0
  5. package/environments/environment.d.ts +15 -0
  6. package/environments/environment.d.ts.map +1 -0
  7. package/esm2015/environments/environment.js +15 -0
  8. package/esm2015/hivegpt-hiveai-angular.js +13 -0
  9. package/esm2015/lib/components/NotificationSocket.js +39 -0
  10. package/esm2015/lib/components/bot-html-editor/bot-html-editor.component.js +112 -0
  11. package/esm2015/lib/components/bot.service.js +50 -0
  12. package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +1743 -0
  13. package/esm2015/lib/components/chatbot/chatbot.component.js +50 -0
  14. package/esm2015/lib/components/conversation.service.js +49 -0
  15. package/esm2015/lib/components/socket-service.service.js +72 -0
  16. package/esm2015/lib/components/translations/translation.service.js +244 -0
  17. package/esm2015/lib/components/video-player/video-player.component.js +123 -0
  18. package/esm2015/lib/hivegpt.module.js +21 -0
  19. package/esm2015/lib/models/video.js +2 -0
  20. package/esm2015/lib/pipes/safe-html.pipe.js +19 -0
  21. package/esm2015/lib/utils/utils.js +36 -0
  22. package/esm2015/public-api.js +7 -0
  23. package/fesm2015/hivegpt-hiveai-angular.js +2541 -0
  24. package/fesm2015/hivegpt-hiveai-angular.js.map +1 -0
  25. package/hivegpt-hiveai-angular.d.ts +13 -0
  26. package/hivegpt-hiveai-angular.d.ts.map +1 -0
  27. package/hivegpt-hiveai-angular.metadata.json +1 -0
  28. package/lib/components/NotificationSocket.d.ts +5 -0
  29. package/lib/components/NotificationSocket.d.ts.map +1 -0
  30. package/lib/components/bot-html-editor/bot-html-editor.component.d.ts +36 -0
  31. package/lib/components/bot-html-editor/bot-html-editor.component.d.ts.map +1 -0
  32. package/lib/components/bot.service.d.ts +12 -0
  33. package/lib/components/bot.service.d.ts.map +1 -0
  34. package/lib/components/chat-drawer/chat-drawer.component.d.ts +255 -0
  35. package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -0
  36. package/lib/components/chatbot/chatbot.component.d.ts +36 -0
  37. package/lib/components/chatbot/chatbot.component.d.ts.map +1 -0
  38. package/lib/components/conversation.service.d.ts +13 -0
  39. package/lib/components/conversation.service.d.ts.map +1 -0
  40. package/lib/components/socket-service.service.d.ts +20 -0
  41. package/lib/components/socket-service.service.d.ts.map +1 -0
  42. package/lib/components/translations/translation.service.d.ts +8 -0
  43. package/lib/components/translations/translation.service.d.ts.map +1 -0
  44. package/lib/components/video-player/video-player.component.d.ts +36 -0
  45. package/lib/components/video-player/video-player.component.d.ts.map +1 -0
  46. package/lib/hivegpt.module.d.ts +3 -0
  47. package/lib/hivegpt.module.d.ts.map +1 -0
  48. package/lib/models/video.d.ts +35 -0
  49. package/lib/models/video.d.ts.map +1 -0
  50. package/lib/pipes/safe-html.pipe.d.ts +8 -0
  51. package/lib/pipes/safe-html.pipe.d.ts.map +1 -0
  52. package/lib/utils/utils.d.ts +3 -0
  53. package/lib/utils/utils.d.ts.map +1 -0
  54. package/package.json +10 -10
  55. package/{src/public-api.ts → public-api.d.ts} +1 -4
  56. package/public-api.d.ts.map +1 -0
  57. package/karma.conf.js +0 -32
  58. package/ng-package.json +0 -7
  59. package/src/environments/environment.ts +0 -19
  60. package/src/lib/components/NotificationSocket.ts +0 -38
  61. package/src/lib/components/bot-html-editor/bot-html-editor.component.css +0 -10
  62. package/src/lib/components/bot-html-editor/bot-html-editor.component.html +0 -11
  63. package/src/lib/components/bot-html-editor/bot-html-editor.component.spec.ts +0 -25
  64. package/src/lib/components/bot-html-editor/bot-html-editor.component.ts +0 -152
  65. package/src/lib/components/bot.service.ts +0 -52
  66. package/src/lib/components/chat-drawer/chat-drawer.component.html +0 -1586
  67. package/src/lib/components/chat-drawer/chat-drawer.component.scss +0 -2907
  68. package/src/lib/components/chat-drawer/chat-drawer.component.ts +0 -2143
  69. package/src/lib/components/chatbot/chatbot.component.html +0 -37
  70. package/src/lib/components/chatbot/chatbot.component.scss +0 -97
  71. package/src/lib/components/chatbot/chatbot.component.ts +0 -44
  72. package/src/lib/components/conversation.service.spec.ts +0 -16
  73. package/src/lib/components/conversation.service.ts +0 -54
  74. package/src/lib/components/socket-service.service.spec.ts +0 -16
  75. package/src/lib/components/socket-service.service.ts +0 -77
  76. package/src/lib/components/translations/translation.service.ts +0 -221
  77. package/src/lib/components/video-player/video-player.component.html +0 -51
  78. package/src/lib/components/video-player/video-player.component.scss +0 -262
  79. package/src/lib/components/video-player/video-player.component.ts +0 -148
  80. package/src/lib/hivegpt.module.ts +0 -18
  81. package/src/lib/models/video.ts +0 -36
  82. package/src/lib/pipes/safe-html.pipe.ts +0 -16
  83. package/src/lib/utils/utils.ts +0 -37
  84. package/tsconfig.lib.json +0 -25
  85. package/tsconfig.lib.prod.json +0 -10
  86. package/tsconfig.spec.json +0 -17
  87. package/tslint.json +0 -17
@@ -1,25 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { BotHtmlEditorComponent } from './bot-html-editor.component';
4
-
5
- describe('BotHtmlEditorComponent', () => {
6
- let component: BotHtmlEditorComponent;
7
- let fixture: ComponentFixture<BotHtmlEditorComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ BotHtmlEditorComponent ]
12
- })
13
- .compileComponents();
14
- });
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(BotHtmlEditorComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
@@ -1,152 +0,0 @@
1
- import { HttpClient, HttpHeaders } from '@angular/common/http';
2
- import {
3
- ChangeDetectionStrategy,
4
- ChangeDetectorRef,
5
- Component,
6
- ElementRef,
7
- EventEmitter,
8
- Input,
9
- OnChanges,
10
- OnInit,
11
- Output,
12
- QueryList,
13
- Renderer2,
14
- SimpleChanges,
15
- ViewChild,
16
- ViewChildren,
17
- } from '@angular/core';
18
- import { MatDrawer } from '@angular/material/sidenav';
19
- import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
20
- import { of, Subscription } from 'rxjs';
21
- import { catchError, switchMap } from 'rxjs/operators';
22
- import { formatNow, formatTimeStamps } from '../../utils/utils';
23
- import {
24
- dev_environment,
25
- prod_environment,
26
- } from '../../../environments/environment';
27
- import { ConversationService } from '../conversation.service';
28
- import { Observable } from 'rxjs';
29
- import { SocketService } from '../socket-service.service';
30
-
31
- @Component({
32
- selector: 'lib-bot-html-editor',
33
- templateUrl: './bot-html-editor.component.html',
34
- styleUrls: ['./bot-html-editor.component.css'],
35
- })
36
- export class BotHtmlEditorComponent implements OnInit {
37
- @Input() editorContent: Observable<string>;
38
- @Input() isDocInEditMode: any;
39
- @Input() documentContent: any;
40
- @Input() conversationId: any;
41
- @Input() botId: any;
42
-
43
- documentName: any = 'doc name';
44
-
45
- environment: {
46
- USERS_API;
47
- BASE_URL;
48
- AGENTS_API;
49
- };
50
-
51
- quillConfig = {
52
- toolbar: [
53
- [{ header: '1' }, { header: '2' }, { font: [] }],
54
- [{ list: 'ordered' }, { list: 'bullet' }],
55
- ['bold', 'italic', 'underline'],
56
- ['link'],
57
- ['clean'],
58
- ],
59
- };
60
- constructor(private cdr: ChangeDetectorRef, private http: HttpClient) {}
61
-
62
- ngOnInit(): void {
63
- this.environment = prod_environment;
64
-
65
- setTimeout(() => {
66
- if (this.isDocInEditMode) {
67
- console.log('In Edit mode');
68
- this.filldataInForm();
69
- } else {
70
- console.log('In save mode');
71
- }
72
- }, 2500);
73
- }
74
-
75
- filldataInForm() {
76
- if (this.documentContent) {
77
- this.documentName = this.documentContent?.name;
78
- this.editorContent = this.documentContent?.content;
79
- this.cdr.detectChanges();
80
- }
81
- }
82
-
83
- saveContent() {
84
- if (!this.isDocInEditMode) {
85
- this.saveContent_http().subscribe();
86
- } else {
87
- this.saveContent_http().subscribe();
88
- }
89
- }
90
-
91
- saveContent_http() {
92
- console.log('API call function');
93
-
94
- const url = `${this.environment.AGENTS_API}/ConversationDocuments?conversationId=${this.conversationId}&botId=${this.botId}`;
95
- const headers = new HttpHeaders({
96
- 'Content-Type': 'application/json',
97
- apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',
98
- });
99
-
100
- let data = {
101
- name: this.documentName,
102
- content: this.editorContent,
103
- };
104
-
105
- return this.http.post(url, data, { headers }).pipe(
106
- switchMap((res: any) => {
107
- if (res) {
108
- // alert('Saved Successfully');
109
- }
110
- this.cdr.markForCheck();
111
-
112
- return of(res);
113
- }),
114
- catchError((error) => {
115
- console.error('Error fetching chatbot config: ', error);
116
-
117
- return of(null);
118
- })
119
- );
120
- }
121
-
122
- updateContent_http() {
123
- console.log('API call function');
124
-
125
- const url = `${this.environment.AGENTS_API}/ConversationDocuments/rename?conversationId=${this.conversationId}&botId=${this.botId}`;
126
- const headers = new HttpHeaders({
127
- 'Content-Type': 'application/json',
128
- apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',
129
- });
130
-
131
- let data = {
132
- name: this.documentName,
133
- content: this.editorContent,
134
- };
135
-
136
- return this.http.put(url, data, { headers }).pipe(
137
- switchMap((res: any) => {
138
- if (res) {
139
- // alert('Updated Successfully');
140
- }
141
- this.cdr.markForCheck();
142
-
143
- return of(res);
144
- }),
145
- catchError((error) => {
146
- console.error('Error fetching chatbot config: ', error);
147
-
148
- return of(null);
149
- })
150
- );
151
- }
152
- }
@@ -1,52 +0,0 @@
1
- import { HttpClient, HttpParams } from '@angular/common/http';
2
- import { Injectable } from '@angular/core';
3
- import { catchError, map } from 'rxjs/operators';
4
-
5
- import { HttpHeaders } from '@angular/common/http';
6
- import { Observable, Subject, throwError } from 'rxjs';
7
- import { AnyRecord } from 'dns';
8
-
9
- @Injectable({
10
- providedIn: 'root',
11
- })
12
- export class BotsService {
13
- eventDescription = new Subject();
14
- bot_api = 'https://agent-api.hivegpt.ai/';
15
- constructor(private http: HttpClient) { }
16
-
17
- fetchSpeechAuthorizationToken(botId, apiKey, domain) {
18
- const headers = new HttpHeaders({
19
- 'Content-Type': 'application/json',
20
- 'x-api-key': apiKey,
21
- 'hive-bot-id': botId,
22
- 'domain-authority': domain
23
- });
24
-
25
- const apiUrl = `${this.bot_api}speech/issue_token`;
26
- const url = `${apiUrl}`;
27
- return this.http.get(url, { headers }).pipe(
28
- map((resp: any) => {
29
- return resp.token;
30
- })
31
- );
32
- }
33
-
34
- getWorkflowsByOrgId(orgId: string): Observable<any> {
35
- const apiUrl = `${this.bot_api}workflows`;
36
- const url = `${apiUrl}?org_id=${orgId}`;
37
- return this.http.get(url).pipe(
38
- map((resp: any) => {
39
- return resp;
40
- })
41
- );
42
- }
43
-
44
- getWorkflowExecutionById(executionId: string): Observable<any> {
45
- const apiUrl = `${this.bot_api}workflows/execution/${executionId}`;
46
- return this.http.get(apiUrl).pipe(
47
- map((resp: any) => {
48
- return resp;
49
- })
50
- );
51
- }
52
- }