n8n-nodes-wecom 0.1.4 → 0.1.6
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/README.md +35 -29
- package/dist/credentials/WeComWebhookApi.credentials.d.ts +13 -0
- package/dist/credentials/WeComWebhookApi.credentials.js +44 -0
- package/dist/credentials/WeComWebhookApi.credentials.js.map +1 -0
- package/dist/nodes/WeCom/WeCom.node.js +10 -1
- package/dist/nodes/WeCom/WeCom.node.js.map +1 -1
- package/dist/nodes/WeCom/resources/pushMessage/execute.js +123 -99
- package/dist/nodes/WeCom/resources/pushMessage/execute.js.map +1 -1
- package/dist/nodes/WeCom/resources/pushMessage/index.js +51 -43
- package/dist/nodes/WeCom/resources/pushMessage/index.js.map +1 -1
- package/dist/nodes/WeCom/resources/pushMessage/sendFile.d.ts +2 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendFile.js +22 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendFile.js.map +1 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendImage.d.ts +2 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendImage.js +65 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendImage.js.map +1 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendMarkdown.d.ts +2 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendMarkdown.js +25 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendMarkdown.js.map +1 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendMarkdownV2.d.ts +2 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendMarkdownV2.js +25 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendMarkdownV2.js.map +1 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendNews.d.ts +2 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendNews.js +68 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendNews.js.map +1 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendTemplateCard.d.ts +2 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendTemplateCard.js +431 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendTemplateCard.js.map +1 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendText.d.ts +2 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendText.js +25 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendText.js.map +1 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendVoice.d.ts +2 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendVoice.js +22 -0
- package/dist/nodes/WeCom/resources/pushMessage/sendVoice.js.map +1 -0
- package/dist/nodes/WeCom/shared/types.d.ts +6 -55
- package/dist/package.json +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/dist/nodes/WeCom/resources/pushMessage/receiveEvent.d.ts +0 -94
- package/dist/nodes/WeCom/resources/pushMessage/receiveEvent.js +0 -105
- package/dist/nodes/WeCom/resources/pushMessage/receiveEvent.js.map +0 -1
- package/dist/nodes/WeCom/resources/pushMessage/receiveImage.d.ts +0 -12
- package/dist/nodes/WeCom/resources/pushMessage/receiveImage.js +0 -22
- package/dist/nodes/WeCom/resources/pushMessage/receiveImage.js.map +0 -1
- package/dist/nodes/WeCom/resources/pushMessage/receiveLink.d.ts +0 -14
- package/dist/nodes/WeCom/resources/pushMessage/receiveLink.js +0 -22
- package/dist/nodes/WeCom/resources/pushMessage/receiveLink.js.map +0 -1
- package/dist/nodes/WeCom/resources/pushMessage/receiveLocation.d.ts +0 -15
- package/dist/nodes/WeCom/resources/pushMessage/receiveLocation.js +0 -22
- package/dist/nodes/WeCom/resources/pushMessage/receiveLocation.js.map +0 -1
- package/dist/nodes/WeCom/resources/pushMessage/receiveText.d.ts +0 -11
- package/dist/nodes/WeCom/resources/pushMessage/receiveText.js +0 -22
- package/dist/nodes/WeCom/resources/pushMessage/receiveText.js.map +0 -1
- package/dist/nodes/WeCom/resources/pushMessage/receiveVideo.d.ts +0 -12
- package/dist/nodes/WeCom/resources/pushMessage/receiveVideo.js +0 -22
- package/dist/nodes/WeCom/resources/pushMessage/receiveVideo.js.map +0 -1
- package/dist/nodes/WeCom/resources/pushMessage/receiveVoice.d.ts +0 -12
- package/dist/nodes/WeCom/resources/pushMessage/receiveVoice.js +0 -22
- package/dist/nodes/WeCom/resources/pushMessage/receiveVoice.js.map +0 -1
package/README.md
CHANGED
|
@@ -14,13 +14,18 @@ npm install n8n-nodes-wecom
|
|
|
14
14
|
|
|
15
15
|
## 凭证配置
|
|
16
16
|
|
|
17
|
-
###
|
|
17
|
+
### 消息推送功能(群机器人 Webhook)
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
19
|
+
**消息推送**功能用于通过群机器人 Webhook 发送消息到企业微信群聊。此功能特点:
|
|
20
|
+
- 使用群机器人的 Webhook URL 发送消息
|
|
21
|
+
- 无需配置企业ID、应用Secret等复杂凭证
|
|
22
|
+
- 适合快速发送通知消息到群聊
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
#### 配置步骤:
|
|
25
|
+
1. 在企业微信群聊中,点击右上角"..."菜单
|
|
26
|
+
2. 选择"群机器人" > "添加机器人"
|
|
27
|
+
3. 创建一个机器人并复制 Webhook 地址
|
|
28
|
+
4. 在 n8n 中配置"企业微信群机器人 Webhook"凭证,填入 Webhook 地址
|
|
24
29
|
|
|
25
30
|
### 获取企业微信凭证(消息发送、通讯录、素材管理功能需要)
|
|
26
31
|
|
|
@@ -33,47 +38,48 @@ npm install n8n-nodes-wecom
|
|
|
33
38
|
### 在 n8n 中配置
|
|
34
39
|
|
|
35
40
|
1. 添加"企业微信"节点到工作流
|
|
36
|
-
2.
|
|
41
|
+
2. 根据使用的功能选择对应的凭证:
|
|
42
|
+
|
|
43
|
+
**消息推送(群机器人):**
|
|
44
|
+
- 点击"Credential to connect with"
|
|
45
|
+
- 选择"创建新凭证 - 企业微信群机器人 Webhook"
|
|
46
|
+
- 填入群机器人的 Webhook URL
|
|
47
|
+
|
|
48
|
+
**应用消息、通讯录、素材管理:**
|
|
37
49
|
- 点击"Credential to connect with"
|
|
38
50
|
- 选择"创建新凭证 - 企业微信 API"
|
|
39
51
|
- 填入以下信息:
|
|
40
52
|
- **企业 ID** - 你的企业 CorpID
|
|
41
53
|
- **应用 Secret** - 应用的 Secret
|
|
42
54
|
- **应用 ID** - 应用的 AgentID
|
|
43
|
-
3. 如果使用消息推送功能,则无需配置凭证
|
|
44
55
|
|
|
45
56
|
### 权限配置
|
|
46
57
|
|
|
47
58
|
确保应用具有以下权限(在应用的"API权限"中开启):
|
|
48
59
|
|
|
49
|
-
- ✅
|
|
50
|
-
- ✅ 消息接收权限(用于消息推送)
|
|
60
|
+
- ✅ 消息发送权限(用于应用消息)
|
|
51
61
|
- ✅ 通讯录读取权限(读取成员、部门、标签信息)
|
|
52
62
|
- ✅ 素材管理权限
|
|
53
63
|
- ✅ 应用可见范围(建议设置为全员)
|
|
54
64
|
|
|
65
|
+
**注意**:消息推送功能使用群机器人,无需配置应用权限
|
|
66
|
+
|
|
55
67
|
## 已实现功能
|
|
56
68
|
|
|
57
|
-
### 📩
|
|
58
|
-
|
|
59
|
-
- ✅
|
|
60
|
-
- ✅
|
|
61
|
-
- ✅
|
|
62
|
-
- ✅
|
|
63
|
-
- ✅
|
|
64
|
-
- ✅
|
|
65
|
-
- ✅
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- 拍照发图事件
|
|
72
|
-
- 地理位置事件
|
|
73
|
-
- 进入应用事件
|
|
74
|
-
- 批量任务完成事件
|
|
75
|
-
|
|
76
|
-
### 📨 消息发送
|
|
69
|
+
### 📩 消息推送(群机器人)
|
|
70
|
+
|
|
71
|
+
- ✅ 发送文本消息
|
|
72
|
+
- ✅ 发送 Markdown 消息
|
|
73
|
+
- ✅ 发送 Markdown V2 消息
|
|
74
|
+
- ✅ 发送图片消息
|
|
75
|
+
- ✅ 发送图文消息
|
|
76
|
+
- ✅ 发送文件消息
|
|
77
|
+
- ✅ 发送语音消息
|
|
78
|
+
- ✅ 发送模板卡片消息
|
|
79
|
+
- 文本通知模板卡片
|
|
80
|
+
- 图文展示模板卡片
|
|
81
|
+
|
|
82
|
+
### 📨 应用消息发送
|
|
77
83
|
|
|
78
84
|
- ✅ 发送文本消息
|
|
79
85
|
- ✅ 发送 Markdown 消息
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class WeComWebhookApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: {
|
|
7
|
+
readonly light: "file:../icons/wecom.png";
|
|
8
|
+
readonly dark: "file:../icons/wecom.dark.png";
|
|
9
|
+
};
|
|
10
|
+
properties: INodeProperties[];
|
|
11
|
+
authenticate: IAuthenticateGeneric;
|
|
12
|
+
test: ICredentialTestRequest;
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WeComWebhookApi = void 0;
|
|
4
|
+
class WeComWebhookApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'weComWebhookApi';
|
|
7
|
+
this.displayName = '企业微信群机器人 Webhook API';
|
|
8
|
+
this.documentationUrl = 'https://developer.work.weixin.qq.com/document/path/91770';
|
|
9
|
+
this.icon = { light: 'file:../icons/wecom.png', dark: 'file:../icons/wecom.dark.png' };
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Webhook URL',
|
|
13
|
+
name: 'webhookUrl',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: {
|
|
16
|
+
password: true,
|
|
17
|
+
},
|
|
18
|
+
default: '',
|
|
19
|
+
required: true,
|
|
20
|
+
placeholder: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxxx',
|
|
21
|
+
description: '企业微信群机器人的 Webhook 地址',
|
|
22
|
+
hint: '在企业微信群聊中添加机器人后获取',
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
this.authenticate = {
|
|
26
|
+
type: 'generic',
|
|
27
|
+
properties: {},
|
|
28
|
+
};
|
|
29
|
+
this.test = {
|
|
30
|
+
request: {
|
|
31
|
+
baseURL: '={{$credentials.webhookUrl}}',
|
|
32
|
+
method: 'POST',
|
|
33
|
+
body: {
|
|
34
|
+
msgtype: 'text',
|
|
35
|
+
text: {
|
|
36
|
+
content: 'n8n 凭证测试消息',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.WeComWebhookApi = WeComWebhookApi;
|
|
44
|
+
//# sourceMappingURL=WeComWebhookApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WeComWebhookApi.credentials.js","sourceRoot":"","sources":["../../credentials/WeComWebhookApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,eAAe;IAA5B;QACC,SAAI,GAAG,iBAAiB,CAAC;QAEzB,gBAAW,GAAG,sBAAsB,CAAC;QAErC,qBAAgB,GAAG,0DAA0D,CAAC;QAE9E,SAAI,GAAG,EAAE,KAAK,EAAE,yBAAyB,EAAE,IAAI,EAAE,8BAA8B,EAAW,CAAC;QAE3F,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,+DAA+D;gBAC5E,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,kBAAkB;aACxB;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,EAAE;SACd,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,8BAA8B;gBACvC,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE;oBACL,OAAO,EAAE,MAAM;oBACf,IAAI,EAAE;wBACL,OAAO,EAAE,YAAY;qBACrB;iBACD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AA1CD,0CA0CC"}
|
|
@@ -28,6 +28,15 @@ class WeCom {
|
|
|
28
28
|
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
29
29
|
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
30
30
|
credentials: [
|
|
31
|
+
{
|
|
32
|
+
name: 'weComWebhookApi',
|
|
33
|
+
required: true,
|
|
34
|
+
displayOptions: {
|
|
35
|
+
show: {
|
|
36
|
+
resource: ['pushMessage'],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
31
40
|
{
|
|
32
41
|
name: 'weComApi',
|
|
33
42
|
required: true,
|
|
@@ -55,7 +64,7 @@ class WeCom {
|
|
|
55
64
|
{
|
|
56
65
|
name: '消息推送',
|
|
57
66
|
value: 'pushMessage',
|
|
58
|
-
description: '
|
|
67
|
+
description: '通过群机器人 Webhook 发送消息到群聊',
|
|
59
68
|
},
|
|
60
69
|
{
|
|
61
70
|
name: '应用消息',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeCom.node.js","sourceRoot":"","sources":["../../../nodes/WeCom/WeCom.node.ts"],"names":[],"mappings":";;;AAQA,+CAAmD;AACnD,yDAAiE;AACjE,iDAAyD;AACzD,iDAAyD;AACzD,mDAA2D;AAC3D,6DAAqE;AACrE,yDAA6D;AAC7D,yDAA6D;AAC7D,0DAA+D;AAC/D,kDAAqD;AAErD,MAAa,KAAK;IAAlB;QACC,gBAAW,G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C,CAAC;QAExD,IAAI,UAAU,GAAyB,EAAE,CAAC;QAE1C,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;YAChC,UAAU,GAAG,MAAM,4BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAmB,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;aAAM,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnC,UAAU,GAAG,MAAM,wBAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAmB,EAAE,KAAK,CAAC,CAAC;QAC1E,CAAC;aAAM,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnC,UAAU,GAAG,MAAM,wBAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAmB,EAAE,KAAK,CAAC,CAAC;QAC1E,CAAC;aAAM,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;YACpC,UAAU,GAAG,MAAM,yBAAe,CAAC,IAAI,CAAC,IAAI,EAAE,SAAmB,EAAE,KAAK,CAAC,CAAC;QAC3E,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAzMD,sBAyMC"}
|
|
@@ -6,123 +6,147 @@ async function executePushMessage(operation, items) {
|
|
|
6
6
|
const returnData = [];
|
|
7
7
|
for (let i = 0; i < items.length; i++) {
|
|
8
8
|
try {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
createTime: messageData.CreateTime,
|
|
20
|
-
agentId: messageData.AgentID,
|
|
21
|
-
raw: messageData,
|
|
9
|
+
const credentials = await this.getCredentials('weComWebhookApi');
|
|
10
|
+
const webhookUrl = credentials.webhookUrl;
|
|
11
|
+
let body = {};
|
|
12
|
+
if (operation === 'sendText') {
|
|
13
|
+
const content = this.getNodeParameter('content', i);
|
|
14
|
+
body = {
|
|
15
|
+
msgtype: 'text',
|
|
16
|
+
text: {
|
|
17
|
+
content,
|
|
18
|
+
},
|
|
22
19
|
};
|
|
23
20
|
}
|
|
24
|
-
else if (operation === '
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
picUrl: messageData.PicUrl,
|
|
32
|
-
mediaId: messageData.MediaId,
|
|
33
|
-
msgId: messageData.MsgId,
|
|
34
|
-
createTime: messageData.CreateTime,
|
|
35
|
-
agentId: messageData.AgentID,
|
|
36
|
-
raw: messageData,
|
|
21
|
+
else if (operation === 'sendMarkdown') {
|
|
22
|
+
const content = this.getNodeParameter('content', i);
|
|
23
|
+
body = {
|
|
24
|
+
msgtype: 'markdown',
|
|
25
|
+
markdown: {
|
|
26
|
+
content,
|
|
27
|
+
},
|
|
37
28
|
};
|
|
38
29
|
}
|
|
39
|
-
else if (operation === '
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
else if (operation === 'sendImage') {
|
|
31
|
+
const imageSource = this.getNodeParameter('imageSource', i);
|
|
32
|
+
if (imageSource === 'base64') {
|
|
33
|
+
const base64 = this.getNodeParameter('base64', i);
|
|
34
|
+
body = {
|
|
35
|
+
msgtype: 'image',
|
|
36
|
+
image: {
|
|
37
|
+
base64,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const md5 = this.getNodeParameter('md5', i);
|
|
43
|
+
body = {
|
|
44
|
+
msgtype: 'image',
|
|
45
|
+
image: {
|
|
46
|
+
md5,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else if (operation === 'sendNews') {
|
|
52
|
+
const articlesData = this.getNodeParameter('articles', i);
|
|
53
|
+
const articles = articlesData.article || [];
|
|
54
|
+
body = {
|
|
55
|
+
msgtype: 'news',
|
|
56
|
+
news: {
|
|
57
|
+
articles: articles.map((article) => ({
|
|
58
|
+
title: article.title,
|
|
59
|
+
description: article.description,
|
|
60
|
+
url: article.url,
|
|
61
|
+
picurl: article.picurl,
|
|
62
|
+
})),
|
|
63
|
+
},
|
|
52
64
|
};
|
|
53
65
|
}
|
|
54
|
-
else if (operation === '
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
mediaId: messageData.MediaId,
|
|
62
|
-
thumbMediaId: messageData.ThumbMediaId,
|
|
63
|
-
msgId: messageData.MsgId,
|
|
64
|
-
createTime: messageData.CreateTime,
|
|
65
|
-
agentId: messageData.AgentID,
|
|
66
|
-
raw: messageData,
|
|
66
|
+
else if (operation === 'sendMarkdownV2') {
|
|
67
|
+
const content = this.getNodeParameter('content', i);
|
|
68
|
+
body = {
|
|
69
|
+
msgtype: 'markdown_v2',
|
|
70
|
+
markdown_v2: {
|
|
71
|
+
content,
|
|
72
|
+
},
|
|
67
73
|
};
|
|
68
74
|
}
|
|
69
|
-
else if (operation === '
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
locationX: messageData.Location_X,
|
|
77
|
-
locationY: messageData.Location_Y,
|
|
78
|
-
scale: messageData.Scale,
|
|
79
|
-
label: messageData.Label,
|
|
80
|
-
msgId: messageData.MsgId,
|
|
81
|
-
createTime: messageData.CreateTime,
|
|
82
|
-
agentId: messageData.AgentID,
|
|
83
|
-
appType: messageData.AppType,
|
|
84
|
-
raw: messageData,
|
|
75
|
+
else if (operation === 'sendFile') {
|
|
76
|
+
const mediaId = this.getNodeParameter('mediaId', i);
|
|
77
|
+
body = {
|
|
78
|
+
msgtype: 'file',
|
|
79
|
+
file: {
|
|
80
|
+
media_id: mediaId,
|
|
81
|
+
},
|
|
85
82
|
};
|
|
86
83
|
}
|
|
87
|
-
else if (operation === '
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
title: messageData.Title,
|
|
95
|
-
description: messageData.Description,
|
|
96
|
-
url: messageData.Url,
|
|
97
|
-
picUrl: messageData.PicUrl,
|
|
98
|
-
msgId: messageData.MsgId,
|
|
99
|
-
createTime: messageData.CreateTime,
|
|
100
|
-
agentId: messageData.AgentID,
|
|
101
|
-
raw: messageData,
|
|
84
|
+
else if (operation === 'sendVoice') {
|
|
85
|
+
const mediaId = this.getNodeParameter('mediaId', i);
|
|
86
|
+
body = {
|
|
87
|
+
msgtype: 'voice',
|
|
88
|
+
voice: {
|
|
89
|
+
media_id: mediaId,
|
|
90
|
+
},
|
|
102
91
|
};
|
|
103
92
|
}
|
|
104
|
-
else if (operation === '
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
93
|
+
else if (operation === 'sendTemplateCard') {
|
|
94
|
+
const cardType = this.getNodeParameter('cardType', i);
|
|
95
|
+
const templateCard = {
|
|
96
|
+
card_type: cardType,
|
|
97
|
+
};
|
|
98
|
+
const sourceData = this.getNodeParameter('source', i, {});
|
|
99
|
+
if (sourceData.sourceValue) {
|
|
100
|
+
templateCard.source = sourceData.sourceValue;
|
|
101
|
+
}
|
|
102
|
+
const mainTitleData = this.getNodeParameter('mainTitle', i);
|
|
103
|
+
if (mainTitleData.mainTitleValue) {
|
|
104
|
+
templateCard.main_title = mainTitleData.mainTitleValue;
|
|
105
|
+
}
|
|
106
|
+
if (cardType === 'text_notice') {
|
|
107
|
+
const emphasisData = this.getNodeParameter('emphasisContent', i, {});
|
|
108
|
+
if (emphasisData.emphasisValue) {
|
|
109
|
+
templateCard.emphasis_content = emphasisData.emphasisValue;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (cardType === 'news_notice') {
|
|
113
|
+
const imageTextData = this.getNodeParameter('imageTextArea', i, {});
|
|
114
|
+
if (imageTextData.imageTextValue) {
|
|
115
|
+
templateCard.image_text_area = imageTextData.imageTextValue;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const subTitleText = this.getNodeParameter('subTitleText', i, '');
|
|
119
|
+
if (subTitleText) {
|
|
120
|
+
templateCard.sub_title_text = subTitleText;
|
|
121
|
+
}
|
|
122
|
+
const horizontalData = this.getNodeParameter('horizontalContentList', i, {});
|
|
123
|
+
if (horizontalData.item && Array.isArray(horizontalData.item)) {
|
|
124
|
+
templateCard.horizontal_content_list = horizontalData.item;
|
|
125
|
+
}
|
|
126
|
+
const jumpListData = this.getNodeParameter('jumpList', i, {});
|
|
127
|
+
if (jumpListData.jump && Array.isArray(jumpListData.jump)) {
|
|
128
|
+
templateCard.jump_list = jumpListData.jump;
|
|
129
|
+
}
|
|
130
|
+
const cardActionData = this.getNodeParameter('cardAction', i, {});
|
|
131
|
+
if (cardActionData.actionValue) {
|
|
132
|
+
templateCard.card_action = cardActionData.actionValue;
|
|
133
|
+
}
|
|
134
|
+
body = {
|
|
135
|
+
msgtype: 'template_card',
|
|
136
|
+
template_card: templateCard,
|
|
119
137
|
};
|
|
120
138
|
}
|
|
121
139
|
else {
|
|
122
140
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `不支持的操作: ${operation}`, { itemIndex: i });
|
|
123
141
|
}
|
|
142
|
+
const response = await this.helpers.httpRequest({
|
|
143
|
+
method: 'POST',
|
|
144
|
+
url: webhookUrl,
|
|
145
|
+
body,
|
|
146
|
+
json: true,
|
|
147
|
+
});
|
|
124
148
|
returnData.push({
|
|
125
|
-
json:
|
|
149
|
+
json: response,
|
|
126
150
|
pairedItem: { item: i },
|
|
127
151
|
});
|
|
128
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/WeCom/resources/pushMessage/execute.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/WeCom/resources/pushMessage/execute.ts"],"names":[],"mappings":";;AAGA,gDAkNC;AApND,+CAAkD;AAE3C,KAAK,UAAU,kBAAkB,CAEvC,SAAiB,EACjB,KAA2B;IAE3B,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC;YACJ,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;YACjE,MAAM,UAAU,GAAG,WAAW,CAAC,UAAoB,CAAC;YAEpD,IAAI,IAAI,GAAgB,EAAE,CAAC;YAE3B,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;gBAE9B,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAW,CAAC;gBAE9D,IAAI,GAAG;oBACN,OAAO,EAAE,MAAM;oBACf,IAAI,EAAE;wBACL,OAAO;qBACP;iBACD,CAAC;YAEH,CAAC;iBAAM,IAAI,SAAS,KAAK,cAAc,EAAE,CAAC;gBAEzC,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAW,CAAC;gBAE9D,IAAI,GAAG;oBACN,OAAO,EAAE,UAAU;oBACnB,QAAQ,EAAE;wBACT,OAAO;qBACP;iBACD,CAAC;YAEH,CAAC;iBAAM,IAAI,SAAS,KAAK,WAAW,EAAE,CAAC;gBAEtC,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAW,CAAC;gBAEtE,IAAI,WAAW,KAAK,QAAQ,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,cAAc,CAAC,WAAW,CAAC;gBACvD,CAAC;gBAED,IAAI,GAAG;oBACN,OAAO,EAAE,eAAe;oBACxB,aAAa,EAAE,YAAY;iBAC3B,CAAC;YAEH,CAAC;iBAAM,CAAC;gBACP,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,WAAW,SAAS,EAAE,EACtB,EAAE,SAAS,EAAE,CAAC,EAAE,CAChB,CAAC;YACH,CAAC;YAGD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;gBAC/C,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,UAAU;gBACf,IAAI;gBACJ,IAAI,EAAE,IAAI;aACV,CAAC,CAAC;YAEH,UAAU,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,QAAuB;gBAC7B,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;aACvB,CAAC,CAAC;QAEJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC3B,UAAU,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE;wBACL,KAAK,EAAG,KAAe,CAAC,OAAO;qBAC/B;oBACD,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;iBACvB,CAAC,CAAC;gBACH,SAAS;YACV,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pushMessageDescription = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
4
|
+
const sendText_1 = require("./sendText");
|
|
5
|
+
const sendMarkdown_1 = require("./sendMarkdown");
|
|
6
|
+
const sendMarkdownV2_1 = require("./sendMarkdownV2");
|
|
7
|
+
const sendImage_1 = require("./sendImage");
|
|
8
|
+
const sendNews_1 = require("./sendNews");
|
|
9
|
+
const sendFile_1 = require("./sendFile");
|
|
10
|
+
const sendVoice_1 = require("./sendVoice");
|
|
11
|
+
const sendTemplateCard_1 = require("./sendTemplateCard");
|
|
11
12
|
const showOnlyForPushMessage = {
|
|
12
13
|
resource: ['pushMessage'],
|
|
13
14
|
};
|
|
@@ -22,56 +23,63 @@ exports.pushMessageDescription = [
|
|
|
22
23
|
},
|
|
23
24
|
options: [
|
|
24
25
|
{
|
|
25
|
-
name: '
|
|
26
|
-
value: '
|
|
27
|
-
action: '
|
|
28
|
-
description: '
|
|
26
|
+
name: '发送 Markdown V2 消息',
|
|
27
|
+
value: 'sendMarkdownV2',
|
|
28
|
+
action: '发送 Markdown V2 消息',
|
|
29
|
+
description: '发送 Markdown V2 格式的消息到群聊',
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
|
-
name: '
|
|
32
|
-
value: '
|
|
33
|
-
action: '
|
|
34
|
-
description: '
|
|
32
|
+
name: '发送 Markdown 消息',
|
|
33
|
+
value: 'sendMarkdown',
|
|
34
|
+
action: '发送 Markdown 消息',
|
|
35
|
+
description: '发送 Markdown 格式的消息到群聊',
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
|
-
name: '
|
|
38
|
-
value: '
|
|
39
|
-
action: '
|
|
40
|
-
description: '
|
|
38
|
+
name: '发送图文消息',
|
|
39
|
+
value: 'sendNews',
|
|
40
|
+
action: '发送图文消息',
|
|
41
|
+
description: '发送图文消息到群聊',
|
|
41
42
|
},
|
|
42
43
|
{
|
|
43
|
-
name: '
|
|
44
|
-
value: '
|
|
45
|
-
action: '
|
|
46
|
-
description: '
|
|
44
|
+
name: '发送图片消息',
|
|
45
|
+
value: 'sendImage',
|
|
46
|
+
action: '发送图片消息',
|
|
47
|
+
description: '发送图片消息到群聊',
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
|
-
name: '
|
|
50
|
-
value: '
|
|
51
|
-
action: '
|
|
52
|
-
description: '
|
|
50
|
+
name: '发送文件消息',
|
|
51
|
+
value: 'sendFile',
|
|
52
|
+
action: '发送文件消息',
|
|
53
|
+
description: '发送文件消息到群聊',
|
|
53
54
|
},
|
|
54
55
|
{
|
|
55
|
-
name: '
|
|
56
|
-
value: '
|
|
57
|
-
action: '
|
|
58
|
-
description: '
|
|
56
|
+
name: '发送文本消息',
|
|
57
|
+
value: 'sendText',
|
|
58
|
+
action: '发送文本消息',
|
|
59
|
+
description: '发送文本消息到群聊',
|
|
59
60
|
},
|
|
60
61
|
{
|
|
61
|
-
name: '
|
|
62
|
-
value: '
|
|
63
|
-
action: '
|
|
64
|
-
description: '
|
|
62
|
+
name: '发送模板卡片消息',
|
|
63
|
+
value: 'sendTemplateCard',
|
|
64
|
+
action: '发送模板卡片消息',
|
|
65
|
+
description: '发送模板卡片消息到群聊',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: '发送语音消息',
|
|
69
|
+
value: 'sendVoice',
|
|
70
|
+
action: '发送语音消息',
|
|
71
|
+
description: '发送语音消息到群聊',
|
|
65
72
|
},
|
|
66
73
|
],
|
|
67
|
-
default: '
|
|
74
|
+
default: 'sendText',
|
|
68
75
|
},
|
|
69
|
-
...
|
|
70
|
-
...
|
|
71
|
-
...
|
|
72
|
-
...
|
|
73
|
-
...
|
|
74
|
-
...
|
|
75
|
-
...
|
|
76
|
+
...sendText_1.sendTextDescription,
|
|
77
|
+
...sendMarkdown_1.sendMarkdownDescription,
|
|
78
|
+
...sendMarkdownV2_1.sendMarkdownV2Description,
|
|
79
|
+
...sendImage_1.sendImageDescription,
|
|
80
|
+
...sendNews_1.sendNewsDescription,
|
|
81
|
+
...sendFile_1.sendFileDescription,
|
|
82
|
+
...sendVoice_1.sendVoiceDescription,
|
|
83
|
+
...sendTemplateCard_1.sendTemplateCardDescription,
|
|
76
84
|
];
|
|
77
85
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/WeCom/resources/pushMessage/index.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/WeCom/resources/pushMessage/index.ts"],"names":[],"mappings":";;;AACA,yCAAiD;AACjD,iDAAyD;AACzD,qDAA6D;AAC7D,2CAAmD;AACnD,yCAAiD;AACjD,yCAAiD;AACjD,2CAAmD;AACnD,yDAAiE;AAEjE,MAAM,sBAAsB,GAAG;IAC9B,QAAQ,EAAE,CAAC,aAAa,CAAC;CACzB,CAAC;AAEW,QAAA,sBAAsB,GAAsB;IACxD;QACC,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE,sBAAsB;SAC5B;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,mBAAmB;gBACzB,KAAK,EAAE,gBAAgB;gBACvB,MAAM,EAAE,mBAAmB;gBAC3B,WAAW,EAAE,yBAAyB;aACtC;YACD;gBACC,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,cAAc;gBACrB,MAAM,EAAE,gBAAgB;gBACxB,WAAW,EAAE,sBAAsB;aACnC;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,QAAQ;gBAChB,WAAW,EAAE,WAAW;aACxB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,MAAM,EAAE,QAAQ;gBAChB,WAAW,EAAE,WAAW;aACxB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,QAAQ;gBAChB,WAAW,EAAE,WAAW;aACxB;YACD;gBACC,IAAI,EAAE,Q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