@zohoim/client-sdk 1.0.0-poc69 → 1.0.0-poc70
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/es/domain/entities/IntegrationService/IntegrationService.js +33 -0
- package/es/domain/entities/IntegrationService/index.js +2 -0
- package/es/domain/entities/Message/Message.js +21 -0
- package/es/domain/entities/Session/Session.js +1 -13
- package/es/domain/entities/index.js +2 -1
- package/es/domain/enum/session/SessionStatus.js +1 -1
- package/package.json +1 -1
- package/es/infrastructure/repositories/sessions/demo.js +0 -21
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { validateSchema } from "../../../core/utils";
|
|
2
|
+
import { IntegrationServices } from "../../enum";
|
|
3
|
+
import { IntegrationServiceSchema } from "../../schema";
|
|
4
|
+
export default class IntegrationService {
|
|
5
|
+
constructor() {
|
|
6
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const validatedData = validateSchema(IntegrationServiceSchema, data);
|
|
8
|
+
this.data = {
|
|
9
|
+
label: validatedData.label || '',
|
|
10
|
+
id: validatedData.id || '',
|
|
11
|
+
provider: validatedData.provider || {},
|
|
12
|
+
logoURL: validatedData.logoURL || null
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static isWhatsApp(integrationServiceId) {
|
|
17
|
+
return integrationServiceId === IntegrationServices.WHATSAPP;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static isTwilio(integrationServiceId) {
|
|
21
|
+
return integrationServiceId === IntegrationServices.TWILIO;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static isBusinessMessaging(integrationServiceId) {
|
|
25
|
+
return integrationServiceId === IntegrationServices.IM_TALK;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
toJSON() {
|
|
29
|
+
return { ...this.data
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { validateSchema } from "../../../core/utils";
|
|
2
|
+
import { MessageDirection, MessageStatus, MessageTypes } from "../../enum";
|
|
2
3
|
import { MessageSchema } from "../../schema";
|
|
3
4
|
import { Actor } from "../Actor";
|
|
4
5
|
import { Attachment } from "../Attachment";
|
|
@@ -37,6 +38,26 @@ export default class Message {
|
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
static isLocationMessage(type) {
|
|
42
|
+
return type === MessageTypes.LOCATION;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static isDeletedMessage(status) {
|
|
46
|
+
return status === MessageStatus.DELETED;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static isOutgoing(direction) {
|
|
50
|
+
return direction === MessageDirection.OUT;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static isInfoMessage(type) {
|
|
54
|
+
return type === MessageTypes.INFO;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static isAttachment(type) {
|
|
58
|
+
return type === MessageTypes.ATTACHMENT;
|
|
59
|
+
}
|
|
60
|
+
|
|
40
61
|
toJSON() {
|
|
41
62
|
return { ...this.data
|
|
42
63
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { validateSchema } from "../../../core/utils";
|
|
2
2
|
import { SessionSchema } from "../../schema";
|
|
3
3
|
import { Actor } from "../Actor";
|
|
4
|
-
import {
|
|
4
|
+
import { SessionReplyStatus, SessionStatus } from "../../enum";
|
|
5
5
|
export default class Session {
|
|
6
6
|
constructor() {
|
|
7
7
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -28,18 +28,6 @@ export default class Session {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
static isWhatsApp(integrationServiceId) {
|
|
32
|
-
return integrationServiceId === IntegrationServices.WHATSAPP;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static isTwilio(integrationServiceId) {
|
|
36
|
-
return integrationServiceId === IntegrationServices.TWILIO;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static isIMTalk(integrationServiceId) {
|
|
40
|
-
return integrationServiceId === IntegrationServices.IM_TALK;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
31
|
static isEnded(sessionStatus) {
|
|
44
32
|
return sessionStatus === SessionStatus.ENDED;
|
|
45
33
|
}
|
package/package.json
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const uiConfig = {
|
|
2
|
-
theme: {
|
|
3
|
-
primaryColor: '#1A73E8'
|
|
4
|
-
},
|
|
5
|
-
labels: {
|
|
6
|
-
session: {},
|
|
7
|
-
conversation: {}
|
|
8
|
-
},
|
|
9
|
-
renderers: {
|
|
10
|
-
session: {},
|
|
11
|
-
conversation: {
|
|
12
|
-
renderInfoMessage: () => {},
|
|
13
|
-
getHoverActions: () => {}
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
navigation: {}
|
|
17
|
-
};
|
|
18
|
-
const serviceInfo = {
|
|
19
|
-
serviceName: 'desk',
|
|
20
|
-
bundledServiceName: 'crmPlus'
|
|
21
|
-
};
|