@nocobase/plugin-notification-manager 2.1.0-beta.2 → 2.1.0-beta.20

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.
@@ -8,8 +8,10 @@
8
8
  */
9
9
  import { Registry } from '@nocobase/utils';
10
10
  import PluginNotificationManagerServer from './plugin';
11
- import type { NotificationChannelConstructor, RegisterServerTypeFnParams, SendOptions, SendUserOptions, WriteLogOptions } from './types';
11
+ import type { NotificationQueueMessage, NotificationChannelConstructor, RegisterServerTypeFnParams, ReceiversOptions, SendOptions, SendUserOptions, WriteLogOptions } from './types';
12
+ import { Transactionable } from '@nocobase/database';
12
13
  export declare class NotificationManager implements NotificationManager {
14
+ private static readonly SLOW_SEND_THRESHOLD_MS;
13
15
  private plugin;
14
16
  channelTypes: Registry<{
15
17
  Channel: NotificationChannelConstructor;
@@ -18,9 +20,38 @@ export declare class NotificationManager implements NotificationManager {
18
20
  plugin: PluginNotificationManagerServer;
19
21
  });
20
22
  registerType({ type, Channel }: RegisterServerTypeFnParams): void;
21
- createSendingRecord: (options: WriteLogOptions) => Promise<any>;
23
+ createSendingRecord: (options: WriteLogOptions & Transactionable) => Promise<any>;
24
+ private toQueueMessage;
25
+ private getQueuedResult;
26
+ private enqueue;
22
27
  findChannel(name: string): Promise<any>;
23
- send(params: SendOptions): Promise<any>;
24
- sendToUsers(options: SendUserOptions): Promise<any[]>;
28
+ private getReceiverMeta;
29
+ send(params: SendOptions): Promise<{
30
+ status: "success";
31
+ triggerFrom: string;
32
+ channelName: string;
33
+ receivers: ReceiversOptions;
34
+ queued: boolean;
35
+ } | {
36
+ status: "failure";
37
+ reason: string;
38
+ triggerFrom: string;
39
+ channelName: string;
40
+ receivers: ReceiversOptions;
41
+ }>;
42
+ sendNow(params: NotificationQueueMessage): Promise<any>;
43
+ sendToUsers(options: SendUserOptions): Promise<({
44
+ status: "success";
45
+ triggerFrom: string;
46
+ channelName: string;
47
+ receivers: ReceiversOptions;
48
+ queued: boolean;
49
+ } | {
50
+ status: "failure";
51
+ reason: string;
52
+ triggerFrom: string;
53
+ channelName: string;
54
+ receivers: ReceiversOptions;
55
+ })[]>;
25
56
  }
26
57
  export default NotificationManager;
@@ -34,6 +34,7 @@ var import_utils = require("@nocobase/utils");
34
34
  var import_constant = require("../constant");
35
35
  var import_compile = require("./utils/compile");
