easywork-common-lib 1.0.1273 → 1.0.1275
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/dist/common/dtos/index.d.ts +1 -0
- package/dist/common/dtos/index.js +1 -0
- package/dist/common/dtos/index.js.map +1 -1
- package/dist/dtos/whatsapp-send-command.dto.d.ts +115 -0
- package/dist/dtos/whatsapp-send-command.dto.js +16 -0
- package/dist/dtos/whatsapp-send-command.dto.js.map +1 -0
- package/package.json +1 -1
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./send-notification.dto"), exports);
|
|
18
|
+
__exportStar(require("../../dtos/whatsapp-send-command.dto"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,uEAAqD"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { WhatsAppMessageType, WhatsAppCostType } from '../entities/messaging/whatsapp/whatsapp.enum';
|
|
2
|
+
export declare enum WhatsAppCommandRoutingKey {
|
|
3
|
+
SEND_SESSION = "whatsapp-command.send-session",
|
|
4
|
+
SEND_TEMPLATE = "whatsapp-command.send-template",
|
|
5
|
+
SEND_INTERACTIVE = "whatsapp-command.send-interactive",
|
|
6
|
+
SEND_MEDIA = "whatsapp-command.send-media"
|
|
7
|
+
}
|
|
8
|
+
export declare enum WhatsAppResultRoutingKey {
|
|
9
|
+
MESSAGE_SENT = "whatsapp-result.message-sent",
|
|
10
|
+
MESSAGE_FAILED = "whatsapp-result.message-failed"
|
|
11
|
+
}
|
|
12
|
+
export interface BaseWhatsAppSendCommand {
|
|
13
|
+
messageId: string;
|
|
14
|
+
conversationId: string;
|
|
15
|
+
phoneNumber: string;
|
|
16
|
+
groupId: string;
|
|
17
|
+
providerConfigurationId: string;
|
|
18
|
+
groupWhatsAppNumberId: string;
|
|
19
|
+
costType: WhatsAppCostType;
|
|
20
|
+
timestamp: Date;
|
|
21
|
+
sentByUserId?: string;
|
|
22
|
+
metadata?: Record<string, any>;
|
|
23
|
+
}
|
|
24
|
+
export interface SendSessionMessageCommand extends BaseWhatsAppSendCommand {
|
|
25
|
+
type: 'session';
|
|
26
|
+
content: string;
|
|
27
|
+
messageType: WhatsAppMessageType;
|
|
28
|
+
mediaUrl?: string;
|
|
29
|
+
mediaCaption?: string;
|
|
30
|
+
replyToMessageId?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface TemplateParameter {
|
|
33
|
+
type: 'text' | 'currency' | 'date_time' | 'image' | 'document' | 'video';
|
|
34
|
+
text?: string;
|
|
35
|
+
currency?: {
|
|
36
|
+
fallback_value: string;
|
|
37
|
+
code: string;
|
|
38
|
+
amount_1000: number;
|
|
39
|
+
};
|
|
40
|
+
date_time?: {
|
|
41
|
+
fallback_value: string;
|
|
42
|
+
};
|
|
43
|
+
image?: {
|
|
44
|
+
link: string;
|
|
45
|
+
};
|
|
46
|
+
document?: {
|
|
47
|
+
link: string;
|
|
48
|
+
filename?: string;
|
|
49
|
+
};
|
|
50
|
+
video?: {
|
|
51
|
+
link: string;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface SendTemplateMessageCommand extends BaseWhatsAppSendCommand {
|
|
55
|
+
type: 'template';
|
|
56
|
+
templateName: string;
|
|
57
|
+
language?: string;
|
|
58
|
+
parameters?: TemplateParameter[];
|
|
59
|
+
headerParameters?: TemplateParameter[];
|
|
60
|
+
}
|
|
61
|
+
export interface InteractiveButton {
|
|
62
|
+
id: string;
|
|
63
|
+
title: string;
|
|
64
|
+
type?: 'quick_reply';
|
|
65
|
+
}
|
|
66
|
+
export interface InteractiveListSection {
|
|
67
|
+
title: string;
|
|
68
|
+
rows: Array<{
|
|
69
|
+
id: string;
|
|
70
|
+
title: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
}>;
|
|
73
|
+
}
|
|
74
|
+
export interface InteractiveHeader {
|
|
75
|
+
type: 'text' | 'image' | 'video' | 'document';
|
|
76
|
+
text?: string;
|
|
77
|
+
mediaUrl?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface SendInteractiveMessageCommand extends BaseWhatsAppSendCommand {
|
|
80
|
+
type: 'interactive';
|
|
81
|
+
interactiveType: 'button' | 'list';
|
|
82
|
+
header?: InteractiveHeader;
|
|
83
|
+
body: string;
|
|
84
|
+
footer?: string;
|
|
85
|
+
buttons?: InteractiveButton[];
|
|
86
|
+
listSections?: InteractiveListSection[];
|
|
87
|
+
listButtonText?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface SendMediaMessageCommand extends BaseWhatsAppSendCommand {
|
|
90
|
+
type: 'media';
|
|
91
|
+
mediaType: 'image' | 'video' | 'document' | 'audio';
|
|
92
|
+
mediaUrl: string;
|
|
93
|
+
fileName?: string;
|
|
94
|
+
caption?: string;
|
|
95
|
+
mimeType?: string;
|
|
96
|
+
}
|
|
97
|
+
export type WhatsAppSendCommand = SendSessionMessageCommand | SendTemplateMessageCommand | SendInteractiveMessageCommand | SendMediaMessageCommand;
|
|
98
|
+
export interface WhatsAppSendSuccessResult {
|
|
99
|
+
success: true;
|
|
100
|
+
messageId: string;
|
|
101
|
+
providerMessageId?: string;
|
|
102
|
+
whatsappMessageId?: string;
|
|
103
|
+
timestamp: Date;
|
|
104
|
+
metadata?: Record<string, any>;
|
|
105
|
+
}
|
|
106
|
+
export interface WhatsAppSendFailureResult {
|
|
107
|
+
success: false;
|
|
108
|
+
messageId: string;
|
|
109
|
+
error: string;
|
|
110
|
+
errorCode?: string;
|
|
111
|
+
timestamp: Date;
|
|
112
|
+
retryable?: boolean;
|
|
113
|
+
metadata?: Record<string, any>;
|
|
114
|
+
}
|
|
115
|
+
export type WhatsAppSendResult = WhatsAppSendSuccessResult | WhatsAppSendFailureResult;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WhatsAppResultRoutingKey = exports.WhatsAppCommandRoutingKey = void 0;
|
|
4
|
+
var WhatsAppCommandRoutingKey;
|
|
5
|
+
(function (WhatsAppCommandRoutingKey) {
|
|
6
|
+
WhatsAppCommandRoutingKey["SEND_SESSION"] = "whatsapp-command.send-session";
|
|
7
|
+
WhatsAppCommandRoutingKey["SEND_TEMPLATE"] = "whatsapp-command.send-template";
|
|
8
|
+
WhatsAppCommandRoutingKey["SEND_INTERACTIVE"] = "whatsapp-command.send-interactive";
|
|
9
|
+
WhatsAppCommandRoutingKey["SEND_MEDIA"] = "whatsapp-command.send-media";
|
|
10
|
+
})(WhatsAppCommandRoutingKey || (exports.WhatsAppCommandRoutingKey = WhatsAppCommandRoutingKey = {}));
|
|
11
|
+
var WhatsAppResultRoutingKey;
|
|
12
|
+
(function (WhatsAppResultRoutingKey) {
|
|
13
|
+
WhatsAppResultRoutingKey["MESSAGE_SENT"] = "whatsapp-result.message-sent";
|
|
14
|
+
WhatsAppResultRoutingKey["MESSAGE_FAILED"] = "whatsapp-result.message-failed";
|
|
15
|
+
})(WhatsAppResultRoutingKey || (exports.WhatsAppResultRoutingKey = WhatsAppResultRoutingKey = {}));
|
|
16
|
+
//# sourceMappingURL=whatsapp-send-command.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whatsapp-send-command.dto.js","sourceRoot":"","sources":["../../src/dtos/whatsapp-send-command.dto.ts"],"names":[],"mappings":";;;AAUA,IAAY,yBAYX;AAZD,WAAY,yBAAyB;IAEnC,2EAA8C,CAAA;IAG9C,6EAAgD,CAAA;IAGhD,mFAAsD,CAAA;IAGtD,uEAA0C,CAAA;AAC5C,CAAC,EAZW,yBAAyB,yCAAzB,yBAAyB,QAYpC;AAKD,IAAY,wBAMX;AAND,WAAY,wBAAwB;IAElC,yEAA6C,CAAA;IAG7C,6EAAiD,CAAA;AACnD,CAAC,EANW,wBAAwB,wCAAxB,wBAAwB,QAMnC"}
|