@nocobase/plugin-api-doc 1.2.13-alpha → 1.3.0-alpha.20240710084543
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.
- package/package.json +2 -2
- package/dist/client/Document.d.ts +0 -12
- package/dist/client/index.d.ts +0 -14
- package/dist/client/index.js +0 -160
- package/dist/externalVersion.js +0 -22
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -42
- package/dist/locale/en-US.json +0 -5
- package/dist/locale/index.d.ts +0 -12
- package/dist/locale/index.js +0 -53
- package/dist/locale/ko_KR.json +0 -5
- package/dist/locale/zh-CN.json +0 -5
- package/dist/server/index.d.ts +0 -9
- package/dist/server/index.js +0 -42
- package/dist/server/server.d.ts +0 -17
- package/dist/server/server.js +0 -83
- package/dist/server/swagger/base-swagger.d.ts +0 -57
- package/dist/server/swagger/base-swagger.js +0 -81
- package/dist/server/swagger/collections/components/field-type-map.d.ts +0 -30
- package/dist/server/swagger/collections/components/field-type-map.js +0 -66
- package/dist/server/swagger/collections/components/index.d.ts +0 -32
- package/dist/server/swagger/collections/components/index.js +0 -49
- package/dist/server/swagger/collections/components/parameters.d.ts +0 -13
- package/dist/server/swagger/collections/components/parameters.js +0 -203
- package/dist/server/swagger/collections/components/schemas.d.ts +0 -31
- package/dist/server/swagger/collections/components/schemas.js +0 -117
- package/dist/server/swagger/collections/index.d.ts +0 -39
- package/dist/server/swagger/collections/index.js +0 -52
- package/dist/server/swagger/collections/paths/associations/index.d.ts +0 -14
- package/dist/server/swagger/collections/paths/associations/index.js +0 -69
- package/dist/server/swagger/collections/paths/associations/multiple-association.d.ts +0 -14
- package/dist/server/swagger/collections/paths/associations/multiple-association.js +0 -134
- package/dist/server/swagger/collections/paths/associations/single-association.d.ts +0 -13
- package/dist/server/swagger/collections/paths/associations/single-association.js +0 -114
- package/dist/server/swagger/collections/paths/collection.d.ts +0 -209
- package/dist/server/swagger/collections/paths/collection.js +0 -371
- package/dist/server/swagger/collections/paths/index.d.ts +0 -14
- package/dist/server/swagger/collections/paths/index.js +0 -74
- package/dist/server/swagger/collections/tags/index.d.ts +0 -14
- package/dist/server/swagger/collections/tags/index.js +0 -52
- package/dist/server/swagger/constants.d.ts +0 -18
- package/dist/server/swagger/constants.js +0 -45
- package/dist/server/swagger/helpers.d.ts +0 -179
- package/dist/server/swagger/helpers.js +0 -143
- package/dist/server/swagger/index.d.ts +0 -57
- package/dist/server/swagger/index.js +0 -259
- package/dist/server/swagger/loader.d.ts +0 -12
- package/dist/server/swagger/loader.js +0 -89
- package/dist/server/swagger/merge.d.ts +0 -9
- package/dist/server/swagger/merge.js +0 -43
- package/dist/swagger.d.ts +0 -51
- package/dist/swagger.js +0 -73
|
@@ -1,259 +0,0 @@
|
|
|
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 __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var swagger_exports = {};
|
|
38
|
-
__export(swagger_exports, {
|
|
39
|
-
SwaggerManager: () => SwaggerManager
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(swagger_exports);
|
|
42
|
-
var import_base_swagger = __toESM(require("./base-swagger"));
|
|
43
|
-
var import_collections = __toESM(require("./collections"));
|
|
44
|
-
var import_constants = require("./constants");
|
|
45
|
-
var import_helpers = require("./helpers");
|
|
46
|
-
var import_loader = require("./loader");
|
|
47
|
-
var import_merge = require("./merge");
|
|
48
|
-
class SwaggerManager {
|
|
49
|
-
plugin;
|
|
50
|
-
constructor(plugin) {
|
|
51
|
-
this.plugin = plugin;
|
|
52
|
-
}
|
|
53
|
-
get app() {
|
|
54
|
-
return this.plugin.app;
|
|
55
|
-
}
|
|
56
|
-
get db() {
|
|
57
|
-
return this.plugin.db;
|
|
58
|
-
}
|
|
59
|
-
async generateSwagger(options = {}) {
|
|
60
|
-
const base = await this.getBaseSwagger();
|
|
61
|
-
const core = options.plugins ? {} : await (0, import_loader.loadSwagger)("@nocobase/server");
|
|
62
|
-
const plugins = await this.loadSwaggers(options.plugins);
|
|
63
|
-
return (0, import_merge.merge)((0, import_merge.merge)(core, plugins), base);
|
|
64
|
-
}
|
|
65
|
-
async getSwagger() {
|
|
66
|
-
return this.generateSwagger();
|
|
67
|
-
}
|
|
68
|
-
async collection2Swagger(collectionName, withAssociation = true) {
|
|
69
|
-
const collection = this.db.getCollection(collectionName);
|
|
70
|
-
return await (async () => {
|
|
71
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
72
|
-
return (0, import_collections.default)(collection, {
|
|
73
|
-
withAssociation
|
|
74
|
-
});
|
|
75
|
-
})();
|
|
76
|
-
}
|
|
77
|
-
async getCollectionsSwagger(name) {
|
|
78
|
-
const base = await this.getBaseSwagger();
|
|
79
|
-
let others = {};
|
|
80
|
-
if (name) {
|
|
81
|
-
const collectionSwagger = await this.collection2Swagger(name);
|
|
82
|
-
others = (0, import_merge.merge)(others, collectionSwagger);
|
|
83
|
-
} else {
|
|
84
|
-
const collections = await this.db.getRepository("collections").find({
|
|
85
|
-
filter: {
|
|
86
|
-
"name.$ne": ["roles", "users"],
|
|
87
|
-
"hidden.$isFalsy": true
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
for (const collection of collections) {
|
|
91
|
-
if (collection.name === "roles") {
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
try {
|
|
95
|
-
others = (0, import_merge.merge)(others, await this.collection2Swagger(collection.name, false));
|
|
96
|
-
} catch (e) {
|
|
97
|
-
this.app.log.error(e);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return (0, import_merge.merge)(base, others);
|
|
102
|
-
}
|
|
103
|
-
async getPluginsSwagger(pluginName) {
|
|
104
|
-
return this.generateSwagger({
|
|
105
|
-
plugins: pluginName ? [pluginName] : []
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
async getCoreSwagger() {
|
|
109
|
-
return (0, import_merge.merge)(await this.getBaseSwagger(), await (0, import_loader.loadSwagger)("@nocobase/server"));
|
|
110
|
-
}
|
|
111
|
-
getURL(pathname) {
|
|
112
|
-
return process.env.API_BASE_PATH + pathname;
|
|
113
|
-
}
|
|
114
|
-
async getUrls() {
|
|
115
|
-
const plugins = await (0, import_loader.getPluginsSwagger)(this.db).then((res) => {
|
|
116
|
-
return Object.keys(res).map((name) => {
|
|
117
|
-
var _a;
|
|
118
|
-
const schema = res[name];
|
|
119
|
-
return {
|
|
120
|
-
name: ((_a = schema.info) == null ? void 0 : _a.title) || name,
|
|
121
|
-
url: this.getURL(`swagger:get?ns=${encodeURIComponent(`plugins/${name}`)}`)
|
|
122
|
-
};
|
|
123
|
-
});
|
|
124
|
-
}).catch(() => []);
|
|
125
|
-
const collections = await this.db.getRepository("collections").find({
|
|
126
|
-
filter: {
|
|
127
|
-
"name.$ne": ["roles", "users"],
|
|
128
|
-
"hidden.$isFalsy": true
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
return [
|
|
132
|
-
{
|
|
133
|
-
name: "NocoBase API",
|
|
134
|
-
url: this.getURL("swagger:get")
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
name: "NocoBase API - Core",
|
|
138
|
-
url: this.getURL("swagger:get?ns=core")
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: "NocoBase API - All plugins",
|
|
142
|
-
url: this.getURL("swagger:get?ns=plugins")
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: "NocoBase API - Custom collections",
|
|
146
|
-
url: this.getURL("swagger:get?ns=collections")
|
|
147
|
-
},
|
|
148
|
-
...plugins,
|
|
149
|
-
...collections.map((collection) => {
|
|
150
|
-
return {
|
|
151
|
-
name: `Collection API - ${collection.title}`,
|
|
152
|
-
url: this.getURL(`swagger:get?ns=${encodeURIComponent("collections/" + collection.name)}`)
|
|
153
|
-
};
|
|
154
|
-
})
|
|
155
|
-
];
|
|
156
|
-
}
|
|
157
|
-
async getBaseSwagger() {
|
|
158
|
-
return (0, import_merge.merge)(import_base_swagger.default, {
|
|
159
|
-
info: {
|
|
160
|
-
version: await this.app.version.get()
|
|
161
|
-
},
|
|
162
|
-
servers: [
|
|
163
|
-
{
|
|
164
|
-
url: (this.app.resourcer.options.prefix || "/").replace(/^[^/]/, "/$1")
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
generateSchemas() {
|
|
170
|
-
const schemas = {};
|
|
171
|
-
this.app.i18n;
|
|
172
|
-
this.db.collections.forEach((collection) => {
|
|
173
|
-
const properties = {};
|
|
174
|
-
const model = {
|
|
175
|
-
type: "object",
|
|
176
|
-
properties
|
|
177
|
-
};
|
|
178
|
-
collection.forEachField((field) => {
|
|
179
|
-
const { type, target } = field;
|
|
180
|
-
const property = {};
|
|
181
|
-
if (type === "hasMany" || type === "belongsToMany") {
|
|
182
|
-
property["type"] = "array";
|
|
183
|
-
property["items"] = {
|
|
184
|
-
$ref: `#/components/schemas/${target}`
|
|
185
|
-
};
|
|
186
|
-
} else if (type === "belongsTo" || type === "hasOne") {
|
|
187
|
-
property["type"] = "object";
|
|
188
|
-
property["$ref"] = `#/components/schemas/${target}`;
|
|
189
|
-
} else {
|
|
190
|
-
property.type = import_constants.SchemaTypeMapping[type] || type;
|
|
191
|
-
if (property.type === "array" && !property.items) {
|
|
192
|
-
property.items = {
|
|
193
|
-
type: "object"
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
property.example = field.get("defaultValue");
|
|
197
|
-
}
|
|
198
|
-
properties[field.name] = property;
|
|
199
|
-
});
|
|
200
|
-
schemas[collection.name] = model;
|
|
201
|
-
});
|
|
202
|
-
return schemas;
|
|
203
|
-
}
|
|
204
|
-
generateCollectionBuiltInInterface() {
|
|
205
|
-
const paths = {};
|
|
206
|
-
const IC = (0, import_helpers.getInterfaceCollection)(this.app.resourcer.options);
|
|
207
|
-
this.db.collections.forEach((collection) => {
|
|
208
|
-
const { name } = collection;
|
|
209
|
-
let actions;
|
|
210
|
-
if (this.app.resourcer.isDefined(name)) {
|
|
211
|
-
actions = this.app.resourcer.getResource(name).actions;
|
|
212
|
-
} else {
|
|
213
|
-
actions = {
|
|
214
|
-
has: () => true
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
const collectionMethods = {};
|
|
218
|
-
Object.entries(IC).forEach(([path, actionNames]) => {
|
|
219
|
-
actionNames.forEach((actionName) => {
|
|
220
|
-
const actionMethods = (0, import_helpers.createDefaultActionSwagger)({
|
|
221
|
-
collection
|
|
222
|
-
});
|
|
223
|
-
const { method = "post", ...swaggerArgs } = actionMethods[actionName];
|
|
224
|
-
const parameters = [];
|
|
225
|
-
["associatedName", "associatedIndex", "resourceIndex"].forEach((name2) => {
|
|
226
|
-
if (path.includes(`{${name2}}`)) {
|
|
227
|
-
parameters.push({
|
|
228
|
-
name: name2,
|
|
229
|
-
required: true,
|
|
230
|
-
schema: {
|
|
231
|
-
type: "string"
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
if (actions.has(actionName)) {
|
|
237
|
-
collectionMethods[path.replace("{resourceName}", `${name}:${actionName}`)] = {
|
|
238
|
-
[method]: {
|
|
239
|
-
tags: [name],
|
|
240
|
-
description: `${name}:${actionName}`,
|
|
241
|
-
parameters,
|
|
242
|
-
...swaggerArgs
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
Object.assign(paths, collectionMethods);
|
|
249
|
-
});
|
|
250
|
-
return paths;
|
|
251
|
-
}
|
|
252
|
-
loadSwaggers(plugins) {
|
|
253
|
-
return (0, import_loader.getSwaggerDocument)(this.db, plugins);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
257
|
-
0 && (module.exports = {
|
|
258
|
-
SwaggerManager
|
|
259
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
export declare const loadSwagger: (packageName: string) => any;
|
|
10
|
-
export declare const getPluginsSwagger: (db: any, pluginNames?: string[]) => Promise<{}>;
|
|
11
|
-
export declare const mergeObjects: (objs: any[]) => any;
|
|
12
|
-
export declare const getSwaggerDocument: (db: any, pluginNames?: string[]) => Promise<any>;
|
|
@@ -1,89 +0,0 @@
|
|
|
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 loader_exports = {};
|
|
28
|
-
__export(loader_exports, {
|
|
29
|
-
getPluginsSwagger: () => getPluginsSwagger,
|
|
30
|
-
getSwaggerDocument: () => getSwaggerDocument,
|
|
31
|
-
loadSwagger: () => loadSwagger,
|
|
32
|
-
mergeObjects: () => mergeObjects
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(loader_exports);
|
|
35
|
-
var import_utils = require("@nocobase/utils");
|
|
36
|
-
var import_merge = require("./merge");
|
|
37
|
-
const loadSwagger = (packageName) => {
|
|
38
|
-
const prefixes = ["src", "lib", "dist"];
|
|
39
|
-
const targets = ["swagger.json", "swagger/index.json", "swagger"];
|
|
40
|
-
for (const prefix of prefixes) {
|
|
41
|
-
for (const dict of targets) {
|
|
42
|
-
try {
|
|
43
|
-
const file = `${packageName}/${prefix}/${dict}`;
|
|
44
|
-
const filePath = require.resolve(file);
|
|
45
|
-
delete require.cache[filePath];
|
|
46
|
-
return (0, import_utils.requireModule)(file);
|
|
47
|
-
} catch (error) {
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return {};
|
|
52
|
-
};
|
|
53
|
-
const getPluginsSwagger = async (db, pluginNames) => {
|
|
54
|
-
const nameFilter = (pluginNames == null ? void 0 : pluginNames.length) ? { name: { $in: pluginNames } } : {};
|
|
55
|
-
const plugins = await db.getRepository("applicationPlugins").find({
|
|
56
|
-
filter: {
|
|
57
|
-
enabled: true,
|
|
58
|
-
...nameFilter
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
const swaggers = {};
|
|
62
|
-
for (const plugin of plugins) {
|
|
63
|
-
const packageName = plugin.get("packageName");
|
|
64
|
-
if (!packageName) {
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
const res = loadSwagger(packageName);
|
|
68
|
-
if (Object.keys(res).length) {
|
|
69
|
-
swaggers[plugin.get("name")] = res;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return swaggers;
|
|
73
|
-
};
|
|
74
|
-
const mergeObjects = (objs) => {
|
|
75
|
-
return objs.reduce((cur, obj) => {
|
|
76
|
-
return (0, import_merge.merge)(cur, obj);
|
|
77
|
-
}, {});
|
|
78
|
-
};
|
|
79
|
-
const getSwaggerDocument = async (db, pluginNames) => {
|
|
80
|
-
const swaggers = await getPluginsSwagger(db, pluginNames);
|
|
81
|
-
return mergeObjects(Object.values(swaggers));
|
|
82
|
-
};
|
|
83
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
84
|
-
0 && (module.exports = {
|
|
85
|
-
getPluginsSwagger,
|
|
86
|
-
getSwaggerDocument,
|
|
87
|
-
loadSwagger,
|
|
88
|
-
mergeObjects
|
|
89
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
export declare function merge(obj1: any, obj2: any, opts?: any): unknown;
|
|
@@ -1,43 +0,0 @@
|
|
|
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 merge_exports = {};
|
|
28
|
-
__export(merge_exports, {
|
|
29
|
-
merge: () => merge
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(merge_exports);
|
|
32
|
-
var import_utils = require("@nocobase/utils");
|
|
33
|
-
const overwriteMerge = (destinationArray, sourceArray, options) => sourceArray.concat(destinationArray);
|
|
34
|
-
function merge(obj1, obj2, opts) {
|
|
35
|
-
return (0, import_utils.merge)(obj1, obj2, {
|
|
36
|
-
arrayMerge: overwriteMerge,
|
|
37
|
-
...opts
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
-
0 && (module.exports = {
|
|
42
|
-
merge
|
|
43
|
-
});
|
package/dist/swagger.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
info: {
|
|
11
|
-
title: string;
|
|
12
|
-
};
|
|
13
|
-
paths: {
|
|
14
|
-
'/swagger:getUrls': {
|
|
15
|
-
get: {
|
|
16
|
-
description: string;
|
|
17
|
-
tags: string[];
|
|
18
|
-
responses: {
|
|
19
|
-
200: {
|
|
20
|
-
description: string;
|
|
21
|
-
content: {
|
|
22
|
-
'application/json': {
|
|
23
|
-
schema: {
|
|
24
|
-
$ref: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
components: {
|
|
34
|
-
responses: {
|
|
35
|
-
SwaggerUrls: {
|
|
36
|
-
type: string;
|
|
37
|
-
items: {
|
|
38
|
-
properties: {
|
|
39
|
-
name: {
|
|
40
|
-
type: string;
|
|
41
|
-
};
|
|
42
|
-
url: {
|
|
43
|
-
type: string;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export default _default;
|
package/dist/swagger.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
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
|
-
var swagger_default = {
|
|
33
|
-
info: {
|
|
34
|
-
title: "NocoBase API - API doc plugin"
|
|
35
|
-
},
|
|
36
|
-
paths: {
|
|
37
|
-
"/swagger:getUrls": {
|
|
38
|
-
get: {
|
|
39
|
-
description: "Get all api-doc destination",
|
|
40
|
-
tags: ["swagger"],
|
|
41
|
-
responses: {
|
|
42
|
-
200: {
|
|
43
|
-
description: "successful operation",
|
|
44
|
-
content: {
|
|
45
|
-
"application/json": {
|
|
46
|
-
schema: {
|
|
47
|
-
$ref: "#/components/responses/SwaggerUrls"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
components: {
|
|
57
|
-
responses: {
|
|
58
|
-
SwaggerUrls: {
|
|
59
|
-
type: "array",
|
|
60
|
-
items: {
|
|
61
|
-
properties: {
|
|
62
|
-
name: {
|
|
63
|
-
type: "string"
|
|
64
|
-
},
|
|
65
|
-
url: {
|
|
66
|
-
type: "string"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|