includio-cms 0.5.3 → 0.5.5

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 (46) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/ROADMAP.md +16 -0
  3. package/dist/admin/api/rest/handler.d.ts +7 -0
  4. package/dist/admin/api/rest/handler.js +116 -0
  5. package/dist/admin/api/rest/middleware/apiKey.d.ts +6 -0
  6. package/dist/admin/api/rest/middleware/apiKey.js +45 -0
  7. package/dist/admin/api/rest/routes/collections.d.ts +5 -0
  8. package/dist/admin/api/rest/routes/collections.js +104 -0
  9. package/dist/admin/api/rest/routes/entries.d.ts +2 -0
  10. package/dist/admin/api/rest/routes/entries.js +37 -0
  11. package/dist/admin/api/rest/routes/languages.d.ts +1 -0
  12. package/dist/admin/api/rest/routes/languages.js +5 -0
  13. package/dist/admin/api/rest/routes/schema.d.ts +2 -0
  14. package/dist/admin/api/rest/routes/schema.js +78 -0
  15. package/dist/admin/api/rest/routes/singletons.d.ts +3 -0
  16. package/dist/admin/api/rest/routes/singletons.js +60 -0
  17. package/dist/admin/auth-client.d.ts +7 -7
  18. package/dist/admin/client/collection/collection-entries.svelte +56 -5
  19. package/dist/admin/client/collection/data-table.svelte +127 -18
  20. package/dist/admin/client/collection/data-table.svelte.d.ts +2 -0
  21. package/dist/admin/components/fields/relation-field.svelte +13 -10
  22. package/dist/admin/components/layout/nav-collections.svelte +2 -1
  23. package/dist/admin/components/layout/nav-forms.svelte +2 -1
  24. package/dist/admin/components/layout/nav-singletons.svelte +2 -1
  25. package/dist/admin/remote/entry.remote.d.ts +9 -1
  26. package/dist/admin/remote/entry.remote.js +14 -2
  27. package/dist/cli/scaffold/admin.js +8 -0
  28. package/dist/core/cms.d.ts +2 -1
  29. package/dist/core/cms.js +2 -0
  30. package/dist/core/server/entries/operations/get.js +2 -1
  31. package/dist/core/server/entries/operations/update.d.ts +1 -0
  32. package/dist/core/server/entries/operations/update.js +5 -1
  33. package/dist/db-postgres/schema/entry.d.ts +17 -0
  34. package/dist/db-postgres/schema/entry.js +4 -2
  35. package/dist/server/auth.d.ts +6 -6
  36. package/dist/sveltekit/server/handle.js +1 -0
  37. package/dist/types/cms.d.ts +7 -0
  38. package/dist/types/collections.d.ts +2 -0
  39. package/dist/types/entries.d.ts +7 -1
  40. package/dist/types/index.d.ts +1 -1
  41. package/dist/updates/0.5.4/index.d.ts +2 -0
  42. package/dist/updates/0.5.4/index.js +15 -0
  43. package/dist/updates/0.5.5/index.d.ts +2 -0
  44. package/dist/updates/0.5.5/index.js +20 -0
  45. package/dist/updates/index.js +3 -1
  46. package/package.json +6 -1
