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.
Files changed (63) hide show
  1. package/API.md +409 -0
  2. package/CHANGELOG.md +55 -0
  3. package/DOCS.md +1 -1
  4. package/ROADMAP.md +1 -0
  5. package/dist/admin/api/rest/handler.d.ts +4 -0
  6. package/dist/admin/api/rest/handler.js +4 -0
  7. package/dist/admin/client/index.d.ts +2 -0
  8. package/dist/admin/client/index.js +4 -0
  9. package/dist/components/ui/input-group/input-group-input.svelte.d.ts +1 -1
  10. package/dist/components/ui/sidebar/sidebar-input.svelte.d.ts +1 -1
  11. package/dist/core/cms.d.ts +4 -0
  12. package/dist/core/cms.js +4 -0
  13. package/dist/core/index.d.ts +2 -0
  14. package/dist/core/index.js +2 -0
  15. package/dist/core/server/consentLogs/operations/create.d.ts +4 -0
  16. package/dist/core/server/consentLogs/operations/create.js +4 -0
  17. package/dist/core/server/fields/utils/resolveMedia.d.ts +5 -2
  18. package/dist/core/server/fields/utils/resolveMedia.js +2 -2
  19. package/dist/core/server/forms/submissions/operations/create.d.ts +7 -0
  20. package/dist/core/server/forms/submissions/operations/create.js +4 -0
  21. package/dist/core/server/forms/submissions/utils/parseMultipart.d.ts +4 -0
  22. package/dist/core/server/forms/submissions/utils/parseMultipart.js +4 -0
  23. package/dist/db-postgres/index.d.ts +2 -0
  24. package/dist/db-postgres/index.js +3 -0
  25. package/dist/entity/index.d.ts +4 -0
  26. package/dist/entity/index.js +4 -0
  27. package/dist/files-local/index.d.ts +1 -0
  28. package/dist/files-local/index.js +1 -0
  29. package/dist/index.d.ts +0 -2
  30. package/dist/index.js +0 -1
  31. package/dist/paraglide/messages/_index.d.ts +36 -3
  32. package/dist/paraglide/messages/_index.js +71 -3
  33. package/dist/paraglide/messages/en.d.ts +5 -0
  34. package/dist/paraglide/messages/en.js +14 -0
  35. package/dist/paraglide/messages/pl.d.ts +5 -0
  36. package/dist/paraglide/messages/pl.js +14 -0
  37. package/dist/server/auth.d.ts +4 -0
  38. package/dist/server/auth.js +4 -0
  39. package/dist/shop/client/index.d.ts +4 -0
  40. package/dist/shop/client/index.js +4 -0
  41. package/dist/sveltekit/config.d.ts +20 -0
  42. package/dist/sveltekit/config.js +20 -0
  43. package/dist/sveltekit/server/handle.d.ts +4 -0
  44. package/dist/sveltekit/server/handle.js +4 -0
  45. package/dist/sveltekit/server/index.d.ts +1 -0
  46. package/dist/sveltekit/server/index.js +2 -0
  47. package/dist/sveltekit/server/layout.d.ts +4 -0
  48. package/dist/sveltekit/server/layout.js +4 -0
  49. package/dist/sveltekit/server/preview.d.ts +4 -0
  50. package/dist/sveltekit/server/preview.js +4 -0
  51. package/dist/types/index.d.ts +1 -0
  52. package/dist/types/index.js +1 -0
  53. package/dist/types/plugins.d.ts +8 -0
  54. package/dist/updates/0.20.0/index.d.ts +2 -0
  55. package/dist/updates/0.20.0/index.js +54 -0
  56. package/dist/updates/index.js +2 -1
  57. package/package.json +7 -67
  58. package/dist/paraglide/messages/hello_world.d.ts +0 -5
  59. package/dist/paraglide/messages/hello_world.js +0 -33
  60. package/dist/paraglide/messages/login_hello.d.ts +0 -16
  61. package/dist/paraglide/messages/login_hello.js +0 -34
  62. package/dist/paraglide/messages/login_please_login.d.ts +0 -16
  63. package/dist/paraglide/messages/login_please_login.js +0 -34
