flutterflow_cloud_admin
functions.resolveWorkspace, functions.listWorkspaceInventory, functions.listWorkspaceInvocations,
functions.queryWorkspaceLogs, functions.queryWorkspaceSummary and functions.queryWorkspaceMetrics expose the authenticated preview read path. The generated
models distinguish denied/unavailable attachment and explicit cursor gaps; private native
identity is absent. These POST-shaped reads do not create mutation keys. Keep the original
workspace reference and filters for pagination; discard them on source or identity change.
See workspace inspection.
Preview summaries return logical calls, physical attempts, known-terminal failure counts and excluded pending/unknown/unstarted calls, with coverage and null missing capture. Preview metric series preserve native buckets, sample counts, quantiles and coverage. Wall-duration/CPU/concurrency sections require usage access; denied sections have capability metadata only, and an entirely denied selection performs no native read. Exact monthly Functions Usage and read-only release/rollout metadata are implemented; deployed execution and serving authority remain unavailable. Preview live logs use the generated authenticated functions.tailWorkspaceLogs POST operation and bounded SSE events; their real browser acceptance is tracked separately.
functions.getWorkspaceDefinition takes projectId, workspaceId, name and a
required query.stage (served, ready or desired). It returns a fresh retained
policy snapshot or an explicit workspace/stage gap. A null definition means the
function is absent from a valid selected stage. Secret alias names are present
only when definition.secrets.access is granted; alias/kind pairs remain visible
under function read access. Source identities require source access. Desired
config has no execution generation, config version or source digest. The GET has
no mutation key, and declarations never establish vault or binding-grant access.
See definition reads.
Generated ModelSpec.unique accepts List<ModelSpecUnique> declarations with
fields: ['teamId', 'userId'] scalar tuples;
IndexDescriptor.unique identifies their dedicated layouts. Existing environment
index-status reads include constraints in overall readiness even when queries
is empty, expose conflict repairs (with record IDs) in warnings, and list
every registered constraint, declared or not, in uniqueConstraints.
admin.indexes.listUniqueConstraints reads the same list for any environment,
draft-serving included, and admin.indexes.retireUniqueConstraint stops
enforcing one the environment no longer serves a declaration for. Activation requires
standalone environments and operator qualification; config §4.1
defines the bounds and registration lifetime.
Project overview
admin.projects.getOverview(projectId: …) reads what a project page opens with in one request (12 §4.4): the config draft, current usage, the first page of members and of pending invites, the first 100 secrets, main's log and, under a provisioning-baseline draft, the committed .ffx/project.json. Each section is exactly its own route's answer at that moment; a section the caller cannot read, whose source failed, or that missed the server's 1 s budget is absent, with its problem under problems — read it from its own route (and continue a page there with its nextPageToken). It is a page's opening read, not a cache: refresh a resource through its own route. The project, its threads, the preview, the publication and sign-ups are not in it.
Project list
admin.projects.list() answers a signed-in person's projects in the order they last opened them (never-opened ones after, newest created first), each with the caller's lastOpenedAt and, unless activity: false, the project's latestThread and lastActivityAt — what a project card draws, with no thread read per card (12 §4.6). admin.projects.recordOpened(projectId: …) records that the caller opened a project they are a member of: at most once a minute, a 404 for anyone else, and never by a read.
Personal allowance
admin.usage.getAgentAllowance() reads the authenticated identity's remaining percentage, reset time and availability without a project parameter. No token counts or plan ceiling are returned. Shared thread reads remain available; only the creator can mutate. Contract.
The pure Dart admin SDK covers every implemented control-plane operation and
the stateful thread stream. Its request methods and wire models are generated
from the same canonical catalog as the
TypeScript SDK; neither SDK owns a second operation
list. This package is a member of the Dart workspace rooted at
backend/pubspec.yaml.
The generated threads.interrupt method returns FFXThreadInterruptResult.
Its 202 acknowledgement records the original scope and selected primary message,
not completed cleanup. Omitted scope stops the thread and direct tasks;
primaryTurn selects only the current primary turn. Retain the idempotency key
in request options when retrying an original stop.
Generated operations
Namespaces and actions are identical in both languages. The checked-in
operation map lists every
method. admin_operations.g.dart implements
them; wire_models.g.dart provides their types.
Path arguments are required named parameters. query, headers and body
use generated types; options carries cancellation, metadata callbacks and
an optional retained idempotency key.
threads.create(projectId: ..., body: ..., options: FFXAdminRequestOptions(...))
accepts a caller-retained idempotencyKey outside the JSON body. Reuse the key and exact
request across client recreation or a lost response within the server's
24-hour retention window. A stored failure is terminal for that key. An optional
deadlineAt: DateTime in the same options is rechecked before every transport
attempt, after credentials and retry waits; expiry stops dispatch and retains
the key. An already dispatched response may still complete after the deadline.
import 'package:flutterflow_cloud_admin/flutterflow_cloud_admin.dart';
final admin = FFXAdmin.initialize(adminKey: serverAdminKey);
try {
final project = await admin.projects.create(
body: CreateProjectBody.fromJson({'displayName': 'Example', 'region': 'us'}),
);
final page = await admin.configVersions.list(
projectId: project.id,
query: const ListConfigVersionsQuery(pageSize: 25),
);
if (page.data.isNotEmpty) {
final version = page.data.first.version;
final frozen = await admin.configVersions.get(
projectId: project.id, version: version,
);
final response = await admin.configArtifacts.get(
projectId: project.id, version: version, artifact: ConfigArtifactName.openapi,
);
print(frozen.sections.models);
print(await response.readBytes());
}
} finally {
admin.close();
}
Lists retain {data, hasMore, nextPageToken}. Single resources unwrap data;
query results retain their generated page/aggregate union. Binary calls return
FFXAdminRawResponse with status, headers and a cancellable stream. Proxy calls
preserve opaque bytes and status rather than decoding an envelope. DELETE
operations without declared bodies send no body; empty-body POSTs send {}
with JSON Content-Type.
Optional nullable members preserve three states using WireValue<T>: a null
wrapper omits the property, WireValue(null) sends JSON null, and
WireValue(value) sends the value. fromJson/toJson preserve this distinction.
For example, a first-promotion precondition is explicit:
final body = PromoteEnvironmentBody(
version: 7,
expectedCurrentVersion: const WireValue(null),
);
await admin.environments.promote(
projectId: projectId, environment: 'dev', body: body,
);
Do not omit a precondition when the intended condition is null. Generated open
record models expose declared system fields and retain other fields through
additional; toJson() reconstructs the raw object.
Identity, retries and cancellation
Initialize with exactly one adminKey or userToken. Admin keys are server
secrets and must not enter an app binary; browser Origin requests reject them.
User sessions exchange lazily, refresh once for concurrent requests and rotate
refresh tokens. Project roles and scopes remain authoritative. The existing
registerAdminAccount helper uses the generated registration operation.
Custom HTTP/WebSocket clients, clocks, random and delay functions remain
injectable. Unsafe calls create an Idempotency-Key unless the caller supplies
one through FFXAdminRequestOptions. Retain it across restarts to resume the
same mutation. Retry-After, full jitter, Problem.retry and stored-result headers
determine retries. Pending same-key completion permits two extra attempts;
Dart never replaces the key after a stored terminal error. Opaque proxy
mutations are not automatically retried.
FFXAdminRetryPolicy.requestTimeoutMs defaults to 60 seconds for credentials,
HTTP acquisition, JSON bodies and retries. Error bodies are capped at 64 KiB;
JSON successes at 32 MiB. Malformed/empty HTTP 408/429/5xx errors remain
retryable by status, and successful-body resets retain the mutation key.
Seconds and HTTP-date Retry-After values override jitter within the budget.
Binary/proxy success streams remain caller-owned after headers arrive;
readBytes(maxBytes: ...) optionally bounds a caller's binary accumulation.
Cancellation covers credentials, fetch, retries and body consumption, including
a binary stream handed to the caller. onResponse receives status and headers,
including Date, on every observed response. Failures remain typed
FFXAdminApiError values with code/detail/fix/requestId and retry metadata.
Generated request validation happens before HTTP. Required malformed response
fields fail rather than acquiring invented defaults.
Config, documentation, usage and indexes
configDraft covers get/replace/updateSection/validate. Revision guards,
draftServing acknowledgements and frozen rule classifications retain their
contracts. configVersions.publish/list/get return immutable metadata or all
eight frozen section maps. Lists are newest first, 25/default and 100/max;
keep project and page size unchanged across pages. Version arguments must be
positive safe integers.
configArtifacts.list/get require project access and config:read and expose
only openapi, jsonSchemas, docs and llmsFull. Reads return immutable
UTF-8 bytes and digest ETags, with authorization even on a conditional request.
Missing published bytes are an invariant failure, never regenerated current
config. Private docs are hosted in the existing drip_app Backend workspace.
usage.getCurrentUsage(projectId: projectId) reads the current QuotaDO report.
usage.queryTimeSeries requires named projectId, UsageMetric, dynamic
environment (or all), UsageInterval, and UTC DateTime start/end bounds.
Microseconds are preserved. The full UsageTimeSeriesResponse envelope retains
its original asOf across pages, with observation expiry after three days.
Unaligned ranges select whole calendar buckets. Generated metric/interval enums
map unknown response strings to .unknown; requests reject that case.
Missing/non-string fields and unrelated enum values remain errors. Gauge nulls
and coverage/source labels are retained. Missing canonical activation or history
returns a typed API error. 09 §13
owns the wire contract.
indexes.getStatus takes GetIndexStatusQuery(configVersion: ...) and an
explicit environment. Dynamic base registrations participate. Its two states
are building/ready, with per-query results and current diagnostics over frozen
plans. registeredAt preserves source microseconds, is null until every
required registration exists, and is null for a no-index version. Poll no
faster than every ten seconds. This read does not approve promotion policy or
lifecycle gates.
Administration and retained state
endUsers.list/get/create/update/delete/revokeSessions/setCustomClaims manage
project-global identities without an implicit profile environment. The list
uses 50/default and 100/max pages with a stable email filter, oldest first or,
with order: newest, newest first. Reads require
auth:read; mutations require auth:write and an active project for all actors.
Success confirms durable session/index or deletion completion. Historical replay
cannot re-enable an account or revoke newer sessions. Claims replacement
validates every current serving declaration and caps UTF-8 JSON at 1,000 bytes;
an empty map revokes all claims. Pass the read claimsRevision as
body.expectedRevision for an atomic conditional replacement. A stale revision
returns 412 versionConflict; read and review before a new write. Retry an
uncertain outcome with the original body and idempotency key.
apiKeys.create/revoke return PublicApiKey; list includes active and revoked
keys. apiKeys:write and project access are required. Any key, including the
last, can be revoked without deleting data or its environment. Revocation is
permanent with up to sixty seconds of edge convergence. A replacement must be
created explicitly; replaying a prior creation cannot revive a key.
adminApiKeys retain the separate organization-owner lifecycle.
Project-secret put/list/delete return metadata only.
Repository read/write scopes are independent of each other and of project
metadata scopes. Owners receive both, developers read only, viewer/billing
neither. repository.getCommitDiff preserves the required truncated notice
when more than 200 changed paths exist; binary/large content omission is
separate. Shares require an explicit thread ID or dashboard target and keep
commit/build/access semantics. Dashboard publication occurs through thread
merge, never a preview-selection API. publish carries the production card:
get, deploy and unpublish for the dashboard share's public state, and
connectDomain/disconnectDomain for one maker-owned hostname; connectDomain
answers 503 where custom domains are not configured. Icons use the canonical base64 upload
body and raw binary download response.
connectProject, watchProject, followThread, threadsAll,
threadMessagesAll remain stateful helpers over generated
requests. They retain lazy/broadcast connections, ticket minting, reconnect,
sequence resume and gap reconciliation. Agent-authored strings are plain text,
not trusted markup. Local stream diagnostics do not change wire schemas.
Interactive terminals use threads.terminals.create/get/write/resize/signal/stream/delete.
Creation returns the original terminal ID, execution generation and absolute deadline;
retain that ID across reconnects. stream returns an FFXAdminRawResponse containing SSE with base64 stdout bytes,
sequence cursors and a distinct exit event; pass after to resume. write sends
application/octet-stream bytes once, without automatic retries. Resize and delete
return an empty204response. Closing a terminal releases its output and workspace hold.
Access requires thread write permission. A terminal is tied to its original primary
generation and cannot move to a replacement execution.
Direct tasks use the generated threads.tasks operations and canonical task,
attempt, result, cleanup and promotion models. threads.tasks.wait returns
completion, attention or timeout while preserving the original attempt and cursor.
Its original idempotency key preserves the deadline and first response across
controller restart; timeout never stops a child. Native Dart tests exercise this
public observational wait through local HTTP. Agent yielded waits remain unbuilt.
Runs group tasks as open/stopped metadata. They have no separate completion
wait helper. Standby is automatic runtime behavior with no public SDK method.
The stream exposes typed listeners for every task and run event. Known frames use the same generated schema table and decoder as HTTP responses, enforcing numeric constraints before model construction. Frames are bounded to 256 KiB of UTF-8 before JSON decoding. Advertised future events may advance the resume cursor only with a positive safe integer sequence; malformed known events remain protocol errors. Deltas and tool progress may be dropped under pressure; durable task state and messages retain normal resume and gap behavior.
The canonical SDK contract and stream cutover are implemented. Some public task handlers and live event publication remain under implementation in the Unikraft runtime. Generated methods alone do not establish that their server behavior is available.
Development
bun run codegen from the root regenerates all models and both admin request
surfaces atomically. bun run codegen:check rejects drift and stale output.
Run bun run dart:analyze and bun run dart:test; deployed thread acceptance
is a separate opt-in suite. No package is published by code generation.
backend/workers/agent/test/task-api-http.test.ts also launches a native Dart
client against real loopback HTTP and the local API/controller fixture. It
checks shared/isolated queued tasks, original idempotent attempts after client
and controller recreation, pagination, and task/group stop responses. This
fixture does not qualify running native children or hel-devel recovery.
The transport remains pure Dart with package:http; WebSocket implementations
are selected by platform. Owners are 12 Admin API,
17 code sharing,
18 conventions and
threads SDKs.
App settings use generated UpdateProjectBody and its canonical nested models.
Optional nullable fields use WireValue: omit to retain, pass null to clear, or
pass a value to replace. ifAppRevision protects conditional saves; the returned
app's revision and appliedRevision distinguish saved from applied identity.
projects.getAppIcon(projectId: projectId, rev: revision) returns a raw response;
consume readBytes() or cancel its body. See 12 §4.1.
Invitation email proof
admin.members.acceptInvite(body: AcceptInviteBody(token: token, upstreamCredential: currentUpstreamIdToken)) requires a current upstream ID token
for the same user as the admin session. The API verifies the provider-returned
email against the invited recipient before granting membership. Renew expired
proof through the host's existing identity provider before calling this method.
A signed-in user can also answer invitations without the link.
admin.members.listMyInvites() returns the pending ReceivedInvites addressed
to them: one page, newest first, one per project, with the project's live name
and theme color and never the token or address.
admin.members.acceptMyInvite(inviteId: id, body: RespondToInviteBody(upstreamCredential: currentUpstreamIdToken)) joins the
project (201, ProjectMember); declineMyInvite takes the same arguments and
answers InviteRevoked — a declined invitation is revoked on the wire, and its
emailed link stops working. Either answer also revokes any older pending
invitation from the same project to the same address. Both require a current
upstream token for the signed-in user with a verified email, or they return
403 permissionDenied; an invitation addressed to a different email looks the
same as an unknown id (404 resourceNotFound).
The account stream (ffx.account.v1) that signals inbox changes is generated
only: admin.account.createConnectTicket() mints a single-use uct_v1 ticket
and admin.account.connectStream(query: ConnectAccountStreamQuery(ticket: ticket)) opens the raw socket. There is no stateful Dart helper; the TypeScript
SDK's admin.account.connect() documents the ping, liveness and reconnect
rules. Check a frame's type before AccountStreamEvent.fromJson: clients
ignore types they do not know, and the generated decoder rejects them.
admin.account.sendFeedback(body: SendFeedbackBody(rating: …, message: …, context: FeedbackContext(path: …))) sends the FlutterFlow team a rating (1–5),
a note, or both from the signed-in person and answers FeedbackSent (id,
createdAt); without a rating the note must hold text, and a server-side
credential is refused with 403 roleForbidden (12 §4.2).
admin.threads.askFeedback(projectId: …, threadId: …, body: AskThreadFeedbackBody(moment: …, anchorSeq: …)) asks the server whether to ask
how a thread turned out and answers ThreadFeedbackAskResult (ask, null when
it will not ask now); admin.threads.updateFeedback(projectId: …, threadId: …, key: …, body: UpdateThreadFeedbackBody(sentiment: …, reasons: …, message: …))
saves a face, reasons, a note or a dismissal on that record and answers
ThreadFeedbackSaved (12 §4.2).
Planning initial flow
admin.threads.create accepts a body with optional FFXCreateThreadBodyInitialFlow; omission
keeps immediate generation. FFXThread.plan, FFXThreadPlan, and its phase
enum expose the durable planning document. See
threads/03.
Message sends accept an optional body.clientRequestId, echoed by REST history
and stream observations, including messages recovered after reconnecting. Match
it together with the authenticated author to confirm a late send. Retry an
uncertain send with the original request body and retained idempotencyKey;
the correlation token does not itself deduplicate requests.
The generated config and frozen version models require functions; {} disables
Functions. Recursive value schemas and nullable type tuples round-trip through
the generated models and request descriptors. Serving readiness is separate from
config publication; see Functions config.
Project-secret put/list/delete decode the canonical ProjectSecret.versionToken,
an opaque write identity independent of the secret value (random for every write;
derived from non-secret metadata for a row written before version tokens). It is metadata,
not a credential or mutation precondition. See the vault contract.
Project-secret put/list/delete accept only stores and builds. Server secrets
use the explicit environment operations below. Server card wire variants require
an environment and intended function IDs.
secrets.listServerSecrets and secrets.listServerSecretVersions read metadata
from an explicit live environment. Pass projectId and environment; versions
also require secretName. Names accept exact name and latest state filters;
versions sort numerically newest first. Query pages default to 25 and cap at 100.
A state-filtered page can be empty while hasMore remains true. Continue with
nextPageToken until null, preserving identity, filters and page size; restart
after environment/secret recreation or grant changes. No secret value or key
wrapping is returned. Conditional version-state mutations and agent delegation of metadata reads are implemented. Runtime secret grants remain
unbuilt. See the read contract.
secrets.getServerSecretWriteTarget returns the live environmentIncarnation
and nullable current metadata. secrets.putServerSecret requires that incarnation,
expected (null for absent, otherwise the observed incarnation/revision/token),
kind and value. File values require canonical padded standard base64 and
fileName; text is UTF-8. Decoded values are 1–256 KiB. Retain one explicit
idempotency key for identical uncertain retries; never generate a new key merely
because a reply was lost. The response is the original version's metadata, even
after a later rotation; current authorization and environment scope still apply.
secrets.getSecretInputRequest returns the durable target, exact expected prior
condition and terminal outcome. An optional inputRequestId on putServerSecret
completes that exact request atomically with the immutable version and receipt.
secrets.skipSecretInputRequest takes the observed revision and a retained
idempotency key. These operations require the original requesting principal,
current secret/thread permissions and the bound live environment/thread generation.
Expiry and skip are terminal; a 409 refusal can be a stored result. No method
creates a function grant or returns values. The primary baked broker/tool and
product private-input card implement delivery. Qualified deployment KMS
configuration and delegated bindings remain unbuilt.
Environment-secret enableServerSecretVersion and disableServerSecretVersion
operations are generated from the canonical metadata-only
ServerSecretVersionStateBody and ServerSecretVersionStateChange contracts.
Submit the full immutable identity, version token and observed state revision,
with one stable idempotency key. A replay returns the original historical result;
read metadata for current state. The response's 5000 ms prior-grant start bound
is policy, not measured cancellation latency, and cancelsRunningUses is false.
Enabling grants no function access; emergency runtime cancellation and runtime secret grants remain
unbuilt. See conditional version state.
secrets.listServerSecretReferences reads the current incarnation's affected
functions and releases (secrets:read and functions:read): active binding grants
first, then retained releases pinning its versions, or one version in the query;
continue with nextPageToken. Rows are the ServerSecretGrantReference /
ServerSecretReleaseReference union, coverage reports runtime: unavailable, and no
value or version token is returned. secrets.deleteServerSecret sends
DeleteServerSecretBody (exact environment incarnation and current
incarnation/revision/token) with one stable idempotency key. It fails with
secretReferenced while a retained release or unresolved access pins a version;
success returns the value-free ServerSecretDeletion receipt with the scheduled
purgeAfter, and a later putServerSecret with expected: null creates a new
incarnation. See reference-aware deletion.
functions.getSecretGrant reads an explicit function/binding slot and its current
immutable grant. functions.putSecretGrant takes an exact target and either null
for an empty slot or the observed revoked grant ID/revision. functions.revokeSecretGrant
permanently revokes that ID; replacing a grant always creates a different ID.
Reads require current secrets:read and functions:read; mutations require
secrets:bind and functions:read. Retain the original body and idempotency key
through uncertain outcomes. Replayed metadata is historical, so read the slot
again before presenting current authority. These APIs never expose values or
runtime credentials, deploy code or validate a future release's pinned config.
Runtime grant delivery remains unbuilt.
Binding contract.
functions.putAgentDelegation, functions.getAgentDelegation and
functions.revokeAgentDelegation create, read and end a conversation agent's delegated
secrets:read/secrets:bind, functions:read/functions:build/functions:deploy and
usage:read/functions:logs:read for named functions (build and deploy need
lifetimeSeconds), and functions.listAgentDelegations pages every delegation of the
environment's current incarnation, newest first, with the same rules as the
TypeScript SDK. Agent delegation.
Preview live logs
The FFXFunctionLogStream extension adds functions.streamWorkspaceLogs over the
generated tailWorkspaceLogs operation. It yields the generated
FunctionWorkspaceTailEvent variants and uses the normal authentication refresh
and FFXAdminCancellation. Cancelling its subscription closes the HTTP body.
Supply the live cursor from fresh recent history, not a historical page cursor.
Reconnect a visible, explicitly started view with the last delivered batch cursor;
sixty-second connections do not renew the fifteen-minute session. Gaps, expiry and
denial are explicit. Clear cached rows on denial and stop on hidden/unmount, scope
or signed-in identity changes. The parser bounds each frame, JSON depth, ordering,
filter and workspace identity. Deployed runtime tails are not implemented.
Transport resilience verification
test/http_resilience_test.dart validates proxy errors, truncated successful responses, same-key replay, cancellation and deadlines over real loopback HTTP.
The opt-in deployed acceptance gate is dart test test/deployed_resilience_test.dart from this
package directory with FFX_AV108_DEPLOYED=1 and FFX_AV108_ADMIN_URL, FFX_AV108_PROJECT_ID, and either FFX_AV108_ADMIN_KEY or
FFX_AV108_ADMIN_TOKEN (a fresh upstream Firebase ID token; the SDK exchanges it
for an admin session and signs out its own test sessions afterward).
Use the deployed HTTPS endpoint and a dedicated test tenant. The gate performs
only reads: baseline, a real upstream response whose local body is deliberately
reset, and successful recovery after injected HTML 502, empty 503 and 429. It
never prints credentials or creates/deletes customer resources. CI skips this
gate without explicit credentials; loopback regression tests run normally.
RuleAssertion.lookupRecords accepts up to 10 RuleAssertionLookupRecords(model: ..., record: ...) fixtures for side-effect-free simulations of exists/get rules. Omitted paths are absent; fixtures must be complete schema-valid records.
Update rule simulations accept RuleAssertion.newRecord: the complete proposed
post-image, alongside the existing record pre-image. Supply resolved increments
and clears, unchanged id/createdAt, and version advanced by one. Both fixtures
are schema-validated and projected before evaluation. Other operations reject
newRecord; an update assertion whose rule reads it or calls changedFields()
but supplies none is invalid, so an expected deny cannot pass on the
missing candidate alone. changedFields() is derived by comparing the two
fixtures.
Permanent server-secret version denial
secrets.revokeServerSecretVersion requires separate secrets:revoke authority,
full version identity/token/revision and one stable idempotency key. Owners receive
this capability by default; developers do not. The transaction persists permanent
denial, a per-version revocation epoch, metadata audit and original receipt.
secrets.getServerSecretRevocation reads current metadata and the durable operation.
The Secrets drawer confirms the exact target and recovers status on refresh/reopen.
The operation stays pending with runtime reconciliation unavailable: running-attempt
cancellation, lease/cache propagation and global convergence are not implemented.
See Functions secrets.
Exact monthly Functions usage
Generated functions.getProjectUsage, functions.getEnvironmentUsage and
functions.getUsage read the closed FunctionUsageResult with an optional
billingPeriod query. Project/environment aggregates require current usage:read;
a named function additionally requires functions:read before lookup. Missing
coverage and unknown liability remain explicit. The API defaults unavailable
without its dedicated qualified reader transport; SDK generation does not
activate execution or billing. Contract.
The generated functions.listReleases, getRelease, listRollouts and
getRollout methods expose permission-safe local release custody history.
ListReleasesQuery/ListRolloutsQuery carry optional function/config filters and
opaque bounded pagination; GetReleaseQuery/GetRolloutQuery carry the selected
function membership filter. Sealed result variants distinguish recorded metadata
from unavailable source/head. secretMetadata decodes to
FunctionReleaseMetadataSecretMetadataRestricted or ...Recorded, whose
FunctionReleaseSecretBindings carry alias, secret name, kind, incarnation and
version, plus the current versionState on getRelease; values and version tokens
are never present. Each FunctionReleaseMetadata names its build once (buildId) and
that build's one code revision once (revisionId; every function the release declares
runs its one artifact), lists the declared function names in functions (only the
filtered one under a function filter), and carries the manifest's runtimeAbi
and placement (FunctionReleaseMetadataPlacement, with its
FunctionReleaseMetadataPlacementMode) and its readiness, sealed as
FunctionReleaseMetadataReadinessPending until a decision is recorded, then exactly
that decision: ...Ready (observedAtMs and the regions eligible when it was decided)
or ...Failed (observedAtMs and its reason). A release read's coverage names
regional readiness recordedDecision; a rollout read's FunctionRolloutReadCoverage
keeps it unavailable. Recorded readiness decisions and historical traffic
observations are not current serving readiness. Model/transport tests verify all
four paths, the readiness variants, restricted source metadata and invalid known-field
refusal.
functions.getTraffic takes a required GetTrafficQuery(configVersion: ...) and
returns FunctionTrafficResultRecorded or FunctionTrafficResultUnavailable. The
recorded lane carries the local custody epoch, weights recorded by the last
observed switch receipt, the public pending rollout ID and the owning controller's
generation: the conditions a rollout, rollback or control compares. Its coverage
keeps serving, regional readiness and convergence unavailable.
functions.createEndpoint takes a CreateFunctionEndpointBody whose sealed
FunctionEndpointConfig is FunctionEndpointConfigPinned(version: …) or
FunctionEndpointConfigDefault(); deleteEndpoint takes a
DeleteFunctionEndpointBody(expectedGeneration: …); listEndpoints and getEndpoint
read enabled aliases as FunctionEndpointReadMetadata, whose sealed convergence is
FunctionEndpointConvergencePending() or FunctionEndpointConvergenceConverged(routeState: …, acknowledgedAtMs: …), under a coverage whose convergence is recorded and
serving unavailable. No deployment installs the alias route authority or its
dispatcher, so aliases read pending indefinitely, which is not progress.
FunctionEndpointMutationResult keeps convergence and serving unavailable; any
other value in those known fields, and any other convergence state, is refused.
functions.issueInvokeGrant returns a FunctionInvokeGrantResult whose grant is a
sensitive ffx_fi_ bearer value for at most 60 seconds. It needs functions:deploy
while the service enrollment and delegation model is a pending design decision; the
default server installs no service enrollment or signing key, so it is unavailable
(contract).
functions.queryInventory posts a FunctionInventoryQuery and returns the sealed
FunctionInventoryResultPage, ...Gap or ...Unavailable; its draftStates, a list
of FunctionInventoryItemDraftState, keeps the items in those draft states. Page items
carry a FunctionDeploymentState derived from recorded custody (ready for a lane's
whole weight on a ready release of an applied route; disabled from a lane's recorded
disable), the FunctionInventoryItemDraftState, the
declaring publishedConfigVersion, per-lane
FunctionInventoryItemLane facts (recorded release weights and rollout target per
config version) and per-item visibility; the page's FunctionInventoryLane list names
the compared config's lane and every recorded config pin lane. Restart from the first
page after a gap. functions.querySummary returns
FunctionSummaryResult whose operational section is
FunctionSummaryOperationalObserved (the deployed store's calls, failures and, under
usage:read, CPU for the environment and each supplied name, with coverage),
...Unavailable (storeUnavailable where no store is installed) or ...Denied and whose usage section is
FunctionSummaryUsageGranted (wrapping FunctionUsageResult) or ...Denied, and
whose inventory section is FunctionSummaryInventorySnapshot (a name-free snapshot
reference), ...Unavailable or ...Denied. Both POSTs are reads and send no
idempotency key.
functions.queryMetrics, listInvocations, getInvocation, queryLogs, tailLogs
and getTrace read one named function's deployed diagnostics
(contract).
Each sealed result shares FunctionDeployedDiagnosticUnavailable, which each returns
where the API has no runtime log view. tailLogs returns the raw
text/event-stream response of FunctionDeployedTailEvent frames. History
(fdh1_) and tail (fdt1_) cursors are opaque and not interchangeable.
Functions build and revision metadata
functions.listBuilds, getBuild, listRevisions and getRevision read retained
project custody with fresh functions:read. An optional function filter applies
to each method; list queries take pageSize (1–25) and an opaque pageToken.
getBuild optionally selects one positive attempt; omission selects the current
number. Keep the original function/page-size selection when continuing. Changed
project creation or grants invalidates the cursor; filtered empty pages may still
have a continuation. These GETs create no mutation/idempotency key.
A revision is one sealed build attempt's one signed artifact
(functions/06 §1):
FunctionRevisionMetadata.functions lists every function that artifact dispatches,
and the function filter selects the revisions dispatching that function.
recorded means a bounded local observation. verificationRecorded and a ready
revision report recorded artifact verification; production build, runtime and
serving authority remain unavailable. Missing custody/source has its own unavailable
variant, distinct from recorded empty or a missing attempt. Source and artifact
digests require repository:read. A failed attempt's failure decodes to a
FunctionBuildFailureCode and a FunctionBuildFailureLocationRecorded (path,
nullable line/column; needs repository:read), ...Restricted or
...Unavailable location. Private provider, sealer, signature, source
provenance, diagnostic messages and fixes are never returned.
Functions build mutations
functions.requestBuild takes a project and closed Git commit/configVersion body;
functions.cancelBuild takes project/build IDs and the exact attempt/generation
condition. Both require current functions:build and accept options: FFXAdminRequestOptions(idempotencyKey: ...).
Retain the original body and key after an uncertain reply. Completed replay returns
the original metadata only after current permission, original principal and project
creation checks. It does not request another source snapshot or compiler run.
The default server has no trusted source/compiler admission, so requestBuild fails
with functionsUnavailable (503, retry: never) before build custody: nothing is kept
under the key, and the SDK sends the request once. An accepted response means the
queued intent is recorded;
runtimeQualification and serving remain unavailable. Cancellation may report
cancelling while unknown work/debt remains; it does not prove a process stopped or
an artifact disappeared. Recipes, filesystem paths and provider identities are not
request fields. At ten queued or running builds per project requestBuild fails
with functionBuildLimitExceeded (409, retry: never). The server's
in-transaction refusal is stored under that key; a stricter local Git admission
policy refuses before the keyed mutation executes, so its refusal is not stored and
the same key may be sent again once a slot frees.
functions.retireRevision takes project/revision IDs and RetireFunctionRevisionBody()
(its only field is the fixed expectedLifecycle: 'ready' condition), requires current
functions:deploy and accepts options: FFXAdminRequestOptions(idempotencyKey: ...).
It records logical retirement only, for every function the revision's artifact
dispatches; artifacts stay until a separate physical
retirement receipt, and a retained release of the revision's build in any
environment or lifecycle makes it fail with operationConflict (409). Revision
metadata decodes quarantine to FunctionRevisionQuarantineNone or
FunctionRevisionQuarantineQuarantined (recorded only by a trusted host authority;
no SDK setter or lift) and, from getRevision only, bounded references.
The isolated run_build_custody.py --mutations proof uses both real SDKs with real
HTTP/Firestore and explicitly synthetic trusted source/compiler authorities.
Immutable release preparation
functions.prepareRelease takes project/environment, a closed
PrepareFunctionReleaseBody selecting published configVersion, one verified buildId
and attempt, whose one ready revision dispatches every declared function, and an exact
secret incarnation/version for every declared alias.
It requires current functions:deploy; every replay rechecks the original
principal/project/environment lifetime. Use the same caller idempotency key and
identical body after uncertainty. No caller placement/profile/digest or secret
value is accepted. The server resolves current config, the verified revision and
binding grants; FunctionReleasePreparationResult reports preparing metadata
and explicitly unavailable runtime, regional readiness and serving. No default
trusted placement policy is installed, so normal startup refuses it with the same
functionsUnavailable (503, retry: never). A release binds its build's one
revision: a code change is a new build of the whole project, and secret
rotation selects the same build with new versions. The release becomes ready once
its build's artifact is ready and enough of its allowed regions run a runtime that
supports its ABI; no deployment installs that runtime inventory, so deployed
releases stay preparing.
The isolated real Firestore/private HTTP proof exercises both generated SDKs, original response recovery and permission/reference fences. Its source, sealing, KMS wrapping and placement authorities are fixtures; this is not provider or runtime qualification. See API composition.
The generated functions.requestRollout and functions.rollback methods take
RequestFunctionRolloutSelection and RollbackFunctionsBody, with caller-owned
FFXAdminRequestOptions(idempotencyKey: ...). The selection wraps either
RequestFunctionRolloutBody (RequestFunctionRolloutSelectionValue1(...)) or the
orchestrated RequestOrchestratedFunctionRolloutBody
(RequestFunctionRolloutSelectionValue2(...); its optional gates tightens the default
health gates), whose later steps move only through an
observation source the default server does not install. Select exact generation and traffic
epoch from release metadata's generation and controlCondition; weights total
10000 across one/two distinct verified releases. A 202 returns queued intent only,
with traffic/readiness/serving unavailable. Original request replay preserves its
identity; SDKs never retry an unknown effect under another key. A request that
would own an unowned config lane, or advance or replace a settled single-step
observing owner, while 20 project rollout operations are active (orchestrated
rollouts that are still observing included) fails with
functionRolloutLimitExceeded (409, retry: never), stored under that key.
Replacing an owner that is already counted, an observing orchestrated one included,
is net zero; it and the controls below are never refused by the bound. functions.pauseRollout, resumeRollout and cancelRollout take the
controller's exact ControlFunctionRolloutBody condition. Default trusted target
admission is unavailable and route authority integration remains open.
functions.retireRelease takes a RetireFunctionReleaseBody(configVersion:, expectedGeneration:) and retires one unreferenced ready or failed release as a
metadata transition: it becomes retiring at once (no new traffic references), and
custody records it retired once the dispatch horizon has passed with nothing
selecting it. Nothing is provisioned or deprovisioned. FunctionReleaseRetirementResult
reports the new generation, with regionalReadiness and serving unavailable; the
default server installs no trusted retirement admission.
See API composition.
functions.disable and functions.enable take DisableFunctionsBody(configVersion:, expectedEpoch:, functionNames:, emergency:) and EnableFunctionsBody(configVersion:, expectedEpoch:, functionNames:, emergency:): a conditional lane-level traffic control at the
lane's exact traffic epoch, on the named declared functions or all of them.
emergency: true needs the owner-only functions:block scope besides
functions:deploy; an emergency disable holds its functions and only an emergency
enable lifts them. FunctionTrafficControlResult is queued intent (transitionId,
requestedDisabledFunctions, supersededRolloutId) with traffic, readiness and
serving unavailable; an orchestrated rollout still observing makes an ordinary
control operationConflict, and only an emergency disable supersedes it; getTraffic's lane carries disabledFunctions,
emergencyDisabledFunctions and pendingTrafficControl. See traffic route authority.
Libraries
- flutterflow_cloud_admin
- Generated control-plane operations with shared credentials, retries and streams.
- wire
- Typed admin-plane wire models, generated from the platform's TypeBox
contracts (
packages/schema) bypackages/codegen.