n8n-nodes-wecom 0.1.4 → 0.1.5

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.
Files changed (59) hide show
  1. package/README.md +35 -29
  2. package/dist/credentials/WeComWebhookApi.credentials.d.ts +13 -0
  3. package/dist/credentials/WeComWebhookApi.credentials.js +44 -0
  4. package/dist/credentials/WeComWebhookApi.credentials.js.map +1 -0
  5. package/dist/nodes/WeCom/WeCom.node.js +10 -1
  6. package/dist/nodes/WeCom/WeCom.node.js.map +1 -1
  7. package/dist/nodes/WeCom/resources/pushMessage/execute.js +131 -99
  8. package/dist/nodes/WeCom/resources/pushMessage/execute.js.map +1 -1
  9. package/dist/nodes/WeCom/resources/pushMessage/index.js +51 -43
  10. package/dist/nodes/WeCom/resources/pushMessage/index.js.map +1 -1
  11. package/dist/nodes/WeCom/resources/pushMessage/sendFile.d.ts +2 -0
  12. package/dist/nodes/WeCom/resources/pushMessage/sendFile.js +22 -0
  13. package/dist/nodes/WeCom/resources/pushMessage/sendFile.js.map +1 -0
  14. package/dist/nodes/WeCom/resources/pushMessage/sendImage.d.ts +2 -0
  15. package/dist/nodes/WeCom/resources/pushMessage/sendImage.js +65 -0
  16. package/dist/nodes/WeCom/resources/pushMessage/sendImage.js.map +1 -0
  17. package/dist/nodes/WeCom/resources/pushMessage/sendMarkdown.d.ts +2 -0
  18. package/dist/nodes/WeCom/resources/pushMessage/sendMarkdown.js +25 -0
  19. package/dist/nodes/WeCom/resources/pushMessage/sendMarkdown.js.map +1 -0
  20. package/dist/nodes/WeCom/resources/pushMessage/sendMarkdownV2.d.ts +2 -0
  21. package/dist/nodes/WeCom/resources/pushMessage/sendMarkdownV2.js +25 -0
  22. package/dist/nodes/WeCom/resources/pushMessage/sendMarkdownV2.js.map +1 -0
  23. package/dist/nodes/WeCom/resources/pushMessage/sendNews.d.ts +2 -0
  24. package/dist/nodes/WeCom/resources/pushMessage/sendNews.js +68 -0
  25. package/dist/nodes/WeCom/resources/pushMessage/sendNews.js.map +1 -0
  26. package/dist/nodes/WeCom/resources/pushMessage/sendTemplateCard.d.ts +2 -0
  27. package/dist/nodes/WeCom/resources/pushMessage/sendTemplateCard.js +431 -0
  28. package/dist/nodes/WeCom/resources/pushMessage/sendTemplateCard.js.map +1 -0
  29. package/dist/nodes/WeCom/resources/pushMessage/sendText.d.ts +2 -0
  30. package/dist/nodes/WeCom/resources/pushMessage/sendText.js +47 -0
  31. package/dist/nodes/WeCom/resources/pushMessage/sendText.js.map +1 -0
  32. package/dist/nodes/WeCom/resources/pushMessage/sendVoice.d.ts +2 -0
  33. package/dist/nodes/WeCom/resources/pushMessage/sendVoice.js +22 -0
  34. package/dist/nodes/WeCom/resources/pushMessage/sendVoice.js.map +1 -0
  35. package/dist/nodes/WeCom/shared/types.d.ts +6 -55
  36. package/dist/package.json +3 -2
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +3 -2
  39. package/dist/nodes/WeCom/resources/pushMessage/receiveEvent.d.ts +0 -94
  40. package/dist/nodes/WeCom/resources/pushMessage/receiveEvent.js +0 -105
  41. package/dist/nodes/WeCom/resources/pushMessage/receiveEvent.js.map +0 -1
  42. package/dist/nodes/WeCom/resources/pushMessage/receiveImage.d.ts +0 -12
  43. package/dist/nodes/WeCom/resources/pushMessage/receiveImage.js +0 -22
  44. package/dist/nodes/WeCom/resources/pushMessage/receiveImage.js.map +0 -1
  45. package/dist/nodes/WeCom/resources/pushMessage/receiveLink.d.ts +0 -14
  46. package/dist/nodes/WeCom/resources/pushMessage/receiveLink.js +0 -22
  47. package/dist/nodes/WeCom/resources/pushMessage/receiveLink.js.map +0 -1
  48. package/dist/nodes/WeCom/resources/pushMessage/receiveLocation.d.ts +0 -15
  49. package/dist/nodes/WeCom/resources/pushMessage/receiveLocation.js +0 -22
  50. package/dist/nodes/WeCom/resources/pushMessage/receiveLocation.js.map +0 -1
  51. package/dist/nodes/WeCom/resources/pushMessage/receiveText.d.ts +0 -11
  52. package/dist/nodes/WeCom/resources/pushMessage/receiveText.js +0 -22
  53. package/dist/nodes/WeCom/resources/pushMessage/receiveText.js.map +0 -1
  54. package/dist/nodes/WeCom/resources/pushMessage/receiveVideo.d.ts +0 -12
  55. package/dist/nodes/WeCom/resources/pushMessage/receiveVideo.js +0 -22
  56. package/dist/nodes/WeCom/resources/pushMessage/receiveVideo.js.map +0 -1
  57. package/dist/nodes/WeCom/resources/pushMessage/receiveVoice.d.ts +0 -12
  58. package/dist/nodes/WeCom/resources/pushMessage/receiveVoice.js +0 -22
  59. package/dist/nodes/WeCom/resources/pushMessage/receiveVoice.js.map +0 -1
