includio-cms 0.16.0 → 0.18.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/DOCS.md +1 -1
  3. package/dist/admin/api/rest/routes/collections.js +1 -1
  4. package/dist/admin/api/rest/routes/entries.js +1 -1
  5. package/dist/admin/api/rest/routes/singletons.js +1 -1
  6. package/dist/admin/remote/entry.remote.js +20 -3
  7. package/dist/admin/remote/invite.d.ts +1 -1
  8. package/dist/admin/remote/preview.remote.js +10 -2
  9. package/dist/admin/remote/reorder.js +1 -1
  10. package/dist/admin/remote/shop.remote.d.ts +18 -18
  11. package/dist/cms/runtime/api.d.ts +10 -6
  12. package/dist/cms/runtime/api.js +7 -7
  13. package/dist/components/ui/accordion/accordion.svelte.d.ts +1 -1
  14. package/dist/components/ui/calendar/calendar.svelte.d.ts +1 -1
  15. package/dist/components/ui/command/command-dialog.svelte.d.ts +1 -1
  16. package/dist/components/ui/command/command-input.svelte.d.ts +1 -1
  17. package/dist/components/ui/command/command.svelte.d.ts +1 -1
  18. package/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +1 -1
  19. package/dist/components/ui/input/input.svelte.d.ts +1 -1
  20. package/dist/components/ui/input-group/input-group-input.svelte.d.ts +1 -1
  21. package/dist/components/ui/input-group/input-group-textarea.svelte.d.ts +1 -1
  22. package/dist/components/ui/radio-group/radio-group.svelte.d.ts +1 -1
  23. package/dist/components/ui/sidebar/sidebar-input.svelte.d.ts +1 -1
  24. package/dist/components/ui/tabs/tabs.svelte.d.ts +1 -1
  25. package/dist/components/ui/textarea/textarea.svelte.d.ts +1 -1
  26. package/dist/components/ui/toggle-group/toggle-group-item.svelte.d.ts +1 -1
  27. package/dist/components/ui/toggle-group/toggle-group.svelte.d.ts +1 -1
  28. package/dist/core/server/entries/operations/create.js +1 -1
  29. package/dist/core/server/entries/operations/get.d.ts +20 -16
  30. package/dist/core/server/entries/operations/get.js +45 -214
  31. package/dist/core/server/entries/operations/resolveEntry.d.ts +94 -0
  32. package/dist/core/server/entries/operations/resolveEntry.js +210 -0
  33. package/dist/core/server/entries/operations/update.js +1 -1
  34. package/dist/core/server/fields/populateEntry.d.ts +9 -1
  35. package/dist/core/server/fields/populateEntry.js +22 -18
  36. package/dist/core/server/fields/resolveRelationFields.d.ts +2 -1
  37. package/dist/core/server/fields/resolveRelationFields.js +140 -34
  38. package/dist/core/server/fields/resolveRichtextLinks.d.ts +2 -1
  39. package/dist/core/server/fields/resolveRichtextLinks.js +2 -1
  40. package/dist/core/server/fields/resolveUrlFields.d.ts +2 -1
  41. package/dist/core/server/fields/resolveUrlFields.js +6 -5
  42. package/dist/core/server/generator/generator.js +17 -14
  43. package/dist/entity/index.js +1 -1
  44. package/dist/shop/server/populate.d.ts +2 -1
  45. package/dist/shop/server/populate.js +2 -1
  46. package/dist/sveltekit/server/index.d.ts +1 -1
  47. package/dist/sveltekit/server/index.js +1 -1
  48. package/dist/types/plugins.d.ts +6 -2
  49. package/dist/updates/0.17.0/index.d.ts +2 -0
  50. package/dist/updates/0.17.0/index.js +78 -0
  51. package/dist/updates/index.js +2 -1
  52. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,86 @@
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.17.0 — 2026-04-29
7
+
8
+ Konsolidacja entry resolverów — kanoniczny `resolveEntry()` / `resolveEntries()` / `countEntries()` w jednym public API. Locale strict, cycle detection, populate config per-field opt-out + maxDepth. Hard remove starych funkcji (getEntry, getEntries, getRawEntry/ies, getDbEntry/ies, populateEntryData) z public surface — przeniesione do internal lub całkowicie usunięte.
9
+
10
+ ### Added
11
+ - `resolveEntry({ id?, collection?, locale?, status?, populate? })` — kanoniczny resolver pojedynczego entry; `id` lub `collection` wymagane. Default locale = `cms.languages[0]`, default status = `published`. Zwraca null gdy locale/status nie ma versionu (strict, brak fallback).
12
+ - `resolveEntries({ collection, locale?, status?, ids?, filter?, orderBy?, limit?, offset?, populate? })` — kanoniczny lister; pokrywa wszystkie use case starego `getEntries`.
13
+ - `countEntries({ collection, locale?, status?, ids?, filter? })` — zlicza entries pasujące do kryteriów (per locale, per status). Bez populate (tani DB count).
14
+ - `PopulateConfig` — typ public: `{ maxDepth?: number; fields?: Record<string, false> }`. Per-field opt-out (`{ author: false }` → raw ID). Default maxDepth = 5 (soft cap).
15
+ - Cycle detection w nested populate — A → B → A nie wybucha; powtórzony entryId zachowuje raw ID zamiast dalszej rekurencji.
16
+ - Status cascade — draft entry z `status: "draft"` populuje draft relations (jeśli istnieją w tym samym locale). Published cascade do published nested.
17
+ - `status: "scheduled"` — dostępne w resolverze. Use case: strona z odliczaniem (countdown) do launchu produktu/postu. `entry._publishedAt` daje datę przyszłej publikacji.
18
+
19
+ ### Fixed
20
+ - Locale spójny w całym call chain — żaden field-level resolver nie hardcoduje już lokalizacji ani nie używa innego defaultu niż top-level resolver. Stara fragmentacja (`resolveRelationFields` defaultowało do `getEntries` published-only) usunięta.
21
+ - Recursion guard — głęboka kolekcja relacji (≥ 6 poziomów) nie wybucha już stackiem. Soft maxDepth=5 + cycle detection.
22
+ - Strict locale — brak ukrytego fallbacku do `cms.languages[0]` w nested resolverach (był różnie w każdym field-resolverze).
23
+
24
+ ### Breaking
25
+ - **REMOVED z public API**: `getEntry`, `getEntries`, `getEntryOrThrow`, `getRawEntry`, `getRawEntries`, `getRawEntryOrThrow`, `getDbEntry`, `getDbEntries`, `populateEntryData`. Wszystkie te funkcje były dotąd re-exportowane przez `includio-cms/server` i `includio-cms`. **Zamień na `resolveEntry`/`resolveEntries`/`countEntries`** zgodnie z migration table niżej. Nie ma deprecated wrappera — hard remove zgodnie z polityką lean-v1 (wszystkie breakingy PRZED v1.0).
26
+ - **Rename arg `language` → `locale`** w `resolveEntry`/`resolveEntries`/`countEntries`. Stare API używało `language`, nowe `locale` (semantycznie bardziej precyzyjne; wartość bez zmian — `cms.languages[N]`).
27
+ - **Rename arg `slug` → `collection`** w resolverach. Stare API używało `slug` (co konfundowało z slugiem entry). Nowe: `collection: "posts"`. Singletons też używają `collection: "settings"` (cms.getBySlug obejmuje obie typy).
28
+ - **`status` enum zwężony** z `"published" | "draft" | "scheduled" | "archived"` do `"published" | "draft" | "scheduled"`. `archived` nie jest już dostępny w resolverze (to filter listy, nie fetch by id) — admin używa internal `_getRawEntries` envelope.
29
+ - **Plugin `populateResolver` 3-arg signature** — custom field plugin `populateResolver(value, field)` ma teraz 3-ci arg `ctx: PopulateCtx` (locale, status, depth, visited, populate, entryId). Plugin API jest `@experimental`, więc breaking dopuszczalne. Migracja: zaktualizuj sygnaturę. Stary 2-arg call zostaje wywołany ale ignoruje cascade — najlepiej dodać 3-ci arg.
30
+ - **`PopulateConfig`** wymagany dla opt-out — wcześniej populate był all-or-nothing.
31
+ - **`populatePreviewData` (admin remote)** używa teraz internal `_populate` zamiast `populateEntryData`. Public API niezmienione, ale jeśli importowałeś `populateEntryData` jako helper — usuń.
32
+ - **Internal renames** — `_getRawEntry/ies`, `_getDbEntry/ies`, `_getRawEntryOrThrow`. Funkcje pozostają dostępne dla admin REST i remote, ale **NIE** są re-exportowane przez `includio-cms/server`. Userland code MUSI przejść na `resolveEntry`/`resolveEntries`.
33
+
34
+ ### Notes
35
+
36
+ Migration table:
37
+
38
+ | Old | New |
39
+ |---|---|
40
+ | `getEntry({ slug, id, language, status })` | `resolveEntry({ collection: slug, id, locale: language, status })` |
41
+ | `getEntry({ slug, language })` (singleton) | `resolveEntry({ collection: slug, locale: language })` |
42
+ | `getEntries({ slug, language, status, ids?, limit?, offset? })` | `resolveEntries({ collection: slug, locale: language, status, ids?, limit?, offset? })` |
43
+ | `getEntryOrThrow(opts)` | `const e = await resolveEntry(opts); if (!e) throw new Error('Entry not found');` |
44
+ | `getRawEntry/ies(...)` | INTERNAL — niedostępne. Jeśli potrzebujesz envelope z per-language draft/published versions, zbuduj custom REST endpoint po stronie aplikacji. |
45
+ | `getDbEntry/ies(...)` | INTERNAL — niedostępne. Userland NIE powinien używać raw DB queries; przejdź na `resolveEntry/ies`. |
46
+ | `populateEntryData(data, fields, language, entryId?)` | INTERNAL — admin preview używa wewnątrz. |
47
+
48
+ Before/after:
49
+
50
+ ```ts
51
+ // PRZED (0.16):
52
+ import { getEntry, getEntries } from 'includio-cms/server';
53
+ const post = await getEntry({ slug: 'posts', id: postId, language: 'pl' });
54
+ const all = await getEntries({ slug: 'posts', language: 'pl', limit: 10 });
55
+
56
+ // PO (0.17):
57
+ import { resolveEntry, resolveEntries } from 'includio-cms/server';
58
+ const post = await resolveEntry({ collection: 'posts', id: postId, locale: 'pl' });
59
+ const all = await resolveEntries({ collection: 'posts', locale: 'pl', limit: 10 });
60
+ ```
61
+
62
+ Populate opt-out:
63
+
64
+ ```ts
65
+ // Pomiń populate dla pojedynczego pola (zwróć raw ID zamiast Entry):
66
+ const post = await resolveEntry({
67
+ collection: 'posts',
68
+ id: postId,
69
+ locale: 'pl',
70
+ populate: { fields: { author: false } }
71
+ });
72
+ console.log(post.author); // 'a1' (string, nie Entry)
73
+
74
+ // Ogranicz głębokość rekursji:
75
+ const post = await resolveEntry({
76
+ collection: 'posts',
77
+ id: postId,
78
+ locale: 'pl',
79
+ populate: { maxDepth: 1 }
80
+ });
81
+ // post.author = pełen Entry, post.author.featuredPost = raw ID (depth 2)
82
+ ```
83
+
84
+ Brak SQL migration. Stary code używający usuniętych funkcji rzuci ImportError przy `pnpm i && pnpm build` — wszystko w userland kodzie wyłapie się TS-em od razu.
85
+
6
86
  ## 0.16.0 — 2026-04-29
