@peacom/core 0.0.30 → 0.0.31
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/package.json +1 -1
- package/src/lib/model/Message.d.ts +2 -1
- package/src/lib/model/Message.js +1 -0
- package/src/lib/model/Message.js.map +1 -1
- package/src/lib/util/message/message.util.d.ts +25 -23
- package/src/lib/util/message/message.util.js +27 -26
- package/src/lib/util/message/message.util.js.map +1 -1
package/package.json
CHANGED
@@ -36,7 +36,8 @@ export declare enum MESSAGE_REACTION {
|
|
36
36
|
export declare enum SuggestionActionType {
|
37
37
|
OPEN_URL = "open-url",
|
38
38
|
REPLY = "reply",
|
39
|
-
DIAL = "dial"
|
39
|
+
DIAL = "dial",
|
40
|
+
LIVE_AGENT_REQUEST = "liveAgentRequest"
|
40
41
|
}
|
41
42
|
export interface FileInfo {
|
42
43
|
type: string;
|
package/src/lib/model/Message.js
CHANGED
@@ -57,5 +57,6 @@ var SuggestionActionType;
|
|
57
57
|
SuggestionActionType["OPEN_URL"] = "open-url";
|
58
58
|
SuggestionActionType["REPLY"] = "reply";
|
59
59
|
SuggestionActionType["DIAL"] = "dial";
|
60
|
+
SuggestionActionType["LIVE_AGENT_REQUEST"] = "liveAgentRequest";
|
60
61
|
})(SuggestionActionType = exports.SuggestionActionType || (exports.SuggestionActionType = {}));
|
61
62
|
//# sourceMappingURL=Message.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../../../../../packages/core/src/lib/model/Message.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAG1C,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,yDAAW,CAAA;IACX,yDAAW,CAAA;IACX,mDAAQ,CAAA;IACR,6DAAa,CAAA;IACb,mDAAQ,CAAA;AACV,CAAC,EANW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAMzB;AAED,IAAY,YAcX;AAdD,WAAY,YAAY;IACtB,6BAAa,CA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,CAAC;IACvE,CAAC,yBAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;IAC3C,CAAC,yBAAW,CAAC,SAAS,CAAC,EAAE,uBAAe;IACxC,CAAC,yBAAW,CAAC,QAAQ,CAAC,EAAE,uBAAe;IACvC,CAAC,yBAAW,CAAC,eAAe,CAAC,EAAE,uBAAe;CAC/C,CAAA;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,yDAAS,CAAA;IACT,+DAAY,CAAA;AACd,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AAED,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,yDAAS,CAAA;IACT,uDAAQ,CAAA;IACR,+EAAoB,CAAA;AACtB,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAED,IAAY,
|
1
|
+
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../../../../../packages/core/src/lib/model/Message.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAG1C,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,yDAAW,CAAA;IACX,yDAAW,CAAA;IACX,mDAAQ,CAAA;IACR,6DAAa,CAAA;IACb,mDAAQ,CAAA;AACV,CAAC,EANW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAMzB;AAED,IAAY,YAcX;AAdD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,6DAA6C,CAAA;IAC7C,uCAAuB,CAAA;IACvB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,6BAAa,CAAA;IACb,sCAAsB,CAAA;IACtB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,qCAAqB,CAAA;IACrB,qDAAqC,CAAA;IACrC,iEAAiD,CAAA;IACjD,+DAA+C,CAAA;AACjD,CAAC,EAdW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAcvB;AAEY,QAAA,eAAe,GAA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d,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AAED,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,yDAAS,CAAA;IACT,uDAAQ,CAAA;IACR,+EAAoB,CAAA;AACtB,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAED,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,6CAAqB,CAAA;IACrB,uCAAe,CAAA;IACf,qCAAa,CAAA;IACb,+DAAuC,CAAA;AACzC,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B"}
|
@@ -1,42 +1,21 @@
|
|
1
|
-
import { FileInfo, MESSAGE_TYPE } from "../../model";
|
1
|
+
import { FileInfo, MESSAGE_TYPE, RawMessageSuggestion } from "../../model";
|
2
2
|
interface ImageMessage {
|
3
3
|
imageUrl: string;
|
4
4
|
fileName?: string;
|
5
5
|
fileSize?: number;
|
6
6
|
message?: string;
|
7
7
|
}
|
8
|
-
export declare const buildImageMessage: ({ imageUrl, fileName, fileSize, message }: ImageMessage, extra?: null) => {
|
9
|
-
type: MESSAGE_TYPE;
|
10
|
-
fileName: string;
|
11
|
-
fileSize: number | undefined;
|
12
|
-
fileUrl: string;
|
13
|
-
message: string;
|
14
|
-
extra: null;
|
15
|
-
};
|
16
8
|
interface VideoMessage {
|
17
9
|
fileUrl: string;
|
18
10
|
thumbnailUrl?: string;
|
19
11
|
duration?: number;
|
20
12
|
message?: string;
|
21
13
|
}
|
22
|
-
export declare const buildVideoMessage: ({ fileUrl, duration, thumbnailUrl, message }: VideoMessage, extra?: null) => {
|
23
|
-
type: MESSAGE_TYPE;
|
24
|
-
duration: number | undefined;
|
25
|
-
fileUrl: string;
|
26
|
-
thumbnailUrl: string | undefined;
|
27
|
-
message: string;
|
28
|
-
extra: null;
|
29
|
-
};
|
30
14
|
interface TextMessage {
|
31
15
|
attachments?: Array<FileInfo>;
|
32
16
|
message: string;
|
17
|
+
suggestions?: Array<RawMessageSuggestion>;
|
33
18
|
}
|
34
|
-
export declare const buildTextMessage: ({ message, attachments }: TextMessage, extra?: null) => {
|
35
|
-
type: MESSAGE_TYPE;
|
36
|
-
message: string;
|
37
|
-
attachments: FileInfo[] | undefined;
|
38
|
-
extra: null;
|
39
|
-
};
|
40
19
|
interface Location {
|
41
20
|
longitude: number;
|
42
21
|
latitude: number;
|
@@ -68,6 +47,13 @@ export declare const buildFileMessage: ({ message, fileUrl, fileName, fileSize }
|
|
68
47
|
interface RichCardMessage {
|
69
48
|
richCards: Array<unknown>;
|
70
49
|
}
|
50
|
+
export declare const buildTextMessage: ({ message, attachments, suggestions }: TextMessage, extra?: null) => {
|
51
|
+
type: MESSAGE_TYPE;
|
52
|
+
message: string;
|
53
|
+
suggestions: RawMessageSuggestion[] | undefined;
|
54
|
+
attachments: FileInfo[] | undefined;
|
55
|
+
extra: null;
|
56
|
+
};
|
71
57
|
export declare const buildRichCardMessage: ({ richCards }: RichCardMessage, extra?: null) => {
|
72
58
|
message: string;
|
73
59
|
type: MESSAGE_TYPE;
|
@@ -84,4 +70,20 @@ export declare const buildTypingIndicatorStopMessage: (extra?: null) => {
|
|
84
70
|
type: MESSAGE_TYPE;
|
85
71
|
extra: null;
|
86
72
|
};
|
73
|
+
export declare const buildImageMessage: ({ imageUrl, fileName, fileSize, message }: ImageMessage, extra?: null) => {
|
74
|
+
type: MESSAGE_TYPE;
|
75
|
+
fileName: string;
|
76
|
+
fileSize: number | undefined;
|
77
|
+
fileUrl: string;
|
78
|
+
message: string;
|
79
|
+
extra: null;
|
80
|
+
};
|
81
|
+
export declare const buildVideoMessage: ({ fileUrl, duration, thumbnailUrl, message }: VideoMessage, extra?: null) => {
|
82
|
+
type: MESSAGE_TYPE;
|
83
|
+
duration: number | undefined;
|
84
|
+
fileUrl: string;
|
85
|
+
thumbnailUrl: string | undefined;
|
86
|
+
message: string;
|
87
|
+
extra: null;
|
88
|
+
};
|
87
89
|
export {};
|
@@ -1,32 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.buildVideoMessage = exports.buildImageMessage = exports.buildTypingIndicatorStopMessage = exports.buildTypingIndicatorStartMessage = exports.buildRichCardMessage = exports.buildTextMessage = exports.buildFileMessage = exports.buildLocationMessage = void 0;
|
4
4
|
const model_1 = require("../../model");
|
5
|
-
const buildImageMessage = ({ imageUrl, fileName = "", fileSize, message = "" }, extra = null) => ({
|
6
|
-
type: model_1.MESSAGE_TYPE.PICTURE,
|
7
|
-
fileName: fileName,
|
8
|
-
fileSize: fileSize,
|
9
|
-
fileUrl: imageUrl,
|
10
|
-
message: message,
|
11
|
-
extra
|
12
|
-
});
|
13
|
-
exports.buildImageMessage = buildImageMessage;
|
14
|
-
const buildVideoMessage = ({ fileUrl, duration, thumbnailUrl, message = "" }, extra = null) => ({
|
15
|
-
type: model_1.MESSAGE_TYPE.VIDEO,
|
16
|
-
duration,
|
17
|
-
fileUrl,
|
18
|
-
thumbnailUrl,
|
19
|
-
message,
|
20
|
-
extra
|
21
|
-
});
|
22
|
-
exports.buildVideoMessage = buildVideoMessage;
|
23
|
-
const buildTextMessage = ({ message, attachments }, extra = null) => ({
|
24
|
-
type: model_1.MESSAGE_TYPE.TEXT,
|
25
|
-
message,
|
26
|
-
attachments,
|
27
|
-
extra
|
28
|
-
});
|
29
|
-
exports.buildTextMessage = buildTextMessage;
|
30
5
|
const buildLocationMessage = ({ location, message = "" }, extra = null) => ({
|
31
6
|
type: model_1.MESSAGE_TYPE.LOCATION,
|
32
7
|
message,
|
@@ -43,6 +18,14 @@ const buildFileMessage = ({ message = "", fileUrl, fileName = "", fileSize = 0 }
|
|
43
18
|
extra
|
44
19
|
});
|
45
20
|
exports.buildFileMessage = buildFileMessage;
|
21
|
+
const buildTextMessage = ({ message, attachments, suggestions }, extra = null) => ({
|
22
|
+
type: model_1.MESSAGE_TYPE.TEXT,
|
23
|
+
message,
|
24
|
+
suggestions,
|
25
|
+
attachments,
|
26
|
+
extra
|
27
|
+
});
|
28
|
+
exports.buildTextMessage = buildTextMessage;
|
46
29
|
const buildRichCardMessage = ({ richCards }, extra = null) => ({
|
47
30
|
message: "",
|
48
31
|
type: model_1.MESSAGE_TYPE.RICH_CARD,
|
@@ -62,4 +45,22 @@ const buildTypingIndicatorStopMessage = (extra = null) => ({
|
|
62
45
|
extra
|
63
46
|
});
|
64
47
|
exports.buildTypingIndicatorStopMessage = buildTypingIndicatorStopMessage;
|
48
|
+
const buildImageMessage = ({ imageUrl, fileName = "", fileSize, message = "" }, extra = null) => ({
|
49
|
+
type: model_1.MESSAGE_TYPE.PICTURE,
|
50
|
+
fileName: fileName,
|
51
|
+
fileSize: fileSize,
|
52
|
+
fileUrl: imageUrl,
|
53
|
+
message: message,
|
54
|
+
extra
|
55
|
+
});
|
56
|
+
exports.buildImageMessage = buildImageMessage;
|
57
|
+
const buildVideoMessage = ({ fileUrl, duration, thumbnailUrl, message = "" }, extra = null) => ({
|
58
|
+
type: model_1.MESSAGE_TYPE.VIDEO,
|
59
|
+
duration,
|
60
|
+
fileUrl,
|
61
|
+
thumbnailUrl,
|
62
|
+
message,
|
63
|
+
extra
|
64
|
+
});
|
65
|
+
exports.buildVideoMessage = buildVideoMessage;
|
65
66
|
//# sourceMappingURL=message.util.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"message.util.js","sourceRoot":"","sources":["../../../../../../../packages/core/src/lib/util/message/message.util.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"message.util.js","sourceRoot":"","sources":["../../../../../../../packages/core/src/lib/util/message/message.util.ts"],"names":[],"mappings":";;;AAAA,uCAAyE;AAgClE,MAAM,oBAAoB,GAAG,CAClC,EAAC,QAAQ,EAAE,OAAO,GAAG,EAAE,EAAkB,EACzC,KAAK,GAAG,IAAI,EACZ,EAAE,CAAC,CAAC;IACJ,IAAI,EAAE,oBAAY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