@nocobase/plugin-api-doc 0.13.0-alpha.3 → 0.13.0-alpha.5
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/dist/client/index.js +177 -48574
- package/dist/index.js +33 -11
- package/dist/locale/en-US.js +22 -4
- package/dist/locale/index.js +36 -12
- package/dist/locale/zh-CN.js +22 -4
- package/dist/server/index.js +33 -11
- package/dist/server/server.js +26 -9
- package/dist/server/swagger/base-swagger.js +22 -4
- package/dist/server/swagger/collections/components/field-type-map.js +28 -5
- package/dist/server/swagger/collections/components/index.js +36 -14
- package/dist/server/swagger/collections/components/parameters.js +26 -9
- package/dist/server/swagger/collections/components/schemas.js +29 -12
- package/dist/server/swagger/collections/index.js +38 -17
- package/dist/server/swagger/collections/paths/associations/index.js +47 -19
- package/dist/server/swagger/collections/paths/associations/multiple-association.js +51 -32
- package/dist/server/swagger/collections/paths/associations/single-association.js +38 -21
- package/dist/server/swagger/collections/paths/collection.js +49 -20
- package/dist/server/swagger/collections/paths/index.d.ts +2 -0
- package/dist/server/swagger/collections/paths/index.js +53 -18
- package/dist/server/swagger/collections/tags/index.js +31 -14
- package/dist/server/swagger/constants.js +26 -4
- package/dist/server/swagger/helpers.js +28 -5
- package/dist/server/swagger/index.js +55 -29
- package/dist/server/swagger/loader.js +38 -14
- package/dist/server/swagger/merge.js +28 -7
- package/dist/swagger.js +22 -4
- package/package.json +2 -2
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var multiple_association_exports = {};
|
|
19
|
+
__export(multiple_association_exports, {
|
|
20
|
+
appendCollectionIndexParams: () => appendCollectionIndexParams,
|
|
21
|
+
default: () => multiple_association_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(multiple_association_exports);
|
|
24
|
+
var import_collection = require("../collection");
|
|
25
|
+
var import__ = require("../index");
|
|
8
26
|
function appendCollectionIndexParams(apiDef) {
|
|
9
27
|
for (const action of Object.keys(apiDef)) {
|
|
10
28
|
const parameters = apiDef[action]["parameters"];
|
|
@@ -17,31 +35,31 @@ function appendCollectionIndexParams(apiDef) {
|
|
|
17
35
|
}
|
|
18
36
|
return apiDef;
|
|
19
37
|
}
|
|
20
|
-
var multiple_association_default = (collection
|
|
38
|
+
var multiple_association_default = (collection, relationField) => {
|
|
21
39
|
const options = {
|
|
22
|
-
collection
|
|
40
|
+
collection,
|
|
23
41
|
relationField
|
|
24
42
|
};
|
|
25
|
-
collection
|
|
43
|
+
const targetCollection = collection.db.getCollection(relationField.target);
|
|
26
44
|
const paths = {
|
|
27
|
-
[`/${collection
|
|
28
|
-
|
|
45
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:list`]: appendCollectionIndexParams(
|
|
46
|
+
(0, import_collection.ListActionTemplate)(options)
|
|
29
47
|
),
|
|
30
|
-
[`/${collection
|
|
31
|
-
|
|
48
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:get`]: appendCollectionIndexParams(
|
|
49
|
+
(0, import_collection.GetActionTemplate)(options)
|
|
32
50
|
),
|
|
33
|
-
[`/${collection
|
|
34
|
-
|
|
51
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:create`]: appendCollectionIndexParams(
|
|
52
|
+
(0, import_collection.CreateActionTemplate)(options)
|
|
35
53
|
),
|
|
36
|
-
[`/${collection
|
|
37
|
-
|
|
54
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:update`]: appendCollectionIndexParams(
|
|
55
|
+
(0, import_collection.UpdateActionTemplate)(options)
|
|
38
56
|
),
|
|
39
|
-
[`/${collection
|
|
40
|
-
|
|
57
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:destroy`]: appendCollectionIndexParams(
|
|
58
|
+
(0, import_collection.DestroyActionTemplate)(options)
|
|
41
59
|
),
|
|
42
|
-
[`/${collection
|
|
60
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:set`]: appendCollectionIndexParams({
|
|
43
61
|
post: {
|
|
44
|
-
tags: [`${collection
|
|
62
|
+
tags: [`${collection.name}.${relationField.name}`],
|
|
45
63
|
summary: "Set or reset associations",
|
|
46
64
|
parameters: [
|
|
47
65
|
{
|
|
@@ -58,9 +76,9 @@ var multiple_association_default = (collection$1, relationField) => {
|
|
|
58
76
|
}
|
|
59
77
|
}
|
|
60
78
|
}),
|
|
61
|
-
[`/${collection
|
|
79
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:remove`]: appendCollectionIndexParams({
|
|
62
80
|
post: {
|
|
63
|
-
tags: [`${collection
|
|
81
|
+
tags: [`${collection.name}.${relationField.name}`],
|
|
64
82
|
summary: "Detach record",
|
|
65
83
|
parameters: [
|
|
66
84
|
{
|
|
@@ -77,9 +95,9 @@ var multiple_association_default = (collection$1, relationField) => {
|
|
|
77
95
|
}
|
|
78
96
|
}
|
|
79
97
|
}),
|
|
80
|
-
[`/${collection
|
|
98
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:toggle`]: appendCollectionIndexParams({
|
|
81
99
|
post: {
|
|
82
|
-
tags: [`${collection
|
|
100
|
+
tags: [`${collection.name}.${relationField.name}`],
|
|
83
101
|
summary: "Attach or detach record",
|
|
84
102
|
parameters: [
|
|
85
103
|
{
|
|
@@ -94,13 +112,14 @@ var multiple_association_default = (collection$1, relationField) => {
|
|
|
94
112
|
}
|
|
95
113
|
})
|
|
96
114
|
};
|
|
97
|
-
if (
|
|
98
|
-
paths[`/${collection
|
|
99
|
-
|
|
115
|
+
if ((0, import__.hasSortField)(collection)) {
|
|
116
|
+
paths[`/${collection.name}/{collectionIndex}/${relationField.name}:move`] = appendCollectionIndexParams(
|
|
117
|
+
(0, import_collection.MoveActionTemplate)(options)
|
|
100
118
|
);
|
|
101
119
|
}
|
|
102
120
|
return paths;
|
|
103
121
|
};
|
|
104
|
-
|
|
105
|
-
exports
|
|
106
|
-
|
|
122
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
123
|
+
0 && (module.exports = {
|
|
124
|
+
appendCollectionIndexParams
|
|
125
|
+
});
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var single_association_exports = {};
|
|
19
|
+
__export(single_association_exports, {
|
|
20
|
+
default: () => single_association_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(single_association_exports);
|
|
23
|
+
var import_multiple_association = require("./multiple-association");
|
|
24
|
+
var import_collection = require("../collection");
|
|
6
25
|
function removeFilterByTkParams(apiDoc) {
|
|
7
26
|
for (const action of Object.values(apiDoc)) {
|
|
8
27
|
if (action.parameters) {
|
|
@@ -32,18 +51,18 @@ function filterSingleAssociationParams(apiDoc) {
|
|
|
32
51
|
}
|
|
33
52
|
return apiDoc;
|
|
34
53
|
}
|
|
35
|
-
var single_association_default = (collection
|
|
54
|
+
var single_association_default = (collection, relationField) => {
|
|
36
55
|
const options = {
|
|
37
|
-
collection
|
|
56
|
+
collection,
|
|
38
57
|
relationField
|
|
39
58
|
};
|
|
40
59
|
return {
|
|
41
|
-
[`/${collection
|
|
42
|
-
filterSingleAssociationParams(
|
|
60
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:get`]: removeFilterByTkParams(
|
|
61
|
+
filterSingleAssociationParams((0, import_multiple_association.appendCollectionIndexParams)((0, import_collection.GetActionTemplate)(options)))
|
|
43
62
|
),
|
|
44
|
-
[`/${collection
|
|
63
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:set`]: (0, import_multiple_association.appendCollectionIndexParams)({
|
|
45
64
|
post: {
|
|
46
|
-
tags: [`${collection
|
|
65
|
+
tags: [`${collection.name}.${relationField.name}`],
|
|
47
66
|
summary: "Associate a record",
|
|
48
67
|
parameters: [
|
|
49
68
|
{
|
|
@@ -62,9 +81,9 @@ var single_association_default = (collection$1, relationField) => {
|
|
|
62
81
|
}
|
|
63
82
|
}
|
|
64
83
|
}),
|
|
65
|
-
[`/${collection
|
|
84
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:remove`]: (0, import_multiple_association.appendCollectionIndexParams)({
|
|
66
85
|
post: {
|
|
67
|
-
tags: [`${collection
|
|
86
|
+
tags: [`${collection.name}.${relationField.name}`],
|
|
68
87
|
summary: "Disassociate the relationship record",
|
|
69
88
|
responses: {
|
|
70
89
|
"200": {
|
|
@@ -73,16 +92,14 @@ var single_association_default = (collection$1, relationField) => {
|
|
|
73
92
|
}
|
|
74
93
|
}
|
|
75
94
|
}),
|
|
76
|
-
[`/${collection
|
|
77
|
-
filterSingleAssociationParams(
|
|
95
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:update`]: removeFilterByTkParams(
|
|
96
|
+
filterSingleAssociationParams((0, import_multiple_association.appendCollectionIndexParams)((0, import_collection.UpdateActionTemplate)(options)))
|
|
78
97
|
),
|
|
79
|
-
[`/${collection
|
|
80
|
-
filterSingleAssociationParams(
|
|
98
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:create`]: removeFilterByTkParams(
|
|
99
|
+
filterSingleAssociationParams((0, import_multiple_association.appendCollectionIndexParams)((0, import_collection.CreateActionTemplate)(options)))
|
|
81
100
|
),
|
|
82
|
-
[`/${collection
|
|
83
|
-
filterSingleAssociationParams(
|
|
101
|
+
[`/${collection.name}/{collectionIndex}/${relationField.name}:destroy`]: removeFilterByTkParams(
|
|
102
|
+
filterSingleAssociationParams((0, import_multiple_association.appendCollectionIndexParams)((0, import_collection.DestroyActionTemplate)(options)))
|
|
84
103
|
)
|
|
85
104
|
};
|
|
86
105
|
};
|
|
87
|
-
|
|
88
|
-
module.exports = single_association_default;
|
|
@@ -1,9 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var collection_exports = {};
|
|
19
|
+
__export(collection_exports, {
|
|
20
|
+
CreateActionTemplate: () => CreateActionTemplate,
|
|
21
|
+
DestroyActionTemplate: () => DestroyActionTemplate,
|
|
22
|
+
GetActionTemplate: () => GetActionTemplate,
|
|
23
|
+
ListActionTemplate: () => ListActionTemplate,
|
|
24
|
+
MoveActionTemplate: () => MoveActionTemplate,
|
|
25
|
+
UpdateActionTemplate: () => UpdateActionTemplate,
|
|
26
|
+
default: () => collection_default,
|
|
27
|
+
relationTypeToString: () => relationTypeToString
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(collection_exports);
|
|
30
|
+
var import_index = require("./index");
|
|
7
31
|
function relationTypeToString(field) {
|
|
8
32
|
return {
|
|
9
33
|
belongsTo: "Many to one",
|
|
@@ -312,22 +336,27 @@ var collection_default = (collection) => {
|
|
|
312
336
|
const options = { collection };
|
|
313
337
|
const apiDoc = {
|
|
314
338
|
[`/${collection.name}:list`]: ListActionTemplate(options),
|
|
315
|
-
[`/${collection.name}:get`]: GetActionTemplate(options)
|
|
316
|
-
[`/${collection.name}:create`]: CreateActionTemplate(options),
|
|
317
|
-
[`/${collection.name}:update`]: UpdateActionTemplate(options),
|
|
318
|
-
[`/${collection.name}:destroy`]: DestroyActionTemplate(options)
|
|
339
|
+
[`/${collection.name}:get`]: GetActionTemplate(options)
|
|
319
340
|
};
|
|
320
|
-
if (
|
|
341
|
+
if (!(0, import_index.readOnlyCollection)(collection)) {
|
|
342
|
+
Object.assign(apiDoc, {
|
|
343
|
+
[`/${collection.name}:create`]: CreateActionTemplate(options),
|
|
344
|
+
[`/${collection.name}:update`]: UpdateActionTemplate(options),
|
|
345
|
+
[`/${collection.name}:destroy`]: DestroyActionTemplate(options)
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
if ((0, import_index.hasSortField)(collection)) {
|
|
321
349
|
apiDoc[`/${collection.name}:move`] = MoveActionTemplate(options);
|
|
322
350
|
}
|
|
323
351
|
return apiDoc;
|
|
324
352
|
};
|
|
325
|
-
|
|
326
|
-
exports
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
353
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
354
|
+
0 && (module.exports = {
|
|
355
|
+
CreateActionTemplate,
|
|
356
|
+
DestroyActionTemplate,
|
|
357
|
+
GetActionTemplate,
|
|
358
|
+
ListActionTemplate,
|
|
359
|
+
MoveActionTemplate,
|
|
360
|
+
UpdateActionTemplate,
|
|
361
|
+
relationTypeToString
|
|
362
|
+
});
|
|
@@ -2,3 +2,5 @@ import { Collection } from '@nocobase/database';
|
|
|
2
2
|
declare const _default: (collection: Collection, options: any) => any;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare function hasSortField(collection: Collection): boolean;
|
|
5
|
+
export declare function readOnlyCollection(collection: Collection): boolean;
|
|
6
|
+
export declare function isViewCollection(collection: Collection): boolean;
|
|
@@ -1,19 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var paths_exports = {};
|
|
29
|
+
__export(paths_exports, {
|
|
30
|
+
default: () => paths_default,
|
|
31
|
+
hasSortField: () => hasSortField,
|
|
32
|
+
isViewCollection: () => isViewCollection,
|
|
33
|
+
readOnlyCollection: () => readOnlyCollection
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(paths_exports);
|
|
36
|
+
var import_collection = __toESM(require("./collection"));
|
|
37
|
+
var import_associations = __toESM(require("./associations"));
|
|
13
38
|
var paths_default = (collection, options) => {
|
|
14
|
-
const paths =
|
|
15
|
-
if (options.withAssociation) {
|
|
16
|
-
Object.assign(paths,
|
|
39
|
+
const paths = (0, import_collection.default)(collection);
|
|
40
|
+
if (options.withAssociation && !isViewCollection(collection)) {
|
|
41
|
+
Object.assign(paths, (0, import_associations.default)(collection));
|
|
17
42
|
}
|
|
18
43
|
return paths;
|
|
19
44
|
};
|
|
@@ -25,6 +50,16 @@ function hasSortField(collection) {
|
|
|
25
50
|
}
|
|
26
51
|
return false;
|
|
27
52
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
53
|
+
function readOnlyCollection(collection) {
|
|
54
|
+
var _a;
|
|
55
|
+
return isViewCollection(collection) && ((_a = collection.options) == null ? void 0 : _a.writableView) == false;
|
|
56
|
+
}
|
|
57
|
+
function isViewCollection(collection) {
|
|
58
|
+
return collection.isView();
|
|
59
|
+
}
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
hasSortField,
|
|
63
|
+
isViewCollection,
|
|
64
|
+
readOnlyCollection
|
|
65
|
+
});
|
|
@@ -1,26 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var tags_exports = {};
|
|
19
|
+
__export(tags_exports, {
|
|
20
|
+
default: () => tags_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(tags_exports);
|
|
23
|
+
var import_associations = require("../paths/associations");
|
|
24
|
+
var import_collection = require("../paths/collection");
|
|
25
|
+
var tags_default = (collection, options) => {
|
|
7
26
|
var _a, _b, _c, _d;
|
|
8
|
-
const associations
|
|
27
|
+
const associations = (0, import_associations.associationFields)(collection);
|
|
9
28
|
const tags = [
|
|
10
29
|
{
|
|
11
|
-
name: collection
|
|
12
|
-
description: ((_a = collection
|
|
30
|
+
name: collection.name,
|
|
31
|
+
description: ((_a = collection.options) == null ? void 0 : _a.title) || collection.name
|
|
13
32
|
}
|
|
14
33
|
];
|
|
15
34
|
if (options.withAssociation) {
|
|
16
|
-
for (const field of associations
|
|
35
|
+
for (const field of associations) {
|
|
17
36
|
tags.push({
|
|
18
|
-
name: `${collection
|
|
19
|
-
description: `${
|
|
37
|
+
name: `${collection.name}.${field.name}`,
|
|
38
|
+
description: `${(0, import_collection.relationTypeToString)(field)} relationship, ${((_b = collection.options) == null ? void 0 : _b.title) || collection.name}/${((_d = (_c = field.options) == null ? void 0 : _c.uiSchema) == null ? void 0 : _d.title) || field.name}`
|
|
20
39
|
});
|
|
21
40
|
}
|
|
22
41
|
}
|
|
23
42
|
return tags;
|
|
24
43
|
};
|
|
25
|
-
|
|
26
|
-
module.exports = tags_default;
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var constants_exports = {};
|
|
19
|
+
__export(constants_exports, {
|
|
20
|
+
SchemaTypeMapping: () => SchemaTypeMapping
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(constants_exports);
|
|
3
23
|
const SchemaTypeMapping = {
|
|
4
24
|
uid: "string",
|
|
5
25
|
json: "object",
|
|
@@ -10,5 +30,7 @@ const SchemaTypeMapping = {
|
|
|
10
30
|
context: "string",
|
|
11
31
|
set: "array"
|
|
12
32
|
};
|
|
13
|
-
|
|
14
|
-
exports
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
SchemaTypeMapping
|
|
36
|
+
});
|
|
@@ -1,5 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var helpers_exports = {};
|
|
19
|
+
__export(helpers_exports, {
|
|
20
|
+
createDefaultActionSwagger: () => createDefaultActionSwagger,
|
|
21
|
+
getInterfaceCollection: () => getInterfaceCollection
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(helpers_exports);
|
|
3
24
|
const createDefaultActionSwagger = ({ collection }) => {
|
|
4
25
|
const responses = {
|
|
5
26
|
default: {
|
|
@@ -106,6 +127,8 @@ const getInterfaceCollection = (options) => {
|
|
|
106
127
|
};
|
|
107
128
|
return single;
|
|
108
129
|
};
|
|
109
|
-
|
|
110
|
-
exports
|
|
111
|
-
|
|
130
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
131
|
+
0 && (module.exports = {
|
|
132
|
+
createDefaultActionSwagger,
|
|
133
|
+
getInterfaceCollection
|
|
134
|
+
});
|