@@ -0,0 +1,431 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendTemplateCardDescription = void 0;
4
+ const showOnlyForSendTemplateCard = {
5
+ resource: ['pushMessage'],
6
+ operation: ['sendTemplateCard'],
7
+ };
8
+ exports.sendTemplateCardDescription = [
9
+ {
10
+ displayName: '模板类型',
11
+ name: 'cardType',
12
+ type: 'options',
13
+ displayOptions: {
14
+ show: showOnlyForSendTemplateCard,
15
+ },
16
+ options: [
17
+ {
18
+ name: '文本通知模板卡片',
19
+ value: 'text_notice',
20
+ description: '用于发送文本通知',
21
+ },
22
+ {
23
+ name: '图文展示模板卡片',
24
+ value: 'news_notice',
25
+ description: '用于发送图文展示',
26
+ },
27
+ ],
28
+ default: 'text_notice',
29
+ description: '选择模板卡片类型',
30
+ },
31
+ {
32
+ displayName: '卡片来源',
33
+ name: 'source',
34
+ type: 'fixedCollection',
35
+ typeOptions: {
36
+ multipleValues: false,
37
+ },
38
+ displayOptions: {
39
+ show: {
40
+ ...showOnlyForSendTemplateCard,
41
+ cardType: ['text_notice', 'news_notice'],
42
+ },
43
+ },
44
+ default: {},
45
+ options: [
46
+ {
47
+ name: 'sourceValue',
48
+ displayName: '来源',
49
+ values: [
50
+ {
51
+ displayName: '来源图标',
52
+ name: 'icon_url',
53
+ type: 'string',
54
+ default: '',
55
+ description: '来源图片的URL',
56
+ hint: '支持JPG、PNG格式,大小不超过200KB',
57
+ },
58
+ {
59
+ displayName: '来源描述',
60
+ name: 'desc',
61
+ type: 'string',
62
+ default: '',
63
+ description: '来源文字描述',
64
+ hint: '建议不超过13个汉字',
65
+ },
66
+ {
67
+ displayName: '来源描述颜色',
68
+ name: 'desc_color',
69
+ type: 'options',
70
+ options: [
71
+ { name: '默认', value: 0 },
72
+ { name: '灰色', value: 1 },
73
+ { name: '黑色', value: 2 },
74
+ { name: '红色', value: 3 },
75
+ ],
76
+ default: 0,
77
+ description: '来源文字颜色',
78
+ },
79
+ ],
80
+ },
81
+ ],
82
+ },
83
+ {
84
+ displayName: '主要内容',
85
+ name: 'mainTitle',
86
+ type: 'fixedCollection',
87
+ typeOptions: {
88
+ multipleValues: false,
89
+ },
90
+ displayOptions: {
91
+ show: {
92
+ ...showOnlyForSendTemplateCard,
93
+ cardType: ['text_notice', 'news_notice'],
94
+ },
95
+ },
96
+ default: {},
97
+ required: true,
98
+ options: [
99
+ {
100
+ name: 'mainTitleValue',
101
+ displayName: '主要内容',
102
+ values: [
103
+ {
104
+ displayName: '标题',
105
+ name: 'title',
106
+ type: 'string',
107
+ default: '',
108
+ required: true,
109
+ description: '一级标题',
110
+ hint: '建议不超过26个汉字',
111
+ },
112
+ {
113
+ displayName: '标题描述',
114
+ name: 'desc',
115
+ type: 'string',
116
+ default: '',
117
+ description: '标题辅助信息',
118
+ hint: '建议不超过30个汉字',
119
+ },
120
+ ],
121
+ },
122
+ ],
123
+ },
124
+ {
125
+ displayName: '关键数据样式',
126
+ name: 'emphasisContent',
127
+ type: 'fixedCollection',
128
+ typeOptions: {
129
+ multipleValues: false,
130
+ },
131
+ displayOptions: {
132
+ show: {
133
+ ...showOnlyForSendTemplateCard,
134
+ cardType: ['text_notice'],
135
+ },
136
+ },
137
+ default: {},
138
+ options: [
139
+ {
140
+ name: 'emphasisValue',
141
+ displayName: '关键数据',
142
+ values: [
143
+ {
144
+ displayName: '关键数据',
145
+ name: 'title',
146
+ type: 'string',
147
+ default: '',
148
+ description: '关键数据内容',
149
+ hint: '建议不超过10个汉字',
150
+ },
151
+ {
152
+ displayName: '关键数据描述',
153
+ name: 'desc',
154
+ type: 'string',
155
+ default: '',
156
+ description: '关键数据辅助信息',
157
+ hint: '建议不超过15个汉字',
158
+ },
159
+ ],
160
+ },
161
+ ],
162
+ },
163
+ {
164
+ displayName: '图文展示样式',
165
+ name: 'imageTextArea',
166
+ type: 'fixedCollection',
167
+ typeOptions: {
168
+ multipleValues: false,
169
+ },
170
+ displayOptions: {
171
+ show: {
172
+ ...showOnlyForSendTemplateCard,
173
+ cardType: ['news_notice'],
174
+ },
175
+ },
176
+ default: {},
177
+ options: [
178
+ {
179
+ name: 'imageTextValue',
180
+ displayName: '图文展示',
181
+ values: [
182
+ {
183
+ displayName: '图片类型',
184
+ name: 'type',
185
+ type: 'options',
186
+ options: [
187
+ { name: '图片链接', value: 1 },
188
+ { name: 'Media ID', value: 2 },
189
+ ],
190
+ default: 1,
191
+ description: '选择图片的提供方式',
192
+ },
193
+ {
194
+ displayName: '图片链接',
195
+ name: 'url',
196
+ type: 'string',
197
+ displayOptions: {
198
+ show: {
199
+ type: [1],
200
+ },
201
+ },
202
+ default: '',
203
+ description: '图片的URL地址',
204
+ },
205
+ {
206
+ displayName: 'Media ID',
207
+ name: 'media_id',
208
+ type: 'string',
209
+ displayOptions: {
210
+ show: {
211
+ type: [2],
212
+ },
213
+ },
214
+ default: '',
215
+ description: '图片的media_id',
216
+ },
217
+ {
218
+ displayName: '图片描述',
219
+ name: 'desc',
220
+ type: 'string',
221
+ default: '',
222
+ description: '图片的辅助信息',
223
+ hint: '建议不超过112个汉字',
224
+ },
225
+ ],
226
+ },
227
+ ],
228
+ },
229
+ {
230
+ displayName: '二级普通文本',
231
+ name: 'subTitleText',
232
+ type: 'string',
233
+ displayOptions: {
234
+ show: {
235
+ ...showOnlyForSendTemplateCard,
236
+ cardType: ['text_notice', 'news_notice'],
237
+ },
238
+ },
239
+ default: '',
240
+ description: '二级普通文本,建议不超过112个汉字',
241
+ },
242
+ {
243
+ displayName: '二级标题+文本列表',
244
+ name: 'horizontalContentList',
245
+ type: 'fixedCollection',
246
+ typeOptions: {
247
+ multipleValues: true,
248
+ },
249
+ displayOptions: {
250
+ show: {
251
+ ...showOnlyForSendTemplateCard,
252
+ cardType: ['text_notice', 'news_notice'],
253
+ },
254
+ },
255
+ default: {},
256
+ placeholder: '添加列表项',
257
+ options: [
258
+ {
259
+ name: 'item',
260
+ displayName: '列表项',
261
+ values: [
262
+ {
263
+ displayName: '标题',
264
+ name: 'keyname',
265
+ type: 'string',
266
+ default: '',
267
+ description: '二级标题',
268
+ hint: '建议不超过5个汉字',
269
+ },
270
+ {
271
+ displayName: '文本',
272
+ name: 'value',
273
+ type: 'string',
274
+ default: '',
275
+ description: '二级文本',
276
+ hint: '建议不超过14个汉字',
277
+ },
278
+ ],
279
+ },
280
+ ],
281
+ },
282
+ {
283
+ displayName: '跳转链接',
284
+ name: 'jumpList',
285
+ type: 'fixedCollection',
286
+ typeOptions: {
287
+ multipleValues: true,
288
+ },
289
+ displayOptions: {
290
+ show: {
291
+ ...showOnlyForSendTemplateCard,
292
+ cardType: ['text_notice', 'news_notice'],
293
+ },
294
+ },
295
+ default: {},
296
+ placeholder: '添加跳转链接',
297
+ options: [
298
+ {
299
+ name: 'jump',
300
+ displayName: '跳转链接',
301
+ values: [
302
+ {
303
+ displayName: '小程序 AppID',
304
+ name: 'appid',
305
+ type: 'string',
306
+ displayOptions: {
307
+ show: {
308
+ type: [2],
309
+ },
310
+ },
311
+ default: '',
312
+ description: '小程序的appid',
313
+ },
314
+ {
315
+ displayName: '小程序页面路径',
316
+ name: 'pagepath',
317
+ type: 'string',
318
+ displayOptions: {
319
+ show: {
320
+ type: [2],
321
+ },
322
+ },
323
+ default: '',
324
+ description: '小程序的页面路径',
325
+ },
326
+ {
327
+ displayName: '跳转标题',
328
+ name: 'title',
329
+ type: 'string',
330
+ default: '',
331
+ description: '跳转链接的文字描述',
332
+ },
333
+ {
334
+ displayName: '跳转类型',
335
+ name: 'type',
336
+ type: 'options',
337
+ options: [
338
+ { name: '跳转URL', value: 1 },
339
+ { name: '小程序', value: 2 },
340
+ ],
341
+ default: 1,
342
+ description: '跳转链接类型',
343
+ },
344
+ {
345
+ displayName: '跳转链接',
346
+ name: 'url',
347
+ type: 'string',
348
+ displayOptions: {
349
+ show: {
350
+ type: [1],
351
+ },
352
+ },
353
+ default: '',
354
+ description: '跳转的URL地址',
355
+ },
356
+ ],
357
+ },
358
+ ],
359
+ },
360
+ {
361
+ displayName: '整体卡片点击跳转',
362
+ name: 'cardAction',
363
+ type: 'fixedCollection',
364
+ typeOptions: {
365
+ multipleValues: false,
366
+ },
367
+ displayOptions: {
368
+ show: {
369
+ ...showOnlyForSendTemplateCard,
370
+ cardType: ['text_notice', 'news_notice'],
371
+ },
372
+ },
373
+ default: {},
374
+ options: [
375
+ {
376
+ name: 'actionValue',
377
+ displayName: '卡片点击',
378
+ values: [
379
+ {
380
+ displayName: '跳转类型',
381
+ name: 'type',
382
+ type: 'options',
383
+ options: [
384
+ { name: '跳转URL', value: 1 },
385
+ { name: '小程序', value: 2 },
386
+ ],
387
+ default: 1,
388
+ description: '卡片点击后的跳转类型',
389
+ },
390
+ {
391
+ displayName: '跳转链接',
392
+ name: 'url',
393
+ type: 'string',
394
+ displayOptions: {
395
+ show: {
396
+ type: [1],
397
+ },
398
+ },
399
+ default: '',
400
+ description: '跳转的URL地址',
401
+ },
402
+ {
403
+ displayName: '小程序 AppID',
404
+ name: 'appid',
405
+ type: 'string',
406
+ displayOptions: {
407
+ show: {
408
+ type: [2],
409
+ },
410
+ },
411
+ default: '',
412
+ description: '小程序的appid',
413
+ },
414
+ {
415
+ displayName: '小程序页面路径',
416
+ name: 'pagepath',
417
+ type: 'string',
418
+ displayOptions: {
419
+ show: {
420
+ type: [2],
421
+ },
422
+ },
423
+ default: '',
424
+ description: '小程序的页面路径',
425
+ },
426
+ ],
427
+ },
428
+ ],
429
+ },
430
+ ];
431
+ //# sourceMappingURL=sendTemplateCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendTemplateCard.js","sourceRoot":"","sources":["../../../../../nodes/WeCom/resources/pushMessage/sendTemplateCard.ts"],"names":[],"mappings":";;;AAEA,MAAM,2BAA2B,GAAG;IACnC,QAAQ,EAAE,CAAC,aAAa,CAAC;IACzB,SAAS,EAAE,CAAC,kBAAkB,CAAC;CAC/B,CAAC;AAEW,QAAA,2BAA2B,GAAsB;IAC7D;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,cAAc,EAAE;YACf,IAAI,EAAE,2BAA2B;SACjC;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,UAAU;aACvB;YACD;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,UAAU;aACvB;SACD;QACD,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,UAAU;KACvB;IAED;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE;YACZ,cAAc,EAAE,KAAK;SACrB;QACD,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,GAAG,2BAA2B;gBAC9B,QAAQ,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;aACxC;SACD;QACD,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,IAAI;gBACjB,MAAM,EAAE;oBACP;wBACC,WAAW,EAAE,MAAM;wBACnB,IAAI,EAAE,UAAU;wBAChB,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,UAAU;wBACvB,IAAI,EAAE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M;wBACnB,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE;4BACR,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE;4BAC3B,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;yBACzB;wBACD,OAAO,EAAE,CAAC;wBACV,WAAW,EAAE,YAAY;qBACzB;oBACD;wBACC,WAAW,EAAE,MAAM;wBACnB,IAAI,EAAE,KAAK;wBACX,IAAI,EAAE,QAAQ;wBACd,cAAc,EAAE;4BACf,IAAI,EAAE;gCACL,IAAI,EAAE,CAAC,CAAC,CAAC;6BACT;yBACD;wBACD,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,UAAU;qBACvB;oBACD;wBACC,WAAW,EAAE,WAAW;wBACxB,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,QAAQ;wBACd,cAAc,EAAE;4BACf,IAAI,EAAE;gCACL,IAAI,EAAE,CAAC,CAAC,CAAC;6BACT;yBACD;wBACD,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,WAAW;qBACxB;oBACD;wBACC,WAAW,EAAE,SAAS;wBACtB,IAAI,EAAE,UAAU;wBAChB,IAAI,EAAE,QAAQ;wBACd,cAAc,EAAE;4BACf,IAAI,EAAE;gCACL,IAAI,EAAE,CAAC,CAAC,CAAC;6BACT;yBACD;wBACD,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,UAAU;qBACvB;iBACD;aACD;SACD;KACD;CACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const sendTextDescription: INodeProperties[];
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendTextDescription = void 0;
4
+ const showOnlyForSendText = {
5
+ resource: ['pushMessage'],
6
+ operation: ['sendText'],
7
+ };
8
+ exports.sendTextDescription = [
9
+ {
10
+ displayName: '消息内容',
11
+ name: 'content',
12
+ type: 'string',
13
+ typeOptions: {
14
+ rows: 4,
15
+ },
16
+ displayOptions: {
17
+ show: showOnlyForSendText,
18
+ },
19
+ default: '',
20
+ required: true,
21
+ description: '文本消息内容',
22
+ hint: '支持换行、@成员等功能',
23
+ },
24
+ {
25
+ displayName: '@成员',
26
+ name: 'mentionedList',
27
+ type: 'string',
28
+ displayOptions: {
29
+ show: showOnlyForSendText,
30
+ },
31
+ default: '',
32
+ description: '要@的成员userid列表,多个用|分隔,@all表示提醒所有人',
33
+ hint: '例如: zhangsan|lisi 或 @all',
34
+ },
35
+ {
36
+ displayName: '@手机号',
37
+ name: 'mentionedMobileList',
38
+ type: 'string',
39
+ displayOptions: {
40
+ show: showOnlyForSendText,
41
+ },
42
+ default: '',
43
+ description: '要@的成员手机号列表,多个用|分隔',
44
+ hint: '例如: 13800000000|13900000000',
45
+ },
46
+ ];
47
+ //# sourceMappingURL=sendText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendText.js","sourceRoot":"","sources":["../../../../../nodes/WeCom/resources/pushMessage/sendText.ts"],"names":[],"mappings":";;;AAEA,MAAM,mBAAmB,GAAG;IAC3B,QAAQ,EAAE,CAAC,aAAa,CAAC;IACzB,SAAS,EAAE,CAAC,UAAU,CAAC;CACvB,CAAC;AAEW,QAAA,mBAAmB,GAAsB;IACrD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;YACZ,IAAI,EAAE,CAAC;SACP;QACD,cAAc,EAAE;YACf,IAAI,EAAE,mBAAmB;SACzB;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,aAAa;KACnB;IACD;QACC,WAAW,EAAE,KAAK;QAClB,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE,mBAAmB;SACzB;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,kCAAkC;QAC/C,IAAI,EAAE,0BAA0B;KAChC;IACD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE,mBAAmB;SACzB;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,6BAA6B;KACnC;CACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const sendVoiceDescription: INodeProperties[];
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendVoiceDescription = void 0;
4
+ const showOnlyForSendVoice = {
5
+ resource: ['pushMessage'],
6
+ operation: ['sendVoice'],
7
+ };
8
+ exports.sendVoiceDescription = [
9
+ {
10
+ displayName: 'Media ID',
11
+ name: 'mediaId',
12
+ type: 'string',
13
+ displayOptions: {
14
+ show: showOnlyForSendVoice,
15
+ },
16
+ default: '',
17
+ required: true,
18
+ description: '语音文件的 media_id',
19
+ hint: '通过上传临时素材接口获取,格式为AMR或SILK,大小不超过2M',
20
+ },
21
+ ];
22
+ //# sourceMappingURL=sendVoice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendVoice.js","sourceRoot":"","sources":["../../../../../nodes/WeCom/resources/pushMessage/sendVoice.ts"],"names":[],"mappings":";;;AAEA,MAAM,oBAAoB,GAAG;IAC5B,QAAQ,EAAE,CAAC,aAAa,CAAC;IACzB,SAAS,EAAE,CAAC,WAAW,CAAC;CACxB,CAAC;AAEW,QAAA,oBAAoB,GAAsB;IACtD;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE,oBAAoB;SAC1B;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,kCAAkC;KACxC;CACD,CAAC"}
@@ -19,60 +19,11 @@ export interface IWeComMessageResponse {
19
19
  response_code?: string;
20
20
  }
