@amerged/ohmyhost-mcp 0.1.10
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/LICENSE +202 -0
- package/NOTICE +4 -0
- package/README.md +11 -0
- package/THIRD_PARTY_NOTICES.md +474 -0
- package/dist/chunk-7MV2EVXV.js +30779 -0
- package/dist/index.js +9 -0
- package/dist/stdio-main.js +5607 -0
- package/package.json +32 -0
- package/src/apps/mcp/index.ts +30 -0
- package/src/apps/mcp/local-client.ts +891 -0
- package/src/apps/mcp/local-server.ts +1512 -0
- package/src/apps/mcp/stdio-main.ts +26 -0
- package/src/apps/product-cli/bin.ts +24 -0
- package/src/apps/product-cli/cli.ts +2271 -0
- package/src/apps/product-cli/command.ts +1811 -0
- package/src/apps/product-cli/composition.ts +823 -0
- package/src/apps/product-cli/credential-store.ts +149 -0
- package/src/apps/product-cli/device-token-expiry.ts +89 -0
- package/src/apps/product-cli/file-credential-store.ts +166 -0
- package/src/apps/product-cli/index.ts +23 -0
- package/src/apps/product-cli/product-api.ts +1082 -0
- package/src/apps/product-cli/project-link-store.ts +30 -0
- package/src/apps/product-cli/psql-session.ts +29 -0
- package/src/apps/product-cli/repository-init.ts +1622 -0
- package/src/apps/product-cli/runtime-contract.ts +1747 -0
- package/src/apps/product-cli/user-token-file.ts +214 -0
- package/src/apps/product-cli/workspace.ts +92 -0
- package/src/packages/agent-skills/generated-skill-resources.ts +147 -0
- package/src/packages/agent-skills/index.ts +37 -0
- package/src/packages/contracts/application-root.ts +80 -0
- package/src/packages/contracts/billing.ts +172 -0
- package/src/packages/contracts/credit-pricing.ts +214 -0
- package/src/packages/contracts/database-access.ts +257 -0
- package/src/packages/contracts/database-compute.ts +72 -0
- package/src/packages/contracts/database-migration-admission.ts +235 -0
- package/src/packages/contracts/feedback.ts +96 -0
- package/src/packages/contracts/framework-admission.ts +280 -0
- package/src/packages/contracts/framework-family.ts +18 -0
- package/src/packages/contracts/functions.ts +76 -0
- package/src/packages/contracts/index.ts +245 -0
- package/src/packages/contracts/operation-deployment-result.ts +165 -0
- package/src/packages/contracts/operation-failure.ts +150 -0
- package/src/packages/contracts/platform-origins.ts +5 -0
- package/src/packages/contracts/project-context.ts +59 -0
- package/src/packages/contracts/project-exports.ts +102 -0
- package/src/packages/contracts/user-api-keys.ts +98 -0
- package/src/packages/sdk-ts/generated/client/client.gen.ts +277 -0
- package/src/packages/sdk-ts/generated/client/index.ts +27 -0
- package/src/packages/sdk-ts/generated/client/types.gen.ts +217 -0
- package/src/packages/sdk-ts/generated/client/utils.gen.ts +316 -0
- package/src/packages/sdk-ts/generated/client.gen.ts +24 -0
- package/src/packages/sdk-ts/generated/core/auth.gen.ts +48 -0
- package/src/packages/sdk-ts/generated/core/bodySerializer.gen.ts +82 -0
- package/src/packages/sdk-ts/generated/core/params.gen.ts +178 -0
- package/src/packages/sdk-ts/generated/core/pathSerializer.gen.ts +171 -0
- package/src/packages/sdk-ts/generated/core/queryKeySerializer.gen.ts +117 -0
- package/src/packages/sdk-ts/generated/core/serverSentEvents.gen.ts +242 -0
- package/src/packages/sdk-ts/generated/core/types.gen.ts +114 -0
- package/src/packages/sdk-ts/generated/core/utils.gen.ts +140 -0
- package/src/packages/sdk-ts/generated/index.ts +578 -0
- package/src/packages/sdk-ts/generated/sdk.gen.ts +3440 -0
- package/src/packages/sdk-ts/generated/types.gen.ts +5790 -0
- package/src/packages/sdk-ts/index.ts +7 -0
- package/src/packages/workos-auth-contracts/device-flow.ts +271 -0
- package/src/packages/workos-auth-contracts/index.ts +8 -0
- package/src/packages/workos-auth-contracts/management-rpc.ts +379 -0
- package/src/packages/workos-auth-contracts/organizations.ts +113 -0
- package/src/packages/workos-auth-contracts/parsing.ts +75 -0
- package/src/packages/workos-auth-contracts/session-status.ts +53 -0
- package/src/packages/workos-auth-contracts/tokens.ts +216 -0
- package/src/packages/workos-auth-contracts/user-api-keys.ts +85 -0
- package/src/packages/workos-auth-contracts/webhooks.ts +127 -0
|
@@ -0,0 +1,1082 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertProjectDatabaseAccess,
|
|
3
|
+
assertProjectDatabaseAccessCredential,
|
|
4
|
+
assertProjectDatabaseAccessPage,
|
|
5
|
+
type DatabaseAccessMode,
|
|
6
|
+
type ProjectDatabaseAccess,
|
|
7
|
+
type ProjectDatabaseAccessCredential,
|
|
8
|
+
type ProjectDatabaseAccessPage,
|
|
9
|
+
type ProjectDatabaseWriteRequest,
|
|
10
|
+
type ProjectDatabaseWriteReceipt,
|
|
11
|
+
} from "@ohmyhost/contracts/database-access";
|
|
12
|
+
import { assertDatabaseCompute, type DatabaseCompute } from "@ohmyhost/contracts/database-compute";
|
|
13
|
+
import {
|
|
14
|
+
assertProjectContext,
|
|
15
|
+
assertProjectNotesReceipt,
|
|
16
|
+
type ProjectContext,
|
|
17
|
+
type ProjectNotesReceipt,
|
|
18
|
+
} from "@ohmyhost/contracts/project-context";
|
|
19
|
+
import { assertProjectExport, type ProjectExport } from "@ohmyhost/contracts/project-exports";
|
|
20
|
+
import {
|
|
21
|
+
parseUserApiKeyCreation,
|
|
22
|
+
parseUserApiKeyPage,
|
|
23
|
+
type UserApiKeyCreation,
|
|
24
|
+
type UserApiKeyPage,
|
|
25
|
+
} from "@ohmyhost/contracts/user-api-keys";
|
|
26
|
+
import { parseFeedbackReceipt } from "@ohmyhost/contracts/feedback";
|
|
27
|
+
import {
|
|
28
|
+
getProjectContext,
|
|
29
|
+
setProjectNotes,
|
|
30
|
+
getDatabaseCompute,
|
|
31
|
+
changeDatabaseCompute,
|
|
32
|
+
createClient,
|
|
33
|
+
createProjectExport,
|
|
34
|
+
getProjectExport,
|
|
35
|
+
createUserApiKey,
|
|
36
|
+
listUserApiKeys,
|
|
37
|
+
revokeUserApiKey,
|
|
38
|
+
createBillingCheckout,
|
|
39
|
+
getBillingCheckout,
|
|
40
|
+
createBillingPortal,
|
|
41
|
+
getBillingRecharge,
|
|
42
|
+
configureBillingRecharge,
|
|
43
|
+
type BillingCheckout,
|
|
44
|
+
type BillingPortal,
|
|
45
|
+
getOrganizationCredits,
|
|
46
|
+
getOrganizationAccount,
|
|
47
|
+
type OrganizationAccount,
|
|
48
|
+
getOrganizationCreditUsage,
|
|
49
|
+
type OrganizationCreditUsage,
|
|
50
|
+
getProjectCreditBudget,
|
|
51
|
+
setProjectCreditBudget,
|
|
52
|
+
type OrganizationCredits,
|
|
53
|
+
type ProjectCreditBudget,
|
|
54
|
+
applyPaidProjectDomain,
|
|
55
|
+
configureProjectDomains,
|
|
56
|
+
configureProjectMailDomain,
|
|
57
|
+
configureProjectSourceAutoDeploy,
|
|
58
|
+
createCloudflareDnsAuthorization,
|
|
59
|
+
createProjectDevAccessTicket,
|
|
60
|
+
createDeployment,
|
|
61
|
+
createProject,
|
|
62
|
+
submitFeedback,
|
|
63
|
+
createOrganization,
|
|
64
|
+
type Organization,
|
|
65
|
+
type GithubConnectionAuthorization,
|
|
66
|
+
type GithubOrganizationConnectionStatus,
|
|
67
|
+
connectGithubOrganization,
|
|
68
|
+
getGithubOrganizationConnection,
|
|
69
|
+
deleteEnvironmentSecret,
|
|
70
|
+
deleteProject,
|
|
71
|
+
deletePaidProjectDomain,
|
|
72
|
+
getOperation,
|
|
73
|
+
getCloudflareDnsAuthorizationStatus,
|
|
74
|
+
getAccountProfile,
|
|
75
|
+
getCurrentIdentity,
|
|
76
|
+
getDeployment,
|
|
77
|
+
getProjectMailDomain,
|
|
78
|
+
getProjectSourceAutoDeploy,
|
|
79
|
+
getProjectStatus,
|
|
80
|
+
getPaidProjectDomain,
|
|
81
|
+
getDeploymentLogs,
|
|
82
|
+
linkProjectSource,
|
|
83
|
+
listEnvironmentSecrets,
|
|
84
|
+
listFunctionRuns,
|
|
85
|
+
listProjects,
|
|
86
|
+
planDeployment,
|
|
87
|
+
planPaidProjectDomain,
|
|
88
|
+
planDeploymentRollback,
|
|
89
|
+
planDeploymentPromotion,
|
|
90
|
+
promoteDeployment,
|
|
91
|
+
planProjectDeletion,
|
|
92
|
+
rollbackDeployment,
|
|
93
|
+
putEnvironmentSecret,
|
|
94
|
+
queryProjectDatabase,
|
|
95
|
+
writeProjectDatabase,
|
|
96
|
+
createProjectDatabaseAccess,
|
|
97
|
+
listProjectDatabaseAccess,
|
|
98
|
+
revokeProjectDatabaseAccess,
|
|
99
|
+
reconcileOperation,
|
|
100
|
+
streamOperationEvents,
|
|
101
|
+
streamDeploymentLogs,
|
|
102
|
+
type DeploymentPlan,
|
|
103
|
+
type CloudflareDnsAuthorization,
|
|
104
|
+
type CloudflareDnsAuthorizationStatus,
|
|
105
|
+
type GuardedActionPlan,
|
|
106
|
+
type Operation,
|
|
107
|
+
type OperationEvent,
|
|
108
|
+
type EnvironmentSecret,
|
|
109
|
+
type EnvironmentSecretPage,
|
|
110
|
+
type FunctionRunPage,
|
|
111
|
+
type DeleteEnvironmentSecretResult,
|
|
112
|
+
type OhMyHostClient,
|
|
113
|
+
type ProviderReconciliationAttempt,
|
|
114
|
+
type ProjectMailDomain,
|
|
115
|
+
type CurrentIdentity,
|
|
116
|
+
type DevAccessTicket,
|
|
117
|
+
type ProjectPage,
|
|
118
|
+
type ProjectStatus,
|
|
119
|
+
type PaidDomain,
|
|
120
|
+
type PaidDomainPlan,
|
|
121
|
+
type ProjectDatabaseQueryResult,
|
|
122
|
+
type DeploymentDiagnostic,
|
|
123
|
+
type DeploymentDiagnosticPage,
|
|
124
|
+
type Deployment,
|
|
125
|
+
type SourceAutoDeploy,
|
|
126
|
+
} from "@ohmyhost/sdk-ts";
|
|
127
|
+
import { parseAccountProfile, type PublicWorkspace } from "./runtime-contract.js";
|
|
128
|
+
|
|
129
|
+
export interface ProjectCreateInput {
|
|
130
|
+
readonly organizationId: string;
|
|
131
|
+
readonly name: string;
|
|
132
|
+
readonly dataMode?: "shared" | "isolated";
|
|
133
|
+
readonly region?: "us" | "eu";
|
|
134
|
+
readonly idempotencyKey: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface ProductApi {
|
|
138
|
+
changeDatabaseCompute(input: {
|
|
139
|
+
projectId: string;
|
|
140
|
+
environment: "dev" | "prod";
|
|
141
|
+
profile: "standard" | "performance";
|
|
142
|
+
idempotencyKey: string;
|
|
143
|
+
}): Promise<import("@ohmyhost/sdk-ts").Operation>;
|
|
144
|
+
getDatabaseCompute(input: {
|
|
145
|
+
projectId: string;
|
|
146
|
+
environment: "dev" | "prod";
|
|
147
|
+
}): Promise<DatabaseCompute>;
|
|
148
|
+
getProjectContext(projectId: string): Promise<ProjectContext>;
|
|
149
|
+
setProjectNotes(input: {
|
|
150
|
+
projectId: string;
|
|
151
|
+
markdown: string;
|
|
152
|
+
expectedVersion: number;
|
|
153
|
+
idempotencyKey: string;
|
|
154
|
+
}): Promise<ProjectNotesReceipt>;
|
|
155
|
+
createProjectExport(input: {
|
|
156
|
+
projectId: string;
|
|
157
|
+
password: string;
|
|
158
|
+
idempotencyKey: string;
|
|
159
|
+
}): Promise<Operation>;
|
|
160
|
+
getProjectExport(input: { projectId: string; exportId: string }): Promise<ProjectExport>;
|
|
161
|
+
createUserApiKey(input: {
|
|
162
|
+
organizationId: string;
|
|
163
|
+
name: string;
|
|
164
|
+
idempotencyKey: string;
|
|
165
|
+
}): Promise<UserApiKeyCreation>;
|
|
166
|
+
listUserApiKeys(input: { organizationId: string; after?: string }): Promise<UserApiKeyPage>;
|
|
167
|
+
revokeUserApiKey(input: { organizationId: string; keyId: string }): Promise<void>;
|
|
168
|
+
createBillingCheckout(input: {
|
|
169
|
+
organizationId: string;
|
|
170
|
+
offer: "topup" | "paid";
|
|
171
|
+
packs: number;
|
|
172
|
+
idempotencyKey: string;
|
|
173
|
+
}): Promise<BillingCheckout>;
|
|
174
|
+
getBillingCheckout(input: {
|
|
175
|
+
organizationId: string;
|
|
176
|
+
checkoutId: string;
|
|
177
|
+
}): Promise<BillingCheckout>;
|
|
178
|
+
getBillingRecharge(organizationId: string): Promise<import("@ohmyhost/sdk-ts").BillingRecharge>;
|
|
179
|
+
configureBillingRecharge(input: {
|
|
180
|
+
organizationId: string;
|
|
181
|
+
enabled: boolean;
|
|
182
|
+
monthlyLimitMinor: number;
|
|
183
|
+
consent: "off_session_v1" | null;
|
|
184
|
+
revision: number;
|
|
185
|
+
idempotencyKey: string;
|
|
186
|
+
}): Promise<import("@ohmyhost/sdk-ts").BillingRecharge>;
|
|
187
|
+
createBillingPortal(organizationId: string): Promise<BillingPortal>;
|
|
188
|
+
getOrganizationAccount(organizationId: string): Promise<OrganizationAccount>;
|
|
189
|
+
getOrganizationCredits(organizationId: string): Promise<OrganizationCredits>;
|
|
190
|
+
getOrganizationCreditUsage(input: {
|
|
191
|
+
organizationId: string;
|
|
192
|
+
month: string;
|
|
193
|
+
cursor?: string;
|
|
194
|
+
}): Promise<OrganizationCreditUsage>;
|
|
195
|
+
getProjectCreditBudget(projectId: string): Promise<ProjectCreditBudget>;
|
|
196
|
+
setProjectCreditBudget(input: {
|
|
197
|
+
projectId: string;
|
|
198
|
+
amountMicros: string | null;
|
|
199
|
+
mode: "continue" | "stop";
|
|
200
|
+
idempotencyKey: string;
|
|
201
|
+
}): Promise<ProjectCreditBudget>;
|
|
202
|
+
createOrganization(input: {
|
|
203
|
+
readonly name: string;
|
|
204
|
+
readonly signupSource?: string;
|
|
205
|
+
readonly idempotencyKey: string;
|
|
206
|
+
}): Promise<Organization>;
|
|
207
|
+
getCurrentIdentity(): Promise<CurrentIdentity>;
|
|
208
|
+
/** The signed-in user's workspaces; an interactive session is required for this route. */
|
|
209
|
+
getAccountProfile(): Promise<readonly PublicWorkspace[]>;
|
|
210
|
+
listProjects(input: { readonly cursor?: string; readonly limit: number }): Promise<ProjectPage>;
|
|
211
|
+
getProjectStatus(projectId: string): Promise<ProjectStatus>;
|
|
212
|
+
writeProjectDatabase(
|
|
213
|
+
input: ProjectDatabaseWriteRequest & { projectId: string; idempotencyKey: string },
|
|
214
|
+
): Promise<ProjectDatabaseWriteReceipt>;
|
|
215
|
+
queryProjectDatabase(input: {
|
|
216
|
+
readonly environment: "dev" | "prod";
|
|
217
|
+
readonly projectId: string;
|
|
218
|
+
readonly statement: string;
|
|
219
|
+
readonly parameters: readonly (string | number | boolean | null)[];
|
|
220
|
+
}): Promise<ProjectDatabaseQueryResult>;
|
|
221
|
+
createProjectDatabaseAccess(input: {
|
|
222
|
+
readonly projectId: string;
|
|
223
|
+
readonly environment: "dev" | "prod";
|
|
224
|
+
readonly mode: DatabaseAccessMode;
|
|
225
|
+
readonly ttlSeconds: number;
|
|
226
|
+
readonly label: string | null;
|
|
227
|
+
}): Promise<ProjectDatabaseAccessCredential>;
|
|
228
|
+
listProjectDatabaseAccess(input: {
|
|
229
|
+
readonly projectId: string;
|
|
230
|
+
readonly environment?: "dev" | "prod";
|
|
231
|
+
}): Promise<ProjectDatabaseAccessPage>;
|
|
232
|
+
revokeProjectDatabaseAccess(input: {
|
|
233
|
+
readonly projectId: string;
|
|
234
|
+
readonly accessId: string;
|
|
235
|
+
}): Promise<ProjectDatabaseAccess>;
|
|
236
|
+
planPaidDomain(input: {
|
|
237
|
+
readonly projectId: string;
|
|
238
|
+
readonly hostname: string;
|
|
239
|
+
}): Promise<PaidDomainPlan>;
|
|
240
|
+
applyPaidDomain(input: {
|
|
241
|
+
readonly projectId: string;
|
|
242
|
+
readonly hostname: string;
|
|
243
|
+
readonly idempotencyKey: string;
|
|
244
|
+
}): Promise<PaidDomain>;
|
|
245
|
+
getPaidDomain(projectId: string): Promise<PaidDomain>;
|
|
246
|
+
deletePaidDomain(input: {
|
|
247
|
+
readonly projectId: string;
|
|
248
|
+
readonly hostname: string;
|
|
249
|
+
readonly idempotencyKey: string;
|
|
250
|
+
}): Promise<PaidDomain>;
|
|
251
|
+
createDevAccessTicket(projectId: string): Promise<DevAccessTicket>;
|
|
252
|
+
submitFeedback(input: {
|
|
253
|
+
report: import("@ohmyhost/sdk-ts").FeedbackSubmission;
|
|
254
|
+
idempotencyKey: string;
|
|
255
|
+
}): Promise<import("@ohmyhost/sdk-ts").FeedbackReceipt>;
|
|
256
|
+
createProject(input: ProjectCreateInput): Promise<Operation>;
|
|
257
|
+
getOperation(operationId: string): Promise<Operation>;
|
|
258
|
+
reconcileOperation(input: {
|
|
259
|
+
readonly operationId: string;
|
|
260
|
+
readonly idempotencyKey: string;
|
|
261
|
+
}): Promise<ProviderReconciliationAttempt>;
|
|
262
|
+
connectGithub(input: {
|
|
263
|
+
readonly organizationId: string;
|
|
264
|
+
readonly idempotencyKey: string;
|
|
265
|
+
}): Promise<GithubConnectionAuthorization>;
|
|
266
|
+
getGithubConnection(organizationId: string): Promise<GithubOrganizationConnectionStatus>;
|
|
267
|
+
linkSource(input: {
|
|
268
|
+
readonly projectId: string;
|
|
269
|
+
readonly repositoryOwner: string;
|
|
270
|
+
readonly repositoryName: string;
|
|
271
|
+
readonly idempotencyKey: string;
|
|
272
|
+
}): Promise<Operation>;
|
|
273
|
+
configureAutoDeploy(input: {
|
|
274
|
+
readonly projectId: string;
|
|
275
|
+
readonly branch: string;
|
|
276
|
+
readonly enabled: boolean;
|
|
277
|
+
readonly idempotencyKey: string;
|
|
278
|
+
}): Promise<SourceAutoDeploy>;
|
|
279
|
+
getAutoDeploy(projectId: string): Promise<SourceAutoDeploy>;
|
|
280
|
+
authorizeCloudflareDns(input: {
|
|
281
|
+
readonly projectId: string;
|
|
282
|
+
readonly zone: string;
|
|
283
|
+
readonly idempotencyKey: string;
|
|
284
|
+
}): Promise<CloudflareDnsAuthorization>;
|
|
285
|
+
getCloudflareDnsStatus(projectId: string): Promise<CloudflareDnsAuthorizationStatus>;
|
|
286
|
+
applyProjectDomains(input: {
|
|
287
|
+
readonly projectId: string;
|
|
288
|
+
readonly idempotencyKey: string;
|
|
289
|
+
}): Promise<Operation>;
|
|
290
|
+
planDeployment(input: {
|
|
291
|
+
readonly projectId: string;
|
|
292
|
+
readonly commitSha: string;
|
|
293
|
+
}): Promise<DeploymentPlan>;
|
|
294
|
+
createDeployment(input: {
|
|
295
|
+
readonly projectId: string;
|
|
296
|
+
readonly planId: string;
|
|
297
|
+
readonly idempotencyKey: string;
|
|
298
|
+
}): Promise<Operation>;
|
|
299
|
+
getDeployment(input: {
|
|
300
|
+
readonly projectId: string;
|
|
301
|
+
readonly deploymentId: string;
|
|
302
|
+
}): Promise<Deployment>;
|
|
303
|
+
streamOperationEvents(
|
|
304
|
+
operationId: string,
|
|
305
|
+
signal: AbortSignal,
|
|
306
|
+
): Promise<AsyncIterable<OperationEvent>>;
|
|
307
|
+
getDeploymentLogs(input: {
|
|
308
|
+
readonly projectId: string;
|
|
309
|
+
readonly deploymentId: string;
|
|
310
|
+
readonly cursor?: string;
|
|
311
|
+
readonly limit: number;
|
|
312
|
+
}): Promise<DeploymentDiagnosticPage>;
|
|
313
|
+
streamDeploymentLogs(
|
|
314
|
+
input: { readonly projectId: string; readonly deploymentId: string },
|
|
315
|
+
signal: AbortSignal,
|
|
316
|
+
): Promise<AsyncIterable<DeploymentDiagnostic>>;
|
|
317
|
+
planRollback(input: {
|
|
318
|
+
readonly projectId: string;
|
|
319
|
+
readonly deploymentId: string;
|
|
320
|
+
}): Promise<GuardedActionPlan>;
|
|
321
|
+
rollback(input: {
|
|
322
|
+
readonly projectId: string;
|
|
323
|
+
readonly deploymentId: string;
|
|
324
|
+
readonly ifMatch: string;
|
|
325
|
+
readonly confirmationToken: string;
|
|
326
|
+
readonly idempotencyKey: string;
|
|
327
|
+
}): Promise<Operation>;
|
|
328
|
+
planPromotion(input: {
|
|
329
|
+
readonly projectId: string;
|
|
330
|
+
readonly sourceDeploymentId: string;
|
|
331
|
+
}): Promise<GuardedActionPlan>;
|
|
332
|
+
promote(input: {
|
|
333
|
+
readonly projectId: string;
|
|
334
|
+
readonly sourceDeploymentId: string;
|
|
335
|
+
readonly ifMatch: string;
|
|
336
|
+
readonly confirmationToken: string;
|
|
337
|
+
readonly idempotencyKey: string;
|
|
338
|
+
}): Promise<Operation>;
|
|
339
|
+
planDelete(projectId: string): Promise<GuardedActionPlan>;
|
|
340
|
+
deleteProject(input: {
|
|
341
|
+
readonly projectId: string;
|
|
342
|
+
readonly ifMatch: string;
|
|
343
|
+
readonly confirmationToken: string;
|
|
344
|
+
readonly idempotencyKey: string;
|
|
345
|
+
}): Promise<Operation>;
|
|
346
|
+
listEnvironmentSecrets(input: {
|
|
347
|
+
readonly projectId: string;
|
|
348
|
+
readonly environmentId: string;
|
|
349
|
+
}): Promise<EnvironmentSecretPage>;
|
|
350
|
+
listFunctionRuns(input: {
|
|
351
|
+
readonly projectId: string;
|
|
352
|
+
readonly environmentId: string;
|
|
353
|
+
readonly limit: number;
|
|
354
|
+
}): Promise<FunctionRunPage>;
|
|
355
|
+
putEnvironmentSecret(input: {
|
|
356
|
+
readonly projectId: string;
|
|
357
|
+
readonly environmentId: string;
|
|
358
|
+
readonly name: string;
|
|
359
|
+
readonly value: string;
|
|
360
|
+
readonly idempotencyKey: string;
|
|
361
|
+
}): Promise<EnvironmentSecret>;
|
|
362
|
+
deleteEnvironmentSecret(input: {
|
|
363
|
+
readonly projectId: string;
|
|
364
|
+
readonly environmentId: string;
|
|
365
|
+
readonly name: string;
|
|
366
|
+
readonly idempotencyKey: string;
|
|
367
|
+
}): Promise<DeleteEnvironmentSecretResult>;
|
|
368
|
+
configureMailDomain(input: {
|
|
369
|
+
readonly projectId: string;
|
|
370
|
+
readonly domain: string;
|
|
371
|
+
readonly idempotencyKey: string;
|
|
372
|
+
}): Promise<ProjectMailDomain>;
|
|
373
|
+
getMailDomain(projectId: string): Promise<ProjectMailDomain>;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export class GeneratedSdkProductApi implements ProductApi {
|
|
377
|
+
readonly #client: OhMyHostClient;
|
|
378
|
+
|
|
379
|
+
public constructor(
|
|
380
|
+
baseUrl: string,
|
|
381
|
+
accessToken: string | (() => Promise<string>),
|
|
382
|
+
fetch: typeof globalThis.fetch,
|
|
383
|
+
) {
|
|
384
|
+
this.#client = createClient({ auth: accessToken, baseUrl, fetch, throwOnError: true });
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
public async changeDatabaseCompute(input: {
|
|
388
|
+
projectId: string;
|
|
389
|
+
environment: "dev" | "prod";
|
|
390
|
+
profile: "standard" | "performance";
|
|
391
|
+
idempotencyKey: string;
|
|
392
|
+
}) {
|
|
393
|
+
return changeDatabaseCompute(
|
|
394
|
+
{
|
|
395
|
+
project_id: input.projectId,
|
|
396
|
+
environment: input.environment,
|
|
397
|
+
profile: input.profile,
|
|
398
|
+
confirm: true,
|
|
399
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
400
|
+
},
|
|
401
|
+
{ client: this.#client },
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
public async getDatabaseCompute(input: { projectId: string; environment: "dev" | "prod" }) {
|
|
405
|
+
const value = await getDatabaseCompute(
|
|
406
|
+
{ project_id: input.projectId, environment: input.environment },
|
|
407
|
+
{ client: this.#client },
|
|
408
|
+
);
|
|
409
|
+
assertDatabaseCompute(value);
|
|
410
|
+
if (value.project_id !== input.projectId || value.environment !== input.environment)
|
|
411
|
+
throw new TypeError("Compute response scope mismatch");
|
|
412
|
+
return value;
|
|
413
|
+
}
|
|
414
|
+
public async getProjectContext(projectId: string) {
|
|
415
|
+
const result = await getProjectContext({ project_id: projectId }, { client: this.#client });
|
|
416
|
+
assertProjectContext(result);
|
|
417
|
+
if (result.project_id !== projectId) throw new TypeError("Project context scope mismatch");
|
|
418
|
+
return result;
|
|
419
|
+
}
|
|
420
|
+
public async setProjectNotes(input: {
|
|
421
|
+
projectId: string;
|
|
422
|
+
markdown: string;
|
|
423
|
+
expectedVersion: number;
|
|
424
|
+
idempotencyKey: string;
|
|
425
|
+
}) {
|
|
426
|
+
const result = await setProjectNotes(
|
|
427
|
+
{
|
|
428
|
+
project_id: input.projectId,
|
|
429
|
+
markdown: input.markdown,
|
|
430
|
+
expected_version: input.expectedVersion,
|
|
431
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
432
|
+
},
|
|
433
|
+
{ client: this.#client },
|
|
434
|
+
);
|
|
435
|
+
assertProjectNotesReceipt(result);
|
|
436
|
+
return result;
|
|
437
|
+
}
|
|
438
|
+
public createProjectExport(input: Parameters<ProductApi["createProjectExport"]>[0]) {
|
|
439
|
+
return createProjectExport(
|
|
440
|
+
{
|
|
441
|
+
project_id: input.projectId,
|
|
442
|
+
password: input.password,
|
|
443
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
444
|
+
},
|
|
445
|
+
{ client: this.#client },
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
public async getProjectExport(input: Parameters<ProductApi["getProjectExport"]>[0]) {
|
|
449
|
+
const result = await getProjectExport(
|
|
450
|
+
{ project_id: input.projectId, export_id: input.exportId },
|
|
451
|
+
{ client: this.#client },
|
|
452
|
+
);
|
|
453
|
+
assertProjectExport(result);
|
|
454
|
+
return result;
|
|
455
|
+
}
|
|
456
|
+
public async getCurrentIdentity(): Promise<CurrentIdentity> {
|
|
457
|
+
return getCurrentIdentity({}, { client: this.#client });
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
public async getAccountProfile(): Promise<readonly PublicWorkspace[]> {
|
|
461
|
+
return parseAccountProfile(await getAccountProfile({ client: this.#client }));
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
public getOrganizationAccount(organizationId: string) {
|
|
465
|
+
return getOrganizationAccount({ organization_id: organizationId }, { client: this.#client });
|
|
466
|
+
}
|
|
467
|
+
public getOrganizationCredits(organizationId: string) {
|
|
468
|
+
return getOrganizationCredits({ organization_id: organizationId }, { client: this.#client });
|
|
469
|
+
}
|
|
470
|
+
public async createUserApiKey(input: Parameters<ProductApi["createUserApiKey"]>[0]) {
|
|
471
|
+
return parseUserApiKeyCreation(
|
|
472
|
+
await createUserApiKey(
|
|
473
|
+
{
|
|
474
|
+
organization_id: input.organizationId,
|
|
475
|
+
name: input.name,
|
|
476
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
477
|
+
},
|
|
478
|
+
{ client: this.#client },
|
|
479
|
+
),
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
public async listUserApiKeys(input: Parameters<ProductApi["listUserApiKeys"]>[0]) {
|
|
483
|
+
return parseUserApiKeyPage(
|
|
484
|
+
await listUserApiKeys(
|
|
485
|
+
{ organization_id: input.organizationId, ...(input.after ? { after: input.after } : {}) },
|
|
486
|
+
{ client: this.#client },
|
|
487
|
+
),
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
public async revokeUserApiKey(input: Parameters<ProductApi["revokeUserApiKey"]>[0]) {
|
|
491
|
+
await revokeUserApiKey(
|
|
492
|
+
{ organization_id: input.organizationId, key_id: input.keyId },
|
|
493
|
+
{ client: this.#client },
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
public createBillingCheckout(input: Parameters<ProductApi["createBillingCheckout"]>[0]) {
|
|
497
|
+
return createBillingCheckout(
|
|
498
|
+
{
|
|
499
|
+
organization_id: input.organizationId,
|
|
500
|
+
offer: input.offer,
|
|
501
|
+
packs: input.packs,
|
|
502
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
503
|
+
},
|
|
504
|
+
{ client: this.#client },
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
public getBillingCheckout(input: Parameters<ProductApi["getBillingCheckout"]>[0]) {
|
|
508
|
+
return getBillingCheckout(
|
|
509
|
+
{ organization_id: input.organizationId, checkout_id: input.checkoutId },
|
|
510
|
+
{ client: this.#client },
|
|
511
|
+
);
|
|
512
|
+
}
|
|
513
|
+
public getBillingRecharge(organizationId: string) {
|
|
514
|
+
return getBillingRecharge({ organization_id: organizationId }, { client: this.#client });
|
|
515
|
+
}
|
|
516
|
+
public configureBillingRecharge(input: Parameters<ProductApi["configureBillingRecharge"]>[0]) {
|
|
517
|
+
return configureBillingRecharge(
|
|
518
|
+
{
|
|
519
|
+
organization_id: input.organizationId,
|
|
520
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
521
|
+
enabled: input.enabled,
|
|
522
|
+
monthly_limit_minor: input.monthlyLimitMinor,
|
|
523
|
+
consent: input.consent,
|
|
524
|
+
revision: input.revision,
|
|
525
|
+
},
|
|
526
|
+
{ client: this.#client },
|
|
527
|
+
);
|
|
528
|
+
}
|
|
529
|
+
public createBillingPortal(organizationId: string) {
|
|
530
|
+
return createBillingPortal(
|
|
531
|
+
{ organization_id: organizationId, body: {} },
|
|
532
|
+
{ client: this.#client },
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
public getOrganizationCreditUsage(
|
|
536
|
+
input: Parameters<ProductApi["getOrganizationCreditUsage"]>[0],
|
|
537
|
+
) {
|
|
538
|
+
return getOrganizationCreditUsage(
|
|
539
|
+
{
|
|
540
|
+
organization_id: input.organizationId,
|
|
541
|
+
month: input.month,
|
|
542
|
+
...(input.cursor ? { cursor: input.cursor } : {}),
|
|
543
|
+
},
|
|
544
|
+
{ client: this.#client },
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
public getProjectCreditBudget(projectId: string) {
|
|
548
|
+
return getProjectCreditBudget({ project_id: projectId }, { client: this.#client });
|
|
549
|
+
}
|
|
550
|
+
public setProjectCreditBudget(input: Parameters<ProductApi["setProjectCreditBudget"]>[0]) {
|
|
551
|
+
return setProjectCreditBudget(
|
|
552
|
+
{
|
|
553
|
+
project_id: input.projectId,
|
|
554
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
555
|
+
setProjectCreditBudgetRequest: { amount_micros: input.amountMicros, mode: input.mode },
|
|
556
|
+
},
|
|
557
|
+
{ client: this.#client },
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
public createOrganization(input: {
|
|
562
|
+
readonly name: string;
|
|
563
|
+
readonly signupSource?: string;
|
|
564
|
+
readonly idempotencyKey: string;
|
|
565
|
+
}): Promise<Organization> {
|
|
566
|
+
return createOrganization(
|
|
567
|
+
{
|
|
568
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
569
|
+
createOrganizationRequest: {
|
|
570
|
+
name: input.name,
|
|
571
|
+
...(input.signupSource === undefined ? {} : { signup_source: input.signupSource }),
|
|
572
|
+
},
|
|
573
|
+
},
|
|
574
|
+
{ client: this.#client },
|
|
575
|
+
);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
public async listProjects(input: {
|
|
579
|
+
readonly cursor?: string;
|
|
580
|
+
readonly limit: number;
|
|
581
|
+
}): Promise<ProjectPage> {
|
|
582
|
+
return listProjects(input, { client: this.#client });
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
public async getProjectStatus(projectId: string): Promise<ProjectStatus> {
|
|
586
|
+
return getProjectStatus({ project_id: projectId }, { client: this.#client });
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
public async writeProjectDatabase(
|
|
590
|
+
input: ProjectDatabaseWriteRequest & { projectId: string; idempotencyKey: string },
|
|
591
|
+
): Promise<ProjectDatabaseWriteReceipt> {
|
|
592
|
+
return writeProjectDatabase(
|
|
593
|
+
{
|
|
594
|
+
project_id: input.projectId,
|
|
595
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
596
|
+
projectDatabaseWriteRequest: {
|
|
597
|
+
environment: input.environment,
|
|
598
|
+
statement: input.statement,
|
|
599
|
+
parameters: [...input.parameters],
|
|
600
|
+
},
|
|
601
|
+
},
|
|
602
|
+
{ client: this.#client },
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
public async queryProjectDatabase(input: {
|
|
606
|
+
readonly environment: "dev" | "prod";
|
|
607
|
+
readonly projectId: string;
|
|
608
|
+
readonly statement: string;
|
|
609
|
+
readonly parameters: readonly (string | number | boolean | null)[];
|
|
610
|
+
}): Promise<ProjectDatabaseQueryResult> {
|
|
611
|
+
return queryProjectDatabase(
|
|
612
|
+
{
|
|
613
|
+
project_id: input.projectId,
|
|
614
|
+
projectDatabaseQueryRequest: {
|
|
615
|
+
environment: input.environment,
|
|
616
|
+
statement: input.statement,
|
|
617
|
+
parameters: [...input.parameters],
|
|
618
|
+
},
|
|
619
|
+
},
|
|
620
|
+
{ client: this.#client },
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/** The connection URI exists only in this response; nothing in the CLI persists it. */
|
|
625
|
+
public async createProjectDatabaseAccess(
|
|
626
|
+
input: Parameters<ProductApi["createProjectDatabaseAccess"]>[0],
|
|
627
|
+
): Promise<ProjectDatabaseAccessCredential> {
|
|
628
|
+
const value = await createProjectDatabaseAccess(
|
|
629
|
+
{
|
|
630
|
+
project_id: input.projectId,
|
|
631
|
+
projectDatabaseAccessRequest: {
|
|
632
|
+
environment: input.environment,
|
|
633
|
+
mode: input.mode,
|
|
634
|
+
ttl_seconds: input.ttlSeconds,
|
|
635
|
+
label: input.label,
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
{ client: this.#client },
|
|
639
|
+
);
|
|
640
|
+
assertProjectDatabaseAccessCredential(value);
|
|
641
|
+
return value;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
public async listProjectDatabaseAccess(
|
|
645
|
+
input: Parameters<ProductApi["listProjectDatabaseAccess"]>[0],
|
|
646
|
+
): Promise<ProjectDatabaseAccessPage> {
|
|
647
|
+
const value = await listProjectDatabaseAccess(
|
|
648
|
+
{
|
|
649
|
+
project_id: input.projectId,
|
|
650
|
+
...(input.environment === undefined ? {} : { environment: input.environment }),
|
|
651
|
+
},
|
|
652
|
+
{ client: this.#client },
|
|
653
|
+
);
|
|
654
|
+
assertProjectDatabaseAccessPage(value);
|
|
655
|
+
return value;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
public async revokeProjectDatabaseAccess(
|
|
659
|
+
input: Parameters<ProductApi["revokeProjectDatabaseAccess"]>[0],
|
|
660
|
+
): Promise<ProjectDatabaseAccess> {
|
|
661
|
+
const value = await revokeProjectDatabaseAccess(
|
|
662
|
+
{ project_id: input.projectId, access_id: input.accessId },
|
|
663
|
+
{ client: this.#client },
|
|
664
|
+
);
|
|
665
|
+
assertProjectDatabaseAccess(value);
|
|
666
|
+
return value;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
public async planPaidDomain(input: {
|
|
670
|
+
readonly projectId: string;
|
|
671
|
+
readonly hostname: string;
|
|
672
|
+
}): Promise<PaidDomainPlan> {
|
|
673
|
+
return planPaidProjectDomain(
|
|
674
|
+
{ project_id: input.projectId, paidDomainRequest: { hostname: input.hostname } },
|
|
675
|
+
{ client: this.#client },
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
public async applyPaidDomain(input: {
|
|
680
|
+
readonly projectId: string;
|
|
681
|
+
readonly hostname: string;
|
|
682
|
+
readonly idempotencyKey: string;
|
|
683
|
+
}): Promise<PaidDomain> {
|
|
684
|
+
return applyPaidProjectDomain(
|
|
685
|
+
{
|
|
686
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
687
|
+
project_id: input.projectId,
|
|
688
|
+
paidDomainRequest: { hostname: input.hostname },
|
|
689
|
+
},
|
|
690
|
+
{ client: this.#client },
|
|
691
|
+
);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
public async getPaidDomain(projectId: string): Promise<PaidDomain> {
|
|
695
|
+
return getPaidProjectDomain({ project_id: projectId }, { client: this.#client });
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
public async deletePaidDomain(input: {
|
|
699
|
+
readonly projectId: string;
|
|
700
|
+
readonly hostname: string;
|
|
701
|
+
readonly idempotencyKey: string;
|
|
702
|
+
}): Promise<PaidDomain> {
|
|
703
|
+
return deletePaidProjectDomain(
|
|
704
|
+
{
|
|
705
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
706
|
+
project_id: input.projectId,
|
|
707
|
+
paidDomainRequest: { hostname: input.hostname },
|
|
708
|
+
},
|
|
709
|
+
{ client: this.#client },
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
public async createDevAccessTicket(projectId: string): Promise<DevAccessTicket> {
|
|
714
|
+
return createProjectDevAccessTicket({ project_id: projectId }, { client: this.#client });
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
public async submitFeedback(input: {
|
|
718
|
+
report: import("@ohmyhost/sdk-ts").FeedbackSubmission;
|
|
719
|
+
idempotencyKey: string;
|
|
720
|
+
}): Promise<import("@ohmyhost/sdk-ts").FeedbackReceipt> {
|
|
721
|
+
return parseFeedbackReceipt(
|
|
722
|
+
await submitFeedback(
|
|
723
|
+
{ "Idempotency-Key": input.idempotencyKey, feedbackSubmission: input.report },
|
|
724
|
+
{ client: this.#client },
|
|
725
|
+
),
|
|
726
|
+
);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
public async createProject(input: ProjectCreateInput): Promise<Operation> {
|
|
730
|
+
return createProject(
|
|
731
|
+
{
|
|
732
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
733
|
+
createProjectRequest: {
|
|
734
|
+
organization_id: input.organizationId,
|
|
735
|
+
name: input.name,
|
|
736
|
+
...(input.dataMode === undefined ? {} : { data_mode: input.dataMode }),
|
|
737
|
+
...(input.region === undefined ? {} : { region: input.region }),
|
|
738
|
+
},
|
|
739
|
+
},
|
|
740
|
+
{ client: this.#client },
|
|
741
|
+
);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
public async getOperation(operationId: string): Promise<Operation> {
|
|
745
|
+
return getOperation({ operation_id: operationId }, { client: this.#client });
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
public async reconcileOperation(input: {
|
|
749
|
+
readonly operationId: string;
|
|
750
|
+
readonly idempotencyKey: string;
|
|
751
|
+
}): Promise<ProviderReconciliationAttempt> {
|
|
752
|
+
return reconcileOperation(
|
|
753
|
+
{
|
|
754
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
755
|
+
operation_id: input.operationId,
|
|
756
|
+
},
|
|
757
|
+
{ client: this.#client },
|
|
758
|
+
);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
public async connectGithub(input: {
|
|
762
|
+
readonly organizationId: string;
|
|
763
|
+
readonly idempotencyKey: string;
|
|
764
|
+
}): Promise<GithubConnectionAuthorization> {
|
|
765
|
+
return connectGithubOrganization(
|
|
766
|
+
{
|
|
767
|
+
organization_id: input.organizationId,
|
|
768
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
769
|
+
connectGithubOrganizationRequest: {},
|
|
770
|
+
},
|
|
771
|
+
{ client: this.#client },
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
public async getGithubConnection(
|
|
776
|
+
organizationId: string,
|
|
777
|
+
): Promise<GithubOrganizationConnectionStatus> {
|
|
778
|
+
return getGithubOrganizationConnection(
|
|
779
|
+
{ organization_id: organizationId },
|
|
780
|
+
{ client: this.#client },
|
|
781
|
+
);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
public async linkSource(input: {
|
|
785
|
+
readonly projectId: string;
|
|
786
|
+
readonly repositoryOwner: string;
|
|
787
|
+
readonly repositoryName: string;
|
|
788
|
+
readonly idempotencyKey: string;
|
|
789
|
+
}): Promise<Operation> {
|
|
790
|
+
return linkProjectSource(
|
|
791
|
+
{
|
|
792
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
793
|
+
project_id: input.projectId,
|
|
794
|
+
linkProjectSourceRequest: {
|
|
795
|
+
repository_owner: input.repositoryOwner,
|
|
796
|
+
repository_name: input.repositoryName,
|
|
797
|
+
},
|
|
798
|
+
},
|
|
799
|
+
{ client: this.#client },
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
public async configureAutoDeploy(input: {
|
|
804
|
+
readonly projectId: string;
|
|
805
|
+
readonly branch: string;
|
|
806
|
+
readonly enabled: boolean;
|
|
807
|
+
readonly idempotencyKey: string;
|
|
808
|
+
}): Promise<SourceAutoDeploy> {
|
|
809
|
+
return configureProjectSourceAutoDeploy(
|
|
810
|
+
{
|
|
811
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
812
|
+
project_id: input.projectId,
|
|
813
|
+
configureSourceAutoDeployRequest: { branch: input.branch, enabled: input.enabled },
|
|
814
|
+
},
|
|
815
|
+
{ client: this.#client },
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
public async getAutoDeploy(projectId: string): Promise<SourceAutoDeploy> {
|
|
820
|
+
return getProjectSourceAutoDeploy({ project_id: projectId }, { client: this.#client });
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
public async authorizeCloudflareDns(input: {
|
|
824
|
+
readonly projectId: string;
|
|
825
|
+
readonly zone: string;
|
|
826
|
+
readonly idempotencyKey: string;
|
|
827
|
+
}): Promise<CloudflareDnsAuthorization> {
|
|
828
|
+
return createCloudflareDnsAuthorization(
|
|
829
|
+
{
|
|
830
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
831
|
+
project_id: input.projectId,
|
|
832
|
+
createCloudflareDnsAuthorizationRequest: { zone: input.zone },
|
|
833
|
+
},
|
|
834
|
+
{ client: this.#client },
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
public async getCloudflareDnsStatus(
|
|
839
|
+
projectId: string,
|
|
840
|
+
): Promise<CloudflareDnsAuthorizationStatus> {
|
|
841
|
+
return getCloudflareDnsAuthorizationStatus({ project_id: projectId }, { client: this.#client });
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
public async applyProjectDomains(input: {
|
|
845
|
+
readonly projectId: string;
|
|
846
|
+
readonly idempotencyKey: string;
|
|
847
|
+
}): Promise<Operation> {
|
|
848
|
+
return configureProjectDomains(
|
|
849
|
+
{ "Idempotency-Key": input.idempotencyKey, project_id: input.projectId },
|
|
850
|
+
{ client: this.#client },
|
|
851
|
+
);
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
public async planDeployment(input: {
|
|
855
|
+
readonly projectId: string;
|
|
856
|
+
readonly commitSha: string;
|
|
857
|
+
}): Promise<DeploymentPlan> {
|
|
858
|
+
return planDeployment(
|
|
859
|
+
{ project_id: input.projectId, planDeploymentRequest: { commit_sha: input.commitSha } },
|
|
860
|
+
{ client: this.#client },
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
public async createDeployment(input: {
|
|
865
|
+
readonly projectId: string;
|
|
866
|
+
readonly planId: string;
|
|
867
|
+
readonly idempotencyKey: string;
|
|
868
|
+
}): Promise<Operation> {
|
|
869
|
+
return createDeployment(
|
|
870
|
+
{
|
|
871
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
872
|
+
project_id: input.projectId,
|
|
873
|
+
createDeploymentRequest: { plan_id: input.planId },
|
|
874
|
+
},
|
|
875
|
+
{ client: this.#client },
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
public async getDeployment(input: {
|
|
880
|
+
readonly projectId: string;
|
|
881
|
+
readonly deploymentId: string;
|
|
882
|
+
}): Promise<Deployment> {
|
|
883
|
+
return getDeployment(
|
|
884
|
+
{ project_id: input.projectId, deployment_id: input.deploymentId },
|
|
885
|
+
{ client: this.#client },
|
|
886
|
+
);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
public async streamOperationEvents(
|
|
890
|
+
operationId: string,
|
|
891
|
+
signal: AbortSignal,
|
|
892
|
+
): Promise<AsyncIterable<OperationEvent>> {
|
|
893
|
+
return (
|
|
894
|
+
await streamOperationEvents(
|
|
895
|
+
{ operation_id: operationId },
|
|
896
|
+
{ client: this.#client, signal, headers: { Accept: "text/event-stream" } },
|
|
897
|
+
)
|
|
898
|
+
).stream;
|
|
899
|
+
}
|
|
900
|
+
public async getDeploymentLogs(input: {
|
|
901
|
+
readonly projectId: string;
|
|
902
|
+
readonly deploymentId: string;
|
|
903
|
+
readonly cursor?: string;
|
|
904
|
+
readonly limit: number;
|
|
905
|
+
}): Promise<DeploymentDiagnosticPage> {
|
|
906
|
+
return getDeploymentLogs(
|
|
907
|
+
{
|
|
908
|
+
project_id: input.projectId,
|
|
909
|
+
deployment_id: input.deploymentId,
|
|
910
|
+
limit: input.limit,
|
|
911
|
+
...(input.cursor === undefined ? {} : { cursor: input.cursor }),
|
|
912
|
+
},
|
|
913
|
+
{ client: this.#client },
|
|
914
|
+
);
|
|
915
|
+
}
|
|
916
|
+
public async streamDeploymentLogs(
|
|
917
|
+
input: { readonly projectId: string; readonly deploymentId: string },
|
|
918
|
+
signal: AbortSignal,
|
|
919
|
+
): Promise<AsyncIterable<DeploymentDiagnostic>> {
|
|
920
|
+
return (
|
|
921
|
+
await streamDeploymentLogs(
|
|
922
|
+
{ project_id: input.projectId, deployment_id: input.deploymentId },
|
|
923
|
+
{ client: this.#client, signal, headers: { Accept: "text/event-stream" } },
|
|
924
|
+
)
|
|
925
|
+
).stream;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
public async planRollback(input: {
|
|
929
|
+
readonly projectId: string;
|
|
930
|
+
readonly deploymentId: string;
|
|
931
|
+
}): Promise<GuardedActionPlan> {
|
|
932
|
+
return planDeploymentRollback(
|
|
933
|
+
{ project_id: input.projectId, target_deployment_id: input.deploymentId },
|
|
934
|
+
{ client: this.#client },
|
|
935
|
+
);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
public async rollback(input: {
|
|
939
|
+
readonly projectId: string;
|
|
940
|
+
readonly deploymentId: string;
|
|
941
|
+
readonly ifMatch: string;
|
|
942
|
+
readonly confirmationToken: string;
|
|
943
|
+
readonly idempotencyKey: string;
|
|
944
|
+
}): Promise<Operation> {
|
|
945
|
+
return rollbackDeployment(
|
|
946
|
+
{
|
|
947
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
948
|
+
"If-Match": input.ifMatch,
|
|
949
|
+
"X-Confirmation-Token": input.confirmationToken,
|
|
950
|
+
project_id: input.projectId,
|
|
951
|
+
target_deployment_id: input.deploymentId,
|
|
952
|
+
},
|
|
953
|
+
{ client: this.#client },
|
|
954
|
+
);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
public async planPromotion(input: {
|
|
958
|
+
readonly projectId: string;
|
|
959
|
+
readonly sourceDeploymentId: string;
|
|
960
|
+
}): Promise<GuardedActionPlan> {
|
|
961
|
+
return planDeploymentPromotion(
|
|
962
|
+
{ project_id: input.projectId, source_deployment_id: input.sourceDeploymentId },
|
|
963
|
+
{ client: this.#client },
|
|
964
|
+
);
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
public async promote(input: {
|
|
968
|
+
readonly projectId: string;
|
|
969
|
+
readonly sourceDeploymentId: string;
|
|
970
|
+
readonly ifMatch: string;
|
|
971
|
+
readonly confirmationToken: string;
|
|
972
|
+
readonly idempotencyKey: string;
|
|
973
|
+
}): Promise<Operation> {
|
|
974
|
+
return promoteDeployment(
|
|
975
|
+
{
|
|
976
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
977
|
+
"If-Match": input.ifMatch,
|
|
978
|
+
"X-Confirmation-Token": input.confirmationToken,
|
|
979
|
+
project_id: input.projectId,
|
|
980
|
+
source_deployment_id: input.sourceDeploymentId,
|
|
981
|
+
},
|
|
982
|
+
{ client: this.#client },
|
|
983
|
+
);
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
public async planDelete(projectId: string): Promise<GuardedActionPlan> {
|
|
987
|
+
return planProjectDeletion({ project_id: projectId }, { client: this.#client });
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
public async deleteProject(input: {
|
|
991
|
+
readonly projectId: string;
|
|
992
|
+
readonly ifMatch: string;
|
|
993
|
+
readonly confirmationToken: string;
|
|
994
|
+
readonly idempotencyKey: string;
|
|
995
|
+
}): Promise<Operation> {
|
|
996
|
+
return deleteProject(
|
|
997
|
+
{
|
|
998
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
999
|
+
"If-Match": input.ifMatch,
|
|
1000
|
+
"X-Confirmation-Token": input.confirmationToken,
|
|
1001
|
+
project_id: input.projectId,
|
|
1002
|
+
},
|
|
1003
|
+
{ client: this.#client },
|
|
1004
|
+
);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
public async listEnvironmentSecrets(input: {
|
|
1008
|
+
readonly projectId: string;
|
|
1009
|
+
readonly environmentId: string;
|
|
1010
|
+
}): Promise<EnvironmentSecretPage> {
|
|
1011
|
+
return listEnvironmentSecrets(
|
|
1012
|
+
{ project_id: input.projectId, environment_id: input.environmentId },
|
|
1013
|
+
{ client: this.#client },
|
|
1014
|
+
);
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
public async listFunctionRuns(input: {
|
|
1018
|
+
readonly projectId: string;
|
|
1019
|
+
readonly environmentId: string;
|
|
1020
|
+
readonly limit: number;
|
|
1021
|
+
}): Promise<FunctionRunPage> {
|
|
1022
|
+
return listFunctionRuns(
|
|
1023
|
+
{ project_id: input.projectId, environment_id: input.environmentId, limit: input.limit },
|
|
1024
|
+
{ client: this.#client },
|
|
1025
|
+
);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
public async putEnvironmentSecret(input: {
|
|
1029
|
+
readonly projectId: string;
|
|
1030
|
+
readonly environmentId: string;
|
|
1031
|
+
readonly name: string;
|
|
1032
|
+
readonly value: string;
|
|
1033
|
+
readonly idempotencyKey: string;
|
|
1034
|
+
}): Promise<EnvironmentSecret> {
|
|
1035
|
+
return putEnvironmentSecret(
|
|
1036
|
+
{
|
|
1037
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
1038
|
+
project_id: input.projectId,
|
|
1039
|
+
environment_id: input.environmentId,
|
|
1040
|
+
secret_name: input.name,
|
|
1041
|
+
putEnvironmentSecretRequest: { value: input.value },
|
|
1042
|
+
},
|
|
1043
|
+
{ client: this.#client },
|
|
1044
|
+
);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
public async deleteEnvironmentSecret(input: {
|
|
1048
|
+
readonly projectId: string;
|
|
1049
|
+
readonly environmentId: string;
|
|
1050
|
+
readonly name: string;
|
|
1051
|
+
readonly idempotencyKey: string;
|
|
1052
|
+
}): Promise<DeleteEnvironmentSecretResult> {
|
|
1053
|
+
return deleteEnvironmentSecret(
|
|
1054
|
+
{
|
|
1055
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
1056
|
+
project_id: input.projectId,
|
|
1057
|
+
environment_id: input.environmentId,
|
|
1058
|
+
secret_name: input.name,
|
|
1059
|
+
},
|
|
1060
|
+
{ client: this.#client },
|
|
1061
|
+
);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
public async configureMailDomain(input: {
|
|
1065
|
+
readonly projectId: string;
|
|
1066
|
+
readonly domain: string;
|
|
1067
|
+
readonly idempotencyKey: string;
|
|
1068
|
+
}): Promise<ProjectMailDomain> {
|
|
1069
|
+
return configureProjectMailDomain(
|
|
1070
|
+
{
|
|
1071
|
+
"Idempotency-Key": input.idempotencyKey,
|
|
1072
|
+
project_id: input.projectId,
|
|
1073
|
+
configureProjectMailDomainRequest: { domain: input.domain },
|
|
1074
|
+
},
|
|
1075
|
+
{ client: this.#client },
|
|
1076
|
+
);
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
public async getMailDomain(projectId: string): Promise<ProjectMailDomain> {
|
|
1080
|
+
return getProjectMailDomain({ project_id: projectId }, { client: this.#client });
|
|
1081
|
+
}
|
|
1082
|
+
}
|