@@ -1,6 +1,10 @@
1
1
  import { getLocalizedLabel } from '../../../../../admin/utils/collectionLabel.js';
2
2
  import { getCMS } from '../../../../cms.js';
3
3
  import { generateZodSchemaFromFormFields } from '../../../../fields/formFieldSchemaToTs.js';
4
+ /**
5
+ * 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).
6
+ * @public
7
+ */
4
8
  export const createFormSubmission = async (options) => {
5
9
  const { slug, data, ip, userAgent } = options;
6
10
  const config = getCMS().getFormBySlug(slug);
@@ -1,2 +1,6 @@
1
1
  import type { FormField } from '../../../../../types/formFields.js';
2
+ /**
3
+ * Parses multipart `FormData` into a typed record of field values, handling file uploads via the configured files adapter.
4
+ * @public
5
+ */
2
6
  export declare function parseFormDataForSubmission(formData: FormData, fields: FormField[]): Promise<Record<string, unknown>>;
@@ -25,6 +25,10 @@ function validateMagicBytes(buffer, declaredMime) {
25
25
  }
26
26
  return false;
27
27
  }
28
+ /**
29
+ * Parses multipart `FormData` into a typed record of field values, handling file uploads via the configured files adapter.
30
+ * @public
31
+ */
28
32
  export async function parseFormDataForSubmission(formData, fields) {
29
33
  const result = {};
30
34
  const fileFields = new Map(fields.filter((f) => f.type === 'file').map((f) => [f.slug, f]));
@@ -2,6 +2,8 @@ import { drizzle } from 'drizzle-orm/postgres-js';
2
2
  import type { Config } from './types.js';
3
3
  import * as schema from './schema/index.js';
4
4
  import type { DatabaseAdapter } from '../types/adapters/db.js';
5
+ export * from './schema/index.js';
6
+ export * from '../server/db/schema/auth-schema.js';
5
7
  export type DatabaseAdapterWithDrizzle = DatabaseAdapter & {
6
8
  _drizzle: ReturnType<typeof drizzle<typeof schema>>;
7
9
  };
@@ -262,6 +262,9 @@ function buildMediaFileConditions(db, options) {
262
262
  }
263
263
  return conditions;
264
264
  }
