fimo 0.5.0 → 0.6.0-experimental.2

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 (31) hide show
  1. package/assets/content-templates/hooks-template.eta +83 -38
  2. package/assets/content-templates/types-template.eta +6 -2
  3. package/assets/skills/fimo/SKILL.md +1 -1
  4. package/assets/skills/fimo/references/content.md +13 -14
  5. package/assets/skills/fimo/references/locales.md +8 -0
  6. package/assets/skills/fimo/references/setup-react-router.md +2 -2
  7. package/assets/skills/fimo/references/ui.md +1 -1
  8. package/assets/skills/fimo-cli/references/content.md +9 -6
  9. package/assets/skills/fimo-cli/references/locales.md +6 -0
  10. package/dist/cli/bundle.json +1 -1
  11. package/dist/cli/index.js +112 -55
  12. package/dist/runtime/app/prefetch.js +1 -1
  13. package/dist/runtime/content/utils/retrieve-data-sources.d.ts +1 -0
  14. package/dist/runtime/content/utils/retrieve-data-sources.d.ts.map +1 -1
  15. package/dist/runtime/content/utils/retrieve-data-sources.js +27 -4
  16. package/dist/runtime/paths/get-fimo-paths.d.ts.map +1 -1
  17. package/dist/runtime/paths/get-fimo-paths.js +16 -6
  18. package/dist/runtime/paths/get-fimo-paths.test.d.ts +2 -0
  19. package/dist/runtime/paths/get-fimo-paths.test.d.ts.map +1 -0
  20. package/dist/runtime/paths/get-fimo-paths.test.js +69 -0
  21. package/dist/runtime/primitives/lib/query.d.ts +11 -9
  22. package/dist/runtime/primitives/lib/query.d.ts.map +1 -1
  23. package/dist/runtime/primitives/public-surface.test.js +3 -3
  24. package/dist/runtime/seo/buildSeoForPath.d.ts +1 -3
  25. package/dist/runtime/seo/buildSeoForPath.d.ts.map +1 -1
  26. package/dist/runtime/seo/buildSeoForPath.js +4 -1
  27. package/dist/scripts/resolve-routes.js +1 -1
  28. package/dist/scripts/sync-schemas.test.js +14 -3
  29. package/package.json +2 -2
  30. package/release.json +2 -2
  31. package/templates/react-router/package.json +10 -7
package/dist/cli/index.js CHANGED
@@ -20618,6 +20618,13 @@ var init_api = __esm({
20618
20618
  });
20619
20619
  return body.data;
20620
20620
  }
