@zohoim/client-sdk 1.0.0-poc81 → 1.0.0-poc83

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.
@@ -51,14 +51,30 @@ export default class Message {
51
51
  return direction === MessageDirection.OUT;
52
52
  }
53
53
 
54
+ static isIncoming(direction) {
55
+ return direction === MessageDirection.IN;
56
+ }
57
+
54
58
  static isInfo(type) {
55
59
  return type === MessageTypes.INFO;
56
60
  }
57
61
 
62
+ static isExternalInfo(type) {
63
+ return type === MessageTypes.EXTERNAL_INFO;
64
+ }
65
+
58
66
  static isAttachment(type) {
59
67
  return type === MessageTypes.ATTACHMENT;
60
68
  }
61
69
 
70
+ static isTemplate(type) {
71
+ return type === MessageTypes.TEMPLATE;
72
+ }
73
+
74
+ static isActionMessage(type) {
75
+ return type === MessageTypes.ACTION;
76
+ }
77
+
62
78
  static isSystemMessage(message) {
63
79
  return !!message;
64
80
  }
@@ -67,11 +83,25 @@ export default class Message {
67
83
  return systemMessageType === MessageTypes.CX_HAPPINESS_SURVEY;
68
84
  }
69
85
 
86
+ static isWelcomeMessage(systemMessageType) {
87
+ return systemMessageType === MessageTypes.WELCOMEMSG;
88
+ }
89
+
90
+ static isWorkflowMessage(systemMessageType) {
91
+ return systemMessageType === MessageTypes.WORKFLOW_MESSAGE;
92
+ }
93
+
94
+ static isWorkflowNotification(systemMessageType) {
95
+ return systemMessageType === MessageTypes.WORKFLOW_NOTIFICATION;
96
+ }
97
+
70
98
  static isFailed(status) {
71
99
  return status === MessageStatus.FAILED;
72
100
  }
73
101
 
74
- static getMetaValue(meta, key) {
102
+ static getMetaValue() {
103
+ let meta = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
104
+ let key = arguments.length > 1 ? arguments[1] : undefined;
75
105
  const item = meta.find(item => item.name === key);
76
106
  return item ? item.value : '';
77
107
  }
@@ -36,14 +36,34 @@ export default class Session {
36
36
  return sessionStatus === SessionStatus.BLOCKED;
37
37
  }
38
38
 
39
+ static isOnProgress(sessionStatus) {
40
+ return sessionStatus === SessionStatus.ON_PROGRESS;
41
+ }
42
+
43
+ static isHold(sessionStatus) {
44
+ return sessionStatus === SessionStatus.ON_HOLD;
45
+ }
46
+
47
+ static isOpen(sessionStatus) {
48
+ return sessionStatus === SessionStatus.OPEN;
49
+ }
50
+
39
51
  static isInactiveChannel(replyStatus) {
40
52
  return replyStatus === SessionReplyStatus.CHANNEL_INACTIVE;
41
53
  }
42
54
 
55
+ static isChannelDeleted(replyStatus) {
56
+ return replyStatus === SessionReplyStatus.CHANNEL_DELETED;
57
+ }
58
+
43
59
  static isReplyAccepted(replyStatus) {
44
60
  return replyStatus === SessionReplyStatus.ACCEPTED;
45
61
  }
46
62
 
63
+ static isEndUserOffline(replyStatus) {
64
+ return replyStatus === SessionReplyStatus.ENDUSER_OFFLINE;
65
+ }
66
+
47
67
  static isAssignedToOtherService(replyStatus) {
48
68
  return replyStatus === SessionReplyStatus.ASSIGNED_TO_OTHER_SERVICE;
49
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.0.0-poc81",
3
+ "version": "1.0.0-poc83",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",