@caretcms/core 0.1.0 → 0.1.2
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/README.md +182 -6
- package/dist/browser-runtime.d.ts +16 -0
- package/dist/browser-runtime.d.ts.map +1 -1
- package/dist/browser-runtime.js +42 -23
- package/dist/browser-runtime.js.map +1 -1
- package/dist/contracts.d.ts +14 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +14 -0
- package/dist/contracts.js.map +1 -0
- package/dist/editable.d.ts +28 -0
- package/dist/editable.d.ts.map +1 -0
- package/dist/editable.js +122 -0
- package/dist/editable.js.map +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +274 -4
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +45 -3
- package/dist/loader.js.map +1 -1
- package/dist/providers/storage/markdown.d.ts +7 -0
- package/dist/providers/storage/markdown.d.ts.map +1 -0
- package/dist/providers/storage/markdown.js +6 -0
- package/dist/providers/storage/markdown.js.map +1 -0
- package/dist/runtime/auth/cookie-utils.d.ts +1 -0
- package/dist/runtime/auth/cookie-utils.d.ts.map +1 -1
- package/dist/runtime/auth/cookie-utils.js +1 -1
- package/dist/runtime/auth/cookie-utils.js.map +1 -1
- package/dist/runtime/auth/rate-limiter.d.ts.map +1 -1
- package/dist/runtime/auth/rate-limiter.js +19 -13
- package/dist/runtime/auth/rate-limiter.js.map +1 -1
- package/dist/runtime/auth/session.d.ts +8 -0
- package/dist/runtime/auth/session.d.ts.map +1 -1
- package/dist/runtime/auth/session.js +72 -11
- package/dist/runtime/auth/session.js.map +1 -1
- package/dist/runtime/config.d.ts +1 -0
- package/dist/runtime/config.d.ts.map +1 -1
- package/dist/runtime/config.js +2 -1
- package/dist/runtime/config.js.map +1 -1
- package/dist/runtime/git-journal.d.ts +19 -0
- package/dist/runtime/git-journal.d.ts.map +1 -0
- package/dist/runtime/git-journal.js +64 -0
- package/dist/runtime/git-journal.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/middleware.d.ts.map +1 -1
- package/dist/runtime/middleware.js +125 -8
- package/dist/runtime/middleware.js.map +1 -1
- package/dist/runtime/mutations/contracts.d.ts.map +1 -1
- package/dist/runtime/mutations/contracts.js +7 -4
- package/dist/runtime/mutations/contracts.js.map +1 -1
- package/dist/runtime/mutations/engine.d.ts +7 -0
- package/dist/runtime/mutations/engine.d.ts.map +1 -1
- package/dist/runtime/mutations/engine.js +30 -17
- package/dist/runtime/mutations/engine.js.map +1 -1
- package/dist/runtime/providers.d.ts +16 -0
- package/dist/runtime/providers.d.ts.map +1 -1
- package/dist/runtime/providers.js +16 -0
- package/dist/runtime/providers.js.map +1 -1
- package/dist/runtime/publish.d.ts +40 -0
- package/dist/runtime/publish.d.ts.map +1 -0
- package/dist/runtime/publish.js +75 -0
- package/dist/runtime/publish.js.map +1 -0
- package/dist/runtime/rebuild-webhook.d.ts +29 -0
- package/dist/runtime/rebuild-webhook.d.ts.map +1 -0
- package/dist/runtime/rebuild-webhook.js +37 -0
- package/dist/runtime/rebuild-webhook.js.map +1 -0
- package/dist/runtime/request-context.d.ts +19 -0
- package/dist/runtime/request-context.d.ts.map +1 -1
- package/dist/runtime/request-context.js.map +1 -1
- package/dist/runtime/rewrite.d.ts +29 -1
- package/dist/runtime/rewrite.d.ts.map +1 -1
- package/dist/runtime/rewrite.js +30 -16
- package/dist/runtime/rewrite.js.map +1 -1
- package/dist/runtime/rich-allowlist.d.ts +29 -0
- package/dist/runtime/rich-allowlist.d.ts.map +1 -0
- package/dist/runtime/rich-allowlist.js +49 -0
- package/dist/runtime/rich-allowlist.js.map +1 -0
- package/dist/runtime/routes/_helpers.d.ts +33 -0
- package/dist/runtime/routes/_helpers.d.ts.map +1 -1
- package/dist/runtime/routes/_helpers.js +117 -1
- package/dist/runtime/routes/_helpers.js.map +1 -1
- package/dist/runtime/routes/admin-entry.d.ts +1 -0
- package/dist/runtime/routes/admin-entry.d.ts.map +1 -1
- package/dist/runtime/routes/admin-entry.js +3 -2
- package/dist/runtime/routes/admin-entry.js.map +1 -1
- package/dist/runtime/routes/admin.d.ts +1 -0
- package/dist/runtime/routes/admin.d.ts.map +1 -1
- package/dist/runtime/routes/admin.js +61 -9
- package/dist/runtime/routes/admin.js.map +1 -1
- package/dist/runtime/routes/auth-login.d.ts +1 -0
- package/dist/runtime/routes/auth-login.d.ts.map +1 -1
- package/dist/runtime/routes/auth-login.js +26 -8
- package/dist/runtime/routes/auth-login.js.map +1 -1
- package/dist/runtime/routes/auth-logout.d.ts +1 -0
- package/dist/runtime/routes/auth-logout.d.ts.map +1 -1
- package/dist/runtime/routes/auth-logout.js +5 -0
- package/dist/runtime/routes/auth-logout.js.map +1 -1
- package/dist/runtime/routes/auth-session.d.ts +1 -0
- package/dist/runtime/routes/auth-session.d.ts.map +1 -1
- package/dist/runtime/routes/auth-session.js +1 -0
- package/dist/runtime/routes/auth-session.js.map +1 -1
- package/dist/runtime/routes/collection-list.d.ts +1 -0
- package/dist/runtime/routes/collection-list.d.ts.map +1 -1
- package/dist/runtime/routes/collection-list.js +3 -2
- package/dist/runtime/routes/collection-list.js.map +1 -1
- package/dist/runtime/routes/collections-metadata.d.ts +1 -0
- package/dist/runtime/routes/collections-metadata.d.ts.map +1 -1
- package/dist/runtime/routes/collections-metadata.js +7 -4
- package/dist/runtime/routes/collections-metadata.js.map +1 -1
- package/dist/runtime/routes/draft.d.ts +13 -0
- package/dist/runtime/routes/draft.d.ts.map +1 -0
- package/dist/runtime/routes/draft.js +55 -0
- package/dist/runtime/routes/draft.js.map +1 -0
- package/dist/runtime/routes/editor-assets.d.ts +1 -0
- package/dist/runtime/routes/editor-assets.d.ts.map +1 -1
- package/dist/runtime/routes/editor-assets.js +1 -0
- package/dist/runtime/routes/editor-assets.js.map +1 -1
- package/dist/runtime/routes/entries.d.ts +1 -0
- package/dist/runtime/routes/entries.d.ts.map +1 -1
- package/dist/runtime/routes/entries.js +3 -2
- package/dist/runtime/routes/entries.js.map +1 -1
- package/dist/runtime/routes/history.d.ts +1 -0
- package/dist/runtime/routes/history.d.ts.map +1 -1
- package/dist/runtime/routes/history.js +24 -10
- package/dist/runtime/routes/history.js.map +1 -1
- package/dist/runtime/routes/mutate.d.ts +1 -0
- package/dist/runtime/routes/mutate.d.ts.map +1 -1
- package/dist/runtime/routes/mutate.js +7 -10
- package/dist/runtime/routes/mutate.js.map +1 -1
- package/dist/runtime/routes/publish.d.ts +10 -0
- package/dist/runtime/routes/publish.d.ts.map +1 -0
- package/dist/runtime/routes/publish.js +75 -0
- package/dist/runtime/routes/publish.js.map +1 -0
- package/dist/runtime/routes/schema.d.ts +1 -0
- package/dist/runtime/routes/schema.d.ts.map +1 -1
- package/dist/runtime/routes/schema.js +7 -4
- package/dist/runtime/routes/schema.js.map +1 -1
- package/dist/runtime/routes/studio-home.d.ts +1 -0
- package/dist/runtime/routes/studio-home.d.ts.map +1 -1
- package/dist/runtime/routes/studio-home.js +10 -9
- package/dist/runtime/routes/studio-home.js.map +1 -1
- package/dist/runtime/routes/theme-stylesheet.d.ts +1 -0
- package/dist/runtime/routes/theme-stylesheet.d.ts.map +1 -1
- package/dist/runtime/routes/theme-stylesheet.js +1 -0
- package/dist/runtime/routes/theme-stylesheet.js.map +1 -1
- package/dist/runtime/routes/upload.d.ts +1 -0
- package/dist/runtime/routes/upload.d.ts.map +1 -1
- package/dist/runtime/routes/upload.js +17 -3
- package/dist/runtime/routes/upload.js.map +1 -1
- package/dist/runtime/sanitize-html.d.ts +8 -2
- package/dist/runtime/sanitize-html.d.ts.map +1 -1
- package/dist/runtime/sanitize-html.js +57 -38
- package/dist/runtime/sanitize-html.js.map +1 -1
- package/dist/runtime/static-bake.d.ts +20 -0
- package/dist/runtime/static-bake.d.ts.map +1 -0
- package/dist/runtime/static-bake.js +58 -0
- package/dist/runtime/static-bake.js.map +1 -0
- package/dist/runtime/stega.d.ts +38 -0
- package/dist/runtime/stega.d.ts.map +1 -0
- package/dist/runtime/stega.js +98 -0
- package/dist/runtime/stega.js.map +1 -0
- package/dist/runtime/storage/atomic-write.d.ts +22 -0
- package/dist/runtime/storage/atomic-write.d.ts.map +1 -0
- package/dist/runtime/storage/atomic-write.js +44 -0
- package/dist/runtime/storage/atomic-write.js.map +1 -0
- package/dist/runtime/storage/filesystem-adapter.d.ts +14 -11
- package/dist/runtime/storage/filesystem-adapter.d.ts.map +1 -1
- package/dist/runtime/storage/filesystem-adapter.js +71 -201
- package/dist/runtime/storage/filesystem-adapter.js.map +1 -1
- package/dist/runtime/storage/frontmatter-codec.d.ts +47 -0
- package/dist/runtime/storage/frontmatter-codec.d.ts.map +1 -0
- package/dist/runtime/storage/frontmatter-codec.js +523 -0
- package/dist/runtime/storage/frontmatter-codec.js.map +1 -0
- package/dist/runtime/storage/fs-runtime.d.ts +8 -0
- package/dist/runtime/storage/fs-runtime.d.ts.map +1 -0
- package/dist/runtime/storage/fs-runtime.js +40 -0
- package/dist/runtime/storage/fs-runtime.js.map +1 -0
- package/dist/runtime/storage/id-contracts.d.ts +22 -0
- package/dist/runtime/storage/id-contracts.d.ts.map +1 -0
- package/dist/runtime/storage/id-contracts.js +27 -0
- package/dist/runtime/storage/id-contracts.js.map +1 -0
- package/dist/runtime/storage/image-validation.d.ts +10 -0
- package/dist/runtime/storage/image-validation.d.ts.map +1 -1
- package/dist/runtime/storage/image-validation.js +17 -4
- package/dist/runtime/storage/image-validation.js.map +1 -1
- package/dist/runtime/storage/in-memory-adapter.d.ts +4 -0
- package/dist/runtime/storage/in-memory-adapter.d.ts.map +1 -1
- package/dist/runtime/storage/in-memory-adapter.js +11 -0
- package/dist/runtime/storage/in-memory-adapter.js.map +1 -1
- package/dist/runtime/storage/markdown-adapter.d.ts +63 -0
- package/dist/runtime/storage/markdown-adapter.d.ts.map +1 -0
- package/dist/runtime/storage/markdown-adapter.js +227 -0
- package/dist/runtime/storage/markdown-adapter.js.map +1 -0
- package/dist/runtime/storage/quota-upload-handler.d.ts +2 -0
- package/dist/runtime/storage/quota-upload-handler.d.ts.map +1 -1
- package/dist/runtime/storage/quota-upload-handler.js +34 -8
- package/dist/runtime/storage/quota-upload-handler.js.map +1 -1
- package/dist/runtime/storage/session-overlay-adapter.d.ts +3 -0
- package/dist/runtime/storage/session-overlay-adapter.d.ts.map +1 -1
- package/dist/runtime/storage/session-overlay-adapter.js +3 -1
- package/dist/runtime/storage/session-overlay-adapter.js.map +1 -1
- package/dist/runtime/storage/sidecar-meta-store.d.ts +51 -0
- package/dist/runtime/storage/sidecar-meta-store.d.ts.map +1 -0
- package/dist/runtime/storage/sidecar-meta-store.js +209 -0
- package/dist/runtime/storage/sidecar-meta-store.js.map +1 -0
- package/dist/runtime/themes/preset-tokens.d.ts +0 -1
- package/dist/runtime/themes/preset-tokens.d.ts.map +1 -1
- package/dist/runtime/themes/preset-tokens.js +1 -1
- package/dist/runtime/themes/preset-tokens.js.map +1 -1
- package/dist/runtime/utils.d.ts +9 -1
- package/dist/runtime/utils.d.ts.map +1 -1
- package/dist/runtime/utils.js +21 -1
- package/dist/runtime/utils.js.map +1 -1
- package/dist/runtime/views/studio-layout.d.ts.map +1 -1
- package/dist/runtime/views/studio-layout.js +11 -10
- package/dist/runtime/views/studio-layout.js.map +1 -1
- package/dist/schema-utils.d.ts.map +1 -1
- package/dist/schema-utils.js +1 -0
- package/dist/schema-utils.js.map +1 -1
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -1
- package/static/cms/dev-toolbar/app.js +265 -0
- package/static/cms/editor/config.js +10 -0
- package/static/cms/editor/helpers.js +5 -1
- package/static/cms/editor/highlight.js +44 -0
- package/static/cms/editor/sanitize.js +56 -9
- package/static/cms/editor/stega-hydrate.js +80 -0
- package/static/cms/editor/text-edit.js +22 -0
- package/static/cms/editor/tokens-and-text.css +1 -1
- package/static/cms/editor/toolbar.css +101 -4
- package/static/cms/editor/toolbar.js +171 -21
- package/static/cms/editor.js +18 -1
- package/static/cms/signin-hint.css +74 -0
- package/static/cms/studio-login.css +70 -0
- package/static/cms/studio.css +80 -13
- package/dist/runtime/schema/template.d.ts +0 -15
- package/dist/runtime/schema/template.d.ts.map +0 -1
- package/dist/runtime/schema/template.js +0 -38
- package/dist/runtime/schema/template.js.map +0 -1
package/static/cms/studio.css
CHANGED
|
@@ -55,7 +55,6 @@ a {
|
|
|
55
55
|
.studio-header {
|
|
56
56
|
display: flex;
|
|
57
57
|
align-items: center;
|
|
58
|
-
justify-content: space-between;
|
|
59
58
|
gap: var(--space-theme-md);
|
|
60
59
|
padding: var(--space-theme-md) var(--space-theme-lg);
|
|
61
60
|
border-bottom: 1px solid var(--studio-border);
|
|
@@ -65,6 +64,29 @@ a {
|
|
|
65
64
|
z-index: 10;
|
|
66
65
|
}
|
|
67
66
|
|
|
67
|
+
.studio-breadcrumb {
|
|
68
|
+
flex: 1;
|
|
69
|
+
min-width: 0;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: var(--space-theme-sm);
|
|
73
|
+
font-family: var(--studio-font);
|
|
74
|
+
font-size: 11px;
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
line-height: 1.2;
|
|
77
|
+
letter-spacing: 0.08em;
|
|
78
|
+
text-transform: uppercase;
|
|
79
|
+
color: var(--studio-text-dim);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.studio-header-nav {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: var(--space-theme-xs);
|
|
86
|
+
margin-left: auto;
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
68
90
|
.studio-brand {
|
|
69
91
|
display: flex;
|
|
70
92
|
align-items: center;
|
|
@@ -73,24 +95,18 @@ a {
|
|
|
73
95
|
font-size: 1rem;
|
|
74
96
|
letter-spacing: 0.02em;
|
|
75
97
|
color: var(--studio-text);
|
|
98
|
+
transition: color 0.15s;
|
|
99
|
+
flex-shrink: 0;
|
|
76
100
|
}
|
|
77
101
|
|
|
102
|
+
.studio-brand:hover { color: var(--studio-text-muted); }
|
|
103
|
+
|
|
78
104
|
.studio-brand-mark {
|
|
79
105
|
width: 24px;
|
|
80
106
|
height: 24px;
|
|
81
107
|
color: var(--studio-accent);
|
|
82
108
|
}
|
|
83
109
|
|
|
84
|
-
.studio-breadcrumb {
|
|
85
|
-
display: flex;
|
|
86
|
-
align-items: center;
|
|
87
|
-
gap: var(--space-theme-sm);
|
|
88
|
-
font-size: 11px;
|
|
89
|
-
letter-spacing: 0.08em;
|
|
90
|
-
text-transform: uppercase;
|
|
91
|
-
color: var(--studio-text-dim);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
110
|
.studio-breadcrumb a:hover { color: var(--studio-text-muted); }
|
|
95
111
|
.studio-breadcrumb-sep { opacity: 0.4; }
|
|
96
112
|
.studio-breadcrumb-current { color: var(--studio-text-muted); }
|
|
@@ -101,6 +117,37 @@ a {
|
|
|
101
117
|
overflow-y: auto;
|
|
102
118
|
}
|
|
103
119
|
|
|
120
|
+
.studio-home {
|
|
121
|
+
max-width: 64rem;
|
|
122
|
+
margin: 0 auto;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.studio-page-intro {
|
|
126
|
+
text-align: center;
|
|
127
|
+
margin: 0 0 2.5rem;
|
|
128
|
+
font-size: 0.85rem;
|
|
129
|
+
color: var(--studio-text-dim);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.studio-home-grid {
|
|
133
|
+
display: grid;
|
|
134
|
+
gap: 1rem;
|
|
135
|
+
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@media (max-width: 640px) {
|
|
139
|
+
.studio-header {
|
|
140
|
+
flex-wrap: wrap;
|
|
141
|
+
padding: var(--space-theme-sm) var(--space-theme-md);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.studio-breadcrumb {
|
|
145
|
+
order: 3;
|
|
146
|
+
flex-basis: 100%;
|
|
147
|
+
padding-top: var(--space-theme-xs);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
104
151
|
/* ─── Drop zone ─────────────────────────────────────────────────────── */
|
|
105
152
|
|
|
106
153
|
.studio-dropzone {
|
|
@@ -259,9 +306,14 @@ textarea.studio-input {
|
|
|
259
306
|
/* ─── Header nav links ──────────────────────────────────────────────── */
|
|
260
307
|
|
|
261
308
|
.studio-nav-link {
|
|
309
|
+
display: inline-flex;
|
|
310
|
+
align-items: center;
|
|
262
311
|
padding: 4px 12px;
|
|
263
|
-
font-
|
|
264
|
-
|
|
312
|
+
font-family: var(--studio-font);
|
|
313
|
+
font-size: 11px;
|
|
314
|
+
font-weight: 500;
|
|
315
|
+
line-height: 1.2;
|
|
316
|
+
letter-spacing: 0.08em;
|
|
265
317
|
text-transform: uppercase;
|
|
266
318
|
text-decoration: none;
|
|
267
319
|
color: var(--studio-text-dim);
|
|
@@ -269,6 +321,21 @@ textarea.studio-input {
|
|
|
269
321
|
border-radius: var(--radius-theme-xs);
|
|
270
322
|
}
|
|
271
323
|
|
|
324
|
+
button.studio-nav-link {
|
|
325
|
+
appearance: none;
|
|
326
|
+
border: none;
|
|
327
|
+
cursor: pointer;
|
|
328
|
+
background: transparent;
|
|
329
|
+
margin: 0;
|
|
330
|
+
font-family: var(--studio-font);
|
|
331
|
+
font-size: 11px;
|
|
332
|
+
font-weight: 500;
|
|
333
|
+
line-height: 1.2;
|
|
334
|
+
letter-spacing: 0.08em;
|
|
335
|
+
text-transform: uppercase;
|
|
336
|
+
color: var(--studio-text-dim);
|
|
337
|
+
}
|
|
338
|
+
|
|
272
339
|
.studio-nav-link:hover {
|
|
273
340
|
color: var(--studio-text-muted);
|
|
274
341
|
background: var(--color-theme-surface-muted);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build a default entry template from a JSON Schema.
|
|
3
|
-
*
|
|
4
|
-
* Used to seed initial data for new entries in dynamically-created
|
|
5
|
-
* collections. Pure JSON-Schema → value mapping; no validation library
|
|
6
|
-
* (schemas reach core as JSON Schema, e.g. via the caller's own
|
|
7
|
-
* `z.toJSONSchema()`), so core stays Zod-agnostic.
|
|
8
|
-
*/
|
|
9
|
-
import type { CollectionSchema } from "../../types.js";
|
|
10
|
-
/**
|
|
11
|
-
* Generate a default template from a JSON Schema.
|
|
12
|
-
* Used to create initial data for new entries in dynamic collections.
|
|
13
|
-
*/
|
|
14
|
-
export declare function generateTemplateFromSchema(jsonSchema: CollectionSchema): Record<string, unknown>;
|
|
15
|
-
//# sourceMappingURL=template.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../src/runtime/schema/template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOvD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBhG"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build a default entry template from a JSON Schema.
|
|
3
|
-
*
|
|
4
|
-
* Used to seed initial data for new entries in dynamically-created
|
|
5
|
-
* collections. Pure JSON-Schema → value mapping; no validation library
|
|
6
|
-
* (schemas reach core as JSON Schema, e.g. via the caller's own
|
|
7
|
-
* `z.toJSONSchema()`), so core stays Zod-agnostic.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Generate a default template from a JSON Schema.
|
|
11
|
-
* Used to create initial data for new entries in dynamic collections.
|
|
12
|
-
*/
|
|
13
|
-
export function generateTemplateFromSchema(jsonSchema) {
|
|
14
|
-
const template = {};
|
|
15
|
-
for (const [key, prop] of Object.entries(jsonSchema.properties)) {
|
|
16
|
-
const p = prop;
|
|
17
|
-
if (p.default !== undefined) {
|
|
18
|
-
template[key] = p.default;
|
|
19
|
-
}
|
|
20
|
-
else if (p.type === "string") {
|
|
21
|
-
template[key] = "";
|
|
22
|
-
}
|
|
23
|
-
else if (p.type === "number" || p.type === "integer") {
|
|
24
|
-
template[key] = 0;
|
|
25
|
-
}
|
|
26
|
-
else if (p.type === "boolean") {
|
|
27
|
-
template[key] = false;
|
|
28
|
-
}
|
|
29
|
-
else if (p.type === "array") {
|
|
30
|
-
template[key] = [];
|
|
31
|
-
}
|
|
32
|
-
else if (p.type === "object") {
|
|
33
|
-
template[key] = {};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return template;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/runtime/schema/template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAA4B;IACrE,MAAM,QAAQ,GAA4B,EAAE,CAAC;IAE7C,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAChE,MAAM,CAAC,GAAG,IAA0B,CAAC;QAErC,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC5B,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;QAC5B,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC/B,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACrB,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACvD,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAChC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACxB,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC9B,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACrB,CAAC;aAAM,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC/B,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|