7
87
 
8
88
  Hard reset martwego kodu — start drogi do v1.0.0. Wycięte: prototyp inline-edit, demo seed, demo routes. Zostają: cmp/ (backend działa), mockups/ (designy), isomorphic-dompurify (Faza 5), tippy.js (slash-command).
package/DOCS.md CHANGED
@@ -1,4 +1,4 @@
1
- # Includio CMS Documentation (v0.16.0)
1
+ # Includio CMS Documentation (v0.18.0)
2
2
 
3
3
  > This file is auto-generated from the docs site. For the latest version, update the package.
4
4
 
@@ -1,6 +1,6 @@
1
1
  import { json } from '@sveltejs/kit';
2
2
  import { getCMS } from '../../../../core/cms.js';
3
- import { getRawEntries, getRawEntry, countRawEntries } from '../../../../core/server/entries/operations/get.js';
3
+ import { _getRawEntries as getRawEntries, _getRawEntry as getRawEntry, _countRawEntries as countRawEntries } from '../../../../core/server/entries/operations/get.js';
4
4
  import { createEntry } from '../../../../core/server/entries/operations/create.js';
5
5
  import { upsertDraftVersion, updateEntry, updateEntryVersion } from '../../../../core/server/entries/operations/update.js';
6
6
  import { deleteEntry } from '../../../../core/server/entries/operations/delete.js';
