@nocobase/plugin-notification-manager 2.2.0-beta.1 → 2.2.0-beta.3

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.
@@ -10,15 +10,15 @@
10
10
  module.exports = {
11
11
  "react": "18.2.0",
12
12
  "antd": "5.24.2",
13
- "@nocobase/client": "2.2.0-beta.1",
14
- "@nocobase/utils": "2.2.0-beta.1",
15
- "@nocobase/flow-engine": "2.2.0-beta.1",
13
+ "@nocobase/client": "2.2.0-beta.3",
14
+ "@nocobase/utils": "2.2.0-beta.3",
15
+ "@nocobase/flow-engine": "2.2.0-beta.3",
16
16
  "react-i18next": "11.18.6",
17
- "@nocobase/client-v2": "2.2.0-beta.1",
18
- "@nocobase/database": "2.2.0-beta.1",
19
- "@nocobase/server": "2.2.0-beta.1",
20
- "@nocobase/cache": "2.2.0-beta.1",
21
- "@nocobase/logger": "2.2.0-beta.1",
17
+ "@nocobase/client-v2": "2.2.0-beta.3",
18
+ "@nocobase/database": "2.2.0-beta.3",
19
+ "@nocobase/server": "2.2.0-beta.3",
20
+ "@nocobase/cache": "2.2.0-beta.3",
21
+ "@nocobase/logger": "2.2.0-beta.3",
22
22
  "@formily/react": "2.3.7",
23
23
  "@formily/core": "2.3.7",
24
24
  "ahooks": "3.7.8",
@@ -27,5 +27,5 @@ module.exports = {
27
27
  "dayjs": "1.11.13",
28
28
  "@formily/shared": "2.3.7",
29
29
  "@formily/antd-v5": "1.2.3",
30
- "@nocobase/plugin-workflow": "2.2.0-beta.1"
30
+ "@nocobase/plugin-workflow": "2.2.0-beta.3"
31
31
  };
@@ -1 +1 @@
1
- {"name":"uuid","version":"10.0.0","description":"RFC9562 UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122","rfc9562"],"license":"MIT","bin":{"uuid":"dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/esm-node/index.js":"./dist/esm-browser/index.js","./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.24.6","@babel/core":"7.24.6","@babel/eslint-parser":"7.24.6","@babel/plugin-syntax-import-attributes":"7.24.6","@babel/preset-env":"7.24.6","@commitlint/cli":"19.3.0","@commitlint/config-conventional":"19.2.2","@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6","bundlewatch":"0.3.3","eslint":"9.4.0","eslint-plugin-prettier":"5.1.3","globals":"15.3.0","husky":"9.0.11","jest":"29.7.0","lint-staged":"15.2.5","neostandard":"0.5.1","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"3.3.0","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","test:matching":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/ -t","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && HUSKY=0 npm install && npm test","prettier:check":"prettier --check .","prettier:fix":"prettier --write .","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"npm run build && npx runmd --output=README.md README_js.md","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"git+https://github.com/uuidjs/uuid.git"},"lint-staged":{"*":["prettier --no-error-on-unmatched-pattern --write"],"*.{js,jsx}":["eslint --no-error-on-unmatched-pattern --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"packageManager":"npm@10.8.1+sha256.b8807aebb9656758e2872fa6e7c564b506aa2faa9297439a478d471d2fe32483","_lastModified":"2026-06-10T23:12:45.617Z"}
1
+ {"name":"uuid","version":"10.0.0","description":"RFC9562 UUIDs","funding":["https://github.com/sponsors/broofa","https://github.com/sponsors/ctavan"],"commitlint":{"extends":["@commitlint/config-conventional"]},"keywords":["uuid","guid","rfc4122","rfc9562"],"license":"MIT","bin":{"uuid":"dist/bin/uuid"},"sideEffects":false,"main":"./dist/index.js","exports":{".":{"node":{"module":"./dist/esm-node/index.js","require":"./dist/index.js","import":"./wrapper.mjs"},"browser":{"import":"./dist/esm-browser/index.js","require":"./dist/commonjs-browser/index.js"},"default":"./dist/esm-browser/index.js"},"./package.json":"./package.json"},"module":"./dist/esm-node/index.js","browser":{"./dist/esm-node/index.js":"./dist/esm-browser/index.js","./dist/md5.js":"./dist/md5-browser.js","./dist/native.js":"./dist/native-browser.js","./dist/rng.js":"./dist/rng-browser.js","./dist/sha1.js":"./dist/sha1-browser.js"},"files":["CHANGELOG.md","CONTRIBUTING.md","LICENSE.md","README.md","dist","wrapper.mjs"],"devDependencies":{"@babel/cli":"7.24.6","@babel/core":"7.24.6","@babel/eslint-parser":"7.24.6","@babel/plugin-syntax-import-attributes":"7.24.6","@babel/preset-env":"7.24.6","@commitlint/cli":"19.3.0","@commitlint/config-conventional":"19.2.2","@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6","bundlewatch":"0.3.3","eslint":"9.4.0","eslint-plugin-prettier":"5.1.3","globals":"15.3.0","husky":"9.0.11","jest":"29.7.0","lint-staged":"15.2.5","neostandard":"0.5.1","npm-run-all":"4.1.5","optional-dev-dependency":"2.0.1","prettier":"3.3.0","random-seed":"0.3.0","runmd":"1.3.9","standard-version":"9.5.0"},"optionalDevDependencies":{"@wdio/browserstack-service":"7.16.10","@wdio/cli":"7.16.10","@wdio/jasmine-framework":"7.16.6","@wdio/local-runner":"7.16.10","@wdio/spec-reporter":"7.16.9","@wdio/static-server-service":"7.16.6"},"scripts":{"examples:browser:webpack:build":"cd examples/browser-webpack && npm install && npm run build","examples:browser:rollup:build":"cd examples/browser-rollup && npm install && npm run build","examples:node:commonjs:test":"cd examples/node-commonjs && npm install && npm test","examples:node:esmodules:test":"cd examples/node-esmodules && npm install && npm test","examples:node:jest:test":"cd examples/node-jest && npm install && npm test","prepare":"husky install","lint":"npm run eslint:check && npm run prettier:check","eslint:check":"eslint src/ test/ examples/ *.js","eslint:fix":"eslint --fix src/ test/ examples/ *.js","pretest":"npm run build","test":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/","test:matching":"BABEL_ENV=commonjsNode node --throw-deprecation node_modules/.bin/jest test/unit/ -t","pretest:browser":"optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**","test:browser":"wdio run ./wdio.conf.js","pretest:node":"npm run build","test:node":"npm-run-all --parallel examples:node:**","test:pack":"./scripts/testpack.sh","pretest:benchmark":"npm run build","test:benchmark":"cd examples/benchmark && HUSKY=0 npm install && npm test","prettier:check":"prettier --check .","prettier:fix":"prettier --write .","bundlewatch":"npm run pretest:browser && bundlewatch --config bundlewatch.config.json","md":"runmd --watch --output=README.md README_js.md","docs":"npm run build && npx runmd --output=README.md README_js.md","docs:diff":"npm run docs && git diff --quiet README.md","build":"./scripts/build.sh","prepack":"npm run build","release":"standard-version --no-verify"},"repository":{"type":"git","url":"git+https://github.com/uuidjs/uuid.git"},"lint-staged":{"*":["prettier --no-error-on-unmatched-pattern --write"],"*.{js,jsx}":["eslint --no-error-on-unmatched-pattern --fix"]},"standard-version":{"scripts":{"postchangelog":"prettier --write CHANGELOG.md"}},"packageManager":"npm@10.8.1+sha256.b8807aebb9656758e2872fa6e7c564b506aa2faa9297439a478d471d2fe32483","_lastModified":"2026-06-15T15:31:24.143Z"}
@@ -110,11 +110,16 @@ class PluginNotificationManagerServer extends import_server.Plugin {
110
110
  this.manager = new import_manager.default({ plugin: this });
111
111
  }
112
112
  async beforeLoad() {
113
- this.app.resourceManager.registerActionHandler("messages:send", async (ctx, next) => {
114
- var _a, _b;
115
- const sendOptions = (_b = (_a = ctx.action) == null ? void 0 : _a.params) == null ? void 0 : _b.values;
116
- await this.manager.send(sendOptions);
117
- await next();
113
+ this.app.resourceManager.define({
114
+ name: import_constant.COLLECTION_NAME.messages,
115
+ actions: {
116
+ send: async (ctx, next) => {
117
+ var _a, _b;
118
+ const sendOptions = (_b = (_a = ctx.action) == null ? void 0 : _a.params) == null ? void 0 : _b.values;
119
+ ctx.body = await this.send(sendOptions);
120
+ await next();
121
+ }
122
+ }
118
123
  });
119
124
  this.app.acl.registerSnippet({
120
125
  name: "pm.notification.channels",
@@ -0,0 +1,542 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ declare const _default: {
10
+ openapi: string;
11
+ info: {
12
+ title: string;
13
+ };
14
+ paths: {
15
+ '/notificationChannels:list': {
16
+ get: {
17
+ tags: string[];
18
+ summary: string;
19
+ description: string;
20
+ parameters: ({
21
+ name: string;
22
+ in: string;
23
+ required: boolean;
24
+ description: string;
25
+ schema: {
26
+ type: string;
27
+ additionalProperties: boolean;
28
+ };
29
+ } | {
30
+ name: string;
31
+ in: string;
32
+ required: boolean;
33
+ description: string;
34
+ schema: {
35
+ oneOf: ({
36
+ type: string;
37
+ items?: undefined;
38
+ } | {
39
+ type: string;
40
+ items: {
41
+ type: string;
42
+ };
43
+ })[];
44
+ type?: undefined;
45
+ };
46
+ } | {
47
+ name: string;
48
+ in: string;
49
+ required: boolean;
50
+ schema: {
51
+ type: string;
52
+ oneOf?: undefined;
53
+ };
54
+ description?: undefined;
55
+ })[];
56
+ responses: {
57
+ 200: {
58
+ description: string;
59
+ content: {
60
+ 'application/json': {
61
+ schema: {
62
+ $ref: string;
63
+ };
64
+ };
65
+ };
66
+ };
67
+ };
68
+ };
69
+ };
70
+ '/notificationChannels:get': {
71
+ get: {
72
+ tags: string[];
73
+ summary: string;
74
+ parameters: {
75
+ name: string;
76
+ in: string;
77
+ required: boolean;
78
+ description: string;
79
+ schema: {
80
+ type: string;
81
+ };
82
+ }[];
83
+ responses: {
84
+ 200: {
85
+ description: string;
86
+ content: {
87
+ 'application/json': {
88
+ schema: {
89
+ $ref: string;
90
+ };
91
+ };
92
+ };
93
+ };
94
+ };
95
+ };
96
+ };
97
+ '/notificationChannels:create': {
98
+ post: {
99
+ tags: string[];
100
+ summary: string;
101
+ requestBody: {
102
+ required: boolean;
103
+ content: {
104
+ 'application/json': {
105
+ schema: {
106
+ $ref: string;
107
+ };
108
+ };
109
+ };
110
+ };
111
+ responses: {
112
+ 200: {
113
+ description: string;
114
+ content: {
115
+ 'application/json': {
116
+ schema: {
117
+ $ref: string;
118
+ };
119
+ };
120
+ };
121
+ };
122
+ };
123
+ };
124
+ };
125
+ '/notificationChannels:update': {
126
+ post: {
127
+ tags: string[];
128
+ summary: string;
129
+ parameters: {
130
+ name: string;
131
+ in: string;
132
+ required: boolean;
133
+ description: string;
134
+ schema: {
135
+ type: string;
136
+ };
137
+ }[];
138
+ requestBody: {
139
+ required: boolean;
140
+ content: {
141
+ 'application/json': {
142
+ schema: {
143
+ $ref: string;
144
+ };
145
+ };
146
+ };
147
+ };
148
+ responses: {
149
+ 200: {
150
+ description: string;
151
+ content: {
152
+ 'application/json': {
153
+ schema: {
154
+ $ref: string;
155
+ };
156
+ };
157
+ };
158
+ };
159
+ };
160
+ };
161
+ };
162
+ '/notificationChannels:destroy': {
163
+ post: {
164
+ tags: string[];
165
+ summary: string;
166
+ parameters: {
167
+ name: string;
168
+ in: string;
169
+ required: boolean;
170
+ description: string;
171
+ schema: {
172
+ type: string;
173
+ };
174
+ }[];
175
+ responses: {
176
+ 200: {
177
+ description: string;
178
+ };
179
+ };
180
+ };
181
+ };
182
+ '/notificationSendLogs:list': {
183
+ get: {
184
+ tags: string[];
185
+ summary: string;
186
+ description: string;
187
+ parameters: ({
188
+ name: string;
189
+ in: string;
190
+ required: boolean;
191
+ description: string;
192
+ schema: {
193
+ type: string;
194
+ additionalProperties: boolean;
195
+ };
196
+ } | {
197
+ name: string;
198
+ in: string;
199
+ required: boolean;
200
+ description: string;
201
+ schema: {
202
+ oneOf: ({
203
+ type: string;
204
+ items?: undefined;
205
+ } | {
206
+ type: string;
207
+ items: {
208
+ type: string;
209
+ };
210
+ })[];
211
+ type?: undefined;
212
+ };
213
+ } | {
214
+ name: string;
215
+ in: string;
216
+ required: boolean;
217
+ schema: {
218
+ type: string;
219
+ oneOf?: undefined;
220
+ };
221
+ description?: undefined;
222
+ })[];
223
+ responses: {
224
+ 200: {
225
+ description: string;
226
+ content: {
227
+ 'application/json': {
228
+ schema: {
229
+ $ref: string;
230
+ };
231
+ };
232
+ };
233
+ };
234
+ };
235
+ };
236
+ };
237
+ '/notificationSendLogs:get': {
238
+ get: {
239
+ tags: string[];
240
+ summary: string;
241
+ parameters: {
242
+ description: string;
243
+ name: string;
244
+ in: string;
245
+ required: boolean;
246
+ schema: {
247
+ type: string;
248
+ };
249
+ }[];
250
+ responses: {
251
+ 200: {
252
+ description: string;
253
+ content: {
254
+ 'application/json': {
255
+ schema: {
256
+ $ref: string;
257
+ };
258
+ };
259
+ };
260
+ };
261
+ };
262
+ };
263
+ };
264
+ '/messages:send': {
265
+ post: {
266
+ tags: string[];
267
+ summary: string;
268
+ description: string;
269
+ requestBody: {
270
+ required: boolean;
271
+ content: {
272
+ 'application/json': {
273
+ schema: {
274
+ $ref: string;
275
+ };
276
+ };
277
+ };
278
+ };
279
+ responses: {
280
+ 200: {
281
+ description: string;
282
+ content: {
283
+ 'application/json': {
284
+ schema: {
285
+ $ref: string;
286
+ };
287
+ };
288
+ };
289
+ };
290
+ };
291
+ };
292
+ };
293
+ };
294
+ components: {
295
+ schemas: {
296
+ NotificationChannel: {
297
+ type: string;
298
+ properties: {
299
+ name: {
300
+ type: string;
301
+ description: string;
302
+ };
303
+ title: {
304
+ type: string;
305
+ };
306
+ description: {
307
+ type: string;
308
+ };
309
+ notificationType: {
310
+ type: string;
311
+ description: string;
312
+ };
313
+ options: {
314
+ type: string;
315
+ additionalProperties: boolean;
316
+ };
317
+ meta: {
318
+ type: string;
319
+ additionalProperties: boolean;
320
+ };
321
+ createdAt: {
322
+ type: string;
323
+ format: string;
324
+ };
325
+ updatedAt: {
326
+ type: string;
327
+ format: string;
328
+ };
329
+ };
330
+ additionalProperties: boolean;
331
+ };
332
+ NotificationChannelInput: {
333
+ type: string;
334
+ required: string[];
335
+ properties: {
336
+ name: {
337
+ type: string;
338
+ };
339
+ title: {
340
+ type: string;
341
+ };
342
+ description: {
343
+ type: string;
344
+ };
345
+ notificationType: {
346
+ type: string;
347
+ };
348
+ options: {
349
+ type: string;
350
+ additionalProperties: boolean;
351
+ };
352
+ meta: {
353
+ type: string;
354
+ additionalProperties: boolean;
355
+ };
356
+ };
357
+ additionalProperties: boolean;
358
+ };
359
+ NotificationChannelResponse: {
360
+ type: string;
361
+ properties: {
362
+ data: {
363
+ $ref: string;
364
+ };
365
+ };
366
+ };
367
+ NotificationChannelListResponse: {
368
+ type: string;
369
+ properties: {
370
+ data: {
371
+ type: string;
372
+ items: {
373
+ $ref: string;
374
+ };
375
+ };
376
+ meta: {
377
+ type: string;
378
+ additionalProperties: boolean;
379
+ };
380
+ };
381
+ };
382
+ NotificationSendLog: {
383
+ type: string;
384
+ properties: {
385
+ id: {
386
+ type: string;
387
+ format: string;
388
+ };
389
+ channelName: {
390
+ type: string;
391
+ };
392
+ channelTitle: {
393
+ type: string;
394
+ };
395
+ triggerFrom: {
396
+ type: string;
397
+ };
398
+ notificationType: {
399
+ type: string;
400
+ };
401
+ status: {
402
+ type: string;
403
+ enum: string[];
404
+ };
405
+ message: {
406
+ type: string;
407
+ additionalProperties: boolean;
408
+ };
409
+ reason: {
410
+ type: string;
411
+ };
412
+ createdAt: {
413
+ type: string;
414
+ format: string;
415
+ };
416
+ updatedAt: {
417
+ type: string;
418
+ format: string;
419
+ };
420
+ };
421
+ additionalProperties: boolean;
422
+ };
423
+ NotificationSendLogResponse: {
424
+ type: string;
425
+ properties: {
426
+ data: {
427
+ $ref: string;
428
+ };
429
+ };
430
+ };
431
+ NotificationSendLogListResponse: {
432
+ type: string;
433
+ properties: {
434
+ data: {
435
+ type: string;
436
+ items: {
437
+ $ref: string;
438
+ };
439
+ };
440
+ meta: {
441
+ type: string;
442
+ additionalProperties: boolean;
443
+ };
444
+ };
445
+ };
446
+ NotificationReceivers: {
447
+ oneOf: ({
448
+ type: string;
449
+ required: string[];
450
+ properties: {
451
+ type: {
452
+ type: string;
453
+ enum: string[];
454
+ };
455
+ value: {
456
+ type: string;
457
+ items: {
458
+ type: string;
459
+ };
460
+ };
461
+ channelType?: undefined;
462
+ };
463
+ } | {
464
+ type: string;
465
+ required: string[];
466
+ properties: {
467
+ type: {
468
+ type: string;
469
+ enum: string[];
470
+ };
471
+ channelType: {
472
+ type: string;
473
+ };
474
+ value: {
475
+ type?: undefined;
476
+ items?: undefined;
477
+ };
478
+ };
479
+ })[];
480
+ };
481
+ NotificationSendRequest: {
482
+ type: string;
483
+ required: string[];
484
+ properties: {
485
+ channelName: {
486
+ type: string;
487
+ description: string;
488
+ };
489
+ message: {
490
+ type: string;
491
+ additionalProperties: boolean;
492
+ };
493
+ receivers: {
494
+ $ref: string;
495
+ };
496
+ triggerFrom: {
497
+ type: string;
498
+ example: string;
499
+ };
500
+ data: {
501
+ type: string;
502
+ additionalProperties: boolean;
503
+ };
504
+ };
505
+ };
506
+ NotificationSendResult: {
507
+ type: string;
508
+ properties: {
509
+ status: {
510
+ type: string;
511
+ enum: string[];
512
+ };
513
+ reason: {
514
+ type: string;
515
+ };
516
+ triggerFrom: {
517
+ type: string;
518
+ };
519
+ channelName: {
520
+ type: string;
521
+ };
522
+ receivers: {
523
+ $ref: string;
524
+ };
525
+ queued: {
526
+ type: string;
527
+ };
528
+ };
529
+ additionalProperties: boolean;
530
+ };
531
+ NotificationSendResponse: {
532
+ type: string;
533
+ properties: {
534
+ data: {
535
+ $ref: string;
536
+ };
537
+ };
538
+ };
539
+ };
540
+ };
541
+ };
542
+ export default _default;
@@ -0,0 +1,492 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var swagger_exports = {};
28
+ __export(swagger_exports, {
29
+ default: () => swagger_default
30
+ });
31
+ module.exports = __toCommonJS(swagger_exports);
32
+ const jsonObjectSchema = {
33
+ type: "object",
34
+ additionalProperties: true
35
+ };
36
+ const listParameters = [
37
+ {
38
+ name: "filter",
39
+ in: "query",
40
+ required: false,
41
+ description: "Filter object encoded as JSON.",
42
+ schema: jsonObjectSchema
43
+ },
44
+ {
45
+ name: "sort",
46
+ in: "query",
47
+ required: false,
48
+ description: "Sort fields, for example `-createdAt`.",
49
+ schema: {
50
+ oneOf: [
51
+ { type: "string" },
52
+ {
53
+ type: "array",
54
+ items: { type: "string" }
55
+ }
56
+ ]
57
+ }
58
+ },
59
+ {
60
+ name: "page",
61
+ in: "query",
62
+ required: false,
63
+ schema: {
64
+ type: "integer"
65
+ }
66
+ },
67
+ {
68
+ name: "pageSize",
69
+ in: "query",
70
+ required: false,
71
+ schema: {
72
+ type: "integer"
73
+ }
74
+ }
75
+ ];
76
+ const filterByTkParameter = {
77
+ name: "filterByTk",
78
+ in: "query",
79
+ required: true,
80
+ description: "Primary key value. For notification channels this is the channel `name`.",
81
+ schema: {
82
+ type: "string"
83
+ }
84
+ };
85
+ var swagger_default = {
86
+ openapi: "3.0.2",
87
+ info: {
88
+ title: "NocoBase API - Notification manager plugin"
89
+ },
90
+ paths: {
91
+ "/notificationChannels:list": {
92
+ get: {
93
+ tags: ["notificationChannels"],
94
+ summary: "List notification channels",
95
+ description: "List configured notification channels. Channel `name` is the primary key used by send APIs.",
96
+ parameters: listParameters,
97
+ responses: {
98
+ 200: {
99
+ description: "OK",
100
+ content: {
101
+ "application/json": {
102
+ schema: {
103
+ $ref: "#/components/schemas/NotificationChannelListResponse"
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "/notificationChannels:get": {
112
+ get: {
113
+ tags: ["notificationChannels"],
114
+ summary: "Get one notification channel",
115
+ parameters: [filterByTkParameter],
116
+ responses: {
117
+ 200: {
118
+ description: "OK",
119
+ content: {
120
+ "application/json": {
121
+ schema: {
122
+ $ref: "#/components/schemas/NotificationChannelResponse"
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }
129
+ },
130
+ "/notificationChannels:create": {
131
+ post: {
132
+ tags: ["notificationChannels"],
133
+ summary: "Create a notification channel",
134
+ requestBody: {
135
+ required: true,
136
+ content: {
137
+ "application/json": {
138
+ schema: {
139
+ $ref: "#/components/schemas/NotificationChannelInput"
140
+ }
141
+ }
142
+ }
143
+ },
144
+ responses: {
145
+ 200: {
146
+ description: "OK",
147
+ content: {
148
+ "application/json": {
149
+ schema: {
150
+ $ref: "#/components/schemas/NotificationChannelResponse"
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ },
158
+ "/notificationChannels:update": {
159
+ post: {
160
+ tags: ["notificationChannels"],
161
+ summary: "Update a notification channel",
162
+ parameters: [filterByTkParameter],
163
+ requestBody: {
164
+ required: true,
165
+ content: {
166
+ "application/json": {
167
+ schema: {
168
+ $ref: "#/components/schemas/NotificationChannelInput"
169
+ }
170
+ }
171
+ }
172
+ },
173
+ responses: {
174
+ 200: {
175
+ description: "OK",
176
+ content: {
177
+ "application/json": {
178
+ schema: {
179
+ $ref: "#/components/schemas/NotificationChannelResponse"
180
+ }
181
+ }
182
+ }
183
+ }
184
+ }
185
+ }
186
+ },
187
+ "/notificationChannels:destroy": {
188
+ post: {
189
+ tags: ["notificationChannels"],
190
+ summary: "Delete a notification channel",
191
+ parameters: [filterByTkParameter],
192
+ responses: {
193
+ 200: {
194
+ description: "OK"
195
+ }
196
+ }
197
+ }
198
+ },
199
+ "/notificationSendLogs:list": {
200
+ get: {
201
+ tags: ["notificationSendLogs"],
202
+ summary: "List notification send logs",
203
+ description: "List delivery records written by the notification manager after send attempts.",
204
+ parameters: listParameters,
205
+ responses: {
206
+ 200: {
207
+ description: "OK",
208
+ content: {
209
+ "application/json": {
210
+ schema: {
211
+ $ref: "#/components/schemas/NotificationSendLogListResponse"
212
+ }
213
+ }
214
+ }
215
+ }
216
+ }
217
+ }
218
+ },
219
+ "/notificationSendLogs:get": {
220
+ get: {
221
+ tags: ["notificationSendLogs"],
222
+ summary: "Get one notification send log",
223
+ parameters: [
224
+ {
225
+ ...filterByTkParameter,
226
+ description: "Send log UUID."
227
+ }
228
+ ],
229
+ responses: {
230
+ 200: {
231
+ description: "OK",
232
+ content: {
233
+ "application/json": {
234
+ schema: {
235
+ $ref: "#/components/schemas/NotificationSendLogResponse"
236
+ }
237
+ }
238
+ }
239
+ }
240
+ }
241
+ }
242
+ },
243
+ "/messages:send": {
244
+ post: {
245
+ tags: ["notifications"],
246
+ summary: "Queue a notification send",
247
+ description: "Send a notification through a configured channel. The manager may enqueue delivery and writes a `notificationSendLogs` record when the send attempt is processed.",
248
+ requestBody: {
249
+ required: true,
250
+ content: {
251
+ "application/json": {
252
+ schema: {
253
+ $ref: "#/components/schemas/NotificationSendRequest"
254
+ }
255
+ }
256
+ }
257
+ },
258
+ responses: {
259
+ 200: {
260
+ description: "OK",
261
+ content: {
262
+ "application/json": {
263
+ schema: {
264
+ $ref: "#/components/schemas/NotificationSendResponse"
265
+ }
266
+ }
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+ },
273
+ components: {
274
+ schemas: {
275
+ NotificationChannel: {
276
+ type: "object",
277
+ properties: {
278
+ name: {
279
+ type: "string",
280
+ description: "Channel primary key, usually generated with the `s_` prefix."
281
+ },
282
+ title: {
283
+ type: "string"
284
+ },
285
+ description: {
286
+ type: "string"
287
+ },
288
+ notificationType: {
289
+ type: "string",
290
+ description: "Registered notification channel type, for example `in-app-message` or `email`."
291
+ },
292
+ options: jsonObjectSchema,
293
+ meta: jsonObjectSchema,
294
+ createdAt: {
295
+ type: "string",
296
+ format: "date-time"
297
+ },
298
+ updatedAt: {
299
+ type: "string",
300
+ format: "date-time"
301
+ }
302
+ },
303
+ additionalProperties: true
304
+ },
305
+ NotificationChannelInput: {
306
+ type: "object",
307
+ required: ["name", "title", "notificationType"],
308
+ properties: {
309
+ name: {
310
+ type: "string"
311
+ },
312
+ title: {
313
+ type: "string"
314
+ },
315
+ description: {
316
+ type: "string"
317
+ },
318
+ notificationType: {
319
+ type: "string"
320
+ },
321
+ options: jsonObjectSchema,
322
+ meta: jsonObjectSchema
323
+ },
324
+ additionalProperties: true
325
+ },
326
+ NotificationChannelResponse: {
327
+ type: "object",
328
+ properties: {
329
+ data: {
330
+ $ref: "#/components/schemas/NotificationChannel"
331
+ }
332
+ }
333
+ },
334
+ NotificationChannelListResponse: {
335
+ type: "object",
336
+ properties: {
337
+ data: {
338
+ type: "array",
339
+ items: {
340
+ $ref: "#/components/schemas/NotificationChannel"
341
+ }
342
+ },
343
+ meta: jsonObjectSchema
344
+ }
345
+ },
346
+ NotificationSendLog: {
347
+ type: "object",
348
+ properties: {
349
+ id: {
350
+ type: "string",
351
+ format: "uuid"
352
+ },
353
+ channelName: {
354
+ type: "string"
355
+ },
356
+ channelTitle: {
357
+ type: "string"
358
+ },
359
+ triggerFrom: {
360
+ type: "string"
361
+ },
362
+ notificationType: {
363
+ type: "string"
364
+ },
365
+ status: {
366
+ type: "string",
367
+ enum: ["success", "failure"]
368
+ },
369
+ message: jsonObjectSchema,
370
+ reason: {
371
+ type: "string"
372
+ },
373
+ createdAt: {
374
+ type: "string",
375
+ format: "date-time"
376
+ },
377
+ updatedAt: {
378
+ type: "string",
379
+ format: "date-time"
380
+ }
381
+ },
382
+ additionalProperties: true
383
+ },
384
+ NotificationSendLogResponse: {
385
+ type: "object",
386
+ properties: {
387
+ data: {
388
+ $ref: "#/components/schemas/NotificationSendLog"
389
+ }
390
+ }
391
+ },
392
+ NotificationSendLogListResponse: {
393
+ type: "object",
394
+ properties: {
395
+ data: {
396
+ type: "array",
397
+ items: {
398
+ $ref: "#/components/schemas/NotificationSendLog"
399
+ }
400
+ },
401
+ meta: jsonObjectSchema
402
+ }
403
+ },
404
+ NotificationReceivers: {
405
+ oneOf: [
406
+ {
407
+ type: "object",
408
+ required: ["type", "value"],
409
+ properties: {
410
+ type: {
411
+ type: "string",
412
+ enum: ["userId"]
413
+ },
414
+ value: {
415
+ type: "array",
416
+ items: {
417
+ type: "integer"
418
+ }
419
+ }
420
+ }
421
+ },
422
+ {
423
+ type: "object",
424
+ required: ["type", "channelType", "value"],
425
+ properties: {
426
+ type: {
427
+ type: "string",
428
+ enum: ["channel-self-defined"]
429
+ },
430
+ channelType: {
431
+ type: "string"
432
+ },
433
+ value: {}
434
+ }
435
+ }
436
+ ]
437
+ },
438
+ NotificationSendRequest: {
439
+ type: "object",
440
+ required: ["channelName", "message", "triggerFrom"],
441
+ properties: {
442
+ channelName: {
443
+ type: "string",
444
+ description: "Existing `notificationChannels.name`."
445
+ },
446
+ message: jsonObjectSchema,
447
+ receivers: {
448
+ $ref: "#/components/schemas/NotificationReceivers"
449
+ },
450
+ triggerFrom: {
451
+ type: "string",
452
+ example: "workflow"
453
+ },
454
+ data: jsonObjectSchema
455
+ }
456
+ },
457
+ NotificationSendResult: {
458
+ type: "object",
459
+ properties: {
460
+ status: {
461
+ type: "string",
462
+ enum: ["success", "failure"]
463
+ },
464
+ reason: {
465
+ type: "string"
466
+ },
467
+ triggerFrom: {
468
+ type: "string"
469
+ },
470
+ channelName: {
471
+ type: "string"
472
+ },
473
+ receivers: {
474
+ $ref: "#/components/schemas/NotificationReceivers"
475
+ },
476
+ queued: {
477
+ type: "boolean"
478
+ }
479
+ },
480
+ additionalProperties: true
481
+ },
482
+ NotificationSendResponse: {
483
+ type: "object",
484
+ properties: {
485
+ data: {
486
+ $ref: "#/components/schemas/NotificationSendResult"
487
+ }
488
+ }
489
+ }
490
+ }
491
+ }
492
+ };
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description.ru-RU": "Предоставляет единый сервис управления, включающий конфигурирование каналов, логирование и другие функции, поддерживает настройку различных каналов уведомлений, включая внутренние сообщения и электронную почту.",
7
7
  "displayName.zh-CN": "通知管理",
8
8
  "description.zh-CN": "提供统一的管理服务,涵盖渠道配置、日志记录等功能,支持多种通知渠道的配置,包括站内信和电子邮件等。",
9
- "version": "2.2.0-beta.1",
9
+ "version": "2.2.0-beta.3",
10
10
  "homepage": "https://docs.nocobase.com/handbook/notification-manager",
11
11
  "homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/notification-manager",
12
12
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/notification-manager",
@@ -36,5 +36,5 @@
36
36
  "Notification"
37
37
  ],
38
38
  "license": "Apache-2.0",
39
- "gitHead": "f82fa9d0c3aa8e00e53dd94e404a312483b4866b"
39
+ "gitHead": "7b16bb2cfd427c110c6671252138cd85155723c5"
40
40
  }