@nocobase/server 2.1.0-beta.15 → 2.1.0-beta.17

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.
@@ -0,0 +1,124 @@
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 app_exports = {};
28
+ __export(app_exports, {
29
+ default: () => app_default
30
+ });
31
+ module.exports = __toCommonJS(app_exports);
32
+ var app_default = {
33
+ "/app:getLang": {
34
+ get: {
35
+ tags: ["app"],
36
+ summary: "Get the current application language",
37
+ description: "Return the current locale used by the server.",
38
+ parameters: [],
39
+ responses: {
40
+ 200: {
41
+ description: "OK",
42
+ content: {
43
+ "application/json": {
44
+ schema: {
45
+ type: "string"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ },
53
+ "/app:getInfo": {
54
+ get: {
55
+ tags: ["app"],
56
+ summary: "Get application metadata",
57
+ description: "Return basic application information, including version and environment-related metadata.",
58
+ parameters: [],
59
+ responses: {
60
+ 200: {
61
+ description: "OK",
62
+ content: {
63
+ "application/json": {
64
+ schema: {
65
+ type: "object",
66
+ additionalProperties: true
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "/app:getPlugins": {
75
+ get: {
76
+ tags: ["app"],
77
+ summary: "List loaded plugins",
78
+ description: "Return plugin metadata for the current application runtime.",
79
+ parameters: [],
80
+ responses: {
81
+ 200: {
82
+ description: "OK",
83
+ content: {
84
+ "application/json": {
85
+ schema: {
86
+ type: "array",
87
+ items: {
88
+ type: "object",
89
+ additionalProperties: true
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ },
98
+ "/app:restart": {
99
+ post: {
100
+ tags: ["app"],
101
+ summary: "Restart the application",
102
+ description: "Trigger an application restart asynchronously.",
103
+ parameters: [],
104
+ responses: {
105
+ 200: {
106
+ description: "OK"
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "/app:clearCache": {
112
+ post: {
113
+ tags: ["app"],
114
+ summary: "Clear application cache",
115
+ description: "Clear server-side caches used by the current application instance.",
116
+ parameters: [],
117
+ responses: {
118
+ 200: {
119
+ description: "OK"
120
+ }
121
+ }
122
+ }
123
+ }
124
+ };
@@ -0,0 +1,244 @@
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
+ readonly openapi: "3.0.2";
11
+ readonly info: {
12
+ readonly title: "NocoBase API - Core";
13
+ };
14
+ readonly tags: readonly [{
15
+ readonly name: "$collection";
16
+ readonly description: "Data table";
17
+ }, {
18
+ readonly name: "$collection.$oneToOneAssociation";
19
+ readonly description: "One to one relationship";
20
+ }, {
21
+ readonly name: "$collection.$manyToOneAssociation";
22
+ readonly description: "Many to one relationship";
23
+ }, {
24
+ readonly name: "$collection.$oneToManyAssociation";
25
+ readonly description: "One to many relationship";
26
+ }, {
27
+ readonly name: "$collection.$manyToManyAssociation";
28
+ readonly description: "Many to many relationship";
29
+ }, {
30
+ readonly name: "app";
31
+ readonly description: "app";
32
+ }, {
33
+ readonly name: "pm";
34
+ readonly description: "pm";
35
+ }];
36
+ readonly components: {
37
+ readonly parameters: {
38
+ readonly collectionName: {
39
+ readonly required: true;
40
+ readonly name: "collectionName";
41
+ readonly in: "path";
42
+ readonly description: "Collection name";
43
+ readonly schema: {
44
+ readonly type: "string";
45
+ };
46
+ };
47
+ readonly collectionIndex: {
48
+ readonly required: true;
49
+ readonly name: "collectionIndex";
50
+ readonly in: "path";
51
+ readonly description: "Collection index";
52
+ readonly schema: {
53
+ readonly type: "integer";
54
+ readonly format: "int64";
55
+ };
56
+ };
57
+ readonly oneToOneAssociation: {
58
+ readonly required: true;
59
+ readonly name: "oneToOneAssociation";
60
+ readonly in: "path";
61
+ readonly description: "Association name";
62
+ readonly schema: {
63
+ readonly type: "string";
64
+ };
65
+ };
66
+ readonly manyToOneAssociation: {
67
+ readonly required: true;
68
+ readonly name: "manyToOneAssociation";
69
+ readonly in: "path";
70
+ readonly description: "Association name";
71
+ readonly schema: {
72
+ readonly type: "string";
73
+ };
74
+ };
75
+ readonly oneToManyAssociation: {
76
+ readonly required: true;
77
+ readonly name: "oneToManyAssociation";
78
+ readonly in: "path";
79
+ readonly description: "Association name";
80
+ readonly schema: {
81
+ readonly type: "string";
82
+ };
83
+ };
84
+ readonly manyToManyAssociation: {
85
+ readonly required: true;
86
+ readonly name: "manyToManyAssociation";
87
+ readonly in: "path";
88
+ readonly description: "Association name";
89
+ readonly schema: {
90
+ readonly type: "string";
91
+ };
92
+ };
93
+ readonly page: {
94
+ readonly name: "page";
95
+ readonly in: "query";
96
+ readonly description: "page number";
97
+ readonly required: false;
98
+ readonly schema: {
99
+ readonly type: "integer";
100
+ };
101
+ };
102
+ readonly pageSize: {
103
+ readonly name: "pageSize";
104
+ readonly in: "query";
105
+ readonly description: "page size";
106
+ readonly required: false;
107
+ readonly schema: {
108
+ readonly type: "integer";
109
+ };
110
+ };
111
+ readonly filterByTk: {
112
+ readonly name: "filterByTk";
113
+ readonly in: "query";
114
+ readonly description: "filter by TK(default by ID)";
115
+ readonly schema: {
116
+ readonly type: "string";
117
+ };
118
+ };
119
+ readonly filterByTks: {
120
+ readonly name: "filterByTks";
121
+ readonly in: "query";
122
+ readonly description: "filter by TKs(default by ID), example: `1,2,3`";
123
+ readonly schema: {
124
+ readonly type: "string";
125
+ };
126
+ };
127
+ readonly filter: {
128
+ readonly name: "filter";
129
+ readonly in: "query";
130
+ readonly description: "filter items";
131
+ readonly content: {
132
+ readonly 'application/json': {
133
+ readonly schema: {
134
+ readonly type: "object";
135
+ };
136
+ };
137
+ };
138
+ };
139
+ readonly sort: {
140
+ readonly name: "sort";
141
+ readonly in: "query";
142
+ readonly description: "sort items by fields, example: `-field1,-field2,field3`";
143
+ readonly schema: {
144
+ readonly oneOf: readonly [{
145
+ readonly type: "array";
146
+ readonly items: {
147
+ readonly type: "string";
148
+ };
149
+ readonly example: readonly ["-id", "createdAt"];
150
+ }, {
151
+ readonly type: "string";
152
+ readonly example: "-id,createdAt";
153
+ }];
154
+ };
155
+ };
156
+ readonly fields: {
157
+ readonly name: "fields";
158
+ readonly in: "query";
159
+ readonly description: "select fields, example: `field1,field2`";
160
+ readonly schema: {
161
+ readonly oneOf: readonly [{
162
+ readonly type: "array";
163
+ readonly items: {
164
+ readonly type: "string";
165
+ };
166
+ readonly example: readonly ["id", "createdAt"];
167
+ }, {
168
+ readonly type: "string";
169
+ readonly example: "id,createdAt";
170
+ }];
171
+ };
172
+ };
173
+ readonly except: {
174
+ readonly name: "except";
175
+ readonly in: "query";
176
+ readonly description: "except fields in results, example: `field1,field2`";
177
+ readonly schema: {
178
+ readonly oneOf: readonly [{
179
+ readonly type: "array";
180
+ readonly items: {
181
+ readonly type: "string";
182
+ };
183
+ readonly example: readonly ["id", "createdAt"];
184
+ }, {
185
+ readonly type: "string";
186
+ readonly example: "id,createdAt";
187
+ }];
188
+ };
189
+ };
190
+ readonly appends: {
191
+ readonly name: "appends";
192
+ readonly in: "query";
193
+ readonly description: "append associations in results, example: `assoc1,assoc2`";
194
+ readonly schema: {
195
+ readonly oneOf: readonly [{
196
+ readonly type: "array";
197
+ readonly items: {
198
+ readonly type: "string";
199
+ };
200
+ readonly example: readonly ["id", "createdAt"];
201
+ }, {
202
+ readonly type: "string";
203
+ readonly example: "id,createdAt";
204
+ }];
205
+ };
206
+ };
207
+ readonly whitelist: {
208
+ readonly name: "whitelist";
209
+ readonly in: "query";
210
+ readonly description: "whitelist for fields changes, example: `field1,field2`";
211
+ readonly schema: {
212
+ readonly oneOf: readonly [{
213
+ readonly type: "array";
214
+ readonly items: {
215
+ readonly type: "string";
216
+ };
217
+ readonly example: readonly ["id", "createdAt"];
218
+ }, {
219
+ readonly type: "string";
220
+ readonly example: "id,createdAt";
221
+ }];
222
+ };
223
+ };
224
+ readonly blacklist: {
225
+ readonly name: "blacklist";
226
+ readonly in: "query";
227
+ readonly description: "blacklist for fields changes, example: `field1,field2`";
228
+ readonly schema: {
229
+ readonly oneOf: readonly [{
230
+ readonly type: "array";
231
+ readonly items: {
232
+ readonly type: "string";
233
+ };
234
+ readonly example: readonly ["id", "createdAt"];
235
+ }, {
236
+ readonly type: "string";
237
+ readonly example: "id,createdAt";
238
+ }];
239
+ };
240
+ };
241
+ };
242
+ };
243
+ };
244
+ export default _default;
@@ -0,0 +1,292 @@
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 base_exports = {};
28
+ __export(base_exports, {
29
+ default: () => base_default
30
+ });
31
+ module.exports = __toCommonJS(base_exports);
32
+ var base_default = {
33
+ openapi: "3.0.2",
34
+ info: {
35
+ title: "NocoBase API - Core"
36
+ },
37
+ tags: [
38
+ {
39
+ name: "$collection",
40
+ description: "Data table"
41
+ },
42
+ {
43
+ name: "$collection.$oneToOneAssociation",
44
+ description: "One to one relationship"
45
+ },
46
+ {
47
+ name: "$collection.$manyToOneAssociation",
48
+ description: "Many to one relationship"
49
+ },
50
+ {
51
+ name: "$collection.$oneToManyAssociation",
52
+ description: "One to many relationship"
53
+ },
54
+ {
55
+ name: "$collection.$manyToManyAssociation",
56
+ description: "Many to many relationship"
57
+ },
58
+ {
59
+ name: "app",
60
+ description: "app"
61
+ },
62
+ {
63
+ name: "pm",
64
+ description: "pm"
65
+ }
66
+ ],
67
+ components: {
68
+ parameters: {
69
+ collectionName: {
70
+ required: true,
71
+ name: "collectionName",
72
+ in: "path",
73
+ description: "Collection name",
74
+ schema: {
75
+ type: "string"
76
+ }
77
+ },
78
+ collectionIndex: {
79
+ required: true,
80
+ name: "collectionIndex",
81
+ in: "path",
82
+ description: "Collection index",
83
+ schema: {
84
+ type: "integer",
85
+ format: "int64"
86
+ }
87
+ },
88
+ oneToOneAssociation: {
89
+ required: true,
90
+ name: "oneToOneAssociation",
91
+ in: "path",
92
+ description: "Association name",
93
+ schema: {
94
+ type: "string"
95
+ }
96
+ },
97
+ manyToOneAssociation: {
98
+ required: true,
99
+ name: "manyToOneAssociation",
100
+ in: "path",
101
+ description: "Association name",
102
+ schema: {
103
+ type: "string"
104
+ }
105
+ },
106
+ oneToManyAssociation: {
107
+ required: true,
108
+ name: "oneToManyAssociation",
109
+ in: "path",
110
+ description: "Association name",
111
+ schema: {
112
+ type: "string"
113
+ }
114
+ },
115
+ manyToManyAssociation: {
116
+ required: true,
117
+ name: "manyToManyAssociation",
118
+ in: "path",
119
+ description: "Association name",
120
+ schema: {
121
+ type: "string"
122
+ }
123
+ },
124
+ page: {
125
+ name: "page",
126
+ in: "query",
127
+ description: "page number",
128
+ required: false,
129
+ schema: {
130
+ type: "integer"
131
+ }
132
+ },
133
+ pageSize: {
134
+ name: "pageSize",
135
+ in: "query",
136
+ description: "page size",
137
+ required: false,
138
+ schema: {
139
+ type: "integer"
140
+ }
141
+ },
142
+ filterByTk: {
143
+ name: "filterByTk",
144
+ in: "query",
145
+ description: "filter by TK(default by ID)",
146
+ schema: {
147
+ type: "string"
148
+ }
149
+ },
150
+ filterByTks: {
151
+ name: "filterByTks",
152
+ in: "query",
153
+ description: "filter by TKs(default by ID), example: `1,2,3`",
154
+ schema: {
155
+ type: "string"
156
+ }
157
+ },
158
+ filter: {
159
+ name: "filter",
160
+ in: "query",
161
+ description: "filter items",
162
+ content: {
163
+ "application/json": {
164
+ schema: {
165
+ type: "object"
166
+ }
167
+ }
168
+ }
169
+ },
170
+ sort: {
171
+ name: "sort",
172
+ in: "query",
173
+ description: "sort items by fields, example: `-field1,-field2,field3`",
174
+ schema: {
175
+ oneOf: [
176
+ {
177
+ type: "array",
178
+ items: {
179
+ type: "string"
180
+ },
181
+ example: ["-id", "createdAt"]
182
+ },
183
+ {
184
+ type: "string",
185
+ example: "-id,createdAt"
186
+ }
187
+ ]
188
+ }
189
+ },
190
+ fields: {
191
+ name: "fields",
192
+ in: "query",
193
+ description: "select fields, example: `field1,field2`",
194
+ schema: {
195
+ oneOf: [
196
+ {
197
+ type: "array",
198
+ items: {
199
+ type: "string"
200
+ },
201
+ example: ["id", "createdAt"]
202
+ },
203
+ {
204
+ type: "string",
205
+ example: "id,createdAt"
206
+ }
207
+ ]
208
+ }
209
+ },
210
+ except: {
211
+ name: "except",
212
+ in: "query",
213
+ description: "except fields in results, example: `field1,field2`",
214
+ schema: {
215
+ oneOf: [
216
+ {
217
+ type: "array",
218
+ items: {
219
+ type: "string"
220
+ },
221
+ example: ["id", "createdAt"]
222
+ },
223
+ {
224
+ type: "string",
225
+ example: "id,createdAt"
226
+ }
227
+ ]
228
+ }
229
+ },
230
+ appends: {
231
+ name: "appends",
232
+ in: "query",
233
+ description: "append associations in results, example: `assoc1,assoc2`",
234
+ schema: {
235
+ oneOf: [
236
+ {
237
+ type: "array",
238
+ items: {
239
+ type: "string"
240
+ },
241
+ example: ["id", "createdAt"]
242
+ },
243
+ {
244
+ type: "string",
245
+ example: "id,createdAt"
246
+ }
247
+ ]
248
+ }
249
+ },
250
+ whitelist: {
251
+ name: "whitelist",
252
+ in: "query",
253
+ description: "whitelist for fields changes, example: `field1,field2`",
254
+ schema: {
255
+ oneOf: [
256
+ {
257
+ type: "array",
258
+ items: {
259
+ type: "string"
260
+ },
261
+ example: ["id", "createdAt"]
262
+ },
263
+ {
264
+ type: "string",
265
+ example: "id,createdAt"
266
+ }
267
+ ]
268
+ }
269
+ },
270
+ blacklist: {
271
+ name: "blacklist",
272
+ in: "query",
273
+ description: "blacklist for fields changes, example: `field1,field2`",
274
+ schema: {
275
+ oneOf: [
276
+ {
277
+ type: "array",
278
+ items: {
279
+ type: "string"
280
+ },
281
+ example: ["id", "createdAt"]
282
+ },
283
+ {
284
+ type: "string",
285
+ example: "id,createdAt"
286
+ }
287
+ ]
288
+ }
289
+ }
290
+ }
291
+ }
292
+ };