@@ -1,6 +1,6 @@
1
1
  import { json } from '@sveltejs/kit';
2
2
  import { getCMS } from '../../../../core/cms.js';
3
- import { getRawEntryOrThrow } from '../../../../core/server/entries/operations/get.js';
3
+ import { _getRawEntryOrThrow as getRawEntryOrThrow } from '../../../../core/server/entries/operations/get.js';
4
4
  import { updateEntry, updateEntryVersion, unpublishEntryLang } from '../../../../core/server/entries/operations/update.js';
5
5
  export async function POST(event, id, action) {
6
6
  const user = event.locals.user;
@@ -1,6 +1,6 @@
1
1
  import { json } from '@sveltejs/kit';
2
2
  import { getCMS } from '../../../../core/cms.js';
3
- import { getRawEntries } from '../../../../core/server/entries/operations/get.js';
3
+ import { _getRawEntries as getRawEntries } from '../../../../core/server/entries/operations/get.js';
4
4
  import { createEntry } from '../../../../core/server/entries/operations/create.js';
5
5
  import { upsertDraftVersion } from '../../../../core/server/entries/operations/update.js';
6
6
  export async function GET(event, slug) {
@@ -1,7 +1,8 @@
1
1
  import { command, query } from '$app/server';
2
2
  import { getAtPath } from '../utils/objectPath.js';
3
3
  import { createEntry as createEntryOperation, createEntrySchema, createEntryVersion } from '../../core/server/entries/operations/create.js';
4
- import { getRawEntries as getRawEntriesOperation, countRawEntries as countRawEntriesOperation, getRawEntry as getRawEntryOperation, getRawEntryOrThrow, getDbEntry, getDbEntryOrThrow, getEntries as getEntriesOperation, getEntry as getEntryOperation, getEntryVersion as getEntryVersionOperation, getEntryLabels as getEntryLabelsOperation } from '../../core/server/entries/operations/get.js';
4
+ import { _getRawEntries as getRawEntriesOperation, _countRawEntries as countRawEntriesOperation, _getRawEntry as getRawEntryOperation, _getRawEntryOrThrow as getRawEntryOrThrow, _getDbEntry as getDbEntry, getEntryVersion as getEntryVersionOperation, getEntryLabels as getEntryLabelsOperation } from '../../core/server/entries/operations/get.js';
5
+ import { resolveEntries, resolveEntry } from '../../core/server/entries/operations/resolveEntry.js';
5
6
  import { getCMS } from '../../core/cms.js';
6
7
  import { pruneOldDraftVersions, unpublishEntryLang, upsertDraftVersion, updateEntry, updateEntrySchema, updateEntryVersionCommandTypes } from '../../core/server/entries/operations/update.js';
7
8
  import z from 'zod';
@@ -42,7 +43,17 @@ export const getEntries = query(z.object({
42
43
  })
43
44
  .optional()
44
45
  }), async (input) => {
45
- return getEntriesOperation(input);
46
+ if (!input.slug)
47
+ return [];
48
+ const status = input.status === 'draft' || input.status === 'scheduled' ? input.status : 'published';
49
+ return resolveEntries({
50
+ collection: input.slug,
51
+ ids: input.ids,
52
+ locale: input.language,
53
+ status,
54
+ filter: { dataValues: input.dataValues, dataLike: input.dataLike },
55
+ orderBy: input.orderBy
56
+ });
46
57
  });