21
21
  export type MessageType = 'text' | 'image' | 'voice' | 'video' | 'file' | 'textcard' | 'news' | 'mpnews' | 'markdown';
22
- export type PushMessageType = 'text' | 'image' | 'voice' | 'video' | 'location' | 'link' | 'event';
23
- export type EventType = 'change_contact' | 'change_contact_party' | 'change_contact_tag' | 'click' | 'view' | 'scancode_push' | 'scancode_waitmsg' | 'pic_sysphoto' | 'pic_photo_or_album' | 'pic_weixin' | 'location_select' | 'location' | 'enter_agent' | 'batch_job_result';
24
- export type ChangeType = 'create_user' | 'update_user' | 'delete_user' | 'create_party' | 'update_party' | 'delete_party' | 'create_tag' | 'update_tag' | 'delete_tag' | 'update_tag_user';
25
- export interface IBasePushMessage {
26
- ToUserName: string;
27
- FromUserName: string;
28
- CreateTime: number;
29
- MsgType: string;
30
- AgentID?: number;
22
+ export type WebhookMessageType = 'text' | 'markdown' | 'markdown_v2' | 'image' | 'news' | 'file' | 'voice' | 'template_card';
23
+ export interface IWeComWebhookCredentials {
24
+ webhookUrl: string;
31
25
  }
32
- export interface IPushTextMessage extends IBasePushMessage {
33
- MsgType: 'text';
34
- Content: string;
35
- MsgId: string;
36
- }
37
- export interface IPushImageMessage extends IBasePushMessage {
38
- MsgType: 'image';
39
- PicUrl: string;
40
- MediaId: string;
41
- MsgId: string;
42
- }
43
- export interface IPushVoiceMessage extends IBasePushMessage {
44
- MsgType: 'voice';
45
- MediaId: string;
46
- Format: string;
47
- MsgId: string;
48
- }
49
- export interface IPushVideoMessage extends IBasePushMessage {
50
- MsgType: 'video';
51
- MediaId: string;
52
- ThumbMediaId: string;
53
- MsgId: string;
54
- }
55
- export interface IPushLocationMessage extends IBasePushMessage {
56
- MsgType: 'location';
57
- Location_X: number;
58
- Location_Y: number;
59
- Scale: number;
60
- Label: string;
61
- MsgId: string;
62
- AppType: string;
63
- }
64
- export interface IPushLinkMessage extends IBasePushMessage {
65
- MsgType: 'link';
66
- Title: string;
67
- Description: string;
68
- Url: string;
69
- PicUrl: string;
70
- MsgId: string;
71
- }
72
- export interface IPushEventMessage extends IBasePushMessage {
73
- MsgType: 'event';
74
- Event: string;
75
- ChangeType?: string;
76
- EventKey?: string;
77
- [key: string]: unknown;
26
+ export interface IWeComWebhookResponse {
27
+ errcode: number;
28
+ errmsg: string;
78
29
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-wecom",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "n8n community node for WeCom (WeChat Work) integration. Send messages and manage contacts.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/funcodingdev/n8n-nodes-wecom",
@@ -37,7 +37,8 @@
37
37
  "n8nNodesApiVersion": 1,
38
38
  "strict": true,
39
39
  "credentials": [
40
- "dist/credentials/WeComApi.credentials.js"
40
+ "dist/credentials/WeComApi.credentials.js",
41
+ "dist/credentials/WeComWebhookApi.credentials.js"
41
42
  ],
42
43
  "nodes": [
43
44
  "dist/nodes/WeCom/WeCom.node.js"