20621
+ async upsertSchemas(projectId, contentTypes) {
20622
+ const body = await this.request(this.tenantPath(projectId, "/schema/batch"), {
20623
+ method: "POST",
20624
+ body: JSON.stringify({ contentTypes })
20625
+ });
20626
+ return body.data;
20627
+ }
20621
20628
  async deleteSchema(projectId, typeName) {
20622
20629
  const body = await this.request(this.tenantPath(projectId, `/schema/types/${typeName}`), {
20623
20630
  method: "DELETE"
@@ -20627,33 +20634,39 @@ var init_api = __esm({
20627
20634
  // ── Tenant API: Entries ──
20628
20635
  async listEntries(projectId, typeName, params) {
20629
20636
  const query = params ? `?${new URLSearchParams(params).toString()}` : "";
20630
- return this.request(this.tenantPath(projectId, `/entries/${typeName}${query}`));
20637
+ return this.request(this.tenantPath(projectId, `/v2/entries/${typeName}${query}`));
20631
20638
  }
20632
- async getEntry(projectId, typeName, id, params) {
20633
- const query = params ? `?${new URLSearchParams(params).toString()}` : "";
20639
+ async getEntry(projectId, typeName, documentId, locale) {
20640
+ const query = new URLSearchParams({ locale }).toString();
20634
20641
  const body = await this.request(
20635
- this.tenantPath(projectId, `/entries/${typeName}/${id}${query}`)
20642
+ this.tenantPath(projectId, `/v2/entries/${typeName}/${documentId}?${query}`)
20636
20643
  );
20637
20644
  return body.data;
20638
20645
  }
20639
20646
  async createEntry(projectId, typeName, data2) {
20640
- const body = await this.request(this.tenantPath(projectId, `/entries/${typeName}`), {
20647
+ const body = await this.request(this.tenantPath(projectId, `/v2/entries/${typeName}`), {
20641
20648
  method: "POST",
20642
20649
  body: JSON.stringify(data2)
20643
20650
  });
20644
20651
  return body.data;
20645
20652
  }
20646
- async updateEntry(projectId, typeName, id, data2) {
20647
- const body = await this.request(this.tenantPath(projectId, `/entries/${typeName}/${id}`), {
20648
- method: "PUT",
20649
- body: JSON.stringify(data2)
20650
- });
20653
+ async updateEntry(projectId, typeName, documentId, locale, data2) {
20654
+ const query = new URLSearchParams({ locale }).toString();
20655
+ const body = await this.request(
20656
+ this.tenantPath(projectId, `/v2/entries/${typeName}/${documentId}?${query}`),
20657
+ {
20658
+ method: "PUT",
20659
+ body: JSON.stringify(data2)
20660
+ }
20661
+ );
20651
20662
  return body.data;
20652
20663
  }
20653
- async deleteEntry(projectId, typeName, id) {
20654
- const body = await this.request(this.tenantPath(projectId, `/entries/${typeName}/${id}`), {
20655
- method: "DELETE"
20656
- });
20664
+ async deleteEntry(projectId, typeName, documentId, locale) {
20665
+ const query = new URLSearchParams({ locale }).toString();
20666
+ const body = await this.request(
20667
+ this.tenantPath(projectId, `/v2/entries/${typeName}/${documentId}?${query}`),
20668
+ { method: "DELETE" }
20669
+ );
20657
20670
  return body.data;
20658
20671
  }
20659
20672
  // ── Tenant API: Assets ──
@@ -44400,7 +44413,7 @@ var init_payment_method_dto = __esm({
44400
44413
  });
44401
44414
 
44402
44415
  // ../../packages/api-contracts/dist/esm/dtos/content.dto.js
44403
- var FieldDefinitionSchema, ContentTypeI18nSchema, ContentTypeDTOSchema, ContentTypeDTO, SchemaDTOSchema, SchemaDTO, EntryDTOSchema, EntryDTO, PaginatedEntriesDTOSchema, PaginatedEntriesDTO, EntryCountDTOSchema, EntryCountDTO, EntryCountsDTOSchema, EntryCountsDTO, ContentTypeResponseSchema, ContentTypeListResponseSchema, SchemaResponseSchema, EntryResponseSchema, EntryListResponseSchema;
44416
+ var FieldDefinitionSchema, ContentTypeI18nSchema, ContentTypeDTOSchema, ContentTypeDTO, SchemaDTOSchema, SchemaDTO, EntryDTOSchema, EntryDTO, EntryV2DTOSchema, EntryV2DTO, PaginatedEntriesDTOSchema, PaginatedEntriesDTO, PaginatedEntriesV2DTOSchema, PaginatedEntriesV2DTO, EntryCountDTOSchema, EntryCountDTO, EntryCountsDTOSchema, EntryCountsDTO, ContentTypeResponseSchema, ContentTypeListResponseSchema, SchemaResponseSchema, EntryResponseSchema, EntryV2ResponseSchema, EntryListResponseSchema, EntryV2ListResponseSchema;
44404
44417
  var init_content_dto = __esm({
44405
44418
  "../../packages/api-contracts/dist/esm/dtos/content.dto.js"() {
44406
44419
  "use strict";
@@ -44442,6 +44455,18 @@ var init_content_dto = __esm({
44442
44455
  })
44443
44456
  }).passthrough();
44444
44457
  EntryDTO = createDTO(EntryDTOSchema);
44458
+ EntryV2DTOSchema = external_exports.object({
44459
+ id: external_exports.never().optional(),
44460
+ documentId: external_exports.string(),
44461
+ slug: external_exports.string(),
44462
+ locale: external_exports.string(),
44463
+ createdAt: external_exports.string(),
44464
+ updatedAt: external_exports.string(),
44465
+ __fimo: external_exports.object({
44466
+ contentType: external_exports.string()
44467
+ })
44468
+ }).passthrough();
44469
+ EntryV2DTO = createDTO(EntryV2DTOSchema);
44445
44470
  PaginatedEntriesDTOSchema = external_exports.object({
44446
44471
  data: external_exports.array(EntryDTOSchema),
44447
44472
  meta: external_exports.object({
@@ -44452,6 +44477,10 @@ var init_content_dto = __esm({
44452
44477
  })
44453
44478
  });
44454
44479
  PaginatedEntriesDTO = createDTO(PaginatedEntriesDTOSchema);
44480
+ PaginatedEntriesV2DTOSchema = PaginatedEntriesDTOSchema.extend({
44481
+ data: external_exports.array(EntryV2DTOSchema)
44482
+ });
44483
+ PaginatedEntriesV2DTO = createDTO(PaginatedEntriesV2DTOSchema);
44455
44484
  EntryCountDTOSchema = external_exports.object({
44456
44485
  contentType: external_exports.string(),
44457
44486
  count: external_exports.number()
@@ -44465,7 +44494,9 @@ var init_content_dto = __esm({
44465
44494
  ContentTypeListResponseSchema = createResponseSchema(external_exports.array(ContentTypeDTOSchema));
44466
44495
  SchemaResponseSchema = createResponseSchema(SchemaDTOSchema);
44467
44496
  EntryResponseSchema = createResponseSchema(EntryDTOSchema);
44497
+ EntryV2ResponseSchema = createResponseSchema(EntryV2DTOSchema);
44468
44498
  EntryListResponseSchema = createResponseSchema(external_exports.array(EntryDTOSchema));
44499
+ EntryV2ListResponseSchema = createResponseSchema(external_exports.array(EntryV2DTOSchema));
44469
44500
  }
44470
44501
  });
44471
44502
 
@@ -48782,13 +48813,15 @@ function isCommandAvailable(command) {
48782
48813
  const result = spawnSync(probe, [command], { stdio: "ignore" });
48783
48814
  return result.status === 0;
48784
48815
  }
48785
- async function resolveOrganization(api, explicit) {
48816
+ async function resolveOrganization(api, explicit, options = {}) {
48786
48817
  if (explicit) {
48787
48818
  return explicit;
48788
48819
  }
48789
48820
  const creds = readCredentials();
48790
- if (creds?.activeOrganization?.id) {
48791
- return creds.activeOrganization.id;
48821
+ const activeOrganizationId = creds?.activeOrganization?.id;
48822
+ const nonInteractive2 = options.nonInteractive ?? (currentMode().format === "json" || !isInteractive());
48823
+ if (nonInteractive2 && activeOrganizationId) {
48824
+ return activeOrganizationId;
48792
48825
  }
48793
48826
  let orgs2;
48794
48827
  try {
@@ -48803,7 +48836,30 @@ async function resolveOrganization(api, explicit) {
48803
48836
  if (orgs2.length === 0) {
48804
48837
  throw new ScaffoldError("NO_ORGANIZATIONS", "No organization found for this account.");
48805
48838
  }
48806
- return orgs2[0].id;
48839
+ if (orgs2.length === 1) {
48840
+ return orgs2[0].id;
48841
+ }
48842
+ if (nonInteractive2) {
48843
+ throw new ScaffoldError(
48844
+ "ORGANIZATION_REQUIRED",
48845
+ "Several organizations are available and no active organization is configured.",
48846
+ "Pass --org <organizationId>, or run `fimo orgs switch --org <id-or-slug>` first."
48847
+ );
48848
+ }
48849
+ const currentId = orgs2.some((organization) => organization.id === activeOrganizationId) ? activeOrganizationId : void 0;
48850
+ const selected = await _t({
48851
+ message: "Select an organization for this project",
48852
+ initialValue: currentId,
48853
+ options: orgs2.map((organization) => ({
48854
+ value: organization.id,
48855
+ label: organization.name,
48856
+ hint: organization.id === currentId ? "current" : organization.slug
48857
+ }))
48858
+ });
48859
+ if (q(selected)) {
48860
+ throw new ScaffoldError("ORGANIZATION_SELECTION_CANCELLED", "Organization selection cancelled.");
48861
+ }
48862
+ return selected;
48807
48863
  }
48808
48864
  var execFileAsync7, MAIN_BRANCH, ScaffoldError;
48809
48865
  var init_scaffold_project = __esm({
@@ -48817,6 +48873,7 @@ var init_scaffold_project = __esm({
48817
48873
  init_auth_errors();
48818
48874
  init_git_credential_setup();
48819
48875
  init_git();
48876
+ init_interactive();
48820
48877
  init_local_project_files();
48821
48878
  init_scaffold();
48822
48879
  init_skills();
@@ -49041,6 +49098,7 @@ async function planInit(args) {
49041
49098
  let projectId;
49042
49099
  let targetDir;
49043
49100
  let displayName;
49101
+ const derived = { ...options };
49044
49102
  if (useExisting) {
49045
49103
  projectId = options.projectId ?? await selectProjectId({
49046
49104
  api,
@@ -49068,8 +49126,27 @@ async function planInit(args) {
49068
49126
  });
49069
49127
  return null;
49070
49128
  }
49129
+ try {
49130
+ derived.org = await resolveOrganization(api, options.org, {
49131
+ nonInteractive: nonInteractive(options)
49132
+ });
49133
+ } catch (error45) {
49134
+ if (error45 instanceof ScaffoldError && error45.code === "ORGANIZATION_SELECTION_CANCELLED") {
49135
+ ui.info({ command: "init", message: "Cancelled." });
49136
+ return null;
49137
+ }
49138
+ if (error45 instanceof ScaffoldError) {
49139
+ ui.error({
49140
+ command: "init",
49141
+ code: error45.code,
49142
+ message: error45.message,
49143
+ hint: error45.hint
49144
+ });
49145
+ return null;
49146
+ }
49147
+ throw error45;
49148
+ }
49071
49149
  }
49072
- const derived = { ...options };
49073
49150
  const gatherAgents = !nonInteractive(options) && (!useExisting || options.skills !== false);
49074
49151
  if (gatherAgents) {
49075
49152
  let agents;
@@ -106299,11 +106376,10 @@ async function entriesListCommand(typeName, options, cmd) {
106299
106376
  ui.result({ command: "entries list", data: result, render: /* @__PURE__ */ __name(() => renderPrettyJson5(result), "render") });
106300
106377
  }
106301
106378
  __name(entriesListCommand, "entriesListCommand");
106302
- async function entriesGetCommand(typeName, id, options, cmd) {
106379
+ async function entriesGetCommand(typeName, documentId, options, cmd) {
106303
106380
  const { ctx, api } = await bootstrapProjectCommand(options, cmd);
106304
106381
  await requireOperation("cms.get", { projectId: ctx.projectId, env: ctx.env });
106305
- const params = options.locale ? { locale: options.locale } : void 0;
106306
- const result = await api.getEntry(ctx.projectId, typeName, id, params);
106382
+ const result = await api.getEntry(ctx.projectId, typeName, documentId, options.locale);
106307
106383
  ui.result({ command: "entries get", data: result, render: /* @__PURE__ */ __name(() => renderPrettyJson5(result), "render") });
106308
106384
  }
106309
106385
  __name(entriesGetCommand, "entriesGetCommand");
@@ -106318,21 +106394,18 @@ async function entriesCreateCommand(typeName, options, cmd) {
106318
106394
  ui.result({ command: "entries create", data: result, render: /* @__PURE__ */ __name(() => renderPrettyJson5(result), "render") });
106319
106395
  }
106320
106396
  __name(entriesCreateCommand, "entriesCreateCommand");
106321
- async function entriesUpdateCommand(typeName, id, options, cmd) {
106397
+ async function entriesUpdateCommand(typeName, documentId, options, cmd) {
106322
106398
  const { ctx, api } = await bootstrapProjectCommand(options, cmd, { refuseReadOnly: true });
106323
106399
  await requireOperation("cms.update", { projectId: ctx.projectId, env: ctx.env });
106324
- const data2 = addDefinedMetadata(parseJsonObject(options.body), {
106325
- locale: options.locale,
106326
- documentId: options.documentId
106327
- });
106328
- const result = await api.updateEntry(ctx.projectId, typeName, id, data2);
106400
+ const data2 = parseJsonObject(options.body);
106401
+ const result = await api.updateEntry(ctx.projectId, typeName, documentId, options.locale, data2);
106329
106402
  ui.result({ command: "entries update", data: result, render: /* @__PURE__ */ __name(() => renderPrettyJson5(result), "render") });
106330
106403
  }
106331
106404
  __name(entriesUpdateCommand, "entriesUpdateCommand");
106332
- async function entriesDeleteCommand(typeName, id, options, cmd) {
106405
+ async function entriesDeleteCommand(typeName, documentId, options, cmd) {
106333
106406
  const { ctx, api } = await bootstrapProjectCommand(options, cmd, { refuseReadOnly: true });
106334
106407
  await requireOperation("cms.delete", { projectId: ctx.projectId, env: ctx.env });
106335
- const result = await api.deleteEntry(ctx.projectId, typeName, id);
106408
+ const result = await api.deleteEntry(ctx.projectId, typeName, documentId, options.locale);
106336
106409
  ui.result({ command: "entries delete", data: result, render: /* @__PURE__ */ __name(() => renderPrettyJson5(result), "render") });
106337
106410
  }
106338
106411
  __name(entriesDeleteCommand, "entriesDeleteCommand");
@@ -109785,7 +109858,6 @@ init_dist();
109785
109858
  init_sync_schemas();
109786
109859
  import fs42 from "node:fs";
109787
109860
  import path46 from "node:path";
109788
- init_api();
109789
109861
  init_project_context();
109790
109862
  init_project();
109791
109863
  function toApiShape(schema) {
@@ -109802,10 +109874,6 @@ function renderPrettyJson8(data2) {
109802
109874
  return JSON.stringify(data2, null, 2);
109803
109875
  }
109804
109876
  __name(renderPrettyJson8, "renderPrettyJson");
109805
- function isAlreadyExistsError(error45) {
109806
- return error45 instanceof ApiRequestError && error45.status === 400 && /already exists/i.test(error45.detail);
109807
- }
109808
- __name(isAlreadyExistsError, "isAlreadyExistsError");
109809
109877
  async function schemaListCommand(options, cmd) {
109810
109878
  const { ctx, api } = await bootstrapProjectCommand(options, cmd);
109811
109879
  await requireOperation("cms.schema.list", { projectId: ctx.projectId, env: ctx.env });
@@ -109849,21 +109917,10 @@ async function schemaPushCommand(typeName, options, cmd) {
109849
109917
  return JSON.parse(fs42.readFileSync(filePath, "utf-8"));
109850
109918
  });
109851
109919
  syncSchemas({ cwd, verbose: false });
109852
- const results = [];
109853
- for (const schema of schemas3) {
109854
- const contentType = toApiShape(schema);
109855
- try {
109856
- const result = await api.createSchema(ctx.projectId, contentType);
109857
- results.push(result);
109858
- } catch (error45) {
109859
- if (isAlreadyExistsError(error45)) {
109860
- const result = await api.updateSchema(ctx.projectId, contentType.name, contentType);
109861
- results.push(result);
109862
- } else {
109863
- throw error45;
109864
- }
109865
- }
109866
- }
109920
+ const results = await api.upsertSchemas(
109921
+ ctx.projectId,
109922
+ schemas3.map((schema) => toApiShape(schema))
109923
+ );
109867
109924
  const payload = results.length === 1 ? results[0] : results;
109868
109925
  ui.result({ command: "schemas push", data: payload, render: /* @__PURE__ */ __name(() => renderPrettyJson8(payload), "render") });
109869
109926
  }
@@ -110184,7 +110241,7 @@ registerChannelsCommands(program);
110184
110241
  registerSchedulesCommands(program);
110185
110242
  program.command("invite").description("Invite a user to an organization or project").option("--target <target>", "Invite target: organization or project").option("--org <organizationId>", "Organization ID (defaults to active when needed)").option("--project <projectId>", "Project ID (defaults to the current project when available)").option("--email <email>", "Email address of the user to invite").option("--role <role>", "Role or access level to grant").option("-C, --cwd <dir>", "Project directory used to resolve the current project").option("-y, --yes", "Skip the confirmation prompt").option("--resend", "Resend an existing pending organization invite").action(inviteCommand);
110186
110243
  program.command("clone").description("Clone an existing Fimo project locally").argument("[projectId]", "Project ID to clone").argument("[dir]", "Target directory (defaults to the project name)").option("--env <name>", "Env to clone (defaults to main)").action(cloneCommand);
110187
- program.command("init").description("Set up a Fimo project locally: sign in, create or link a project, install deps and skills").argument("[dir]", "Target directory").option("--project-id <id>", "Link an existing project instead of creating a new one").option("--org <organizationId>", "Target organization ID when creating (auto if you belong to one)").option("--env <name>", "Env to check out when linking an existing project (defaults to main)").option("--template-root <path>", "Override template directory when creating").option("--package-manager <pm>", "Install dependencies with: npm | pnpm | yarn | bun").option("--install", "Install dependencies after checkout").option("--no-install", "Skip dependency installation after checkout").option("--skills", "Set up Fimo skills for your AI coding agents").option("--no-skills", "Skip setting up Fimo skills").option(
110244
+ program.command("init").description("Set up a Fimo project locally: sign in, create or link a project, install deps and skills").argument("[dir]", "Target directory").option("--project-id <id>", "Link an existing project instead of creating a new one").option("--org <organizationId>", "Target organization ID when creating (recommended for agents and CI)").option("--env <name>", "Env to check out when linking an existing project (defaults to main)").option("--template-root <path>", "Override template directory when creating").option("--package-manager <pm>", "Install dependencies with: npm | pnpm | yarn | bun").option("--install", "Install dependencies after checkout").option("--no-install", "Skip dependency installation after checkout").option("--skills", "Set up Fimo skills for your AI coding agents").option("--no-skills", "Skip setting up Fimo skills").option(
110188
110245
  "--agents <list>",
110189
110246
  'Comma-separated list of AI agents to set up project rules for (e.g. claude-code,cursor). Pass "none" to skip per-agent variants.'
110190
110247
  ).option(
@@ -110301,10 +110358,10 @@ schemas2.command("push").description("Push schema JSON files to the API (create
110301
110358
  schemas2.command("delete").description("Delete a schema by type name").argument("<typeName>", "Content type name").option("-C, --cwd <dir>", "Project directory").action(schemaDeleteCommand);
110302
110359
  var entries = program.command("entries").description("Manage content entries");
110303
110360
  entries.command("list").description("List entries of a content type").argument("<typeName>", "Content type name").option("-C, --cwd <dir>", "Project directory").option("--limit <n>", "Max entries to return").option("--offset <n>", "Offset for pagination").option("--search <query>", "Search query").option("--where <json>", `JSON filter object, e.g. '{"featured":true}'`).option("--sort <field>", "Sort field, prefix with - for descending").option("--fields <fields>", "Comma-separated fields to return, e.g. slug,title,excerpt").option("--populate <fields>", "Comma-separated reference fields to populate, e.g. author,contributors").option("--locale <locale>", "Locale to list (default en)").option("--sort-by <field>", "Sort field").option("--sort-direction <dir>", "Sort direction (asc|desc)").action(entriesListCommand);
110304
- entries.command("get").description("Get a single entry").argument("<typeName>", "Content type name").argument("<id>", "Entry ID").option("-C, --cwd <dir>", "Project directory").option("--locale <locale>", "Locale to read (default en)").action(entriesGetCommand);
110361
+ entries.command("get").description("Get a single entry").argument("<typeName>", "Content type name").argument("<documentId>", "Document ID").option("-C, --cwd <dir>", "Project directory").requiredOption("--locale <locale>", "Entry locale").action(entriesGetCommand);
110305
110362
  entries.command("create").description("Create a new entry").argument("<typeName>", "Content type name").option("-C, --cwd <dir>", "Project directory").requiredOption("--body <json>", "Entry JSON body (slug + data)").option("--locale <locale>", "Entry locale (default en)").option("--document-id <id>", "Document ID shared by localized variants").action(entriesCreateCommand);
110306
- entries.command("update").description("Update an existing entry").argument("<typeName>", "Content type name").argument("<id>", "Entry ID").option("-C, --cwd <dir>", "Project directory").requiredOption("--body <json>", "Updated entry JSON body").option("--locale <locale>", "Entry locale").option("--document-id <id>", "Document ID shared by localized variants").action(entriesUpdateCommand);
110307
- entries.command("delete").description("Delete an entry").argument("<typeName>", "Content type name").argument("<id>", "Entry ID").option("-C, --cwd <dir>", "Project directory").action(entriesDeleteCommand);
110363
+ entries.command("update").description("Update an existing entry").argument("<typeName>", "Content type name").argument("<documentId>", "Document ID").option("-C, --cwd <dir>", "Project directory").requiredOption("--body <json>", "Updated entry JSON body").requiredOption("--locale <locale>", "Entry locale").action(entriesUpdateCommand);
110364
+ entries.command("delete").description("Delete an entry").argument("<typeName>", "Content type name").argument("<documentId>", "Document ID").option("-C, --cwd <dir>", "Project directory").requiredOption("--locale <locale>", "Entry locale").action(entriesDeleteCommand);
110308
110365
  var assets2 = program.command("assets").description("Manage media assets");
110309
110366
  assets2.command("list").description("List assets").option("-C, --cwd <dir>", "Project directory").option("--parent-id <id>", "Filter by parent folder").option(
110310
110367
  "--search <query>",
@@ -71,7 +71,7 @@ export async function resolveMetaEntries(url) {
71
71
  return;
72
72
  }
73
73
  const { schema, queryField } = paramInfo;
74
- const entryUrl = new URL(`${base}/entries/${schema}/field/${encodeURIComponent(queryField)}/${encodeURIComponent(value)}`);
74
+ const entryUrl = new URL(`${base}/v2/entries/${schema}/field/${encodeURIComponent(queryField)}/${encodeURIComponent(value)}`);
75
75
  entryUrl.searchParams.set('locale', localeResolution.locale);
76
76
  const res = await fetch(entryUrl);
77
77
  if (res.ok) {
@@ -1,6 +1,7 @@
1
1
  type FieldData = Record<string, string>;
2
2
  interface RecordData {
3
3
  id: string;
4
+ locale?: string;
4
5
  data: FieldData;
5
6
  visible: boolean;
6
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"retrieve-data-sources.d.ts","sourceRoot":"","sources":["../../../../src/runtime/content/utils/retrieve-data-sources.ts"],"names":[],"mappings":"AACA,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExC,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;AA8B9D;;;;GAIG;AACH,wBAAgB,0BAA0B,IAAI,kBAAkB,CAiD/D"}
1
+ {"version":3,"file":"retrieve-data-sources.d.ts","sourceRoot":"","sources":["../../../../src/runtime/content/utils/retrieve-data-sources.ts"],"names":[],"mappings":"AACA,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExC,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;AAgD9D;;;;GAIG;AACH,wBAAgB,0BAA0B,IAAI,kBAAkB,CAwD/D"}
@@ -1,3 +1,19 @@
1
+ function parseRecordIdentity(token) {
2
+ if (!token.startsWith('v2:')) {
3
+ return { id: token };
4
+ }
5
+ const [version, documentId, encodedLocale, ...rest] = token.split(':');
6
+ if (version !== 'v2' || !documentId || !encodedLocale || rest.length > 0) {
7
+ return null;
8
+ }
9
+ try {
10
+ const locale = decodeURIComponent(encodedLocale);
11
+ return locale ? { id: documentId, locale } : null;
12
+ }
13
+ catch {
14
+ return null;
15
+ }
16
+ }
1
17
  /**
2
18
  * Checks if an element is genuinely visible to the user within the viewport.
3
19
  * @param el The element to check.
@@ -38,7 +54,13 @@ export function retrieveVisibleDataSources() {
38
54
  const parts = source.split('.');
39
55
  // Expects the format "SchemaName.id.fieldName"
40
56
  if (parts.length === 3) {
41
- const [schemaName, id, fieldName] = parts;
57
+ const [schemaName, identityToken, fieldName] = parts;
58
+ const identity = parseRecordIdentity(identityToken);
59
+ if (!identity) {
60
+ return;
61
+ }
62
+ const { id, locale } = identity;
63
+ const recordKey = JSON.stringify([id, locale ?? null]);
42
64
  // Skip __translations
43
65
  if (schemaName === '__translations') {
44
66
  return;
@@ -48,16 +70,17 @@ export function retrieveVisibleDataSources() {
48
70
  tempGroupedData[schemaName] = {};
49
71
  }
50
72
  // Ensure the record (by ID) exists for this schema
51
- if (!tempGroupedData[schemaName][id]) {
52
- tempGroupedData[schemaName][id] = {
73
+ if (!tempGroupedData[schemaName][recordKey]) {
74
+ tempGroupedData[schemaName][recordKey] = {
53
75
  id: id,
76
+ ...(locale ? { locale } : {}),
54
77
  data: {},
55
78
  visible: isElementVisible(el),
56
79
  };
57
80
  }
58
81
  // Add the field and its text content to the record
59
82
  if (el.textContent) {
60
- tempGroupedData[schemaName][id].data[fieldName] = el.textContent.trim();
83
+ tempGroupedData[schemaName][recordKey].data[fieldName] = el.textContent.trim();
61
84
  }
62
85
  }
63
86
  });
@@ -1 +1 @@
1
- {"version":3,"file":"get-fimo-paths.d.ts","sourceRoot":"","sources":["../../../src/runtime/paths/get-fimo-paths.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAoEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,YAAY,CAAC,IAAI,GAAE,mBAAwB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAoGtF"}
1
+ {"version":3,"file":"get-fimo-paths.d.ts","sourceRoot":"","sources":["../../../src/runtime/paths/get-fimo-paths.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAkFhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,YAAY,CAAC,IAAI,GAAE,mBAAwB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAoGtF"}
@@ -7,6 +7,9 @@ import { getFimoLocales, localizeFimoPath } from '../i18n/locale.js';
7
7
  import { resolveSeoForPath } from '../seo/resolver.js';
8
8
  import { getConfigServer } from '../shared/fimo-config.server.js';
9
9
  const isValidationBuild = !!process.env.FIMO_VALIDATION_BUILD;
10
+ const MAX_FETCH_ATTEMPTS = 3;
11
+ const RETRYABLE_FETCH_STATUSES = new Set([502, 503, 504]);
12
+ const RETRY_BASE_DELAY_MS = 250;
10
13
  function readEnvValue(rootDir, key) {
11
14
  if (process.env[key]) {
12
15
  return process.env[key];
@@ -32,7 +35,7 @@ function resolveApiBaseUrl(rootDir) {
32
35
  return readEnvValue(rootDir, 'VITE_API_URL') ?? readEnvValue(rootDir, 'VITE_API_URL_DEV');
33
36
  }
34
37
  async function fetchEntries(baseUrl, schema, rootDir, locale) {
35
- const url = new URL(`${baseUrl.replace(/\/$/, '')}/entries/${schema}`);
38
+ const url = new URL(`${baseUrl.replace(/\/$/, '')}/v2/entries/${schema}`);
36
39
  url.searchParams.set('locale', locale);
37
40
  if (isValidationBuild) {
38
41
  url.searchParams.set('limit', '1');
@@ -42,12 +45,19 @@ async function fetchEntries(baseUrl, schema, rootDir, locale) {
42
45
  if (branch) {
43
46
  headers['X-Fimo-Branch'] = branch;
44
47
  }
45
- const res = await fetch(url, { headers });
46
- if (!res.ok) {
47
- throw new Error(`Failed to fetch ${schema}: ${res.status}`);
48
+ for (let attempt = 1; attempt <= MAX_FETCH_ATTEMPTS; attempt += 1) {
49
+ const res = await fetch(url, { headers });
50
+ if (res.ok) {
51
+ const payload = (await res.json());
52
+ return Array.isArray(payload?.data) ? payload.data : [];
53
+ }
54
+ if (!RETRYABLE_FETCH_STATUSES.has(res.status) || attempt === MAX_FETCH_ATTEMPTS) {
55
+ const attemptDetail = attempt > 1 ? ` after ${attempt} attempts` : '';
56
+ throw new Error(`Failed to fetch ${schema}: ${res.status}${attemptDetail}`);
57
+ }
58
+ await new Promise((resolveDelay) => setTimeout(resolveDelay, RETRY_BASE_DELAY_MS * attempt));
48
59
  }
49
- const payload = (await res.json());
50
- return Array.isArray(payload?.data) ? payload.data : [];
60
+ throw new Error(`Failed to fetch ${schema}`);
51
61
  }
52
62
  // Glob-ish matcher for route keys: '*' matches one segment, '**' matches any.
53
63
  function compilePattern(pattern) {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=get-fimo-paths.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-fimo-paths.test.d.ts","sourceRoot":"","sources":["../../../src/runtime/paths/get-fimo-paths.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,69 @@
1
+ import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
2
+ import { tmpdir } from 'node:os';
3
+ import { join } from 'node:path';
4
+ import { afterEach, describe, expect, it, vi } from 'vitest';
5
+ import { getFimoPaths } from './get-fimo-paths.js';
6
+ const roots = [];
7
+ function createDynamicProject() {
8
+ const root = mkdtempSync(join(tmpdir(), 'fimo-paths-'));
9
+ roots.push(root);
10
+ writeFileSync(join(root, '.env'), 'VITE_API_URL=https://tenant.example.test\n');
11
+ writeFileSync(join(root, 'fimo-config.json'), JSON.stringify({
12
+ routes: {
13
+ 'blog/post': {
14
+ path: '/blog/:slug',
15
+ params: {
16
+ slug: {
17
+ schema: 'BlogPost',
18
+ queryField: 'slug',
19
+ displayField: 'title',
20
+ },
21
+ },
22
+ },
23
+ },
24
+ }));
25
+ return root;
26
+ }
27
+ function response(status, data = []) {
28
+ return new Response(JSON.stringify({ data }), {
29
+ status,
30
+ headers: { 'Content-Type': 'application/json' },
31
+ });
32
+ }
33
+ afterEach(() => {
34
+ vi.useRealTimers();
35
+ vi.unstubAllGlobals();
36
+ for (const root of roots.splice(0)) {
37
+ rmSync(root, { recursive: true, force: true });
38
+ }
39
+ });
40
+ describe('getFimoPaths content fetches', () => {
41
+ it.each([502, 503, 504])('recovers from a transient %s response', async (status) => {
42
+ vi.useFakeTimers();
43
+ const fetchMock = vi
44
+ .fn()
45
+ .mockResolvedValueOnce(response(status))
46
+ .mockResolvedValueOnce(response(200, [{ slug: 'hello-world' }]));
47
+ vi.stubGlobal('fetch', fetchMock);
48
+ const resultPromise = getFimoPaths({ cwd: createDynamicProject() });
49
+ await vi.runAllTimersAsync();
50
+ await expect(resultPromise).resolves.toContainEqual(expect.objectContaining({ routeKey: 'blog/post', path: '/blog/hello-world' }));
51
+ expect(fetchMock).toHaveBeenCalledTimes(2);
52
+ });
53
+ it('fails clearly after exhausting the transient retry budget', async () => {
54
+ vi.useFakeTimers();
55
+ const fetchMock = vi.fn().mockResolvedValue(response(503));
56
+ vi.stubGlobal('fetch', fetchMock);
57
+ const resultPromise = getFimoPaths({ cwd: createDynamicProject() });
58
+ const rejection = expect(resultPromise).rejects.toThrow('Failed to fetch BlogPost: 503 after 3 attempts');
59
+ await vi.runAllTimersAsync();
60
+ await rejection;
61
+ expect(fetchMock).toHaveBeenCalledTimes(3);
62
+ });
63
+ it('does not retry an author response', async () => {
64
+ const fetchMock = vi.fn().mockResolvedValue(response(400));
65
+ vi.stubGlobal('fetch', fetchMock);
66
+ await expect(getFimoPaths({ cwd: createDynamicProject() })).rejects.toThrow('Failed to fetch BlogPost: 400');
67
+ expect(fetchMock).toHaveBeenCalledTimes(1);
68
+ });
69
+ });
@@ -42,7 +42,6 @@ export type ManyReferenceOps = {
42
42
  };
43
43
  export type FilterFor<T> = [T] extends [FimoString | string] ? string | StringOps : [T] extends [FimoBoolean | boolean] ? boolean | BoolOps : [T] extends [FimoDate | Date] ? string | DateOps : [T] extends [number] ? number | NumberOps : [T] extends [FimoPolymorphicReference | null] ? never : [T] extends [FimoPolymorphicReference[]] ? never : [T] extends [FimoReference | null] ? string | null | ReferenceOps : [T] extends [FimoReference[]] ? string | ManyReferenceOps : [T] extends [FimoMedia | FimoMedia[]] ? NullOnlyOps : [T] extends [FimoRichText] ? string | StringOps : NullOnlyOps;
44
44
  type BaseTopLevelWhere = {
45
- id?: string | StringOps;
46
45
  documentId?: string | StringOps;
47
46
  slug?: string | StringOps;
48
47
  createdAt?: string | DateOps;
@@ -66,9 +65,12 @@ export type Fields<T> = Field<T> | readonly Field<T>[];
66
65
  type SelectedField<TField> = TField extends `__fimo.${string}` ? '__fimo' : TField;
67
66
  type SelectedFields<TFields> = TFields extends readonly (infer K)[] ? SelectedField<K> : SelectedField<TFields>;
68
67
  type ListItem<TValue> = TValue extends readonly (infer K)[] ? K : TValue;
68
+ type EntryIdentityField<T> = Extract<'documentId' | 'locale', keyof T>;
69
69
  export type Projected<T extends {
70
- id: string;
71
- }, TFields extends Fields<T> | undefined> = [TFields] extends [undefined] ? T : Pick<T, Extract<'id' | SelectedFields<TFields>, keyof T>>;
70
+ documentId: string;
71
+ }, TFields extends Fields<T> | undefined> = [TFields] extends [
72
+ undefined
73
+ ] ? T : Pick<T, EntryIdentityField<T> | Extract<SelectedFields<TFields>, keyof T>>;
72
74
  export declare const FIMO_REFERENCES: unique symbol;
73
75
  export interface WithReferences<TReferences> {
74
76
  readonly [FIMO_REFERENCES]?: TReferences;
@@ -78,20 +80,20 @@ export type ReferenceField<TEntry> = Extract<keyof ReferenceMap<TEntry>, string>
78
80
  export type Populate<TEntry> = ReferenceField<TEntry> | readonly ReferenceField<TEntry>[];
79
81
  type PopulatedKeys<TEntry, TPopulate> = Extract<ListItem<TPopulate>, keyof ReferenceMap<TEntry> & keyof TEntry>;
80
82
  export type Populated<TEntry extends {
81
- id: string;
82
- }, TPopulate extends Populate<TEntry>> = Pick<TEntry, 'id'> & Omit<TEntry, PopulatedKeys<TEntry, TPopulate>> & {
83
+ documentId: string;
84
+ }, TPopulate extends Populate<TEntry>> = Pick<TEntry, EntryIdentityField<TEntry>> & Omit<TEntry, PopulatedKeys<TEntry, TPopulate>> & {
83
85
  [K in PopulatedKeys<TEntry, TPopulate>]: ReferenceMap<TEntry>[K];
84
86
  };
85
87
  export type PopulatedResult<TEntry extends {
86
- id: string;
88
+ documentId: string;
87
89
  }, TPopulate extends Populate<TEntry> | undefined> = [
88
90
  TPopulate
89
91
  ] extends [undefined] ? TEntry : Populated<TEntry, NonNullable<TPopulate>>;
90
92
  export type ProjectedWithPopulate<T extends {
91
- id: string;
92
- }, TFields extends string | readonly string[] | undefined, TPopulate extends string | readonly string[] | undefined> = [TFields] extends [undefined] ? T : Pick<T, Extract<'id' | SelectedFields<TFields> | ListItem<NonNullable<TPopulate>>, keyof T>>;
93
+ documentId: string;
94
+ }, TFields extends string | readonly string[] | undefined, TPopulate extends string | readonly string[] | undefined> = [TFields] extends [undefined] ? T : Pick<T, EntryIdentityField<T> | Extract<SelectedFields<TFields> | ListItem<NonNullable<TPopulate>>, keyof T>>;
93
95
  export type Query<T extends {
94
- id: string;
96
+ documentId: string;
95
97
  }, TFields extends Fields<T> | undefined = Fields<T> | undefined, TPopulate extends string | readonly string[] | undefined = string | readonly string[] | undefined> = {
96
98
  where?: Where<T>;
97
99
  locale?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/runtime/primitives/lib/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,SAAS,EACT,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IACzB,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;IACV,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;IACX,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb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,CAAC,SAAS,CAAC,SAAS,CAAC,GAC7B,CAAC,GACD,IAAI,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAElH,MAAM,MAAM,KAAK,CACf,CAAC,SAAS;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,EAChC,OAAO,SAAS,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,EAC7D,SAAS,SAAS,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,IAC/F;IACF,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC"}
@@ -12,9 +12,9 @@ describe('fimo/ui public type surface', () => {
12
12
  expectTypeOf().toEqualTypeOf();
13
13
  const localizedWhere = { locale: 'en' };
14
14
  expectTypeOf(localizedWhere).toEqualTypeOf();
15
- // @ts-expect-error locale is not a filter on non-localized generated entry types.
16
- const sharedWhere = { locale: 'en' };
17
- expectTypeOf(sharedWhere).toEqualTypeOf();
15
+ // @ts-expect-error row IDs are not part of the v2 public entry contract.
16
+ const rowIdWhere = { id: '550e8400-e29b-41d4-a716-446655440000' };
17
+ expectTypeOf(rowIdWhere).toEqualTypeOf();
18
18
  });
19
19
  it('supports the reference populate pattern emitted into generated schemas', () => {
20
20
  const query = {