36
36
  class NotificationManager {
37
+ static SLOW_SEND_THRESHOLD_MS = 500;
37
38
  plugin;
38
39
  channelTypes = new import_utils.Registry();
39
40
  constructor({ plugin }) {
@@ -44,52 +45,153 @@ class NotificationManager {
44
45
  }
45
46
  createSendingRecord = async (options) => {
46
47
  const logsRepo = this.plugin.app.db.getRepository(import_constant.COLLECTION_NAME.logs);
47
- return logsRepo.create({ values: options });
48
+ const { transaction, ...values } = options;
49
+ return logsRepo.create({ values, transaction });
48
50
  };
51
+ toQueueMessage(params) {
52
+ const { transaction, ...message } = params;
53
+ return message;
54
+ }
55
+ getQueuedResult(params) {
56
+ return {
57
+ status: "success",
58
+ triggerFrom: params.triggerFrom,
59
+ channelName: params.channelName,
60
+ receivers: params.receivers,
61
+ queued: true
62
+ };
63
+ }
64
+ async enqueue(message) {
65
+ await this.plugin.app.eventQueue.publish(this.plugin.sendQueueChannel, message);
66
+ }
49
67
  async findChannel(name) {
50
- const repository = this.plugin.app.db.getRepository(import_constant.COLLECTION_NAME.channels);
51
- const instance = await repository.findOne({ filterByTk: name });
52
- if (!instance) {
53
- return null;
68
+ return await this.plugin.getChannel(name);
69
+ }
70
+ getReceiverMeta(receivers) {
71
+ if (!receivers) {
72
+ return {};
73
+ }
74
+ if (receivers.type === "userId") {
75
+ return {
76
+ receiverType: receivers.type,
77
+ receiverCount: receivers.value.length
78
+ };
54
79
  }
55
- return this.plugin.app.environment.renderJsonTemplate(instance.toJSON());
80
+ return {
81
+ receiverType: receivers.type
82
+ };
56
83
  }
57
84
  async send(params) {
58
- this.plugin.logger.info("receive sending message request", params);
85
+ const queueMessage = this.toQueueMessage(params);
86
+ const transaction = params.transaction;
87
+ if (transaction == null ? void 0 : transaction.afterCommit) {
88
+ transaction.afterCommit(() => {
89
+ void this.enqueue(queueMessage).catch((error) => {
90
+ this.plugin.logger.error("notification queue publish failed after transaction committed", {
91
+ channelName: params.channelName,
92
+ triggerFrom: params.triggerFrom,
93
+ reason: error instanceof Error ? `${error.name}: ${error.message}` : JSON.stringify(error)
94
+ });
95
+ });
96
+ });
97
+ return this.getQueuedResult(params);
98
+ }
99
+ try {
100
+ await this.enqueue(queueMessage);
101
+ return this.getQueuedResult(params);
102
+ } catch (error) {
103
+ const reason = error instanceof Error ? `${error.name}: ${error.message}` : JSON.stringify(error);
104
+ this.plugin.logger.error("notification queue publish failed", {
105
+ channelName: params.channelName,
106
+ triggerFrom: params.triggerFrom,
107
+ reason
108
+ });
109
+ return {
110
+ status: "failure",
111
+ reason,
112
+ triggerFrom: params.triggerFrom,
113
+ channelName: params.channelName,
114
+ receivers: params.receivers
115
+ };
116
+ }
117
+ }
118
+ async sendNow(params) {
119
+ const startedAt = Date.now();
120
+ const receiverMeta = this.getReceiverMeta(params.receivers);
121
+ const compileStartedAt = Date.now();
59
122
  const message = (0, import_compile.compile)(params.message ?? {}, params.data ?? {});
123
+ const compileMs = Date.now() - compileStartedAt;
60
124
  const messageData = { ...params.receivers ? { receivers: params.receivers } : {}, ...message };
61
125
  const logData = {
62
126
  triggerFrom: params.triggerFrom,
63
127
  channelName: params.channelName,
64
128
  message: messageData
65
129
  };
130
+ let findChannelMs = 0;
131
+ let channelSendMs = 0;
66
132
  try {
133
+ const findChannelStartedAt = Date.now();
67
134
  const channel = await this.findChannel(params.channelName);
135
+ findChannelMs = Date.now() - findChannelStartedAt;
68
136
  if (channel) {
69
137
  const Channel = this.channelTypes.get(channel.notificationType).Channel;
70
138
  const instance = new Channel(this.plugin.app);
71
139
  logData.channelTitle = channel.title;
72
140
  logData.notificationType = channel.notificationType;
73
141
  logData.receivers = params.receivers;
74
- const result = await instance.send({ message, channel, receivers: params.receivers });
142
+ const channelSendStartedAt = Date.now();
143
+ const result = await instance.send({
144
+ message,
145
+ channel,
146
+ receivers: params.receivers
147
+ });
148
+ channelSendMs = Date.now() - channelSendStartedAt;
75
149
  logData.status = result.status;
76
150
  logData.reason = result.reason;
77
151
  } else {
78
152
  logData.status = "failure";
79
153
  logData.reason = "channel not found";
80
154
  }
81
- this.createSendingRecord(logData);
155
+ await this.createSendingRecord(logData);
156
+ const totalMs = Date.now() - startedAt;
157
+ if (totalMs >= NotificationManager.SLOW_SEND_THRESHOLD_MS) {
158
+ this.plugin.logger.warn("notification send is slow", {
159
+ channelName: params.channelName,
160
+ triggerFrom: params.triggerFrom,
161
+ status: logData.status,
162
+ notificationType: logData.notificationType,
163
+ compileMs,
164
+ findChannelMs,
165
+ channelSendMs,
166
+ totalMs,
167
+ ...receiverMeta
168
+ });
169
+ }
82
170
  return logData;
83
171
  } catch (error) {
84
172
  logData.status = "failure";
85
- this.plugin.logger.error(`notification send failed, options: ${JSON.stringify(error)}`);
86
- logData.reason = JSON.stringify(error);
87
- this.createSendingRecord(logData);
173
+ const totalMs = Date.now() - startedAt;
174
+ const reason = error instanceof Error ? `${error.name}: ${error.message}` : JSON.stringify(error);
175
+ this.plugin.logger.error("notification send failed", {
176
+ channelName: params.channelName,
177
+ triggerFrom: params.triggerFrom,
178
+ compileMs,
179
+ findChannelMs,
180
+ channelSendMs,
181
+ totalMs,
182
+ reason,
183
+ ...receiverMeta
184
+ });
185
+ logData.reason = reason;
186
+ await this.createSendingRecord(logData);
88
187
  return logData;
89
188
  }
90
189
  }
91
190
  async sendToUsers(options) {
92
- this.plugin.logger.info(`notificationManager.sendToUsers options: ${JSON.stringify(options)}`);
191
+ this.plugin.logger.debug("notificationManager.sendToUsers", {
192
+ channelCount: options.channels.length,
193
+ userCount: options.userIds.length
194
+ });
93
195
  const { userIds, channels, message, data = {} } = options;
94
196
  return await Promise.all(
95
197
  channels.map(
@@ -98,7 +200,8 @@ class NotificationManager {
98
200
  message,
99
201
  data,
100
202
  triggerFrom: "sendToUsers",
101
- receivers: { value: userIds, type: "userId" }
203
+ receivers: { value: userIds, type: "userId" },
204
+ transaction: options.transaction
102
205
  })
103
206
  )
104
207
  );
@@ -6,18 +6,52 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import type { Cache } from '@nocobase/cache';
9
10
  import type { Logger } from '@nocobase/logger';
11
+ import { Transactionable } from '@nocobase/database';
10
12
  import { Plugin } from '@nocobase/server';
11
13
  import { RegisterServerTypeFnParams, SendOptions, SendUserOptions } from './types';
12
14
  export declare class PluginNotificationManagerServer extends Plugin {
15
+ private static readonly CHANNELS_CACHE_KEY;
13
16
  private manager;
14
17
  logger: Logger;
18
+ cache: Cache;
19
+ get sendQueueChannel(): string;
20
+ private ensureCache;
21
+ parseChannel(instance: any): any;
22
+ loadChannels(options?: Transactionable): Promise<void>;
23
+ getChannel(name: string): Promise<any>;
15
24
  get channelTypes(): import("@nocobase/utils").Registry<{
16
25
  Channel: import("./types").NotificationChannelConstructor;
17
26
  }>;
18
27
  registerChannelType(params: RegisterServerTypeFnParams): void;
19
- send(options: SendOptions): Promise<any>;
20
- sendToUsers(options: SendUserOptions): Promise<any[]>;
28
+ send(options: SendOptions): Promise<{
29
+ status: "success";
30
+ triggerFrom: string;
31
+ channelName: string;
32
+ receivers: import("./types").ReceiversOptions;
33
+ queued: boolean;
34
+ } | {
35
+ status: "failure";
36
+ reason: string;
37
+ triggerFrom: string;
38
+ channelName: string;
39
+ receivers: import("./types").ReceiversOptions;
40
+ }>;
41
+ sendNow(options: SendOptions): Promise<any>;
42
+ sendToUsers(options: SendUserOptions): Promise<({
43
+ status: "success";
44
+ triggerFrom: string;
45
+ channelName: string;
46
+ receivers: import("./types").ReceiversOptions;
47
+ queued: boolean;
48
+ } | {
49
+ status: "failure";
50
+ reason: string;
51
+ triggerFrom: string;
52
+ channelName: string;
53
+ receivers: import("./types").ReceiversOptions;
54
+ })[]>;
21
55
  afterAdd(): Promise<void>;
22
56
  beforeLoad(): Promise<void>;
23
57
  load(): Promise<void>;
@@ -41,10 +41,50 @@ __export(plugin_exports, {
41
41
  });
42
42
  module.exports = __toCommonJS(plugin_exports);
43
43
  var import_server = require("@nocobase/server");
44
+ var import_constant = require("../constant");
44
45
  var import_manager = __toESM(require("./manager"));
45
46
  class PluginNotificationManagerServer extends import_server.Plugin {
47
+ static CHANNELS_CACHE_KEY = "channels";
46
48
  manager;
47
49
  logger;
50
+ cache;
51
+ get sendQueueChannel() {
52
+ return `${this.name}.send`;
53
+ }
54
+ async ensureCache() {
55
+ if (!this.cache) {
56
+ this.cache = await this.app.cacheManager.createCache({
57
+ name: this.name,
58
+ prefix: this.name
59
+ });
60
+ }
61
+ return this.cache;
62
+ }
63
+ parseChannel(instance) {
64
+ return this.app.environment.renderJsonTemplate(instance.toJSON());
65
+ }
66
+ async loadChannels(options) {
67
+ const cache = await this.ensureCache();
68
+ const repository = this.app.db.getRepository(import_constant.COLLECTION_NAME.channels);
69
+ const channels = await repository.find({
70
+ transaction: options == null ? void 0 : options.transaction
71
+ });
72
+ const channelsCache = {};
73
+ for (const channel of channels) {
74
+ channelsCache[channel.get("name")] = this.parseChannel(channel);
75
+ }
76
+ await cache.set(PluginNotificationManagerServer.CHANNELS_CACHE_KEY, channelsCache);
77
+ }
78
+ async getChannel(name) {
79
+ const cache = await this.ensureCache();
80
+ const channels = await cache.get(PluginNotificationManagerServer.CHANNELS_CACHE_KEY) || void 0;
81
+ if (!channels) {
82
+ await this.loadChannels();
83
+ const reloadedChannels = await cache.get(PluginNotificationManagerServer.CHANNELS_CACHE_KEY);
84
+ return (reloadedChannels == null ? void 0 : reloadedChannels[name]) || null;
85
+ }
86
+ return channels[name] || null;
87
+ }
48
88
  get channelTypes() {
49
89
  return this.manager.channelTypes;
50
90
  }
@@ -54,6 +94,10 @@ class PluginNotificationManagerServer extends import_server.Plugin {
54
94
  async send(options) {
55
95
  return await this.manager.send(options);
56
96
  }
97
+ async sendNow(options) {
98
+ const { transaction, ...message } = options;
99
+ return await this.manager.sendNow(message);
100
+ }
57
101
  async sendToUsers(options) {
58
102
  return await this.manager.sendToUsers(options);
59
103
  }
@@ -69,8 +113,8 @@ class PluginNotificationManagerServer extends import_server.Plugin {
69
113
  this.app.resourceManager.registerActionHandler("messages:send", async (ctx, next) => {
70
114
  var _a, _b;
71
115
  const sendOptions = (_b = (_a = ctx.action) == null ? void 0 : _a.params) == null ? void 0 : _b.values;
72
- this.manager.send(sendOptions);
73
- next();
116
+ await this.manager.send(sendOptions);
117
+ await next();
74
118
  });
75
119
  this.app.acl.registerSnippet({
76
120
  name: "pm.notification.channels",
@@ -80,16 +124,35 @@ class PluginNotificationManagerServer extends import_server.Plugin {
80
124
  name: "pm.notification.logs",
81
125
  actions: ["notificationSendLogs:*"]
82
126
  });
127
+ this.app.on("afterStart", async () => {
128
+ await this.loadChannels();
129
+ });
83
130
  }
84
131
  async load() {
132
+ const Channel = this.app.db.getModel(import_constant.COLLECTION_NAME.channels);
133
+ Channel.afterSave(async (_model, { transaction }) => {
134
+ await this.loadChannels({ transaction });
135
+ });
136
+ Channel.afterDestroy(async (_model, { transaction }) => {
137
+ await this.loadChannels({ transaction });
138
+ });
139
+ this.app.eventQueue.subscribe(this.sendQueueChannel, {
140
+ concurrency: 1,
141
+ idle: () => true,
142
+ process: async (message) => {
143
+ await this.manager.sendNow(message);
144
+ }
145
+ });
85
146
  }
86
147
  async install() {
87
148
  }
88
149
  async afterEnable() {
89
150
  }
90
151
  async afterDisable() {
152
+ this.app.eventQueue.unsubscribe(this.sendQueueChannel);
91
153
  }
92
154
  async remove() {
155
+ this.app.eventQueue.unsubscribe(this.sendQueueChannel);
93
156
  }
94
157
  }
95
158
  var plugin_default = PluginNotificationManagerServer;
@@ -6,6 +6,7 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import { Transactionable } from '@nocobase/database';
9
10
  import { Application } from '@nocobase/server';
10
11
  import { BaseNotificationChannel } from './base-notification-channel';
11
12
  /**
@@ -33,9 +34,10 @@ export type SendFnType<Message> = (args: {
33
34
  message: Message;
34
35
  channel: ChannelOptions;
35
36
  receivers?: ReceiversOptions;
37
+ transaction?: Transactionable['transaction'];
36
38
  }) => Promise<{
37
39
  message: Message;
38
- status: 'success' | 'fail';
40
+ status: 'success' | 'failure';
39
41
  reason?: string;
40
42
  }>;
41
43
  export type ReceiversOptions = {
@@ -46,14 +48,15 @@ export type ReceiversOptions = {
46
48
  type: 'channel-self-defined';
47
49
  channelType: string;
48
50
  };
49
- export interface SendOptions {
51
+ export interface SendOptions extends Transactionable {
50
52
  channelName: string;
51
53
  message: Record<string, any>;
52
54
  triggerFrom: string;
53
55
  receivers?: ReceiversOptions;
54
56
  data?: Record<string, any>;
55
57
  }
56
- export interface SendUserOptions {
58
+ export type NotificationQueueMessage = Omit<SendOptions, 'transaction'>;
59
+ export interface SendUserOptions extends Transactionable {
57
60
  userIds: number[];
58
61
  channels: string[];
59
62
  message: Record<string, any>;
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.1.0-beta.2",
9
+ "version": "2.1.0-beta.20",
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",
@@ -34,5 +34,6 @@
34
34
  "keywords": [
35
35
  "Notification"
36
36
  ],
37
- "gitHead": "d80433799fb4a8d59ded4d7eea114d585a137ea0"
37
+ "license": "Apache-2.0",
38
+ "gitHead": "5515f27380c0c5410f7d1e5e5858364fcd838e5e"
38
39
  }
package/LICENSE.txt DELETED
@@ -1,172 +0,0 @@
1
- Updated Date: October 2, 2025
2
-
3
- NocoBase License Agreement
4
-
5
- NOCOBASE PTE. LTD.,a Singaporean Exempt Private Company Limited by Shares with its principal place of business located at 112 ROBINSON ROAD, #03-01, SINGAPORE ("The Company") https://www.nocobase.com/ issues this License Agreement ("Agreement") to you. You, as an individual or a company ("The User"), will be deemed to voluntarily accept all terms of this Agreement by using NocoBase (including but not limited to obtaining NocoBase source code or installation package in any form, installing and using NocoBase, purchasing NocoBase commercial license and services, purchasing NocoBase commercial plugins). If the User does not agree to any term of this Agreement, or cannot accurately understand our interpretation of the relevant terms, please stop using it immediately.
6
-
7
- This Agreement applies to any use, quotation, contract, invoice, and all software delivered by the Company. The User and the Company or NocoBase's agents can no longer sign a separate license agreement for the sale and delivery of the software.
8
-
9
- The Company reserves the right to formulate and modify this Agreement from time to time as needed. If there are changes, the Company will announce them in the form of website announcements, without further individual notification. The changed Agreement will automatically take effect once it is announced, becoming part of this Agreement.
10
-
11
- ==============
12
- 1. Definitions
13
- ==============
14
-
15
- 1.1 "Software" refers to the NocoBase kernel and plugins placed in the same code repository as the kernel, including their source code, installation packages, images, and all their modifications, updates, and upgrades.
16
-
17
- 1.2 "Community Edition" refers to the free version of the Software provided to the User through public channels.
18
-
19
- 1.3 "Commercial Edition" refers to the paid version of the Software purchased by the User from the Company or its agents, downloaded through exclusive channels, and includes additional benefits. It consists of three versions: Standard Edition, Professional Edition, and Enterprise Edition.
20
-
21
- 1.4 "Marketplace" refers to the marketplace provided by the Company for selling Software plugins and solutions.
22
-
23
- 1.5 "Commercial Plugin" refers to the paid plugins sold in the Marketplace.
24
-
25
- 1.6 "Upper Layer Application" refers to a specific business use case application serving internal or external customers of the User, developed based on Software and Commercial Plugins, such as ERP/CRM.
26
-
27
- 1.7 "Customer" refers to the clients who purchase the User's Upper Layer Application.
28
-
29
- 1.8 "Third-Party Open Source Software" refers to open source software provided with Software and Commercial Plugins. They are licensed through various published open source software licenses or copyright notices accompanying such software.
30
-
31
- ===================================
32
- 2. Intellectual Property Protection
33
- ===================================
34
-
35
- Except for Third-Party Open Source Software, the Company owns all copyrights, trademark rights, patent rights, trade secrets, and other intellectual property rights of the Software, and has registered and protected them in relevant countries and regions according to the "Paris Convention" or "TRIPS Agreement", ensuring that the intellectual property rights of the Software and Commercial Plugins are internationally recognized and protected.
36
-
37
- =============
38
- 3. Disclaimer
39
- =============
40
-
41
- 3.1 The User shall not use the Software and Commercial Plugins to engage in activities that contravene applicable laws and regulations or offend against public order or religious prohibitions. All legal liabilities and consequences arising from the User’s use shall be borne by the User.
42
-
43
- 3.2 The Company shall not be liable for any direct, indirect, special, incidental, or consequential damages (including but not limited to loss of profits, business interruption, data loss, or business information disclosure) caused by the User's use of the Software and Commercial Plugins, even if it has been previously informed of the possibility of such damages.
44
-
45
- ===============
46
- 4. License Type
47
- ===============
48
-
49
- 4.1 This Agreement serves as the unified license agreement for NocoBase Software, applying to both the Community Edition and the Commercial Editions.
50
-
51
- 4.2 For the Community Edition, this Agreement incorporates and references the full text of the GNU Affero General Public License v3.0 (“AGPL-3.0”, available at: https://www.gnu.org/licenses/agpl-3.0.html ). Community Edition users must comply with the AGPL-3.0 License as well as the supplementary terms set forth in this Agreement. In case of any inconsistency between AGPL-3.0 and this Agreement, the supplementary terms of this Agreement shall prevail.
52
-
53
- 4.3 For the Commercial Edition (including Standard, Professional, and Enterprise Editions), only the Commercial License terms contained in this Agreement apply. Commercial Edition users are not subject to AGPL-3.0 obligations.
54
-
55
- 4.4 For Commercial Plugins, only the Commercial Plugin License terms contained in this Agreement apply.
56
-
57
- ================================================
58
- 5. Rights and Obligations of Open Source License
59
- ================================================
60
-
61
- 5.1 The Software can be used for commercial purposes.
62
-
63
- 5.2 The User can sell plugins developed for the Software in the Marketplace.
64
-
65
- 5.3 Outside the Marketplace, changes and plugins to the Software developed by the User or third parties, and third-party applications developed based on the Software must all be open-sourced under the AGPL-3.0 license.
66
-
67
- 5.4 It is not allowed to remove or change the brand, name, link, version number, license, and other information about NocoBase on the Software interface, except for the main LOGO in the upper left corner of the page.
68
-
69
- 5.5 It is not allowed to remove or change all intellectual property statements about NocoBase in the code.
70
-
71
- 5.6 It is not allowed to provide to the public any form of no-code, zero-code, or low-code platform SaaS/PaaS products using the original or modified Software.
72
-
73
- 5.7 Comply with all requirements of the AGPL-3.0 License, including but not limited to:
74
- (a) Any modifications, extensions, or derivative works of the Software must be released under the AGPL-3.0 License;
75
- (b) If Upper Layer Applications are provided as a network service (including SaaS or PaaS), the complete corresponding source code must be made available to all users of the service;
76
- (c) The Software may not be combined with other software under incompatible licenses in a manner that would violate the AGPL-3.0 License;
77
- (d) No additional contractual restrictions may be imposed when redistributing the Software.
78
-
79
- ===============================
80
- 6. Rights of Commercial License
81
- ===============================
82
-
83
- 6.1 Obtain a permanent commercial license of the Software.
84
-
85
- 6.2 Get software upgrades and exclusive technical support during the upgrade validity period.
86
-
87
- 6.3 The licensed Software can be used for commercial purposes with no restrictions on the number of applications and users.
88
-
89
- 6.4 Changes and plugins to the Software, and applications integrated with the Software do not need to be open sourced.
90
-
91
- 6.5 Can remove or change the brand, name, link, version number, license, and other information about NocoBase on the Software interface.
92
-
93
- 6.6 Can sell plugins developed for Software in the Marketplace.
94
-
95
- 6.7 The User holding a Professional or Enterprise Edition License can sell Upper Layer Application to its Customers.
96
-
97
- 6.8 Exemption from AGPL-3.0 obligations, including but not limited to:
98
- (a) the requirement to release source code of modifications, extensions, or derivative works;
99
- (b) the requirement to provide source code when offering the Software as a network service;
100
- (c) restrictions on combining the Software with other software under different license terms; and
101
- (d) limitations on adding contractual terms for redistribution.
102
- The User remains bound by this Agreement and by its commercial license contract.
103
-
104
- 6.9 If there are other agreements in the contract for the above rights, the contract agreement shall prevail.
105
-
106
- ====================================
107
- 7. Obligations of Commercial License
108
- ====================================
109
-
110
- 7.1 It is not allowed to remove or change all intellectual property statements about NocoBase in the code.
111
-
112
- 7.2 It is not allowed to sell, transfer, lease, share, gift, or distribute the Commercial License.
113
-
114
- 7.3 It is not allowed to sell, transfer, lease, share, or distribute any form of no-code, zero-code, low-code platform, or developer tools developed based on Software.
115
-
116
- 7.4 It is not allowed to provide any form of no-code, zero-code, low-code platform SaaS/PaaS products to the public using the original or modified Software.
117
-
118
- 7.5 It is not allowed for the User holding a Standard Edition license to sell Upper Layer Application to Customers without a Commercial license.
119
-
120
- 7.6 It is not allowed for the User holding a Professional or Enterprise Edition license to sell Upper Layer Application to Customers without a Commercial license with access to further development and configuration.
121
-
122
- 7.7 It is not allowed to publicly sell plugins developed for Software outside of the Marketplace.
123
-
124
- 7.8 If there is a violation of the above obligations or the terms of this Agreement, the rights owned by the User will be immediately terminated, the paid fees will not be refunded, and the Company reserves the right to pursue the User's legal responsibility.
125
-
126
- 7.9 If there are other agreements in the contract for the above obligations, the contract agreement shall prevail.
127
-
128
- ======================================
129
- 8. Rights of Commercial Plugin License
130
- ======================================
131
-
132
- 8.1 Obtain a permanent Commercial Plugin License for the Commercial Plugin.
133
-
134
- 8.2 Receive plugin upgrades and exclusive technical support during the upgrade validity period.
135
-
136
- 8.3 Can be used for commercial purposes without restrictions on the number of applications or users.
137
-
138
- 8.4 The User holding a Professional or Enterprise Edition License can use the Commercial Plugin in Upper Layer Applications sold to its customers.
139
-
140
- 8.5 Exemption from AGPL-3.0 obligations.
141
-
142
- 8.6 If there are other agreements in the contract regarding the above rights, the contract agreement shall prevail.
143
-
144
- ===========================================
145
- 9. Obligations of Commercial Plugin License
146
- ===========================================
147
-
148
- 9.1 It is not allowed to remove or change any intellectual property statements about NocoBase and the plugin authors in the code.
149
-
150
- 9.2 It is not allowed to sell, transfer, lease, share, or gift the Commercial Plugin.
151
-
152
- 9.3 It is not allowed to use reverse engineering, decompilation, or other methods to attempt to discover the source code of Commercial Plugins without obtaining a source code license.
153
-
154
- 9.4 It is not allowed to disclose the source code of Commercial Plugins to any third party.
155
-
156
- 9.5 It is not allowed for the User holding a Community or Standard Edition license to use Commercial Plugins in Upper Layer Applications sold to its customers. Such Commercial Plugins are limited to internal use within the licensed company only.
157
-
158
- 9.6 If there is any violation of the above obligations or the terms of this Agreement, the rights owned by the User will be immediately terminated, the paid fees will not be refunded, and the Company reserves the right to pursue the User's legal responsibility.
159
-
160
- 9.7 If there are other agreements in the contract regarding the above obligations, the contract agreement shall prevail.
161
-
162
- =============================================================
163
- 10. Legal Jurisdiction, Interpretation, and Dispute Resolution
164
- =============================================================
165
-
166
- 10.1 Except for Mainland China, the interpretation, application, and all matters related to this agreement are subject to the jurisdiction of Singapore law.
167
-
168
- 10.2 Any dispute related to this Agreement should first be resolved through friendly negotiation. If the negotiation fails to resolve the dispute, the dispute should be submitted to the International Chamber of Commerce (ICC) for arbitration. The arbitration venue should be Singapore, conducted in English.
169
-
170
- 10.3 All terms and conditions of this Agreement shall be deemed enforceable to the maximum extent permitted by applicable law. If any term of this Agreement is deemed invalid by any applicable law, the invalidity of that term does not affect the validity of any other term of this Agreement, and it should be deemed that the invalid term has been modified as much as possible to make it valid and enforceable, or if the term cannot be modified, it should be deemed to have been deleted from this Agreement.
171
-
172
- 10.4 The arbitration award is final, binding on both parties, and can be enforced in any court with jurisdiction.