@dani-builder/strapi-plugin-builder 0.2.0 → 0.4.0
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/AGENTS.md +18 -21
- package/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/server/src/bootstrap.d.ts +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/bootstrap.js +12 -1
- package/dist/server/src/bootstrap.js.map +1 -1
- package/dist/server/src/bootstrap.test.d.ts +2 -0
- package/dist/server/src/bootstrap.test.d.ts.map +1 -0
- package/dist/server/src/bootstrap.test.js +60 -0
- package/dist/server/src/bootstrap.test.js.map +1 -0
- package/dist/server/src/components/blocks/cta.json +13 -5
- package/dist/server/src/components/blocks/faq.json +1 -1
- package/dist/server/src/components/blocks/features.json +10 -5
- package/dist/server/src/components/blocks/hero.json +15 -6
- package/dist/server/src/components/blocks/highlights.json +9 -5
- package/dist/server/src/components/blocks/inquiry-form.json +3 -0
- package/dist/server/src/components/blocks/logo-cloud.json +6 -1
- package/dist/server/src/components/blocks/stats.json +9 -5
- package/dist/server/src/components/blocks/testimonials.json +10 -5
- package/dist/server/src/components/shared/bento-item.json +4 -4
- package/dist/server/src/components/shared/highlight-item.json +5 -5
- package/dist/server/src/components/shared/image.json +24 -0
- package/dist/server/src/components/shared/slider-item.json +5 -5
- package/dist/server/src/config/index.d.ts +15 -0
- package/dist/server/src/config/index.d.ts.map +1 -0
- package/dist/server/src/config/index.js +164 -0
- package/dist/server/src/config/index.js.map +1 -0
- package/dist/server/src/config/index.test.d.ts +2 -0
- package/dist/server/src/config/index.test.d.ts.map +1 -0
- package/dist/server/src/config/index.test.js +87 -0
- package/dist/server/src/config/index.test.js.map +1 -0
- package/dist/server/src/content-types/article/index.d.ts +146 -0
- package/dist/server/src/content-types/article/index.d.ts.map +1 -0
- package/dist/server/src/content-types/article/index.js +8 -0
- package/dist/server/src/content-types/article/index.js.map +1 -0
- package/dist/server/src/content-types/article/schema.json +104 -0
- package/dist/server/src/content-types/author/index.d.ts +56 -0
- package/dist/server/src/content-types/author/index.d.ts.map +1 -0
- package/dist/server/src/content-types/author/index.js +8 -0
- package/dist/server/src/content-types/author/index.js.map +1 -0
- package/dist/server/src/content-types/author/schema.json +48 -0
- package/dist/server/src/content-types/category/index.d.ts +71 -0
- package/dist/server/src/content-types/category/index.d.ts.map +1 -0
- package/dist/server/src/content-types/category/index.js +8 -0
- package/dist/server/src/content-types/category/index.js.map +1 -0
- package/dist/server/src/content-types/category/schema.json +45 -0
- package/dist/server/src/content-types/faq/index.d.ts +60 -0
- package/dist/server/src/content-types/faq/index.d.ts.map +1 -0
- package/dist/server/src/content-types/faq/index.js +8 -0
- package/dist/server/src/content-types/faq/index.js.map +1 -0
- package/dist/server/src/content-types/faq/schema.json +38 -0
- package/dist/server/src/content-types/global/index.d.ts +91 -0
- package/dist/server/src/content-types/global/index.d.ts.map +1 -0
- package/dist/server/src/content-types/global/index.js +8 -0
- package/dist/server/src/content-types/global/index.js.map +1 -0
- package/dist/server/src/content-types/global/schema.json +66 -0
- package/dist/server/src/content-types/index.d.ts +795 -0
- package/dist/server/src/content-types/index.d.ts.map +1 -0
- package/dist/server/src/content-types/index.js +30 -0
- package/dist/server/src/content-types/index.js.map +1 -0
- package/dist/server/src/content-types/inquiry/index.d.ts +48 -0
- package/dist/server/src/content-types/inquiry/index.d.ts.map +1 -0
- package/dist/server/src/content-types/inquiry/index.js +8 -0
- package/dist/server/src/content-types/inquiry/index.js.map +1 -0
- package/dist/server/src/content-types/inquiry/schema.json +40 -0
- package/dist/server/src/content-types/navigation/index.d.ts +80 -0
- package/dist/server/src/content-types/navigation/index.d.ts.map +1 -0
- package/dist/server/src/content-types/navigation/index.js +8 -0
- package/dist/server/src/content-types/navigation/index.js.map +1 -0
- package/dist/server/src/content-types/navigation/schema.json +54 -0
- package/dist/server/src/content-types/page/index.d.ts +78 -0
- package/dist/server/src/content-types/page/index.d.ts.map +1 -0
- package/dist/server/src/content-types/page/index.js +8 -0
- package/dist/server/src/content-types/page/index.js.map +1 -0
- package/dist/server/src/content-types/page/schema.json +64 -0
- package/dist/server/src/content-types/series/index.d.ts +68 -0
- package/dist/server/src/content-types/series/index.d.ts.map +1 -0
- package/dist/server/src/content-types/series/index.js +8 -0
- package/dist/server/src/content-types/series/index.js.map +1 -0
- package/dist/server/src/content-types/series/schema.json +46 -0
- package/dist/server/src/content-types/site-setting/index.d.ts +47 -0
- package/dist/server/src/content-types/site-setting/index.d.ts.map +1 -0
- package/dist/server/src/content-types/site-setting/index.js +8 -0
- package/dist/server/src/content-types/site-setting/index.js.map +1 -0
- package/dist/server/src/content-types/site-setting/schema.json +39 -0
- package/dist/server/src/content-types/tag/index.d.ts +68 -0
- package/dist/server/src/content-types/tag/index.d.ts.map +1 -0
- package/dist/server/src/content-types/tag/index.js +8 -0
- package/dist/server/src/content-types/tag/index.js.map +1 -0
- package/dist/server/src/content-types/tag/schema.json +46 -0
- package/dist/server/src/controllers/global.d.ts +1 -10
- package/dist/server/src/controllers/global.d.ts.map +1 -1
- package/dist/server/src/controllers/global.js +11 -4
- package/dist/server/src/controllers/global.js.map +1 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/index.js +10 -0
- package/dist/server/src/controllers/index.js.map +1 -1
- package/dist/server/src/controllers/page.d.ts +11 -14
- package/dist/server/src/controllers/page.d.ts.map +1 -1
- package/dist/server/src/controllers/page.js +78 -9
- package/dist/server/src/controllers/page.js.map +1 -1
- package/dist/server/src/index.d.ts +1 -0
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/index.js +6 -0
- package/dist/server/src/index.js.map +1 -1
- package/dist/server/src/policies/index.d.ts +3 -0
- package/dist/server/src/policies/index.d.ts.map +1 -0
- package/dist/server/src/policies/index.js +13 -0
- package/dist/server/src/policies/index.js.map +1 -0
- package/dist/server/src/policies/rate-limit.d.ts +15 -0
- package/dist/server/src/policies/rate-limit.d.ts.map +1 -0
- package/dist/server/src/policies/rate-limit.js +39 -0
- package/dist/server/src/policies/rate-limit.js.map +1 -0
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/register.js +55 -2
- package/dist/server/src/register.js.map +1 -1
- package/dist/server/src/routes/content-api.d.ts +10 -13
- package/dist/server/src/routes/content-api.d.ts.map +1 -1
- package/dist/server/src/routes/content-api.js +34 -30
- package/dist/server/src/routes/content-api.js.map +1 -1
- package/dist/server/src/routes/index.d.ts +10 -15
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/routes/index.js +2 -1
- package/dist/server/src/routes/index.js.map +1 -1
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/index.js +12 -0
- package/dist/server/src/services/index.js.map +1 -1
- package/dist/server/src/services/populate.d.ts +1 -1
- package/dist/server/src/services/populate.d.ts.map +1 -1
- package/dist/server/src/services/populate.js +24 -11
- package/dist/server/src/services/populate.js.map +1 -1
- package/dist/server/src/utils/query.d.ts +11 -0
- package/dist/server/src/utils/query.d.ts.map +1 -0
- package/dist/server/src/utils/query.js +112 -0
- package/dist/server/src/utils/query.js.map +1 -0
- package/package.json +26 -15
- package/bin/sync.js +0 -320
- package/schemas/api/article/content-types/article/schema.json +0 -102
- package/schemas/api/author/content-types/author/schema.json +0 -44
- package/schemas/api/category/content-types/category/schema.json +0 -43
- package/schemas/api/faq/content-types/faq/schema.json +0 -36
- package/schemas/api/global/content-types/global/schema.json +0 -64
- package/schemas/api/inquiry/content-types/inquiry/schema.json +0 -31
- package/schemas/api/navigation/content-types/navigation/schema.json +0 -52
- package/schemas/api/page/content-types/page/schema.json +0 -62
- package/schemas/api/series/content-types/series/schema.json +0 -44
- package/schemas/api/site-setting/content-types/site-setting/schema.json +0 -35
- package/schemas/api/tag/content-types/tag/schema.json +0 -44
- package/schemas/manifest.json +0 -16
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const bento_grid_json_1 = __importDefault(require("../components/blocks/bento-grid.json"));
|
|
7
|
+
const content_json_1 = __importDefault(require("../components/blocks/content.json"));
|
|
8
|
+
const cta_json_1 = __importDefault(require("../components/blocks/cta.json"));
|
|
9
|
+
const faq_json_1 = __importDefault(require("../components/blocks/faq.json"));
|
|
10
|
+
const features_json_1 = __importDefault(require("../components/blocks/features.json"));
|
|
11
|
+
const hero_json_1 = __importDefault(require("../components/blocks/hero.json"));
|
|
12
|
+
const highlights_json_1 = __importDefault(require("../components/blocks/highlights.json"));
|
|
13
|
+
const inquiry_form_json_1 = __importDefault(require("../components/blocks/inquiry-form.json"));
|
|
14
|
+
const logo_cloud_json_1 = __importDefault(require("../components/blocks/logo-cloud.json"));
|
|
15
|
+
const pricing_json_1 = __importDefault(require("../components/blocks/pricing.json"));
|
|
16
|
+
const slider_json_1 = __importDefault(require("../components/blocks/slider.json"));
|
|
17
|
+
const stats_json_1 = __importDefault(require("../components/blocks/stats.json"));
|
|
18
|
+
const team_json_1 = __importDefault(require("../components/blocks/team.json"));
|
|
19
|
+
const testimonials_json_1 = __importDefault(require("../components/blocks/testimonials.json"));
|
|
20
|
+
const footer_json_1 = __importDefault(require("../components/elements/footer.json"));
|
|
21
|
+
const section_json_1 = __importDefault(require("../components/elements/section.json"));
|
|
22
|
+
const analytics_setting_json_1 = __importDefault(require("../components/shared/analytics-setting.json"));
|
|
23
|
+
const bento_item_json_1 = __importDefault(require("../components/shared/bento-item.json"));
|
|
24
|
+
const brand_colors_json_1 = __importDefault(require("../components/shared/brand-colors.json"));
|
|
25
|
+
const chatbot_setting_json_1 = __importDefault(require("../components/shared/chatbot-setting.json"));
|
|
26
|
+
const feature_item_json_1 = __importDefault(require("../components/shared/feature-item.json"));
|
|
27
|
+
const highlight_item_json_1 = __importDefault(require("../components/shared/highlight-item.json"));
|
|
28
|
+
const image_json_1 = __importDefault(require("../components/shared/image.json"));
|
|
29
|
+
const link_json_1 = __importDefault(require("../components/shared/link.json"));
|
|
30
|
+
const logo_item_json_1 = __importDefault(require("../components/shared/logo-item.json"));
|
|
31
|
+
const navigation_group_json_1 = __importDefault(require("../components/shared/navigation-group.json"));
|
|
32
|
+
const pricing_tier_json_1 = __importDefault(require("../components/shared/pricing-tier.json"));
|
|
33
|
+
const seo_json_1 = __importDefault(require("../components/shared/seo.json"));
|
|
34
|
+
const site_verification_json_1 = __importDefault(require("../components/shared/site-verification.json"));
|
|
35
|
+
const slider_item_json_1 = __importDefault(require("../components/shared/slider-item.json"));
|
|
36
|
+
const stat_item_json_1 = __importDefault(require("../components/shared/stat-item.json"));
|
|
37
|
+
const team_member_json_1 = __importDefault(require("../components/shared/team-member.json"));
|
|
38
|
+
const testimonial_item_json_1 = __importDefault(require("../components/shared/testimonial-item.json"));
|
|
39
|
+
const attributeTypes = new Set([
|
|
40
|
+
'biginteger',
|
|
41
|
+
'boolean',
|
|
42
|
+
'component',
|
|
43
|
+
'date',
|
|
44
|
+
'datetime',
|
|
45
|
+
'decimal',
|
|
46
|
+
'email',
|
|
47
|
+
'enumeration',
|
|
48
|
+
'float',
|
|
49
|
+
'integer',
|
|
50
|
+
'json',
|
|
51
|
+
'media',
|
|
52
|
+
'password',
|
|
53
|
+
'relation',
|
|
54
|
+
'richtext',
|
|
55
|
+
'string',
|
|
56
|
+
'text',
|
|
57
|
+
'time',
|
|
58
|
+
'timestamp',
|
|
59
|
+
'uid',
|
|
60
|
+
]);
|
|
61
|
+
const componentSchemas = {
|
|
62
|
+
'blocks.bento-grid': bento_grid_json_1.default,
|
|
63
|
+
'blocks.content': content_json_1.default,
|
|
64
|
+
'blocks.cta': cta_json_1.default,
|
|
65
|
+
'blocks.faq': faq_json_1.default,
|
|
66
|
+
'blocks.features': features_json_1.default,
|
|
67
|
+
'blocks.hero': hero_json_1.default,
|
|
68
|
+
'blocks.highlights': highlights_json_1.default,
|
|
69
|
+
'blocks.inquiry-form': inquiry_form_json_1.default,
|
|
70
|
+
'blocks.logo-cloud': logo_cloud_json_1.default,
|
|
71
|
+
'blocks.pricing': pricing_json_1.default,
|
|
72
|
+
'blocks.slider': slider_json_1.default,
|
|
73
|
+
'blocks.stats': stats_json_1.default,
|
|
74
|
+
'blocks.team': team_json_1.default,
|
|
75
|
+
'blocks.testimonials': testimonials_json_1.default,
|
|
76
|
+
'elements.footer': footer_json_1.default,
|
|
77
|
+
'elements.section': section_json_1.default,
|
|
78
|
+
'shared.analytics-setting': analytics_setting_json_1.default,
|
|
79
|
+
'shared.bento-item': bento_item_json_1.default,
|
|
80
|
+
'shared.brand-colors': brand_colors_json_1.default,
|
|
81
|
+
'shared.chatbot-setting': chatbot_setting_json_1.default,
|
|
82
|
+
'shared.feature-item': feature_item_json_1.default,
|
|
83
|
+
'shared.highlight-item': highlight_item_json_1.default,
|
|
84
|
+
'shared.image': image_json_1.default,
|
|
85
|
+
'shared.link': link_json_1.default,
|
|
86
|
+
'shared.logo-item': logo_item_json_1.default,
|
|
87
|
+
'shared.navigation-group': navigation_group_json_1.default,
|
|
88
|
+
'shared.pricing-tier': pricing_tier_json_1.default,
|
|
89
|
+
'shared.seo': seo_json_1.default,
|
|
90
|
+
'shared.site-verification': site_verification_json_1.default,
|
|
91
|
+
'shared.slider-item': slider_item_json_1.default,
|
|
92
|
+
'shared.stat-item': stat_item_json_1.default,
|
|
93
|
+
'shared.team-member': team_member_json_1.default,
|
|
94
|
+
'shared.testimonial-item': testimonial_item_json_1.default,
|
|
95
|
+
};
|
|
96
|
+
function isObject(value) {
|
|
97
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
98
|
+
}
|
|
99
|
+
function requireObject(value, path) {
|
|
100
|
+
if (!isObject(value)) {
|
|
101
|
+
throw new Error(`[builder] ${path} must be an object`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function rejectUnknownKeys(value, allowedKeys, path) {
|
|
105
|
+
const unknownKey = Object.keys(value).find((key) => !allowedKeys.includes(key));
|
|
106
|
+
if (unknownKey) {
|
|
107
|
+
throw new Error(`[builder] ${path} has unknown key: "${unknownKey}"`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const config = {
|
|
111
|
+
default() {
|
|
112
|
+
return {
|
|
113
|
+
blocks: {
|
|
114
|
+
extra: {},
|
|
115
|
+
includeInGlobal: true,
|
|
116
|
+
},
|
|
117
|
+
components: {},
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
validator(value) {
|
|
121
|
+
requireObject(value, 'config');
|
|
122
|
+
rejectUnknownKeys(value, ['blocks', 'components'], 'config');
|
|
123
|
+
requireObject(value.blocks, 'config.blocks');
|
|
124
|
+
rejectUnknownKeys(value.blocks, ['extra', 'includeInGlobal'], 'config.blocks');
|
|
125
|
+
requireObject(value.blocks.extra, 'config.blocks.extra');
|
|
126
|
+
if (typeof value.blocks.includeInGlobal !== 'boolean') {
|
|
127
|
+
throw new Error('[builder] config.blocks.includeInGlobal must be a boolean');
|
|
128
|
+
}
|
|
129
|
+
for (const [uid, populate] of Object.entries(value.blocks.extra)) {
|
|
130
|
+
if (!/^[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*$/.test(uid)) {
|
|
131
|
+
throw new Error(`[builder] config.blocks.extra has an invalid component UID: "${uid}"`);
|
|
132
|
+
}
|
|
133
|
+
requireObject(populate, `config.blocks.extra["${uid}"]`);
|
|
134
|
+
rejectUnknownKeys(populate, ['populate'], `config.blocks.extra["${uid}"]`);
|
|
135
|
+
requireObject(populate.populate, `config.blocks.extra["${uid}"].populate`);
|
|
136
|
+
}
|
|
137
|
+
requireObject(value.components, 'config.components');
|
|
138
|
+
for (const [uid, extension] of Object.entries(value.components)) {
|
|
139
|
+
const schema = componentSchemas[uid];
|
|
140
|
+
if (!schema) {
|
|
141
|
+
throw new Error(`[builder] config.components references unknown component UID: "${uid}"`);
|
|
142
|
+
}
|
|
143
|
+
requireObject(extension, `config.components["${uid}"]`);
|
|
144
|
+
rejectUnknownKeys(extension, ['attributes'], `config.components["${uid}"]`);
|
|
145
|
+
requireObject(extension.attributes, `config.components["${uid}"].attributes`);
|
|
146
|
+
for (const [attributeName, attribute] of Object.entries(extension.attributes)) {
|
|
147
|
+
if (attributeName in schema.attributes) {
|
|
148
|
+
throw new Error(`[builder] config.components["${uid}"].attributes cannot overwrite existing attribute: "${attributeName}"`);
|
|
149
|
+
}
|
|
150
|
+
requireObject(attribute, `config.components["${uid}"].attributes["${attributeName}"]`);
|
|
151
|
+
if (typeof attribute.type !== 'string' ||
|
|
152
|
+
!attributeTypes.has(attribute.type)) {
|
|
153
|
+
throw new Error(`[builder] config.components["${uid}"].attributes["${attributeName}"].type is unsupported: "${String(attribute.type)}"`);
|
|
154
|
+
}
|
|
155
|
+
if (attribute.required === true || attribute.unique === true) {
|
|
156
|
+
throw new Error(`[builder] config.components["${uid}"].attributes["${attributeName}"] cannot be required or unique: ` +
|
|
157
|
+
'documents stored before this attribute existed would fail validation on their next publish');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
exports.default = config;
|
|
164
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/src/config/index.ts"],"names":[],"mappings":";;;;;AAAA,2FAA6D;AAC7D,qFAAwD;AACxD,6EAAgD;AAChD,6EAAgD;AAChD,uFAA0D;AAC1D,+EAAkD;AAClD,2FAA8D;AAC9D,+FAAiE;AACjE,2FAA6D;AAC7D,qFAAwD;AACxD,mFAAsD;AACtD,iFAAoD;AACpD,+EAAkD;AAClD,+FAAkE;AAClE,qFAAwD;AACxD,uFAA0D;AAC1D,yGAA2E;AAC3E,2FAA6D;AAC7D,+FAAiE;AACjE,qGAAuE;AACvE,+FAAiE;AACjE,mGAAqE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C;YACxD,iBAAiB,CACf,SAAS,EACT,CAAC,YAAY,CAAC,EACd,sBAAsB,GAAG,IAAI,CAC9B,CAAC;YACF,aAAa,CACX,SAAS,CAAC,UAAU,EACpB,sBAAsB,GAAG,eAAe,CACzC,CAAC;YAEF,KAAK,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CACrD,SAAS,CAAC,UAAU,CACrB,EAAE,CAAC;gBACF,IAAI,aAAa,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;oBACvC,MAAM,IAAI,KAAK,CACb,gCAAgC,GAAG,uDAAuD,aAAa,GAAG,CAC3G,CAAC;gBACJ,CAAC;gBACD,aAAa,CACX,SAAS,EACT,sBAAsB,GAAG,kBAAkB,aAAa,IAAI,CAC7D,CAAC;gBACF,IACE,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ;oBAClC,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,EACnC,CAAC;oBACD,MAAM,IAAI,KAAK,CACb,gCAAgC,GAAG,kBAAkB,aAAa,4BAA4B,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CACxH,CAAC;gBACJ,CAAC;gBACD,IAAI,SAAS,CAAC,QAAQ,KAAK,IAAI,IAAI,SAAS,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;oBAC7D,MAAM,IAAI,KAAK,CACb,gCAAgC,GAAG,kBAAkB,aAAa,mCAAmC;wBACnG,4FAA4F,CAC/F,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../server/src/config/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const vitest_1 = require("vitest");
|
|
7
|
+
const index_1 = __importDefault(require("./index"));
|
|
8
|
+
function mergedConfig(value) {
|
|
9
|
+
const defaults = index_1.default.default();
|
|
10
|
+
return {
|
|
11
|
+
blocks: {
|
|
12
|
+
...defaults.blocks,
|
|
13
|
+
...value.blocks,
|
|
14
|
+
},
|
|
15
|
+
components: value.components ?? defaults.components,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
(0, vitest_1.describe)('builder config', () => {
|
|
19
|
+
(0, vitest_1.it)('provides empty additive extension defaults', () => {
|
|
20
|
+
(0, vitest_1.expect)(index_1.default.default()).toEqual({
|
|
21
|
+
blocks: { extra: {}, includeInGlobal: true },
|
|
22
|
+
components: {},
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
(0, vitest_1.it)('accepts a blocks-only partial config after Strapi default merging', () => {
|
|
26
|
+
const value = mergedConfig({
|
|
27
|
+
blocks: {
|
|
28
|
+
extra: { 'custom.dynamic-hero': { populate: { section: true } } },
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
(0, vitest_1.expect)(() => index_1.default.validator(value)).not.toThrow();
|
|
32
|
+
(0, vitest_1.expect)(value.blocks.includeInGlobal).toBe(true);
|
|
33
|
+
});
|
|
34
|
+
(0, vitest_1.it)('accepts a components-only partial config after Strapi default merging', () => {
|
|
35
|
+
(0, vitest_1.expect)(() => index_1.default.validator(mergedConfig({
|
|
36
|
+
components: {
|
|
37
|
+
'blocks.hero': { attributes: { badgeText: { type: 'string' } } },
|
|
38
|
+
},
|
|
39
|
+
}))).not.toThrow();
|
|
40
|
+
});
|
|
41
|
+
(0, vitest_1.it)('rejects overwriting an existing component attribute', () => {
|
|
42
|
+
(0, vitest_1.expect)(() => index_1.default.validator(mergedConfig({
|
|
43
|
+
components: {
|
|
44
|
+
'blocks.hero': { attributes: { variant: { type: 'string' } } },
|
|
45
|
+
},
|
|
46
|
+
}))).toThrow('cannot overwrite existing attribute: "variant"');
|
|
47
|
+
});
|
|
48
|
+
(0, vitest_1.it)('rejects deleting a component attribute', () => {
|
|
49
|
+
(0, vitest_1.expect)(() => index_1.default.validator(mergedConfig({
|
|
50
|
+
components: { 'blocks.hero': { attributes: { badgeText: null } } },
|
|
51
|
+
}))).toThrow('attributes["badgeText"] must be an object');
|
|
52
|
+
});
|
|
53
|
+
(0, vitest_1.it)('rejects an unknown component UID', () => {
|
|
54
|
+
(0, vitest_1.expect)(() => index_1.default.validator(mergedConfig({
|
|
55
|
+
components: {
|
|
56
|
+
'blocks.unknown': { attributes: { badgeText: { type: 'string' } } },
|
|
57
|
+
},
|
|
58
|
+
}))).toThrow('references unknown component UID: "blocks.unknown"');
|
|
59
|
+
});
|
|
60
|
+
vitest_1.it.each([
|
|
61
|
+
[{ block: {}, blocks: index_1.default.default().blocks, components: {} }, 'config'],
|
|
62
|
+
[
|
|
63
|
+
{
|
|
64
|
+
blocks: {
|
|
65
|
+
...index_1.default.default().blocks,
|
|
66
|
+
includeInGlobals: false,
|
|
67
|
+
},
|
|
68
|
+
components: {},
|
|
69
|
+
},
|
|
70
|
+
'config.blocks',
|
|
71
|
+
],
|
|
72
|
+
])('rejects unknown config keys', (value, path) => {
|
|
73
|
+
(0, vitest_1.expect)(() => index_1.default.validator(value)).toThrow(`${path} has unknown key`);
|
|
74
|
+
});
|
|
75
|
+
vitest_1.it.each([
|
|
76
|
+
[{ type: 'not-a-strapi-type' }, 'type is unsupported'],
|
|
77
|
+
[{ type: 'string', required: true }, 'cannot be required or unique'],
|
|
78
|
+
[{ type: 'string', unique: true }, 'cannot be required or unique'],
|
|
79
|
+
])('rejects unsafe additive attributes', (attribute, message) => {
|
|
80
|
+
(0, vitest_1.expect)(() => index_1.default.validator(mergedConfig({
|
|
81
|
+
components: {
|
|
82
|
+
'blocks.hero': { attributes: { badgeText: attribute } },
|
|
83
|
+
},
|
|
84
|
+
}))).toThrow(message);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../server/src/config/index.test.ts"],"names":[],"mappings":";;;;;AAAA,mCAA8C;AAE9C,oDAA6B;AAE7B,SAAS,YAAY,CAAC,KAA8B;IAClD,MAAM,QAAQ,GAAG,eAAM,CAAC,OAAO,EAAE,CAAC;IAClC,OAAO;QACL,MAAM,EAAE;YACN,GAAG,QAAQ,CAAC,MAAM;YAClB,GAAI,KAAK,CAAC,MAA6B;SACxC;QACD,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU;KACpD,CAAC;AACJ,CAAC;AAED,IAAA,iBAAQ,EAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAA,WAAE,EAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,IAAA,eAAM,EAAC,eAAM,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC;YAC/B,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;YAC5C,UAAU,EAAE,EAAE;SACf,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,KAAK,GAAG,YAAY,CAAC;YACzB,MAAM,EAAE;gBACN,KAAK,EAAE,EAAE,qBAAqB,EAAE,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;aAClE;SACF,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,GAAG,EAAE,CAAC,eAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACpD,IAAA,eAAM,EAAC,KAAK,CAAC,MAAM,CAAC,eAAe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AO,CAAC,OAAO,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
schema: {
|
|
3
|
+
kind: string;
|
|
4
|
+
collectionName: string;
|
|
5
|
+
info: {
|
|
6
|
+
singularName: string;
|
|
7
|
+
pluralName: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
options: {
|
|
12
|
+
draftAndPublish: boolean;
|
|
13
|
+
};
|
|
14
|
+
pluginOptions: {
|
|
15
|
+
i18n: {
|
|
16
|
+
localized: boolean;
|
|
17
|
+
};
|
|
18
|
+
"content-manager": {
|
|
19
|
+
visible: boolean;
|
|
20
|
+
};
|
|
21
|
+
"content-type-builder": {
|
|
22
|
+
visible: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
attributes: {
|
|
26
|
+
title: {
|
|
27
|
+
type: string;
|
|
28
|
+
required: boolean;
|
|
29
|
+
pluginOptions: {
|
|
30
|
+
i18n: {
|
|
31
|
+
localized: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
slug: {
|
|
36
|
+
type: string;
|
|
37
|
+
targetField: string;
|
|
38
|
+
required: boolean;
|
|
39
|
+
pluginOptions: {
|
|
40
|
+
i18n: {
|
|
41
|
+
localized: boolean;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
body: {
|
|
46
|
+
type: string;
|
|
47
|
+
required: boolean;
|
|
48
|
+
pluginOptions: {
|
|
49
|
+
i18n: {
|
|
50
|
+
localized: boolean;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
summary: {
|
|
55
|
+
type: string;
|
|
56
|
+
pluginOptions: {
|
|
57
|
+
i18n: {
|
|
58
|
+
localized: boolean;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
excerpt: {
|
|
63
|
+
type: string;
|
|
64
|
+
pluginOptions: {
|
|
65
|
+
i18n: {
|
|
66
|
+
localized: boolean;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
cover: {
|
|
71
|
+
type: string;
|
|
72
|
+
multiple: boolean;
|
|
73
|
+
allowedTypes: string[];
|
|
74
|
+
pluginOptions: {
|
|
75
|
+
i18n: {
|
|
76
|
+
localized: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
gallery: {
|
|
81
|
+
type: string;
|
|
82
|
+
multiple: boolean;
|
|
83
|
+
allowedTypes: string[];
|
|
84
|
+
pluginOptions: {
|
|
85
|
+
i18n: {
|
|
86
|
+
localized: boolean;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
reading_time: {
|
|
91
|
+
type: string;
|
|
92
|
+
min: number;
|
|
93
|
+
default: number;
|
|
94
|
+
};
|
|
95
|
+
firstPublishedAt: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
seo: {
|
|
99
|
+
type: string;
|
|
100
|
+
component: string;
|
|
101
|
+
repeatable: boolean;
|
|
102
|
+
pluginOptions: {
|
|
103
|
+
i18n: {
|
|
104
|
+
localized: boolean;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
categories: {
|
|
109
|
+
type: string;
|
|
110
|
+
relation: string;
|
|
111
|
+
target: string;
|
|
112
|
+
inversedBy: string;
|
|
113
|
+
};
|
|
114
|
+
tags: {
|
|
115
|
+
type: string;
|
|
116
|
+
relation: string;
|
|
117
|
+
target: string;
|
|
118
|
+
inversedBy: string;
|
|
119
|
+
};
|
|
120
|
+
author: {
|
|
121
|
+
type: string;
|
|
122
|
+
relation: string;
|
|
123
|
+
target: string;
|
|
124
|
+
inversedBy: string;
|
|
125
|
+
};
|
|
126
|
+
series: {
|
|
127
|
+
type: string;
|
|
128
|
+
relation: string;
|
|
129
|
+
target: string;
|
|
130
|
+
inversedBy: string;
|
|
131
|
+
};
|
|
132
|
+
series_order: {
|
|
133
|
+
type: string;
|
|
134
|
+
min: number;
|
|
135
|
+
default: number;
|
|
136
|
+
};
|
|
137
|
+
related_posts: {
|
|
138
|
+
type: string;
|
|
139
|
+
relation: string;
|
|
140
|
+
target: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
export default _default;
|
|
146
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/content-types/article/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAA0B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const schema_json_1 = __importDefault(require("./schema.json"));
|
|
7
|
+
exports.default = { schema: schema_json_1.default };
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/src/content-types/article/index.ts"],"names":[],"mappings":";;;;;AAAA,gEAAmC;AAEnC,kBAAe,EAAE,MAAM,EAAN,qBAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "collectionType",
|
|
3
|
+
"collectionName": "articles",
|
|
4
|
+
"info": {
|
|
5
|
+
"singularName": "article",
|
|
6
|
+
"pluralName": "articles",
|
|
7
|
+
"displayName": "Article",
|
|
8
|
+
"description": "Blog/news post with rich text body and relations"
|
|
9
|
+
},
|
|
10
|
+
"options": {
|
|
11
|
+
"draftAndPublish": true
|
|
12
|
+
},
|
|
13
|
+
"pluginOptions": {
|
|
14
|
+
"i18n": { "localized": true },
|
|
15
|
+
"content-manager": { "visible": true },
|
|
16
|
+
"content-type-builder": { "visible": true }
|
|
17
|
+
},
|
|
18
|
+
"attributes": {
|
|
19
|
+
"title": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"required": true,
|
|
22
|
+
"pluginOptions": { "i18n": { "localized": true } }
|
|
23
|
+
},
|
|
24
|
+
"slug": {
|
|
25
|
+
"type": "uid",
|
|
26
|
+
"targetField": "title",
|
|
27
|
+
"required": true,
|
|
28
|
+
"pluginOptions": { "i18n": { "localized": true } }
|
|
29
|
+
},
|
|
30
|
+
"body": {
|
|
31
|
+
"type": "blocks",
|
|
32
|
+
"required": true,
|
|
33
|
+
"pluginOptions": { "i18n": { "localized": true } }
|
|
34
|
+
},
|
|
35
|
+
"summary": {
|
|
36
|
+
"type": "text",
|
|
37
|
+
"pluginOptions": { "i18n": { "localized": true } }
|
|
38
|
+
},
|
|
39
|
+
"excerpt": {
|
|
40
|
+
"type": "text",
|
|
41
|
+
"pluginOptions": { "i18n": { "localized": true } }
|
|
42
|
+
},
|
|
43
|
+
"cover": {
|
|
44
|
+
"type": "media",
|
|
45
|
+
"multiple": false,
|
|
46
|
+
"allowedTypes": ["images"],
|
|
47
|
+
"pluginOptions": { "i18n": { "localized": true } }
|
|
48
|
+
},
|
|
49
|
+
"gallery": {
|
|
50
|
+
"type": "media",
|
|
51
|
+
"multiple": true,
|
|
52
|
+
"allowedTypes": ["images"],
|
|
53
|
+
"pluginOptions": { "i18n": { "localized": true } }
|
|
54
|
+
},
|
|
55
|
+
"reading_time": {
|
|
56
|
+
"type": "integer",
|
|
57
|
+
"min": 1,
|
|
58
|
+
"default": 5
|
|
59
|
+
},
|
|
60
|
+
"firstPublishedAt": {
|
|
61
|
+
"type": "datetime"
|
|
62
|
+
},
|
|
63
|
+
"seo": {
|
|
64
|
+
"type": "component",
|
|
65
|
+
"component": "shared.seo",
|
|
66
|
+
"repeatable": false,
|
|
67
|
+
"pluginOptions": { "i18n": { "localized": true } }
|
|
68
|
+
},
|
|
69
|
+
"categories": {
|
|
70
|
+
"type": "relation",
|
|
71
|
+
"relation": "manyToMany",
|
|
72
|
+
"target": "plugin::builder.category",
|
|
73
|
+
"inversedBy": "articles"
|
|
74
|
+
},
|
|
75
|
+
"tags": {
|
|
76
|
+
"type": "relation",
|
|
77
|
+
"relation": "manyToMany",
|
|
78
|
+
"target": "plugin::builder.tag",
|
|
79
|
+
"inversedBy": "articles"
|
|
80
|
+
},
|
|
81
|
+
"author": {
|
|
82
|
+
"type": "relation",
|
|
83
|
+
"relation": "manyToOne",
|
|
84
|
+
"target": "plugin::builder.author",
|
|
85
|
+
"inversedBy": "articles"
|
|
86
|
+
},
|
|
87
|
+
"series": {
|
|
88
|
+
"type": "relation",
|
|
89
|
+
"relation": "manyToOne",
|
|
90
|
+
"target": "plugin::builder.series",
|
|
91
|
+
"inversedBy": "articles"
|
|
92
|
+
},
|
|
93
|
+
"series_order": {
|
|
94
|
+
"type": "integer",
|
|
95
|
+
"min": 1,
|
|
96
|
+
"default": 1
|
|
97
|
+
},
|
|
98
|
+
"related_posts": {
|
|
99
|
+
"type": "relation",
|
|
100
|
+
"relation": "manyToMany",
|
|
101
|
+
"target": "plugin::builder.article"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
schema: {
|
|
3
|
+
kind: string;
|
|
4
|
+
collectionName: string;
|
|
5
|
+
info: {
|
|
6
|
+
singularName: string;
|
|
7
|
+
pluralName: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
options: {
|
|
12
|
+
draftAndPublish: boolean;
|
|
13
|
+
};
|
|
14
|
+
pluginOptions: {
|
|
15
|
+
"content-manager": {
|
|
16
|
+
visible: boolean;
|
|
17
|
+
};
|
|
18
|
+
"content-type-builder": {
|
|
19
|
+
visible: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
attributes: {
|
|
23
|
+
name: {
|
|
24
|
+
type: string;
|
|
25
|
+
required: boolean;
|
|
26
|
+
};
|
|
27
|
+
slug: {
|
|
28
|
+
type: string;
|
|
29
|
+
targetField: string;
|
|
30
|
+
required: boolean;
|
|
31
|
+
};
|
|
32
|
+
role: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
bio: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
avatar: {
|
|
39
|
+
type: string;
|
|
40
|
+
multiple: boolean;
|
|
41
|
+
allowedTypes: string[];
|
|
42
|
+
};
|
|
43
|
+
email: {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
articles: {
|
|
47
|
+
type: string;
|
|
48
|
+
relation: string;
|
|
49
|
+
target: string;
|
|
50
|
+
mappedBy: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export default _default;
|
|
56
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/content-types/author/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAA0B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const schema_json_1 = __importDefault(require("./schema.json"));
|
|
7
|
+
exports.default = { schema: schema_json_1.default };
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/src/content-types/author/index.ts"],"names":[],"mappings":";;;;;AAAA,gEAAmC;AAEnC,kBAAe,EAAE,MAAM,EAAN,qBAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "collectionType",
|
|
3
|
+
"collectionName": "authors",
|
|
4
|
+
"info": {
|
|
5
|
+
"singularName": "author",
|
|
6
|
+
"pluralName": "authors",
|
|
7
|
+
"displayName": "Author",
|
|
8
|
+
"description": "Article author profile"
|
|
9
|
+
},
|
|
10
|
+
"options": {
|
|
11
|
+
"draftAndPublish": false
|
|
12
|
+
},
|
|
13
|
+
"pluginOptions": {
|
|
14
|
+
"content-manager": { "visible": true },
|
|
15
|
+
"content-type-builder": { "visible": true }
|
|
16
|
+
},
|
|
17
|
+
"attributes": {
|
|
18
|
+
"name": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"required": true
|
|
21
|
+
},
|
|
22
|
+
"slug": {
|
|
23
|
+
"type": "uid",
|
|
24
|
+
"targetField": "name",
|
|
25
|
+
"required": true
|
|
26
|
+
},
|
|
27
|
+
"role": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"bio": {
|
|
31
|
+
"type": "richtext"
|
|
32
|
+
},
|
|
33
|
+
"avatar": {
|
|
34
|
+
"type": "media",
|
|
35
|
+
"multiple": false,
|
|
36
|
+
"allowedTypes": ["images"]
|
|
37
|
+
},
|
|
38
|
+
"email": {
|
|
39
|
+
"type": "email"
|
|
40
|
+
},
|
|
41
|
+
"articles": {
|
|
42
|
+
"type": "relation",
|
|
43
|
+
"relation": "oneToMany",
|
|
44
|
+
"target": "plugin::builder.article",
|
|
45
|
+
"mappedBy": "author"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|