@@ -11,6 +11,7 @@ const adminGuard = async ({ event, resolve }) => {
11
11
  !event.url.pathname.startsWith('/admin/accept-invite') &&
12
12
  !event.url.pathname.startsWith('/admin/api/accept-invite') &&
13
13
  !event.url.pathname.startsWith('/admin/reset-password') &&
14
+ !event.url.pathname.startsWith('/admin/api/rest/') &&
14
15
  (!user || !session)) {
15
16
  setFlash({
16
17
  message: 'You must be logged in to access the admin panel.',
@@ -27,6 +27,11 @@ export interface AuthAdapter {
27
27
  } | null>;
28
28
  };
29
29
  }
30
+ export interface ApiKeyConfig {
31
+ key: string;
32
+ name?: string;
33
+ role?: 'admin' | 'editor';
34
+ }
30
35
  export interface CMSConfig {
31
36
  languages: Language[];
32
37
  collections?: CollectionConfig[];
@@ -39,6 +44,7 @@ export interface CMSConfig {
39
44
  plugins?: PluginConfig[];
40
45
  ai?: AIAdapter;
41
46
  media?: MediaConfig;
47
+ apiKeys?: ApiKeyConfig[];
42
48
  }
43
49
  export interface ICMS {
44
50
  collections: Record<string, CollectionConfigWithType>;
@@ -52,4 +58,5 @@ export interface ICMS {
52
58
  plugins: PluginConfig[];
53
59
  aiAdapter: AIAdapter | null;
54
60
  mediaConfig: MediaConfig;
61
+ apiKeys: ApiKeyConfig[];
55
62
  }
@@ -6,6 +6,8 @@ export interface CollectionConfig extends ConfigBase {
6
6
  singular?: Localized;
7
7
  plural?: Localized;
8
8
  };
9
+ orderable?: boolean;
10
+ listColumns?: string[];
9
11
  }
10
12
  export interface CollectionConfigWithType extends CollectionConfig {
11
13
  type: 'collection';
@@ -19,6 +19,7 @@ export interface DbEntry {
19
19
  publishedAt: Date | null;
20
20
  publishedVersionId: string | null;
21
21
  publishedBy: string | null;
22
+ sortOrder: number | null;
22
23
  }
23
24
  export interface DbEntryInsert {
24
25
  slug: string;
@@ -30,6 +31,7 @@ export interface DbEntryInsert {
30
31
  publishedAt?: Date | null;
31
32
  publishedVersionId?: string | null;
32
33
  publishedBy?: string | null;
34
+ sortOrder?: number | null;
33
35
  }
34
36
  export interface RawEntry extends DbEntry {
35
37
  collection: CollectionConfigWithType | SingleConfigWithType;
@@ -68,7 +70,7 @@ export interface PaginationOptions {
68
70
  limit?: number;
69
71
  offset?: number;
70
72
  orderBy?: {
71
- column: 'createdAt' | 'updatedAt';
73
+ column: 'createdAt' | 'updatedAt' | 'sortOrder';
72
74
  direction: 'asc' | 'desc';
73
75
  };
74
76
  }
@@ -103,6 +105,10 @@ export interface GetEntriesOptions {
103
105
  dataLike?: Record<string, unknown>;
104
106
  language?: string;
105
107
  status?: EntryStatus;
108
+ orderBy?: {
109
+ column: 'createdAt' | 'updatedAt' | 'sortOrder';
110
+ direction: 'asc' | 'desc';
111
+ };
106
112
  }
107
113
  export interface GetEntryOptions {
108
114
  id?: string;
@@ -8,6 +8,6 @@ export { type CollectionConfig } from './collections.js';
8
8
  export { type SingleConfig } from './singles.js';
9
9
  export { type FormConfig, type FormSubmission } from './forms.js';
10
10
  export { type FormField, type FormFieldType, type FormBaseField, type FormTextField, type FormEmailField, type FormTextareaField, type FormCheckboxField, type FormSelectField } from './formFields.js';
11
- export { type CMSConfig } from './cms.js';
11
+ export { type CMSConfig, type ApiKeyConfig } from './cms.js';
12
12
  export { type Language, type Localized } from './languages.js';
13
13
  export { type Layout, type LayoutNode, type LayoutPreset, type LayoutNodeType, type ColumnRatio, type SectionNode, type ColumnsNode, type CardNode, type AccordionNode, type StackNode } from './layout.js';
@@ -0,0 +1,2 @@
1
+ import type { CmsUpdate } from '../index.js';
2
+ export declare const update: CmsUpdate;
@@ -0,0 +1,15 @@
1
+ export const update = {
2
+ version: '0.5.4',
3
+ date: '2026-03-04',
4
+ description: 'Collection ordering (DnD), custom list columns',
5
+ features: [
6
+ 'Orderable collections: DnD reordering of entries in admin list with keyboard alternative (WCAG 2.1)',
7
+ 'Custom list columns: display arbitrary entry fields as columns in collection list',
8
+ 'sortOrder column on entries table for persistent manual ordering',
9
+ 'reorderEntriesCommand remote for bulk sort order updates'
10
+ ],
11
+ fixes: [],
12
+ breakingChanges: [],
13
+ sql: 'ALTER TABLE entry ADD COLUMN sort_order INTEGER;',
14
+ notes: 'Add `orderable: true` to collections that need manual ordering. Add `listColumns: ["fieldSlug"]` to show fields in the entry list.'
15
+ };
@@ -0,0 +1,2 @@
1
+ import type { CmsUpdate } from '../index.js';
2
+ export declare const update: CmsUpdate;
@@ -0,0 +1,20 @@
1
+ export const update = {
2
+ version: '0.5.5',
3
+ date: '2026-03-04',
4
+ description: 'REST API with API key auth, orderable collection fixes',
5
+ features: [
6
+ 'REST API with API key authentication — CRUD for collections, singletons, entries, schema introspection, language listing',
7
+ 'API key configuration in CMS config (`apiKeys` array)',
8
+ 'getEntries supports `orderBy` parameter (column + direction)',
9
+ 'Admin scaffold generates REST API catch-all route'
10
+ ],
11
+ fixes: [
12
+ 'Orderable collections: DnD rows use proper `<tr>` element instead of `<div>` wrapper',
13
+ 'Reorder buttons always visible (not sr-only) for better discoverability',
14
+ 'Selection enabled for orderable collections',
15
+ 'Relation field respects orderable collection sort order',
16
+ 'Nav active state: exact match prevents false highlights on similarly-named routes'
17
+ ],
18
+ breakingChanges: [],
19
+ notes: 'Add `apiKeys: [{ key: "your-secret", name: "My App" }]` to CMS config. REST API available at `/admin/api/rest/`.'
20
+ };
@@ -15,7 +15,9 @@ import { update as update050 } from './0.5.0/index.js';
15
15
  import { update as update051 } from './0.5.1/index.js';
16
16
  import { update as update052 } from './0.5.2/index.js';
17
17
  import { update as update053 } from './0.5.3/index.js';
18
- export const updates = [update0065, update0066, update0067, update0068, update0069, update010, update011, update012, update013, update014, update015, update020, update022, update050, update051, update052, update053];
18
+ import { update as update054 } from './0.5.4/index.js';
19
+ import { update as update055 } from './0.5.5/index.js';
20
+ export const updates = [update0065, update0066, update0067, update0068, update0069, update010, update011, update012, update013, update014, update015, update020, update022, update050, update051, update052, update053, update054, update055];
19
21
  export const getUpdatesFrom = (fromVersion) => {
20
22
  const fromParts = fromVersion.split('.').map(Number);
21
23
  return updates.filter((update) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "includio-cms",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
@@ -63,6 +63,11 @@
63
63
  "svelte": "./dist/admin/api/*.js",
64
64
  "node": "./dist/admin/api/*.js"
65
65
  },
66
+ "./admin/api/rest/handler": {
67
+ "types": "./dist/admin/api/rest/handler.d.ts",
68
+ "svelte": "./dist/admin/api/rest/handler.js",
69
+ "node": "./dist/admin/api/rest/handler.js"
70
+ },
66
71
  "./admin/client/account": {
67
72
  "types": "./dist/admin/client/account/index.d.ts",
68
73
  "svelte": "./dist/admin/client/account/index.js"