@dani-builder/strapi-plugin-builder 0.1.0 → 0.3.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 +149 -0
- 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 +8 -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 +45 -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/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.map +1 -1
- package/dist/server/src/index.js +4 -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 +16 -1
- 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.map +1 -1
- package/dist/server/src/services/populate.js +15 -9
- 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 +30 -18
- 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
package/AGENTS.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# @dani-builder/strapi-plugin-builder
|
|
2
|
+
|
|
3
|
+
Strapi v5 plugin providing 11 content types, 31 components, and smart API endpoints for a page builder CMS. Installed as a Strapi plugin — not used standalone.
|
|
4
|
+
|
|
5
|
+
## Installation & Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 1. Install the plugin
|
|
9
|
+
pnpm add @dani-builder/strapi-plugin-builder
|
|
10
|
+
|
|
11
|
+
# 2. Enable in Strapi config (config/plugins.ts)
|
|
12
|
+
export default () => ({
|
|
13
|
+
builder: { enabled: true },
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
# 3. Start Strapi — the plugin registers all Builder content types itself
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Do not copy Builder schemas into `src/api/`.** The plugin owns the content
|
|
20
|
+
types and their core REST routes; copied schemas duplicate collection names and
|
|
21
|
+
prevent Strapi from booting.
|
|
22
|
+
|
|
23
|
+
## Content Types (11)
|
|
24
|
+
|
|
25
|
+
### Collection Types (8)
|
|
26
|
+
|
|
27
|
+
| singularName | pluralName | REST endpoint | draftAndPublish | i18n |
|
|
28
|
+
|---|---|---|---|---|
|
|
29
|
+
| page | pages | `api/builder/pages` | true | yes |
|
|
30
|
+
| article | articles | `api/builder/articles` | true | yes |
|
|
31
|
+
| faq | faqs | `api/builder/faqs` | true | yes |
|
|
32
|
+
| category | categories | `api/builder/categories` | false | yes |
|
|
33
|
+
| tag | tags | `api/builder/tags` | false | yes |
|
|
34
|
+
| author | authors | `api/builder/authors` | false | no |
|
|
35
|
+
| inquiry | inquiries | `api/builder/inquiries` | false | no |
|
|
36
|
+
| series | all-series | `api/builder/all-series` | false | yes |
|
|
37
|
+
|
|
38
|
+
### Single Types (3)
|
|
39
|
+
|
|
40
|
+
| singularName | pluralName | REST endpoint | draftAndPublish | i18n |
|
|
41
|
+
|---|---|---|---|---|
|
|
42
|
+
| navigation | navigations | `api/builder/navigation` | true | yes |
|
|
43
|
+
| global | globals | `api/builder/global` | true | yes |
|
|
44
|
+
| site-setting | site-settings | `api/builder/site-setting` | false | no |
|
|
45
|
+
|
|
46
|
+
**Series quirk:** `pluralName` is `all-series` (not `series`) because Strapi requires singular and plural names to differ.
|
|
47
|
+
|
|
48
|
+
## Components (31)
|
|
49
|
+
|
|
50
|
+
### Blocks (14) — used in Page.blocks dynamic zone
|
|
51
|
+
|
|
52
|
+
`blocks.hero`, `blocks.features`, `blocks.cta`, `blocks.slider`, `blocks.inquiry-form`, `blocks.faq`, `blocks.highlights`, `blocks.bento-grid`, `blocks.testimonials`, `blocks.logo-cloud`, `blocks.stats`, `blocks.pricing`, `blocks.content`, `blocks.team`
|
|
53
|
+
|
|
54
|
+
### Elements (2)
|
|
55
|
+
|
|
56
|
+
`elements.section`, `elements.footer`
|
|
57
|
+
|
|
58
|
+
### Shared (15)
|
|
59
|
+
|
|
60
|
+
`shared.link`, `shared.seo`, `shared.feature-item`, `shared.highlight-item`, `shared.bento-item`, `shared.slider-item`, `shared.stat-item`, `shared.team-member`, `shared.testimonial-item`, `shared.pricing-tier`, `shared.logo-item`, `shared.navigation-group`, `shared.brand-colors`, `shared.analytics-setting`, `shared.chatbot-setting`, `shared.site-verification`
|
|
61
|
+
|
|
62
|
+
## Smart API Endpoints
|
|
63
|
+
|
|
64
|
+
Server-side deep populate — no need for client-side populate building.
|
|
65
|
+
|
|
66
|
+
| Method | Path | Description |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| GET | `/api/builder/pages` | List pages (minimal populate) |
|
|
69
|
+
| GET | `/api/builder/pages/:documentId` | Single page with all blocks deeply populated |
|
|
70
|
+
| GET | `/api/builder/global` | Global settings (siteWideBlocks + footer, fully populated) |
|
|
71
|
+
|
|
72
|
+
## Critical Rules
|
|
73
|
+
|
|
74
|
+
1. **Component registration** — The plugin uses `strapi.get('components').add(map)`. Never assign directly to `strapi.components[uid]`.
|
|
75
|
+
2. **Components require metadata** — Each component JSON must include `__schema__`, `globalId`, and `collectionName` fields.
|
|
76
|
+
3. **`__component` required in dynamic zones** — Every block object needs `"__component": "blocks.hero"` etc.
|
|
77
|
+
4. **Block text lives in `section`** — heading, subheading, and theme are on the `section` sub-component, NOT at block root.
|
|
78
|
+
5. **Section.theme is a Tailwind preset key** — Values like `'dark'`, `'default'`. No arbitrary CSS colors.
|
|
79
|
+
6. **`name` fields are admin-only** — Used for CMS identification. Never display in frontend.
|
|
80
|
+
7. **All media fields are nullable** — Render defensively even for "required" media fields.
|
|
81
|
+
8. **CT directory names match singularName** — `site-setting/` not `site-settings/`.
|
|
82
|
+
|
|
83
|
+
## Variant-Based Layouts
|
|
84
|
+
|
|
85
|
+
Blocks use a `variant` enum instead of separate components per layout. Only use values defined in the schema:
|
|
86
|
+
|
|
87
|
+
| Block | Variants |
|
|
88
|
+
|---|---|
|
|
89
|
+
| hero | `side-by-side`, `media-extending`, `fullscreen-media`, `stacked-media` |
|
|
90
|
+
| features | `simple-grid`, `card-grid`, `icon-grid` |
|
|
91
|
+
| cta | `side-by-side`, `centered` |
|
|
92
|
+
| pricing | `card-grid`, `comparison-table` |
|
|
93
|
+
| testimonials | `card-grid`, `alternating`, `single-highlight` |
|
|
94
|
+
| highlights | `media-aside`, `alternating`, `card-grid` |
|
|
95
|
+
| bento-grid | `auto`, `featured-left`, `featured-right` |
|
|
96
|
+
| stats | `simple-row`, `card-grid` |
|
|
97
|
+
| team | `card-grid`, `simple-grid` |
|
|
98
|
+
| logo-cloud | `simple-grid`, `ticker` |
|
|
99
|
+
| slider | `fullscreen`, `card-carousel` |
|
|
100
|
+
|
|
101
|
+
**Never invent variant values** — always check the schema definition.
|
|
102
|
+
|
|
103
|
+
## REST API Rules (for MCP / programmatic content creation)
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
// POST api/builder/pages — create a page with blocks
|
|
107
|
+
{
|
|
108
|
+
"data": {
|
|
109
|
+
"title": "About",
|
|
110
|
+
"slug": "about",
|
|
111
|
+
"locale": "en",
|
|
112
|
+
"blocks": [
|
|
113
|
+
{
|
|
114
|
+
"__component": "blocks.hero",
|
|
115
|
+
"variant": "side-by-side",
|
|
116
|
+
"section": {
|
|
117
|
+
"heading": "About Us",
|
|
118
|
+
"subheading": "Our story",
|
|
119
|
+
"theme": "dark"
|
|
120
|
+
},
|
|
121
|
+
"ctaLink": { "label": "Learn more", "href": "/contact" }
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
1. **`data` wrapper required** — POST/PUT body must be `{ "data": { ... } }`
|
|
129
|
+
2. **`locale` required** — i18n-enabled CTs fail with `Invalid key` without it
|
|
130
|
+
3. **Media uploaded separately** — Upload via Strapi Upload API, then reference by ID
|
|
131
|
+
4. **Deep reads via Smart API** — Standard REST only populates 1 level; use `/api/builder/pages/:docId` for full data
|
|
132
|
+
|
|
133
|
+
## File Structure
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
server/src/
|
|
137
|
+
content-types/ — Plugin-owned content type schemas
|
|
138
|
+
register.ts — Programmatic component registration
|
|
139
|
+
controllers/ — Smart API controllers (page, global)
|
|
140
|
+
services/ — Populate service (deep populate definitions for all 14 blocks)
|
|
141
|
+
routes/ — Core and smart API route definitions
|
|
142
|
+
components/ — Component JSON schemas (blocks, elements, shared)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Peer Dependencies
|
|
146
|
+
|
|
147
|
+
- `@strapi/strapi` ^5.0.0
|
|
148
|
+
- `@strapi/plugin-color-picker` ^5.0.0
|
|
149
|
+
- `@d3levvv/strapi-react-icons-plugin` ^1.0.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 HJ-company
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# @dani-builder/strapi-plugin-builder
|
|
2
|
+
|
|
3
|
+
Reusable CMS building blocks for **Strapi v5** — 11 content types, 31 block/element
|
|
4
|
+
components, and a "smart API" that returns fully deep-populated pages and globals
|
|
5
|
+
in a single request. Powers the [Daniworks Builder](https://github.com/HJ-company/daniworks-builder-v2)
|
|
6
|
+
block-based site builder.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pnpm add @dani-builder/strapi-plugin-builder @strapi/plugin-color-picker @d3levvv/strapi-react-icons-plugin
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The two peer plugins are required: builder components use their custom
|
|
15
|
+
fields (`plugin::color-picker.color`, `plugin::icon-picker.icon`), and Strapi
|
|
16
|
+
only loads plugins listed in your own `package.json`. Without them the app
|
|
17
|
+
fails to boot with `Could not find Custom Field: plugin::color-picker.color`.
|
|
18
|
+
|
|
19
|
+
Enable it in `config/plugins.ts`:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
export default () => ({
|
|
23
|
+
builder: { enabled: true },
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Plugin-owned content types
|
|
28
|
+
|
|
29
|
+
The plugin directly registers all 11 content types as `plugin::builder.*`.
|
|
30
|
+
Do not copy schemas into a consumer's `src/api` directory: that would create
|
|
31
|
+
conflicting `collectionName` registrations. Core REST endpoints are available
|
|
32
|
+
under `/api/builder/*`.
|
|
33
|
+
|
|
34
|
+
The `inquiry` endpoint is write-only (`POST /api/builder/inquiries`) and IP
|
|
35
|
+
rate-limited so submitter PII cannot be listed over the public API.
|
|
36
|
+
|
|
37
|
+
## Extending from your project
|
|
38
|
+
|
|
39
|
+
Add your own blocks to `Page.blocks` and extra fields to plugin components
|
|
40
|
+
from `src/extensions/builder/strapi-server.ts` in your Strapi project — no
|
|
41
|
+
plugin fork needed. Register populate for custom blocks with
|
|
42
|
+
`strapi.plugin('builder').service('populate').registerBlock(uid, populate)`.
|
|
43
|
+
Step-by-step guide with the failure cases to avoid:
|
|
44
|
+
[docs/guides/extending-builder.md](https://github.com/HJ-company/daniworks-builder-v2/blob/main/docs/guides/extending-builder.md).
|
|
45
|
+
Claude Code users get the same procedure as the `builder-extender` skill.
|
|
46
|
+
|
|
47
|
+
## Smart API
|
|
48
|
+
|
|
49
|
+
Deep-populated, published-only reads (drafts never leak):
|
|
50
|
+
|
|
51
|
+
| Method | Endpoint | Purpose |
|
|
52
|
+
|--------|----------|---------|
|
|
53
|
+
| GET | `/api/builder/pages` | List pages (minimal populate) |
|
|
54
|
+
| GET | `/api/builder/pages/:documentId` | Single page, deep block populate |
|
|
55
|
+
| GET | `/api/builder/global` | Global settings, deep populate |
|
|
56
|
+
|
|
57
|
+
Consume it with [`@dani-builder/strapi-client`](https://www.npmjs.com/package/@dani-builder/strapi-client).
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT © HJ-company
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C,QAAA,MAAM,SAAS,GAAI,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE,SAUrD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AGENT_PLUGIN_ID = "agent";
|
|
3
4
|
const bootstrap = ({ strapi }) => {
|
|
4
5
|
// Initialize populate service with core block definitions
|
|
5
|
-
strapi.plugin(
|
|
6
|
+
strapi.plugin("builder").service("populate").buildBlocksPopulate();
|
|
7
|
+
// The agent plugin is optional. Its first registration set is deliberately
|
|
8
|
+
// empty; future agent work adds observed serializer overrides here.
|
|
9
|
+
const serializer = strapi.plugins[AGENT_PLUGIN_ID]?.services?.serializer;
|
|
10
|
+
if (serializer && typeof serializer.registerOverrides === "function") {
|
|
11
|
+
serializer.registerOverrides({});
|
|
12
|
+
}
|
|
6
13
|
};
|
|
7
14
|
exports.default = bootstrap;
|
|
8
15
|
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":";;AAEA,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAA2B,EAAE,EAAE;IACxD,0DAA0D;IAC1D,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,mBAAmB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../server/src/bootstrap.ts"],"names":[],"mappings":";;AAEA,MAAM,eAAe,GAAG,OAAO,CAAC;AAEhC,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAA2B,EAAE,EAAE;IACxD,0DAA0D;IAC1D,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,mBAAmB,EAAE,CAAC;IAEnE,2EAA2E;IAC3E,oEAAoE;IACpE,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC;IACzE,IAAI,UAAU,IAAI,OAAO,UAAU,CAAC,iBAAiB,KAAK,UAAU,EAAE,CAAC;QACrE,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IACnC,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.test.d.ts","sourceRoot":"","sources":["../../../server/src/bootstrap.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 bootstrap_1 = __importDefault(require("./bootstrap"));
|
|
8
|
+
function createStrapi(serializerInstalled) {
|
|
9
|
+
const registerOverrides = vitest_1.vi.fn();
|
|
10
|
+
const buildBlocksPopulate = vitest_1.vi.fn();
|
|
11
|
+
const plugins = serializerInstalled
|
|
12
|
+
? { agent: { services: { serializer: { registerOverrides } } } }
|
|
13
|
+
: {};
|
|
14
|
+
return {
|
|
15
|
+
plugins,
|
|
16
|
+
plugin: vitest_1.vi.fn((name) => {
|
|
17
|
+
if (name === "builder")
|
|
18
|
+
return { service: () => ({ buildBlocksPopulate }) };
|
|
19
|
+
return { service: () => ({ registerOverrides }) };
|
|
20
|
+
}),
|
|
21
|
+
registerOverrides,
|
|
22
|
+
buildBlocksPopulate,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
(0, vitest_1.describe)("builder bootstrap", () => {
|
|
26
|
+
(0, vitest_1.it)("does not access agent services when the optional plugin is absent", () => {
|
|
27
|
+
const strapi = createStrapi(false);
|
|
28
|
+
(0, bootstrap_1.default)({ strapi: strapi });
|
|
29
|
+
(0, vitest_1.expect)(strapi.buildBlocksPopulate).toHaveBeenCalledOnce();
|
|
30
|
+
(0, vitest_1.expect)(strapi.plugin).toHaveBeenCalledTimes(1);
|
|
31
|
+
});
|
|
32
|
+
(0, vitest_1.it)("registers the empty serializer override set when agent is installed", () => {
|
|
33
|
+
const strapi = createStrapi(true);
|
|
34
|
+
(0, bootstrap_1.default)({ strapi: strapi });
|
|
35
|
+
(0, vitest_1.expect)(strapi.registerOverrides).toHaveBeenCalledWith({});
|
|
36
|
+
});
|
|
37
|
+
(0, vitest_1.it)("does not access an unrelated plugin registered as agent", () => {
|
|
38
|
+
const strapi = createStrapi(false);
|
|
39
|
+
strapi.plugins.agent = {};
|
|
40
|
+
(0, bootstrap_1.default)({ strapi: strapi });
|
|
41
|
+
(0, vitest_1.expect)(strapi.registerOverrides).not.toHaveBeenCalled();
|
|
42
|
+
(0, vitest_1.expect)(strapi.plugin).toHaveBeenCalledTimes(1);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=bootstrap.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.test.js","sourceRoot":"","sources":["../../../server/src/bootstrap.test.ts"],"names":[],"mappings":";;;;;AAAA,mCAAkD;AAClD,4DAAoC;AAEpC,SAAS,YAAY,CAAC,mBAA4B;IAChD,MAAM,iBAAiB,GAAG,WAAE,CAAC,EAAE,EAAE,CAAC;IAClC,MAAM,mBAAmB,GAAG,WAAE,CAAC,EAAE,EAAE,CAAC;IACpC,MAAM,OAAO,GAA4B,mBAAmB;QAC1D,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,EAAE;QAChE,CAAC,CAAC,EAAE,CAAC;IACP,OAAO;QACL,OAAO;QACP,MAAM,EAAE,WAAE,CAAC,EAAE,CAAC,CAAC,IAAY,EAAE,EAAE;YAC7B,IAAI,IAAI,KAAK,SAAS;gBACpB,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,mBAAmB,EAAE,CAAC,EAAE,CAAC;YACtD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;QACpD,CAAC,CAAC;QACF,iBAAiB;QACjB,mBAAmB;KACpB,CAAC;AACJ,CAAC;AAED,IAAA,iBAAQ,EAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAA,WAAE,EAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QACnC,IAAA,mBAAS,EAAC,EAAE,MAAM,EAAE,MAAe,EAAE,CAAC,CAAC;QACvC,IAAA,eAAM,EAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,EAAE,CAAC;QAC1D,IAAA,eAAM,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAClC,IAAA,mBAAS,EAAC,EAAE,MAAM,EAAE,MAAe,EAAE,CAAC,CAAC;QACvC,IAAA,eAAM,EAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;QAC1B,IAAA,mBAAS,EAAC,EAAE,MAAM,EAAE,MAAe,EAAE,CAAC,CAAC;QACvC,IAAA,eAAM,EAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QACxD,IAAA,eAAM,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -13,12 +13,20 @@
|
|
|
13
13
|
},
|
|
14
14
|
"variant": {
|
|
15
15
|
"type": "enumeration",
|
|
16
|
-
"enum": [
|
|
16
|
+
"enum": [
|
|
17
|
+
"inline-spread",
|
|
18
|
+
"inline-centered",
|
|
19
|
+
"inline-stacked",
|
|
20
|
+
"card-stacked",
|
|
21
|
+
"card-centered",
|
|
22
|
+
"card-horizontal"
|
|
23
|
+
],
|
|
24
|
+
"default": "inline-spread"
|
|
17
25
|
},
|
|
18
|
-
"
|
|
19
|
-
"type": "
|
|
20
|
-
"
|
|
21
|
-
"
|
|
26
|
+
"image": {
|
|
27
|
+
"type": "component",
|
|
28
|
+
"component": "shared.image",
|
|
29
|
+
"repeatable": false
|
|
22
30
|
},
|
|
23
31
|
"ctaText": {
|
|
24
32
|
"type": "text"
|
|
@@ -11,17 +11,22 @@
|
|
|
11
11
|
},
|
|
12
12
|
"variant": {
|
|
13
13
|
"type": "enumeration",
|
|
14
|
-
"enum": [
|
|
14
|
+
"enum": [
|
|
15
|
+
"simple-grid",
|
|
16
|
+
"dual-column",
|
|
17
|
+
"media-aside",
|
|
18
|
+
"media-aside-compact"
|
|
19
|
+
]
|
|
15
20
|
},
|
|
16
21
|
"section": {
|
|
17
22
|
"type": "component",
|
|
18
23
|
"component": "elements.section",
|
|
19
24
|
"repeatable": false
|
|
20
25
|
},
|
|
21
|
-
"
|
|
22
|
-
"type": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
26
|
+
"image": {
|
|
27
|
+
"type": "component",
|
|
28
|
+
"component": "shared.image",
|
|
29
|
+
"repeatable": false
|
|
25
30
|
},
|
|
26
31
|
"items": {
|
|
27
32
|
"type": "component",
|
|
@@ -8,17 +8,22 @@
|
|
|
8
8
|
"attributes": {
|
|
9
9
|
"variant": {
|
|
10
10
|
"type": "enumeration",
|
|
11
|
-
"enum": [
|
|
11
|
+
"enum": [
|
|
12
|
+
"side-by-side",
|
|
13
|
+
"media-extending",
|
|
14
|
+
"fullscreen-media",
|
|
15
|
+
"stacked-media"
|
|
16
|
+
]
|
|
12
17
|
},
|
|
13
18
|
"section": {
|
|
14
19
|
"type": "component",
|
|
15
20
|
"component": "elements.section",
|
|
16
21
|
"repeatable": false
|
|
17
22
|
},
|
|
18
|
-
"
|
|
19
|
-
"type": "
|
|
20
|
-
"
|
|
21
|
-
"
|
|
23
|
+
"image": {
|
|
24
|
+
"type": "component",
|
|
25
|
+
"component": "shared.image",
|
|
26
|
+
"repeatable": false
|
|
22
27
|
},
|
|
23
28
|
"ctaText": {
|
|
24
29
|
"type": "text"
|
|
@@ -35,7 +40,11 @@
|
|
|
35
40
|
},
|
|
36
41
|
"headerMode": {
|
|
37
42
|
"type": "enumeration",
|
|
38
|
-
"enum": [
|
|
43
|
+
"enum": [
|
|
44
|
+
"none",
|
|
45
|
+
"transparent-black",
|
|
46
|
+
"transparent-white"
|
|
47
|
+
],
|
|
39
48
|
"default": "none"
|
|
40
49
|
}
|
|
41
50
|
}
|
|
@@ -11,12 +11,16 @@
|
|
|
11
11
|
},
|
|
12
12
|
"variant": {
|
|
13
13
|
"type": "enumeration",
|
|
14
|
-
"enum": [
|
|
14
|
+
"enum": [
|
|
15
|
+
"dual-column",
|
|
16
|
+
"triple-column",
|
|
17
|
+
"alternating"
|
|
18
|
+
]
|
|
15
19
|
},
|
|
16
|
-
"
|
|
17
|
-
"type": "
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
+
"image": {
|
|
21
|
+
"type": "component",
|
|
22
|
+
"component": "shared.image",
|
|
23
|
+
"repeatable": false
|
|
20
24
|
},
|
|
21
25
|
"section": {
|
|
22
26
|
"type": "component",
|
|
@@ -11,17 +11,21 @@
|
|
|
11
11
|
},
|
|
12
12
|
"variant": {
|
|
13
13
|
"type": "enumeration",
|
|
14
|
-
"enum": [
|
|
14
|
+
"enum": [
|
|
15
|
+
"simple",
|
|
16
|
+
"card-grid",
|
|
17
|
+
"split"
|
|
18
|
+
]
|
|
15
19
|
},
|
|
16
20
|
"section": {
|
|
17
21
|
"type": "component",
|
|
18
22
|
"component": "elements.section",
|
|
19
23
|
"repeatable": false
|
|
20
24
|
},
|
|
21
|
-
"
|
|
22
|
-
"type": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
+
"image": {
|
|
26
|
+
"type": "component",
|
|
27
|
+
"component": "shared.image",
|
|
28
|
+
"repeatable": false
|
|
25
29
|
},
|
|
26
30
|
"items": {
|
|
27
31
|
"type": "component",
|
|
@@ -11,17 +11,22 @@
|
|
|
11
11
|
},
|
|
12
12
|
"variant": {
|
|
13
13
|
"type": "enumeration",
|
|
14
|
-
"enum": [
|
|
14
|
+
"enum": [
|
|
15
|
+
"centered",
|
|
16
|
+
"side-by-side",
|
|
17
|
+
"card-grid",
|
|
18
|
+
"subtle-grid"
|
|
19
|
+
]
|
|
15
20
|
},
|
|
16
21
|
"section": {
|
|
17
22
|
"type": "component",
|
|
18
23
|
"component": "elements.section",
|
|
19
24
|
"repeatable": false
|
|
20
25
|
},
|
|
21
|
-
"
|
|
22
|
-
"type": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
26
|
+
"image": {
|
|
27
|
+
"type": "component",
|
|
28
|
+
"component": "shared.image",
|
|
29
|
+
"repeatable": false
|
|
25
30
|
},
|
|
26
31
|
"items": {
|
|
27
32
|
"type": "component",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"description": {
|
|
13
13
|
"type": "text"
|
|
14
14
|
},
|
|
15
|
-
"
|
|
16
|
-
"type": "
|
|
17
|
-
"
|
|
18
|
-
"
|
|
15
|
+
"image": {
|
|
16
|
+
"type": "component",
|
|
17
|
+
"component": "shared.image",
|
|
18
|
+
"repeatable": false
|
|
19
19
|
},
|
|
20
20
|
"icon": {
|
|
21
21
|
"type": "customField",
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"description": {
|
|
13
13
|
"type": "richtext"
|
|
14
14
|
},
|
|
15
|
-
"
|
|
16
|
-
"type": "
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
15
|
+
"image": {
|
|
16
|
+
"type": "component",
|
|
17
|
+
"component": "shared.image",
|
|
18
|
+
"repeatable": false,
|
|
19
|
+
"required": true
|
|
20
20
|
},
|
|
21
21
|
"link": {
|
|
22
22
|
"type": "component",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_shared_images",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Image",
|
|
5
|
+
"icon": "picture",
|
|
6
|
+
"description": "Informational image with per-usage fit control and localized alt override"
|
|
7
|
+
},
|
|
8
|
+
"attributes": {
|
|
9
|
+
"media": {
|
|
10
|
+
"type": "media",
|
|
11
|
+
"multiple": false,
|
|
12
|
+
"required": true,
|
|
13
|
+
"allowedTypes": ["images", "videos"]
|
|
14
|
+
},
|
|
15
|
+
"alt": {
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"fit": {
|
|
19
|
+
"type": "enumeration",
|
|
20
|
+
"enum": ["auto", "cover", "contain"],
|
|
21
|
+
"default": "auto"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"component": "shared.link",
|
|
18
18
|
"repeatable": false
|
|
19
19
|
},
|
|
20
|
-
"
|
|
21
|
-
"type": "
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
20
|
+
"image": {
|
|
21
|
+
"type": "component",
|
|
22
|
+
"component": "shared.image",
|
|
23
|
+
"repeatable": false,
|
|
24
|
+
"required": true
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|