fimo 2.2.0-staging.8 → 2.2.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 (106) hide show
  1. package/assets/agent-templates/_default/config.yaml +6 -0
  2. package/assets/agent-templates/broken-link-sweeper/config.yaml +1 -0
  3. package/assets/content-templates/shared/types.eta +65 -6
  4. package/assets/skills/fimo-cli/SKILL.md +5 -3
  5. package/assets/skills/fimo-cli/references/agents.md +29 -4
  6. package/assets/skills/fimo-cli/references/assets.md +42 -3
  7. package/assets/skills/fimo-cli/references/branches.md +9 -8
  8. package/assets/skills/fimo-cli/references/content.md +4 -4
  9. package/assets/skills/fimo-cli/references/credits.md +12 -19
  10. package/assets/skills/fimo-cli/references/deploy.md +8 -8
  11. package/assets/skills/fimo-cli/references/forms.md +3 -1
  12. package/assets/skills/fimo-cli/references/history.md +3 -2
  13. package/assets/skills/fimo-cli/references/inbox.md +86 -0
  14. package/assets/skills/fimo-cli/references/init.md +7 -6
  15. package/assets/skills/fimo-cli/references/invite.md +11 -9
  16. package/assets/skills/fimo-cli/references/labels.md +3 -11
  17. package/assets/skills/fimo-cli/references/locales.md +5 -3
  18. package/assets/skills/fimo-cli/references/preview.md +1 -2
  19. package/assets/skills/fimo-cli/references/projects.md +8 -8
  20. package/assets/skills/fimo-cli/references/schedules.md +6 -4
  21. package/assets/skills/fimo-cli/references/webhooks.md +6 -4
  22. package/assets/skills/fimo-code/references/assets.md +22 -11
  23. package/assets/skills/fimo-code/references/content/clients.md +15 -1
  24. package/assets/skills/fimo-code/references/content/schema.md +1 -0
  25. package/assets/skills/fimo-code/references/frameworks/astro.md +1 -1
  26. package/assets/skills/fimo-code/references/frameworks/next/app-router.md +12 -1
  27. package/assets/skills/fimo-code/references/frameworks/next/locales.md +2 -2
  28. package/assets/skills/fimo-code/references/frameworks/next.md +1 -1
  29. package/assets/skills/fimo-code/references/locales.md +4 -2
  30. package/assets/skills/fimo-migration/SKILL.md +54 -16
  31. package/assets/skills/fimo-migration/references/frameworks/nextjs.md +8 -0
  32. package/assets/skills/fimo-migration/references/media.md +11 -0
  33. package/assets/skills/fimo-migration/references/qa.md +30 -4
  34. package/assets/skills/fimo-migration/references/questions-and-improvements.md +188 -0
  35. package/assets/skills/fimo-migration/references/workers/content-planner.md +8 -3
  36. package/assets/skills/fimo-migration/references/workers/validator.md +20 -6
  37. package/assets/skills/fimo-migration/references/workers.md +17 -6
  38. package/assets/skills/fimo-migration/references/workflow.md +36 -6
  39. package/assets/skills/fimo-studio/SKILL.md +3 -1
  40. package/assets/skills/fimo-studio/references/agents.md +25 -0
  41. package/assets/skills/fimo-studio/references/ai-chat.md +1 -2
  42. package/assets/skills/fimo-studio/references/billing-and-credits.md +14 -7
  43. package/assets/skills/fimo-studio/references/visual-editing.md +9 -1
  44. package/assets/skills/fimo-studio/references/webhooks.md +1 -1
  45. package/dist/cli/bundle.json +2 -2
  46. package/dist/cli/index.js +210 -179
  47. package/dist/runtime/content/client/collection-core.js +3 -2
  48. package/dist/runtime/content/client/core-types.d.ts +4 -3
  49. package/dist/runtime/content/client/internal.d.ts +2 -0
  50. package/dist/runtime/content/client/internal.js +54 -25
  51. package/dist/runtime/content/client/singleton-core.js +2 -1
  52. package/dist/runtime/content/index.d.ts +1 -1
  53. package/dist/runtime/content/index.js +1 -1
  54. package/dist/runtime/content/serialization.d.ts +4 -3
  55. package/dist/runtime/content/serialization.js +4 -3
  56. package/dist/runtime/primitives/lib/index.d.ts +1 -1
  57. package/dist/runtime/primitives/lib/index.js +1 -1
  58. package/dist/runtime/primitives/lib/primitives.d.ts +39 -12
  59. package/dist/runtime/primitives/lib/primitives.js +83 -17
  60. package/dist/runtime/primitives/lib/template.js +2 -2
  61. package/dist/runtime/shared/local-runtime-env.d.ts +2 -2
  62. package/dist/runtime/shared/local-runtime-env.js +14 -9
  63. package/dist/runtime/templates.d.ts +9 -2
  64. package/dist/runtime/templates.js +36 -7
  65. package/dist/scripts/validate-schemas.js +10 -15
  66. package/package.json +10 -8
  67. package/release.json +2 -2
  68. package/templates/astro/AGENTS.md +1 -1
  69. package/templates/astro/package.json +2 -2
  70. package/templates/nextjs/AGENTS.md +2 -2
  71. package/templates/nextjs/package.json +3 -3
  72. package/templates/nextjs/src/app/layout.tsx +4 -1
  73. package/templates/react-router/AGENTS.md +2 -2
  74. package/templates/react-router/package.json +4 -4
  75. package/templates/sveltekit/AGENTS.md +1 -1
  76. package/templates/sveltekit/package.json +2 -2
  77. package/templates/vite/AGENTS.md +5 -1
  78. package/templates/vite/package.json +4 -4
  79. package/templates/welcome/manifest.json +655 -0
  80. package/templates/welcome/media/analytics-overview.avif +0 -0
  81. package/templates/welcome/media/autonomous-loop.avif +0 -0
  82. package/templates/welcome/media/editable-preview.avif +0 -0
  83. package/templates/welcome/media/media-library.avif +0 -0
  84. package/templates/welcome/media/slack-teams.avif +0 -0
  85. package/templates/welcome/template/.fimo/agents/welcome-guide/GOAL.md +12 -0
  86. package/templates/welcome/template/.fimo/agents/welcome-guide/capabilities.yaml +3 -0
  87. package/templates/welcome/template/.fimo/agents/welcome-guide/config.yaml +8 -0
  88. package/templates/welcome/template/.fimo/config.json +53 -0
  89. package/templates/welcome/template/src/font.css +60 -0
  90. package/templates/welcome/template/src/pages/ArticleDetail.tsx +104 -0
  91. package/templates/welcome/template/src/pages/Index.tsx +36 -0
  92. package/templates/welcome/template/src/pages/SiteContent.tsx +674 -0
  93. package/templates/welcome/template/src/pages/fallback-content.ts +152 -0
  94. package/templates/welcome/template/src/routes.ts +9 -0
  95. package/templates/welcome/template/src/schemas/Article.json +34 -0
  96. package/templates/welcome/template/src/schemas/Article.ts +54 -0
  97. package/templates/welcome/template/src/schemas/Article.types.ts +93 -0
  98. package/templates/welcome/template/src/schemas/Author.json +17 -0
  99. package/templates/welcome/template/src/schemas/Author.ts +51 -0
  100. package/templates/welcome/template/src/schemas/Author.types.ts +54 -0
  101. package/templates/welcome/template/src/schemas/Category.json +17 -0
  102. package/templates/welcome/template/src/schemas/Category.ts +51 -0
  103. package/templates/welcome/template/src/schemas/Category.types.ts +54 -0
  104. package/templates/welcome/template/src/schemas/HomePage.json +110 -0
  105. package/templates/welcome/template/src/schemas/HomePage.ts +22 -0
  106. package/templates/welcome/template/src/schemas/HomePage.types.ts +116 -0