265
+ // Schema re-exports (folded from `./db-postgres/schema-core`, `./db-postgres/schema-shop`, `./auth-schema` in 0.20.0)
266
+ export * from './schema/index.js';
267
+ export * from '../server/db/schema/auth-schema.js';
265
268
  /**
266
269
  * Postgres database adapter (drizzle + `postgres`).
267
270
  * @public
@@ -7,6 +7,10 @@ interface CreateOptions {
7
7
  skipValidation?: boolean;
8
8
  sortOrder?: number;
9
9
  }
10
+ /**
11
+ * Creates a high-level Entity API (CRUD + publish/archive) bound to a CMS instance and a user.
12
+ * @public
13
+ */
10
14
  export declare function createEntityAPI(cms: CMS, opts?: EntityAPIOptions): {
11
15
  create(slug: string, data?: EntryData, options?: CreateOptions & {
12
16
  lang?: string;
@@ -1,6 +1,10 @@
1
1
  import { generateZodSchemaFromFields } from '../core/fields/fieldSchemaToTs.js';
2
2
  import { getFieldsFromConfig } from '../core/fields/layoutUtils.js';
3
3
  import { _getRawEntries as getRawEntries } from '../core/server/entries/operations/get.js';
4
+ /**
5
+ * Creates a high-level Entity API (CRUD + publish/archive) bound to a CMS instance and a user.
6
+ * @public
7
+ */
4
8
  export function createEntityAPI(cms, opts) {
5
9
  const db = cms.databaseAdapter;
6
10
  const userId = opts?.userId ?? 'system';
@@ -1,4 +1,5 @@
1
1
  import type { FilesAdapter } from '../types/adapters/files.js';
2
+ /** @internal */
2
3
  export declare const fullDir: string;
3
4
  export interface LocalFilesConfig {
4
5
  ffmpegPath?: string;
@@ -9,6 +9,7 @@ import { processVideo, setFfmpegPaths } from './video.js';
9
9
  const __filename = fileURLToPath(import.meta.url);
10
10
  const __dirname = dirname(__filename);
11
11
  global.__dirname = __dirname ?? '';
12
+ /** @internal */
12
13
  export const fullDir = process.env.NODE_ENV === 'production' ? `/data/uploads` : `./static/uploads`;
13
14
  const privateDir = process.env.NODE_ENV === 'production' ? `/data/private-uploads` : `./data/private-uploads`;
14
15
  async function ensureDir(dir) {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- export * from './admin/index.js';
2
- export type * from './admin/index.js';
3
1
  export * from './core/index.js';
4
2
  export type * from './core/index.js';
package/dist/index.js CHANGED
@@ -1,2 +1 @@
1
- export * from './admin/index.js';
2
1
  export * from './core/index.js';
@@ -1,3 +1,36 @@
1
- export * from "./hello_world.js";
2
- export * from "./login_hello.js";
3
- export * from "./login_please_login.js";
1
+ export function hello_world(inputs: {
2
+ name: NonNullable<unknown>;
3
+ }, options?: {
4
+ locale?: "en" | "pl";
5
+ }): string;
6
+ /**
7
+ * This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
8
+ *
9
+ * - Changing this function will be over-written by the next build.
10
+ *
11
+ * - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
12
+ * use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
13
+ *
14
+ * @param {{}} inputs
15
+ * @param {{ locale?: "en" | "pl" }} options
16
+ * @returns {string}
17
+ */
18
+ declare function login_hello(inputs?: {}, options?: {
19
+ locale?: "en" | "pl";
20
+ }): string;
21
+ /**
22
+ * This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
23
+ *
24
+ * - Changing this function will be over-written by the next build.
25
+ *
26
+ * - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
27
+ * use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
28
+ *
29
+ * @param {{}} inputs
30
+ * @param {{ locale?: "en" | "pl" }} options
31
+ * @returns {string}
32
+ */
33
+ declare function login_please_login(inputs?: {}, options?: {
34
+ locale?: "en" | "pl";
35
+ }): string;
36
+ export { login_hello as login.hello, login_please_login as login.please_login };
@@ -1,4 +1,72 @@
1
1
  /* eslint-disable */
2
- export * from './hello_world.js'
3
- export * from './login_hello.js'
4
- export * from './login_please_login.js'
2
+ import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from "../runtime.js"
3
+ import * as en from "./en.js"
4
+ import * as pl from "./pl.js"
5
+ /**
6
+ * This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
7
+ *
8
+ * - Changing this function will be over-written by the next build.
9
+ *
10
+ * - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
11
+ * use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
12
+ *
13
+ * @param {{ name: NonNullable<unknown> }} inputs
14
+ * @param {{ locale?: "en" | "pl" }} options
15
+ * @returns {string}
16
+ */
17
+ /* @__NO_SIDE_EFFECTS__ */
18
+ export const hello_world = (inputs, options = {}) => {
19
+ if (experimentalMiddlewareLocaleSplitting && isServer === false) {
20
+ return /** @type {any} */ (globalThis).__paraglide_ssr.hello_world(inputs)
21
+ }
22
+ const locale = options.locale ?? getLocale()
23
+ trackMessageCall("hello_world", locale)
24
+ if (locale === "en") return en.hello_world(inputs)
25
+ return pl.hello_world(inputs)
26
+ };
27
+ /**
28
+ * This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
29
+ *
30
+ * - Changing this function will be over-written by the next build.
31
+ *
32
+ * - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
33
+ * use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
34
+ *
35
+ * @param {{}} inputs
36
+ * @param {{ locale?: "en" | "pl" }} options
37
+ * @returns {string}
38
+ */
39
+ /* @__NO_SIDE_EFFECTS__ */
40
+ const login_hello = (inputs = {}, options = {}) => {
41
+ if (experimentalMiddlewareLocaleSplitting && isServer === false) {
42
+ return /** @type {any} */ (globalThis).__paraglide_ssr.login_hello(inputs)
43
+ }
44
+ const locale = options.locale ?? getLocale()
45
+ trackMessageCall("login_hello", locale)
46
+ if (locale === "en") return en.login_hello(inputs)
47
+ return pl.login_hello(inputs)
48
+ };
49
+ export { login_hello as "login.hello" }
50
+ /**
51
+ * This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
52
+ *
53
+ * - Changing this function will be over-written by the next build.
54
+ *
55
+ * - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
56
+ * use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
57
+ *
58
+ * @param {{}} inputs
59
+ * @param {{ locale?: "en" | "pl" }} options
60
+ * @returns {string}
61
+ */
62
+ /* @__NO_SIDE_EFFECTS__ */
63
+ const login_please_login = (inputs = {}, options = {}) => {
64
+ if (experimentalMiddlewareLocaleSplitting && isServer === false) {
65
+ return /** @type {any} */ (globalThis).__paraglide_ssr.login_please_login(inputs)
66
+ }
67
+ const locale = options.locale ?? getLocale()
68
+ trackMessageCall("login_please_login", locale)
69
+ if (locale === "en") return en.login_please_login(inputs)
70
+ return pl.login_please_login(inputs)
71
+ };
72
+ export { login_please_login as "login.please_login" }
@@ -0,0 +1,5 @@
1
+ export const hello_world: (inputs: {
2
+ name: NonNullable<unknown>;
3
+ }) => string;
4
+ export const login_hello: (inputs: {}) => string;
5
+ export const login_please_login: (inputs: {}) => string;
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+
3
+
4
+ export const hello_world = /** @type {(inputs: { name: NonNullable<unknown> }) => string} */ (i) => {
5
+ return `Hello, ${i.name} from en!`
6
+ };
7
+
8
+ export const login_hello = /** @type {(inputs: {}) => string} */ () => {
9
+ return `Welcome back`
10
+ };
11
+
12
+ export const login_please_login = /** @type {(inputs: {}) => string} */ () => {
13
+ return `Login to your account`
14
+ };
@@ -0,0 +1,5 @@
1
+ export const hello_world: (inputs: {
2
+ name: NonNullable<unknown>;
3
+ }) => string;
4
+ export const login_hello: (inputs: {}) => string;
5
+ export const login_please_login: (inputs: {}) => string;
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+
3
+
4
+ export const hello_world = /** @type {(inputs: { name: NonNullable<unknown> }) => string} */ (i) => {
5
+ return `Hello, ${i.name} from pl!`
6
+ };
7
+
8
+ export const login_hello = /** @type {(inputs: {}) => string} */ () => {
9
+ return `Witaj ponownie`
10
+ };
11
+
12
+ export const login_please_login = /** @type {(inputs: {}) => string} */ () => {
13
+ return `Zaloguj się na swoje konto`
14
+ };
@@ -1 +1,5 @@
1
+ /**
2
+ * Returns the underlying `better-auth` instance from the initialized CMS.
3
+ * @public
4
+ */
1
5
  export declare function getAuth(): import("better-auth", { with: { "resolution-mode": "require" } }).Auth<import("better-auth", { with: { "resolution-mode": "require" } }).BetterAuthOptions>;
@@ -1,4 +1,8 @@
1
1
  import { getCMS } from '../core/cms.js';
2
+ /**
3
+ * Returns the underlying `better-auth` instance from the initialized CMS.
4
+ * @public
5
+ */
2
6
  export function getAuth() {
3
7
  return getCMS().auth;
4
8
  }
@@ -125,3 +125,7 @@ export declare function createShopClient(options?: ShopClientOptions): ShopClien
125
125
  export type { CartSnapshot, CartLine, CartItemRef } from '../cart/types.js';
126
126
  export { createOrderState } from './use-order.svelte.js';
127
127
  export type { OrderState, CreateOrderStateOptions, OrderPaymentPhase } from './use-order.svelte.js';
128
+ export { default as OrderStatus } from '../svelte/OrderStatus.svelte';
129
+ export { default as InpostPicker } from '../svelte/InpostPicker.svelte';
130
+ export { DEFAULT_LABELS_PL } from '../svelte/labels.js';
131
+ export type { OrderStatusLabels } from '../svelte/labels.js';
@@ -47,3 +47,7 @@ function tokenQuery(token) {
47
47
  return token ? `?token=${encodeURIComponent(token)}` : '';
48
48
  }
49
49
  export { createOrderState } from './use-order.svelte.js';
50
+ // Folded from `./shop/svelte` (dropped as separate export in 0.20.0)
51
+ export { default as OrderStatus } from '../svelte/OrderStatus.svelte';
52
+ export { default as InpostPicker } from '../svelte/InpostPicker.svelte';
53
+ export { DEFAULT_LABELS_PL } from '../svelte/labels.js';
@@ -12,9 +12,29 @@ type SingleInput = Omit<SingleConfig, 'fields'> & {
12
12
  fields: Field[];
13
13
  layout?: Layout;
14
14
  };
15
+ /**
16
+ * Defines the root CMS configuration. Pass to `includioCMS()` in `hooks.server.ts`.
17
+ * @public
18
+ */
15
19
  export declare function defineConfig(config: CMSConfig): CMSConfig;
20
+ /**
21
+ * Defines a collection (multi-entry content type).
22
+ * @public
23
+ */
16
24
  export declare function defineCollection(config: CollectionInput): CollectionConfig;
25
+ /**
26
+ * Defines a singleton (single-entry content type, e.g. site settings).
27
+ * @public
28
+ */
17
29
  export declare function defineSingle(config: SingleInput): SingleConfig;
30
+ /**
31
+ * Defines a public form (submitted via `/api/forms/[slug]/submit`).
32
+ * @public
33
+ */
18
34
  export declare function defineForm(config: FormConfig): FormConfig;
35
+ /**
36
+ * Defines a reusable object field (nested record). Use inside `fields[]`.
37
+ * @public
38
+ */
19
39
  export declare function defineObject(config: Omit<ObjectField, 'type'>): ObjectField;
20
40
  export {};
@@ -1,15 +1,35 @@
1
+ /**
2
+ * Defines the root CMS configuration. Pass to `includioCMS()` in `hooks.server.ts`.
3
+ * @public
4
+ */
1
5
  export function defineConfig(config) {
2
6
  return config;
3
7
  }
8
+ /**
9
+ * Defines a collection (multi-entry content type).
10
+ * @public
11
+ */
4
12
  export function defineCollection(config) {
5
13
  return config;
6
14
  }
15
+ /**
16
+ * Defines a singleton (single-entry content type, e.g. site settings).
17
+ * @public
18
+ */
7
19
  export function defineSingle(config) {
8
20
  return config;
9
21
  }
22
+ /**
23
+ * Defines a public form (submitted via `/api/forms/[slug]/submit`).
24
+ * @public
25
+ */
10
26
  export function defineForm(config) {
11
27
  return config;
12
28
  }
29
+ /**
30
+ * Defines a reusable object field (nested record). Use inside `fields[]`.
31
+ * @public
32
+ */
13
33
  export function defineObject(config) {
14
34
  return { ...config, type: 'object' };
15
35
  }
@@ -1,3 +1,7 @@
1
1
  import { type Handle } from '@sveltejs/kit';
2
2
  import type { CMSConfig } from '../../types/cms.js';
3
+ /**
4
+ * 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`.
5
+ * @public
6
+ */
3
7
  export declare function includioCMS(cmsConfig: CMSConfig): Handle[];
@@ -65,6 +65,10 @@ const detectBrowserContext = async ({ event, resolve }) => {
65
65
  };
66
66
  return resolve(event);
67
67
  };
68
+ /**
69
+ * 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`.
70
+ * @public
71
+ */
68
72
  export function includioCMS(cmsConfig) {
69
73
  generateRuntime(cmsConfig); // Generate runtime code based on the CMS config
70
74
  initCMS(cmsConfig);
@@ -5,3 +5,4 @@ export { createFormSubmission } from '../../core/server/forms/submissions/operat
5
5
  export { parseFormDataForSubmission } from '../../core/server/forms/submissions/utils/parseMultipart.js';
6
6
  export { createConsentLog } from '../../core/server/consentLogs/operations/create.js';
7
7
  export { getPreviewEntry } from './preview.js';
8
+ export { createRestApiHandler } from '../../admin/api/rest/handler.js';
@@ -5,3 +5,5 @@ export { createFormSubmission } from '../../core/server/forms/submissions/operat
5
5
  export { parseFormDataForSubmission } from '../../core/server/forms/submissions/utils/parseMultipart.js';
6
6
  export { createConsentLog } from '../../core/server/consentLogs/operations/create.js';
7
7
  export { getPreviewEntry } from './preview.js';
8
+ // Folded from `./admin/api/rest/handler` (dropped as separate export in 0.20.0)
9
+ export { createRestApiHandler } from '../../admin/api/rest/handler.js';
@@ -1,4 +1,8 @@
1
1
  import type { RequestEvent } from '@sveltejs/kit';
2
+ /**
3
+ * Returns `cmsContext` from `event.locals` for use in a SvelteKit layout `load`. Drop into your `+layout.server.ts`.
4
+ * @public
5
+ */
2
6
  export declare function cmsLayoutLoad(event: RequestEvent): {
3
7
  cmsContext: any;
4
8
  };
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Returns `cmsContext` from `event.locals` for use in a SvelteKit layout `load`. Drop into your `+layout.server.ts`.
3
+ * @public
4
+ */
1
5
  export function cmsLayoutLoad(event) {
2
6
  return {
3
7
  cmsContext: event.locals.cmsContext ?? {}
@@ -1,5 +1,9 @@
1
1
  import type { Entry } from '../../types/entries.js';
2
2
  import { type RequestEvent } from '@sveltejs/kit';
3
+ /**
4
+ * Resolves the preview entry from a `?preview=<versionId>` query param. Requires an authenticated session — throws `Unauthorized` otherwise.
5
+ * @public
6
+ */
3
7
  export declare function getPreviewEntry(event: RequestEvent, options: {
4
8
  language: string;
5
9
  }): Promise<Entry | null>;
@@ -1,5 +1,9 @@
1
1
  import { getEntryVersion } from '../../core/server/entries/operations/get.js';
2
2
  import {} from '@sveltejs/kit';
3
+ /**
4
+ * Resolves the preview entry from a `?preview=<versionId>` query param. Requires an authenticated session — throws `Unauthorized` otherwise.
5
+ * @public
6
+ */
3
7
  export async function getPreviewEntry(event, options) {
4
8
  const preview = event.url.searchParams.get('preview');
5
9
  if (!preview) {
@@ -14,3 +14,4 @@ export { type PluginConfig, type CustomFieldDefinition } from './plugins.js';
14
14
  export { type Language, type Localized } from './languages.js';
15
15
  export { type Layout, type LayoutNode, type LayoutPreset, type LayoutNodeType, type ColumnRatio, type SectionNode, type ColumnsNode, type CardNode, type AccordionNode, type StackNode } from './layout.js';
16
16
  export { type CmsContext } from './cms-context.js';
17
+ export { type UserData, type Breadcrumb } from '../admin/types.js';
@@ -14,3 +14,4 @@ export {} from './plugins.js';
14
14
  export {} from './languages.js';
15
15
  export {} from './layout.js';
16
16
  export {} from './cms-context.js';
17
+ export {} from '../admin/types.js';
@@ -3,6 +3,10 @@ import type { z } from 'zod';
3
3
  import type { RawEntry } from './entries.js';
4
4
  import type { CustomField } from './fields.js';
5
5
  import type { PopulateCtx } from '../core/server/entries/operations/resolveEntry.js';
6
+ /**
7
+ * Defines a custom field type contributed by a plugin.
8
+ * @experimental Plugin system finalizes in 1.x — shape may change.
9
+ */
6
10
  export interface CustomFieldDefinition {
7
11
  /** Unique field type slug, e.g. 'photo-grid' */
8
12
  fieldType: string;
@@ -20,6 +24,10 @@ export interface CustomFieldDefinition {
20
24
  */
21
25
  populateResolver?: (value: unknown, field: CustomField, ctx: PopulateCtx) => Promise<unknown>;
22
26
  }
27
+ /**
28
+ * CMS plugin configuration — register custom field types and CRUD lifecycle hooks.
29
+ * @experimental Plugin hooks API not finalized — may change in 1.x without breaking semver.
30
+ */
23
31
  export interface PluginConfig {
24
32
  slug: string;
25
33
  fields?: CustomFieldDefinition[];
@@ -0,0 +1,2 @@
1
+ import type { CmsUpdate } from '../index.js';
2
+ export declare const update: CmsUpdate;
@@ -0,0 +1,54 @@
1
+ export const update = {
2
+ version: '0.20.0',
3
+ date: '2026-04-29',
4
+ description: '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.',
5
+ features: [
6
+ '`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`.',
7
+ 'Wszystkie publiczne `define*` helpery (`defineConfig`, `defineCollection`, `defineSingle`, `defineForm`, `defineObject`) oznaczone `@public`.',
8
+ '`getCMS`, `getAuth`, `createEntityAPI`, `resolveMediaWithStyles`, `includioCMS`, `cmsLayoutLoad`, `getPreviewEntry`, `createFormSubmission`, `parseFormDataForSubmission`, `createConsentLog`, `createRestApiHandler` — `@public`.',
9
+ '`PluginConfig` + `CustomFieldDefinition` oznaczone `@experimental` — plugin hooks API finalizujemy w 1.x.'
10
+ ],
11
+ fixes: [],
12
+ breakingChanges: [
13
+ '**`package.json` exports trim 26→15.** Usunięte / scalone entry pointy poniżej. Każdy import wymaga jednorazowej migracji (znajdź-i-zamień).',
14
+ '`includio-cms/admin` → `includio-cms/types` (typy `UserData`, `Breadcrumb` przeniesione do publicznych typów).',
15
+ '`includio-cms/admin/helpers` → `includio-cms/admin/client` (re-eksport — zmień tylko ścieżkę importu).',
16
+ '`includio-cms/admin/ui` → `includio-cms/admin/client` (re-eksport — zmień tylko ścieżkę importu).',
17
+ '`includio-cms/admin/client/account` → `includio-cms/admin/client` (re-eksport — `AccountPage` dostępny pod nową ścieżką).',
18
+ '`includio-cms/admin/api/*` (wildcard) → **usunięte**. Były to internalsy (media-gc, upload, transcode, replace) — nie powinny być publiczne. Brak migracji.',
19
+ '`includio-cms/admin/api/rest/handler` → `includio-cms/sveltekit/server` (`createRestApiHandler` — zmień ścieżkę importu).',
20
+ '`includio-cms/admin/client/*.svelte` (wildcard) → użyj nazwanych eksportów z `includio-cms/admin/client`.',
21
+ '`includio-cms/sveltekit/components/*.svelte` (wildcard) → użyj nazwanych eksportów z `includio-cms/sveltekit`.',
22
+ '`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ą).',
23
+ '`includio-cms/auth` → `includio-cms/core` (`getAuth` — zmień ścieżkę importu).',
24
+ '`includio-cms/entity` → `includio-cms/core` (`createEntityAPI` — zmień ścieżkę importu).',
25
+ '`includio-cms/shop/svelte` → `includio-cms/shop/client` (`OrderStatus`, `InpostPicker`, `DEFAULT_LABELS_PL`, `OrderStatusLabels` — zmień ścieżkę importu).',
26
+ '`includio-cms/updates` → **usunięte** (internal CLI tooling, nigdy nie powinno być w runtime API).'
27
+ ],
28
+ notes: `Migracja (znajdź-i-zamień):
29
+
30
+ \`\`\`bash
31
+ # Przykładowe sed'y (dostosuj do swojego edytora):
32
+ sed -i '' "s|'includio-cms/admin/helpers'|'includio-cms/admin/client'|g" src/**/*.ts
33
+ sed -i '' "s|'includio-cms/admin/ui'|'includio-cms/admin/client'|g" src/**/*.ts
34
+ sed -i '' "s|'includio-cms/auth'|'includio-cms/core'|g" src/**/*.ts
35
+ sed -i '' "s|'includio-cms/entity'|'includio-cms/core'|g" src/**/*.ts
36
+ sed -i '' "s|'includio-cms/shop/svelte'|'includio-cms/shop/client'|g" src/**/*.ts
37
+ sed -i '' "s|'includio-cms/auth-schema'|'includio-cms/db-postgres'|g" src/**/*.ts
38
+ sed -i '' "s|'includio-cms/db-postgres/schema-core'|'includio-cms/db-postgres'|g" src/**/*.ts
39
+ sed -i '' "s|'includio-cms/db-postgres/schema-shop'|'includio-cms/db-postgres'|g" src/**/*.ts
40
+ sed -i '' "s|'includio-cms/admin/api/rest/handler'|'includio-cms/sveltekit/server'|g" src/**/*.ts
41
+ \`\`\`
42
+
43
+ Po migracji uruchom \`pnpm check\` — TypeScript zweryfikuje czy wszystkie symbole są dostępne pod nową ścieżką.
44
+
45
+ API Surface freeze v1.0:
46
+
47
+ - **\`@public\`** — stabilne, semver-protected w v1.0. Breaking change wymaga major bump.
48
+ - **\`@experimental\`** — może się zmienić w 1.x bez breaking semver (np. \`PluginConfig\` — plugin hooks API).
49
+ - **\`@internal\`** — implementation detail, NIE importować. Nie listowane w \`API.md\`.
50
+
51
+ Pełna lista publicznych symboli per entry point: \`API.md\` w root paczki (regenerowany przy każdym \`npm publish\`).
52
+
53
+ Brak SQL migration. Zmiana czysto package-level.`
54
+ };
@@ -53,7 +53,8 @@ import { update as update0155 } from './0.15.5/index.js';
53
53
  import { update as update0160 } from './0.16.0/index.js';
54
54
  import { update as update0180 } from './0.18.0/index.js';
55
55
  import { update as update0190 } from './0.19.0/index.js';
56
- export const updates = [update0065, update0066, update0067, update0068, update0069, update010, update011, update012, update013, update014, update015, update020, update022, update050, update051, update052, update053, update054, update055, update056, update057, update058, update060, update061, update062, update070, update071, update072, update073, update080, update090, update0100, update0110, update0120, update0130, update0131, update0132, update0133, update0134, update0140, update0141, update0142, update0143, update0144, update0145, update0146, update0150, update0151, update0152, update0153, update0154, update0155, update0160, update0180, update0190];
56
+ import { update as update0200 } from './0.20.0/index.js';
57
+ export const updates = [update0065, update0066, update0067, update0068, update0069, update010, update011, update012, update013, update014, update015, update020, update022, update050, update051, update052, update053, update054, update055, update056, update057, update058, update060, update061, update062, update070, update071, update072, update073, update080, update090, update0100, update0110, update0120, update0130, update0131, update0132, update0133, update0134, update0140, update0141, update0142, update0143, update0144, update0145, update0146, update0150, update0151, update0152, update0153, update0154, update0155, update0160, update0180, update0190, update0200];
57
58
  export const getUpdatesFrom = (fromVersion) => {
58
59
  const fromParts = fromVersion.split('.').map(Number);
59
60
  return updates.filter((update) => {