@nocobase/server 2.1.0-alpha.15 → 2.1.0-alpha.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,364 @@
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 pm_exports = {};
28
+ __export(pm_exports, {
29
+ default: () => pm_default,
30
+ pmComponents: () => pmComponents
31
+ });
32
+ module.exports = __toCommonJS(pm_exports);
33
+ const pluginNameParameter = {
34
+ name: "filterByTk",
35
+ in: "query",
36
+ description: "Plugin name.",
37
+ required: true,
38
+ schema: {
39
+ type: "string"
40
+ }
41
+ };
42
+ const pluginListResponse = {
43
+ description: "OK",
44
+ content: {
45
+ "application/json": {
46
+ schema: {
47
+ type: "array",
48
+ items: {
49
+ $ref: "#/components/schemas/PMPlugin"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ };
55
+ const enabledPluginListResponse = {
56
+ description: "OK",
57
+ content: {
58
+ "application/json": {
59
+ schema: {
60
+ type: "array",
61
+ items: {
62
+ $ref: "#/components/schemas/PMEnabledPlugin"
63
+ }
64
+ }
65
+ }
66
+ }
67
+ };
68
+ const pluginOperationResponse = {
69
+ description: "OK",
70
+ content: {
71
+ "application/json": {
72
+ schema: {
73
+ oneOf: [
74
+ {
75
+ type: "string",
76
+ example: "ok"
77
+ },
78
+ {
79
+ $ref: "#/components/schemas/PMPluginActionResult"
80
+ }
81
+ ]
82
+ }
83
+ }
84
+ }
85
+ };
86
+ const pmComponents = {
87
+ schemas: {
88
+ PMPlugin: {
89
+ type: "object",
90
+ properties: {
91
+ id: {
92
+ type: "integer"
93
+ },
94
+ name: {
95
+ type: "string",
96
+ description: "Plugin short name."
97
+ },
98
+ packageName: {
99
+ type: "string",
100
+ description: "Plugin package name."
101
+ },
102
+ version: {
103
+ type: "string"
104
+ },
105
+ enabled: {
106
+ type: "boolean"
107
+ },
108
+ installed: {
109
+ type: "boolean"
110
+ },
111
+ builtIn: {
112
+ type: "boolean"
113
+ },
114
+ options: {
115
+ type: "object",
116
+ additionalProperties: true
117
+ }
118
+ },
119
+ additionalProperties: true
120
+ },
121
+ PMEnabledPlugin: {
122
+ type: "object",
123
+ properties: {
124
+ name: {
125
+ type: "string"
126
+ },
127
+ packageName: {
128
+ type: "string"
129
+ },
130
+ options: {
131
+ type: "object",
132
+ additionalProperties: true
133
+ },
134
+ url: {
135
+ type: "string",
136
+ description: "Resolved client bundle URL."
137
+ }
138
+ },
139
+ additionalProperties: true
140
+ },
141
+ PMPluginActionResult: {
142
+ type: "string",
143
+ description: "Queued successfully.",
144
+ example: "ok"
145
+ },
146
+ PMInstallOrUpdatePayload: {
147
+ type: "object",
148
+ description: "JSON payload for installing or updating a plugin from npm or a compressed package URL.",
149
+ properties: {
150
+ packageName: {
151
+ type: "string",
152
+ description: "Plugin package name."
153
+ },
154
+ version: {
155
+ type: "string",
156
+ description: "Target plugin version."
157
+ },
158
+ registry: {
159
+ type: "string",
160
+ description: "Custom npm registry URL."
161
+ },
162
+ authToken: {
163
+ type: "string",
164
+ description: "Authentication token used when accessing a private registry."
165
+ },
166
+ compressedFileUrl: {
167
+ type: "string",
168
+ description: "Remote compressed package URL."
169
+ }
170
+ },
171
+ additionalProperties: true
172
+ },
173
+ PMUploadPayload: {
174
+ type: "object",
175
+ description: "Multipart payload for uploading a plugin package file.",
176
+ properties: {
177
+ packageName: {
178
+ type: "string",
179
+ description: "Plugin package name. Required when updating from an uploaded file."
180
+ },
181
+ version: {
182
+ type: "string"
183
+ },
184
+ registry: {
185
+ type: "string"
186
+ },
187
+ authToken: {
188
+ type: "string"
189
+ },
190
+ file: {
191
+ type: "string",
192
+ format: "binary",
193
+ description: "Compressed plugin package file."
194
+ }
195
+ },
196
+ additionalProperties: true
197
+ }
198
+ }
199
+ };
200
+ var pm_default = {
201
+ "/pm:list": {
202
+ get: {
203
+ tags: ["pm"],
204
+ summary: "List available plugins",
205
+ description: "Return plugin metadata from the plugin manager.",
206
+ parameters: [],
207
+ responses: {
208
+ 200: pluginListResponse
209
+ }
210
+ }
211
+ },
212
+ "/pm:get": {
213
+ get: {
214
+ tags: ["pm"],
215
+ summary: "Get plugin details",
216
+ description: "Return metadata for a single plugin.",
217
+ parameters: [pluginNameParameter],
218
+ responses: {
219
+ 200: {
220
+ description: "OK",
221
+ content: {
222
+ "application/json": {
223
+ schema: {
224
+ $ref: "#/components/schemas/PMPlugin"
225
+ }
226
+ }
227
+ }
228
+ }
229
+ }
230
+ }
231
+ },
232
+ "/pm:listEnabled": {
233
+ get: {
234
+ tags: ["pm"],
235
+ summary: "List enabled client plugins",
236
+ description: "Return enabled plugins that expose a `dist/client/index.js` entry.",
237
+ parameters: [],
238
+ responses: {
239
+ 200: enabledPluginListResponse
240
+ }
241
+ }
242
+ },
243
+ "/pm:listEnabledV2": {
244
+ get: {
245
+ tags: ["pm"],
246
+ summary: "List enabled client-v2 plugins",
247
+ description: "Return enabled plugins that expose a `dist/client-v2/index.js` entry.",
248
+ parameters: [],
249
+ responses: {
250
+ 200: enabledPluginListResponse
251
+ }
252
+ }
253
+ },
254
+ // '/pm:npmVersionList': {
255
+ // get: {
256
+ // tags: ['pm'],
257
+ // summary: 'List published plugin versions',
258
+ // description: 'Return all available npm versions for a specific installed plugin.',
259
+ // parameters: [pluginNameParameter],
260
+ // responses: {
261
+ // 200: {
262
+ // description: 'OK',
263
+ // content: {
264
+ // 'application/json': {
265
+ // schema: {
266
+ // type: 'array',
267
+ // items: {
268
+ // type: 'string',
269
+ // },
270
+ // },
271
+ // },
272
+ // },
273
+ // },
274
+ // },
275
+ // },
276
+ // },
277
+ "/pm:add": {
278
+ post: {
279
+ tags: ["pm"],
280
+ summary: "Install a plugin",
281
+ description: "Queue a plugin installation from npm, a remote compressed package URL, or an uploaded package file.",
282
+ requestBody: {
283
+ required: true,
284
+ content: {
285
+ "application/json": {
286
+ schema: {
287
+ $ref: "#/components/schemas/PMInstallOrUpdatePayload"
288
+ }
289
+ },
290
+ "multipart/form-data": {
291
+ schema: {
292
+ $ref: "#/components/schemas/PMUploadPayload"
293
+ }
294
+ }
295
+ }
296
+ },
297
+ responses: {
298
+ 200: pluginOperationResponse
299
+ }
300
+ }
301
+ },
302
+ "/pm:update": {
303
+ post: {
304
+ tags: ["pm"],
305
+ summary: "Update a plugin",
306
+ description: "Queue a plugin update from npm, a remote compressed package URL, or an uploaded package file.",
307
+ requestBody: {
308
+ required: true,
309
+ content: {
310
+ "application/json": {
311
+ schema: {
312
+ $ref: "#/components/schemas/PMInstallOrUpdatePayload"
313
+ }
314
+ },
315
+ "multipart/form-data": {
316
+ schema: {
317
+ $ref: "#/components/schemas/PMUploadPayload"
318
+ }
319
+ }
320
+ }
321
+ },
322
+ responses: {
323
+ 200: pluginOperationResponse
324
+ }
325
+ }
326
+ },
327
+ "/pm:enable": {
328
+ post: {
329
+ tags: ["pm"],
330
+ summary: "Enable a plugin",
331
+ description: "Queue an enable operation for a plugin.",
332
+ parameters: [pluginNameParameter],
333
+ responses: {
334
+ 200: pluginOperationResponse
335
+ }
336
+ }
337
+ },
338
+ "/pm:disable": {
339
+ post: {
340
+ tags: ["pm"],
341
+ summary: "Disable a plugin",
342
+ description: "Queue a disable operation for a plugin.",
343
+ parameters: [pluginNameParameter],
344
+ responses: {
345
+ 200: pluginOperationResponse
346
+ }
347
+ }
348
+ },
349
+ "/pm:remove": {
350
+ post: {
351
+ tags: ["pm"],
352
+ summary: "Remove a plugin",
353
+ description: "Queue a removal operation for a plugin.",
354
+ parameters: [pluginNameParameter],
355
+ responses: {
356
+ 200: pluginOperationResponse
357
+ }
358
+ }
359
+ }
360
+ };
361
+ // Annotate the CommonJS export names for ESM import in node:
362
+ 0 && (module.exports = {
363
+ pmComponents
364
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/server",
3
- "version": "2.1.0-alpha.15",
3
+ "version": "2.1.0-alpha.17",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -10,21 +10,21 @@
10
10
  "@koa/cors": "^5.0.0",
11
11
  "@koa/multer": "^3.1.0",
12
12
  "@koa/router": "^13.1.0",
13
- "@nocobase/acl": "2.1.0-alpha.15",
14
- "@nocobase/actions": "2.1.0-alpha.15",
15
- "@nocobase/ai": "2.1.0-alpha.15",
16
- "@nocobase/auth": "2.1.0-alpha.15",
17
- "@nocobase/cache": "2.1.0-alpha.15",
18
- "@nocobase/data-source-manager": "2.1.0-alpha.15",
19
- "@nocobase/database": "2.1.0-alpha.15",
20
- "@nocobase/evaluators": "2.1.0-alpha.15",
21
- "@nocobase/lock-manager": "2.1.0-alpha.15",
22
- "@nocobase/logger": "2.1.0-alpha.15",
23
- "@nocobase/resourcer": "2.1.0-alpha.15",
24
- "@nocobase/sdk": "2.1.0-alpha.15",
25
- "@nocobase/snowflake-id": "2.1.0-alpha.15",
26
- "@nocobase/telemetry": "2.1.0-alpha.15",
27
- "@nocobase/utils": "2.1.0-alpha.15",
13
+ "@nocobase/acl": "2.1.0-alpha.17",
14
+ "@nocobase/actions": "2.1.0-alpha.17",
15
+ "@nocobase/ai": "2.1.0-alpha.17",
16
+ "@nocobase/auth": "2.1.0-alpha.17",
17
+ "@nocobase/cache": "2.1.0-alpha.17",
18
+ "@nocobase/data-source-manager": "2.1.0-alpha.17",
19
+ "@nocobase/database": "2.1.0-alpha.17",
20
+ "@nocobase/evaluators": "2.1.0-alpha.17",
21
+ "@nocobase/lock-manager": "2.1.0-alpha.17",
22
+ "@nocobase/logger": "2.1.0-alpha.17",
23
+ "@nocobase/resourcer": "2.1.0-alpha.17",
24
+ "@nocobase/sdk": "2.1.0-alpha.17",
25
+ "@nocobase/snowflake-id": "2.1.0-alpha.17",
26
+ "@nocobase/telemetry": "2.1.0-alpha.17",
27
+ "@nocobase/utils": "2.1.0-alpha.17",
28
28
  "@types/decompress": "4.2.7",
29
29
  "@types/ini": "^1.3.31",
30
30
  "@types/koa-send": "^4.1.3",
@@ -61,5 +61,5 @@
61
61
  "@types/serve-handler": "^6.1.1",
62
62
  "@types/ws": "^8.5.5"
63
63
  },
64
- "gitHead": "7c86e75b0af4b9f532c8ebf5ef96a7423b0ab60e"
64
+ "gitHead": "586cb00f56557e66168b9720d0e0193a1b752067"
65
65
  }