47
58
  export const getEntryLabels = query(z.object({
48
59
  slug: z.string(),
@@ -61,7 +72,13 @@ export const getEntry = query(z.object({
61
72
  status: z.enum(entryStatuses).optional(),
62
73
  slug: z.string().optional()
63
74
  }), async (input) => {
64
- return getEntryOperation(input);
75
+ const status = input.status === 'draft' || input.status === 'scheduled' ? input.status : 'published';
76
+ return resolveEntry({
77
+ id: input.id,
78
+ collection: input.slug,
79
+ locale: input.language,
80
+ status
81
+ });
65
82
  });
66
83
  export const createEntry = command(createEntrySchema, async (input) => {
67
84
  requireAuth();
@@ -5,8 +5,8 @@ export declare function createInvitation(email: string, role: UserRole, createdB
5
5
  createdAt: Date;
6
6
  email: string;
7
7
  expiresAt: Date;
8
- token: string;
9
8
  createdBy: string;
9
+ token: string;
10
10
  usedAt: Date | null;
11
11
  }>;
12
12
  export declare function getInvitationByToken(token: string): Promise<{
@@ -1,6 +1,6 @@
1
1
  import { command } from '$app/server';
2
2
  import { getCMS } from '../../core/cms.js';
3
- import { populateEntryData } from '../../core/server/fields/populateEntry.js';
3
+ import { _populate } from '../../core/server/fields/populateEntry.js';
4
4
  import { getFieldsFromConfig } from '../../core/fields/layoutUtils.js';
5
5
  import z from 'zod';
6
6
  const schema = z.object({
@@ -11,6 +11,14 @@ const schema = z.object({
11
11
  export const populatePreviewData = command(schema, async ({ data, slug, language }) => {
12
12
  const config = getCMS().getBySlug(slug);
13
13
  const fields = getFieldsFromConfig(config);
14
- const populated = await populateEntryData(data, fields, language);
14
+ const populated = await _populate(data, fields, {
15
+ locale: language,
16
+ status: 'draft',
17
+ depth: 0,
18
+ maxDepth: 5,
19
+ visited: new Set(),
20
+ populate: {},
21
+ entryId: ''
22
+ });
15
23
  return populated;
16
24
  });
@@ -1,4 +1,4 @@
1
- import { getDbEntries } from '../../core/server/entries/operations/get.js';
1
+ import { _getDbEntries as getDbEntries } from '../../core/server/entries/operations/get.js';
2
2
  import { updateEntry } from '../../core/server/entries/operations/update.js';
3
3
  export async function stableSlotReorder(orderedIds, collectionSlug) {
4
4
  if (orderedIds.length === 0)
@@ -88,12 +88,6 @@ export declare const listOrdersAdmin: import("@sveltejs/kit").RemoteQueryFunctio
88
88
  createdAt: Date;
89
89
  updatedAt: Date;
90
90
  language: string | null;
91
- accessToken: string;
92
- consents: {
93
- id: string;
94
- accepted: boolean;
95
- label: string;
96
- }[] | null;
97
91
  carrierType: string | null;
98
92
  currency: string;
99
93
  customerEmail: string;
@@ -113,7 +107,13 @@ export declare const listOrdersAdmin: import("@sveltejs/kit").RemoteQueryFunctio
113
107
  shipmentCreatedAt: Date | null;
114
108
  paymentMethod: string | null;
115
109
  paymentProviderRef: string | null;
110
+ consents: {
111
+ id: string;
112
+ accepted: boolean;
113
+ label: string;
114
+ }[] | null;
116
115
  notes: string | null;
116
+ accessToken: string;
117
117
  }[]>;
118
118
  export declare const getOrderForAdmin: import("@sveltejs/kit").RemoteQueryFunction<string, {
119
119
  order: {
@@ -123,12 +123,6 @@ export declare const getOrderForAdmin: import("@sveltejs/kit").RemoteQueryFuncti
123
123
  createdAt: Date;
124
124
  updatedAt: Date;
125
125
  language: string | null;
126
- accessToken: string;
127
- consents: {
128
- id: string;
129
- accepted: boolean;
130
- label: string;
131
- }[] | null;
132
126
  carrierType: string | null;
133
127
  currency: string;
134
128
  customerEmail: string;
@@ -148,7 +142,13 @@ export declare const getOrderForAdmin: import("@sveltejs/kit").RemoteQueryFuncti
148
142
  shipmentCreatedAt: Date | null;
149
143
  paymentMethod: string | null;
150
144
  paymentProviderRef: string | null;
145
+ consents: {
146
+ id: string;
147
+ accepted: boolean;
148
+ label: string;
149
+ }[] | null;
151
150
  notes: string | null;
151
+ accessToken: string;
152
152
  };
153
153
  items: {
154
154
  id: string;
@@ -182,12 +182,6 @@ export declare const updateOrderStatusCmd: import("@sveltejs/kit").RemoteCommand
182
182
  createdAt: Date;
183
183
  updatedAt: Date;
184
184
  language: string | null;
185
- accessToken: string;
186
- consents: {
187
- id: string;
188
- accepted: boolean;
189
- label: string;
190
- }[] | null;
191
185
  carrierType: string | null;
192
186
  currency: string;
193
187
  customerEmail: string;
@@ -207,7 +201,13 @@ export declare const updateOrderStatusCmd: import("@sveltejs/kit").RemoteCommand
207
201
  shipmentCreatedAt: Date | null;
208
202
  paymentMethod: string | null;
209
203
  paymentProviderRef: string | null;
204
+ consents: {
205
+ id: string;
206
+ accepted: boolean;
207
+ label: string;
208
+ }[] | null;
210
209
  notes: string | null;
210
+ accessToken: string;
211
211
  }>>;
212
212
  export declare const resendOrderEmailCmd: import("@sveltejs/kit").RemoteCommand<{
213
213
  orderId: string;
@@ -1,14 +1,18 @@
1
1
  import type { SingleEntryMap, SingleSlug, CollectionEntryMap, CollectionSlug, FormEntryMap, SiteLanguage } from './types';
2
+ import { type PopulateConfig } from 'includio-cms/sveltekit/server';
2
3
  interface GetEntryOptions {
3
4
  id?: string;
4
- status?: 'draft' | 'published' | 'scheduled' | 'archived';
5
- dataValues?: Record<string, unknown>;
6
- language?: SiteLanguage;
5
+ status?: 'published' | 'draft' | 'scheduled';
6
+ populate?: PopulateConfig;
7
+ locale?: SiteLanguage;
7
8
  }
8
9
  interface GetEntriesOptions extends GetEntryOptions {
9
10
  ids?: string[];
10
- dataLike?: Record<string, unknown>;
11
- dataILikeOr?: Record<string, unknown>;
11
+ filter?: {
12
+ dataValues?: Record<string, unknown>;
13
+ dataLike?: Record<string, unknown>;
14
+ dataILikeOr?: Record<string, unknown>;
15
+ };
12
16
  orderBy?: {
13
17
  column: 'createdAt' | 'updatedAt' | 'sortOrder';
14
18
  direction: 'asc' | 'desc';
@@ -23,7 +27,7 @@ interface GetEntriesOptions extends GetEntryOptions {
23
27
  export declare function getSingleEntry<K extends SingleSlug>(slug: K, options?: GetEntryOptions): Promise<SingleEntryMap[K] | null>;
24
28
  export declare function getCollectionEntry<K extends CollectionSlug>(slug: K, options?: GetEntryOptions): Promise<CollectionEntryMap[K] | null>;
25
29
  export declare function getCollectionEntries<K extends CollectionSlug>(slug: K, options?: GetEntriesOptions): Promise<CollectionEntryMap[K][]>;
26
- export declare function countCollectionEntries<K extends CollectionSlug>(slug: K, options?: Omit<GetEntriesOptions, 'limit' | 'offset' | 'orderBy'>): Promise<number>;
30
+ export declare function countCollectionEntries<K extends CollectionSlug>(slug: K, options?: Omit<GetEntriesOptions, 'limit' | 'offset' | 'orderBy' | 'populate'>): Promise<number>;
27
31
  export interface SubmitFormOptions {
28
32
  ip?: string;
29
33
  userAgent?: string;
@@ -1,22 +1,22 @@
1
1
  // This file is auto-generated. Do not edit directly.
2
- import { getEntry, getEntries, countEntries, createFormSubmission } from 'includio-cms/sveltekit/server';
2
+ import { resolveEntry, resolveEntries, countEntries, createFormSubmission } from 'includio-cms/sveltekit/server';
3
3
  export async function getSingleEntry(slug, options = {}) {
4
- return (await getEntry({
5
- slug,
4
+ return (await resolveEntry({
5
+ collection: slug,
6
6
  ...options
7
7
  }));
8
8
  }
9
9
  export async function getCollectionEntry(slug, options = {}) {
10
- return (await getEntry({
11
- slug,
10
+ return (await resolveEntry({
11
+ collection: slug,
12
12
  ...options
13
13
  }));
14
14
  }
15
15
  export async function getCollectionEntries(slug, options = {}) {
16
- return (await getEntries({ slug, ...options }));
16
+ return (await resolveEntries({ collection: slug, ...options }));
17
17
  }
18
18
  export async function countCollectionEntries(slug, options = {}) {
19
- return countEntries({ slug, ...options });
19
+ return countEntries({ collection: slug, ...options });
20
20
  }
21
21
  export async function submitForm(slug, data, options) {
22
22
  return createFormSubmission({ slug, data, ...options });
@@ -1,4 +1,4 @@
1
1
  import { Accordion as AccordionPrimitive } from "bits-ui";
2
- declare const Accordion: import("svelte").Component<AccordionPrimitive.RootProps, {}, "value" | "ref">;
2
+ declare const Accordion: import("svelte").Component<AccordionPrimitive.RootProps, {}, "ref" | "value">;
3
3
  type Accordion = ReturnType<typeof Accordion>;
4
4
  export default Accordion;
@@ -16,6 +16,6 @@ type $$ComponentProps = WithoutChildrenOrChild<CalendarPrimitive.RootProps> & {
16
16
  outsideMonth: boolean;
17
17
  }]>;
18
18
  };
19
- declare const Calendar: import("svelte").Component<$$ComponentProps, {}, "value" | "ref" | "placeholder">;
19
+ declare const Calendar: import("svelte").Component<$$ComponentProps, {}, "ref" | "value" | "placeholder">;
20
20
  type Calendar = ReturnType<typeof Calendar>;
21
21
  export default Calendar;
@@ -7,6 +7,6 @@ type $$ComponentProps = WithoutChildrenOrChild<DialogPrimitive.RootProps> & With
7
7
  title?: string;
8
8
  description?: string;
9
9
  };
10
- declare const CommandDialog: import("svelte").Component<$$ComponentProps, {}, "value" | "ref" | "open">;
10
+ declare const CommandDialog: import("svelte").Component<$$ComponentProps, {}, "ref" | "value" | "open">;
11
11
  type CommandDialog = ReturnType<typeof CommandDialog>;
12
12
  export default CommandDialog;
@@ -1,4 +1,4 @@
1
1
  import { Command as CommandPrimitive } from "bits-ui";
2
- declare const CommandInput: import("svelte").Component<CommandPrimitive.InputProps, {}, "value" | "ref">;
2
+ declare const CommandInput: import("svelte").Component<CommandPrimitive.InputProps, {}, "ref" | "value">;
3
3
  type CommandInput = ReturnType<typeof CommandInput>;
4
4
  export default CommandInput;
@@ -3,6 +3,6 @@ export type CommandRootApi = CommandPrimitive.Root;
3
3
  type $$ComponentProps = CommandPrimitive.RootProps & {
4
4
  api?: CommandRootApi | null;
5
5
  };
6
- declare const Command: import("svelte").Component<$$ComponentProps, {}, "value" | "ref" | "api">;
6
+ declare const Command: import("svelte").Component<$$ComponentProps, {}, "ref" | "value" | "api">;
7
7
  type Command = ReturnType<typeof Command>;
8
8
  export default Command;
@@ -1,4 +1,4 @@
1
1
  import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
2
- declare const DropdownMenuRadioGroup: import("svelte").Component<DropdownMenuPrimitive.RadioGroupProps, {}, "value" | "ref">;
2
+ declare const DropdownMenuRadioGroup: import("svelte").Component<DropdownMenuPrimitive.RadioGroupProps, {}, "ref" | "value">;
3
3
  type DropdownMenuRadioGroup = ReturnType<typeof DropdownMenuRadioGroup>;
4
4
  export default DropdownMenuRadioGroup;
@@ -8,6 +8,6 @@ type Props = WithElementRef<Omit<HTMLInputAttributes, "type"> & ({
8
8
  type?: InputType;
9
9
  files?: undefined;
10
10
  })>;
11
- declare const Input: import("svelte").Component<Props, {}, "files" | "value" | "ref">;
11
+ declare const Input: import("svelte").Component<Props, {}, "files" | "ref" | "value">;
12
12
  type Input = ReturnType<typeof Input>;
13
13
  export default Input;
@@ -6,6 +6,6 @@ declare const InputGroupInput: import("svelte").Component<(Omit<import("svelte/e
6
6
  files?: undefined;
7
7
  })) & {
8
8
  ref?: HTMLElement | null | undefined;
9
- }, {}, "value" | "ref">;
9
+ }, {}, "ref" | "value">;
10
10
  type InputGroupInput = ReturnType<typeof InputGroupInput>;
11
11
  export default InputGroupInput;
@@ -1,3 +1,3 @@
1
- declare const InputGroupTextarea: import("svelte").Component<Omit<import("../../../utils.js").WithElementRef<import("svelte/elements").HTMLTextareaAttributes>, "children">, {}, "value" | "ref">;
1
+ declare const InputGroupTextarea: import("svelte").Component<Omit<import("../../../utils.js").WithElementRef<import("svelte/elements").HTMLTextareaAttributes>, "children">, {}, "ref" | "value">;
2
2
  type InputGroupTextarea = ReturnType<typeof InputGroupTextarea>;
3
3
  export default InputGroupTextarea;
@@ -1,4 +1,4 @@
1
1
  import { RadioGroup as RadioGroupPrimitive } from "bits-ui";
2
- declare const RadioGroup: import("svelte").Component<RadioGroupPrimitive.RootProps, {}, "value" | "ref">;
2
+ declare const RadioGroup: import("svelte").Component<RadioGroupPrimitive.RootProps, {}, "ref" | "value">;
3
3
  type RadioGroup = ReturnType<typeof RadioGroup>;
4
4
  export default RadioGroup;
@@ -6,6 +6,6 @@ declare const SidebarInput: import("svelte").Component<(Omit<import("svelte/elem
6
6
  files?: undefined;
7
7
  })) & {
8
8
  ref?: HTMLElement | null | undefined;
9
- }, {}, "value" | "ref">;
9
+ }, {}, "ref" | "value">;
10
10
  type SidebarInput = ReturnType<typeof SidebarInput>;
11
11
  export default SidebarInput;
@@ -1,4 +1,4 @@
1
1
  import { Tabs as TabsPrimitive } from "bits-ui";
2
- declare const Tabs: import("svelte").Component<TabsPrimitive.RootProps, {}, "value" | "ref">;
2
+ declare const Tabs: import("svelte").Component<TabsPrimitive.RootProps, {}, "ref" | "value">;
3
3
  type Tabs = ReturnType<typeof Tabs>;
4
4
  export default Tabs;
@@ -1,5 +1,5 @@
1
1
  import { type WithElementRef } from "../../../utils.js";
2
2
  import type { HTMLTextareaAttributes } from "svelte/elements";
3
- declare const Textarea: import("svelte").Component<Omit<WithElementRef<HTMLTextareaAttributes>, "children">, {}, "value" | "ref">;
3
+ declare const Textarea: import("svelte").Component<Omit<WithElementRef<HTMLTextareaAttributes>, "children">, {}, "ref" | "value">;
4
4
  type Textarea = ReturnType<typeof Textarea>;
5
5
  export default Textarea;
@@ -1,6 +1,6 @@
1
1
  import { ToggleGroup as ToggleGroupPrimitive } from "bits-ui";
2
2
  import { type ToggleVariants } from "../toggle/index.js";
3
3
  type $$ComponentProps = ToggleGroupPrimitive.ItemProps & ToggleVariants;
4
- declare const ToggleGroupItem: import("svelte").Component<$$ComponentProps, {}, "value" | "ref">;
4
+ declare const ToggleGroupItem: import("svelte").Component<$$ComponentProps, {}, "ref" | "value">;
5
5
  type ToggleGroupItem = ReturnType<typeof ToggleGroupItem>;
6
6
  export default ToggleGroupItem;
@@ -3,6 +3,6 @@ export declare function setToggleGroupCtx(props: ToggleVariants): void;
3
3
  export declare function getToggleGroupCtx(): ToggleVariants;
4
4
  import { ToggleGroup as ToggleGroupPrimitive } from "bits-ui";
5
5
  type $$ComponentProps = ToggleGroupPrimitive.RootProps & ToggleVariants;
6
- declare const ToggleGroup: import("svelte").Component<$$ComponentProps, {}, "value" | "ref">;
6
+ declare const ToggleGroup: import("svelte").Component<$$ComponentProps, {}, "ref" | "value">;
7
7
  type ToggleGroup = ReturnType<typeof ToggleGroup>;
8
8
  export default ToggleGroup;
@@ -2,7 +2,7 @@ import { requireAuth } from '../../../../admin/remote/middleware/auth.js';
2
2
  import { getCMS } from '../../../cms.js';
3
3
  import { entryTypes } from '../../../../types/entries.js';
4
4
  import z from 'zod';
5
- import { getDbEntryOrThrow } from './get.js';
5
+ import { _getDbEntryOrThrow as getDbEntryOrThrow } from './get.js';
6
6
  import { generateZodSchemaFromFields } from '../../../fields/fieldSchemaToTs.js';
7
7
  import { getFieldsFromConfig } from '../../../fields/layoutUtils.js';
8
8
  export const createEntrySchema = z.object({
@@ -1,16 +1,16 @@
1
- import type { DbEntry, DbEntryVersion, Entry, GetDbEntriesOptions, GetDbEntryOptions, GetDbEntryVersionOptions, GetDbEntryVersionsOptions, GetEntriesOptions, GetEntryOptions, GetRawEntriesOptions, getRawEntryOptions, RawEntry } from '../../../../types/entries.js';
2
- export declare const getDbEntries: (options: GetDbEntriesOptions) => Promise<DbEntry[]>;
3
- export declare const countDbEntries: (options: Omit<GetDbEntriesOptions, "limit" | "offset" | "orderBy">) => Promise<number>;
4
- export declare const getDbEntry: (options: GetDbEntryOptions) => Promise<DbEntry | null>;
5
- export declare const getDbEntryOrThrow: (options: GetDbEntryOptions) => Promise<DbEntry>;
6
- export declare const countRawEntries: (options: Omit<GetRawEntriesOptions, "limit" | "offset" | "orderBy">) => Promise<number>;
7
- export declare const getRawEntries: (options: GetRawEntriesOptions) => Promise<RawEntry[]>;
8
- export declare const getRawEntry: (options: getRawEntryOptions) => Promise<RawEntry | null>;
9
- export declare const getRawEntryOrThrow: (options: getRawEntryOptions) => Promise<RawEntry>;
10
- export declare const getEntries: (options?: GetEntriesOptions) => Promise<Entry[]>;
11
- export declare const countEntries: (options: Omit<GetEntriesOptions, "limit" | "offset" | "orderBy">) => Promise<number>;
12
- export declare const getEntry: (options?: GetEntryOptions) => Promise<Entry | null>;
13
- export declare const getEntryOrThrow: (options?: GetEntryOptions) => Promise<Entry>;
1
+ import type { DbEntry, DbEntryVersion, Entry, GetDbEntriesOptions, GetDbEntryOptions, GetDbEntryVersionOptions, GetDbEntryVersionsOptions, GetRawEntriesOptions, getRawEntryOptions, RawEntry } from '../../../../types/entries.js';
2
+ export declare const _getDbEntries: (options: GetDbEntriesOptions) => Promise<DbEntry[]>;
3
+ export declare const _countDbEntries: (options: Omit<GetDbEntriesOptions, "limit" | "offset" | "orderBy">) => Promise<number>;
4
+ export declare const _getDbEntry: (options: GetDbEntryOptions) => Promise<DbEntry | null>;
5
+ export declare const _getDbEntryOrThrow: (options: GetDbEntryOptions) => Promise<DbEntry>;
6
+ export declare const _countRawEntries: (options: Omit<GetRawEntriesOptions, "limit" | "offset" | "orderBy">) => Promise<number>;
7
+ export declare const _getRawEntries: (options: GetRawEntriesOptions) => Promise<RawEntry[]>;
8
+ export declare const _getRawEntry: (options: getRawEntryOptions) => Promise<RawEntry | null>;
9
+ export declare const _getRawEntryOrThrow: (options: getRawEntryOptions) => Promise<RawEntry>;
10
+ /**
11
+ * Admin helper: returns dropdown labels for collection entries.
12
+ * Not part of the public resolver API — admin UI use only.
13
+ */
14
14
  export declare const getEntryLabels: (options: {
15
15
  slug: string;
16
16
  ids?: string[];
@@ -22,9 +22,13 @@ export declare const getEntryLabels: (options: {
22
22
  label: string;
23
23
  total: number;
24
24
  }[]>;
25
- export declare const getDbEntryVersions: (options: GetDbEntryVersionsOptions) => Promise<DbEntryVersion[]>;
26
- export declare const getDbEntryVersion: (options: GetDbEntryVersionOptions) => Promise<DbEntryVersion | null>;
27
- export declare const getDbEntryVersionOrThrow: (options: GetDbEntryVersionOptions) => Promise<DbEntryVersion>;
25
+ export declare const _getDbEntryVersions: (options: GetDbEntryVersionsOptions) => Promise<DbEntryVersion[]>;
26
+ export declare const _getDbEntryVersion: (options: GetDbEntryVersionOptions) => Promise<DbEntryVersion | null>;
27
+ export declare const _getDbEntryVersionOrThrow: (options: GetDbEntryVersionOptions) => Promise<DbEntryVersion>;
28
+ /**
29
+ * Admin helper: fetches a specific version of an entry by version id and populates it.
30
+ * Used by version-history admin UI; not part of public resolver API.
31
+ */
28
32
  export declare const getEntryVersion: (options: {
29
33
  id: string;
30
34
  language: string;