fimo 2.10.2-staging.1 → 2.10.2-staging.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.
@@ -31,7 +31,7 @@ fimo singles update <Type> [--locale es] (--body '<json>' | --file <path> | --st
31
31
  ```
32
32
 
33
33
  - `--body` is always a `{"data":{...}}` envelope, also for `singles update`. Put `slug` inside `data`.
34
- - `entries create` and `entries update` take the body only with `--body`: they have no `--file` or `--stdin`. For a body you wrote to a file, use `bulk-create --file` or `bulk-update --file` (`--ref content/bulk`).
34
+ - `entries create` and `entries update` require exactly one of `--body '<json>'`, `--file <path>`, or `--stdin`. Files and stdin use the same `{"data":{...}}` envelope.
35
35
  - Before you write a body, load fimo-code `content/richtext`. Rich text is Tiptap JSON (`{"type":"doc","content":[...]}`), a reference is `{"id":"<id>"}`, and media has its own shape.
36
36
  - `get`, `update`, and `delete` take the `id` (a UUID) that `create` and `list` return. Never pass a slug as the id.
37
37
  - `update` and `singles update` change only the top-level fields in `data`; each field you send replaces its old value. The first `singles update` for a locale creates the Single, so it needs every required field.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "bundled": true,
3
3
  "bundler": "esbuild",
4
- "bundledAt": "2026-10-29T08:21:29.060Z",
4
+ "bundledAt": "2026-10-29T09:03:32.775Z",
5
5
  "cliVersion": "2.10.1",
6
6
  "external": [
7
7
  "oxc-parser",
package/dist/cli/index.js CHANGED
@@ -2501,7 +2501,7 @@ ${failure.stderr}`});break}}__name(emitPushFailure,"emitPushFailure");function e
2501
2501
  Purchase: ${formatPrice(pricing.price)} \xD7 ${effectiveYears} year${effectiveYears===1?"":"s"} = ${formatPrice(totalCents)}
