primitive-admin 1.1.0-alpha.78 → 1.1.0-alpha.79
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.
- package/README.md +38 -17
- package/assets/skill/skills/primitive-platform/SKILL.md +39 -52
- package/dist/bin/primitive.js +14 -25
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.js +8 -18
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/analytics.js +46 -5
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/auth.js +16 -1
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/collection-type-configs.js +1 -9
- package/dist/src/commands/collection-type-configs.js.map +1 -1
- package/dist/src/commands/config.js +11 -29
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +1 -9
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/databases.js +8 -38
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/env.js +27 -32
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/functions.js +197 -23
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/groups.js +1 -9
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/init.js +6 -0
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/rule-sets.js +1 -9
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/scripts.js +12 -28
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/sync.d.ts +119 -0
- package/dist/src/commands/sync.js +387 -196
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/workflows.js +2 -14
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +46 -11
- package/dist/src/lib/api-client.js +21 -11
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +24 -57
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +30 -204
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -1
- package/dist/src/lib/config-json-field.d.ts +28 -0
- package/dist/src/lib/config-json-field.js +56 -0
- package/dist/src/lib/config-json-field.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.js +4 -3
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-surface.js +1 -1
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/config.d.ts +21 -14
- package/dist/src/lib/config.js +25 -44
- package/dist/src/lib/config.js.map +1 -1
- package/dist/src/lib/credentials-store.d.ts +31 -8
- package/dist/src/lib/credentials-store.js +52 -13
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/env-resolver-core.d.ts +18 -0
- package/dist/src/lib/env-resolver-core.js +26 -3
- package/dist/src/lib/env-resolver-core.js.map +1 -1
- package/dist/src/lib/env-resolver.d.ts +15 -0
- package/dist/src/lib/env-resolver.js +21 -1
- package/dist/src/lib/env-resolver.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +1 -1
- package/dist/src/lib/function-collect.js +138 -7
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +49 -11
- package/dist/src/lib/function-db-types.js +234 -39
- package/dist/src/lib/function-db-types.js.map +1 -1
- package/dist/src/lib/function-document-types.d.ts +50 -0
- package/dist/src/lib/function-document-types.js +163 -0
- package/dist/src/lib/function-document-types.js.map +1 -0
- package/dist/src/lib/function-log-tail.d.ts +83 -0
- package/dist/src/lib/function-log-tail.js +115 -0
- package/dist/src/lib/function-log-tail.js.map +1 -0
- package/dist/src/lib/function-schema-codegen.d.ts +118 -0
- package/dist/src/lib/function-schema-codegen.js +402 -0
- package/dist/src/lib/function-schema-codegen.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +85 -2
- package/dist/src/lib/function-sync.js +196 -27
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/function-triggers.d.ts +9 -3
- package/dist/src/lib/function-triggers.js +12 -9
- package/dist/src/lib/function-triggers.js.map +1 -1
- package/dist/src/lib/function-typecheck.d.ts +86 -0
- package/dist/src/lib/function-typecheck.js +370 -0
- package/dist/src/lib/function-typecheck.js.map +1 -0
- package/dist/src/lib/generated-allowlist.js +4 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +422 -0
- package/dist/src/lib/generated-config-surfaces.js +838 -9
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- package/dist/src/lib/generated-sdk-types.d.ts +1 -1
- package/dist/src/lib/generated-sdk-types.js +1 -1
- package/dist/src/lib/generated-sdk-types.js.map +1 -1
- package/dist/src/lib/log-inspection.d.ts +116 -4
- package/dist/src/lib/log-inspection.js +147 -2
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/snapshots.d.ts +6 -7
- package/dist/src/lib/snapshots.js +18 -81
- package/dist/src/lib/snapshots.js.map +1 -1
- package/dist/src/lib/sync-paths.d.ts +29 -53
- package/dist/src/lib/sync-paths.js +46 -97
- package/dist/src/lib/sync-paths.js.map +1 -1
- package/dist/src/lib/workflow-toml-validator.d.ts +8 -3
- package/dist/src/lib/workflow-toml-validator.js +8 -3
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/package.json +3 -3
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* Regenerate with:
|
|
10
10
|
* node cli/scripts/gen-sdk-types.mjs
|
|
11
11
|
*/
|
|
12
|
-
export declare const SDK_TYPES_SOURCE = "// GENERATED by scripts/generate-function-profile.mjs from openapi.json.\n// DO NOT EDIT. Run `pnpm functions:profile` and commit the result; the\n// freshness guard in tests/api/spec/function-profile.test.ts fails when this\n// file and a fresh generation diverge.\n\n/**\n * Type surface of `primitive-functions` \u2014 what a server function's author writes\n * against (#3180). The published package's RUNTIME is a stub that throws from\n * every export on purpose: the platform substitutes its own copy at invoke\n * time, and reaching the stub means it did not.\n */\n\n/**\n * The signed-in user who invoked the function over HTTP.\n *\n * Attribution, never authority (#3279): function code acts as the system\n * whoever called it, so this says WHO asked, and the rows the function writes\n * are attributed to them. A trigger fire has no caller and `ctx.user` is\n * null.\n */\nexport interface FunctionUser {\n userId: string;\n email: string | null;\n}\n\n/** What started this invocation. */\nexport type FunctionTrigger =\n | { kind: \"http\" }\n | { kind: \"webhook\"; [key: string]: unknown }\n | { kind: \"cron\"; [key: string]: unknown }\n | { kind: \"database\"; databaseId: string; databaseType: string; [key: string]: unknown }\n /**\n * A DSL workflow's `workflow.call` step reached this function (#3288).\n *\n * TRANSITIONAL: the bridge exists so a workflow tree can migrate leaf-first\n * during the transition, and it retires with the workflow engine in phase 7,\n * taking this variant with it. `workflowKey` names the PARENT workflow, and\n * `runId`/`stepId` locate the step inside its run.\n */\n | { kind: \"workflow\"; workflowKey: string; runId: string; stepId: string };\n\n/** The result shape of an operation that answers in response headers. */\nexport interface HeaderResult {\n status: number;\n headers: Record<string, string>;\n}\n\n/**\n * A platform call that was refused. `errorCode` carries the gateway's own\n * codes (`FUNCTION_ROUTE_NOT_ALLOWED`, `FUNCTION_EGRESS_DENIED`, \u2026) as well\n * as the route's.\n */\nexport interface PrimitivePlatformError extends Error {\n status: number;\n errorCode: string | null;\n}\n\n/**\n * The typed HTTP profile, generated from the platform's OpenAPI document. Its\n * namespaces mirror the operation ids: analytics, blobBuckets, channels, collections, configVars, connections, databaseTypeConfigs, databases, documents, email, functions, gemini, groups, integrations, iterations, llm, locks, notifications, prompts, resourceMetadata, secrets, users.\n * Methods take one options object carrying the operation's path parameters,\n * query parameters, request headers (under their wire names) and `body`.\n *\n * Generated from the same operations as the runtime profile, so a method that\n * type-checks is a method the platform publishes \u2014 and a missing path\n * parameter or a missing required header is a compile error rather than a\n * `TypeError` at invoke time. Every call runs with the app's own SYSTEM\n * authority (#3279): the invocation gate was the authorization. The three\n * namespaces the gateway does not admit (`functions`, `iterations`,\n * `databaseTypeConfigs`) are still declared: they exist, they answer the\n * gateway's structured denial, and hiding them would make a route's\n * availability look like a typo.\n */\nexport interface FunctionApi {\n \"analytics\": {\n /** `analytics.cohortRetention` \u2014 GET /analytics/cohort-retention. Cohort retention metrics */\n \"cohortRetention\"(args?: {\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.dailyActive` \u2014 GET /analytics/daily-active. Daily active user time series */\n \"dailyActive\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.errorGroups` \u2014 GET /analytics/errors/groups. Group failure events by fingerprint with per-day count buckets */\n \"errorGroups\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n \"filter\"?: Record<string, Record<string, string | number | boolean | Array<string | number | boolean>>>;\n }): Promise<any>;\n /** `analytics.integrationUsage` \u2014 GET /analytics/integrations. Integration usage metrics */\n \"integrationUsage\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.listEvents` \u2014 GET /analytics/events. List analytics events */\n \"listEvents\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"page\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n \"filter\"?: Record<string, Record<string, string | number | boolean | Array<string | number | boolean>>>;\n }): Promise<any>;\n /** `analytics.listEventsGrouped` \u2014 GET /analytics/events/grouped. List analytics events grouped by dimension */\n \"listEventsGrouped\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"groupBy\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n \"filter\"?: Record<string, Record<string, string | number | boolean | Array<string | number | boolean>>>;\n }): Promise<any>;\n /** `analytics.overviewDau` \u2014 GET /analytics/overview/dau. Daily active users overview */\n \"overviewDau\"(args?: {\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.overviewGrowth` \u2014 GET /analytics/overview/growth. User growth overview */\n \"overviewGrowth\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.overviewMau` \u2014 GET /analytics/overview/mau. Monthly active users overview */\n \"overviewMau\"(args?: {\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.overviewWau` \u2014 GET /analytics/overview/wau. Weekly active users overview */\n \"overviewWau\"(args?: {\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.rollingActive` \u2014 GET /analytics/rolling-active. Rolling active user time series */\n \"rollingActive\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.searchUsers` \u2014 GET /analytics/users/search. Search app users for analytics */\n \"searchUsers\"(args?: {\n \"q\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.topPrompts` \u2014 GET /analytics/prompts/top. List the most-executed prompts */\n \"topPrompts\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.topUsers` \u2014 GET /analytics/users/top. List the most active users */\n \"topUsers\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.topWorkflows` \u2014 GET /analytics/workflows/top. List the most-run workflows */\n \"topWorkflows\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.userDetail` \u2014 GET /analytics/users/{userUlid}/detail. Detailed analytics for a single user */\n \"userDetail\"(args: {\n \"userUlid\": string | number;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.userSnapshot` \u2014 GET /analytics/users/{userUlid}/snapshot. Activity snapshot for a single user */\n \"userSnapshot\"(args: {\n \"userUlid\": string | number;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.writeForUser` \u2014 POST /analytics/write-for-user. Write an analytics event for a subject user under a grant */\n \"writeForUser\"(args: {\n body: unknown;\n }): Promise<any>;\n };\n \"blobBuckets\": {\n /** `blobBuckets.createBucket` \u2014 POST /blob-buckets. Create a blob bucket */\n \"createBucket\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `blobBuckets.delete` \u2014 DELETE /blob-buckets/{bucketId}/blobs/{blobId}. Delete a blob */\n \"delete\"(args: {\n \"bucketId\": string | number;\n \"blobId\": string | number;\n }): Promise<any>;\n /** `blobBuckets.deleteBatch` \u2014 POST /blob-buckets/{bucketId}/blobs/delete. Batch delete blobs from a bucket */\n \"deleteBatch\"(args: {\n \"bucketId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `blobBuckets.deleteBucket` \u2014 DELETE /blob-buckets/{bucketId}. Delete a blob bucket */\n \"deleteBucket\"(args: {\n \"bucketId\": string | number;\n }): Promise<any>;\n /** `blobBuckets.download` \u2014 GET /blob-buckets/{bucketId}/blobs/{blobId}. Download a blob (anonymous allowed for public buckets) */\n \"download\"(args: {\n \"bucketId\": string | number;\n \"blobId\": string | number;\n \"disposition\"?: string | number | boolean;\n }): Promise<Uint8Array>;\n /** `blobBuckets.downloadSigned` \u2014 GET /blob-buckets/{bucketId}/blobs/{blobId}/signed. Download a blob via a signed URL token */\n \"downloadSigned\"(args: {\n \"bucketId\": string | number;\n \"blobId\": string | number;\n \"token\"?: string | number | boolean;\n }): Promise<Uint8Array>;\n /** `blobBuckets.getBucket` \u2014 GET /blob-buckets/{bucketId}. Get a blob bucket by id */\n \"getBucket\"(args: {\n \"bucketId\": string | number;\n }): Promise<any>;\n /** `blobBuckets.getMetadata` \u2014 GET /blob-buckets/{bucketId}/blobs/{blobId}/metadata. Get blob metadata (anonymous allowed for public buckets) */\n \"getMetadata\"(args: {\n \"bucketId\": string | number;\n \"blobId\": string | number;\n }): Promise<any>;\n /** `blobBuckets.getSignedUrl` \u2014 POST /blob-buckets/{bucketId}/blobs/{blobId}/signed-url. Create a signed download URL for a blob */\n \"getSignedUrl\"(args: {\n \"bucketId\": string | number;\n \"blobId\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `blobBuckets.list` \u2014 GET /blob-buckets/{bucketId}/blobs. List blobs in a bucket (anonymous allowed for public buckets) */\n \"list\"(args: {\n \"bucketId\": string | number;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `blobBuckets.listBuckets` \u2014 GET /blob-buckets. List blob buckets */\n \"listBuckets\"(args?: Record<string, never>): Promise<any>;\n /** `blobBuckets.updateBucket` \u2014 PATCH /blob-buckets/{bucketId}. Update a blob bucket */\n \"updateBucket\"(args: {\n \"bucketId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `blobBuckets.upload` \u2014 POST /blob-buckets/{bucketId}/blobs. Upload a blob to a bucket */\n \"upload\"(args: {\n \"bucketId\": string | number;\n \"X-Blob-Filename\": string | number;\n \"X-Blob-Tags\"?: string | number;\n \"Content-Type\"?: string | number;\n body: ArrayBuffer | Uint8Array | string;\n }): Promise<any>;\n };\n \"channels\": {\n /** `channels.authorize` \u2014 POST /channels/{channel}/grants. Issue a channel grant under a server function's grant */\n \"authorize\"(args: {\n \"channel\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `channels.publish` \u2014 POST /channels/{channel}/publish. Publish a message to a channel under a server function's grant */\n \"publish\"(args: {\n \"channel\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"collections\": {\n /** `collections.addDocument` \u2014 POST /collections/{collectionId}/documents. Add a document to a collection */\n \"addDocument\"(args: {\n \"collectionId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `collections.addMember` \u2014 POST /collections/{collectionId}/members. Add a member to a collection */\n \"addMember\"(args: {\n \"collectionId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `collections.create` \u2014 POST /collections. Create a collection */\n \"create\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `collections.delete` \u2014 DELETE /collections/{collectionId}. Delete a collection */\n \"delete\"(args: {\n \"collectionId\": string | number;\n }): Promise<any>;\n /** `collections.get` \u2014 GET /collections/{collectionId}. Get a collection by id */\n \"get\"(args: {\n \"collectionId\": string | number;\n }): Promise<any>;\n /** `collections.getAccess` \u2014 GET /collections/{collectionId}/access. Get a collection's access summary */\n \"getAccess\"(args: {\n \"collectionId\": string | number;\n }): Promise<any>;\n /** `collections.grantGroupPermission` \u2014 POST /collections/{collectionId}/group-permissions. Grant a group permission on a collection */\n \"grantGroupPermission\"(args: {\n \"collectionId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `collections.list` \u2014 GET /collections. List collections */\n \"list\"(args?: {\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `collections.listCollectionsForDocument` \u2014 GET /documents/{documentId}/collections. List collections a document belongs to (reverse lookup) */\n \"listCollectionsForDocument\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `collections.listDocuments` \u2014 GET /collections/{collectionId}/documents. List documents in a collection */\n \"listDocuments\"(args: {\n \"collectionId\": string | number;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `collections.listPendingInvitations` \u2014 GET /collections/{collectionId}/pending-invitations. List a collection's pending invitations */\n \"listPendingInvitations\"(args: {\n \"collectionId\": string | number;\n }): Promise<any>;\n /** `collections.removeDocument` \u2014 DELETE /collections/{collectionId}/documents/{documentId}. Remove a document from a collection */\n \"removeDocument\"(args: {\n \"collectionId\": string | number;\n \"documentId\": string | number;\n }): Promise<any>;\n /** `collections.removeMember` \u2014 DELETE /collections/{collectionId}/members/{userId}. Remove a member from a collection */\n \"removeMember\"(args: {\n \"collectionId\": string | number;\n \"userId\": string | number;\n }): Promise<any>;\n /** `collections.revokeGroupPermission` \u2014 DELETE /collections/{collectionId}/group-permissions/{groupType}/{groupId}. Revoke a group permission on a collection */\n \"revokeGroupPermission\"(args: {\n \"collectionId\": string | number;\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `collections.update` \u2014 PATCH /collections/{collectionId}. Update a collection */\n \"update\"(args: {\n \"collectionId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"configVars\": {\n /** `configVars.get` \u2014 GET /config-vars/{name}. Read an app config var under a server function's grants */\n \"get\"(args: {\n \"name\": string | number;\n }): Promise<any>;\n };\n \"connections\": {\n /** `connections.send` \u2014 POST /connections/{connectionId}/send. Send a realtime message to one connection of this app */\n \"send\"(args: {\n \"connectionId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"databaseTypeConfigs\": {\n /** `databaseTypeConfigs.create` \u2014 POST /databases/types. Create a database type */\n \"create\"(args: {\n \"dryRun\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n /** `databaseTypeConfigs.createOperation` \u2014 POST /databases/types/{databaseType}/operations. Create an operation for a database type */\n \"createOperation\"(args: {\n \"databaseType\": string | number;\n \"dryRun\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n /** `databaseTypeConfigs.delete` \u2014 DELETE /databases/types/{databaseType}. Delete a database type */\n \"delete\"(args: {\n \"databaseType\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.deleteOperation` \u2014 DELETE /databases/types/{databaseType}/operations/{name}. Delete an operation for a database type */\n \"deleteOperation\"(args: {\n \"databaseType\": string | number;\n \"name\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.get` \u2014 GET /databases/types/{databaseType}. Get a database type */\n \"get\"(args: {\n \"databaseType\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.getOperation` \u2014 GET /databases/types/{databaseType}/operations/{name}. Get an operation for a database type */\n \"getOperation\"(args: {\n \"databaseType\": string | number;\n \"name\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.getReindexStatus` \u2014 GET /databases/types/{databaseType}/reindex-status. Status of the index back-provision fan-out for a type */\n \"getReindexStatus\"(args: {\n \"databaseType\": string | number;\n \"runId\"?: string | number | boolean;\n }): Promise<any>;\n /** `databaseTypeConfigs.list` \u2014 GET /databases/types. List database types */\n \"list\"(args?: Record<string, never>): Promise<any>;\n /** `databaseTypeConfigs.listOperations` \u2014 GET /databases/types/{databaseType}/operations. List operations for a database type */\n \"listOperations\"(args: {\n \"databaseType\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.scaffoldSchema` \u2014 POST /databases/types/{databaseType}/schema:scaffold. Scaffold a starter schema for a database type */\n \"scaffoldSchema\"(args: {\n \"databaseType\": string | number;\n }): Promise<any>;\n \"subscriptions\": {\n /** `databaseTypeConfigs.subscriptions.create` \u2014 POST /databases/types/{databaseType}/subscriptions. Create a subscription for a database type */\n \"create\"(args: {\n \"databaseType\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databaseTypeConfigs.subscriptions.delete` \u2014 DELETE /databases/types/{databaseType}/subscriptions/{subscriptionKey}. Delete a database type subscription */\n \"delete\"(args: {\n \"databaseType\": string | number;\n \"subscriptionKey\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.subscriptions.get` \u2014 GET /databases/types/{databaseType}/subscriptions/{subscriptionKey}. Get a database type subscription */\n \"get\"(args: {\n \"databaseType\": string | number;\n \"subscriptionKey\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.subscriptions.list` \u2014 GET /databases/types/{databaseType}/subscriptions. List subscriptions for a database type */\n \"list\"(args: {\n \"databaseType\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.subscriptions.update` \u2014 PUT /databases/types/{databaseType}/subscriptions/{subscriptionKey}. Update a database type subscription */\n \"update\"(args: {\n \"databaseType\": string | number;\n \"subscriptionKey\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n /** `databaseTypeConfigs.update` \u2014 PATCH /databases/types/{databaseType}. Update a database type */\n \"update\"(args: {\n \"databaseType\": string | number;\n \"dryRun\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n /** `databaseTypeConfigs.updateOperation` \u2014 PATCH /databases/types/{databaseType}/operations/{name}. Update an operation for a database type */\n \"updateOperation\"(args: {\n \"databaseType\": string | number;\n \"name\": string | number;\n \"dryRun\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n };\n \"databases\": {\n /** `databases.addManager` \u2014 PUT /databases/{databaseId}/permissions. Set a user's database permission */\n \"addManager\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n \"adminData\": {\n /** `databases.adminData.batch` \u2014 POST /databases/{databaseId}/admin-data/batch. DEPRECATED \u2014 direct database batch; use databases/{databaseId}/records/batch */\n \"batch\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.adminData.count` \u2014 POST /databases/{databaseId}/admin-data/count. DEPRECATED \u2014 direct database count; use databases/{databaseId}/records/count */\n \"count\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.adminData.delete` \u2014 POST /databases/{databaseId}/admin-data/delete. DEPRECATED \u2014 direct database delete; use databases/{databaseId}/records/delete */\n \"delete\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.adminData.patch` \u2014 POST /databases/{databaseId}/admin-data/patch. DEPRECATED \u2014 direct database patch; use databases/{databaseId}/records/patch */\n \"patch\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.adminData.query` \u2014 POST /databases/{databaseId}/admin-data/query. DEPRECATED \u2014 direct database query; use databases/{databaseId}/records/query */\n \"query\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.adminData.save` \u2014 POST /databases/{databaseId}/admin-data/save. DEPRECATED \u2014 direct database save; use databases/{databaseId}/records/save */\n \"save\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n /** `databases.create` \u2014 POST /databases. Create a database */\n \"create\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `databases.delete` \u2014 DELETE /databases/{databaseId}. Delete a database */\n \"delete\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.executeBatch` \u2014 POST /databases/{databaseId}/operations/{name}/batch. Execute a database operation in batch */\n \"executeBatch\"(args: {\n \"databaseId\": string | number;\n \"name\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.executeOperation` \u2014 POST /databases/{databaseId}/operations/{name}/execute. Execute a database operation */\n \"executeOperation\"(args: {\n \"databaseId\": string | number;\n \"name\": string | number;\n \"dryRun\"?: string | number | boolean;\n body?: unknown;\n }): Promise<any>;\n /** `databases.get` \u2014 GET /databases/{databaseId}. Get a database by id */\n \"get\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.getMetadata` \u2014 GET /databases/{databaseId}/metadata. Get database metadata */\n \"getMetadata\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.grantGroupPermission` \u2014 POST /databases/{databaseId}/group-permissions. Grant a group permission on a database */\n \"grantGroupPermission\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.importBulk` \u2014 POST /databases/{databaseId}/operations/{name}/import-bulk. Bulk-import records via a database operation */\n \"importBulk\"(args: {\n \"databaseId\": string | number;\n \"name\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.list` \u2014 GET /databases. List databases */\n \"list\"(args?: Record<string, never>): Promise<any>;\n /** `databases.listGroupPermissions` \u2014 GET /databases/{databaseId}/group-permissions. List a database's group permissions */\n \"listGroupPermissions\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.listOperations` \u2014 GET /databases/{databaseId}/operations. List operations runnable on a database */\n \"listOperations\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.listPermissions` \u2014 GET /databases/{databaseId}/permissions. List a database's user permissions */\n \"listPermissions\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n \"records\": {\n /** `databases.records.addToSet` \u2014 POST /databases/{databaseId}/records/stringset/add. Database records: stringset/add (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"addToSet\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.aggregate` \u2014 POST /databases/{databaseId}/records/aggregate. Database records: aggregate (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"aggregate\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.batch` \u2014 POST /databases/{databaseId}/records/batch. Database records: batch (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"batch\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.count` \u2014 POST /databases/{databaseId}/records/count. Database records: count (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"count\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.delete` \u2014 POST /databases/{databaseId}/records/delete. Database records: delete (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"delete\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.describe` \u2014 GET /databases/{databaseId}/records/describe. Database records: describe (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"describe\"(args: {\n \"databaseId\": string | number;\n \"modelName\"?: string | number | boolean;\n }): Promise<any>;\n /** `databases.records.dropIndex` \u2014 POST /databases/{databaseId}/records/index/drop. Database records: index/drop (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"dropIndex\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.dropUniqueConstraint` \u2014 POST /databases/{databaseId}/records/unique-constraint/drop. Database records: unique-constraint/drop (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"dropUniqueConstraint\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.increment` \u2014 POST /databases/{databaseId}/records/increment. Database records: increment (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"increment\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.listIndexes` \u2014 GET /databases/{databaseId}/records/indexes. Database records: indexes (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"listIndexes\"(args: {\n \"databaseId\": string | number;\n \"modelName\"?: string | number | boolean;\n }): Promise<any>;\n /** `databases.records.listUniqueConstraints` \u2014 GET /databases/{databaseId}/records/unique-constraints. Database records: unique-constraints (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"listUniqueConstraints\"(args: {\n \"databaseId\": string | number;\n \"modelName\"?: string | number | boolean;\n }): Promise<any>;\n /** `databases.records.models` \u2014 GET /databases/{databaseId}/records/models. Database records: models (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"models\"(args: {\n \"databaseId\": string | number;\n \"modelName\"?: string | number | boolean;\n }): Promise<any>;\n /** `databases.records.patch` \u2014 POST /databases/{databaseId}/records/patch. Database records: patch (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"patch\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.query` \u2014 POST /databases/{databaseId}/records/query. Database records: query (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"query\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.registerIndex` \u2014 POST /databases/{databaseId}/records/index/register. Database records: index/register (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"registerIndex\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.registerUniqueConstraint` \u2014 POST /databases/{databaseId}/records/unique-constraint/register. Database records: unique-constraint/register (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"registerUniqueConstraint\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.removeFromSet` \u2014 POST /databases/{databaseId}/records/stringset/remove. Database records: stringset/remove (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"removeFromSet\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.save` \u2014 POST /databases/{databaseId}/records/save. Database records: save (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"save\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.syncIndexes` \u2014 POST /databases/{databaseId}/records/indexes/sync. Database records: indexes/sync (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"syncIndexes\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n /** `databases.reindex` \u2014 POST /databases/{databaseId}/reindex. Reindex a database */\n \"reindex\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.revokeGroupPermission` \u2014 DELETE /databases/{databaseId}/group-permissions/{groupType}/{groupId}. Revoke a group permission on a database */\n \"revokeGroupPermission\"(args: {\n \"databaseId\": string | number;\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `databases.revokePermission` \u2014 DELETE /databases/{databaseId}/permissions/{userId}. Remove a user's database permission */\n \"revokePermission\"(args: {\n \"databaseId\": string | number;\n \"userId\": string | number;\n }): Promise<any>;\n /** `databases.runOperation` \u2014 POST /databases/{databaseId}/operations/{name}/run. Run a database operation under a server function's grants */\n \"runOperation\"(args: {\n \"databaseId\": string | number;\n \"name\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `databases.transferOwnership` \u2014 POST /databases/{databaseId}/permissions/transfer. Transfer database ownership */\n \"transferOwnership\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.update` \u2014 PATCH /databases/{databaseId}. Update a database */\n \"update\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.updateMetadata` \u2014 PATCH /databases/{databaseId}/metadata. Update database metadata */\n \"updateMetadata\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"documents\": {\n /** `documents.addTag` \u2014 POST /documents/{documentId}/tags. Add a tag to a document */\n \"addTag\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n \"aliases\": {\n /** `documents.aliases.delete` \u2014 DELETE /document-aliases/{scope}/{aliasKey}. Delete a (scope, aliasKey) document alias binding */\n \"delete\"(args: {\n \"scope\": string | number;\n \"aliasKey\": string | number;\n }): Promise<any>;\n /** `documents.aliases.listForDocument` \u2014 GET /documents/{documentId}/aliases. List aliases bound to a document */\n \"listForDocument\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.aliases.resolve` \u2014 GET /document-aliases/{scope}/{aliasKey}. Resolve the document bound to a (scope, aliasKey) alias */\n \"resolve\"(args: {\n \"scope\": string | number;\n \"aliasKey\": string | number;\n }): Promise<any>;\n /** `documents.aliases.set` \u2014 PUT /document-aliases/{scope}/{aliasKey}. Bind a (scope, aliasKey) alias to a document */\n \"set\"(args: {\n \"scope\": string | number;\n \"aliasKey\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n /** `documents.approveAccessRequest` \u2014 POST /documents/{documentId}/access-requests/{requestId}/approve. Approve a document access request */\n \"approveAccessRequest\"(args: {\n \"documentId\": string | number;\n \"requestId\": string | number;\n body?: unknown;\n }): Promise<any>;\n \"blobs\": {\n /** `documents.blobs.delete` \u2014 DELETE /documents/{documentId}/blobs/{blobId}. Delete a document blob */\n \"delete\"(args: {\n \"documentId\": string | number;\n \"blobId\": string | number;\n }): Promise<any>;\n /** `documents.blobs.downloadHeaders` \u2014 HEAD /documents/{documentId}/blobs/{blobId}/download. Get document blob download headers (ETag/304 support) */\n \"downloadHeaders\"(args: {\n \"documentId\": string | number;\n \"blobId\": string | number;\n }): Promise<HeaderResult>;\n /** `documents.blobs.downloadUrl` \u2014 GET /documents/{documentId}/blobs/{blobId}/download. Download a document blob's bytes */\n \"downloadUrl\"(args: {\n \"documentId\": string | number;\n \"blobId\": string | number;\n \"disposition\"?: string | number | boolean;\n }): Promise<Uint8Array>;\n /** `documents.blobs.get` \u2014 GET /documents/{documentId}/blobs/{blobId}. Get a document blob's metadata */\n \"get\"(args: {\n \"documentId\": string | number;\n \"blobId\": string | number;\n }): Promise<any>;\n /** `documents.blobs.list` \u2014 GET /documents/{documentId}/blobs. List blobs attached to a document */\n \"list\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.blobs.upload` \u2014 PUT /documents/{documentId}/blobs/{blobId}. Upload a document blob with a client-specified id (immutable + idempotent) */\n \"upload\"(args: {\n \"documentId\": string | number;\n \"blobId\": string | number;\n \"X-Blob-Filename\": string | number;\n \"X-Blob-Size\": string | number;\n \"X-Blob-Sha256\": string | number;\n body: ArrayBuffer | Uint8Array | string;\n }): Promise<any>;\n /** `documents.blobs.uploadWithoutId` \u2014 PUT /documents/{documentId}/blobs. Deprecated: upload a document blob without a client-specified id */\n \"uploadWithoutId\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n };\n /** `documents.clearLinkAccess` \u2014 DELETE /documents/{documentId}/link-access. Turn off the document's link access */\n \"clearLinkAccess\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.create` \u2014 POST /documents. Create a new document */\n \"create\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `documents.createWithAlias` \u2014 POST /documents/create-with-alias. Create a document and bind it to an alias */\n \"createWithAlias\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `documents.debugDumpUpdates` \u2014 POST /documents/{documentId}/debug/dump-updates. Dump a document's raw CRDT update log (debug) */\n \"debugDumpUpdates\"(args: {\n \"documentId\": string | number;\n \"limit\"?: string | number | boolean;\n \"offset\"?: string | number | boolean;\n \"includeData\"?: string | number | boolean;\n \"includeR2Data\"?: string | number | boolean;\n body?: unknown;\n }): Promise<any>;\n /** `documents.debugMerge` \u2014 POST /documents/{documentId}/debug/merge. Force-merge a document's pending updates (debug) */\n \"debugMerge\"(args: {\n \"documentId\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `documents.debugMergeBlock` \u2014 POST /documents/{documentId}/debug/merge-block. Merge a specific update block of a document (debug) */\n \"debugMergeBlock\"(args: {\n \"documentId\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `documents.debugRestore` \u2014 POST /documents/debug/restore. Restore a document from a prior state snapshot (debug) */\n \"debugRestore\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `documents.debugStats` \u2014 GET /documents/{documentId}/debug/stats. Get document storage/update stats (debug) */\n \"debugStats\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.delete` \u2014 DELETE /documents/{documentId}. Delete a document */\n \"delete\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.denyAccessRequest` \u2014 POST /documents/{documentId}/access-requests/{requestId}/deny. Deny a document access request */\n \"denyAccessRequest\"(args: {\n \"documentId\": string | number;\n \"requestId\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `documents.exportChain` \u2014 GET /documents/{documentId}/export/chain. Export chain of a large document (snapshot + sealed overlays + open epoch) */\n \"exportChain\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.exportState` \u2014 GET /documents/{documentId}/export/state. Export a document's encoded CRDT state */\n \"exportState\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.get` \u2014 GET /documents/{documentId}. Get a single document by id */\n \"get\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.getImportChainStatus` \u2014 GET /documents/{documentId}/import/chain. How far a large document's chain import has got */\n \"getImportChainStatus\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.getLinkAccess` \u2014 GET /documents/{documentId}/link-access. Get the document's \"anyone with the link\" access level */\n \"getLinkAccess\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.getOrCreateWithAlias` \u2014 POST /documents/get-or-create-with-alias. Get the document bound to an alias, creating it if absent (idempotent) */\n \"getOrCreateWithAlias\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `documents.getPermissions` \u2014 GET /documents/{documentId}/permissions. List a document's user permissions */\n \"getPermissions\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.getSchema` \u2014 GET /documents/{documentId}/schema. Introspect a document's model schema */\n \"getSchema\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.getStats` \u2014 GET /documents/{documentId}/stats. Document statistics (record/model/blob counts, approximate size) */\n \"getStats\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.grantGroupPermission` \u2014 POST /documents/{documentId}/group-permissions. Grant a group permission on a document */\n \"grantGroupPermission\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.importChain` \u2014 POST /documents/{documentId}/import/chain. Install an uploaded chain into a large document */\n \"importChain\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.importChainArtifact` \u2014 POST /documents/{documentId}/import/chain/artifact. Upload one artifact of a large document's import chain */\n \"importChainArtifact\"(args: {\n \"documentId\": string | number;\n \"kind\"?: string | number | boolean;\n \"epoch\"?: string | number | boolean;\n \"buildId\"?: string | number | boolean;\n \"model\"?: string | number | boolean;\n \"index\"?: string | number | boolean;\n body: ArrayBuffer | Uint8Array | string;\n }): Promise<any>;\n /** `documents.importState` \u2014 POST /documents/{documentId}/import/state. Import encoded CRDT state into a document */\n \"importState\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.listAccessRequests` \u2014 GET /documents/{documentId}/access-requests. List access requests for a document */\n \"listAccessRequests\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.listGroupPermissions` \u2014 GET /documents/{documentId}/group-permissions. List a document's group permissions */\n \"listGroupPermissions\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.listPendingInvitations` \u2014 GET /documents/{documentId}/pending-invitations. List a document's pending (deferred) invitations */\n \"listPendingInvitations\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.open` \u2014 POST /documents/open. Open a document for collaboration (resolves access + alias) */\n \"open\"(args: {\n body: unknown;\n }): Promise<any>;\n \"records\": {\n /** `documents.records.aggregate` \u2014 POST /documents/{documentId}/records/{model}/aggregate. Aggregate records in a document model (count/sum/avg/min/max, optional grouping) */\n \"aggregate\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.records.bulk` \u2014 POST /documents/{documentId}/records/bulk. Apply an atomic multi-model record blob to a document (create/patch/delete) */\n \"bulk\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.records.count` \u2014 GET /documents/{documentId}/records/{model}/count. Count records in a document model */\n \"count\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n \"filter\"?: Record<string, unknown> | string;\n }): Promise<any>;\n /** `documents.records.delete` \u2014 DELETE /documents/{documentId}/records/{model}/{recordId}. Delete a record from a document model */\n \"delete\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n \"recordId\": string | number;\n }): Promise<any>;\n /** `documents.records.patch` \u2014 PATCH /documents/{documentId}/records/{model}/{recordId}. Merge fields into an existing record in a document model */\n \"patch\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n \"recordId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.records.query` \u2014 GET /documents/{documentId}/records/{model}. Query records in a document model */\n \"query\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n \"filter\"?: Record<string, unknown> | string;\n }): Promise<any>;\n /** `documents.records.save` \u2014 POST /documents/{documentId}/records/{model}. Create or replace a record in a document model */\n \"save\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n /** `documents.removePermissionByEmail` \u2014 DELETE /documents/{documentId}/permissions. Revoke a user's permission on a document by email (?email=) */\n \"removePermissionByEmail\"(args: {\n \"documentId\": string | number;\n \"email\"?: string | number | boolean;\n }): Promise<any>;\n /** `documents.removePermissionByUserId` \u2014 DELETE /documents/{documentId}/permissions/{userId}. Revoke a user's permission on a document by user id */\n \"removePermissionByUserId\"(args: {\n \"documentId\": string | number;\n \"userId\": string | number;\n }): Promise<any>;\n /** `documents.removeTag` \u2014 DELETE /documents/{documentId}/tags/{tag}. Remove a tag from a document */\n \"removeTag\"(args: {\n \"documentId\": string | number;\n \"tag\": string | number;\n }): Promise<any>;\n /** `documents.requestAccess` \u2014 POST /documents/{documentId}/access-requests. Request access to a document */\n \"requestAccess\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.revokeGroupPermission` \u2014 DELETE /documents/{documentId}/group-permissions/{groupType}/{groupId}. Revoke a group permission on a document */\n \"revokeGroupPermission\"(args: {\n \"documentId\": string | number;\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `documents.setLinkAccess` \u2014 PUT /documents/{documentId}/link-access. Set the document's \"anyone with the link\" access level */\n \"setLinkAccess\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.transferOwnership` \u2014 POST /documents/{documentId}/permissions/transfer. Transfer ownership of a document to another user */\n \"transferOwnership\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.update` \u2014 PUT /documents/{documentId}. Update a document's metadata */\n \"update\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.updatePermissions` \u2014 PUT /documents/{documentId}/permissions. Grant or update a user's permission on a document */\n \"updatePermissions\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.validateAccess` \u2014 POST /documents/{documentId}/validate-access. Resolve the caller's effective access level for a document */\n \"validateAccess\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n };\n \"email\": {\n /** `email.send` \u2014 POST /emails/send. Send an application email under a server function's grant */\n \"send\"(args: {\n body: unknown;\n }): Promise<any>;\n };\n \"functions\": {\n /** `functions.invoke` \u2014 POST /functions/{functionKey}. Invoke a server function: a synchronous one returns its result, a durable one starts a run */\n \"invoke\"(args: {\n \"functionKey\": string | number;\n body?: unknown;\n }): Promise<any>;\n };\n \"gemini\": {\n /** `gemini.countTokens` \u2014 POST /gemini/count-tokens. Count tokens for a Gemini request */\n \"countTokens\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `gemini.generate` \u2014 POST /gemini/generate. Generate content with Gemini */\n \"generate\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `gemini.generateRaw` \u2014 POST /gemini/generate-raw. Generate content with Gemini (raw passthrough) */\n \"generateRaw\"(args: {\n \"model\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n /** `gemini.models` \u2014 GET /gemini/models. List available Gemini models */\n \"models\"(args?: Record<string, never>): Promise<any>;\n };\n \"groups\": {\n /** `groups.addMember` \u2014 POST /groups/{groupType}/{groupId}/members. Add a member to a group */\n \"addMember\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `groups.create` \u2014 POST /groups. Create a group */\n \"create\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `groups.delete` \u2014 DELETE /groups/{groupType}/{groupId}. Delete a group */\n \"delete\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `groups.get` \u2014 GET /groups/{groupType}/{groupId}. Get a group by type and id */\n \"get\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `groups.list` \u2014 GET /groups. List groups */\n \"list\"(args?: {\n \"type\"?: string | number | boolean;\n \"includeSystem\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `groups.listDatabases` \u2014 GET /groups/{groupType}/{groupId}/databases. List databases shared with a group */\n \"listDatabases\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `groups.listDocuments` \u2014 GET /groups/{groupType}/{groupId}/documents. List documents shared with a group */\n \"listDocuments\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `groups.listMembers` \u2014 GET /groups/{groupType}/{groupId}/members. List a group's members */\n \"listMembers\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n \"include\"?: string | number | boolean;\n }): Promise<any>;\n /** `groups.listPendingInvitations` \u2014 GET /groups/{groupType}/{groupId}/pending-invitations. List a group's pending invitations */\n \"listPendingInvitations\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `groups.listUserMemberships` \u2014 GET /users/{userId}/memberships. List a user's group memberships */\n \"listUserMemberships\"(args: {\n \"userId\": string | number;\n \"includeSystem\"?: string | number | boolean;\n \"type\"?: string | number | boolean;\n }): Promise<any>;\n /** `groups.removeMember` \u2014 DELETE /groups/{groupType}/{groupId}/members/{userId}. Remove a specific member from a group */\n \"removeMember\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n \"userId\": string | number;\n }): Promise<any>;\n /** `groups.removeMemberByEmail` \u2014 DELETE /groups/{groupType}/{groupId}/members. Remove a group member or pending invitation by email */\n \"removeMemberByEmail\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n \"email\"?: string | number | boolean;\n }): Promise<any>;\n /** `groups.update` \u2014 PATCH /groups/{groupType}/{groupId}. Update a group */\n \"update\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"integrations\": {\n /** `integrations.call` \u2014 POST /integrations/{integrationKey}/call. Call an integration under a server function's grants */\n \"call\"(args: {\n \"integrationKey\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `integrations.list` \u2014 GET /integrations. List integrations configured for the app */\n \"list\"(args?: Record<string, never>): Promise<any>;\n /** `integrations.proxy` \u2014 POST /integrations/{integrationKey}/proxy. Proxy a request through a configured integration */\n \"proxy\"(args: {\n \"integrationKey\": string | number;\n }): Promise<any>;\n };\n \"iterations\": {\n /** `iterations.get` \u2014 GET /iterations/{iterationName}. Get details for a single iteration */\n \"get\"(args: {\n \"iterationName\": string | number;\n }): Promise<any>;\n /** `iterations.list` \u2014 GET /iterations. List iteration runs */\n \"list\"(args?: Record<string, never>): Promise<any>;\n /** `iterations.reset` \u2014 POST /iterations/{iterationName}/reset. Reset a terminal iteration so the next trigger runs fresh */\n \"reset\"(args: {\n \"iterationName\": string | number;\n }): Promise<any>;\n };\n \"llm\": {\n /** `llm.chat` \u2014 POST /llm/chat. Run an LLM chat completion */\n \"chat\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `llm.models` \u2014 GET /llm/models. List available LLM models */\n \"models\"(args?: Record<string, never>): Promise<any>;\n };\n \"locks\": {\n /** `locks.list` \u2014 GET /locks. List all currently-held named locks in the app */\n \"list\"(args?: Record<string, never>): Promise<any>;\n /** `locks.release` \u2014 POST /locks/release. Release a held named lock (requires the acquire handle) */\n \"release\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `locks.renew` \u2014 POST /locks/renew. Extend the lease on a held named lock */\n \"renew\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `locks.status` \u2014 POST /locks/status. Report the current holder of a named lock */\n \"status\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `locks.tryAcquire` \u2014 POST /locks/acquire. Attempt to acquire a named lock (single non-blocking attempt) */\n \"tryAcquire\"(args: {\n body: unknown;\n }): Promise<any>;\n };\n \"notifications\": {\n /** `notifications.list` \u2014 GET /notifications. List the caller's in-app notification inbox (newest first) */\n \"list\"(args?: {\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `notifications.listDevices` \u2014 GET /me/push-tokens. List the caller's registered push devices */\n \"listDevices\"(args?: Record<string, never>): Promise<any>;\n /** `notifications.markAllRead` \u2014 POST /notifications/read-all. Mark all of the caller's notifications as read */\n \"markAllRead\"(args?: Record<string, never>): Promise<any>;\n /** `notifications.markRead` \u2014 PATCH /notifications/{notificationId}/read. Mark one of the caller's notifications as read */\n \"markRead\"(args: {\n \"notificationId\": string | number;\n }): Promise<any>;\n /** `notifications.registerDevice` \u2014 POST /me/push-tokens. Register (upsert) the caller's device push token */\n \"registerDevice\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `notifications.send` \u2014 POST /notifications/send. Send a notification to an app user (durable in-app inbox row + live WS frame) */\n \"send\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `notifications.unreadCount` \u2014 GET /notifications/unread-count. Count the caller's unread notifications */\n \"unreadCount\"(args?: Record<string, never>): Promise<any>;\n /** `notifications.unregisterDevice` \u2014 DELETE /me/push-tokens/{token}. Unregister one of the caller's device push tokens */\n \"unregisterDevice\"(args: {\n \"token\": string | number;\n }): Promise<any>;\n };\n \"prompts\": {\n /** `prompts.execute` \u2014 POST /prompts/{promptKey}/execute. Execute a saved prompt */\n \"execute\"(args: {\n \"promptKey\": string | number;\n }): Promise<any>;\n /** `prompts.run` \u2014 POST /prompts/{promptKey}/run. Run a prompt under a server function's grants */\n \"run\"(args: {\n \"promptKey\": string | number;\n body?: unknown;\n }): Promise<any>;\n };\n \"resourceMetadata\": {\n /** `resourceMetadata.delete` \u2014 DELETE /resources/{resourceType}/{resourceId}/metadata/{category}. Delete a resource's metadata for a category (idempotent) */\n \"delete\"(args: {\n \"resourceType\": string | number;\n \"resourceId\": string | number;\n \"category\": string | number;\n }): Promise<any>;\n /** `resourceMetadata.get` \u2014 GET /resources/{resourceType}/{resourceId}/metadata/{category}. Read a resource's metadata for a category */\n \"get\"(args: {\n \"resourceType\": string | number;\n \"resourceId\": string | number;\n \"category\": string | number;\n }): Promise<any>;\n /** `resourceMetadata.getBatch` \u2014 POST /resources/metadata/batch. Batch-read resource metadata (partial success) */\n \"getBatch\"(args: {\n \"debug\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n /** `resourceMetadata.list` \u2014 GET /resources/{resourceType}/{resourceId}/metadata. List all metadata categories on a resource */\n \"list\"(args: {\n \"resourceType\": string | number;\n \"resourceId\": string | number;\n }): Promise<any>;\n /** `resourceMetadata.resolve` \u2014 POST /metadata/resolve. Resolve a resource by a category's unique metadata value */\n \"resolve\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `resourceMetadata.set` \u2014 PUT /resources/{resourceType}/{resourceId}/metadata/{category}. Write a resource's metadata for a category */\n \"set\"(args: {\n \"resourceType\": string | number;\n \"resourceId\": string | number;\n \"category\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"secrets\": {\n /** `secrets.get` \u2014 GET /secrets/{name}. Read an app secret under a server function's grants */\n \"get\"(args: {\n \"name\": string | number;\n }): Promise<any>;\n };\n \"users\": {\n /** `users.getBasic` \u2014 GET /users/{userId}/basic. Get a user's basic public profile */\n \"getBasic\"(args: {\n \"userId\": string | number;\n }): Promise<any>;\n /** `users.getProfiles` \u2014 POST /users/profiles. Look up user profiles in bulk */\n \"getProfiles\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `users.list` \u2014 GET /users. List app users */\n \"list\"(args?: {\n \"email\"?: string | number | boolean;\n \"userId\"?: string | number | boolean;\n \"name\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `users.lookup` \u2014 GET /users/lookup. Look up a user by identifier */\n \"lookup\"(args?: {\n \"email\"?: string | number | boolean;\n }): Promise<any>;\n /** `users.remove` \u2014 DELETE /users/{userId}. Remove a user from the app */\n \"remove\"(args: {\n \"userId\": string | number;\n }): Promise<any>;\n /** `users.send` \u2014 POST /users/{userId}/send. Send a realtime message to a member of this app */\n \"send\"(args: {\n \"userId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `users.setRole` \u2014 PUT /users/{userId}/role. Set a user's app role */\n \"setRole\"(args: {\n \"userId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n}\n\n/**\n * The app's database types, model by model \u2014 EMPTY here and filled by the\n * declaration `primitive config push` writes into the config tree's\n * `functions/` directory (#3182). A tree that has pushed once therefore types\n * `ctx.db` against its own schemas; one that has not gets the open form and\n * still compiles.\n */\nexport interface DatabaseSchemas {}\n\n/**\n * The type keys `ctx.db` accepts.\n *\n * Every key the augmentation declares, and NOTHING else, once a tree has\n * pushed: naming a type the app does not have is a compile error. Before that\n * \u2014 an unaugmented tree, a function written before the first push \u2014\n * `DatabaseSchemas` is empty and `keyof` it is `never`, which would make the\n * argument unwritable rather than open. So the empty case widens to `string`\n * and the handle is untyped instead of unusable.\n */\nexport type DatabaseTypeKeys = [keyof DatabaseSchemas] extends [never]\n ? string\n : keyof DatabaseSchemas & string;\n\n/** A model's row shape, or an open record for a type with no schema. */\nexport type DatabaseModels<K extends string> = K extends keyof DatabaseSchemas\n ? DatabaseSchemas[K]\n : Record<string, Record<string, unknown>>;\n\n/**\n * The model names one database type addresses \u2014 its own, or any name at all\n * for a type that declares no schema (the DO is schemaless, so a grant on such\n * a type is legal and there is simply nothing to narrow to).\n */\nexport type DatabaseModelNames<TModels> = [keyof TModels] extends [never]\n ? string\n : keyof TModels & string;\n\n/** One model's row shape, open when the type declares no schema. */\nexport type DatabaseModelRow<TModels, M extends string> =\n M extends keyof TModels ? TModels[M] : Record<string, unknown>;\n\n/**\n * One model of one database, scoped: the `modelName` every records call needs\n * is bound once, so a call names an operation and its own arguments.\n *\n * Filters and options are ordinary objects. Inline filter typing arrives with\n * unified schemas \u2014 the intent's decision, not an omission \u2014 so what is typed\n * today is the model name and the row shape a read hands back.\n */\nexport type ModelScopedBody<TBody = Record<string, unknown>> = TBody & {\n /**\n * Bound by the handle. Reserved so a body cannot look like a second way to\n * choose a model: the runtime assigns the handle's own model last, and a row\n * type that said otherwise would be a lie about what came back.\n */\n modelName?: never;\n};\n\n/**\n * One write inside a model-scoped batch. Every batch verb is a write, so a\n * batch on a model needs that model's write grant whatever the ops are.\n */\nexport type ModelBatchOperation<TRow> = {\n op: \"save\" | \"patch\" | \"delete\" | \"increment\" | \"addToSet\" | \"removeFromSet\";\n id?: string;\n data?: Partial<TRow>;\n /** Bound by the handle, for the same reason every other call's is. */\n modelName?: never;\n [key: string]: unknown;\n};\n\nexport interface DatabaseModelHandle<TRow> {\n query(body?: ModelScopedBody): Promise<{ data: TRow[]; hasMore?: boolean; nextCursor?: string }>;\n count(body?: ModelScopedBody): Promise<any>;\n aggregate(body: ModelScopedBody): Promise<any>;\n save(body: ModelScopedBody<{ id?: string; data: Partial<TRow>; [key: string]: unknown }>): Promise<any>;\n /** Several writes to THIS model in one request; the binding is per item. */\n batch(body: {\n operations: Array<ModelBatchOperation<TRow>>;\n atomic?: boolean;\n }): Promise<any>;\n}\n\n/** One database, typed by the database TYPE key its grant names. */\nexport interface DatabaseHandle<TModels> {\n /** The database this handle addresses \u2014 part of every query cache key. */\n databaseId: string;\n /** The type key this handle was opened with. */\n databaseType: string;\n model<M extends DatabaseModelNames<TModels>>(\n modelName: M\n ): DatabaseModelHandle<DatabaseModelRow<TModels, M>>;\n /**\n * A batch may also SPAN models, and then it names each one itself \u2014 the\n * model-scoped form above is the typed way to write the common case.\n */\n batch(body: {\n operations: Array<Record<string, unknown>>;\n atomic?: boolean;\n }): Promise<any>;\n /** Run one of the database type's prepared operations under this function's grants. */\n runOperation(name: string, params?: Record<string, unknown>): Promise<any>;\n}\n\n/**\n * One call through a granted integration \u2014 #3183.\n *\n * `path` is RELATIVE to the integration's `baseUrl`, and the host is the\n * integration's: the platform resolves and normalizes the path before checking\n * it against `allowedPaths`, so a protocol-relative path or a `..` segment is\n * refused rather than silently sending the request somewhere else.\n */\nexport interface IntegrationCallRequest {\n /** Must be in the integration's `allowedMethods`. Defaults to its own default. */\n method?: string;\n /** Relative to the integration's `baseUrl`. */\n path?: string;\n query?: Record<string, unknown>;\n headers?: Record<string, string>;\n body?: unknown;\n /** form-urlencoded body; not combinable with `body`. */\n form?: Record<string, unknown>;\n bodyMode?: \"json\" | \"raw\" | \"multipart\";\n}\n\n/** What the upstream answered, as the platform saw it. */\nexport interface IntegrationCallResult {\n status: number;\n headers: Record<string, string>;\n body: unknown;\n durationMs: number;\n traceId: string;\n /** Set when the platform or the upstream refused; absent on success. */\n errorCode?: string;\n}\n\n/** What a prompt run is given \u2014 the member execute route's own body. */\nexport interface PromptRunArgs {\n variables?: Record<string, unknown>;\n /** Run against a different model for this call only. */\n modelOverride?: string;\n /** Pin a specific config OF THIS PROMPT; defaults to its active one. */\n configId?: string;\n}\n\n/** The member execute envelope, unchanged on the function path. */\nexport interface PromptRunResult {\n success: boolean;\n output: string;\n error?: string | null;\n metrics?: Record<string, unknown>;\n configId: string;\n}\n\n/** What a send delivered to. */\nexport interface SendResult {\n /** Unique live connections the frame was sent to. Zero is a success. */\n connections: number;\n /** True when the per-user connection ceiling stopped the fanout. */\n truncated: boolean;\n}\n\n/** Who a channel grant is for, and for how long \u2014 #3184. */\nexport interface ChannelAuthorizeOptions {\n /**\n * The member the grant names. Caller mode defaults to the invoking caller;\n * system mode has no caller and must say.\n */\n userId?: string;\n /** Default 300 s, clamped to the platform ceiling of 900 s. */\n ttlSeconds?: number;\n}\n\n/** The credential a client presents on the WebSocket it already has. */\nexport interface ChannelGrantResult {\n channel: string;\n /** The signed grant. Hand it to the client; it is not readable here. */\n grant: string;\n /** Epoch milliseconds. Expiry is the only revocation a channel has. */\n expiresAt: number;\n}\n\nexport interface FunctionContext {\n /** The HTTP caller, or null for a webhook, cron or database-change fire. */\n user: FunctionUser | null;\n trigger: FunctionTrigger;\n api: FunctionApi;\n /**\n * A typed handle over one database. The second argument is the database TYPE\n * key \u2014 the same key a `database:<type>/<model>:read|write` grant names \u2014\n * and it is what selects the models this handle knows (#3182).\n */\n db<K extends DatabaseTypeKeys>(\n databaseId: string,\n databaseType: K\n ): DatabaseHandle<DatabaseModels<K>>;\n /**\n * Outbound HTTP, through a granted integration and nowhere else (#3183).\n *\n * A function has no raw network access: every `fetch` to a host that is not\n * the platform answers `FUNCTION_EGRESS_DENIED`, grant or no grant. What an\n * `integration:<key>` grant buys is this call, which the MAIN WORKER makes on\n * the function's behalf \u2014 which is why the integration's `{{secrets.*}}`\n * credentials can be injected into the request without ever being visible to\n * the code that asked for it.\n */\n integrations: {\n call(\n integrationKey: string,\n request?: IntegrationCallRequest\n ): Promise<IntegrationCallResult>;\n };\n /**\n * Run one of the app's prompts, under a `prompt:<key>` grant (#3183).\n *\n * The prompt's `accessRule` is not consulted \u2014 it states which MEMBERS may\n * execute the prompt from a client, and the grant is what authorizes this\n * call. The provider request is bounded by the invocation's own deadline.\n */\n prompts: {\n run(promptKey: string, args?: PromptRunArgs): Promise<PromptRunResult>;\n };\n /**\n * The value of one app secret, under a `secret:<NAME>` grant (#3183).\n *\n * Prefer `ctx.integrations.call` when the secret is a credential FOR an\n * integration: there the value is injected by the platform and never enters\n * the sandbox at all. This is for the cases an integration cannot express.\n *\n * Rejects with `FUNCTION_SECRET_NOT_FOUND` when the grant names a value\n * this environment has not been given \u2014 secrets are provisioned per\n * environment, out of band from the push.\n */\n secret(name: string): Promise<string>;\n /** The value of one app config var, under a `var:<NAME>` grant (#3183). */\n configVar(name: string): Promise<string>;\n /**\n * Realtime messages to this app's clients, under a `users:send` grant\n * (#3183).\n *\n * The recipient's client receives a `direct.message` frame carrying this\n * payload and the sending function's key. Presence is not guaranteed: a\n * member with no live socket answers `{ connections: 0 }` rather than an\n * error.\n */\n users: {\n send(userId: string, payload: unknown): Promise<SendResult>;\n };\n /** The same frame to ONE connection, under a `connections:send` grant. */\n connections: {\n send(connectionId: string, payload: unknown): Promise<SendResult>;\n };\n /**\n * Realtime channels, under a `channel:<namespace>` grant that COVERS the\n * channel \u2014 #3184.\n *\n * `authorize` hands back a short-lived grant for ONE member to present on\n * the socket it already has; `publish` delivers a `channel.message` frame to\n * every connection that has joined and whose grant has not expired. Expiry is\n * the only revocation, so `expiresAt` comes back for the client to renew\n * ahead of \u2014 a renewal is another authorize and another subscribe.\n */\n channels: {\n authorize(\n channel: string,\n options?: ChannelAuthorizeOptions\n ): Promise<ChannelGrantResult>;\n publish(channel: string, payload: unknown): Promise<SendResult>;\n };\n}\n\n/**\n * The durable step handle \u2014 Cloudflare Workflows' `WorkflowStep`, forwarded\n * untouched, so `step.do` results are memoized and `step.sleep` hibernates.\n *\n * A SYNCHRONOUS invocation gets a passthrough shim of the same shape, so a body\n * written for durable mode runs either way: `do` executes the body (nothing to\n * memoize into without an engine), `sleep` resolves immediately (the sync\n * ceiling is seconds), and `waitForEvent` throws `STEP_NOT_AVAILABLE`.\n */\nexport interface FunctionStep {\n do<T>(name: string, body: () => T | Promise<T>): Promise<T>;\n do<T>(\n name: string,\n config: Record<string, unknown>,\n body: () => T | Promise<T>\n ): Promise<T>;\n sleep(name: string, duration: number | string): Promise<void>;\n sleepUntil(name: string, timestamp: Date | number): Promise<void>;\n waitForEvent<T = unknown>(\n name: string,\n options: Record<string, unknown>\n ): Promise<T>;\n}\n\nexport declare const SDK_STUB_VERSION: string;\n\n/**\n * Declare a server function's handler.\n *\n * Both authoring styles reach the platform bootstrap identically \u2014 a plain\n * default export taking `(input, ctx, step)` runs exactly as a wrapped one\n * does \u2014 so this is a typing and intent marker, not a different calling\n * convention.\n *\n * `step` is the third argument in BOTH modes (#3186). A durable run gets the\n * engine's live `WorkflowStep`; a synchronous one gets a passthrough shim\n * (`do` runs the body, `sleep` resolves at once, `waitForEvent` throws a\n * named error), so a durable-authored body can be exercised synchronously.\n */\nexport declare function defineFunction<TInput = unknown, TOutput = unknown>(\n handler: (\n input: TInput,\n ctx: FunctionContext,\n step: FunctionStep\n ) => TOutput | Promise<TOutput>\n): (\n input: TInput,\n ctx: FunctionContext,\n step: FunctionStep\n) => Promise<TOutput>;\n\n/**\n * One declared parameter of a registered query.\n *\n * `caller: true` (or `type: \"$caller\"`) is the intent's IMMUTABLE binding:\n * the platform injects the invocation's user and refuses a call that supplies\n * the parameter itself.\n */\nexport interface QueryParamSpec {\n type?: \"string\" | \"number\" | \"boolean\" | \"any\" | \"$caller\";\n caller?: boolean;\n optional?: boolean;\n default?: unknown;\n}\n\nexport interface QueryDefinition<TDb, TParams, TResult> {\n /** The models this query touches. Caching is off unless the run matches. */\n models: string[];\n params?: Record<string, QueryParamSpec>;\n /**\n * Cache the answer for `ttlMs` \u2014 capped by the platform, and applied ONLY\n * when the run is verified: every model the body touched was declared, and\n * no prepared operation was used. A write through the handle drops the\n * entries that read the written model.\n */\n cache?: { ttlMs: number };\n run: (db: TDb, params: TParams) => TResult | Promise<TResult>;\n}\n\n/**\n * Register a named query over a database handle (#3187).\n *\n * A registration helper, not a language: `run` is ordinary code over the same\n * typed handle, and what registration adds is a name, declared parameters\n * (validated, coerced and defaulted), the `$caller` binding, and a cache the\n * platform may use when it can verify what the run touched.\n *\n * Register at MODULE scope: a registration made inside the handler still works\n * for direct calls but is invisible to `config push`'s manifest.\n */\nexport declare function defineQuery<\n TDb = DatabaseHandle<any>,\n TParams = Record<string, any>,\n TResult = any\n>(\n name: string,\n definition: QueryDefinition<TDb, TParams, TResult>\n): (db: TDb, params?: Record<string, unknown>) => Promise<TResult>;\n\n/** The same, for a registration that writes. A mutation is never cached. */\nexport declare function defineMutation<\n TDb = DatabaseHandle<any>,\n TParams = Record<string, any>,\n TResult = any\n>(\n name: string,\n definition: QueryDefinition<TDb, TParams, TResult>\n): (db: TDb, params?: Record<string, unknown>) => Promise<TResult>;\n\n/** The platform's cap on a registered query's cache TTL, in milliseconds. */\nexport declare const MAX_QUERY_CACHE_TTL_MS: number;\n\n/**\n * Map over items with BOUNDED concurrency (#3187). Results come back in the\n * input's order; the first rejection wins and nothing new is started after it.\n *\n * The bound matters inside a sandbox: an unbounded fan-out over a page of rows\n * spends the whole subrequest ceiling in one line.\n */\nexport declare function pMap<T, R>(\n items: Iterable<T>,\n mapper: (item: T, index: number) => R | Promise<R>,\n options?: { concurrency?: number }\n): Promise<R[]>;\n\n/** The default concurrency `pMap` applies when none is given. */\nexport declare const PMAP_DEFAULT_CONCURRENCY: number;\n\n/**\n * A time-ordered ULID.\n *\n * GENERATE IT INSIDE `step.do`. A durable run re-executes its handler on\n * every resume and memoizes only what a step returned, so an id minted at the\n * top of a handler is a different id after a sleep \u2014 and whatever it was\n * written into is orphaned.\n */\nexport declare function ulid(): string;\n\n/** One family's durable `step.do` configuration. */\nexport interface StepPolicy {\n retries: { limit: number; delay: string; backoff: string };\n timeout: string;\n}\n\n/**\n * The per-family step policies the DSL runners use, generated from their own\n * timeout module (#3187):\n *\n * await step.do(\"send-receipt\", stepPolicy.email, () =>\n * ctx.api.email.send({ body: { to, subject, htmlBody } }));\n *\n * `retries: 0` on email and the AI families is deliberate \u2014 a retried timeout\n * would send the same email twice or bill the same generation twice.\n */\nexport declare const stepPolicy: {\n email: StepPolicy;\n llm: StepPolicy;\n gemini: StepPolicy;\n database: StepPolicy;\n};\n\ndeclare const _default: {\n SDK_STUB_VERSION: string;\n defineFunction: typeof defineFunction;\n defineQuery: typeof defineQuery;\n defineMutation: typeof defineMutation;\n pMap: typeof pMap;\n ulid: typeof ulid;\n};\nexport default _default;\n";
|
|
12
|
+
export declare const SDK_TYPES_SOURCE = "// GENERATED by scripts/generate-function-profile.mjs from openapi.json.\n// DO NOT EDIT. Run `pnpm functions:profile` and commit the result; the\n// freshness guard in tests/api/spec/function-profile.test.ts fails when this\n// file and a fresh generation diverge.\n\n/**\n * Type surface of `primitive-functions` \u2014 what a server function's author writes\n * against (#3180). The published package's RUNTIME is a stub that throws from\n * every export on purpose: the platform substitutes its own copy at invoke\n * time, and reaching the stub means it did not.\n */\n\n/**\n * The signed-in user who invoked the function over HTTP.\n *\n * Attribution, never authority (#3279): function code acts as the system\n * whoever called it, so this says WHO asked, and the rows the function writes\n * are attributed to them. A trigger fire has no caller and `ctx.user` is\n * null.\n */\nexport interface FunctionUser {\n userId: string;\n email: string | null;\n}\n\n/**\n * What started this invocation. Narrow on `kind`.\n *\n * The same union the runtime builds (`src/server-functions/trigger-descriptor.ts`),\n * held identical by `tests/api/spec/function-trigger-declarations-3281.test.ts`:\n * a field the fire path sets is declared here, and nothing is declared here\n * that the fire path does not set.\n */\nexport type FunctionTrigger =\n /** An HTTP invocation: the caller is `ctx.user`. */\n | { kind: \"http\" }\n /** A verified webhook delivery to the function's own key. */\n | {\n kind: \"webhook\";\n /** The webhook key, which is the function key. */\n webhookKey: string;\n /** The platform's webhook row the delivery log lives under. */\n webhookId: string;\n /** The provider's event id (`X-Webhook-Event-Id`), when it sent one. */\n externalEventId: string | null;\n }\n /** A cron entry firing, scheduled or from the `cron-triggers test` diagnostic. */\n | {\n kind: \"cron\";\n /** The `[[function.triggers.cron]]` entry's `name`. */\n name: string;\n /** The platform's cron row. */\n triggerId: string;\n /** ISO 8601. The instant the fire was scheduled for; a diagnostic fire's is \"now\". */\n scheduledFor: string;\n /** Present, and true, only on the diagnostic fire: nothing was scheduled. */\n manual?: true;\n }\n /** A write to a watched database type. */\n | { kind: \"database\"; databaseId: string; databaseType: string }\n /**\n * A DSL workflow's `workflow.call` step reached this function (#3288).\n *\n * TRANSITIONAL: the bridge exists so a workflow tree can migrate leaf-first\n * during the transition, and it retires with the workflow engine in phase 7,\n * taking this variant with it. `workflowKey` names the PARENT workflow, and\n * `runId`/`stepId` locate the step inside its run.\n */\n | { kind: \"workflow\"; workflowKey: string; runId: string; stepId: string }\n /**\n * Another function started this one with `ctx.functions.start` (#3280).\n *\n * `functionKey` names the PARENT, and `runId` its run \u2014 null when the\n * parent was a request invocation over HTTP, which writes no run row, or a\n * database-change fire, which writes none either.\n */\n | { kind: \"function\"; functionKey: string; runId: string | null };\n\n/** The result shape of an operation that answers in response headers. */\nexport interface HeaderResult {\n status: number;\n headers: Record<string, string>;\n}\n\n/**\n * A platform call that was refused. `errorCode` carries the gateway's own\n * codes (`FUNCTION_ROUTE_NOT_ALLOWED`, `FUNCTION_EGRESS_DENIED`, \u2026) as well\n * as the route's.\n */\nexport interface PrimitivePlatformError extends Error {\n status: number;\n errorCode: string | null;\n}\n\n/**\n * The typed HTTP profile, generated from the platform's OpenAPI document. Its\n * namespaces mirror the operation ids: analytics, blobBuckets, channels, collections, configVars, connections, databaseTypeConfigs, databases, documents, email, functions, gemini, groups, integrations, llm, locks, notifications, prompts, resourceMetadata, secrets, users.\n * Methods take one options object carrying the operation's path parameters,\n * query parameters, request headers (under their wire names) and `body`.\n *\n * Generated from the same operations as the runtime profile, so a method that\n * type-checks is a method the platform publishes \u2014 and a missing path\n * parameter or a missing required header is a compile error rather than a\n * `TypeError` at invoke time. Every call runs with the app's own SYSTEM\n * authority (#3279): the invocation gate was the authorization. The two\n * namespaces the gateway does not admit are still declared: they exist, they\n * answer the gateway's structured denial, and hiding them would make a route's\n * availability look like a typo. Those are `databaseTypeConfigs` whole, and\n * `functions` except for `functions.start` \u2014 the nested-start door #3280\n * admits by name, which `ctx.functions.start` calls. `functions.invoke`\n * stays refused: same-run composition is an import.\n */\nexport interface FunctionApi {\n \"analytics\": {\n /** `analytics.cohortRetention` \u2014 GET /analytics/cohort-retention. Cohort retention metrics */\n \"cohortRetention\"(args?: {\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.dailyActive` \u2014 GET /analytics/daily-active. Daily active user time series */\n \"dailyActive\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.errorGroups` \u2014 GET /analytics/errors/groups. Group failure events by fingerprint with per-day count buckets */\n \"errorGroups\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n \"filter\"?: Record<string, Record<string, string | number | boolean | Array<string | number | boolean>>>;\n }): Promise<any>;\n /** `analytics.integrationUsage` \u2014 GET /analytics/integrations. Integration usage metrics */\n \"integrationUsage\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.listEvents` \u2014 GET /analytics/events. List analytics events */\n \"listEvents\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"page\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n \"filter\"?: Record<string, Record<string, string | number | boolean | Array<string | number | boolean>>>;\n }): Promise<any>;\n /** `analytics.listEventsGrouped` \u2014 GET /analytics/events/grouped. List analytics events grouped by dimension */\n \"listEventsGrouped\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"groupBy\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n \"filter\"?: Record<string, Record<string, string | number | boolean | Array<string | number | boolean>>>;\n }): Promise<any>;\n /** `analytics.overviewDau` \u2014 GET /analytics/overview/dau. Daily active users overview */\n \"overviewDau\"(args?: {\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.overviewGrowth` \u2014 GET /analytics/overview/growth. User growth overview */\n \"overviewGrowth\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.overviewMau` \u2014 GET /analytics/overview/mau. Monthly active users overview */\n \"overviewMau\"(args?: {\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.overviewWau` \u2014 GET /analytics/overview/wau. Weekly active users overview */\n \"overviewWau\"(args?: {\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.rollingActive` \u2014 GET /analytics/rolling-active. Rolling active user time series */\n \"rollingActive\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.searchUsers` \u2014 GET /analytics/users/search. Search app users for analytics */\n \"searchUsers\"(args?: {\n \"q\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"signupDay\"?: string | number | boolean;\n \"signupStartDay\"?: string | number | boolean;\n \"signupEndDay\"?: string | number | boolean;\n \"offset\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.topPrompts` \u2014 GET /analytics/prompts/top. List the most-executed prompts */\n \"topPrompts\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.topUsers` \u2014 GET /analytics/users/top. List the most active users */\n \"topUsers\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.topWorkflows` \u2014 GET /analytics/workflows/top. List the most-run workflows */\n \"topWorkflows\"(args?: {\n \"windowDays\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.userDetail` \u2014 GET /analytics/users/{userUlid}/detail. Detailed analytics for a single user */\n \"userDetail\"(args: {\n \"userUlid\": string | number;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.userSnapshot` \u2014 GET /analytics/users/{userUlid}/snapshot. Activity snapshot for a single user */\n \"userSnapshot\"(args: {\n \"userUlid\": string | number;\n \"current_timestamp\"?: string | number | boolean;\n \"_bust\"?: string | number | boolean;\n }): Promise<any>;\n /** `analytics.writeForUser` \u2014 POST /analytics/write-for-user. Write an analytics event for a subject user under a grant */\n \"writeForUser\"(args: {\n body: unknown;\n }): Promise<any>;\n };\n \"blobBuckets\": {\n /** `blobBuckets.createBucket` \u2014 POST /blob-buckets. Create a blob bucket */\n \"createBucket\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `blobBuckets.delete` \u2014 DELETE /blob-buckets/{bucketId}/blobs/{blobId}. Delete a blob */\n \"delete\"(args: {\n \"bucketId\": string | number;\n \"blobId\": string | number;\n }): Promise<any>;\n /** `blobBuckets.deleteBatch` \u2014 POST /blob-buckets/{bucketId}/blobs/delete. Batch delete blobs from a bucket */\n \"deleteBatch\"(args: {\n \"bucketId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `blobBuckets.deleteBucket` \u2014 DELETE /blob-buckets/{bucketId}. Delete a blob bucket */\n \"deleteBucket\"(args: {\n \"bucketId\": string | number;\n }): Promise<any>;\n /** `blobBuckets.download` \u2014 GET /blob-buckets/{bucketId}/blobs/{blobId}. Download a blob (anonymous allowed for public buckets) */\n \"download\"(args: {\n \"bucketId\": string | number;\n \"blobId\": string | number;\n \"disposition\"?: string | number | boolean;\n }): Promise<Uint8Array>;\n /** `blobBuckets.downloadSigned` \u2014 GET /blob-buckets/{bucketId}/blobs/{blobId}/signed. Download a blob via a signed URL token */\n \"downloadSigned\"(args: {\n \"bucketId\": string | number;\n \"blobId\": string | number;\n \"token\"?: string | number | boolean;\n }): Promise<Uint8Array>;\n /** `blobBuckets.getBucket` \u2014 GET /blob-buckets/{bucketId}. Get a blob bucket by id */\n \"getBucket\"(args: {\n \"bucketId\": string | number;\n }): Promise<any>;\n /** `blobBuckets.getMetadata` \u2014 GET /blob-buckets/{bucketId}/blobs/{blobId}/metadata. Get blob metadata (anonymous allowed for public buckets) */\n \"getMetadata\"(args: {\n \"bucketId\": string | number;\n \"blobId\": string | number;\n }): Promise<any>;\n /** `blobBuckets.getSignedUrl` \u2014 POST /blob-buckets/{bucketId}/blobs/{blobId}/signed-url. Create a signed download URL for a blob */\n \"getSignedUrl\"(args: {\n \"bucketId\": string | number;\n \"blobId\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `blobBuckets.list` \u2014 GET /blob-buckets/{bucketId}/blobs. List blobs in a bucket (anonymous allowed for public buckets) */\n \"list\"(args: {\n \"bucketId\": string | number;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `blobBuckets.listBuckets` \u2014 GET /blob-buckets. List blob buckets */\n \"listBuckets\"(args?: Record<string, never>): Promise<any>;\n /** `blobBuckets.updateBucket` \u2014 PATCH /blob-buckets/{bucketId}. Update a blob bucket */\n \"updateBucket\"(args: {\n \"bucketId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `blobBuckets.upload` \u2014 POST /blob-buckets/{bucketId}/blobs. Upload a blob to a bucket */\n \"upload\"(args: {\n \"bucketId\": string | number;\n \"X-Blob-Filename\": string | number;\n \"X-Blob-Tags\"?: string | number;\n \"Content-Type\"?: string | number;\n body: ArrayBuffer | Uint8Array | string;\n }): Promise<any>;\n };\n \"channels\": {\n /** `channels.authorize` \u2014 POST /channels/{channel}/grants. Issue a channel grant under a server function's grant */\n \"authorize\"(args: {\n \"channel\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `channels.publish` \u2014 POST /channels/{channel}/publish. Publish a message to a channel under a server function's grant */\n \"publish\"(args: {\n \"channel\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"collections\": {\n /** `collections.addDocument` \u2014 POST /collections/{collectionId}/documents. Add a document to a collection */\n \"addDocument\"(args: {\n \"collectionId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `collections.addMember` \u2014 POST /collections/{collectionId}/members. Add a member to a collection */\n \"addMember\"(args: {\n \"collectionId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `collections.create` \u2014 POST /collections. Create a collection */\n \"create\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `collections.delete` \u2014 DELETE /collections/{collectionId}. Delete a collection */\n \"delete\"(args: {\n \"collectionId\": string | number;\n }): Promise<any>;\n /** `collections.get` \u2014 GET /collections/{collectionId}. Get a collection by id */\n \"get\"(args: {\n \"collectionId\": string | number;\n }): Promise<any>;\n /** `collections.getAccess` \u2014 GET /collections/{collectionId}/access. Get a collection's access summary */\n \"getAccess\"(args: {\n \"collectionId\": string | number;\n }): Promise<any>;\n /** `collections.grantGroupPermission` \u2014 POST /collections/{collectionId}/group-permissions. Grant a group permission on a collection */\n \"grantGroupPermission\"(args: {\n \"collectionId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `collections.list` \u2014 GET /collections. List collections */\n \"list\"(args?: {\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `collections.listCollectionsForDocument` \u2014 GET /documents/{documentId}/collections. List collections a document belongs to (reverse lookup) */\n \"listCollectionsForDocument\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `collections.listDocuments` \u2014 GET /collections/{collectionId}/documents. List documents in a collection */\n \"listDocuments\"(args: {\n \"collectionId\": string | number;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `collections.listPendingInvitations` \u2014 GET /collections/{collectionId}/pending-invitations. List a collection's pending invitations */\n \"listPendingInvitations\"(args: {\n \"collectionId\": string | number;\n }): Promise<any>;\n /** `collections.removeDocument` \u2014 DELETE /collections/{collectionId}/documents/{documentId}. Remove a document from a collection */\n \"removeDocument\"(args: {\n \"collectionId\": string | number;\n \"documentId\": string | number;\n }): Promise<any>;\n /** `collections.removeMember` \u2014 DELETE /collections/{collectionId}/members/{userId}. Remove a member from a collection */\n \"removeMember\"(args: {\n \"collectionId\": string | number;\n \"userId\": string | number;\n }): Promise<any>;\n /** `collections.revokeGroupPermission` \u2014 DELETE /collections/{collectionId}/group-permissions/{groupType}/{groupId}. Revoke a group permission on a collection */\n \"revokeGroupPermission\"(args: {\n \"collectionId\": string | number;\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `collections.update` \u2014 PATCH /collections/{collectionId}. Update a collection */\n \"update\"(args: {\n \"collectionId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"configVars\": {\n /** `configVars.get` \u2014 GET /config-vars/{name}. Read an app config var under a server function's grants */\n \"get\"(args: {\n \"name\": string | number;\n }): Promise<any>;\n };\n \"connections\": {\n /** `connections.send` \u2014 POST /connections/{connectionId}/send. Send a realtime message to one connection of this app */\n \"send\"(args: {\n \"connectionId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"databaseTypeConfigs\": {\n /** `databaseTypeConfigs.create` \u2014 POST /databases/types. Create a database type */\n \"create\"(args: {\n \"dryRun\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n /** `databaseTypeConfigs.createOperation` \u2014 POST /databases/types/{databaseType}/operations. Create an operation for a database type */\n \"createOperation\"(args: {\n \"databaseType\": string | number;\n \"dryRun\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n /** `databaseTypeConfigs.delete` \u2014 DELETE /databases/types/{databaseType}. Delete a database type */\n \"delete\"(args: {\n \"databaseType\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.deleteOperation` \u2014 DELETE /databases/types/{databaseType}/operations/{name}. Delete an operation for a database type */\n \"deleteOperation\"(args: {\n \"databaseType\": string | number;\n \"name\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.get` \u2014 GET /databases/types/{databaseType}. Get a database type */\n \"get\"(args: {\n \"databaseType\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.getOperation` \u2014 GET /databases/types/{databaseType}/operations/{name}. Get an operation for a database type */\n \"getOperation\"(args: {\n \"databaseType\": string | number;\n \"name\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.getReindexStatus` \u2014 GET /databases/types/{databaseType}/reindex-status. Status of the index back-provision fan-out for a type */\n \"getReindexStatus\"(args: {\n \"databaseType\": string | number;\n \"runId\"?: string | number | boolean;\n }): Promise<any>;\n /** `databaseTypeConfigs.list` \u2014 GET /databases/types. List database types */\n \"list\"(args?: Record<string, never>): Promise<any>;\n /** `databaseTypeConfigs.listOperations` \u2014 GET /databases/types/{databaseType}/operations. List operations for a database type */\n \"listOperations\"(args: {\n \"databaseType\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.scaffoldSchema` \u2014 POST /databases/types/{databaseType}/schema:scaffold. Scaffold a starter schema for a database type */\n \"scaffoldSchema\"(args: {\n \"databaseType\": string | number;\n }): Promise<any>;\n \"subscriptions\": {\n /** `databaseTypeConfigs.subscriptions.create` \u2014 POST /databases/types/{databaseType}/subscriptions. Create a subscription for a database type */\n \"create\"(args: {\n \"databaseType\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databaseTypeConfigs.subscriptions.delete` \u2014 DELETE /databases/types/{databaseType}/subscriptions/{subscriptionKey}. Delete a database type subscription */\n \"delete\"(args: {\n \"databaseType\": string | number;\n \"subscriptionKey\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.subscriptions.get` \u2014 GET /databases/types/{databaseType}/subscriptions/{subscriptionKey}. Get a database type subscription */\n \"get\"(args: {\n \"databaseType\": string | number;\n \"subscriptionKey\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.subscriptions.list` \u2014 GET /databases/types/{databaseType}/subscriptions. List subscriptions for a database type */\n \"list\"(args: {\n \"databaseType\": string | number;\n }): Promise<any>;\n /** `databaseTypeConfigs.subscriptions.update` \u2014 PUT /databases/types/{databaseType}/subscriptions/{subscriptionKey}. Update a database type subscription */\n \"update\"(args: {\n \"databaseType\": string | number;\n \"subscriptionKey\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n /** `databaseTypeConfigs.update` \u2014 PATCH /databases/types/{databaseType}. Update a database type */\n \"update\"(args: {\n \"databaseType\": string | number;\n \"dryRun\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n /** `databaseTypeConfigs.updateOperation` \u2014 PATCH /databases/types/{databaseType}/operations/{name}. Update an operation for a database type */\n \"updateOperation\"(args: {\n \"databaseType\": string | number;\n \"name\": string | number;\n \"dryRun\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n };\n \"databases\": {\n /** `databases.addManager` \u2014 PUT /databases/{databaseId}/permissions. Set a user's database permission */\n \"addManager\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n \"adminData\": {\n /** `databases.adminData.batch` \u2014 POST /databases/{databaseId}/admin-data/batch. DEPRECATED \u2014 direct database batch; use databases/{databaseId}/records/batch */\n \"batch\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.adminData.count` \u2014 POST /databases/{databaseId}/admin-data/count. DEPRECATED \u2014 direct database count; use databases/{databaseId}/records/count */\n \"count\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.adminData.delete` \u2014 POST /databases/{databaseId}/admin-data/delete. DEPRECATED \u2014 direct database delete; use databases/{databaseId}/records/delete */\n \"delete\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.adminData.patch` \u2014 POST /databases/{databaseId}/admin-data/patch. DEPRECATED \u2014 direct database patch; use databases/{databaseId}/records/patch */\n \"patch\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.adminData.query` \u2014 POST /databases/{databaseId}/admin-data/query. DEPRECATED \u2014 direct database query; use databases/{databaseId}/records/query */\n \"query\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.adminData.save` \u2014 POST /databases/{databaseId}/admin-data/save. DEPRECATED \u2014 direct database save; use databases/{databaseId}/records/save */\n \"save\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n /** `databases.create` \u2014 POST /databases. Create a database */\n \"create\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `databases.delete` \u2014 DELETE /databases/{databaseId}. Delete a database */\n \"delete\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.executeBatch` \u2014 POST /databases/{databaseId}/operations/{name}/batch. Execute a database operation in batch */\n \"executeBatch\"(args: {\n \"databaseId\": string | number;\n \"name\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.executeOperation` \u2014 POST /databases/{databaseId}/operations/{name}/execute. Execute a database operation */\n \"executeOperation\"(args: {\n \"databaseId\": string | number;\n \"name\": string | number;\n \"dryRun\"?: string | number | boolean;\n body?: unknown;\n }): Promise<any>;\n /** `databases.get` \u2014 GET /databases/{databaseId}. Get a database by id */\n \"get\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.getMetadata` \u2014 GET /databases/{databaseId}/metadata. Get database metadata */\n \"getMetadata\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.grantGroupPermission` \u2014 POST /databases/{databaseId}/group-permissions. Grant a group permission on a database */\n \"grantGroupPermission\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.importBulk` \u2014 POST /databases/{databaseId}/operations/{name}/import-bulk. Bulk-import records via a database operation */\n \"importBulk\"(args: {\n \"databaseId\": string | number;\n \"name\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.list` \u2014 GET /databases. List databases */\n \"list\"(args?: Record<string, never>): Promise<any>;\n /** `databases.listGroupPermissions` \u2014 GET /databases/{databaseId}/group-permissions. List a database's group permissions */\n \"listGroupPermissions\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.listOperations` \u2014 GET /databases/{databaseId}/operations. List operations runnable on a database */\n \"listOperations\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.listPermissions` \u2014 GET /databases/{databaseId}/permissions. List a database's user permissions */\n \"listPermissions\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n \"records\": {\n /** `databases.records.addToSet` \u2014 POST /databases/{databaseId}/records/stringset/add. Database records: stringset/add (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"addToSet\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.aggregate` \u2014 POST /databases/{databaseId}/records/aggregate. Database records: aggregate (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"aggregate\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.batch` \u2014 POST /databases/{databaseId}/records/batch. Database records: batch (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"batch\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.count` \u2014 POST /databases/{databaseId}/records/count. Database records: count (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"count\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.delete` \u2014 POST /databases/{databaseId}/records/delete. Database records: delete (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"delete\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.describe` \u2014 GET /databases/{databaseId}/records/describe. Database records: describe (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"describe\"(args: {\n \"databaseId\": string | number;\n \"modelName\"?: string | number | boolean;\n }): Promise<any>;\n /** `databases.records.dropIndex` \u2014 POST /databases/{databaseId}/records/index/drop. Database records: index/drop (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"dropIndex\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.dropUniqueConstraint` \u2014 POST /databases/{databaseId}/records/unique-constraint/drop. Database records: unique-constraint/drop (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"dropUniqueConstraint\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.increment` \u2014 POST /databases/{databaseId}/records/increment. Database records: increment (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"increment\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.listIndexes` \u2014 GET /databases/{databaseId}/records/indexes. Database records: indexes (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"listIndexes\"(args: {\n \"databaseId\": string | number;\n \"modelName\"?: string | number | boolean;\n }): Promise<any>;\n /** `databases.records.listUniqueConstraints` \u2014 GET /databases/{databaseId}/records/unique-constraints. Database records: unique-constraints (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"listUniqueConstraints\"(args: {\n \"databaseId\": string | number;\n \"modelName\"?: string | number | boolean;\n }): Promise<any>;\n /** `databases.records.models` \u2014 GET /databases/{databaseId}/records/models. Database records: models (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"models\"(args: {\n \"databaseId\": string | number;\n \"modelName\"?: string | number | boolean;\n }): Promise<any>;\n /** `databases.records.patch` \u2014 POST /databases/{databaseId}/records/patch. Database records: patch (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"patch\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.query` \u2014 POST /databases/{databaseId}/records/query. Database records: query (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"query\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<{ items: any[]; hasMore: boolean; nextCursor?: string; prevCursor?: string }>;\n /** `databases.records.registerIndex` \u2014 POST /databases/{databaseId}/records/index/register. Database records: index/register (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"registerIndex\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.registerUniqueConstraint` \u2014 POST /databases/{databaseId}/records/unique-constraint/register. Database records: unique-constraint/register (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"registerUniqueConstraint\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.removeFromSet` \u2014 POST /databases/{databaseId}/records/stringset/remove. Database records: stringset/remove (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"removeFromSet\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.save` \u2014 POST /databases/{databaseId}/records/save. Database records: save (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"save\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.records.syncIndexes` \u2014 POST /databases/{databaseId}/records/indexes/sync. Database records: indexes/sync (requires manager-or-higher on the database, or an app-admin/owner role) */\n \"syncIndexes\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n /** `databases.reindex` \u2014 POST /databases/{databaseId}/reindex. Reindex a database */\n \"reindex\"(args: {\n \"databaseId\": string | number;\n }): Promise<any>;\n /** `databases.revokeGroupPermission` \u2014 DELETE /databases/{databaseId}/group-permissions/{groupType}/{groupId}. Revoke a group permission on a database */\n \"revokeGroupPermission\"(args: {\n \"databaseId\": string | number;\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `databases.revokePermission` \u2014 DELETE /databases/{databaseId}/permissions/{userId}. Remove a user's database permission */\n \"revokePermission\"(args: {\n \"databaseId\": string | number;\n \"userId\": string | number;\n }): Promise<any>;\n /** `databases.runOperation` \u2014 POST /databases/{databaseId}/operations/{name}/run. Run a database operation under a server function's grants */\n \"runOperation\"(args: {\n \"databaseId\": string | number;\n \"name\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `databases.transferOwnership` \u2014 POST /databases/{databaseId}/permissions/transfer. Transfer database ownership */\n \"transferOwnership\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.update` \u2014 PATCH /databases/{databaseId}. Update a database */\n \"update\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `databases.updateMetadata` \u2014 PATCH /databases/{databaseId}/metadata. Update database metadata */\n \"updateMetadata\"(args: {\n \"databaseId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"documents\": {\n /** `documents.addTag` \u2014 POST /documents/{documentId}/tags. Add a tag to a document */\n \"addTag\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n \"aliases\": {\n /** `documents.aliases.delete` \u2014 DELETE /document-aliases/{scope}/{aliasKey}. Delete a (scope, aliasKey) document alias binding */\n \"delete\"(args: {\n \"scope\": string | number;\n \"aliasKey\": string | number;\n }): Promise<any>;\n /** `documents.aliases.listForDocument` \u2014 GET /documents/{documentId}/aliases. List aliases bound to a document */\n \"listForDocument\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.aliases.resolve` \u2014 GET /document-aliases/{scope}/{aliasKey}. Resolve the document bound to a (scope, aliasKey) alias */\n \"resolve\"(args: {\n \"scope\": string | number;\n \"aliasKey\": string | number;\n }): Promise<any>;\n /** `documents.aliases.set` \u2014 PUT /document-aliases/{scope}/{aliasKey}. Bind a (scope, aliasKey) alias to a document */\n \"set\"(args: {\n \"scope\": string | number;\n \"aliasKey\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n /** `documents.approveAccessRequest` \u2014 POST /documents/{documentId}/access-requests/{requestId}/approve. Approve a document access request */\n \"approveAccessRequest\"(args: {\n \"documentId\": string | number;\n \"requestId\": string | number;\n body?: unknown;\n }): Promise<any>;\n \"blobs\": {\n /** `documents.blobs.delete` \u2014 DELETE /documents/{documentId}/blobs/{blobId}. Delete a document blob */\n \"delete\"(args: {\n \"documentId\": string | number;\n \"blobId\": string | number;\n }): Promise<any>;\n /** `documents.blobs.downloadHeaders` \u2014 HEAD /documents/{documentId}/blobs/{blobId}/download. Get document blob download headers (ETag/304 support) */\n \"downloadHeaders\"(args: {\n \"documentId\": string | number;\n \"blobId\": string | number;\n }): Promise<HeaderResult>;\n /** `documents.blobs.downloadUrl` \u2014 GET /documents/{documentId}/blobs/{blobId}/download. Download a document blob's bytes */\n \"downloadUrl\"(args: {\n \"documentId\": string | number;\n \"blobId\": string | number;\n \"disposition\"?: string | number | boolean;\n }): Promise<Uint8Array>;\n /** `documents.blobs.get` \u2014 GET /documents/{documentId}/blobs/{blobId}. Get a document blob's metadata */\n \"get\"(args: {\n \"documentId\": string | number;\n \"blobId\": string | number;\n }): Promise<any>;\n /** `documents.blobs.list` \u2014 GET /documents/{documentId}/blobs. List blobs attached to a document */\n \"list\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.blobs.upload` \u2014 PUT /documents/{documentId}/blobs/{blobId}. Upload a document blob with a client-specified id (immutable + idempotent) */\n \"upload\"(args: {\n \"documentId\": string | number;\n \"blobId\": string | number;\n \"X-Blob-Filename\": string | number;\n \"X-Blob-Size\": string | number;\n \"X-Blob-Sha256\": string | number;\n body: ArrayBuffer | Uint8Array | string;\n }): Promise<any>;\n /** `documents.blobs.uploadWithoutId` \u2014 PUT /documents/{documentId}/blobs. Deprecated: upload a document blob without a client-specified id */\n \"uploadWithoutId\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n };\n /** `documents.clearLinkAccess` \u2014 DELETE /documents/{documentId}/link-access. Turn off the document's link access */\n \"clearLinkAccess\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.create` \u2014 POST /documents. Create a new document */\n \"create\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `documents.createWithAlias` \u2014 POST /documents/create-with-alias. Create a document and bind it to an alias */\n \"createWithAlias\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `documents.debugDumpUpdates` \u2014 POST /documents/{documentId}/debug/dump-updates. Dump a document's raw CRDT update log (debug) */\n \"debugDumpUpdates\"(args: {\n \"documentId\": string | number;\n \"limit\"?: string | number | boolean;\n \"offset\"?: string | number | boolean;\n \"includeData\"?: string | number | boolean;\n \"includeR2Data\"?: string | number | boolean;\n body?: unknown;\n }): Promise<any>;\n /** `documents.debugMerge` \u2014 POST /documents/{documentId}/debug/merge. Force-merge a document's pending updates (debug) */\n \"debugMerge\"(args: {\n \"documentId\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `documents.debugMergeBlock` \u2014 POST /documents/{documentId}/debug/merge-block. Merge a specific update block of a document (debug) */\n \"debugMergeBlock\"(args: {\n \"documentId\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `documents.debugRestore` \u2014 POST /documents/debug/restore. Restore a document from a prior state snapshot (debug) */\n \"debugRestore\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `documents.debugStats` \u2014 GET /documents/{documentId}/debug/stats. Get document storage/update stats (debug) */\n \"debugStats\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.delete` \u2014 DELETE /documents/{documentId}. Delete a document */\n \"delete\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.denyAccessRequest` \u2014 POST /documents/{documentId}/access-requests/{requestId}/deny. Deny a document access request */\n \"denyAccessRequest\"(args: {\n \"documentId\": string | number;\n \"requestId\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `documents.exportChain` \u2014 GET /documents/{documentId}/export/chain. Export chain of a large document (snapshot + sealed overlays + open epoch) */\n \"exportChain\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.exportState` \u2014 GET /documents/{documentId}/export/state. Export a document's encoded CRDT state */\n \"exportState\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.get` \u2014 GET /documents/{documentId}. Get a single document by id */\n \"get\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.getImportChainStatus` \u2014 GET /documents/{documentId}/import/chain. How far a large document's chain import has got */\n \"getImportChainStatus\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.getLinkAccess` \u2014 GET /documents/{documentId}/link-access. Get the document's \"anyone with the link\" access level */\n \"getLinkAccess\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.getOrCreateWithAlias` \u2014 POST /documents/get-or-create-with-alias. Get the document bound to an alias, creating it if absent (idempotent) */\n \"getOrCreateWithAlias\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `documents.getPermissions` \u2014 GET /documents/{documentId}/permissions. List a document's user permissions */\n \"getPermissions\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.getSchema` \u2014 GET /documents/{documentId}/schema. Introspect a document's model schema */\n \"getSchema\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.getStats` \u2014 GET /documents/{documentId}/stats. Document statistics (record/model/blob counts, approximate size) */\n \"getStats\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.grantGroupPermission` \u2014 POST /documents/{documentId}/group-permissions. Grant a group permission on a document */\n \"grantGroupPermission\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.importChain` \u2014 POST /documents/{documentId}/import/chain. Install an uploaded chain into a large document */\n \"importChain\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.importChainArtifact` \u2014 POST /documents/{documentId}/import/chain/artifact. Upload one artifact of a large document's import chain */\n \"importChainArtifact\"(args: {\n \"documentId\": string | number;\n \"kind\"?: string | number | boolean;\n \"epoch\"?: string | number | boolean;\n \"buildId\"?: string | number | boolean;\n \"model\"?: string | number | boolean;\n \"index\"?: string | number | boolean;\n body: ArrayBuffer | Uint8Array | string;\n }): Promise<any>;\n /** `documents.importState` \u2014 POST /documents/{documentId}/import/state. Import encoded CRDT state into a document */\n \"importState\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.listAccessRequests` \u2014 GET /documents/{documentId}/access-requests. List access requests for a document */\n \"listAccessRequests\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.listGroupPermissions` \u2014 GET /documents/{documentId}/group-permissions. List a document's group permissions */\n \"listGroupPermissions\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.listPendingInvitations` \u2014 GET /documents/{documentId}/pending-invitations. List a document's pending (deferred) invitations */\n \"listPendingInvitations\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n /** `documents.open` \u2014 POST /documents/open. Open a document for collaboration (resolves access + alias) */\n \"open\"(args: {\n body: unknown;\n }): Promise<any>;\n \"records\": {\n /** `documents.records.aggregate` \u2014 POST /documents/{documentId}/records/{model}/aggregate. Aggregate records in a document model (count/sum/avg/min/max, optional grouping) */\n \"aggregate\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.records.bulk` \u2014 POST /documents/{documentId}/records/bulk. Apply an atomic multi-model record blob to a document (create/patch/delete) */\n \"bulk\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.records.count` \u2014 GET /documents/{documentId}/records/{model}/count. Count records in a document model */\n \"count\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n \"filter\"?: Record<string, unknown> | string;\n }): Promise<any>;\n /** `documents.records.delete` \u2014 DELETE /documents/{documentId}/records/{model}/{recordId}. Delete a record from a document model */\n \"delete\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n \"recordId\": string | number;\n }): Promise<any>;\n /** `documents.records.patch` \u2014 PATCH /documents/{documentId}/records/{model}/{recordId}. Merge fields into an existing record in a document model */\n \"patch\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n \"recordId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.records.query` \u2014 GET /documents/{documentId}/records/{model}. Query records in a document model */\n \"query\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n \"filter\"?: Record<string, unknown> | string;\n }): Promise<any>;\n /** `documents.records.save` \u2014 POST /documents/{documentId}/records/{model}. Create or replace a record in a document model */\n \"save\"(args: {\n \"documentId\": string | number;\n \"model\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n /** `documents.removePermissionByEmail` \u2014 DELETE /documents/{documentId}/permissions. Revoke a user's permission on a document by email (?email=) */\n \"removePermissionByEmail\"(args: {\n \"documentId\": string | number;\n \"email\"?: string | number | boolean;\n }): Promise<any>;\n /** `documents.removePermissionByUserId` \u2014 DELETE /documents/{documentId}/permissions/{userId}. Revoke a user's permission on a document by user id */\n \"removePermissionByUserId\"(args: {\n \"documentId\": string | number;\n \"userId\": string | number;\n }): Promise<any>;\n /** `documents.removeTag` \u2014 DELETE /documents/{documentId}/tags/{tag}. Remove a tag from a document */\n \"removeTag\"(args: {\n \"documentId\": string | number;\n \"tag\": string | number;\n }): Promise<any>;\n /** `documents.requestAccess` \u2014 POST /documents/{documentId}/access-requests. Request access to a document */\n \"requestAccess\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.revokeGroupPermission` \u2014 DELETE /documents/{documentId}/group-permissions/{groupType}/{groupId}. Revoke a group permission on a document */\n \"revokeGroupPermission\"(args: {\n \"documentId\": string | number;\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `documents.setLinkAccess` \u2014 PUT /documents/{documentId}/link-access. Set the document's \"anyone with the link\" access level */\n \"setLinkAccess\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.transferOwnership` \u2014 POST /documents/{documentId}/permissions/transfer. Transfer ownership of a document to another user */\n \"transferOwnership\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.update` \u2014 PUT /documents/{documentId}. Update a document's metadata */\n \"update\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.updatePermissions` \u2014 PUT /documents/{documentId}/permissions. Grant or update a user's permission on a document */\n \"updatePermissions\"(args: {\n \"documentId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `documents.validateAccess` \u2014 POST /documents/{documentId}/validate-access. Resolve the caller's effective access level for a document */\n \"validateAccess\"(args: {\n \"documentId\": string | number;\n }): Promise<any>;\n };\n \"email\": {\n /** `email.send` \u2014 POST /emails/send. Send an application email under a server function's grant */\n \"send\"(args: {\n body: unknown;\n }): Promise<any>;\n };\n \"functions\": {\n /** `functions.invoke` \u2014 POST /functions/{functionKey}. Invoke a server function: a request function returns its result, a task function starts a run */\n \"invoke\"(args: {\n \"functionKey\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `functions.logs` \u2014 GET /functions/{functionKey}/logs. List a server function's invocation logs, newest first */\n \"logs\"(args: {\n \"functionKey\": string | number;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `functions.start` \u2014 POST /functions/{functionKey}/start. Start a task function from inside another server function */\n \"start\"(args: {\n \"functionKey\": string | number;\n body?: unknown;\n }): Promise<any>;\n };\n \"gemini\": {\n /** `gemini.countTokens` \u2014 POST /gemini/count-tokens. Count tokens for a Gemini request */\n \"countTokens\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `gemini.generate` \u2014 POST /gemini/generate. Generate content with Gemini */\n \"generate\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `gemini.generateRaw` \u2014 POST /gemini/generate-raw. Generate content with Gemini (raw passthrough) */\n \"generateRaw\"(args: {\n \"model\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n /** `gemini.models` \u2014 GET /gemini/models. List available Gemini models */\n \"models\"(args?: Record<string, never>): Promise<any>;\n };\n \"groups\": {\n /** `groups.addMember` \u2014 POST /groups/{groupType}/{groupId}/members. Add a member to a group */\n \"addMember\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `groups.create` \u2014 POST /groups. Create a group */\n \"create\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `groups.delete` \u2014 DELETE /groups/{groupType}/{groupId}. Delete a group */\n \"delete\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `groups.get` \u2014 GET /groups/{groupType}/{groupId}. Get a group by type and id */\n \"get\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `groups.list` \u2014 GET /groups. List groups */\n \"list\"(args?: {\n \"type\"?: string | number | boolean;\n \"includeSystem\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `groups.listDatabases` \u2014 GET /groups/{groupType}/{groupId}/databases. List databases shared with a group */\n \"listDatabases\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `groups.listDocuments` \u2014 GET /groups/{groupType}/{groupId}/documents. List documents shared with a group */\n \"listDocuments\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `groups.listMembers` \u2014 GET /groups/{groupType}/{groupId}/members. List a group's members */\n \"listMembers\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n \"include\"?: string | number | boolean;\n }): Promise<any>;\n /** `groups.listPendingInvitations` \u2014 GET /groups/{groupType}/{groupId}/pending-invitations. List a group's pending invitations */\n \"listPendingInvitations\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n }): Promise<any>;\n /** `groups.listUserMemberships` \u2014 GET /users/{userId}/memberships. List a user's group memberships */\n \"listUserMemberships\"(args: {\n \"userId\": string | number;\n \"includeSystem\"?: string | number | boolean;\n \"type\"?: string | number | boolean;\n }): Promise<any>;\n /** `groups.removeMember` \u2014 DELETE /groups/{groupType}/{groupId}/members/{userId}. Remove a specific member from a group */\n \"removeMember\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n \"userId\": string | number;\n }): Promise<any>;\n /** `groups.removeMemberByEmail` \u2014 DELETE /groups/{groupType}/{groupId}/members. Remove a group member or pending invitation by email */\n \"removeMemberByEmail\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n \"email\"?: string | number | boolean;\n }): Promise<any>;\n /** `groups.update` \u2014 PATCH /groups/{groupType}/{groupId}. Update a group */\n \"update\"(args: {\n \"groupType\": string | number;\n \"groupId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"integrations\": {\n /** `integrations.call` \u2014 POST /integrations/{integrationKey}/call. Call an integration under a server function's grants */\n \"call\"(args: {\n \"integrationKey\": string | number;\n body?: unknown;\n }): Promise<any>;\n /** `integrations.list` \u2014 GET /integrations. List integrations configured for the app */\n \"list\"(args?: Record<string, never>): Promise<any>;\n /** `integrations.proxy` \u2014 POST /integrations/{integrationKey}/proxy. Proxy a request through a configured integration */\n \"proxy\"(args: {\n \"integrationKey\": string | number;\n }): Promise<any>;\n };\n \"llm\": {\n /** `llm.chat` \u2014 POST /llm/chat. Run an LLM chat completion */\n \"chat\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `llm.models` \u2014 GET /llm/models. List available LLM models */\n \"models\"(args?: Record<string, never>): Promise<any>;\n };\n \"locks\": {\n /** `locks.list` \u2014 GET /locks. List all currently-held named locks in the app */\n \"list\"(args?: Record<string, never>): Promise<any>;\n /** `locks.release` \u2014 POST /locks/release. Release a held named lock (requires the acquire handle) */\n \"release\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `locks.renew` \u2014 POST /locks/renew. Extend the lease on a held named lock */\n \"renew\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `locks.status` \u2014 POST /locks/status. Report the current holder of a named lock */\n \"status\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `locks.tryAcquire` \u2014 POST /locks/acquire. Attempt to acquire a named lock (single non-blocking attempt) */\n \"tryAcquire\"(args: {\n body: unknown;\n }): Promise<any>;\n };\n \"notifications\": {\n /** `notifications.list` \u2014 GET /notifications. List the caller's in-app notification inbox (newest first) */\n \"list\"(args?: {\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `notifications.listDevices` \u2014 GET /me/push-tokens. List the caller's registered push devices */\n \"listDevices\"(args?: Record<string, never>): Promise<any>;\n /** `notifications.markAllRead` \u2014 POST /notifications/read-all. Mark all of the caller's notifications as read */\n \"markAllRead\"(args?: Record<string, never>): Promise<any>;\n /** `notifications.markRead` \u2014 PATCH /notifications/{notificationId}/read. Mark one of the caller's notifications as read */\n \"markRead\"(args: {\n \"notificationId\": string | number;\n }): Promise<any>;\n /** `notifications.registerDevice` \u2014 POST /me/push-tokens. Register (upsert) the caller's device push token */\n \"registerDevice\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `notifications.send` \u2014 POST /notifications/send. Send a notification to an app user (durable in-app inbox row + live WS frame) */\n \"send\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `notifications.unreadCount` \u2014 GET /notifications/unread-count. Count the caller's unread notifications */\n \"unreadCount\"(args?: Record<string, never>): Promise<any>;\n /** `notifications.unregisterDevice` \u2014 DELETE /me/push-tokens/{token}. Unregister one of the caller's device push tokens */\n \"unregisterDevice\"(args: {\n \"token\": string | number;\n }): Promise<any>;\n };\n \"prompts\": {\n /** `prompts.execute` \u2014 POST /prompts/{promptKey}/execute. Execute a saved prompt */\n \"execute\"(args: {\n \"promptKey\": string | number;\n }): Promise<any>;\n /** `prompts.run` \u2014 POST /prompts/{promptKey}/run. Run a prompt under a server function's grants */\n \"run\"(args: {\n \"promptKey\": string | number;\n body?: unknown;\n }): Promise<any>;\n };\n \"resourceMetadata\": {\n /** `resourceMetadata.delete` \u2014 DELETE /resources/{resourceType}/{resourceId}/metadata/{category}. Delete a resource's metadata for a category (idempotent) */\n \"delete\"(args: {\n \"resourceType\": string | number;\n \"resourceId\": string | number;\n \"category\": string | number;\n }): Promise<any>;\n /** `resourceMetadata.get` \u2014 GET /resources/{resourceType}/{resourceId}/metadata/{category}. Read a resource's metadata for a category */\n \"get\"(args: {\n \"resourceType\": string | number;\n \"resourceId\": string | number;\n \"category\": string | number;\n }): Promise<any>;\n /** `resourceMetadata.getBatch` \u2014 POST /resources/metadata/batch. Batch-read resource metadata (partial success) */\n \"getBatch\"(args: {\n \"debug\"?: string | number | boolean;\n body: unknown;\n }): Promise<any>;\n /** `resourceMetadata.list` \u2014 GET /resources/{resourceType}/{resourceId}/metadata. List all metadata categories on a resource */\n \"list\"(args: {\n \"resourceType\": string | number;\n \"resourceId\": string | number;\n }): Promise<any>;\n /** `resourceMetadata.resolve` \u2014 POST /metadata/resolve. Resolve a resource by a category's unique metadata value */\n \"resolve\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `resourceMetadata.set` \u2014 PUT /resources/{resourceType}/{resourceId}/metadata/{category}. Write a resource's metadata for a category */\n \"set\"(args: {\n \"resourceType\": string | number;\n \"resourceId\": string | number;\n \"category\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n \"secrets\": {\n /** `secrets.get` \u2014 GET /secrets/{name}. Read an app secret under a server function's grants */\n \"get\"(args: {\n \"name\": string | number;\n }): Promise<any>;\n };\n \"users\": {\n /** `users.getBasic` \u2014 GET /users/{userId}/basic. Get a user's basic public profile */\n \"getBasic\"(args: {\n \"userId\": string | number;\n }): Promise<any>;\n /** `users.getProfiles` \u2014 POST /users/profiles. Look up user profiles in bulk */\n \"getProfiles\"(args: {\n body: unknown;\n }): Promise<any>;\n /** `users.list` \u2014 GET /users. List app users */\n \"list\"(args?: {\n \"email\"?: string | number | boolean;\n \"userId\"?: string | number | boolean;\n \"name\"?: string | number | boolean;\n \"limit\"?: string | number | boolean;\n \"cursor\"?: string | number | boolean;\n }): Promise<any>;\n /** `users.lookup` \u2014 GET /users/lookup. Look up a user by identifier */\n \"lookup\"(args?: {\n \"email\"?: string | number | boolean;\n }): Promise<any>;\n /** `users.remove` \u2014 DELETE /users/{userId}. Remove a user from the app */\n \"remove\"(args: {\n \"userId\": string | number;\n }): Promise<any>;\n /** `users.send` \u2014 POST /users/{userId}/send. Send a realtime message to a member of this app */\n \"send\"(args: {\n \"userId\": string | number;\n body: unknown;\n }): Promise<any>;\n /** `users.setRole` \u2014 PUT /users/{userId}/role. Set a user's app role */\n \"setRole\"(args: {\n \"userId\": string | number;\n body: unknown;\n }): Promise<any>;\n };\n}\n\n/**\n * The app's database types, model by model \u2014 EMPTY here and filled by the\n * declaration `primitive config push` writes into the config tree's\n * `functions/` directory (#3182). A tree that has pushed once therefore types\n * `ctx.db` against its own schemas; one that has not gets the open form and\n * still compiles.\n */\nexport interface DatabaseSchemas {}\n\n/**\n * The type keys `ctx.db` accepts.\n *\n * Every key the augmentation declares, and NOTHING else, once a tree has\n * pushed: naming a type the app does not have is a compile error. Before that\n * \u2014 an unaugmented tree, a function written before the first push \u2014\n * `DatabaseSchemas` is empty and `keyof` it is `never`, which would make the\n * argument unwritable rather than open. So the empty case widens to `string`\n * and the handle is untyped instead of unusable.\n */\nexport type DatabaseTypeKeys = [keyof DatabaseSchemas] extends [never]\n ? string\n : keyof DatabaseSchemas & string;\n\n/** A model's row shape, or an open record for a type with no schema. */\nexport type DatabaseModels<K extends string> = K extends keyof DatabaseSchemas\n ? DatabaseSchemas[K]\n : Record<string, Record<string, unknown>>;\n\n/**\n * The app's functions, key by key \u2014 EMPTY here and filled by the declaration\n * `primitive config push` writes into the config tree's `functions/`\n * directory (`primitive-function-types.d.ts`): each key's declared input and\n * output types (from its `inputSchema` and `outputSchema`) and its mode. It\n * is what types `defineFunction(\"<key>\", handler)`.\n */\nexport interface FunctionSchemas {}\n\n/**\n * The keys `defineFunction(key, handler)` accepts: every key the augmentation\n * declares once a tree has pushed, so a key the tree does not declare is a\n * compile error \u2014 and `string` before that, the `DatabaseTypeKeys` rule, so an\n * unaugmented tree keeps compiling.\n */\nexport type FunctionKeys = [keyof FunctionSchemas] extends [never]\n ? string\n : keyof FunctionSchemas & string;\n\n/** A declared function's input type, or `any` when nothing is declared. */\nexport type FunctionInput<K extends string> = K extends keyof FunctionSchemas\n ? FunctionSchemas[K] extends { input: infer I }\n ? I\n : any\n : any;\n\n/** A declared function's output type, or `any` when nothing is declared. */\nexport type FunctionOutput<K extends string> = K extends keyof FunctionSchemas\n ? FunctionSchemas[K] extends { output: infer O }\n ? O\n : any\n : any;\n\n/** A declared function's mode, fixed at generation time. */\nexport type FunctionMode<K extends string> = K extends keyof FunctionSchemas\n ? FunctionSchemas[K] extends { mode: infer M }\n ? M\n : \"request\" | \"task\"\n : \"request\" | \"task\";\n\n/**\n * The model names one database type addresses \u2014 its own, or any name at all\n * for a type that declares no schema (the DO is schemaless, so a grant on such\n * a type is legal and there is simply nothing to narrow to).\n */\nexport type DatabaseModelNames<TModels> = [keyof TModels] extends [never]\n ? string\n : keyof TModels & string;\n\n/** One model's row shape, open when the type declares no schema. */\nexport type DatabaseModelRow<TModels, M extends string> =\n M extends keyof TModels ? TModels[M] : Record<string, unknown>;\n\n/**\n * One model of one database, scoped: the `modelName` every records call needs\n * is bound once, so a call names an operation and its own arguments.\n *\n * Filters and options are ordinary objects. Inline filter typing arrives with\n * unified schemas \u2014 the intent's decision, not an omission \u2014 so what is typed\n * today is the model name and the row shape a read hands back.\n */\nexport type ModelScopedBody<TBody = Record<string, unknown>> = TBody & {\n /**\n * Bound by the handle. Reserved so a body cannot look like a second way to\n * choose a model: the runtime assigns the handle's own model last, and a row\n * type that said otherwise would be a lie about what came back.\n */\n modelName?: never;\n};\n\n/**\n * One write inside a model-scoped batch. Every batch verb is a write, so a\n * batch on a model needs that model's write grant whatever the ops are.\n */\nexport type ModelBatchOperation<TRow> = {\n op: \"save\" | \"patch\" | \"delete\" | \"increment\" | \"addToSet\" | \"removeFromSet\";\n id?: string;\n data?: Partial<TRow>;\n /** Bound by the handle, for the same reason every other call's is. */\n modelName?: never;\n [key: string]: unknown;\n};\n\nexport interface DatabaseModelHandle<TRow> {\n /**\n * One page of this model's rows, in the decided envelope \u2014 `{ items,\n * hasMore, nextCursor? }` (#3287), the same shape `ctx.doc(...)`,\n * `ctx.users.list` and the client library answer. The route's own wire\n * shape is unchanged; the SDK is where the one name lives, so shared paging\n * code can be written once.\n */\n query(body?: ModelScopedBody): Promise<{ items: TRow[]; hasMore: boolean; nextCursor?: string }>;\n count(body?: ModelScopedBody): Promise<any>;\n aggregate(body: ModelScopedBody): Promise<any>;\n save(body: ModelScopedBody<{ id?: string; data: Partial<TRow>; [key: string]: unknown }>): Promise<any>;\n /** Several writes to THIS model in one request; the binding is per item. */\n batch(body: {\n operations: Array<ModelBatchOperation<TRow>>;\n atomic?: boolean;\n }): Promise<any>;\n}\n\n/** One database, typed by the database TYPE key its grant names. */\nexport interface DatabaseHandle<TModels> {\n /** The database this handle addresses \u2014 part of every query cache key. */\n databaseId: string;\n /** The type key this handle was opened with. */\n databaseType: string;\n model<M extends DatabaseModelNames<TModels>>(\n modelName: M\n ): DatabaseModelHandle<DatabaseModelRow<TModels, M>>;\n /**\n * A batch may also SPAN models, and then it names each one itself \u2014 the\n * model-scoped form above is the typed way to write the common case.\n */\n batch(body: {\n operations: Array<Record<string, unknown>>;\n atomic?: boolean;\n }): Promise<any>;\n /** Run one of the database type's prepared operations under this function's grants. */\n runOperation(name: string, params?: Record<string, unknown>): Promise<any>;\n}\n\n/**\n * The app's DOCUMENT models \u2014 EMPTY here and filled by the declaration\n * `primitive config push` writes into the config tree's `functions/` directory\n * (`primitive-document-types.d.ts`, from the project's `models/models.toml`).\n * A project with no document schema gets the open form and still compiles.\n */\nexport interface DocumentSchemas {}\n\n/** The model names `ctx.doc(id).model()` accepts \u2014 every declared one, or `string` before a push. */\nexport type DocumentModelNames = [keyof DocumentSchemas] extends [never]\n ? string\n : keyof DocumentSchemas & string;\n\n/** A document model's row shape, or an open record for an undeclared schema. */\nexport type DocumentModelRow<M extends string> = M extends keyof DocumentSchemas\n ? DocumentSchemas[M]\n : Record<string, unknown>;\n\n/** The options a document model read takes: a filter object (or its JSON), a page size, a cursor. */\nexport interface DocumentQueryOptions {\n filter?: Record<string, unknown> | string;\n limit?: number;\n cursor?: string;\n}\n\n/**\n * One document model, bound to its document and its model name \u2014 a thin\n * binding over `ctx.api.documents.records.*` with the route's own shapes.\n */\nexport interface DocumentModelHandle<TRow> {\n query(options?: DocumentQueryOptions): Promise<{ items: TRow[]; hasMore: boolean; nextCursor?: string }>;\n count(options?: { filter?: Record<string, unknown> | string }): Promise<{ count: number }>;\n aggregate(body: Record<string, unknown>): Promise<any>;\n save(body: { id: string; data: Partial<TRow>; options?: Record<string, unknown> }): Promise<{ record: TRow }>;\n patch(recordId: string, body: { data: Partial<TRow>; options?: Record<string, unknown> }): Promise<{ record: TRow }>;\n delete(recordId: string): Promise<{ deleted: boolean }>;\n}\n\n/** A document, addressed once; its models are typed from `DocumentSchemas`. */\nexport interface DocumentHandle {\n documentId: string;\n model<M extends DocumentModelNames>(modelName: M): DocumentModelHandle<DocumentModelRow<M>>;\n}\n\n/**\n * One call through a granted integration \u2014 #3183.\n *\n * `path` is RELATIVE to the integration's `baseUrl`, and the host is the\n * integration's: the platform resolves and normalizes the path before checking\n * it against `allowedPaths`, so a protocol-relative path or a `..` segment is\n * refused rather than silently sending the request somewhere else.\n */\nexport interface IntegrationCallRequest {\n /** Must be in the integration's `allowedMethods`. Defaults to its own default. */\n method?: string;\n /** Relative to the integration's `baseUrl`. */\n path?: string;\n query?: Record<string, unknown>;\n headers?: Record<string, string>;\n body?: unknown;\n /** form-urlencoded body; not combinable with `body`. */\n form?: Record<string, unknown>;\n bodyMode?: \"json\" | \"raw\" | \"multipart\";\n}\n\n/** What the upstream answered, as the platform saw it. */\nexport interface IntegrationCallResult {\n status: number;\n headers: Record<string, string>;\n body: unknown;\n durationMs: number;\n traceId: string;\n /** Set when the platform or the upstream refused; absent on success. */\n errorCode?: string;\n}\n\n/** What a prompt run is given \u2014 the member execute route's own body. */\nexport interface PromptRunArgs {\n variables?: Record<string, unknown>;\n /** Run against a different model for this call only. */\n modelOverride?: string;\n /** Pin a specific config OF THIS PROMPT; defaults to its active one. */\n configId?: string;\n}\n\n/** The member execute envelope, unchanged on the function path. */\nexport interface PromptRunResult {\n success: boolean;\n output: string;\n error?: string | null;\n metrics?: Record<string, unknown>;\n configId: string;\n}\n\n/** What a send delivered to. */\nexport interface SendResult {\n /** Unique live connections the frame was sent to. Zero is a success. */\n connections: number;\n /** True when the per-user connection ceiling stopped the fanout. */\n truncated: boolean;\n}\n\n/** Who a channel grant is for, and for how long \u2014 #3184. */\nexport interface ChannelAuthorizeOptions {\n /**\n * The member the grant names. Caller mode defaults to the invoking caller;\n * system mode has no caller and must say.\n */\n userId?: string;\n /** Default 300 s, clamped to the platform ceiling of 900 s. */\n ttlSeconds?: number;\n}\n\n/** The credential a client presents on the WebSocket it already has. */\nexport interface ChannelGrantResult {\n channel: string;\n /** The signed grant. Hand it to the client; it is not readable here. */\n grant: string;\n /** Epoch milliseconds. Expiry is the only revocation a channel has. */\n expiresAt: number;\n}\n\n/** Where to start and how big a page to take \u2014 #3280. */\nexport interface UserPageOptions {\n /** Page size. Capped by the route at 100. */\n limit?: number;\n /** The `nextCursor` of the page before this one. */\n cursor?: string;\n}\n\n/** One user on the roster, as the platform's own users route reports them. */\nexport interface UserPageItem {\n userId: string;\n email: string | null;\n name: string | null;\n avatarUrl: string | null;\n role: string;\n addedAt: string | null;\n status: string;\n disabledAt: string | null;\n [key: string]: unknown;\n}\n\n/** The decided paged envelope, the same shape every paged read answers. */\nexport interface UserPage {\n items: UserPageItem[];\n hasMore: boolean;\n /** Absent on the last page. */\n nextCursor?: string;\n}\n\n/** How a nested start is keyed and labelled \u2014 #3280. */\nexport interface FunctionStartOptions {\n /**\n * Idempotency key, scoped to the tree's root initiator and the resolved\n * context document: a repeat replays the run that already exists rather than\n * starting a second. At most 100 characters.\n */\n runKey?: string;\n /**\n * The document the child's run is keyed under. Defaults through the\n * inheritance rule: the parent run's context, else the root caller's root\n * document, else `fn:<the root function's id>`. At most 100 characters.\n */\n contextDocId?: string;\n /** Caller metadata, at most 1 KB encoded. */\n meta?: Record<string, unknown>;\n}\n\n/** The start envelope, the same one a workflow start answers with \u2014 #3280. */\nexport interface FunctionStartResult {\n /** Poll this on the platform's run-status route. */\n runId: string;\n runKey: string;\n instanceId: string;\n status: string;\n /**\n * True when `runKey` already named a run in this tree, which this envelope\n * describes. That is what makes a run key a singleton.\n */\n existing?: boolean;\n}\n\nexport interface FunctionContext {\n /** The HTTP caller, or null for a webhook, cron or database-change fire. */\n user: FunctionUser | null;\n trigger: FunctionTrigger;\n api: FunctionApi;\n /**\n * A typed handle over one database. The second argument is the database TYPE\n * key \u2014 the same key a `database:<type>/<model>:read|write` grant names \u2014\n * and it is what selects the models this handle knows (#3182).\n */\n db<K extends DatabaseTypeKeys>(\n databaseId: string,\n databaseType: K\n ): DatabaseHandle<DatabaseModels<K>>;\n /**\n * A typed handle over one document's record models, typed from the\n * project's `models/models.toml` \u2014 `ctx.db`'s shape for documents. It\n * confers nothing: every call is a `documents.records.*` operation on the\n * same authority.\n */\n doc(documentId: string): DocumentHandle;\n /**\n * Outbound HTTP, through a granted integration and nowhere else (#3183).\n *\n * A function has no raw network access: every `fetch` to a host that is not\n * the platform answers `FUNCTION_EGRESS_DENIED`, grant or no grant. What an\n * `integration:<key>` grant buys is this call, which the MAIN WORKER makes on\n * the function's behalf \u2014 which is why the integration's `{{secrets.*}}`\n * credentials can be injected into the request without ever being visible to\n * the code that asked for it.\n */\n integrations: {\n call(\n integrationKey: string,\n request?: IntegrationCallRequest\n ): Promise<IntegrationCallResult>;\n };\n /**\n * Start a TASK function from inside this one \u2014 #3280.\n *\n * The one nested door, and it is a START. A request function is code and\n * code composes by being IMPORTED, so there is no synchronous nested\n * invocation to reach for; a request-mode callee answers\n * `FUNCTION_MODE_MISMATCH`.\n *\n * The callee's `access` gate is not consulted \u2014 this function's own gate was\n * the authorization \u2014 and every run in the tree is keyed by whoever started\n * it, so the member who invoked the root polls and terminates them all.\n * Nesting is bounded at four levels.\n */\n functions: {\n start(\n functionKey: string,\n input?: unknown,\n options?: FunctionStartOptions\n ): Promise<FunctionStartResult>;\n };\n /**\n * Run one of the app's prompts, under a `prompt:<key>` grant (#3183).\n *\n * The prompt's `accessRule` is not consulted \u2014 it states which MEMBERS may\n * execute the prompt from a client, and the grant is what authorizes this\n * call. The provider request is bounded by the invocation's own deadline.\n */\n prompts: {\n run(promptKey: string, args?: PromptRunArgs): Promise<PromptRunResult>;\n };\n /**\n * The value of one app secret, under a `secret:<NAME>` grant (#3183).\n *\n * Prefer `ctx.integrations.call` when the secret is a credential FOR an\n * integration: there the value is injected by the platform and never enters\n * the sandbox at all. This is for the cases an integration cannot express.\n *\n * Rejects with `FUNCTION_SECRET_NOT_FOUND` when the grant names a value\n * this environment has not been given \u2014 secrets are provisioned per\n * environment, out of band from the push.\n */\n secret(name: string): Promise<string>;\n /** The value of one app config var, under a `var:<NAME>` grant (#3183). */\n configVar(name: string): Promise<string>;\n /**\n * Realtime messages to this app's clients, under a `users:send` grant\n * (#3183).\n *\n * The recipient's client receives a `direct.message` frame carrying this\n * payload and the sending function's key. Presence is not guaranteed: a\n * member with no live socket answers `{ connections: 0 }` rather than an\n * error.\n */\n users: {\n /**\n * One page of the app's users \u2014 #3280.\n *\n * On the APP's system authority, whoever invoked the function: a member\n * who passes this function's gate reads whatever roster it chooses to\n * expose, so say who may in the function's own `access` expression.\n * `limit` is capped by the route at 100.\n */\n list(options?: UserPageOptions): Promise<UserPage>;\n /**\n * Every page of the app's users, in order \u2014 #3280.\n *\n * FOR A REQUEST FUNCTION AND A SINGLE-SLICE LOOP. A durable loop must take\n * its pages inside `step.do` with an EXPLICIT cursor: a memoized step does\n * not advance an iterator on resume, so an iteration across a sleep would\n * replay pages it had already taken.\n */\n iterate(options?: UserPageOptions): AsyncIterable<UserPage>;\n send(userId: string, payload: unknown): Promise<SendResult>;\n };\n /** The same frame to ONE connection, under a `connections:send` grant. */\n connections: {\n send(connectionId: string, payload: unknown): Promise<SendResult>;\n };\n /**\n * Realtime channels, under a `channel:<namespace>` grant that COVERS the\n * channel \u2014 #3184.\n *\n * `authorize` hands back a short-lived grant for ONE member to present on\n * the socket it already has; `publish` delivers a `channel.message` frame to\n * every connection that has joined and whose grant has not expired. Expiry is\n * the only revocation, so `expiresAt` comes back for the client to renew\n * ahead of \u2014 a renewal is another authorize and another subscribe.\n */\n channels: {\n authorize(\n channel: string,\n options?: ChannelAuthorizeOptions\n ): Promise<ChannelGrantResult>;\n publish(channel: string, payload: unknown): Promise<SendResult>;\n };\n}\n\n/**\n * The durable step handle \u2014 Cloudflare Workflows' `WorkflowStep`, forwarded\n * untouched, so `step.do` results are memoized and `step.sleep` hibernates.\n *\n * A SYNCHRONOUS invocation gets a passthrough shim of the same shape, so a body\n * written for durable mode runs either way: `do` executes the body (nothing to\n * memoize into without an engine), `sleep` resolves immediately (the sync\n * ceiling is seconds), and `waitForEvent` throws `STEP_NOT_AVAILABLE`.\n */\nexport interface FunctionStep {\n do<T>(name: string, body: () => T | Promise<T>): Promise<T>;\n do<T>(\n name: string,\n config: Record<string, unknown>,\n body: () => T | Promise<T>\n ): Promise<T>;\n sleep(name: string, duration: number | string): Promise<void>;\n sleepUntil(name: string, timestamp: Date | number): Promise<void>;\n waitForEvent<T = unknown>(\n name: string,\n options: Record<string, unknown>\n ): Promise<T>;\n}\n\nexport declare const SDK_STUB_VERSION: string;\n\n/**\n * The handler a function exports, typed for one declared key.\n *\n * `step` is the third argument in BOTH modes (#3186). A task run gets the\n * engine's live `WorkflowStep`; a request invocation gets a passthrough shim\n * (`do` runs the body, `sleep` resolves at once, `waitForEvent` throws a\n * named error), so a task-authored body can be exercised as a request.\n */\nexport type FunctionHandler<TInput, TOutput> = (\n input: TInput,\n ctx: FunctionContext,\n step: FunctionStep\n) => Promise<TOutput>;\n\n/**\n * Declare a server function's handler, typed from its declaration.\n *\n * The KEYED form, `defineFunction(\"<key>\", handler)`, is typed from the\n * `FunctionSchemas` augmentation `primitive config push` writes beside the\n * sources: `input` is the key's declared input, the return is checked against\n * its declared output, and a key the tree does not declare is a compile error.\n * `config push` also refuses an entry whose key names another file's. In a\n * tree that has not pushed yet the key is any string and both types are `any`.\n *\n * The UNKEYED form is what it always was: author-declared generics. Both\n * styles reach the platform bootstrap identically \u2014 a plain default export\n * taking `(input, ctx, step)` runs exactly as a wrapped one does \u2014 so this is\n * a typing and intent marker, not a different calling convention.\n */\nexport declare function defineFunction<K extends FunctionKeys>(\n key: K,\n handler: (\n input: FunctionInput<K>,\n ctx: FunctionContext,\n step: FunctionStep\n ) => FunctionOutput<K> | Promise<FunctionOutput<K>>\n): FunctionHandler<FunctionInput<K>, FunctionOutput<K>> & { functionKey: K };\nexport declare function defineFunction<TInput = unknown, TOutput = unknown>(\n handler: (\n input: TInput,\n ctx: FunctionContext,\n step: FunctionStep\n ) => TOutput | Promise<TOutput>\n): FunctionHandler<TInput, TOutput>;\n\n/**\n * One declared parameter of a registered query.\n *\n * `caller: true` (or `type: \"$caller\"`) is the intent's IMMUTABLE binding:\n * the platform injects the invocation's user and refuses a call that supplies\n * the parameter itself.\n */\n/** The scalar parameter types, and an array parameter's element types. */\nexport type QueryScalarParamType = \"string\" | \"number\" | \"boolean\" | \"any\";\n\nexport interface QueryParamSpec {\n type?: QueryScalarParamType | \"$caller\" | \"array\";\n /** For `type: \"array\"` \u2014 the element type; absent means any element. */\n items?: { type: QueryScalarParamType };\n caller?: boolean;\n optional?: boolean;\n default?: unknown;\n}\n\n/** A scalar parameter type's TypeScript type. */\nexport type QueryScalarValue<T> = T extends \"string\"\n ? string\n : T extends \"number\"\n ? number\n : T extends \"boolean\"\n ? boolean\n : T extends \"$caller\"\n ? string\n : any;\n\n/** The value `run` receives for one declared parameter. */\nexport type QueryParamValue<S> = S extends { caller: true }\n ? string\n : S extends { type: \"array\"; items: { type: infer I } }\n ? QueryScalarValue<I>[]\n : S extends { type: \"array\" }\n ? unknown[]\n : S extends { type: infer T }\n ? QueryScalarValue<T>\n : any;\n\ntype QueryOptionalKeys<P> = {\n [K in keyof P]: P[K] extends { optional: true } ? K : never;\n}[keyof P];\n\n/**\n * `run`'s `params`, typed from the declaration: scalars as their scalar,\n * `$caller` as a string, an array as `T[]`, an `optional: true` parameter\n * as an optional key (a parameter with a default is always present). An\n * undeclared name is a compile error.\n */\nexport type QueryParams<P> = {\n [K in Exclude<keyof P, QueryOptionalKeys<P>>]: QueryParamValue<P[K]>;\n} & {\n [K in QueryOptionalKeys<P>]?: QueryParamValue<P[K]>;\n};\n\n/** A registration's definition with its parameters DECLARED, so `run` is typed from them. */\nexport interface TypedQueryDefinition<TDb, TSpec extends Record<string, QueryParamSpec>, TResult> {\n models: string[];\n params?: TSpec;\n cache?: { ttlMs: number };\n run: (db: TDb, params: QueryParams<TSpec>) => TResult | Promise<TResult>;\n}\n\nexport interface QueryDefinition<TDb, TParams, TResult> {\n /** The models this query touches. Caching is off unless the run matches. */\n models: string[];\n params?: Record<string, QueryParamSpec>;\n /**\n * Cache the answer for `ttlMs` \u2014 capped by the platform, and applied ONLY\n * when the run is verified: every model the body touched was declared, and\n * no prepared operation was used. A write through the handle drops the\n * entries that read the written model.\n */\n cache?: { ttlMs: number };\n run: (db: TDb, params: TParams) => TResult | Promise<TResult>;\n}\n\n/**\n * Register a named query over a database handle (#3187).\n *\n * A registration helper, not a language: `run` is ordinary code over the same\n * typed handle, and what registration adds is a name, declared parameters\n * (validated, coerced and defaulted), the `$caller` binding, and a cache the\n * platform may use when it can verify what the run touched.\n *\n * Register at MODULE scope: a registration made inside the handler still works\n * for direct calls but is invisible to `config push`'s manifest.\n *\n * `run`'s `params` are TYPED from the declaration (the first overload,\n * inferred with a `const` type parameter): a scalar as its scalar, `$caller`\n * as a string, `{ type: \"array\", items: { type: \"string\" } }` as `string[]`,\n * an `optional: true` parameter as an optional key; an undeclared name inside\n * `run` is a compile error. A declared default is coerced to the declared\n * type at registration, so `run` receives what the declaration promises. The\n * second overload keeps an explicit `TParams`.\n */\nexport declare function defineQuery<\n const TSpec extends Record<string, QueryParamSpec>,\n TDb = DatabaseHandle<any>,\n TResult = any\n>(\n name: string,\n definition: TypedQueryDefinition<TDb, TSpec, TResult>\n): (db: TDb, params?: Record<string, unknown>) => Promise<TResult>;\nexport declare function defineQuery<\n TDb = DatabaseHandle<any>,\n TParams = Record<string, any>,\n TResult = any\n>(\n name: string,\n definition: QueryDefinition<TDb, TParams, TResult>\n): (db: TDb, params?: Record<string, unknown>) => Promise<TResult>;\n\n/** The same, for a registration that writes. A mutation is never cached. */\nexport declare function defineMutation<\n const TSpec extends Record<string, QueryParamSpec>,\n TDb = DatabaseHandle<any>,\n TResult = any\n>(\n name: string,\n definition: TypedQueryDefinition<TDb, TSpec, TResult>\n): (db: TDb, params?: Record<string, unknown>) => Promise<TResult>;\nexport declare function defineMutation<\n TDb = DatabaseHandle<any>,\n TParams = Record<string, any>,\n TResult = any\n>(\n name: string,\n definition: QueryDefinition<TDb, TParams, TResult>\n): (db: TDb, params?: Record<string, unknown>) => Promise<TResult>;\n\n/** The platform's cap on a registered query's cache TTL, in milliseconds. */\nexport declare const MAX_QUERY_CACHE_TTL_MS: number;\n\n/**\n * Map over items with BOUNDED concurrency (#3187). Results come back in the\n * input's order; the first rejection wins and nothing new is started after it.\n *\n * The bound matters inside a sandbox: an unbounded fan-out over a page of rows\n * spends the whole subrequest ceiling in one line.\n */\nexport declare function pMap<T, R>(\n items: Iterable<T>,\n mapper: (item: T, index: number) => R | Promise<R>,\n options?: { concurrency?: number }\n): Promise<R[]>;\n\n/** The default concurrency `pMap` applies when none is given. */\nexport declare const PMAP_DEFAULT_CONCURRENCY: number;\n\n/**\n * A time-ordered ULID.\n *\n * GENERATE IT INSIDE `step.do`. A durable run re-executes its handler on\n * every resume and memoizes only what a step returned, so an id minted at the\n * top of a handler is a different id after a sleep \u2014 and whatever it was\n * written into is orphaned.\n */\nexport declare function ulid(): string;\n\n/** One family's durable `step.do` configuration. */\nexport interface StepPolicy {\n retries: { limit: number; delay: string; backoff: string };\n timeout: string;\n}\n\n/**\n * The per-family step policies the DSL runners use, generated from their own\n * timeout module (#3187):\n *\n * await step.do(\"send-receipt\", stepPolicy.email, () =>\n * ctx.api.email.send({ body: { to, subject, htmlBody } }));\n *\n * `retries: 0` on email and the AI families is deliberate \u2014 a retried timeout\n * would send the same email twice or bill the same generation twice.\n */\nexport declare const stepPolicy: {\n email: StepPolicy;\n llm: StepPolicy;\n gemini: StepPolicy;\n database: StepPolicy;\n};\n\ndeclare const _default: {\n SDK_STUB_VERSION: string;\n defineFunction: typeof defineFunction;\n defineQuery: typeof defineQuery;\n defineMutation: typeof defineMutation;\n pMap: typeof pMap;\n ulid: typeof ulid;\n};\nexport default _default;\n";
|