run402-mcp
Version:
MCP server for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.
984 lines • 32.7 kB
JavaScript
class ScopedProjectStripeAccount {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
connect(input) {
return this.parent.projects.stripe.account.connect(this.projectId, input);
}
get() {
return this.parent.projects.stripe.account.get(this.projectId);
}
disconnect() {
return this.parent.projects.stripe.account.disconnect(this.projectId);
}
}
class ScopedProjectStripeOnboardingLinks {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
create(input) {
return this.parent.projects.stripe.onboardingLinks.create(this.projectId, input);
}
}
class ScopedProjectStripeCheckoutSessions {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
create(input) {
return this.parent.projects.stripe.checkoutSessions.create(this.projectId, input);
}
get(checkoutSessionId) {
return this.parent.projects.stripe.checkoutSessions.get(this.projectId, checkoutSessionId);
}
}
class ScopedProjectStripePortalSessions {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
create(input) {
return this.parent.projects.stripe.portalSessions.create(this.projectId, input);
}
}
/** `r.project(id).stripe` — the organization's Stripe account and sessions, project pre-bound. */
class ScopedProjectStripe {
account;
onboardingLinks;
checkoutSessions;
portalSessions;
constructor(parent, projectId) {
this.account = new ScopedProjectStripeAccount(parent, projectId);
this.onboardingLinks = new ScopedProjectStripeOnboardingLinks(parent, projectId);
this.checkoutSessions = new ScopedProjectStripeCheckoutSessions(parent, projectId);
this.portalSessions = new ScopedProjectStripePortalSessions(parent, projectId);
}
}
class ScopedProjects {
parent;
projectId;
stripe;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
this.stripe = new ScopedProjectStripe(parent, projectId);
}
delete() {
return this.parent.projects.delete(this.projectId);
}
getUsage() {
return this.parent.projects.getUsage(this.projectId);
}
getSchema() {
return this.parent.projects.getSchema(this.projectId);
}
sql(sql, params, opts) {
return this.parent.projects.sql(this.projectId, sql, params, opts);
}
sqlBatch(statements, opts) {
return this.parent.projects.sqlBatch(this.projectId, statements, opts);
}
rest(table, options) {
return this.parent.projects.rest(this.projectId, table, options);
}
restResponse(table, options) {
return this.parent.projects.restResponse(this.projectId, table, options);
}
applyExpose(manifest) {
return this.parent.projects.applyExpose(this.projectId, manifest);
}
validateExpose(manifest, opts = {}) {
if (opts.project !== undefined || opts.project_id !== undefined) {
return this.parent.projects.validateExpose(manifest, opts);
}
return this.parent.projects.validateExpose(manifest, { ...opts, project: this.projectId });
}
getExpose() {
return this.parent.projects.getExpose(this.projectId);
}
rename(name) {
return this.parent.projects.rename(this.projectId, name);
}
setRepoName(name) {
return this.parent.projects.setRepoName(this.projectId, name);
}
listTenantPayments(opts) {
return this.parent.projects.listTenantPayments(this.projectId, opts);
}
promoteUser(email) {
return this.parent.projects.promoteUser(this.projectId, email);
}
demoteUser(email) {
return this.parent.projects.demoteUser(this.projectId, email);
}
get() {
return this.parent.projects.get(this.projectId);
}
info() {
return this.parent.projects.info(this.projectId);
}
keys() {
return this.parent.projects.keys(this.projectId);
}
// Pass-through for non-id-bearing methods.
list(opts) {
return this.parent.projects.list(opts);
}
getQuote() {
return this.parent.projects.getQuote();
}
active() {
return this.parent.projects.active();
}
}
class ScopedApps {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
publish(opts) {
return this.parent.apps.publish(this.projectId, opts);
}
listVersions() {
return this.parent.apps.listVersions(this.projectId);
}
updateVersion(versionId, opts) {
return this.parent.apps.updateVersion(this.projectId, versionId, opts);
}
deleteVersion(versionId) {
return this.parent.apps.deleteVersion(this.projectId, versionId);
}
// Pass-through.
browse(tags) {
return this.parent.apps.browse(tags);
}
fork(opts) {
return this.parent.apps.fork(opts);
}
getApp(versionId) {
return this.parent.apps.getApp(versionId);
}
upsertInstallState(input) {
return this.parent.apps.upsertInstallState({ ...input, project_id: input.project_id ?? this.projectId });
}
getInstallState(appKey) {
return this.parent.apps.getInstallState(this.projectId, appKey);
}
}
class ScopedAi {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
translate(opts) {
return this.parent.ai.translate(this.projectId, opts);
}
moderate(text) {
return this.parent.ai.moderate(this.projectId, text);
}
usage() {
return this.parent.ai.usage(this.projectId);
}
// Pass-through.
generateImage(opts) {
return this.parent.ai.generateImage(opts);
}
}
class ScopedGrants {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
create(input) {
return this.parent.grants.create(this.projectId, input);
}
list() {
return this.parent.grants.list(this.projectId);
}
revoke(grantId) {
return this.parent.grants.revoke(this.projectId, grantId);
}
createKey(grantId, input) {
return this.parent.grants.createKey(this.projectId, grantId, input);
}
revokeKey(keyId) {
return this.parent.grants.revokeKey(this.projectId, keyId);
}
rotateKey(keyId) {
return this.parent.grants.rotateKey(this.projectId, keyId);
}
}
class ScopedEvents {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
/** Read a page of this project's events feed (cursor is opaque — store and echo). */
list(opts) {
return this.parent.events.list(this.projectId, opts);
}
}
class ScopedLive {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
/** Hints since `cursor`, or hold up to `wait` seconds for the first one. */
changes(opts) {
return this.parent.live.changes(this.projectId, opts);
}
/** Reconnecting SSE subscription; handle `resync` by refetching. */
subscribe(opts, onEvent) {
return this.parent.live.subscribe(this.projectId, opts, onEvent);
}
}
class ScopedPush {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
/** Subscriptions by user, today's deliveries against the daily cap, and the latest 10 messages. */
status() {
return this.parent.push.status(this.projectId);
}
/** One message: what was sent, to whom, and each delivery's state. */
getMessage(messageId) {
return this.parent.push.getMessage(this.projectId, messageId);
}
/** Give Run402 the project's Firebase service-account key (checked with Google, never returned). */
setFcmCredential(serviceAccount) {
return this.parent.push.setFcmCredential(this.projectId, serviceAccount);
}
/** Remove the project's Firebase key and the devices registered under it. */
removeFcmCredential() {
return this.parent.push.removeFcmCredential(this.projectId);
}
}
class ScopedAppRepos {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
/** Every app repo of the project; `default` is always listed. */
list() {
return this.parent.appRepos.list(this.projectId);
}
/** Create a repo, optionally `from` another repo of the project. */
create(opts) {
return this.parent.appRepos.create(this.projectId, opts);
}
/** One repo, with its head and `clone_url`. */
get(repoName) {
return this.parent.appRepos.get(this.projectId, repoName);
}
/** Delete a repo; `confirm` must equal its name, and `default` cannot be deleted. */
delete(repoName, opts) {
return this.parent.appRepos.delete(this.projectId, repoName, opts);
}
/** Commits on `main`, newest first, optionally only those that changed `path`. */
log(repoName, opts) {
return this.parent.appRepos.log(this.projectId, repoName, opts);
}
/** One file at the head or `at`; `null` when absent. */
readFile(repoName, path, opts) {
return this.parent.appRepos.readFile(this.projectId, repoName, path, opts);
}
/** A directory listing at the head or `at`. */
tree(repoName, path, opts) {
return this.parent.appRepos.tree(this.projectId, repoName, path, opts);
}
/** The paths that changed between two commits. */
diff(repoName, from, to) {
return this.parent.appRepos.diff(this.projectId, repoName, from, to);
}
/** Commit files to `main`. */
commit(repoName, opts) {
return this.parent.appRepos.commit(this.projectId, repoName, opts);
}
/** Commit the inverse of `commit`'s changes. */
revert(repoName, commit, opts) {
return this.parent.appRepos.revert(this.projectId, repoName, commit, opts);
}
/** The credential git sends for one repo, by the SDK's one resolution (principal first). */
gitCredential(repoName) {
return this.parent.appRepos.gitCredential(this.projectId, repoName);
}
/** Mint a credential for one repo, read or write, that expires by itself. `token` is returned only here. */
createToken(repoName, opts) {
return this.parent.appRepos.createToken(this.projectId, repoName, opts);
}
/** Stop a token at once; repeating it answers the same. */
revokeToken(repoName, tokenId) {
return this.parent.appRepos.revokeToken(this.projectId, repoName, tokenId);
}
}
class ScopedErrors {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
/** Read a verdict-first page of this project's grouped error fingerprints. */
list(opts) {
return this.parent.errors.list(this.projectId, opts);
}
/** Read one fingerprint's full detail (all samples + per-sample drill-downs). */
get(fingerprintId) {
return this.parent.errors.get(this.projectId, fingerprintId);
}
/** Run the promote-gate poll loop against a release (`{ newIn }` required). */
watch(opts) {
return this.parent.errors.watch(this.projectId, opts);
}
/** Mark a group resolved once its fix is live; it reopens if its error is seen again. */
resolve(fingerprintId) {
return this.parent.errors.resolve(this.projectId, fingerprintId);
}
/** Mark a group ignored; it keeps counting and announces nothing. */
ignore(fingerprintId) {
return this.parent.errors.ignore(this.projectId, fingerprintId);
}
/** Open a resolved or ignored group again. */
reopen(fingerprintId) {
return this.parent.errors.reopen(this.projectId, fingerprintId);
}
}
class ScopedArchives {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
create(opts) {
return this.parent.archives.create(this.projectId, opts);
}
get(archiveId) {
return this.parent.archives.get(this.projectId, archiveId);
}
wait(archiveId, opts) {
return this.parent.archives.wait(this.projectId, archiveId, opts);
}
download(archiveId) {
return this.parent.archives.download(this.projectId, archiveId);
}
export(opts) {
return this.parent.archives.export(this.projectId, opts);
}
}
class ScopedSnapshots {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
create(opts) {
return this.parent.snapshots.create(this.projectId, opts);
}
list(opts) {
return this.parent.snapshots.list(this.projectId, opts);
}
get(snapshotId) {
return this.parent.snapshots.get(this.projectId, snapshotId);
}
delete(snapshotId) {
return this.parent.snapshots.delete(this.projectId, snapshotId);
}
restorePlan(snapshotId, opts) {
return this.parent.snapshots.restorePlan(this.projectId, snapshotId, opts);
}
restore(snapshotId, confirm, opts) {
return this.parent.snapshots.restore(this.projectId, snapshotId, confirm, opts);
}
getRestore(snapshotId, restoreId) {
return this.parent.snapshots.getRestore(this.projectId, snapshotId, restoreId);
}
}
class ScopedBranches {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
create(opts) {
return this.parent.branches.create(this.projectId, opts);
}
list() {
return this.parent.branches.list(this.projectId);
}
renew(branchProjectId, opts) {
return this.parent.branches.renew(this.projectId, branchProjectId, opts);
}
delete(branchProjectId) {
return this.parent.branches.delete(this.projectId, branchProjectId);
}
}
class ScopedAuth {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
requestMagicLink(opts) {
return this.parent.auth.requestMagicLink(this.projectId, opts);
}
verifyMagicLink(token) {
return this.parent.auth.verifyMagicLink(this.projectId, token);
}
verifyEmailCode(opts) {
return this.parent.auth.verifyEmailCode(this.projectId, opts);
}
refreshSession(refreshToken) {
return this.parent.auth.refreshSession(this.projectId, refreshToken);
}
actorToken(accessToken) {
return this.parent.auth.actorToken(this.projectId, accessToken);
}
endSession(refreshToken) {
return this.parent.auth.endSession(this.projectId, refreshToken);
}
createUser(opts) {
return this.parent.auth.createUser(this.projectId, opts);
}
inviteUser(opts) {
return this.parent.auth.inviteUser(this.projectId, opts);
}
getUser(opts) {
return this.parent.auth.getUser(this.projectId, opts);
}
createTestSession(opts) {
return this.parent.auth.createTestSession(this.projectId, opts);
}
listTestEmails(opts) {
return this.parent.auth.listTestEmails(this.projectId, opts);
}
setUserPassword(opts) {
return this.parent.auth.setUserPassword(this.projectId, opts);
}
settings(settings) {
return this.parent.auth.settings(this.projectId, settings);
}
/** Give Run402 the project's Sign in with Apple key (never returned). */
setAppleKey(key) {
return this.parent.auth.setAppleKey(this.projectId, key);
}
/** Native Apple sign-in on this project: the key's public fields, the apps, the notification URL, what is missing. */
appleKeyStatus() {
return this.parent.auth.appleKeyStatus(this.projectId);
}
/** Remove the project's Sign in with Apple key. */
removeAppleKey() {
return this.parent.auth.removeAppleKey(this.projectId);
}
createPasskeyRegistrationOptions(opts) {
return this.parent.auth.createPasskeyRegistrationOptions(this.projectId, opts);
}
verifyPasskeyRegistration(opts) {
return this.parent.auth.verifyPasskeyRegistration(this.projectId, opts);
}
createPasskeyLoginOptions(opts) {
return this.parent.auth.createPasskeyLoginOptions(this.projectId, opts);
}
verifyPasskeyLogin(opts) {
return this.parent.auth.verifyPasskeyLogin(this.projectId, opts);
}
listPasskeys(opts) {
return this.parent.auth.listPasskeys(this.projectId, opts);
}
deletePasskey(opts) {
return this.parent.auth.deletePasskey(this.projectId, opts);
}
providers() {
return this.parent.auth.providers(this.projectId);
}
promote(email) {
return this.parent.auth.promote(this.projectId, email);
}
demote(email) {
return this.parent.auth.demote(this.projectId, email);
}
}
class ScopedAssets {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
put(key, source, opts) {
return this.parent.assets.put(this.projectId, key, source, opts);
}
diagnoseUrl(url) {
return this.parent.assets.diagnoseUrl(this.projectId, url);
}
waitFresh(opts) {
return this.parent.assets.waitFresh(this.projectId, opts);
}
get(key) {
return this.parent.assets.get(this.projectId, key);
}
ls(opts) {
return this.parent.assets.ls(this.projectId, opts);
}
rm(key) {
return this.parent.assets.rm(this.projectId, key);
}
sign(key, opts) {
return this.parent.assets.sign(this.projectId, key, opts);
}
signMany(items, opts) {
return this.parent.assets.signMany(this.projectId, items, opts);
}
}
class ScopedContracts {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
provisionSigner(opts) {
return this.parent.contracts.provisionSigner(this.projectId, opts);
}
getSigner(signerId) {
return this.parent.contracts.getSigner(this.projectId, signerId);
}
listSigners() {
return this.parent.contracts.listSigners(this.projectId);
}
setRecovery(signerId, recoveryAddress) {
return this.parent.contracts.setRecovery(this.projectId, signerId, recoveryAddress);
}
setLowBalanceAlert(signerId, thresholdWei) {
return this.parent.contracts.setLowBalanceAlert(this.projectId, signerId, thresholdWei);
}
call(opts) {
return this.parent.contracts.call(this.projectId, opts);
}
deploy(opts) {
return this.parent.contracts.deploy(this.projectId, opts);
}
callStatus(callId) {
return this.parent.contracts.callStatus(this.projectId, callId);
}
transfer(opts) {
return this.parent.contracts.transfer(this.projectId, opts);
}
transferStatus(signerId, transferId) {
return this.parent.contracts.transferStatus(this.projectId, signerId, transferId);
}
listTransfers(signerId) {
return this.parent.contracts.listTransfers(this.projectId, signerId);
}
drain(signerId, destinationAddress) {
return this.parent.contracts.drain(this.projectId, signerId, destinationAddress);
}
deleteSigner(signerId) {
return this.parent.contracts.deleteSigner(this.projectId, signerId);
}
// `read` is not project-scoped — pass through.
read(opts) {
return this.parent.contracts.read(opts);
}
}
function createScopedApplyHero(parent, projectId) {
const bindProject = (spec) => ({ ...spec, project_id: spec.project_id ?? projectId });
const hero = ((spec, opts) => parent._applyEngine.apply(bindProject(spec), opts));
hero.plan = (spec, opts) => parent._applyEngine.plan(bindProject(spec), opts);
hero.start = (spec, opts) => parent._applyEngine.start(bindProject(spec), opts);
hero.resume = (operationId, opts = {}) => parent._applyEngine.resume(operationId, {
...opts,
project: opts.project ?? projectId,
});
hero.promote = (releaseId, opts = {}) => parent._applyEngine.promote(projectId, releaseId, opts);
hero.upload = (plan, opts) => parent._applyEngine.upload(plan, {
...opts,
project: opts.project ?? projectId,
});
hero.commit = (planId, opts = {}) => parent._applyEngine.commit(planId, {
...opts,
project: opts.project ?? projectId,
});
hero.rehearse = (planId, opts = {}) => parent._applyEngine.rehearse(planId, {
...opts,
project: opts.project ?? projectId,
});
hero.status = (operationId, opts = {}) => parent._applyEngine.status(operationId, {
...opts,
project: opts.project ?? projectId,
});
hero.list = (opts = {}) => parent._applyEngine.list({
project: opts.project ?? projectId,
limit: opts.limit,
cursor: opts.cursor,
});
hero.events = (operationId, opts = {}) => parent._applyEngine.events(operationId, {
project: opts.project ?? projectId,
});
hero.edgeCoherence = (operationId, opts = {}) => parent._applyEngine.edgeCoherence(operationId, {
project: opts.project ?? projectId,
});
hero.waitEdgeCoherent = (operationId, opts = {}) => parent._applyEngine.waitEdgeCoherent(operationId, {
...opts,
project: opts.project ?? projectId,
});
hero.getRelease = (releaseId, opts = {}) => parent._applyEngine.getRelease({
project: opts.project ?? projectId,
releaseId,
siteLimit: opts.siteLimit,
});
hero.getActiveRelease = (opts = {}) => parent._applyEngine.getActiveRelease({
project: opts.project ?? projectId,
siteLimit: opts.siteLimit,
});
hero.diff = (opts) => parent._applyEngine.diff({
...opts,
project: opts.project ?? projectId,
});
hero.resolve = (opts) => parent._applyEngine.resolve({
...opts,
project: opts.project ?? projectId,
});
return hero;
}
class ScopedDomains {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
connect(input) {
return this.parent.domains.connect(this.projectId, input);
}
get(domain) {
return this.parent.domains.get(this.projectId, domain);
}
list() {
return this.parent.domains.list(this.projectId);
}
check(domain) {
return this.parent.domains.check(this.projectId, domain);
}
apply(domain) {
return this.parent.domains.apply(this.projectId, domain);
}
repair(domain) {
return this.parent.domains.repair(this.projectId, domain);
}
testReceive(domain, to) {
return this.parent.domains.testReceive(this.projectId, domain, to);
}
activate(domain) {
return this.parent.domains.activate(this.projectId, domain);
}
disconnect(domain) {
return this.parent.domains.disconnect(this.projectId, domain);
}
wait(domain, opts) {
return this.parent.domains.wait(this.projectId, domain, opts);
}
}
class ScopedEmailWebhooks {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
register(opts) {
return this.parent.email.webhooks.register(this.projectId, opts);
}
list() {
return this.parent.email.webhooks.list(this.projectId);
}
get(webhookId) {
return this.parent.email.webhooks.get(this.projectId, webhookId);
}
update(webhookId, opts) {
return this.parent.email.webhooks.update(this.projectId, webhookId, opts);
}
delete(webhookId) {
return this.parent.email.webhooks.delete(this.projectId, webhookId);
}
listDeliveries(opts) {
return this.parent.email.webhooks.listDeliveries(this.projectId, opts);
}
redriveDelivery(deliveryId) {
return this.parent.email.webhooks.redriveDelivery(this.projectId, deliveryId);
}
}
class ScopedEmail {
parent;
projectId;
webhooks;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
this.webhooks = new ScopedEmailWebhooks(parent, projectId);
}
createMailbox(slug) {
return this.parent.email.createMailbox(this.projectId, slug);
}
listMailboxes() {
return this.parent.email.listMailboxes(this.projectId);
}
setMailboxDefaults(opts) {
return this.parent.email.setMailboxDefaults(this.projectId, opts);
}
updateMailbox(opts) {
return this.parent.email.updateMailbox(this.projectId, opts);
}
send(opts) {
return this.parent.email.send(this.projectId, opts);
}
list(opts) {
return this.parent.email.list(this.projectId, opts);
}
get(messageId) {
return this.parent.email.get(this.projectId, messageId);
}
getRaw(messageId) {
return this.parent.email.getRaw(this.projectId, messageId);
}
getMailbox() {
return this.parent.email.getMailbox(this.projectId);
}
deleteMailbox(mailboxId) {
return this.parent.email.deleteMailbox(this.projectId, mailboxId);
}
}
class ScopedFunctionRuns {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
create(name, opts) {
return this.parent.functions.runs.create(this.projectId, name, opts);
}
list(name, opts) {
return this.parent.functions.runs.list(this.projectId, name, opts);
}
get(runId) {
return this.parent.functions.runs.get(this.projectId, runId);
}
logs(runId, opts) {
return this.parent.functions.runs.logs(this.projectId, runId, opts);
}
cancel(runId) {
return this.parent.functions.runs.cancel(this.projectId, runId);
}
redrive(runId, opts) {
return this.parent.functions.runs.redrive(this.projectId, runId, opts);
}
wait(runId, opts) {
return this.parent.functions.runs.wait(this.projectId, runId, opts);
}
}
class ScopedFunctions {
parent;
projectId;
runs;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
this.runs = new ScopedFunctionRuns(parent, projectId);
}
deploy(opts) {
return this.parent.functions.deploy(this.projectId, opts);
}
invoke(name, opts) {
return this.parent.functions.invoke(this.projectId, name, opts);
}
logs(name, opts) {
return this.parent.functions.logs(this.projectId, name, opts);
}
logsByRequestId(requestId, opts) {
return this.parent.functions.logsByRequestId(this.projectId, requestId, opts);
}
list() {
return this.parent.functions.list(this.projectId);
}
delete(name) {
return this.parent.functions.delete(this.projectId, name);
}
update(name, opts) {
return this.parent.functions.update(this.projectId, name, opts);
}
schedule(name, cron, opts) {
return this.parent.functions.schedule(this.projectId, name, cron, opts);
}
unschedule(name, opts) {
return this.parent.functions.unschedule(this.projectId, name, opts);
}
rebuild(name) {
return this.parent.functions.rebuild(this.projectId, name);
}
rebuildAll() {
return this.parent.functions.rebuildAll(this.projectId);
}
}
class ScopedSecrets {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
set(key, opts) {
return this.parent.secrets.set(this.projectId, key, opts);
}
list() {
return this.parent.secrets.list(this.projectId);
}
delete(key) {
return this.parent.secrets.delete(this.projectId, key);
}
}
class ScopedJobs {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
submit(request) {
return this.parent.jobs.submit(this.projectId, request);
}
get(jobId) {
return this.parent.jobs.get(this.projectId, jobId);
}
logs(jobId, opts) {
return this.parent.jobs.logs(this.projectId, jobId, opts);
}
cancel(jobId) {
return this.parent.jobs.cancel(this.projectId, jobId);
}
purge() {
return this.parent.jobs.purge(this.projectId);
}
downloadArtifact(jobId, filename) {
return this.parent.jobs.downloadArtifact(this.projectId, jobId, filename);
}
}
class ScopedSubdomains {
parent;
projectId;
constructor(parent, projectId) {
this.parent = parent;
this.projectId = projectId;
}
list() {
return this.parent.subdomains.list(this.projectId);
}
add(input) {
return this.parent.subdomains.add({
...input,
projectId: input.projectId ?? this.projectId,
});
}
delete(name, opts = {}) {
return this.parent.subdomains.delete(name, {
...opts,
projectId: opts.projectId ?? this.projectId,
});
}
}
export class ScopedRun402 {
/** Resolved project id this client is bound to. Read-only. */
projectId;
projects;
apps;
ai;
auth;
assets;
contracts;
/**
* 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.
*/
apply;
/**
* 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(...)`.
*/
domains;
email;
functions;
jobs;
secrets;
subdomains;
/** Per-project capability grants and their grant keys, project-id pre-bound. */
grants;
/** Cursored project events feed, project-id pre-bound. */
events;
live;
/** Push notification status, per-message delivery outcomes, and the Firebase key, project-id pre-bound. */
push;
/** App repos (plain git repositories the app owns), project-id pre-bound. */
appRepos;
/** Release-error-rollup query surface (list / get / watch), project-id pre-bound. */
errors;
archives;
snapshots;
branches;
constructor(parent, _client, projectId) {
this.projectId = projectId;
this.projects = new ScopedProjects(parent, projectId);
this.apps = new ScopedApps(parent, projectId);
this.ai = new ScopedAi(parent, projectId);
this.auth = new ScopedAuth(parent, projectId);
this.assets = new ScopedAssets(parent, projectId);
this.contracts = new ScopedContracts(parent, projectId);
this.apply = createScopedApplyHero(parent, projectId);
this.domains = new ScopedDomains(parent, projectId);
this.email = new ScopedEmail(parent, projectId);
this.functions = new ScopedFunctions(parent, projectId);
this.jobs = new ScopedJobs(parent, projectId);
this.secrets = new ScopedSecrets(parent, projectId);
this.subdomains = new ScopedSubdomains(parent, projectId);
this.grants = new ScopedGrants(parent, projectId);
this.events = new ScopedEvents(parent, projectId);
this.live = new ScopedLive(parent, projectId);
this.push = new ScopedPush(parent, projectId);
this.appRepos = new ScopedAppRepos(parent, projectId);
this.errors = new ScopedErrors(parent, projectId);
this.archives = new ScopedArchives(parent, projectId);
this.snapshots = new ScopedSnapshots(parent, projectId);
this.branches = new ScopedBranches(parent, projectId);
}
}
//# sourceMappingURL=scoped.js.map