@@ -0,0 +1,152 @@
1
+ import type { HomePage } from '@/schemas/HomePage';
2
+
3
+ import type { TutorialArticle } from './SiteContent';
4
+
5
+ // Generated from the starter seed (../../manifest.json): the loading
6
+ // fallback renders the real TutorialPage with this data so the live CMS
7
+ // values swap in without any visible change. Regenerate when the seed
8
+ // copy changes — a drifted fallback flashes different text on load.
9
+ // Rich-text values carry { content: <tiptap doc> } like FimoRichText;
10
+ // the missing source symbol simply disables inline editing until the
11
+ // live values arrive.
12
+
13
+ export const FALLBACK_PAGE = {
14
+ title: 'Welcome to the Fimo onboarding!',
15
+ intro: {
16
+ content: {
17
+ type: 'doc',
18
+ content: [
19
+ {
20
+ type: 'paragraph',
21
+ content: [
22
+ {
23
+ type: 'text',
24
+ text: 'This is a tutorial project, made for you to practice.',
25
+ },
26
+ { type: 'hardBreak' },
27
+ {
28
+ type: 'text',
29
+ text: 'Four actions, five minutes, and nothing you change here can break anything.',
30
+ },
31
+ ],
32
+ },
33
+ ],
34
+ },
35
+ },
36
+ startLabel: 'Start the 5-minute tour',
37
+ tourTitle: 'Try the essentials in five minutes',
38
+ tourIntro: 'Follow these steps in order. Every change is safe to make in this tutorial project.',
39
+ steps: [
40
+ {
41
+ _key: 'fallback-step-1',
42
+ number: '1',
43
+ title: 'Edit this page',
44
+ body: 'Edit mode lets you change text and images directly on the website.\n- Select the big title and replace it with “Welcome, [your name]”.',
45
+ actionLabel: 'Activate Edit mode',
46
+ action: 'toggleEditMode',
47
+ },
48
+ {
49
+ _key: 'fallback-step-2',
50
+ number: '2',
51
+ title: 'Open the CMS',
52
+ body: 'The website content also lives in the CMS, as structured data.\n- Change “Title” and watch the site update.',
53
+ actionLabel: 'Jump to the Home page',
54
+ action: 'openHomePage',
55
+ },
56
+ {
57
+ _key: 'fallback-step-3',
58
+ number: '3',
59
+ title: 'Explore branches',
60
+ body: 'Branches let people and agents work without touching the live site.\n- Create “tutorial/first-change” from the branch menu and change the page title there.',
61
+ actionLabel: 'Show the branch menu',
62
+ action: 'openBranches',
63
+ },
64
+ {
65
+ _key: 'fallback-step-4',
66
+ number: '4',
67
+ title: 'Meet your agent',
68
+ body: 'Your agent maintains this website on a schedule.\n- Open its latest run, read the report, and accept the proposed change.',
69
+ actionLabel: 'Meet your first agent',
70
+ action: 'openAgents',
71
+ },
72
+ ],
73
+ articlesTitle: 'Continue learning in the CMS',
74
+ articlesIntro:
75
+ 'These are real entries in the Articles collection. Open Content to edit their titles, summaries, bodies, and cover images.',
76
+ migrationTitle: 'Migrate my existing website',
77
+ migrationBody: {
78
+ content: {
79
+ type: 'doc',
80
+ content: [
81
+ {
82
+ type: 'paragraph',
83
+ content: [
84
+ {
85
+ type: 'text',
86
+ text: 'Open your existing local project with Codex, Claude Code, Cursor, or another coding agent. Copy the prompt below so the agent connects the website you already trust to Fimo, with a recoverable backup first.',
87
+ },
88
+ ],
89
+ },
90
+ ],
91
+ },
92
+ },
93
+ migrationPrompt:
94
+ 'Before changing anything, create a recoverable backup of this website. If it uses Git, create a branch and commit the current state. If it does not use Git, duplicate the entire project folder and confirm the copy opens. Then inspect the existing codebase and migrate this website to Fimo in place. Preserve every route, visible piece of content, media asset, form, SEO field, redirect, and locale. Connect the existing implementation to Fimo rather than generating a new empty site. Report any item you cannot migrate safely before changing it.',
95
+ buildTitle: 'Create my website',
96
+ buildBody: {
97
+ content: {
98
+ type: 'doc',
99
+ content: [
100
+ {
101
+ type: 'paragraph',
102
+ content: [
103
+ {
104
+ type: 'text',
105
+ text: 'Use your Codex, Claude Code, Cursor, or other coding-agent subscription to design and build the first version in a local repository. Connect it to Fimo when the foundation is ready. Fimo starts where the first build ends: content, visual editing, environments, agents, and hosting.',
106
+ },
107
+ ],
108
+ },
109
+ ],
110
+ },
111
+ },
112
+ closingTitle: 'Fimo keeps finished websites autonomous',
113
+ closingBody:
114
+ 'Fimo Credits are designed for the agents that maintain your website and for teammates who use Studio chat without a local coding tool.',
115
+ footerNote: 'This tutorial website is looked after by your Fimo agent.',
116
+ } as unknown as HomePage;
117
+
118
+ // Covers are omitted: the card's image box keeps its own aspect ratio, so
119
+ // the live images arrive without shifting the layout.
120
+ // The author and category shapes mirror a populated read: the cards render
121
+ // them during the loading window too, so a fallback without them would
122
+ // crash the very first paint.
123
+ // Ordered the way the live read returns them (newest entry first), not the
124
+ // way the manifest seeds them: the fallback exists to be replaced without a
125
+ // visible change, and a different order is a visible change.
126
+ export const FALLBACK_ARTICLES = [
127
+ {
128
+ id: 'fallback-article-1',
129
+ slug: 'discover-the-analytics',
130
+ title: 'Discover the analytics',
131
+ summary: 'What your traffic numbers mean, and how an agent can use them to improve your pages every week.',
132
+ author: { name: 'Fimo Product', role: 'Product team' },
133
+ category: { name: 'Automation' },
134
+ },
135
+ {
136
+ id: 'fallback-article-2',
137
+ slug: 'branches-and-environments',
138
+ title: 'How branches and environments work',
139
+ summary: 'What a branch is, why it keeps your live site safe, and how changes come back together.',
140
+ author: { name: 'Fimo Engineering', role: 'Engineering team' },
141
+ category: { name: 'Concepts' },
142
+ },
143
+ {
144
+ id: 'fallback-article-3',
145
+ slug: 'create-your-first-agent',
146
+ title: 'Create your first agent',
147
+ summary:
148
+ 'Build a weekly SEO agent with one prompt: full audit, safe fixes applied to the CMS, and a report you can trust.',
149
+ author: { name: 'Fimo Engineering', role: 'Engineering team' },
150
+ category: { name: 'Automation' },
151
+ },
152
+ ] as unknown as TutorialArticle[];
@@ -0,0 +1,9 @@
1
+ import type { RouteConfig } from '@react-router/dev/routes';
2
+ import { layout, route } from '@react-router/dev/routes';
3
+
4
+ export default [
5
+ layout('./pages/LocaleLayout.tsx', [
6
+ route(':locale?', './pages/Index.tsx', { id: 'home' }),
7
+ route(':locale?/articles/:slug', './pages/ArticleDetail.tsx', { id: 'article' }),
8
+ ]),
9
+ ] satisfies RouteConfig;
@@ -0,0 +1,34 @@
1
+ {
2
+ "uid": "Article",
3
+ "name": "Articles",
4
+ "isSingleton": false,
5
+ "i18n": {
6
+ "enabled": false
7
+ },
8
+ "fields": {
9
+ "title": {
10
+ "type": "string",
11
+ "required": true
12
+ },
13
+ "summary": {
14
+ "type": "text",
15
+ "required": true
16
+ },
17
+ "body": {
18
+ "type": "richtext",
19
+ "required": true
20
+ },
21
+ "cover": {
22
+ "type": "media",
23
+ "required": true
24
+ },
25
+ "author": {
26
+ "type": "reference",
27
+ "target": "Author"
28
+ },
29
+ "category": {
30
+ "type": "reference",
31
+ "target": "Category"
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,54 @@
1
+ // AUTO-GENERATED by `fimo` from src/schemas/Article.json - DO NOT EDIT.
2
+ // Change content fields in the schema, then run `fimo validate`.
3
+ // Runtime implementation lives in the project-local fimo-react package export.
4
+ import { createContentClient } from "fimo-react";
5
+ import type { CollectionContentClient } from "fimo-react";
6
+ import type { ContentSchema } from "fimo-react";
7
+
8
+ import schema from "./Article.json";
9
+ import * as Author from "./Author";
10
+ import * as Category from "./Category";
11
+ import type { Article, ArticleFields, ArticleInput, ArticlePopulate, ArticleQuery } from "./Article.types";
12
+
13
+ export type { Article, ArticleFields, ArticleFimoMeta, ArticleInput, ArticlePopulate, ArticleQuery, ArticleReferences, ArticleResult, ArticleSort, ArticleWhere } from "./Article.types";
14
+ export type { CollectionPage, CollectionPageInfo, InfiniteListResult } from "fimo-react";
15
+ export type InfiniteListQuery<
16
+ TFields extends ArticleFields | undefined = undefined,
17
+ TPopulate extends ArticlePopulate | undefined = undefined,
18
+ > = Omit<ArticleQuery<TFields, TPopulate>, "offset">;
19
+
20
+ const client: CollectionContentClient<Article, ArticleInput> = createContentClient<
21
+ Article,
22
+ ArticleInput
23
+ >({
24
+ schema: schema as unknown as ContentSchema,
25
+ references: { Author, Category },
26
+ });
27
+
28
+ export const {
29
+ wrapWithSource,
30
+ meta,
31
+ getById,
32
+ getBySlug,
33
+ getByField,
34
+ list,
35
+ get,
36
+ create,
37
+ update,
38
+ remove,
39
+ useGetById,
40
+ useGetBySlug,
41
+ useGetByField,
42
+ useList,
43
+ useInfiniteList,
44
+ useGet,
45
+ useSuspenseGetById,
46
+ useSuspenseGet,
47
+ useSuspenseGetByField,
48
+ useSuspenseGetBySlug,
49
+ useCreate,
50
+ useUpdate,
51
+ useRemove,
52
+ } = client;
53
+
54
+ export default client;
@@ -0,0 +1,93 @@
1
+ // AUTO-GENERATED ⚠️ – do not edit by hand
2
+ import { type Fields, type FimoMedia, type FimoReference, type FimoRichText, type FimoRichTextContent, type FimoString, type Populate, type PopulatedResult, type ProjectedWithPopulate, type Query, type Sort, type Where, type WithReferences } from "fimo-react";
3
+ import type { Author } from "./Author.types";
4
+ import type { Category } from "./Category.types";
5
+
6
+ /*───────────────────────────────────────────────────────────────*/
7
+ /* ──────────── 📄 Type definitions ──────────── */
8
+ /*───────────────────────────────────────────────────────────────*/
9
+
10
+ /**
11
+ * What a media field stores: a reference to a media-library asset. Point at the
12
+ * asset by `id`, or by the `url` an upload returned and Fimo resolves the `id`
13
+ * for you. `alt` belongs to the entry, so it survives replacing the asset. The
14
+ * facts the asset owns are never copied in, so they cannot go stale.
15
+ */
16
+ export type FimoMediaRef = ({ id: string; url?: string } | { id?: string; url: string }) & {
17
+ alt?: string;
18
+ source?: "local" | "external";
19
+ };
20
+
21
+ /**
22
+ * What a read returns for a media field it named in `populate`: the reference
23
+ * plus the facts the asset owns as of that read. `name`, `mime`, `width`, and
24
+ * `height` remain optional when the asset is external, missing, or incomplete.
25
+ * A read that did not name the field returns `FimoMedia` with those facts absent.
26
+ */
27
+ export type FimoPopulatedMedia = FimoMedia & { name?: string; mime?: string };
28
+
29
+ /**
30
+ * Article entity interface
31
+ */
32
+ export interface ArticleFimoMeta {
33
+ contentType: "Article";
34
+ }
35
+
36
+ export interface Article extends WithReferences<ArticleReferences> {
37
+ id: string;
38
+ entryId: string;
39
+ documentId: string;
40
+ slug: FimoString;
41
+ locale: string;
42
+ createdAt: string;
43
+ updatedAt: string;
44
+ __fimo: ArticleFimoMeta;
45
+ title: FimoString;
46
+ summary: FimoString;
47
+ body: FimoRichText;
48
+ cover: FimoMedia;
49
+ author: FimoReference | null;
50
+ category: FimoReference | null;
51
+ }
52
+
53
+ export interface ArticleInput {
54
+ slug?: string;
55
+ documentId?: string;
56
+ title: string;
57
+ summary: string;
58
+ body: FimoRichTextContent;
59
+ cover: FimoMediaRef;
60
+ author?: FimoReference | null;
61
+ category?: FimoReference | null;
62
+ }
63
+
64
+
65
+ /**
66
+ * What each populatable field returns when a read names it in `populate`: a
67
+ * reference field resolves to its target entry, a media field to the asset's
68
+ * current facts, a blocks field to the same items with every media value
69
+ * inside them filled. Fields absent here are returned as stored.
70
+ */
71
+ export interface ArticleReferences {
72
+ author: Author | null;
73
+ category: Category | null;
74
+ cover: FimoPopulatedMedia;
75
+ }
76
+
77
+ export type ArticlePopulate = Populate<Article>;
78
+
79
+ /*───────────────────────────────────────────────────────────────*/
80
+ /* ──────────── 🔎 Query types ──────────── */
81
+ /*───────────────────────────────────────────────────────────────*/
82
+
83
+ export type ArticleWhere = Where<Article>;
84
+ export type ArticleSort = Sort<Article>;
85
+ export type ArticleFields = Fields<Article>;
86
+ export type ArticleQuery<
87
+ TFields extends ArticleFields | undefined = ArticleFields | undefined,
88
+ TPopulate extends ArticlePopulate | undefined = ArticlePopulate | undefined,
89
+ > = Query<Article, TFields, TPopulate>;
90
+ export type ArticleResult<
91
+ TFields extends ArticleFields | undefined = undefined,
92
+ TPopulate extends ArticlePopulate | undefined = undefined,
93
+ > = ProjectedWithPopulate<PopulatedResult<Article, TPopulate>, TFields, TPopulate>;
@@ -0,0 +1,17 @@
1
+ {
2
+ "uid": "Author",
3
+ "name": "Authors",
4
+ "isSingleton": false,
5
+ "i18n": {
6
+ "enabled": false
7
+ },
8
+ "fields": {
9
+ "name": {
10
+ "type": "string",
11
+ "required": true
12
+ },
13
+ "role": {
14
+ "type": "string"
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,51 @@
1
+ // AUTO-GENERATED by `fimo` from src/schemas/Author.json - DO NOT EDIT.
2
+ // Change content fields in the schema, then run `fimo validate`.
3
+ // Runtime implementation lives in the project-local fimo-react package export.
4
+ import { createContentClient } from "fimo-react";
5
+ import type { CollectionContentClient } from "fimo-react";
6
+ import type { ContentSchema } from "fimo-react";
7
+
8
+ import schema from "./Author.json";
9
+ import type { Author, AuthorFields, AuthorInput, AuthorPopulate, AuthorQuery } from "./Author.types";
10
+
11
+ export type { Author, AuthorFields, AuthorFimoMeta, AuthorInput, AuthorPopulate, AuthorQuery, AuthorReferences, AuthorResult, AuthorSort, AuthorWhere } from "./Author.types";
12
+ export type { CollectionPage, CollectionPageInfo, InfiniteListResult } from "fimo-react";
13
+ export type InfiniteListQuery<
14
+ TFields extends AuthorFields | undefined = undefined,
15
+ TPopulate extends AuthorPopulate | undefined = undefined,
16
+ > = Omit<AuthorQuery<TFields, TPopulate>, "offset">;
17
+
18
+ const client: CollectionContentClient<Author, AuthorInput> = createContentClient<
19
+ Author,
20
+ AuthorInput
21
+ >({
22
+ schema: schema as unknown as ContentSchema,
23
+ });
24
+
25
+ export const {
26
+ wrapWithSource,
27
+ meta,
28
+ getById,
29
+ getBySlug,
30
+ getByField,
31
+ list,
32
+ get,
33
+ create,
34
+ update,
35
+ remove,
36
+ useGetById,
37
+ useGetBySlug,
38
+ useGetByField,
39
+ useList,
40
+ useInfiniteList,
41
+ useGet,
42
+ useSuspenseGetById,
43
+ useSuspenseGet,
44
+ useSuspenseGetByField,
45
+ useSuspenseGetBySlug,
46
+ useCreate,
47
+ useUpdate,
48
+ useRemove,
49
+ } = client;
50
+
51
+ export default client;
@@ -0,0 +1,54 @@
1
+ // AUTO-GENERATED ⚠️ – do not edit by hand
2
+ import { type Fields, type FimoString, type Populate, type PopulatedResult, type ProjectedWithPopulate, type Query, type Sort, type Where, type WithReferences } from "fimo-react";
3
+
4
+ /*───────────────────────────────────────────────────────────────*/
5
+ /* ──────────── 📄 Type definitions ──────────── */
6
+ /*───────────────────────────────────────────────────────────────*/
7
+
8
+ /**
9
+ * Author entity interface
10
+ */
11
+ export interface AuthorFimoMeta {
12
+ contentType: "Author";
13
+ }
14
+
15
+ export interface Author extends WithReferences<AuthorReferences> {
16
+ id: string;
17
+ entryId: string;
18
+ documentId: string;
19
+ slug: FimoString;
20
+ locale: string;
21
+ createdAt: string;
22
+ updatedAt: string;
23
+ __fimo: AuthorFimoMeta;
24
+ name: FimoString;
25
+ role: FimoString;
26
+ }
27
+
28
+ export interface AuthorInput {
29
+ slug?: string;
30
+ documentId?: string;
31
+ name: string;
32
+ role?: string;
33
+ }
34
+
35
+
36
+ export type AuthorReferences = Record<never, never>;
37
+
38
+ export type AuthorPopulate = Populate<Author>;
39
+
40
+ /*───────────────────────────────────────────────────────────────*/
41
+ /* ──────────── 🔎 Query types ──────────── */
42
+ /*───────────────────────────────────────────────────────────────*/
43
+
44
+ export type AuthorWhere = Where<Author>;
45
+ export type AuthorSort = Sort<Author>;
46
+ export type AuthorFields = Fields<Author>;
47
+ export type AuthorQuery<
48
+ TFields extends AuthorFields | undefined = AuthorFields | undefined,
49
+ TPopulate extends AuthorPopulate | undefined = AuthorPopulate | undefined,
50
+ > = Query<Author, TFields, TPopulate>;
51
+ export type AuthorResult<
52
+ TFields extends AuthorFields | undefined = undefined,
53
+ TPopulate extends AuthorPopulate | undefined = undefined,
54
+ > = ProjectedWithPopulate<PopulatedResult<Author, TPopulate>, TFields, TPopulate>;
@@ -0,0 +1,17 @@
1
+ {
2
+ "uid": "Category",
3
+ "name": "Categories",
4
+ "isSingleton": false,
5
+ "i18n": {
6
+ "enabled": false
7
+ },
8
+ "fields": {
9
+ "name": {
10
+ "type": "string",
11
+ "required": true
12
+ },
13
+ "description": {
14
+ "type": "text"
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,51 @@
1
+ // AUTO-GENERATED by `fimo` from src/schemas/Category.json - DO NOT EDIT.
2
+ // Change content fields in the schema, then run `fimo validate`.
3
+ // Runtime implementation lives in the project-local fimo-react package export.
4
+ import { createContentClient } from "fimo-react";
5
+ import type { CollectionContentClient } from "fimo-react";
6
+ import type { ContentSchema } from "fimo-react";
7
+
8
+ import schema from "./Category.json";
9
+ import type { Category, CategoryFields, CategoryInput, CategoryPopulate, CategoryQuery } from "./Category.types";
10
+
11
+ export type { Category, CategoryFields, CategoryFimoMeta, CategoryInput, CategoryPopulate, CategoryQuery, CategoryReferences, CategoryResult, CategorySort, CategoryWhere } from "./Category.types";
12
+ export type { CollectionPage, CollectionPageInfo, InfiniteListResult } from "fimo-react";
13
+ export type InfiniteListQuery<
14
+ TFields extends CategoryFields | undefined = undefined,
15
+ TPopulate extends CategoryPopulate | undefined = undefined,
16
+ > = Omit<CategoryQuery<TFields, TPopulate>, "offset">;
17
+
18
+ const client: CollectionContentClient<Category, CategoryInput> = createContentClient<
19
+ Category,
20
+ CategoryInput
21
+ >({
22
+ schema: schema as unknown as ContentSchema,
23
+ });
24
+
25
+ export const {
26
+ wrapWithSource,
27
+ meta,
28
+ getById,
29
+ getBySlug,
30
+ getByField,
31
+ list,
32
+ get,
33
+ create,
34
+ update,
35
+ remove,
36
+ useGetById,
37
+ useGetBySlug,
38
+ useGetByField,
39
+ useList,
40
+ useInfiniteList,
41
+ useGet,
42
+ useSuspenseGetById,
43
+ useSuspenseGet,
44
+ useSuspenseGetByField,
45
+ useSuspenseGetBySlug,
46
+ useCreate,
47
+ useUpdate,
48
+ useRemove,
49
+ } = client;
50
+
51
+ export default client;
@@ -0,0 +1,54 @@
1
+ // AUTO-GENERATED ⚠️ – do not edit by hand
2
+ import { type Fields, type FimoString, type Populate, type PopulatedResult, type ProjectedWithPopulate, type Query, type Sort, type Where, type WithReferences } from "fimo-react";
3
+
4
+ /*───────────────────────────────────────────────────────────────*/
5
+ /* ──────────── 📄 Type definitions ──────────── */
6
+ /*───────────────────────────────────────────────────────────────*/
7
+
8
+ /**
9
+ * Category entity interface
10
+ */
11
+ export interface CategoryFimoMeta {
12
+ contentType: "Category";
13
+ }
14
+
15
+ export interface Category extends WithReferences<CategoryReferences> {
16
+ id: string;
17
+ entryId: string;
18
+ documentId: string;
19
+ slug: FimoString;
20
+ locale: string;
21
+ createdAt: string;
22
+ updatedAt: string;
23
+ __fimo: CategoryFimoMeta;
24
+ name: FimoString;
25
+ description: FimoString;
26
+ }
27
+
28
+ export interface CategoryInput {
29
+ slug?: string;
30
+ documentId?: string;
31
+ name: string;
32
+ description?: string;
33
+ }
34
+
35
+
36
+ export type CategoryReferences = Record<never, never>;
37
+
38
+ export type CategoryPopulate = Populate<Category>;
39
+
40
+ /*───────────────────────────────────────────────────────────────*/
41
+ /* ──────────── 🔎 Query types ──────────── */
42
+ /*───────────────────────────────────────────────────────────────*/
43
+
44
+ export type CategoryWhere = Where<Category>;
45
+ export type CategorySort = Sort<Category>;
46
+ export type CategoryFields = Fields<Category>;
47
+ export type CategoryQuery<
48
+ TFields extends CategoryFields | undefined = CategoryFields | undefined,
49
+ TPopulate extends CategoryPopulate | undefined = CategoryPopulate | undefined,
50
+ > = Query<Category, TFields, TPopulate>;
51
+ export type CategoryResult<
52
+ TFields extends CategoryFields | undefined = undefined,
53
+ TPopulate extends CategoryPopulate | undefined = undefined,
54
+ > = ProjectedWithPopulate<PopulatedResult<Category, TPopulate>, TFields, TPopulate>;