livechat-assistant 0.0.9 → 0.1.1
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/fesm2022/livechat-assistant.mjs +445 -0
- package/fesm2022/livechat-assistant.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/chat-history/chat-history.component.d.ts +94 -0
- package/lib/components/chat-widget/chat-widget.component.d.ts +17 -0
- package/lib/components/help-support/help-support.component.d.ts +15 -0
- package/lib/components/home/home.component.d.ts +8 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/message/message.component.d.ts +16 -0
- package/lib/components/success-message/success-message.component.d.ts +15 -0
- package/lib/components/support-buttons/support-buttons.component.d.ts +12 -0
- package/lib/environment/environment.test.d.ts +15 -0
- package/lib/livechat-assistant.component.d.ts +5 -0
- package/lib/livechat-assistant.service.d.ts +6 -0
- package/lib/services/index.d.ts +1 -0
- package/lib/services/request.d.ts +12 -0
- package/lib/utilities/helper.d.ts +9 -0
- package/lib/utilities/index.d.ts +1 -0
- package/package.json +28 -19
- package/public-api.d.ts +5 -0
- package/styles.css +2 -0
- package/ng-package.json +0 -10
- package/src/lib/components/chat-history/chat-history.component.html +0 -83
- package/src/lib/components/chat-history/chat-history.component.scss +0 -0
- package/src/lib/components/chat-history/chat-history.component.spec.ts +0 -23
- package/src/lib/components/chat-history/chat-history.component.ts +0 -97
- package/src/lib/components/chat-widget/chat-widget.component.html +0 -87
- package/src/lib/components/chat-widget/chat-widget.component.scss +0 -77
- package/src/lib/components/chat-widget/chat-widget.component.spec.ts +0 -23
- package/src/lib/components/chat-widget/chat-widget.component.ts +0 -84
- package/src/lib/components/help-support/help-support.component.html +0 -106
- package/src/lib/components/help-support/help-support.component.scss +0 -0
- package/src/lib/components/help-support/help-support.component.spec.ts +0 -23
- package/src/lib/components/help-support/help-support.component.ts +0 -46
- package/src/lib/components/home/home.component.html +0 -64
- package/src/lib/components/home/home.component.scss +0 -0
- package/src/lib/components/home/home.component.spec.ts +0 -23
- package/src/lib/components/home/home.component.ts +0 -18
- package/src/lib/components/index.ts +0 -2
- package/src/lib/components/message/message.component.html +0 -119
- package/src/lib/components/message/message.component.scss +0 -0
- package/src/lib/components/message/message.component.spec.ts +0 -23
- package/src/lib/components/message/message.component.ts +0 -48
- package/src/lib/components/success-message/success-message.component.html +0 -33
- package/src/lib/components/success-message/success-message.component.scss +0 -65
- package/src/lib/components/success-message/success-message.component.spec.ts +0 -23
- package/src/lib/components/success-message/success-message.component.ts +0 -34
- package/src/lib/components/support-buttons/support-buttons.component.html +0 -42
- package/src/lib/components/support-buttons/support-buttons.component.scss +0 -49
- package/src/lib/components/support-buttons/support-buttons.component.spec.ts +0 -21
- package/src/lib/components/support-buttons/support-buttons.component.ts +0 -33
- package/src/lib/environment/environment.test.ts +0 -15
- package/src/lib/livechat-assistant.component.spec.ts +0 -23
- package/src/lib/livechat-assistant.component.ts +0 -15
- package/src/lib/livechat-assistant.service.spec.ts +0 -16
- package/src/lib/livechat-assistant.service.ts +0 -9
- package/src/lib/services/index.ts +0 -1
- package/src/lib/services/request.ts +0 -58
- package/src/lib/utilities/helper.ts +0 -23
- package/src/lib/utilities/index.ts +0 -1
- package/src/public-api.ts +0 -10
- package/src/styles.css +0 -5
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './request';
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './helper'
|
package/src/public-api.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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
DELETED
package/tsconfig.lib.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
package/tsconfig.lib.prod.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
package/tsconfig.spec.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|