livechat-assistant 0.0.8 → 0.0.9
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/ng-package.json +10 -0
- package/package.json +19 -23
- package/src/lib/components/chat-history/chat-history.component.html +83 -0
- package/src/lib/components/chat-history/chat-history.component.scss +0 -0
- package/src/lib/components/chat-history/chat-history.component.spec.ts +23 -0
- package/src/lib/components/chat-history/chat-history.component.ts +97 -0
- package/src/lib/components/chat-widget/chat-widget.component.html +87 -0
- package/src/lib/components/chat-widget/chat-widget.component.scss +77 -0
- package/src/lib/components/chat-widget/chat-widget.component.spec.ts +23 -0
- package/src/lib/components/chat-widget/chat-widget.component.ts +84 -0
- package/src/lib/components/help-support/help-support.component.html +106 -0
- package/src/lib/components/help-support/help-support.component.scss +0 -0
- package/src/lib/components/help-support/help-support.component.spec.ts +23 -0
- package/src/lib/components/help-support/help-support.component.ts +46 -0
- package/src/lib/components/home/home.component.html +64 -0
- package/src/lib/components/home/home.component.scss +0 -0
- package/src/lib/components/home/home.component.spec.ts +23 -0
- package/src/lib/components/home/home.component.ts +18 -0
- package/src/lib/components/index.ts +2 -0
- package/src/lib/components/message/message.component.html +119 -0
- package/src/lib/components/message/message.component.scss +0 -0
- package/src/lib/components/message/message.component.spec.ts +23 -0
- package/src/lib/components/message/message.component.ts +48 -0
- package/src/lib/components/success-message/success-message.component.html +33 -0
- package/src/lib/components/success-message/success-message.component.scss +65 -0
- package/src/lib/components/success-message/success-message.component.spec.ts +23 -0
- package/src/lib/components/success-message/success-message.component.ts +34 -0
- package/src/lib/components/support-buttons/support-buttons.component.html +42 -0
- package/src/lib/components/support-buttons/support-buttons.component.scss +49 -0
- package/src/lib/components/support-buttons/support-buttons.component.spec.ts +21 -0
- package/src/lib/components/support-buttons/support-buttons.component.ts +33 -0
- package/src/lib/environment/environment.test.ts +15 -0
- package/src/lib/livechat-assistant.component.spec.ts +23 -0
- package/src/lib/livechat-assistant.component.ts +15 -0
- package/src/lib/livechat-assistant.service.spec.ts +16 -0
- package/src/lib/livechat-assistant.service.ts +9 -0
- package/src/lib/services/index.ts +1 -0
- package/src/lib/services/request.ts +58 -0
- package/src/lib/utilities/helper.ts +23 -0
- package/src/lib/utilities/index.ts +1 -0
- package/src/public-api.ts +10 -0
- package/src/styles.css +5 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/fesm2022/livechat-assistant.mjs +0 -445
- package/fesm2022/livechat-assistant.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/chat-history/chat-history.component.d.ts +0 -94
- package/lib/components/chat-widget/chat-widget.component.d.ts +0 -17
- package/lib/components/help-support/help-support.component.d.ts +0 -15
- package/lib/components/home/home.component.d.ts +0 -8
- package/lib/components/index.d.ts +0 -2
- package/lib/components/message/message.component.d.ts +0 -16
- package/lib/components/success-message/success-message.component.d.ts +0 -15
- package/lib/components/support-buttons/support-buttons.component.d.ts +0 -12
- package/lib/environment/environment.test.d.ts +0 -15
- package/lib/livechat-assistant.component.d.ts +0 -5
- package/lib/livechat-assistant.service.d.ts +0 -6
- package/lib/services/index.d.ts +0 -1
- package/lib/services/request.d.ts +0 -12
- package/lib/utilities/helper.d.ts +0 -9
- package/lib/utilities/index.d.ts +0 -1
- package/public-api.d.ts +0 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const chat = {
|
|
2
|
+
url: 'https://backoffice.kreador.io',
|
|
3
|
+
db: "developer_odoodemo_db",
|
|
4
|
+
email: "info@kreador.io",
|
|
5
|
+
password: "admin",
|
|
6
|
+
payload: {
|
|
7
|
+
jsonrpc: "2.0",
|
|
8
|
+
method: "call",
|
|
9
|
+
params: {
|
|
10
|
+
service: "object",
|
|
11
|
+
method: "execute_kw",
|
|
12
|
+
args: []
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { LivechatAssistantComponent } from './livechat-assistant.component';
|
|
4
|
+
|
|
5
|
+
describe('LivechatAssistantComponent', () => {
|
|
6
|
+
let component: LivechatAssistantComponent;
|
|
7
|
+
let fixture: ComponentFixture<LivechatAssistantComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [LivechatAssistantComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(LivechatAssistantComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { LivechatAssistantService } from './livechat-assistant.service';
|
|
4
|
+
|
|
5
|
+
describe('LivechatAssistantService', () => {
|
|
6
|
+
let service: LivechatAssistantService;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
TestBed.configureTestingModule({});
|
|
10
|
+
service = TestBed.inject(LivechatAssistantService);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should be created', () => {
|
|
14
|
+
expect(service).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './request';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Injectable, OnInit, inject } from '@angular/core';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
|
+
import { chat } from '../environment/environment.test';
|
|
4
|
+
|
|
5
|
+
@Injectable({
|
|
6
|
+
providedIn: 'root',
|
|
7
|
+
})
|
|
8
|
+
export class RequestService {
|
|
9
|
+
url: string = chat.url;
|
|
10
|
+
private http: HttpClient = inject(HttpClient)
|
|
11
|
+
headers: any = {
|
|
12
|
+
"content-type": "application/json"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
async get(routes: string, custom_url: boolean = false) {
|
|
16
|
+
const url = custom_url ? routes : this.url + routes;
|
|
17
|
+
return await new Promise(async (resolve, reject) => {
|
|
18
|
+
this.http.get(url, this.headers).subscribe((res: any) => {
|
|
19
|
+
resolve(res)
|
|
20
|
+
}, (err: any) => {
|
|
21
|
+
reject(err);
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async post(routes: string, data: any, custom_url: boolean = false) {
|
|
27
|
+
const url = routes;
|
|
28
|
+
return await new Promise((resolve, reject) => {
|
|
29
|
+
this.http.post(url, data, {
|
|
30
|
+
headers: this.headers,
|
|
31
|
+
withCredentials: true
|
|
32
|
+
}).subscribe(
|
|
33
|
+
(response) => resolve(response),
|
|
34
|
+
(error) => reject(error)
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async update(routes: string, data: any, custom_url: boolean = false) {
|
|
40
|
+
const url = custom_url ? routes : this.url + routes;
|
|
41
|
+
return await new Promise((resolve, reject) => {
|
|
42
|
+
this.http.put(url, data).subscribe(
|
|
43
|
+
(response) => resolve(response),
|
|
44
|
+
(error) => reject(error)
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async delete(routes: string, data: any = {}, custom_url: boolean = false) {
|
|
50
|
+
const url = custom_url ? routes : this.url + routes;
|
|
51
|
+
return await new Promise((resolve, reject) => {
|
|
52
|
+
this.http.delete(url, data).subscribe(
|
|
53
|
+
(response) => resolve(response),
|
|
54
|
+
(error) => reject(error)
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export let isOpen: boolean;
|
|
2
|
+
export let confettiArray: Array<{left: number, delay: number, color: string}> = [];
|
|
3
|
+
|
|
4
|
+
export const isChatOpen = ()=> {
|
|
5
|
+
return isOpen;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const closeChat=()=> {
|
|
9
|
+
document.body.classList.remove("show-chatbot");
|
|
10
|
+
isOpen = false;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const toggleLivechat = () => {
|
|
14
|
+
if (isOpen) {
|
|
15
|
+
document.body.classList.remove("show-chatbot");
|
|
16
|
+
isOpen = false;
|
|
17
|
+
} else {
|
|
18
|
+
document.body.classList.toggle("show-chatbot");
|
|
19
|
+
isOpen = true;
|
|
20
|
+
}
|
|
21
|
+
return isOpen;
|
|
22
|
+
}
|
|
23
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './helper'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of livechat-assistant
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from './lib/livechat-assistant.service';
|
|
6
|
+
export * from './lib/livechat-assistant.component';
|
|
7
|
+
|
|
8
|
+
export * from './lib/components'
|
|
9
|
+
export * from './lib/services'
|
|
10
|
+
export * from './lib/utilities'
|
package/src/styles.css
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/lib",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"inlineSources": true,
|
|
10
|
+
"types": []
|
|
11
|
+
},
|
|
12
|
+
"exclude": [
|
|
13
|
+
"**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "./tsconfig.lib.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"declarationMap": false
|
|
7
|
+
},
|
|
8
|
+
"angularCompilerOptions": {
|
|
9
|
+
"compilationMode": "partial"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/spec",
|
|
7
|
+
"types": [
|
|
8
|
+
"jasmine"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"**/*.spec.ts",
|
|
13
|
+
"**/*.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|