/** * Project-scoped sub-client. `ScopedRun402` wraps the SDK's project-id-bearing * namespaces with the id pre-bound, so callers don't have to thread the id * through every call. * * Construct via `r.project(id?)` — see the JSDoc on * {@link Run402.project} for the resolution rule (explicit arg vs. fallback to * the credential provider's active-project state). * * Methods that take an options object containing `project_id`/`project` * (deploy, subdomains, domains) honour a caller-supplied value over the scoped * id, so a scoped client can still address a different project ad-hoc. * * Methods that don't take a project id (e.g. `projects.list(wallet)`, * `projects.getQuote()`, `projects.active()`, `apps.browse(tags?)`, * `ai.generateImage(opts)`, etc.) pass through unchanged. */ import type { LiveChangesOptions, LiveChangesPage, LiveEvent, LiveSubscribeOptions, LiveSubscription } from "./namespaces/live.types.js"; import type { Client } from "./kernel.js"; import type { Run402 } from "./index.js"; import type { ProjectKeys } from "./credentials.js"; import type { ExposeManifestValidationInput, ExposeManifestValidationResult, ListProjectsOptions, ListProjectsResult, ProjectDetail, ProjectInfo, ProjectRestOptions, ProjectRestResponse, QuoteResult, RenameProjectResult, SetRepoNameResult, SchemaReport, ListTenantPaymentsOptions, TenantPaymentListResult, UsageReport, ValidateExposeOptions } from "./namespaces/projects.types.js"; import type { AppDetails, AppInstallState, AppInstallStateInput, BrowseAppsResult, ForkAppOptions, ForkAppResult, ListVersionsResult, PublishAppOptions, PublishedVersion, UpdateVersionOptions } from "./namespaces/apps.js"; import type { AiUsageResult, GenerateImageOptions, GenerateImageResult, ModerateResult, TranslateOptions, TranslateResult } from "./namespaces/ai.js"; import type { AuthSettings, AuthSettingsResult, AuthSessionResult, AuthUserAdminResult, CreateAuthUserOptions, MagicLinkOptions, MagicLinkRequestResult, MagicLinkVerifyResult, EmailCodeVerifyOptions, PasskeyDeleteOptions, PasskeyListOptions, PasskeyLoginOptions, PasskeyLoginVerifyOptions, PasskeyOptionsResult, PasskeyRecord, PasskeyRegistrationOptions, PasskeyRegistrationVerifyOptions, SetPasswordOptions } from "./namespaces/auth.js"; import type { BlobDiagnoseEnvelope, BlobLsOptions, BlobLsResult, BlobPutOptions, BlobPutResult, BlobPutSource, BlobSignOptions, BlobSignResult, BlobWaitFreshOptions, BlobWaitFreshResult } from "./namespaces/assets.types.js"; import type { ContractCallOptions, ContractDeployOptions, ContractReadOptions, ProvisionSignerOptions } from "./namespaces/contracts.js"; import type { ProjectDomain, ProjectDomainEnsureOptions, ProjectDomainListResult, ProjectDomainTestReceiveResult, ProjectDomainWaitOptions } from "./namespaces/domains.js"; import type { CreateMailboxResult, DeleteMailboxResult, EmailDetail, EmailSummary, ListDeliveriesOptions, ListEmailsOptions, MailboxInfo, MailboxListResult, MailboxWebhookSummary, MailboxWebhooksResult, RawEmailResult, RedriveDeliveryResult, RegisterWebhookOptions, SendEmailOptions, SendEmailResult, SetMailboxDefaultsOptions, SetMailboxDefaultsResult, UpdateMailboxOptions, UpdateMailboxResult, UpdateWebhookOptions, WebhookDeliveriesResult } from "./namespaces/email.js"; import type { DeleteFunctionResult, FunctionDeployOptions, FunctionDeployResult, FunctionInvokeOptions, FunctionInvokeResult, FunctionListResult, FunctionLogsByRequestIdOptions, FunctionLogsByRequestIdResult, FunctionLogsOptions, FunctionLogsResult, FunctionRunCreateOptions, FunctionRunHandle, FunctionRunListOptions, FunctionRunListResult, FunctionRunLogsOptions, FunctionRunRedriveOptions, FunctionRunWaitOptions, FunctionRebuildBatchResult, FunctionRebuildResult, FunctionUpdateOptions, FunctionUpdateResult } from "./namespaces/functions.types.js"; import type { ManagedJobLogsOptions, ManagedJobLogsResponse, ManagedJobPurgeResponse, ManagedJobResponse, ManagedJobSubmitRequest } from "./namespaces/jobs.js"; import type { DeleteSecretResult, SecretListResult, SecretSetOptions } from "./namespaces/secrets.js"; import type { CreateGrantInput, GrantCreateResult, GrantRevokeResult } from "./namespaces/grants.types.js"; import type { CreateDelegateInput, DelegateCreateResult, DelegateListResult, DelegateRevokeResult } from "./namespaces/delegates.types.js"; import type { ListEventsOptions, ProjectEventFeedPage } from "./namespaces/events.types.js"; import type { ErrorFingerprintDetail, ErrorsPage, ListErrorsOptions, WatchErrorsOptions, WatchErrorsResult } from "./namespaces/errors.types.js"; import type { ProjectArchiveCreateOptions, ProjectArchiveDownload, ProjectArchiveDto, ProjectArchiveExportOptions, ProjectArchiveExportResult, ProjectArchiveWaitOptions } from "./namespaces/archives.types.js"; import type { ProjectSnapshotDto, ProjectSnapshotsListOptions, ProjectSnapshotsListResult, SnapshotRestoreOptions, SnapshotRestorePlanEnvelope, SnapshotRestoreResult } from "./namespaces/snapshots.types.js"; import type { ProjectBranchCreateOptions, ProjectBranchCreateResult, ProjectBranchDto, ProjectBranchesListResult, ProjectBranchRenewOptions } from "./namespaces/branches.types.js"; import type { SubdomainClaimInput, SubdomainClaimOptions, SubdomainClaimResult, SubdomainDeleteResult, SubdomainSummary } from "./namespaces/subdomains.js"; import type { ApplyOptions, ActiveReleaseInventory, DeployEvent, DeployEventsResponse, ExposeManifest, DeployListOptions, DeployListResponse, DeployOperation, DeployResolveResponse, DeployResult, EdgeCoherenceReport, EdgeCoherenceWaitOptions, EdgeCoherenceWaitResult, OperationSnapshot, PlanResponse, PromoteOptions, PromoteResult, RehearsePlanOptions, RehearsePlanResult, ReleaseDiffOptions, ReleaseInventory, ReleaseInventoryOptions, ReleaseSpec, ReleaseToReleaseDiff, ScopedDeployResolveOptions, StartOptions } from "./namespaces/deploy.types.js"; import type { ByteReader } from "./namespaces/deploy.js"; declare class ScopedProjects { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); delete(): Promise; getUsage(): Promise; getSchema(): Promise; sql(sql: string, params?: unknown[]): Promise; rest(table: string, options?: ProjectRestOptions): Promise; restResponse(table: string, options?: ProjectRestOptions): Promise>; applyExpose(manifest: ExposeManifest): Promise; validateExpose(manifest: ExposeManifestValidationInput, opts?: ValidateExposeOptions): Promise; getExpose(): Promise; rename(name: string): Promise; setRepoName(name: string): Promise; listTenantPayments(opts?: ListTenantPaymentsOptions): Promise; promoteUser(email: string): Promise; demoteUser(email: string): Promise; get(): Promise; info(): Promise; keys(): Promise; list(opts?: ListProjectsOptions): Promise; getQuote(): Promise; active(): Promise; } declare class ScopedApps { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); publish(opts?: PublishAppOptions): Promise; listVersions(): Promise; updateVersion(versionId: string, opts: UpdateVersionOptions): Promise; deleteVersion(versionId: string): Promise; browse(tags?: string[]): Promise; fork(opts: ForkAppOptions): Promise; getApp(versionId: string): Promise; upsertInstallState(input: Omit & { project_id?: string; }): Promise; getInstallState(appKey: string): Promise; } declare class ScopedAi { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); translate(opts: TranslateOptions): Promise; moderate(text: string): Promise; usage(): Promise; generateImage(opts: GenerateImageOptions): Promise; } declare class ScopedGrants { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); create(input: CreateGrantInput): Promise; revoke(grantId: string): Promise; } declare class ScopedDelegates { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); create(input: CreateDelegateInput): Promise; list(): Promise; revoke(delegateId: string): Promise; rotate(delegateId: string): Promise; } declare class ScopedEvents { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); /** Read a page of this project's events feed (cursor is opaque — store and echo). */ list(opts?: ListEventsOptions): Promise; } declare class ScopedLive { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); /** Hints since `cursor`, or hold up to `wait` seconds for the first one. */ changes(opts: LiveChangesOptions): Promise; /** Reconnecting SSE subscription; handle `resync` by refetching. */ subscribe(opts: LiveSubscribeOptions, onEvent: (event: LiveEvent) => void): LiveSubscription; } declare class ScopedErrors { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); /** Read a verdict-first page of this project's grouped error fingerprints. */ list(opts?: ListErrorsOptions): Promise; /** Read one fingerprint's full detail (all samples + per-sample drill-downs). */ get(fingerprintId: string): Promise; /** Run the promote-gate poll loop against a release (`{ newIn }` required). */ watch(opts: WatchErrorsOptions): Promise; } declare class ScopedArchives { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); create(opts?: ProjectArchiveCreateOptions): Promise; get(archiveId: string): Promise; wait(archiveId: string, opts?: ProjectArchiveWaitOptions): Promise; download(archiveId: string): Promise; export(opts?: ProjectArchiveExportOptions): Promise; } declare class ScopedSnapshots { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); create(): Promise; list(opts?: ProjectSnapshotsListOptions): Promise; get(snapshotId: string): Promise; delete(snapshotId: string): Promise; restorePlan(snapshotId: string, opts?: SnapshotRestoreOptions): Promise; restore(snapshotId: string, confirm: string, opts?: SnapshotRestoreOptions): Promise; } declare class ScopedBranches { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); create(opts?: ProjectBranchCreateOptions): Promise; list(): Promise; renew(branchProjectId: string, opts?: ProjectBranchRenewOptions): Promise; delete(branchProjectId: string): Promise; } declare class ScopedAuth { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); requestMagicLink(opts: MagicLinkOptions): Promise; verifyMagicLink(token: string): Promise; verifyEmailCode(opts: EmailCodeVerifyOptions): Promise; createUser(opts: CreateAuthUserOptions): Promise; inviteUser(opts: Omit): Promise; setUserPassword(opts: SetPasswordOptions): Promise; settings(settings: AuthSettings): Promise; createPasskeyRegistrationOptions(opts: PasskeyRegistrationOptions): Promise; verifyPasskeyRegistration(opts: PasskeyRegistrationVerifyOptions): Promise; createPasskeyLoginOptions(opts: PasskeyLoginOptions): Promise; verifyPasskeyLogin(opts: PasskeyLoginVerifyOptions): Promise; listPasskeys(opts: PasskeyListOptions): Promise<{ passkeys: PasskeyRecord[]; }>; deletePasskey(opts: PasskeyDeleteOptions): Promise; providers(): Promise; promote(email: string): Promise; demote(email: string): Promise; } declare class ScopedAssets { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); put(key: string, source: BlobPutSource, opts?: BlobPutOptions): Promise; diagnoseUrl(url: string): Promise; waitFresh(opts: BlobWaitFreshOptions): Promise; get(key: string): Promise; ls(opts?: BlobLsOptions): Promise; rm(key: string): Promise; sign(key: string, opts?: BlobSignOptions): Promise; } declare class ScopedContracts { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); provisionSigner(opts: ProvisionSignerOptions): Promise; getSigner(signerId: string): Promise; listSigners(): Promise; setRecovery(signerId: string, recoveryAddress: string | null): Promise; setLowBalanceAlert(signerId: string, thresholdWei: string): Promise; call(opts: ContractCallOptions): Promise; deploy(opts: ContractDeployOptions): Promise; callStatus(callId: string): Promise; drain(signerId: string, destinationAddress: string): Promise; deleteSigner(signerId: string): Promise; read(opts: ContractReadOptions): Promise; } /** * Callable hero shape for `r.project(id).apply`. The function form is the * documented happy path; the attached `plan`/`start`/`resume` sub-methods * are advanced primitives for callers building their own plan/upload/commit * pipelines. The same object owns release and operation reads, so the public * project-scoped lifecycle has one noun: apply. The hero is the * only public apply surface — no bare `r.apply`, no `r.deploy.apply`, no * `r.assets.apply`. */ export interface ScopedApplyHero { (spec: Omit & { project?: string; }, opts?: ApplyOptions): Promise; plan(spec: Omit & { project?: string; }, opts?: { idempotencyKey?: string; dryRun?: boolean; mode?: "legacyDryRun" | "reviewedPlan"; requiredPlan?: { planId: string; planFingerprint?: string; }; }): Promise<{ plan: PlanResponse; byteReaders: Map; }>; start(spec: Omit & { project?: string; }, opts?: StartOptions): Promise; resume(operationId: string, opts?: { onEvent?: (event: DeployEvent) => void; project?: string; }): Promise; /** * Operator pointer-swap: promote an existing release to be the project's * current live release without re-running the apply pipeline. v1.58+. * See `Deploy.promote` for full semantics + warning surface. */ promote(releaseId: string, opts?: PromoteOptions): Promise; upload(plan: PlanResponse, opts: { project?: string; byteReaders: Map; onEvent?: (event: DeployEvent) => void; }): Promise; commit(planId: string, opts?: { onEvent?: (event: DeployEvent) => void; idempotencyKey?: string; project?: string; }): Promise; rehearse(planId: string, opts?: Omit & { project?: string; }): Promise; status(operationId: string, opts?: { project?: string; }): Promise; list(opts?: Omit & { project?: string; }): Promise; events(operationId: string, opts?: { project?: string; }): Promise; edgeCoherence(operationId: string, opts?: { project?: string; }): Promise; waitEdgeCoherent(operationId: string, opts?: Omit & { project?: string; }): Promise; getRelease(releaseId: string, opts?: Partial): Promise; getActiveRelease(opts?: Partial): Promise; diff(opts: Omit & { project?: string; }): Promise; resolve(opts: ScopedDeployResolveOptions): Promise; } declare class ScopedDomains { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); ensure(domain: string, opts: ProjectDomainEnsureOptions): Promise; get(domain: string): Promise; list(): Promise; check(domain: string): Promise; apply(domain: string): Promise; repair(domain: string): Promise; testReceive(domain: string, to: string): Promise; activate(domain: string): Promise; disconnect(domain: string): Promise<{ status: string; domain: string; }>; wait(domain: string, opts?: ProjectDomainWaitOptions): Promise; } declare class ScopedEmailWebhooks { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); register(opts: RegisterWebhookOptions): Promise; list(): Promise; get(webhookId: string): Promise; update(webhookId: string, opts: UpdateWebhookOptions): Promise; delete(webhookId: string): Promise; listDeliveries(opts?: ListDeliveriesOptions): Promise; redriveDelivery(deliveryId: string): Promise; } declare class ScopedEmail { private readonly parent; private readonly projectId; readonly webhooks: ScopedEmailWebhooks; constructor(parent: Run402, projectId: string); createMailbox(slug: string): Promise; listMailboxes(): Promise; setMailboxDefaults(opts: SetMailboxDefaultsOptions): Promise; updateMailbox(opts: UpdateMailboxOptions): Promise; send(opts: SendEmailOptions): Promise; list(opts?: ListEmailsOptions): Promise; get(messageId: string): Promise; getRaw(messageId: string): Promise; getMailbox(): Promise; deleteMailbox(mailboxId?: string): Promise; } declare class ScopedFunctionRuns { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); create(name: string, opts: FunctionRunCreateOptions): Promise; list(name: string, opts?: FunctionRunListOptions): Promise; get(runId: string): Promise; logs(runId: string, opts?: FunctionRunLogsOptions): Promise; cancel(runId: string): Promise; redrive(runId: string, opts?: FunctionRunRedriveOptions): Promise; wait(runId: string, opts?: FunctionRunWaitOptions): Promise; } declare class ScopedFunctions { private readonly parent; private readonly projectId; readonly runs: ScopedFunctionRuns; constructor(parent: Run402, projectId: string); deploy(opts: FunctionDeployOptions): Promise; invoke(name: string, opts?: FunctionInvokeOptions): Promise; logs(name: string, opts?: FunctionLogsOptions): Promise; logsByRequestId(requestId: string, opts?: FunctionLogsByRequestIdOptions): Promise; list(): Promise; delete(name: string): Promise; update(name: string, opts: FunctionUpdateOptions): Promise; rebuild(name: string): Promise; rebuildAll(): Promise; } declare class ScopedSecrets { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); set(key: string, opts: SecretSetOptions): Promise; list(): Promise; delete(key: string): Promise; } declare class ScopedJobs { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); submit(request: ManagedJobSubmitRequest): Promise; get(jobId: string): Promise; logs(jobId: string, opts?: ManagedJobLogsOptions): Promise; cancel(jobId: string): Promise; purge(): Promise; downloadArtifact(jobId: string, filename: string): Promise; } declare class ScopedSubdomains { private readonly parent; private readonly projectId; constructor(parent: Run402, projectId: string); list(): Promise; claim(input: SubdomainClaimInput): Promise; delete(name: string, opts?: SubdomainClaimOptions): Promise; } export declare class ScopedRun402 { /** Resolved project id this client is bound to. Read-only. */ readonly projectId: string; readonly projects: ScopedProjects; readonly apps: ScopedApps; readonly ai: ScopedAi; readonly auth: ScopedAuth; readonly assets: ScopedAssets; readonly contracts: ScopedContracts; /** * Hero apply surface: `r.project(id).apply(spec)` * is the documented happy path for both release-only and mixed apply. * Callable directly, with `.plan(spec)` / `.start(spec)` / `.resume(opId)` * sub-methods for advanced plan-upload-commit pipelines. */ readonly apply: ScopedApplyHero; /** * No `deploy` namespace: `apply` owns both writes and lifecycle reads. * Use `p.apply(...)`, `p.apply.plan(...)`, `p.apply.status(...)`, * `p.apply.getRelease(...)`, and `p.apply.resolve(...)`. */ readonly domains: ScopedDomains; readonly email: ScopedEmail; readonly functions: ScopedFunctions; readonly jobs: ScopedJobs; readonly secrets: ScopedSecrets; readonly subdomains: ScopedSubdomains; /** Per-project capability grants (agent/CI principals), project-id pre-bound. */ readonly grants: ScopedGrants; /** Scoped deploy credentials for agents (mint / list / revoke / rotate), project-id pre-bound. */ readonly delegates: ScopedDelegates; /** Cursored project events feed, project-id pre-bound. */ readonly events: ScopedEvents; readonly live: ScopedLive; /** Release-error-rollup query surface (list / get / watch), project-id pre-bound. */ readonly errors: ScopedErrors; readonly archives: ScopedArchives; readonly snapshots: ScopedSnapshots; readonly branches: ScopedBranches; constructor(parent: Run402, _client: Client, projectId: string); } export {}; //# sourceMappingURL=scoped.d.ts.map