2502
2502
  Renewal: ${formatPrice(pricing.renewalPrice)}/year${autoRenew===!1?" (auto-renew off)":" (auto-renews)"}`);let confirmed=await ot2({message:`Create a checkout invoice for ${domain}?`,initialValue:!1});if(q(confirmed)||!confirmed){ui.info({command:"domains buy",message:"Cancelled."});return}}let purchased;try{purchased=await fimo.execute("registeredDomains.purchase",{organizationId,domain,years:effectiveYears,autoRenew})}catch(err){rethrowCliAuthError(err);let featureMsg=featureDisabledMessage(err);if(featureMsg){ui.error({command:"domains buy",code:"DOMAIN_PURCHASE_DISABLED",message:featureMsg});return}if(err instanceof ApiRequestError){if(err.status===403){ui.error({command:"domains buy",code:"PURCHASE_FORBIDDEN",message:"You don't have permission to buy domains for this organization.",hint:"Org admins only."});return}ui.error({command:"domains buy",code:"PURCHASE_FAILED",message:`Purchase failed: ${err.detail}`});return}throw err}ui.result({command:"domains buy",data:purchased,render:__name(()=>{let lines=[];return lines.push(""),lines.push(`Invoice created for ${purchased.domain} (${formatPrice(purchased.price)}).`),lines.push("Pay to complete registration:"),lines.push(""),lines.push(` ${purchased.checkoutUrl??"(checkout URL pending \u2014 refresh in a moment)"}`),lines.push(""),lines.push("No money moves until you complete payment in the browser."),lines.push(`Once paid, ${purchased.domain} registers automatically and shows up in \`fimo domains owned\`.`),lines.join(`
2503
2503
  `)},"render")}),options.open&&purchased.checkoutUrl&&await open_default(purchased.checkoutUrl).catch(()=>{});let{enabled:waitEnabled,timeoutMs}=parseWait(options,!1);waitEnabled&&await pollPurchasePayment(fimo,organizationId,purchased,timeoutMs)}__name(domainsBuyCommand,"domainsBuyCommand");async function pollPurchasePayment(fimo,organizationId,initial,timeoutMs){let start=Date.now(),sp=spinner(`Waiting for payment (status: ${initial.status})`),current=initial;for(;Date.now()-start<timeoutMs;){if(current.status==="owned")return sp.succeed(`Registered \u2014 ${current.domain} is now yours.`),current;if(current.status==="registration_failed"||current.status==="payment_failed")return sp.fail(`${current.status==="payment_failed"?"Payment":"Registration"} failed for ${current.domain}.`),current;await new Promise(resolve10=>setTimeout(resolve10,5e3));try{current=await fimo.execute("registeredDomains.refreshPayment",{organizationId,domainId:current.id}),sp.update(`Waiting (status: ${current.status})`)}catch(err){return rethrowCliAuthError(err,()=>sp.fail("Authentication required")),sp.fail(`Refresh failed: ${err instanceof Error?err.message:String(err)}`),current}}return sp.fail("Timed out. Run `fimo domains owned` later to check status."),current}__name(pollPurchasePayment,"pollPurchasePayment");async function domainsOwnedCommand(options){let cfg=loadConfig(),fimo=createCliFimoClient(cfg),organizationId=resolveOrgId(options),domains2;try{domains2=await fimo.execute("registeredDomains.list",{organizationId})}catch(err){rethrowCliAuthError(err);let featureMsg=featureDisabledMessage(err);if(featureMsg){ui.error({command:"domains owned",code:"DOMAIN_PURCHASE_DISABLED",message:featureMsg});return}if(err instanceof ApiRequestError&&err.status===403){ui.error({command:"domains owned",code:"OWNED_DOMAINS_FORBIDDEN",message:"You don't have access to this organization's domains.",hint:"Org admins only."});return}throw err}let statusFilter=options.status?.split(",").map(s=>s.trim().toLowerCase()).filter(s=>s.length>0),limit=options.limit?parseInt(options.limit,10):null,filtered=domains2;if(statusFilter&&statusFilter.length>0&&(filtered=filtered.filter(d3=>statusFilter.includes(d3.status.toLowerCase()))),limit!==null&&Number.isFinite(limit)&&limit>0&&(filtered=filtered.slice(0,limit)),filtered.length===0){ui.info({command:"domains owned",message:"No domains registered through Fimo yet.",hint:"Try `fimo domains search <keyword>`."});return}ui.result({command:"domains owned",data:{domains:filtered,total:filtered.length},render:__name(()=>{let nameW=Math.max(8,...filtered.map(d3=>d3.domain.length)),statusW=Math.max(8,...filtered.map(d3=>d3.status.length)),lines=[];lines.push(` ${pad("DOMAIN",nameW)} ${pad("STATUS",statusW)} EXPIRES`);for(let d3 of filtered){let expires=d3.expirationDate?new Date(d3.expirationDate).toISOString().slice(0,10):"\u2014";lines.push(` ${pad(d3.domain,nameW)} ${pad(d3.status,statusW)} ${expires}`)}return lines.join(`
2504
- `)},"render")})}__name(domainsOwnedCommand,"domainsOwnedCommand");init_dist();init_config();init_sdk_transport();init_project_context();init_project2();import fs28 from"node:fs";import path27 from"node:path";function selectedInputSources(options,inlineFlag){return[options.body!==void 0?inlineFlag:void 0,options.file?"--file":void 0,options.stdin?"--stdin":void 0].filter(source=>!!source)}__name(selectedInputSources,"selectedInputSources");async function readContentInputSource(options,createError,inlineFlag="--body"){if(selectedInputSources(options,inlineFlag).length!==1)throw createError(`Pass exactly one of ${inlineFlag}, --file, or --stdin.`);if(options.body!==void 0)return options.body;if(options.file){let filePath=path27.resolve(resolveProjectCwd(options.cwd),options.file);try{return fs28.readFileSync(filePath,"utf8")}catch(error){throw createError(error instanceof Error?error.message:`Could not read ${filePath}.`)}}if(process.stdin.isTTY)throw createError("Pipe input to the command when using --stdin.");let chunks=[];for await(let chunk of process.stdin)chunks.push(Buffer.isBuffer(chunk)?chunk:Buffer.from(chunk));return Buffer.concat(chunks).toString("utf8")}__name(readContentInputSource,"readContentInputSource");function renderPrettyJson5(data){return JSON.stringify(data,null,2)}__name(renderPrettyJson5,"renderPrettyJson");var EntriesInputError=class extends Error{static{__name(this,"EntriesInputError")}constructor(message){super(message),this.name="EntriesInputError"}};function reportSingleContentTypeError(command,error){return!(error instanceof ApiRequestError)||error.code!=="single_content_type"?!1:(ui.error({command,code:"SINGLE_CONTENT_TYPE",message:"This content type is a Single. Use `fimo singles update` to create or update it."}),!0)}__name(reportSingleContentTypeError,"reportSingleContentTypeError");var DEFAULT_BULK_CHUNK_SIZE=100,MAX_BULK_CHUNK_SIZE=1e3;function parseJsonObject(value){let parsed=JSON.parse(value);if(!parsed||typeof parsed!="object"||Array.isArray(parsed))throw new Error("Expected a JSON object");return parsed}__name(parseJsonObject,"parseJsonObject");function parseJsonArray(value){let parsed;try{parsed=JSON.parse(value)}catch(error){throw new EntriesInputError(error instanceof Error?`Invalid JSON: ${error.message}`:"Invalid JSON.")}if(!Array.isArray(parsed))throw new EntriesInputError("Expected a JSON array.");return parsed}__name(parseJsonArray,"parseJsonArray");function parseChunkSize(value){if(value===void 0)return DEFAULT_BULK_CHUNK_SIZE;let size=Number(value);if(!Number.isInteger(size)||size<1||size>MAX_BULK_CHUNK_SIZE)throw new EntriesInputError(`--chunk-size must be an integer from 1 to ${MAX_BULK_CHUNK_SIZE}.`);return size}__name(parseChunkSize,"parseChunkSize");function chunksOf(items,size){let chunks=[];for(let offset=0;offset<items.length;offset+=size)chunks.push(items.slice(offset,offset+size));return chunks}__name(chunksOf,"chunksOf");function parseEntryInput(value,index){if(!value||typeof value!="object"||Array.isArray(value))throw new EntriesInputError(`Entry ${index+1} must be a JSON object.`);let input=value;if(!input.data||typeof input.data!="object"||Array.isArray(input.data))throw new EntriesInputError(`Entry ${index+1} must include a data object.`);return input}__name(parseEntryInput,"parseEntryInput");function identityValue(input,field,index){let value=field==="slug"?input.data.slug??input.data[field]:input.data[field];if(typeof value!="string"||value.length===0)throw new EntriesInputError(`Entry ${index+1} needs a non-empty data.${field} for --upsert-by ${field}.`);return value}__name(identityValue,"identityValue");function identityKey(value,locale){return`${locale??""}\0${value}`}__name(identityKey,"identityKey");async function listEntriesByIdentity(content2,projectId2,typeName,field,inputs){let byLocale=new Map;for(let[index,input]of inputs.entries()){let values=byLocale.get(input.locale)??new Set;values.add(identityValue(input,field,index)),byLocale.set(input.locale,values)}let found=new Map;for(let[locale,values]of byLocale){let result=await content2.listEntries(projectId2,typeName,{limit:"100",where:JSON.stringify({[field]:{$in:[...values]}}),fields:`id,documentId,${field},locale`,...locale?{locale}:{}});if(result.meta.hasMore)throw new EntriesInputError(`More than 100 ${typeName} entries matched this ${field} batch; reduce --chunk-size.`);for(let entry of result.data){let value=entry[field];if(typeof value!="string")continue;let key=identityKey(value,locale);found.set(key,[...found.get(key)??[],entry])}}return found}__name(listEntriesByIdentity,"listEntriesByIdentity");async function createWithReconciliation(fimo,content2,projectId2,branch,typeName,field,inputs){let pending=inputs,created=0,reconciled=0;for(let attempt=0;attempt<2&&pending.length>0;attempt+=1)try{let result=await fimo.execute("entries.bulkCreate",{projectId:projectId2,branch,typeName,entries:pending});created+=result.meta.created,pending=[]}catch(error){if(!(error instanceof ApiRequestError)||error.status!==504)throw error;let existing=await listEntriesByIdentity(content2,projectId2,typeName,field,pending),absent=pending.filter((input,index)=>{let key=identityKey(identityValue(input,field,index),input.locale);return(existing.get(key)?.length??0)===0});reconciled+=pending.length-absent.length,pending=absent}if(pending.length>0)throw new EntriesInputError(`${pending.length} entries remain absent after reconciling an ambiguous 504; rerun the same upsert input safely.`);return{created,reconciled}}__name(createWithReconciliation,"createWithReconciliation");async function upsertChunk(fimo,content2,projectId2,branch,typeName,field,inputs,chunk,identityCounts){let existing=await listEntriesByIdentity(content2,projectId2,typeName,field,inputs),creates=[],updates=[],conflicts=0;for(let[index,input]of inputs.entries()){let key=identityKey(identityValue(input,field,index),input.locale),matches=existing.get(key)??[];if((identityCounts.get(key)??0)>1||matches.length>1){conflicts+=1;continue}matches.length===1?updates.push({id:matches[0].documentId,body:input}):creates.push(input)}let updated=0;if(updates.length>0)try{let result=await fimo.execute("entries.bulkUpdate",{projectId:projectId2,branch,typeName,selection:{updates}});updated=result.meta.updated,conflicts+=result.meta.missing.length}catch(error){throw!(error instanceof ApiRequestError)||error.status!==504?error:(await listEntriesByIdentity(content2,projectId2,typeName,field,inputs),new EntriesInputError(`${updates.length} updates had an ambiguous 504; identities were reread without replay. Rerun the same upsert input safely.`))}let createResult=await createWithReconciliation(fimo,content2,projectId2,branch,typeName,field,creates);return{chunk,input:inputs.length,created:createResult.created,updated,conflicts,reconciled:createResult.reconciled}}__name(upsertChunk,"upsertChunk");function parseBulkJsonObject(value){try{return parseJsonObject(value)}catch(error){throw new EntriesInputError(error instanceof Error?error.message:"Expected a JSON object.")}}__name(parseBulkJsonObject,"parseBulkJsonObject");function parseIds(value){let ids=[...new Set(value.split(",").map(id=>id.trim()).filter(Boolean))];if(ids.length===0)throw new EntriesInputError("--ids must include at least one ID.");return ids}__name(parseIds,"parseIds");function missingIdWarnings(result,action){let{missing}=result.meta;if(missing.length===0)return[];let changed=action==="updated"?result.meta.updated:result.meta.deleted,ids=missing.join(", ");if(changed===0)return missing.length===1?[`No entries were ${action}; the requested ID was not found: ${ids}.`]:[`No entries were ${action}; all ${missing.length} requested IDs were not found: ${ids}.`];let subject=missing.length===1?"ID was":"IDs were";return[`${missing.length} requested ${subject} not found: ${ids}.`]}__name(missingIdWarnings,"missingIdWarnings");function addDefinedMetadata(body,metadata){for(let[key,value]of Object.entries(metadata))value!==void 0&&(body[key]=value);return body}__name(addDefinedMetadata,"addDefinedMetadata");async function entriesListCommand(typeName,options,cmd){let pagination=parsePaginationOptions(options,{defaultLimit:20,maxLimit:100,legacyCursor:"offset"}),{ctx}=await bootstrapProjectCommand(options,cmd),content2=createContentTransferService(loadConfig(),ctx.branch);await requireOperation("cms.list",{projectId:ctx.projectId,branch:ctx.branch});let params={};params.limit=String(pagination.limit),options.search&&(params.search=options.search),options.sort&&(params.sort=options.sort),!options.sort&&options.sortBy&&(params.sortBy=options.sortBy),!options.sort&&options.sortDirection&&(params.sortDirection=options.sortDirection),options.where&&(JSON.parse(options.where),params.where=options.where),options.fields&&(params.fields=options.fields),options.populate&&(params.populate=options.populate),options.locale&&(params.locale=options.locale);let initialOffset=parseCursorNumber(pagination.cursor,{defaultValue:0,minimum:0}),page=await collectPaginatedItems({cursor:pagination.cursor,allPages:pagination.allPages,fetchPage:__name(async cursor=>{let offset=parseCursorNumber(cursor,{defaultValue:0,minimum:0});return toOffsetPaginationPage(await content2.listEntries(ctx.projectId,typeName,{...params,offset:String(offset)}))},"fetchPage")}),result={data:page.items,items:page.items,nextCursor:page.nextCursor,total:page.total,meta:{...page.meta,offset:initialOffset,hasMore:page.nextCursor!==null}},trailingArgs=paginationTrailingArgs(options,ctx.branch);ui.result({command:"entries list",data:result,render:__name(()=>renderPrettyJson5(result),"render"),...page.nextCursor?{hint:buildPaginationHint(["fimo","entries","list",typeName],{cursor:page.nextCursor,limit:pagination.limit,trailingArgs})}:{}})}__name(entriesListCommand,"entriesListCommand");function paginationTrailingArgs(options,branch){return[["--branch",branch],["--search",options.search],["--sort",options.sort],["--sort-by",options.sortBy],["--sort-direction",options.sortDirection],["--where",options.where],["--fields",options.fields],["--populate",options.populate],["--locale",options.locale],["--cwd",options.cwd]].flatMap(([flag2,value])=>value===void 0?[]:[flag2,value])}__name(paginationTrailingArgs,"paginationTrailingArgs");async function entriesGetCommand(typeName,id,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd);await requireOperation("cms.get",{projectId:ctx.projectId,branch:ctx.branch});let{data:result}=await fimo.execute("entries.get",{projectId:ctx.projectId,branch:ctx.branch,typeName,id,locale:options.locale,populate:options.populate?[options.populate]:void 0});ui.result({command:"entries get",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesGetCommand,"entriesGetCommand");async function entriesCreateCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.create",{projectId:ctx.projectId,branch:ctx.branch});let input=addDefinedMetadata(parseJsonObject(options.body),{locale:options.locale,documentId:options.documentId}),{data:result}=await fimo.execute("entries.create",{projectId:ctx.projectId,branch:ctx.branch,typeName,...input});ui.result({command:"entries create",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesCreateCommand,"entriesCreateCommand");async function entriesUpdateCommand(typeName,id,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.update",{projectId:ctx.projectId,branch:ctx.branch});let data=parseJsonObject(options.body),result=await fimo.execute("entries.updateFields",{projectId:ctx.projectId,branch:ctx.branch,typeName,id,locale:options.locale,fields:data});ui.result({command:"entries update",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesUpdateCommand,"entriesUpdateCommand");async function entriesDeleteCommand(typeName,id,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.delete",{projectId:ctx.projectId,branch:ctx.branch});let{data:result}=await fimo.execute("entries.delete",{projectId:ctx.projectId,branch:ctx.branch,typeName,id,locale:options.locale});ui.result({command:"entries delete",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesDeleteCommand,"entriesDeleteCommand");async function entriesQueryCommand(options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd);await requireOperation("cms.query",{projectId:ctx.projectId,branch:ctx.branch});let sql=await readContentInputSource({...options,body:options.sql},message=>new EntriesInputError(message),"--sql"),result=await fimo.execute("entries.querySql",{projectId:ctx.projectId,branch:ctx.branch,sql});ui.result({command:"entries query",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesQueryCommand,"entriesQueryCommand");async function entriesBulkCreateCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0}),content2=createContentTransferService(loadConfig(),ctx.branch);await requireOperation("cms.bulk_create",{projectId:ctx.projectId,branch:ctx.branch}),options.upsertBy&&(await requireOperation("cms.list",{projectId:ctx.projectId,branch:ctx.branch}),await requireOperation("cms.bulk_update",{projectId:ctx.projectId,branch:ctx.branch}));let entries2=parseJsonArray(await readContentInputSource(options,message=>new EntriesInputError(message))),chunkSize=parseChunkSize(options.chunkSize);if(entries2.length===0){if(options.upsertBy)throw new EntriesInputError("Upsert input must be a non-empty JSON array.");let result2=await fimo.execute("entries.bulkCreate",{projectId:ctx.projectId,branch:ctx.branch,typeName,entries:entries2});ui.result({command:"entries bulk-create",data:result2,render:__name(()=>renderPrettyJson5(result2),"render")});return}let upsertInputs=options.upsertBy?entries2.map((entry,index)=>parseEntryInput(entry,index)):[],identityCounts=new Map;if(options.upsertBy)for(let[index,input]of upsertInputs.entries()){let key=identityKey(identityValue(input,options.upsertBy,index),input.locale);identityCounts.set(key,(identityCounts.get(key)??0)+1)}let chunks=chunksOf(options.upsertBy?upsertInputs:entries2,chunkSize),receipts=[],data=[];for(let[index,chunk]of chunks.entries()){if(options.upsertBy){receipts.push(await upsertChunk(fimo,content2,ctx.projectId,ctx.branch,typeName,options.upsertBy,chunk,index+1,identityCounts));continue}let result2=await fimo.execute("entries.bulkCreate",{projectId:ctx.projectId,branch:ctx.branch,typeName,entries:chunk});data.push(...result2.data),receipts.push({chunk:index+1,input:chunk.length,created:result2.meta.created,updated:0,conflicts:0,reconciled:0})}let result={data,meta:{created:receipts.reduce((sum,receipt)=>sum+receipt.created,0),updated:receipts.reduce((sum,receipt)=>sum+receipt.updated,0),conflicts:receipts.reduce((sum,receipt)=>sum+receipt.conflicts,0),chunks:receipts}};ui.result({command:"entries bulk-create",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesBulkCreateCommand,"entriesBulkCreateCommand");function withBulkLocale(body,locale,source){if(locale===void 0||!body||typeof body!="object"||Array.isArray(body))return body;let bodyLocale=body.locale;if(bodyLocale!==void 0&&bodyLocale!==locale)throw new EntriesInputError(`--locale ${locale} disagrees with "locale": ${JSON.stringify(bodyLocale)} in ${source}. Pass the locale once.`);return{...body,locale}}__name(withBulkLocale,"withBulkLocale");async function entriesBulkUpdateCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.bulk_update",{projectId:ctx.projectId,branch:ctx.branch});let usesBatchInput=!!(options.file||options.stdin),selection,body;if(usesBatchInput){if(options.body!==void 0||options.ids||options.where)throw new EntriesInputError("Use --file or --stdin alone for per-entry updates.");selection={updates:parseJsonArray(await readContentInputSource(options,message=>new EntriesInputError(message))).map((update,index)=>update&&typeof update=="object"&&!Array.isArray(update)?{...update,body:withBulkLocale(update.body,options.locale,`update ${index+1}`)}:update)}}else{if((options.ids?1:0)+(options.where?1:0)!=1||options.body===void 0)throw new EntriesInputError("Pass --body with exactly one of --ids or --where.");selection=options.ids?{ids:parseIds(options.ids)}:{where:parseBulkJsonObject(options.where)},body=withBulkLocale(parseBulkJsonObject(options.body),options.locale,"--body")}let result=await fimo.execute("entries.bulkUpdate",{projectId:ctx.projectId,branch:ctx.branch,typeName,selection,body});ui.result({command:"entries bulk-update",data:result,warnings:missingIdWarnings(result,"updated"),render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesBulkUpdateCommand,"entriesBulkUpdateCommand");async function entriesBulkDeleteCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});if(await requireOperation("cms.bulk_delete",{projectId:ctx.projectId,branch:ctx.branch}),(options.ids?1:0)+(options.where?1:0)!=1)throw new EntriesInputError("Pass exactly one of --ids or --where.");let selection=options.ids?{ids:parseIds(options.ids)}:{where:parseBulkJsonObject(options.where)},result=await fimo.execute("entries.bulkDelete",{projectId:ctx.projectId,branch:ctx.branch,typeName,selection,locale:options.locale});ui.result({command:"entries bulk-delete",data:result,warnings:missingIdWarnings(result,"deleted"),render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesBulkDeleteCommand,"entriesBulkDeleteCommand");init_dist();init_config();init_sdk_transport();init_project2();function collect(value,previous){return[...previous??[],value]}__name(collect,"collect");function addScopeOptions(command){return command.option("--project <id>","Site id (defaults to the locally linked site)").option("-C, --cwd <dir>","Site directory")}__name(addScopeOptions,"addScopeOptions");function registerEnvironmentsCommands(program2){let environments=program2.command("environments").description("Group site Branches into deployment Environments").addHelpText("after",`
2504
+ `)},"render")})}__name(domainsOwnedCommand,"domainsOwnedCommand");init_dist();init_config();init_sdk_transport();init_project_context();init_project2();import fs28 from"node:fs";import path27 from"node:path";function selectedInputSources(options,inlineFlag){return[options.body!==void 0?inlineFlag:void 0,options.file?"--file":void 0,options.stdin?"--stdin":void 0].filter(source=>!!source)}__name(selectedInputSources,"selectedInputSources");async function readContentInputSource(options,createError,inlineFlag="--body"){if(selectedInputSources(options,inlineFlag).length!==1)throw createError(`Pass exactly one of ${inlineFlag}, --file, or --stdin.`);if(options.body!==void 0)return options.body;if(options.file){let filePath=path27.resolve(resolveProjectCwd(options.cwd),options.file);try{return fs28.readFileSync(filePath,"utf8")}catch(error){throw createError(error instanceof Error?error.message:`Could not read ${filePath}.`)}}if(process.stdin.isTTY)throw createError("Pipe input to the command when using --stdin.");let chunks=[];for await(let chunk of process.stdin)chunks.push(Buffer.isBuffer(chunk)?chunk:Buffer.from(chunk));return Buffer.concat(chunks).toString("utf8")}__name(readContentInputSource,"readContentInputSource");function renderPrettyJson5(data){return JSON.stringify(data,null,2)}__name(renderPrettyJson5,"renderPrettyJson");var EntriesInputError=class extends Error{static{__name(this,"EntriesInputError")}constructor(message){super(message),this.name="EntriesInputError"}};function reportSingleContentTypeError(command,error){return!(error instanceof ApiRequestError)||error.code!=="single_content_type"?!1:(ui.error({command,code:"SINGLE_CONTENT_TYPE",message:"This content type is a Single. Use `fimo singles update` to create or update it."}),!0)}__name(reportSingleContentTypeError,"reportSingleContentTypeError");var DEFAULT_BULK_CHUNK_SIZE=100,MAX_BULK_CHUNK_SIZE=1e3;function parseJsonObject(value){let parsed=JSON.parse(value);if(!parsed||typeof parsed!="object"||Array.isArray(parsed))throw new Error("Expected a JSON object");return parsed}__name(parseJsonObject,"parseJsonObject");function parseJsonArray(value){let parsed;try{parsed=JSON.parse(value)}catch(error){throw new EntriesInputError(error instanceof Error?`Invalid JSON: ${error.message}`:"Invalid JSON.")}if(!Array.isArray(parsed))throw new EntriesInputError("Expected a JSON array.");return parsed}__name(parseJsonArray,"parseJsonArray");function parseChunkSize(value){if(value===void 0)return DEFAULT_BULK_CHUNK_SIZE;let size=Number(value);if(!Number.isInteger(size)||size<1||size>MAX_BULK_CHUNK_SIZE)throw new EntriesInputError(`--chunk-size must be an integer from 1 to ${MAX_BULK_CHUNK_SIZE}.`);return size}__name(parseChunkSize,"parseChunkSize");function chunksOf(items,size){let chunks=[];for(let offset=0;offset<items.length;offset+=size)chunks.push(items.slice(offset,offset+size));return chunks}__name(chunksOf,"chunksOf");function parseEntryInput(value,index){if(!value||typeof value!="object"||Array.isArray(value))throw new EntriesInputError(`Entry ${index+1} must be a JSON object.`);let input=value;if(!input.data||typeof input.data!="object"||Array.isArray(input.data))throw new EntriesInputError(`Entry ${index+1} must include a data object.`);return input}__name(parseEntryInput,"parseEntryInput");function identityValue(input,field,index){let value=field==="slug"?input.data.slug??input.data[field]:input.data[field];if(typeof value!="string"||value.length===0)throw new EntriesInputError(`Entry ${index+1} needs a non-empty data.${field} for --upsert-by ${field}.`);return value}__name(identityValue,"identityValue");function identityKey(value,locale){return`${locale??""}\0${value}`}__name(identityKey,"identityKey");async function listEntriesByIdentity(content2,projectId2,typeName,field,inputs){let byLocale=new Map;for(let[index,input]of inputs.entries()){let values=byLocale.get(input.locale)??new Set;values.add(identityValue(input,field,index)),byLocale.set(input.locale,values)}let found=new Map;for(let[locale,values]of byLocale){let result=await content2.listEntries(projectId2,typeName,{limit:"100",where:JSON.stringify({[field]:{$in:[...values]}}),fields:`id,documentId,${field},locale`,...locale?{locale}:{}});if(result.meta.hasMore)throw new EntriesInputError(`More than 100 ${typeName} entries matched this ${field} batch; reduce --chunk-size.`);for(let entry of result.data){let value=entry[field];if(typeof value!="string")continue;let key=identityKey(value,locale);found.set(key,[...found.get(key)??[],entry])}}return found}__name(listEntriesByIdentity,"listEntriesByIdentity");async function createWithReconciliation(fimo,content2,projectId2,branch,typeName,field,inputs){let pending=inputs,created=0,reconciled=0;for(let attempt=0;attempt<2&&pending.length>0;attempt+=1)try{let result=await fimo.execute("entries.bulkCreate",{projectId:projectId2,branch,typeName,entries:pending});created+=result.meta.created,pending=[]}catch(error){if(!(error instanceof ApiRequestError)||error.status!==504)throw error;let existing=await listEntriesByIdentity(content2,projectId2,typeName,field,pending),absent=pending.filter((input,index)=>{let key=identityKey(identityValue(input,field,index),input.locale);return(existing.get(key)?.length??0)===0});reconciled+=pending.length-absent.length,pending=absent}if(pending.length>0)throw new EntriesInputError(`${pending.length} entries remain absent after reconciling an ambiguous 504; rerun the same upsert input safely.`);return{created,reconciled}}__name(createWithReconciliation,"createWithReconciliation");async function upsertChunk(fimo,content2,projectId2,branch,typeName,field,inputs,chunk,identityCounts){let existing=await listEntriesByIdentity(content2,projectId2,typeName,field,inputs),creates=[],updates=[],conflicts=0;for(let[index,input]of inputs.entries()){let key=identityKey(identityValue(input,field,index),input.locale),matches=existing.get(key)??[];if((identityCounts.get(key)??0)>1||matches.length>1){conflicts+=1;continue}matches.length===1?updates.push({id:matches[0].documentId,body:input}):creates.push(input)}let updated=0;if(updates.length>0)try{let result=await fimo.execute("entries.bulkUpdate",{projectId:projectId2,branch,typeName,selection:{updates}});updated=result.meta.updated,conflicts+=result.meta.missing.length}catch(error){throw!(error instanceof ApiRequestError)||error.status!==504?error:(await listEntriesByIdentity(content2,projectId2,typeName,field,inputs),new EntriesInputError(`${updates.length} updates had an ambiguous 504; identities were reread without replay. Rerun the same upsert input safely.`))}let createResult=await createWithReconciliation(fimo,content2,projectId2,branch,typeName,field,creates);return{chunk,input:inputs.length,created:createResult.created,updated,conflicts,reconciled:createResult.reconciled}}__name(upsertChunk,"upsertChunk");function parseBulkJsonObject(value){try{return parseJsonObject(value)}catch(error){throw new EntriesInputError(error instanceof Error?error.message:"Expected a JSON object.")}}__name(parseBulkJsonObject,"parseBulkJsonObject");function parseIds(value){let ids=[...new Set(value.split(",").map(id=>id.trim()).filter(Boolean))];if(ids.length===0)throw new EntriesInputError("--ids must include at least one ID.");return ids}__name(parseIds,"parseIds");function missingIdWarnings(result,action){let{missing}=result.meta;if(missing.length===0)return[];let changed=action==="updated"?result.meta.updated:result.meta.deleted,ids=missing.join(", ");if(changed===0)return missing.length===1?[`No entries were ${action}; the requested ID was not found: ${ids}.`]:[`No entries were ${action}; all ${missing.length} requested IDs were not found: ${ids}.`];let subject=missing.length===1?"ID was":"IDs were";return[`${missing.length} requested ${subject} not found: ${ids}.`]}__name(missingIdWarnings,"missingIdWarnings");function addDefinedMetadata(body,metadata){for(let[key,value]of Object.entries(metadata))value!==void 0&&(body[key]=value);return body}__name(addDefinedMetadata,"addDefinedMetadata");async function entriesListCommand(typeName,options,cmd){let pagination=parsePaginationOptions(options,{defaultLimit:20,maxLimit:100,legacyCursor:"offset"}),{ctx}=await bootstrapProjectCommand(options,cmd),content2=createContentTransferService(loadConfig(),ctx.branch);await requireOperation("cms.list",{projectId:ctx.projectId,branch:ctx.branch});let params={};params.limit=String(pagination.limit),options.search&&(params.search=options.search),options.sort&&(params.sort=options.sort),!options.sort&&options.sortBy&&(params.sortBy=options.sortBy),!options.sort&&options.sortDirection&&(params.sortDirection=options.sortDirection),options.where&&(JSON.parse(options.where),params.where=options.where),options.fields&&(params.fields=options.fields),options.populate&&(params.populate=options.populate),options.locale&&(params.locale=options.locale);let initialOffset=parseCursorNumber(pagination.cursor,{defaultValue:0,minimum:0}),page=await collectPaginatedItems({cursor:pagination.cursor,allPages:pagination.allPages,fetchPage:__name(async cursor=>{let offset=parseCursorNumber(cursor,{defaultValue:0,minimum:0});return toOffsetPaginationPage(await content2.listEntries(ctx.projectId,typeName,{...params,offset:String(offset)}))},"fetchPage")}),result={data:page.items,items:page.items,nextCursor:page.nextCursor,total:page.total,meta:{...page.meta,offset:initialOffset,hasMore:page.nextCursor!==null}},trailingArgs=paginationTrailingArgs(options,ctx.branch);ui.result({command:"entries list",data:result,render:__name(()=>renderPrettyJson5(result),"render"),...page.nextCursor?{hint:buildPaginationHint(["fimo","entries","list",typeName],{cursor:page.nextCursor,limit:pagination.limit,trailingArgs})}:{}})}__name(entriesListCommand,"entriesListCommand");function paginationTrailingArgs(options,branch){return[["--branch",branch],["--search",options.search],["--sort",options.sort],["--sort-by",options.sortBy],["--sort-direction",options.sortDirection],["--where",options.where],["--fields",options.fields],["--populate",options.populate],["--locale",options.locale],["--cwd",options.cwd]].flatMap(([flag2,value])=>value===void 0?[]:[flag2,value])}__name(paginationTrailingArgs,"paginationTrailingArgs");async function entriesGetCommand(typeName,id,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd);await requireOperation("cms.get",{projectId:ctx.projectId,branch:ctx.branch});let{data:result}=await fimo.execute("entries.get",{projectId:ctx.projectId,branch:ctx.branch,typeName,id,locale:options.locale,populate:options.populate?[options.populate]:void 0});ui.result({command:"entries get",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesGetCommand,"entriesGetCommand");async function entriesCreateCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.create",{projectId:ctx.projectId,branch:ctx.branch});let input=addDefinedMetadata(parseJsonObject(await readContentInputSource(options,message=>new EntriesInputError(message))),{locale:options.locale,documentId:options.documentId}),{data:result}=await fimo.execute("entries.create",{projectId:ctx.projectId,branch:ctx.branch,typeName,...input});ui.result({command:"entries create",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesCreateCommand,"entriesCreateCommand");async function entriesUpdateCommand(typeName,id,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.update",{projectId:ctx.projectId,branch:ctx.branch});let data=parseJsonObject(await readContentInputSource(options,message=>new EntriesInputError(message))),result=await fimo.execute("entries.updateFields",{projectId:ctx.projectId,branch:ctx.branch,typeName,id,locale:options.locale,fields:data});ui.result({command:"entries update",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesUpdateCommand,"entriesUpdateCommand");async function entriesDeleteCommand(typeName,id,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.delete",{projectId:ctx.projectId,branch:ctx.branch});let{data:result}=await fimo.execute("entries.delete",{projectId:ctx.projectId,branch:ctx.branch,typeName,id,locale:options.locale});ui.result({command:"entries delete",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesDeleteCommand,"entriesDeleteCommand");async function entriesQueryCommand(options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd);await requireOperation("cms.query",{projectId:ctx.projectId,branch:ctx.branch});let sql=await readContentInputSource({...options,body:options.sql},message=>new EntriesInputError(message),"--sql"),result=await fimo.execute("entries.querySql",{projectId:ctx.projectId,branch:ctx.branch,sql});ui.result({command:"entries query",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesQueryCommand,"entriesQueryCommand");async function entriesBulkCreateCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0}),content2=createContentTransferService(loadConfig(),ctx.branch);await requireOperation("cms.bulk_create",{projectId:ctx.projectId,branch:ctx.branch}),options.upsertBy&&(await requireOperation("cms.list",{projectId:ctx.projectId,branch:ctx.branch}),await requireOperation("cms.bulk_update",{projectId:ctx.projectId,branch:ctx.branch}));let entries2=parseJsonArray(await readContentInputSource(options,message=>new EntriesInputError(message))),chunkSize=parseChunkSize(options.chunkSize);if(entries2.length===0){if(options.upsertBy)throw new EntriesInputError("Upsert input must be a non-empty JSON array.");let result2=await fimo.execute("entries.bulkCreate",{projectId:ctx.projectId,branch:ctx.branch,typeName,entries:entries2});ui.result({command:"entries bulk-create",data:result2,render:__name(()=>renderPrettyJson5(result2),"render")});return}let upsertInputs=options.upsertBy?entries2.map((entry,index)=>parseEntryInput(entry,index)):[],identityCounts=new Map;if(options.upsertBy)for(let[index,input]of upsertInputs.entries()){let key=identityKey(identityValue(input,options.upsertBy,index),input.locale);identityCounts.set(key,(identityCounts.get(key)??0)+1)}let chunks=chunksOf(options.upsertBy?upsertInputs:entries2,chunkSize),receipts=[],data=[];for(let[index,chunk]of chunks.entries()){if(options.upsertBy){receipts.push(await upsertChunk(fimo,content2,ctx.projectId,ctx.branch,typeName,options.upsertBy,chunk,index+1,identityCounts));continue}let result2=await fimo.execute("entries.bulkCreate",{projectId:ctx.projectId,branch:ctx.branch,typeName,entries:chunk});data.push(...result2.data),receipts.push({chunk:index+1,input:chunk.length,created:result2.meta.created,updated:0,conflicts:0,reconciled:0})}let result={data,meta:{created:receipts.reduce((sum,receipt)=>sum+receipt.created,0),updated:receipts.reduce((sum,receipt)=>sum+receipt.updated,0),conflicts:receipts.reduce((sum,receipt)=>sum+receipt.conflicts,0),chunks:receipts}};ui.result({command:"entries bulk-create",data:result,render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesBulkCreateCommand,"entriesBulkCreateCommand");function withBulkLocale(body,locale,source){if(locale===void 0||!body||typeof body!="object"||Array.isArray(body))return body;let bodyLocale=body.locale;if(bodyLocale!==void 0&&bodyLocale!==locale)throw new EntriesInputError(`--locale ${locale} disagrees with "locale": ${JSON.stringify(bodyLocale)} in ${source}. Pass the locale once.`);return{...body,locale}}__name(withBulkLocale,"withBulkLocale");async function entriesBulkUpdateCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.bulk_update",{projectId:ctx.projectId,branch:ctx.branch});let usesBatchInput=!!(options.file||options.stdin),selection,body;if(usesBatchInput){if(options.body!==void 0||options.ids||options.where)throw new EntriesInputError("Use --file or --stdin alone for per-entry updates.");selection={updates:parseJsonArray(await readContentInputSource(options,message=>new EntriesInputError(message))).map((update,index)=>update&&typeof update=="object"&&!Array.isArray(update)?{...update,body:withBulkLocale(update.body,options.locale,`update ${index+1}`)}:update)}}else{if((options.ids?1:0)+(options.where?1:0)!=1||options.body===void 0)throw new EntriesInputError("Pass --body with exactly one of --ids or --where.");selection=options.ids?{ids:parseIds(options.ids)}:{where:parseBulkJsonObject(options.where)},body=withBulkLocale(parseBulkJsonObject(options.body),options.locale,"--body")}let result=await fimo.execute("entries.bulkUpdate",{projectId:ctx.projectId,branch:ctx.branch,typeName,selection,body});ui.result({command:"entries bulk-update",data:result,warnings:missingIdWarnings(result,"updated"),render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesBulkUpdateCommand,"entriesBulkUpdateCommand");async function entriesBulkDeleteCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});if(await requireOperation("cms.bulk_delete",{projectId:ctx.projectId,branch:ctx.branch}),(options.ids?1:0)+(options.where?1:0)!=1)throw new EntriesInputError("Pass exactly one of --ids or --where.");let selection=options.ids?{ids:parseIds(options.ids)}:{where:parseBulkJsonObject(options.where)},result=await fimo.execute("entries.bulkDelete",{projectId:ctx.projectId,branch:ctx.branch,typeName,selection,locale:options.locale});ui.result({command:"entries bulk-delete",data:result,warnings:missingIdWarnings(result,"deleted"),render:__name(()=>renderPrettyJson5(result),"render")})}__name(entriesBulkDeleteCommand,"entriesBulkDeleteCommand");init_dist();init_config();init_sdk_transport();init_project2();function collect(value,previous){return[...previous??[],value]}__name(collect,"collect");function addScopeOptions(command){return command.option("--project <id>","Site id (defaults to the locally linked site)").option("-C, --cwd <dir>","Site directory")}__name(addScopeOptions,"addScopeOptions");function registerEnvironmentsCommands(program2){let environments=program2.command("environments").description("Group site Branches into deployment Environments").addHelpText("after",`
2505
2505
  Environments group Branches. Production is the deployed snapshot published from the configured Production source.
2506
2506
  Automatic previews receives every unclaimed Branch.
2507
2507
 
@@ -2871,7 +2871,7 @@ Examples (BlogPost must have a title field):
2871
2871
  fimo entries update BlogPost <id> --body '{"data":{"title":"Updated"}}'
2872
2872
 
2873
2873
  Use the UUID returned as id by create/list for get, update, and delete.
2874
- The content type is positional. Create/update require --body; JSON files use bulk-create/bulk-update.`);addPaginationOptions(entries.command("list").description("List entries of a content type"),{defaultLimit:20,maxLimit:100,legacyCursor:"offset"}).argument("<typeName>","Content type name").option("-C, --cwd <dir>","Site directory").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, media, or blocks fields to populate, e.g. author,cover").option("--locale <locale>","Locale to list (default en)").option("--sort-by <field>","Sort field").option("--sort-direction <dir>","Sort direction (asc|desc)").action(entriesListCommand);entries.command("get").description("Get a single entry").argument("<typeName>","Content type name").argument("<id>","Entry UUID returned as id by create/list").option("-C, --cwd <dir>","Site directory").option("--locale <locale>","Entry locale (defaults to the site locale)").option("--populate <fields>","Comma-separated reference, media, or blocks fields to populate, e.g. author,cover").action(entriesGetCommand);entries.command("create").description("Create a new entry").argument("<typeName>","Content type name").option("-C, --cwd <dir>","Site directory").requiredOption("--body <json>",`Entry body, e.g. '{"data":{"slug":"hello","title":"Hello"}}'`).option("--locale <locale>","Entry locale (default en)").option("--document-id <id>","Document ID shared by localized variants").action(entriesCreateCommand);entries.command("update").description("Update an existing entry").argument("<typeName>","Content type name").argument("<id>","Entry UUID returned as id by create/list").option("-C, --cwd <dir>","Site directory").requiredOption("--body <json>",`Entry body, e.g. '{"data":{"title":"Updated"}}'`).option("--locale <locale>","Entry locale (defaults to the site locale)").action(entriesUpdateCommand);entries.command("delete").description("Delete an entry").argument("<typeName>","Content type name").argument("<id>","Entry UUID returned as id by create/list").option("-C, --cwd <dir>","Site directory").option("--locale <locale>","Entry locale (defaults to the site locale)").action(entriesDeleteCommand);entries.command("query").description("Run a read-only SQL query over the entries table").option("-C, --cwd <dir>","Site directory").option("--sql <query>","SQL SELECT query").option("--file <path>","Read the SQL query from a file").option("--stdin","Read the SQL query from stdin").addHelpText("after",`
2874
+ The content type is positional. Create/update require --body; JSON files use bulk-create/bulk-update.`);addPaginationOptions(entries.command("list").description("List entries of a content type"),{defaultLimit:20,maxLimit:100,legacyCursor:"offset"}).argument("<typeName>","Content type name").option("-C, --cwd <dir>","Site directory").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, media, or blocks fields to populate, e.g. author,cover").option("--locale <locale>","Locale to list (default en)").option("--sort-by <field>","Sort field").option("--sort-direction <dir>","Sort direction (asc|desc)").action(entriesListCommand);entries.command("get").description("Get a single entry").argument("<typeName>","Content type name").argument("<id>","Entry UUID returned as id by create/list").option("-C, --cwd <dir>","Site directory").option("--locale <locale>","Entry locale (defaults to the site locale)").option("--populate <fields>","Comma-separated reference, media, or blocks fields to populate, e.g. author,cover").action(entriesGetCommand);entries.command("create").description("Create a new entry").argument("<typeName>","Content type name").option("-C, --cwd <dir>","Site directory").option("--body <json>",`Entry body, e.g. '{"data":{"slug":"hello","title":"Hello"}}'`).option("--file <path>","Read the entry JSON body from a file").option("--stdin","Read the entry JSON body from stdin").option("--locale <locale>","Entry locale (default en)").option("--document-id <id>","Document ID shared by localized variants").action(entriesCreateCommand);entries.command("update").description("Update an existing entry").argument("<typeName>","Content type name").argument("<id>","Entry UUID returned as id by create/list").option("-C, --cwd <dir>","Site directory").option("--body <json>",`Entry body, e.g. '{"data":{"title":"Updated"}}'`).option("--file <path>","Read the entry JSON body from a file").option("--stdin","Read the entry JSON body from stdin").option("--locale <locale>","Entry locale (defaults to the site locale)").action(entriesUpdateCommand);entries.command("delete").description("Delete an entry").argument("<typeName>","Content type name").argument("<id>","Entry UUID returned as id by create/list").option("-C, --cwd <dir>","Site directory").option("--locale <locale>","Entry locale (defaults to the site locale)").action(entriesDeleteCommand);entries.command("query").description("Run a read-only SQL query over the entries table").option("-C, --cwd <dir>","Site directory").option("--sql <query>","SQL SELECT query").option("--file <path>","Read the SQL query from a file").option("--stdin","Read the SQL query from stdin").addHelpText("after",`
2875
2875
  One SELECT that reads only the entries table. Writes are rejected. Limits: 5 seconds, 1,000 rows.
2876
2876
 
2877
2877
  Columns (one row per locale variant):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fimo",
3
- "version": "2.10.2-staging.1",
3
+ "version": "2.10.2-staging.2",
4
4
  "description": "Fimo CLI - create, deploy, and manage Fimo sites",
5
5
  "keywords": [
6
6
  "astro-component"
@@ -194,13 +194,13 @@
194
194
  "devDependencies": {
195
195
  "@clack/core": "^1.2.0",
196
196
  "@clack/prompts": "^1.2.0",
197
- "@fimo/agents-bundle": "2.10.2-staging.1",
198
- "@fimo/api-contracts": "2.10.2-staging.1",
199
- "@fimo/cli-kit": "2.10.2-staging.1",
200
- "@fimo/framework-detect": "2.10.2-staging.1",
201
- "@fimo/routes": "2.10.2-staging.1",
202
- "@fimo/sdk": "2.10.2-staging.1",
203
- "@fimo/tsconfig": "2.10.2-staging.1",
197
+ "@fimo/agents-bundle": "2.10.2-staging.2",
198
+ "@fimo/api-contracts": "2.10.2-staging.2",
199
+ "@fimo/cli-kit": "2.10.2-staging.2",
200
+ "@fimo/framework-detect": "2.10.2-staging.2",
201
+ "@fimo/routes": "2.10.2-staging.2",
202
+ "@fimo/sdk": "2.10.2-staging.2",
203
+ "@fimo/tsconfig": "2.10.2-staging.2",
204
204
  "@types/node": "22.18.6",
205
205
  "agent-install": "^0.0.5",
206
206
  "astro": "^7.1.6",
@@ -9,9 +9,9 @@
9
9
  "check": "astro sync && astro check"
10
10
  },
11
11
  "dependencies": {
12
- "fimo": "2.10.2-staging.1",
13
- "fimo-analytics": "2.10.2-staging.1",
14
- "fimo-astro": "2.10.2-staging.1",
12
+ "fimo": "2.10.2-staging.2",
13
+ "fimo-analytics": "2.10.2-staging.2",
14
+ "fimo-astro": "2.10.2-staging.2",
15
15
  "zod": "^4.4.3"
16
16
  },
17
17
  "devDependencies": {
@@ -12,10 +12,10 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@tanstack/react-query": "^5.80.6",
15
- "fimo": "2.10.2-staging.1",
16
- "fimo-analytics": "2.10.2-staging.1",
17
- "fimo-next": "2.10.2-staging.1",
18
- "fimo-react": "2.10.2-staging.1",
15
+ "fimo": "2.10.2-staging.2",
16
+ "fimo-analytics": "2.10.2-staging.2",
17
+ "fimo-next": "2.10.2-staging.2",
18
+ "fimo-react": "2.10.2-staging.2",
19
19
  "next": "16.4.2",
20
20
  "react": "^19.2.7",
21
21
  "react-dom": "^19.2.7",
@@ -21,11 +21,11 @@
21
21
  "cn": "0.2.4",
22
22
  "date-fns": "^4.1.0",
23
23
  "embla-carousel-react": "^8.6.0",
24
- "fimo": "2.10.2-staging.1",
25
- "fimo-analytics": "2.10.2-staging.1",
26
- "fimo-react": "2.10.2-staging.1",
27
- "fimo-react-router": "2.10.2-staging.1",
28
- "fimo-vite": "2.10.2-staging.1",
24
+ "fimo": "2.10.2-staging.2",
25
+ "fimo-analytics": "2.10.2-staging.2",
26
+ "fimo-react": "2.10.2-staging.2",
27
+ "fimo-react-router": "2.10.2-staging.2",
28
+ "fimo-vite": "2.10.2-staging.2",
29
29
  "input-otp": "^1.4.2",
30
30
  "isbot": "^5",
31
31
  "lucide-react": "^0.577.0",
@@ -11,9 +11,9 @@
11
11
  "prepare": "svelte-kit sync"
12
12
  },
13
13
  "dependencies": {
14
- "fimo": "2.10.2-staging.1",
15
- "fimo-analytics": "2.10.2-staging.1",
16
- "fimo-sveltekit": "2.10.2-staging.1",
14
+ "fimo": "2.10.2-staging.2",
15
+ "fimo-analytics": "2.10.2-staging.2",
16
+ "fimo-sveltekit": "2.10.2-staging.2",
17
17
  "zod": "^4.4.3"
18
18
  },
19
19
  "devDependencies": {
@@ -11,11 +11,11 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@tanstack/react-query": "^5.80.6",
14
- "fimo": "2.10.2-staging.1",
15
- "fimo-analytics": "2.10.2-staging.1",
16
- "fimo-react": "2.10.2-staging.1",
17
- "fimo-react-router": "2.10.2-staging.1",
18
- "fimo-vite": "2.10.2-staging.1",
14
+ "fimo": "2.10.2-staging.2",
15
+ "fimo-analytics": "2.10.2-staging.2",
16
+ "fimo-react": "2.10.2-staging.2",
17
+ "fimo-react-router": "2.10.2-staging.2",
18
+ "fimo-vite": "2.10.2-staging.2",
19
19
  "react": "^19.2.7",
20
20
  "react-dom": "^19.2.7",
21
21
  "react-router": "^8.3.0",