includio-cms 0.19.0 → 0.20.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/API.md +409 -0
- package/CHANGELOG.md +55 -0
- package/DOCS.md +1 -1
- package/ROADMAP.md +1 -0
- package/dist/admin/api/rest/handler.d.ts +4 -0
- package/dist/admin/api/rest/handler.js +4 -0
- package/dist/admin/client/index.d.ts +2 -0
- package/dist/admin/client/index.js +4 -0
- package/dist/components/ui/input-group/input-group-input.svelte.d.ts +1 -1
- package/dist/components/ui/sidebar/sidebar-input.svelte.d.ts +1 -1
- package/dist/core/cms.d.ts +4 -0
- package/dist/core/cms.js +4 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/core/server/consentLogs/operations/create.d.ts +4 -0
- package/dist/core/server/consentLogs/operations/create.js +4 -0
- package/dist/core/server/fields/utils/resolveMedia.d.ts +5 -2
- package/dist/core/server/fields/utils/resolveMedia.js +2 -2
- package/dist/core/server/forms/submissions/operations/create.d.ts +7 -0
- package/dist/core/server/forms/submissions/operations/create.js +4 -0
- package/dist/core/server/forms/submissions/utils/parseMultipart.d.ts +4 -0
- package/dist/core/server/forms/submissions/utils/parseMultipart.js +4 -0
- package/dist/db-postgres/index.d.ts +2 -0
- package/dist/db-postgres/index.js +3 -0
- package/dist/entity/index.d.ts +4 -0
- package/dist/entity/index.js +4 -0
- package/dist/files-local/index.d.ts +1 -0
- package/dist/files-local/index.js +1 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/paraglide/messages/_index.d.ts +36 -3
- package/dist/paraglide/messages/_index.js +71 -3
- package/dist/paraglide/messages/en.d.ts +5 -0
- package/dist/paraglide/messages/en.js +14 -0
- package/dist/paraglide/messages/pl.d.ts +5 -0
- package/dist/paraglide/messages/pl.js +14 -0
- package/dist/server/auth.d.ts +4 -0
- package/dist/server/auth.js +4 -0
- package/dist/shop/client/index.d.ts +4 -0
- package/dist/shop/client/index.js +4 -0
- package/dist/sveltekit/config.d.ts +20 -0
- package/dist/sveltekit/config.js +20 -0
- package/dist/sveltekit/server/handle.d.ts +4 -0
- package/dist/sveltekit/server/handle.js +4 -0
- package/dist/sveltekit/server/index.d.ts +1 -0
- package/dist/sveltekit/server/index.js +2 -0
- package/dist/sveltekit/server/layout.d.ts +4 -0
- package/dist/sveltekit/server/layout.js +4 -0
- package/dist/sveltekit/server/preview.d.ts +4 -0
- package/dist/sveltekit/server/preview.js +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/plugins.d.ts +8 -0
- package/dist/updates/0.20.0/index.d.ts +2 -0
- package/dist/updates/0.20.0/index.js +54 -0
- package/dist/updates/index.js +2 -1
- package/package.json +7 -67
- package/dist/paraglide/messages/hello_world.d.ts +0 -5
- package/dist/paraglide/messages/hello_world.js +0 -33
- package/dist/paraglide/messages/login_hello.d.ts +0 -16
- package/dist/paraglide/messages/login_hello.js +0 -34
- package/dist/paraglide/messages/login_please_login.d.ts +0 -16
- package/dist/paraglide/messages/login_please_login.js +0 -34
package/API.md
ADDED
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
# includio-cms — Public API v0.20.0
|
|
2
|
+
|
|
3
|
+
> Auto-generated by `scripts/generate-api-md.ts`. Do not edit by hand.
|
|
4
|
+
|
|
5
|
+
Entry points: **15** · Stable: **345** · Experimental: **2**
|
|
6
|
+
|
|
7
|
+
Tags:
|
|
8
|
+
- `@public` — frozen for v1.0; semver-protected.
|
|
9
|
+
- `@experimental` — may change in 1.x without breaking semver.
|
|
10
|
+
- `@internal` — implementation detail; not listed here, do not import.
|
|
11
|
+
|
|
12
|
+
## Stable
|
|
13
|
+
|
|
14
|
+
### `includio-cms`
|
|
15
|
+
|
|
16
|
+
- `createEntityAPI(cms: CMS, opts?: EntityAPIOptions): <inferred>` — Creates a high-level Entity API (CRUD + publish/archive) bound to a CMS instance and a user.
|
|
17
|
+
- `getAuth(): <inferred>` — Returns the underlying `better-auth` instance from the initialized CMS.
|
|
18
|
+
- `getCMS(): CMS` — Returns the singleton CMS instance. Must be called after `includioCMS()` initializes the CMS in `hooks.server.ts`.
|
|
19
|
+
- `interface ResolvedMedia`
|
|
20
|
+
- `resolveMediaWithStyles(mediaIds: string[], styles?: ImageFieldStyle[]): Promise<Record<string, ResolvedMedia>>` — Resolve media files by IDs and generate image styles. Useful for plugins resolving media references (e.g. photo-grid).
|
|
21
|
+
|
|
22
|
+
### `includio-cms/core`
|
|
23
|
+
|
|
24
|
+
- `createEntityAPI(cms: CMS, opts?: EntityAPIOptions): <inferred>` — Creates a high-level Entity API (CRUD + publish/archive) bound to a CMS instance and a user.
|
|
25
|
+
- `getAuth(): <inferred>` — Returns the underlying `better-auth` instance from the initialized CMS.
|
|
26
|
+
- `getCMS(): CMS` — Returns the singleton CMS instance. Must be called after `includioCMS()` initializes the CMS in `hooks.server.ts`.
|
|
27
|
+
- `interface ResolvedMedia`
|
|
28
|
+
- `resolveMediaWithStyles(mediaIds: string[], styles?: ImageFieldStyle[]): Promise<Record<string, ResolvedMedia>>` — Resolve media files by IDs and generate image styles. Useful for plugins resolving media references (e.g. photo-grid).
|
|
29
|
+
|
|
30
|
+
### `includio-cms/types`
|
|
31
|
+
|
|
32
|
+
- `interface AccordionNode`
|
|
33
|
+
- `interface ApiKeyConfig`
|
|
34
|
+
- `interface ArrayField`
|
|
35
|
+
- `interface AuthConfig`
|
|
36
|
+
- `interface BaseField`
|
|
37
|
+
- `interface BlocksField`
|
|
38
|
+
- `interface BooleanField`
|
|
39
|
+
- `interface Breadcrumb`
|
|
40
|
+
- `interface CardNode`
|
|
41
|
+
- `interface CheckboxesField`
|
|
42
|
+
- `interface CMSConfig`
|
|
43
|
+
- `interface CmsContext`
|
|
44
|
+
- `interface CollectionConfig`
|
|
45
|
+
- `type ColumnRatio = | '1fr 1fr' | '2fr 1fr' | '1fr 2fr' | '3fr 1fr' | '1fr 3fr' | '1fr 1fr 1fr'`
|
|
46
|
+
- `interface ColumnsNode`
|
|
47
|
+
- `interface ConfigBase`
|
|
48
|
+
- `interface ConsentLogData`
|
|
49
|
+
- `interface ContentField`
|
|
50
|
+
- `interface CustomField`
|
|
51
|
+
- `interface DateField`
|
|
52
|
+
- `interface DateTimeField`
|
|
53
|
+
- `type Entry = { _id: string; _slug: string; _type: EntryType; _publishedAt?: Date | null; _url?: string; _sortO...`
|
|
54
|
+
- `type EntryStatus = (typeof entryStatuses)[number]`
|
|
55
|
+
- `type EntryType = (typeof entryTypes)[number]`
|
|
56
|
+
- `type EntryVersionStatus = (typeof entryVersionStatuses)[number]`
|
|
57
|
+
- `type Field = | TextField | ContentField | NumberField | BooleanField | DateField | DateTimeField | FileField |...`
|
|
58
|
+
- `interface FieldCondition`
|
|
59
|
+
- `type FieldType = | 'text' | 'content' | 'number' | 'boolean' | 'date' | 'datetime' | 'file' | 'media' | 'select' |...`
|
|
60
|
+
- `interface FileField`
|
|
61
|
+
- `type FlatImageFieldData = MediaFile & { _styles: Record<string, ImageStyle>; _blurDataUrl?: string | null; }`
|
|
62
|
+
- `type FlatMediaFieldData = FlatImageFieldData | FlatVideoFieldData`
|
|
63
|
+
- `type FlatVideoFieldData = MediaFile & { _styles: Record<string, VideoStyle>; _transcript: MediaFile | null; _audioDescripti...`
|
|
64
|
+
- `interface FormBaseField`
|
|
65
|
+
- `interface FormCheckboxField`
|
|
66
|
+
- `interface FormConfig`
|
|
67
|
+
- `interface FormEmailField`
|
|
68
|
+
- `type FormField = | FormTextField | FormEmailField | FormTextareaField | FormCheckboxField | FormSelectField | Form...`
|
|
69
|
+
- `type FormFieldType = 'text' | 'email' | 'textarea' | 'checkbox' | 'select' | 'file'`
|
|
70
|
+
- `interface FormSelectField`
|
|
71
|
+
- `interface FormSubmission`
|
|
72
|
+
- `interface FormTextareaField`
|
|
73
|
+
- `interface FormTextField`
|
|
74
|
+
- `type IconName = keyof typeof iconMap`
|
|
75
|
+
- `interface ImageFieldData`
|
|
76
|
+
- `interface ImageFieldStyle`
|
|
77
|
+
- `interface ImageStyle`
|
|
78
|
+
- `type Language = 'en' | 'pl'`
|
|
79
|
+
- `type Layout = LayoutPreset | LayoutNode[]`
|
|
80
|
+
- `type LayoutNode = SectionNode | ColumnsNode | CardNode | AccordionNode | StackNode`
|
|
81
|
+
- `type LayoutNodeType = 'section' | 'columns' | 'card' | 'accordion' | 'stack'`
|
|
82
|
+
- `type LayoutPreset = | 'sidebar-right' | 'two-column' | { preset: 'sidebar-right'; sidebar: string[] } | { preset: 'tw...`
|
|
83
|
+
- `type Localized = Partial<Record<InterfaceLanguage, string>> | string`
|
|
84
|
+
- `interface MediaField`
|
|
85
|
+
- `type MediaFieldData = ImageFieldData | VideoFieldData`
|
|
86
|
+
- `interface MediaFile`
|
|
87
|
+
- `type MediaFileType = 'image' | 'video' | 'audio' | 'pdf' | 'other'`
|
|
88
|
+
- `interface MediaTag`
|
|
89
|
+
- `interface NumberField`
|
|
90
|
+
- `interface ObjectField`
|
|
91
|
+
- `type ObjectFieldData = { _id?: string; _slug?: string; } & Record<string, unknown>`
|
|
92
|
+
- `interface RadioField`
|
|
93
|
+
- `interface RelationField`
|
|
94
|
+
- `type RelationFieldData = string | string[]`
|
|
95
|
+
- `interface SCFigureAttrs`
|
|
96
|
+
- `interface SCInlineBlockAttrs`
|
|
97
|
+
- `interface SCMark`
|
|
98
|
+
- `interface SCNode`
|
|
99
|
+
- `interface SCTypedInlineBlock`
|
|
100
|
+
- `interface SCVideoAttrs`
|
|
101
|
+
- `interface SectionNode`
|
|
102
|
+
- `interface SelectField`
|
|
103
|
+
- `interface SeoField`
|
|
104
|
+
- `interface SeoFieldData`
|
|
105
|
+
- `interface ShopField`
|
|
106
|
+
- `interface ShopFieldData`
|
|
107
|
+
- `type SimpleArrayItemType = 'text' | 'number' | 'url'`
|
|
108
|
+
- `interface SingleConfig`
|
|
109
|
+
- `interface SlugField`
|
|
110
|
+
- `interface StackNode`
|
|
111
|
+
- `interface StructuredContentDoc`
|
|
112
|
+
- `interface TextField`
|
|
113
|
+
- `interface TypographyConfig`
|
|
114
|
+
- `interface UrlField`
|
|
115
|
+
- `type UrlFieldData = { id?: string; url: Record<string, string>; text?: Record<string, string>; newTab?: boolean; rel?...`
|
|
116
|
+
- `interface UserData`
|
|
117
|
+
- `interface VideoFieldData`
|
|
118
|
+
- `interface VideoFieldStyle`
|
|
119
|
+
- `interface VideoStyle`
|
|
120
|
+
- `type VideoStyleStatus = 'pending' | 'processing' | 'done' | 'failed'`
|
|
121
|
+
|
|
122
|
+
### `includio-cms/admin/client`
|
|
123
|
+
|
|
124
|
+
- `const AcceptInvitePage: LegacyComponentType`
|
|
125
|
+
- `const AdminAfterLoginLayout: LegacyComponentType`
|
|
126
|
+
- `const AdminLayout: LegacyComponentType`
|
|
127
|
+
- `const Badge: LegacyComponentType`
|
|
128
|
+
- `buildCustomFieldsMap(...plugins: PluginConfig[]): Map<string, CustomFieldDefinition>` — Build a Map<fieldType, CustomFieldDefinition> from plugin configs.
|
|
129
|
+
- `const Button: LegacyComponentType`
|
|
130
|
+
- `Card`
|
|
131
|
+
- `const CollectionPage: LegacyComponentType`
|
|
132
|
+
- `const DashboardPage: LegacyComponentType`
|
|
133
|
+
- `Dialog`
|
|
134
|
+
- `const EntryPage: LegacyComponentType`
|
|
135
|
+
- `const FileMiniature: LegacyComponentType`
|
|
136
|
+
- `const FormPage: LegacyComponentType`
|
|
137
|
+
- `const FormSubmissionPage: LegacyComponentType`
|
|
138
|
+
- `getContentLanguage`
|
|
139
|
+
- `getCustomFields(): Map<string, CustomFieldDefinition>`
|
|
140
|
+
- `getLocalizedLabel(label: Localized | undefined, lang: InterfaceLanguage): string`
|
|
141
|
+
- `getRemotes(): typeof remotes`
|
|
142
|
+
- `const Input: LegacyComponentType`
|
|
143
|
+
- `const Label: LegacyComponentType`
|
|
144
|
+
- `const LoginPage: LegacyComponentType`
|
|
145
|
+
- `const MaintenancePage: LegacyComponentType`
|
|
146
|
+
- `const MediaPage: LegacyComponentType`
|
|
147
|
+
- `const MediaSelector: LegacyComponentType`
|
|
148
|
+
- `const ResetPasswordPage: LegacyComponentType`
|
|
149
|
+
- `const Separator: LegacyComponentType`
|
|
150
|
+
- `const ShippingMethodEditPage: LegacyComponentType`
|
|
151
|
+
- `const ShippingMethodNewPage: LegacyComponentType`
|
|
152
|
+
- `const ShippingMethodsListPage: LegacyComponentType`
|
|
153
|
+
- `const ShopOrderDetailPage: LegacyComponentType`
|
|
154
|
+
- `const ShopOrdersListPage: LegacyComponentType`
|
|
155
|
+
- `const ShopProductsListPage: LegacyComponentType`
|
|
156
|
+
- `const Skeleton: LegacyComponentType`
|
|
157
|
+
- `Tabs`
|
|
158
|
+
- `Tooltip`
|
|
159
|
+
- `useField(form: SuperForm<Record<string, unknown>>, path: FormPathLeaves<Record<string, unknown>>): <inferred>` — Simplified wrapper around sveltekit-superforms' formFieldProxy.
|
|
160
|
+
- `useInterfaceLanguage(): <inferred>`
|
|
161
|
+
- `const UsersPage: LegacyComponentType`
|
|
162
|
+
|
|
163
|
+
### `includio-cms/admin/remote`
|
|
164
|
+
|
|
165
|
+
- `const archiveEntryCommand: <inferred>`
|
|
166
|
+
- `const bulkDeleteMediaFiles: <inferred>`
|
|
167
|
+
- `const bulkSetMediaFileTags: <inferred>`
|
|
168
|
+
- `const cancelShipmentForOrderCmd: <inferred>`
|
|
169
|
+
- `const countMediaFiles: <inferred>`
|
|
170
|
+
- `const createEntry: <inferred>`
|
|
171
|
+
- `const createMediaTag: <inferred>`
|
|
172
|
+
- `const createShipmentForOrderCmd: <inferred>`
|
|
173
|
+
- `const createShippingMethodCmd: <inferred>`
|
|
174
|
+
- `const deleteEntryCommand: <inferred>`
|
|
175
|
+
- `const deleteFormSubmission: <inferred>`
|
|
176
|
+
- `const deleteFormSubmissions: <inferred>`
|
|
177
|
+
- `const deleteMediaFile: <inferred>`
|
|
178
|
+
- `const deleteMediaTag: <inferred>`
|
|
179
|
+
- `const deleteShippingMethodCmd: <inferred>`
|
|
180
|
+
- `const deleteShopDataForEntry: <inferred>`
|
|
181
|
+
- `const exportFormSubmissions: <inferred>`
|
|
182
|
+
- `const findMediaReferences: <inferred>`
|
|
183
|
+
- `const generateAltText: <inferred>`
|
|
184
|
+
- `const getAltOverview: <inferred>`
|
|
185
|
+
- `const getCollection: <inferred>`
|
|
186
|
+
- `const getCollections: <inferred>`
|
|
187
|
+
- `const getEmailConfigured: <inferred>`
|
|
188
|
+
- `const getEntries: <inferred>`
|
|
189
|
+
- `const getEntry: <inferred>`
|
|
190
|
+
- `const getEntryForEntryPage: <inferred>`
|
|
191
|
+
- `const getEntryLabels: <inferred>`
|
|
192
|
+
- `const getEntryVersion: <inferred>`
|
|
193
|
+
- `const getFileById: <inferred>`
|
|
194
|
+
- `const getForm: <inferred>`
|
|
195
|
+
- `const getForms: <inferred>`
|
|
196
|
+
- `const getFormSubmission: <inferred>`
|
|
197
|
+
- `const getFormSubmissions: <inferred>`
|
|
198
|
+
- `const getLanguages: <inferred>`
|
|
199
|
+
- `const getMedia: <inferred>`
|
|
200
|
+
- `const getMediaFiles: <inferred>`
|
|
201
|
+
- `const getMediaTags: <inferred>`
|
|
202
|
+
- `const getMediaTagsWithCounts: <inferred>`
|
|
203
|
+
- `const getOrderForAdmin: <inferred>`
|
|
204
|
+
- `const getRawEntries: <inferred>`
|
|
205
|
+
- `const getRawEntry: <inferred>`
|
|
206
|
+
- `const getRecentActivity: <inferred>`
|
|
207
|
+
- `const getRecentEntries: <inferred>`
|
|
208
|
+
- `const getRecordBySlug: <inferred>`
|
|
209
|
+
- `const getShippingMethodForAdmin: <inferred>`
|
|
210
|
+
- `const getShopConfig: <inferred>`
|
|
211
|
+
- `const getShopDataForEntry: <inferred>`
|
|
212
|
+
- `const getShopEnabled: <inferred>`
|
|
213
|
+
- `const getSingles: <inferred>`
|
|
214
|
+
- `const getSubmissionsOverview: <inferred>`
|
|
215
|
+
- `const isAIAvailable: <inferred>`
|
|
216
|
+
- `const listOrdersAdmin: <inferred>`
|
|
217
|
+
- `const listShippingMethodsAdmin: <inferred>`
|
|
218
|
+
- `const listShopableCollections: <inferred>`
|
|
219
|
+
- `const listShopProductEntries: <inferred>`
|
|
220
|
+
- `const populatePreviewData: <inferred>`
|
|
221
|
+
- `const regenerateVideoPoster: <inferred>`
|
|
222
|
+
- `const renameMediaFile: <inferred>`
|
|
223
|
+
- `const reorderEntriesCommand: <inferred>`
|
|
224
|
+
- `const reorderShippingMethodsCmd: <inferred>`
|
|
225
|
+
- `const resendOrderEmailCmd: <inferred>`
|
|
226
|
+
- `const setFocalPoint: <inferred>`
|
|
227
|
+
- `const setMediaFileAlt: <inferred>`
|
|
228
|
+
- `const setMediaFileTags: <inferred>`
|
|
229
|
+
- `const unarchiveEntryCommand: <inferred>`
|
|
230
|
+
- `const updateEntryCommand: <inferred>`
|
|
231
|
+
- `const updateEntryVersionCommand: <inferred>`
|
|
232
|
+
- `const updateFormSubmission: <inferred>`
|
|
233
|
+
- `const updateMediaAccessibility: <inferred>`
|
|
234
|
+
- `const updateMediaTag: <inferred>`
|
|
235
|
+
- `const updateOrderStatusCmd: <inferred>`
|
|
236
|
+
- `const updateShippingMethodCmd: <inferred>`
|
|
237
|
+
- `const upsertShopDataForEntry: <inferred>`
|
|
238
|
+
|
|
239
|
+
### `includio-cms/sveltekit`
|
|
240
|
+
|
|
241
|
+
- `const CmsProvider: LegacyComponentType`
|
|
242
|
+
- `defineCollection(config: CollectionInput): CollectionConfig` — Defines a collection (multi-entry content type).
|
|
243
|
+
- `defineConfig(config: CMSConfig): CMSConfig` — Defines the root CMS configuration. Pass to `includioCMS()` in `hooks.server.ts`.
|
|
244
|
+
- `defineForm(config: FormConfig): FormConfig` — Defines a public form (submitted via `/api/forms/[slug]/submit`).
|
|
245
|
+
- `defineObject(config: Omit<ObjectField, 'type'>): ObjectField` — Defines a reusable object field (nested record). Use inside `fields[]`.
|
|
246
|
+
- `defineSingle(config: SingleInput): SingleConfig` — Defines a singleton (single-entry content type, e.g. site settings).
|
|
247
|
+
- `enableHybridEditing(): <inferred>` — Call in a layout/component script to enable data-hybrid-path rendering for all descendant HybridTarget/Image/Video.
|
|
248
|
+
- `extractBlocks(doc: StructuredContentDoc, type?: string): SCNode[]` — Extract block-level nodes, optionally filtered by type.
|
|
249
|
+
- `extractInlineBlocks(doc: StructuredContentDoc, blockType?: string): SCInlineBlockAttrs[]` — Extract inline block nodes, optionally filtered by blockType.
|
|
250
|
+
- `extractMediaRefs(doc: StructuredContentDoc): MediaRef[]` — Extract media references from figure/video/image nodes.
|
|
251
|
+
- `extractText(doc: StructuredContentDoc): string` — Extract all plain text from doc (useful for excerpts, search indexing).
|
|
252
|
+
- `getCustomFields(): Map<string, CustomFieldDefinition>`
|
|
253
|
+
- `getLink(link: string | { url: string | Record<string, string> } |..., language?: string): string` — Resolves a link value to a URL string.
|
|
254
|
+
- `getRemotes(): typeof remotes`
|
|
255
|
+
- `const HybridTarget: LegacyComponentType`
|
|
256
|
+
- `const Image: LegacyComponentType`
|
|
257
|
+
- `isImageFieldData(media: MediaFieldData): media is ImageFieldData`
|
|
258
|
+
- `isVideoFieldData(media: MediaFieldData): media is VideoFieldData`
|
|
259
|
+
- `const Media: LegacyComponentType`
|
|
260
|
+
- `const Preview: LegacyComponentType`
|
|
261
|
+
- `setCustomFields(defs: Map<string, CustomFieldDefinition>): <inferred>`
|
|
262
|
+
- `setPreferMp4(value: boolean): <inferred>`
|
|
263
|
+
- `setRemotes(data: typeof remotes): <inferred>`
|
|
264
|
+
- `const StructuredContent: LegacyComponentType`
|
|
265
|
+
- `structuredToHtml(doc: StructuredContentDoc, options: StructuredToHtmlOptions = {}): string` — Convert a StructuredContentDoc to an HTML string.
|
|
266
|
+
- `const Video: LegacyComponentType`
|
|
267
|
+
|
|
268
|
+
### `includio-cms/sveltekit/server`
|
|
269
|
+
|
|
270
|
+
- `cmsLayoutLoad(event: RequestEvent): <inferred>` — Returns `cmsContext` from `event.locals` for use in a SvelteKit layout `load`. Drop into your `+layout.server.ts`.
|
|
271
|
+
- `countEntries(opts: CountEntriesOptions): Promise<number>` — Count entries matching the same filters as `resolveEntries`, without populating.
|
|
272
|
+
- `type CountEntriesOptions = Omit< ResolveEntriesOptions, 'limit' | 'offset' | 'populate' | 'orderBy' | 'dataOrderBy' >`
|
|
273
|
+
- `const createConsentLog: <inferred>`
|
|
274
|
+
- `const createFormSubmission: <inferred>`
|
|
275
|
+
- `createRestApiHandler(): <inferred>` — REST API handler factory. Returns `{ GET, POST, PUT, DELETE }` `RequestHandler`s authenticated via `x-api-key` header. Mount in `src/routes/admin/api/rest/[...restPath]/+server.ts`.
|
|
276
|
+
- `getPreviewEntry(event: RequestEvent, options: { language: string }): Promise<Entry | null>` — Resolves the preview entry from a `?preview=<versionId>` query param. Requires an authenticated session — throws `Unauthorized` otherwise.
|
|
277
|
+
- `includioCMS(cmsConfig: CMSConfig): Handle[]` — SvelteKit `Handle[]` array that initializes the CMS, generates runtime artifacts, wires auth/admin guards, and exposes `event.locals.cmsContext`. Compose with `sequence()` in `hooks.server.ts`.
|
|
278
|
+
- `parseFormDataForSubmission(formData: FormData, fields: FormField[]): Promise<Record<string, unknown>>` — Parses multipart `FormData` into a typed record of field values, handling file uploads via the configured files adapter.
|
|
279
|
+
- `type PopulateConfig = { /** Hard cap on relation depth. Default 5. Use `0` to keep all relations as raw IDs. */ maxDept...` — Recursion + per-field opt-out config for relation population.
|
|
280
|
+
- `resolveEntries(opts: ResolveEntriesOptions): Promise<Entry[]>` — Fetch a list of populated Entries from a collection (or singleton with multiple instances).
|
|
281
|
+
- `interface ResolveEntriesOptions`
|
|
282
|
+
- `resolveEntry(opts: ResolveEntryOptions): Promise<Entry | null>` — Fetch a single populated Entry.
|
|
283
|
+
- `interface ResolveEntryOptions`
|
|
284
|
+
- `type ResolveStatus = 'published' | 'draft' | 'scheduled'` — Status filter for `resolveEntry`/`resolveEntries`/`countEntries`.
|
|
285
|
+
|
|
286
|
+
### `includio-cms/db-postgres`
|
|
287
|
+
|
|
288
|
+
- `const account: <inferred>`
|
|
289
|
+
- `const accountRelations: <inferred>`
|
|
290
|
+
- `const consentLogsTable: <inferred>`
|
|
291
|
+
- `type DatabaseAdapterWithDrizzle = DatabaseAdapter & { _drizzle: ReturnType<typeof drizzle<typeof schema>>; }`
|
|
292
|
+
- `const entriesTable: <inferred>`
|
|
293
|
+
- `const entryVersionsTable: <inferred>`
|
|
294
|
+
- `const formSubmissionsTable: <inferred>`
|
|
295
|
+
- `const imageStylesTable: <inferred>`
|
|
296
|
+
- `type InpostParcelSize = 'A' | 'B' | 'C'`
|
|
297
|
+
- `type InpostServiceType = | 'inpost_locker_standard' | 'inpost_locker_express' | 'inpost_courier_standard' | 'inpost_courie...`
|
|
298
|
+
- `const invitation: <inferred>`
|
|
299
|
+
- `const mediaFilesTable: <inferred>`
|
|
300
|
+
- `const mediaFileTagsTable: <inferred>`
|
|
301
|
+
- `const mediaTagsTable: <inferred>`
|
|
302
|
+
- `pg(config: Config): DatabaseAdapterWithDrizzle` — Postgres database adapter (drizzle + `postgres`).
|
|
303
|
+
- `const session: <inferred>`
|
|
304
|
+
- `const sessionRelations: <inferred>`
|
|
305
|
+
- `interface ShippingCarrierConfig`
|
|
306
|
+
- `type ShopCarrierType = 'none' | 'inpost' | string`
|
|
307
|
+
- `const shopOrderItemsTable: <inferred>`
|
|
308
|
+
- `const shopOrdersTable: <inferred>`
|
|
309
|
+
- `const shopOrderStatusHistoryTable: <inferred>`
|
|
310
|
+
- `const shopPaymentsTable: <inferred>`
|
|
311
|
+
- `type ShopPaymentStatus = 'pending' | 'paid' | 'failed' | 'refunded' | 'cancelled'`
|
|
312
|
+
- `const shopProductsTable: <inferred>`
|
|
313
|
+
- `const shopProductVariantsTable: <inferred>`
|
|
314
|
+
- `const shopShippingMethodsTable: <inferred>`
|
|
315
|
+
- `const shopStockReservationsTable: <inferred>`
|
|
316
|
+
- `const user: <inferred>`
|
|
317
|
+
- `const userRelations: <inferred>`
|
|
318
|
+
- `const verification: <inferred>`
|
|
319
|
+
- `const videoStylesTable: <inferred>`
|
|
320
|
+
|
|
321
|
+
### `includio-cms/shop`
|
|
322
|
+
|
|
323
|
+
- `interface CarrierAdapter`
|
|
324
|
+
- `interface CarrierEvent`
|
|
325
|
+
- `interface ConsentConfig`
|
|
326
|
+
- `type Currency = 'PLN'`
|
|
327
|
+
- `defineShop(config: ShopConfig): ResolvedShopConfig`
|
|
328
|
+
- `type GeowidgetConfigPreset = | 'parcelcollect' | 'parcelsend' | 'parcelcollect247' | string`
|
|
329
|
+
- `type I18nText = { [lang: string]: string; }`
|
|
330
|
+
- `inpostAdapter(opts: InpostAdapterOptions): CarrierAdapter`
|
|
331
|
+
- `interface InpostAdapterOptions`
|
|
332
|
+
- `type InpostEnvironment = 'production' | 'sandbox'` — InPost Points API — public, no auth required. Used to validate that a parcel
|
|
333
|
+
- `interface InpostSenderAddress`
|
|
334
|
+
- `manualAdapter(opts: ManualPaymentAdapterOptions = {}): PaymentAdapter` — Manual payment adapter — order goes to awaitingPayment, admin marks as paid later
|
|
335
|
+
- `interface OrderRef`
|
|
336
|
+
- `type OrderStatus = | 'new' | 'awaitingPayment' | 'paid' | 'preparing' | 'sent' | 'done' | 'cancelled' | 'paymentReje...`
|
|
337
|
+
- `interface PaymentAdapter`
|
|
338
|
+
- `interface PaymentCreateContext`
|
|
339
|
+
- `interface PaymentCreateResult`
|
|
340
|
+
- `interface PaymentEvent`
|
|
341
|
+
- `payuAdapter(opts: PayuAdapterOptions): PaymentAdapter`
|
|
342
|
+
- `interface PayuAdapterOptions`
|
|
343
|
+
- `interface ResolvedShopConfig`
|
|
344
|
+
- `interface ShipmentCreateInput`
|
|
345
|
+
- `interface ShipmentCreateResult`
|
|
346
|
+
- `interface ShipmentLabel`
|
|
347
|
+
- `interface ShopConfig`
|
|
348
|
+
- `interface ShopFeatures`
|
|
349
|
+
|
|
350
|
+
### `includio-cms/shop/client`
|
|
351
|
+
|
|
352
|
+
- `interface CartItemRef`
|
|
353
|
+
- `interface CartLine`
|
|
354
|
+
- `interface CartSnapshot`
|
|
355
|
+
- `interface CheckoutInput`
|
|
356
|
+
- `interface CheckoutResult`
|
|
357
|
+
- `createOrderState(opts: CreateOrderStateOptions): OrderState`
|
|
358
|
+
- `interface CreateOrderStateOptions`
|
|
359
|
+
- `createShopClient(options: ShopClientOptions = {}): ShopClient`
|
|
360
|
+
- `const DEFAULT_LABELS_PL: OrderStatusLabels`
|
|
361
|
+
- `const InpostPicker: LegacyComponentType`
|
|
362
|
+
- `interface OrderDetailResponse`
|
|
363
|
+
- `type OrderPaymentPhase = 'idle' | 'polling' | 'retrying' | 'refreshing'`
|
|
364
|
+
- `type OrderState = OrderStateImpl`
|
|
365
|
+
- `const OrderStatus: LegacyComponentType`
|
|
366
|
+
- `interface OrderStatusLabels`
|
|
367
|
+
- `interface RefreshPaymentResult`
|
|
368
|
+
- `interface RetryPaymentResult`
|
|
369
|
+
- `interface ShippingMethodPublic`
|
|
370
|
+
- `interface ShopClient`
|
|
371
|
+
- `interface ShopClientOptions`
|
|
372
|
+
|
|
373
|
+
### `includio-cms/shop/http`
|
|
374
|
+
|
|
375
|
+
- `createCarrierConfigHandler(): { GET: RequestHandler }` — Public endpoint that returns front-end facing carrier widget descriptor for
|
|
376
|
+
- `createCarrierWebhookHandler(): { POST: RequestHandler }` — Public webhook receiver for carrier events (e.g. ShipX `shipment_status_changed`).
|
|
377
|
+
- `createCartHandler(): { GET: RequestHandler; POST: RequestHandler; PATCH: RequestHandler; DELETE: R...`
|
|
378
|
+
- `createCheckoutHandler(): { POST: RequestHandler }`
|
|
379
|
+
- `createOrderHandler(): { GET: RequestHandler }`
|
|
380
|
+
- `createPaymentWebhookHandler(): { POST: RequestHandler }`
|
|
381
|
+
- `createRefreshPaymentHandler(): { POST: RequestHandler }`
|
|
382
|
+
- `createRetryPaymentHandler(): { POST: RequestHandler }`
|
|
383
|
+
- `createShipmentLabelHandler(): { GET: RequestHandler }` — Admin-only PDF proxy that streams the carrier label without exposing the
|
|
384
|
+
- `createShippingMethodsHandler(): { GET: RequestHandler }`
|
|
385
|
+
|
|
386
|
+
### `includio-cms/files-local`
|
|
387
|
+
|
|
388
|
+
- `const fullDir: <inferred>`
|
|
389
|
+
- `local(config?: LocalFilesConfig): FilesAdapter` — Local-disk files adapter. Stores uploads under `./static/uploads` (dev) or `/data/uploads` (prod).
|
|
390
|
+
- `interface LocalFilesConfig`
|
|
391
|
+
|
|
392
|
+
### `includio-cms/email-nodemailer`
|
|
393
|
+
|
|
394
|
+
- `nodemailerAdapter(options: Options): EmailAdapter` — SMTP email adapter built on `nodemailer`.
|
|
395
|
+
|
|
396
|
+
### `includio-cms/ai-openai`
|
|
397
|
+
|
|
398
|
+
- `openAIAdapter(config: AIConfig): AIAdapter` — OpenAI AI adapter for `generateAltText`.
|
|
399
|
+
|
|
400
|
+
### `includio-cms/ai-claude`
|
|
401
|
+
|
|
402
|
+
- `claudeAdapter(config: AIConfig): AIAdapter` — Anthropic Claude AI adapter for `generateAltText`.
|
|
403
|
+
|
|
404
|
+
## Experimental
|
|
405
|
+
|
|
406
|
+
### `includio-cms/types`
|
|
407
|
+
|
|
408
|
+
- `interface CustomFieldDefinition` — Defines a custom field type contributed by a plugin.
|
|
409
|
+
- `interface PluginConfig` — CMS plugin configuration — register custom field types and CRUD lifecycle hooks.
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,61 @@
|
|
|
3
3
|
All notable changes to includio-cms are documented here.
|
|
4
4
|
Generated from `src/lib/updates/` — do not edit manually.
|
|
5
5
|
|
|
6
|
+
## 0.20.0 — 2026-04-29
|
|
7
|
+
|
|
8
|
+
API Surface Lock — exports trim 26→15, JSDoc tagi (`@public`/`@experimental`/`@internal`), autogenerowany `API.md`. Powierzchnia publiczna zamrożona w v1.0 — w 1.x tylko `@experimental` może się zmienić bez breaking semver.
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `API.md` w root — autogenerowany przez `scripts/generate-api-md.ts` (ts-morph). 15 entry pointów, ~345 stable, 2 experimental. Skrypt wpięty w `prepublishOnly`.
|
|
12
|
+
- Wszystkie publiczne `define*` helpery (`defineConfig`, `defineCollection`, `defineSingle`, `defineForm`, `defineObject`) oznaczone `@public`.
|
|
13
|
+
- `getCMS`, `getAuth`, `createEntityAPI`, `resolveMediaWithStyles`, `includioCMS`, `cmsLayoutLoad`, `getPreviewEntry`, `createFormSubmission`, `parseFormDataForSubmission`, `createConsentLog`, `createRestApiHandler` — `@public`.
|
|
14
|
+
- `PluginConfig` + `CustomFieldDefinition` oznaczone `@experimental` — plugin hooks API finalizujemy w 1.x.
|
|
15
|
+
|
|
16
|
+
### Breaking
|
|
17
|
+
- **`package.json` exports trim 26→15.** Usunięte / scalone entry pointy poniżej. Każdy import wymaga jednorazowej migracji (znajdź-i-zamień).
|
|
18
|
+
- `includio-cms/admin` → `includio-cms/types` (typy `UserData`, `Breadcrumb` przeniesione do publicznych typów).
|
|
19
|
+
- `includio-cms/admin/helpers` → `includio-cms/admin/client` (re-eksport — zmień tylko ścieżkę importu).
|
|
20
|
+
- `includio-cms/admin/ui` → `includio-cms/admin/client` (re-eksport — zmień tylko ścieżkę importu).
|
|
21
|
+
- `includio-cms/admin/client/account` → `includio-cms/admin/client` (re-eksport — `AccountPage` dostępny pod nową ścieżką).
|
|
22
|
+
- `includio-cms/admin/api/*` (wildcard) → **usunięte**. Były to internalsy (media-gc, upload, transcode, replace) — nie powinny być publiczne. Brak migracji.
|
|
23
|
+
- `includio-cms/admin/api/rest/handler` → `includio-cms/sveltekit/server` (`createRestApiHandler` — zmień ścieżkę importu).
|
|
24
|
+
- `includio-cms/admin/client/*.svelte` (wildcard) → użyj nazwanych eksportów z `includio-cms/admin/client`.
|
|
25
|
+
- `includio-cms/sveltekit/components/*.svelte` (wildcard) → użyj nazwanych eksportów z `includio-cms/sveltekit`.
|
|
26
|
+
- `includio-cms/db-postgres/schema-core` + `includio-cms/db-postgres/schema-shop` + `includio-cms/auth-schema` → `includio-cms/db-postgres` (jeden barrel — wszystkie tabele, w tym auth, dostępne pod jedną ścieżką).
|
|
27
|
+
- `includio-cms/auth` → `includio-cms/core` (`getAuth` — zmień ścieżkę importu).
|
|
28
|
+
- `includio-cms/entity` → `includio-cms/core` (`createEntityAPI` — zmień ścieżkę importu).
|
|
29
|
+
- `includio-cms/shop/svelte` → `includio-cms/shop/client` (`OrderStatus`, `InpostPicker`, `DEFAULT_LABELS_PL`, `OrderStatusLabels` — zmień ścieżkę importu).
|
|
30
|
+
- `includio-cms/updates` → **usunięte** (internal CLI tooling, nigdy nie powinno być w runtime API).
|
|
31
|
+
|
|
32
|
+
### Notes
|
|
33
|
+
|
|
34
|
+
Migracja (znajdź-i-zamień):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Przykładowe sed'y (dostosuj do swojego edytora):
|
|
38
|
+
sed -i '' "s|'includio-cms/admin/helpers'|'includio-cms/admin/client'|g" src/**/*.ts
|
|
39
|
+
sed -i '' "s|'includio-cms/admin/ui'|'includio-cms/admin/client'|g" src/**/*.ts
|
|
40
|
+
sed -i '' "s|'includio-cms/auth'|'includio-cms/core'|g" src/**/*.ts
|
|
41
|
+
sed -i '' "s|'includio-cms/entity'|'includio-cms/core'|g" src/**/*.ts
|
|
42
|
+
sed -i '' "s|'includio-cms/shop/svelte'|'includio-cms/shop/client'|g" src/**/*.ts
|
|
43
|
+
sed -i '' "s|'includio-cms/auth-schema'|'includio-cms/db-postgres'|g" src/**/*.ts
|
|
44
|
+
sed -i '' "s|'includio-cms/db-postgres/schema-core'|'includio-cms/db-postgres'|g" src/**/*.ts
|
|
45
|
+
sed -i '' "s|'includio-cms/db-postgres/schema-shop'|'includio-cms/db-postgres'|g" src/**/*.ts
|
|
46
|
+
sed -i '' "s|'includio-cms/admin/api/rest/handler'|'includio-cms/sveltekit/server'|g" src/**/*.ts
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Po migracji uruchom `pnpm check` — TypeScript zweryfikuje czy wszystkie symbole są dostępne pod nową ścieżką.
|
|
50
|
+
|
|
51
|
+
API Surface freeze v1.0:
|
|
52
|
+
|
|
53
|
+
- **`@public`** — stabilne, semver-protected w v1.0. Breaking change wymaga major bump.
|
|
54
|
+
- **`@experimental`** — może się zmienić w 1.x bez breaking semver (np. `PluginConfig` — plugin hooks API).
|
|
55
|
+
- **`@internal`** — implementation detail, NIE importować. Nie listowane w `API.md`.
|
|
56
|
+
|
|
57
|
+
Pełna lista publicznych symboli per entry point: `API.md` w root paczki (regenerowany przy każdym `npm publish`).
|
|
58
|
+
|
|
59
|
+
Brak SQL migration. Zmiana czysto package-level.
|
|
60
|
+
|
|
6
61
|
## 0.19.0 — 2026-04-29
|
|
7
62
|
|
|
8
63
|
Adapter contracts final + 3rd-party SDKs (`@anthropic-ai/sdk`, `openai`, `nodemailer`) przeniesione do `peerDependenciesMeta` jako optional. Adapter typy + factory oznaczone `@public` JSDoc. README sekcja "Writing your own adapter".
|
package/DOCS.md
CHANGED
package/ROADMAP.md
CHANGED
|
@@ -338,6 +338,7 @@
|
|
|
338
338
|
|
|
339
339
|
> 13 faz w ~16 sesjach, droga 0.16 → 1.0.0. Lean scope: stabilizacja, security, testy, docs, audit + polish shopa. Bez nowych feature'ów.
|
|
340
340
|
|
|
341
|
+
- [x] `[breaking]` `[P0]` API surface lock — exports trim 26→15, JSDoc tagi (@public/@internal/@experimental), `API.md` autogenerated (0.20.0) <!-- files: package.json, scripts/generate-api-md.ts -->
|
|
341
342
|
- [ ] `[fix]` `[P1]` Select field — `defaultValue` propagacja do zod schema (full repro: `ideas/post-v1/select-field-defaultvalue-bug.md`); fix planowany w Fazie 12 (RC)
|
|
342
343
|
|
|
343
344
|
## v1.x — Post-v1.0 deferred
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type RequestHandler } from '@sveltejs/kit';
|
|
2
|
+
/**
|
|
3
|
+
* REST API handler factory. Returns `{ GET, POST, PUT, DELETE }` `RequestHandler`s authenticated via `x-api-key` header. Mount in `src/routes/admin/api/rest/[...restPath]/+server.ts`.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
2
6
|
export declare function createRestApiHandler(): {
|
|
3
7
|
GET: RequestHandler;
|
|
4
8
|
POST: RequestHandler;
|
|
@@ -49,6 +49,10 @@ function matchRoute(method, path) {
|
|
|
49
49
|
}
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* REST API handler factory. Returns `{ GET, POST, PUT, DELETE }` `RequestHandler`s authenticated via `x-api-key` header. Mount in `src/routes/admin/api/rest/[...restPath]/+server.ts`.
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
52
56
|
export function createRestApiHandler() {
|
|
53
57
|
function handle(method) {
|
|
54
58
|
return async (event) => {
|
|
@@ -18,3 +18,5 @@ export { default as ShippingMethodNewPage } from './shop/shipping-method-new-pag
|
|
|
18
18
|
export { default as ShippingMethodEditPage } from './shop/shipping-method-edit-page.svelte';
|
|
19
19
|
export { default as ShopOrdersListPage } from './shop/shop-orders-list-page.svelte';
|
|
20
20
|
export { default as ShopOrderDetailPage } from './shop/shop-order-detail-page.svelte';
|
|
21
|
+
export * from '../helpers/index.js';
|
|
22
|
+
export * from '../ui/index.js';
|
|
@@ -18,3 +18,7 @@ export { default as ShippingMethodNewPage } from './shop/shipping-method-new-pag
|
|
|
18
18
|
export { default as ShippingMethodEditPage } from './shop/shipping-method-edit-page.svelte';
|
|
19
19
|
export { default as ShopOrdersListPage } from './shop/shop-orders-list-page.svelte';
|
|
20
20
|
export { default as ShopOrderDetailPage } from './shop/shop-order-detail-page.svelte';
|
|
21
|
+
// Folded from `./admin/helpers` (dropped as separate export in 0.20.0)
|
|
22
|
+
export * from '../helpers/index.js';
|
|
23
|
+
// Folded from `./admin/ui` (dropped as separate export in 0.20.0)
|
|
24
|
+
export * from '../ui/index.js';
|
|
@@ -2,7 +2,7 @@ declare const InputGroupInput: import("svelte").Component<(Omit<import("svelte/e
|
|
|
2
2
|
type: "file";
|
|
3
3
|
files?: FileList;
|
|
4
4
|
} | {
|
|
5
|
-
type?: "number" | "image" | "url" | "text" | "date" | "radio" | "color" | "button" | "checkbox" | "search" | (string & {}) | "email" | "
|
|
5
|
+
type?: "number" | "image" | "url" | "text" | "date" | "radio" | "color" | "button" | "checkbox" | "search" | (string & {}) | "email" | "password" | "time" | "hidden" | "reset" | "submit" | "tel" | "datetime-local" | "month" | "range" | "week";
|
|
6
6
|
files?: undefined;
|
|
7
7
|
})) & {
|
|
8
8
|
ref?: HTMLElement | null | undefined;
|
|
@@ -2,7 +2,7 @@ declare const SidebarInput: import("svelte").Component<(Omit<import("svelte/elem
|
|
|
2
2
|
type: "file";
|
|
3
3
|
files?: FileList;
|
|
4
4
|
} | {
|
|
5
|
-
type?: "number" | "image" | "url" | "text" | "date" | "radio" | "color" | "button" | "checkbox" | "search" | (string & {}) | "email" | "
|
|
5
|
+
type?: "number" | "image" | "url" | "text" | "date" | "radio" | "color" | "button" | "checkbox" | "search" | (string & {}) | "email" | "password" | "time" | "hidden" | "reset" | "submit" | "tel" | "datetime-local" | "month" | "range" | "week";
|
|
6
6
|
files?: undefined;
|
|
7
7
|
})) & {
|
|
8
8
|
ref?: HTMLElement | null | undefined;
|
package/dist/core/cms.d.ts
CHANGED
|
@@ -38,4 +38,8 @@ export declare class CMS implements ICMS {
|
|
|
38
38
|
getFormBySlug(slug: string): FormConfig;
|
|
39
39
|
}
|
|
40
40
|
export declare function initCMS(config: CMSConfig): CMS;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the singleton CMS instance. Must be called after `includioCMS()` initializes the CMS in `hooks.server.ts`.
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
41
45
|
export declare function getCMS(): CMS;
|
package/dist/core/cms.js
CHANGED
|
@@ -159,6 +159,10 @@ export function initCMS(config) {
|
|
|
159
159
|
.catch((e) => console.warn('[cms] Failed to start background maintenance:', e));
|
|
160
160
|
return cms;
|
|
161
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Returns the singleton CMS instance. Must be called after `includioCMS()` initializes the CMS in `hooks.server.ts`.
|
|
164
|
+
* @public
|
|
165
|
+
*/
|
|
162
166
|
export function getCMS() {
|
|
163
167
|
if (!cms) {
|
|
164
168
|
throw new Error('CMS not initialized. Call initCMS() first with your CMS config.');
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { ImageFieldStyle } from '../../../../types/fields.js';
|
|
2
2
|
import type { ImageStyle, MediaFile } from '../../../../types/media.js';
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export interface ResolvedMedia {
|
|
4
7
|
data: MediaFile;
|
|
5
8
|
styles: Record<string, ImageStyle>;
|
|
6
9
|
blurDataUrl: string | null;
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
|
-
* Resolve media files by IDs and generate image styles.
|
|
10
|
-
*
|
|
12
|
+
* Resolve media files by IDs and generate image styles. Useful for plugins resolving media references (e.g. photo-grid).
|
|
13
|
+
* @public
|
|
11
14
|
*/
|
|
12
15
|
export declare function resolveMediaWithStyles(mediaIds: string[], styles?: ImageFieldStyle[]): Promise<Record<string, ResolvedMedia>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getCMS } from '../../../cms.js';
|
|
2
2
|
import { getImageStyles } from './imageStyles.js';
|
|
3
3
|
/**
|
|
4
|
-
* Resolve media files by IDs and generate image styles.
|
|
5
|
-
*
|
|
4
|
+
* Resolve media files by IDs and generate image styles. Useful for plugins resolving media references (e.g. photo-grid).
|
|
5
|
+
* @public
|
|
6
6
|
*/
|
|
7
7
|
export async function resolveMediaWithStyles(mediaIds, styles) {
|
|
8
8
|
if (!mediaIds.length)
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
*/
|
|
1
4
|
export interface CreateFormSubmissionOptions {
|
|
2
5
|
slug: string;
|
|
3
6
|
data: Record<string, unknown>;
|
|
4
7
|
ip?: string;
|
|
5
8
|
userAgent?: string;
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Persists a form submission and triggers best-effort notification email. Returns `true` if the row was written (email failures are logged, do not affect return).
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
7
14
|
export declare const createFormSubmission: (options: CreateFormSubmissionOptions) => Promise<boolean>;
|