@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,3440 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import { client } from "./client.gen.js";
|
|
4
|
+
import {
|
|
5
|
+
buildClientParams,
|
|
6
|
+
type Client,
|
|
7
|
+
type ClientMeta,
|
|
8
|
+
type Options as Options2,
|
|
9
|
+
type RequestResult,
|
|
10
|
+
type ServerSentEventsResult,
|
|
11
|
+
type TDataShape,
|
|
12
|
+
} from "./client/index.js";
|
|
13
|
+
import type {
|
|
14
|
+
ApplyPaidProjectDomainErrors,
|
|
15
|
+
ApplyPaidProjectDomainResponses,
|
|
16
|
+
ChangeDatabaseComputeErrors,
|
|
17
|
+
ChangeDatabaseComputeResponses,
|
|
18
|
+
CompleteCloudflareDnsAuthorizationErrors,
|
|
19
|
+
CompleteCloudflareDnsAuthorizationResponses,
|
|
20
|
+
CompleteGithubSourceAuthorizationErrors,
|
|
21
|
+
ConfigureBillingRechargeErrors,
|
|
22
|
+
ConfigureBillingRechargeResponses,
|
|
23
|
+
ConfigureProjectDomainsErrors,
|
|
24
|
+
ConfigureProjectDomainsResponses,
|
|
25
|
+
ConfigureProjectMailDomainErrors,
|
|
26
|
+
ConfigureProjectMailDomainRequest,
|
|
27
|
+
ConfigureProjectMailDomainResponses,
|
|
28
|
+
ConfigureProjectSourceAutoDeployErrors,
|
|
29
|
+
ConfigureProjectSourceAutoDeployResponses,
|
|
30
|
+
ConfigureSourceAutoDeployRequest,
|
|
31
|
+
ConfirmationToken,
|
|
32
|
+
ConnectGithubOrganizationErrors,
|
|
33
|
+
ConnectGithubOrganizationRequest,
|
|
34
|
+
ConnectGithubOrganizationResponses,
|
|
35
|
+
CreateBillingCheckoutErrors,
|
|
36
|
+
CreateBillingCheckoutResponses,
|
|
37
|
+
CreateBillingPortalErrors,
|
|
38
|
+
CreateBillingPortalResponses,
|
|
39
|
+
CreateCloudflareDnsAuthorizationErrors,
|
|
40
|
+
CreateCloudflareDnsAuthorizationRequest,
|
|
41
|
+
CreateCloudflareDnsAuthorizationResponses,
|
|
42
|
+
CreateDeploymentErrors,
|
|
43
|
+
CreateDeploymentRequest,
|
|
44
|
+
CreateDeploymentResponses,
|
|
45
|
+
CreateOrganizationErrors,
|
|
46
|
+
CreateOrganizationRequest,
|
|
47
|
+
CreateOrganizationResponses,
|
|
48
|
+
CreateProjectDatabaseAccessErrors,
|
|
49
|
+
CreateProjectDatabaseAccessResponses,
|
|
50
|
+
CreateProjectDevAccessTicketErrors,
|
|
51
|
+
CreateProjectDevAccessTicketResponses,
|
|
52
|
+
CreateProjectErrors,
|
|
53
|
+
CreateProjectExportErrors,
|
|
54
|
+
CreateProjectExportResponses,
|
|
55
|
+
CreateProjectRequest,
|
|
56
|
+
CreateProjectResponses,
|
|
57
|
+
CreateUserApiKeyErrors,
|
|
58
|
+
CreateUserApiKeyResponses,
|
|
59
|
+
DeleteEnvironmentSecretErrors,
|
|
60
|
+
DeleteEnvironmentSecretResponses,
|
|
61
|
+
DeletePaidProjectDomainErrors,
|
|
62
|
+
DeletePaidProjectDomainResponses,
|
|
63
|
+
DeleteProjectErrors,
|
|
64
|
+
DeleteProjectResponses,
|
|
65
|
+
FeedbackSubmission,
|
|
66
|
+
GetAccountProfileErrors,
|
|
67
|
+
GetAccountProfileResponses,
|
|
68
|
+
GetBillingCheckoutErrors,
|
|
69
|
+
GetBillingCheckoutResponses,
|
|
70
|
+
GetBillingRechargeErrors,
|
|
71
|
+
GetBillingRechargeResponses,
|
|
72
|
+
GetCloudflareDnsAuthorizationStatusErrors,
|
|
73
|
+
GetCloudflareDnsAuthorizationStatusResponses,
|
|
74
|
+
GetCurrentIdentityErrors,
|
|
75
|
+
GetCurrentIdentityResponses,
|
|
76
|
+
GetDatabaseComputeErrors,
|
|
77
|
+
GetDatabaseComputeResponses,
|
|
78
|
+
GetDeploymentErrors,
|
|
79
|
+
GetDeploymentLogsErrors,
|
|
80
|
+
GetDeploymentLogsResponses,
|
|
81
|
+
GetDeploymentResponses,
|
|
82
|
+
GetFeatureInterestsErrors,
|
|
83
|
+
GetFeatureInterestsResponses,
|
|
84
|
+
GetGithubOrganizationConnectionErrors,
|
|
85
|
+
GetGithubOrganizationConnectionResponses,
|
|
86
|
+
GetOperationErrors,
|
|
87
|
+
GetOperationResponses,
|
|
88
|
+
GetOrganizationAccountErrors,
|
|
89
|
+
GetOrganizationAccountResponses,
|
|
90
|
+
GetOrganizationCreditsErrors,
|
|
91
|
+
GetOrganizationCreditsResponses,
|
|
92
|
+
GetOrganizationCreditUsageErrors,
|
|
93
|
+
GetOrganizationCreditUsageResponses,
|
|
94
|
+
GetPaidProjectDomainErrors,
|
|
95
|
+
GetPaidProjectDomainResponses,
|
|
96
|
+
GetProjectContextErrors,
|
|
97
|
+
GetProjectContextResponses,
|
|
98
|
+
GetProjectCreditBudgetErrors,
|
|
99
|
+
GetProjectCreditBudgetResponses,
|
|
100
|
+
GetProjectErrors,
|
|
101
|
+
GetProjectExportErrors,
|
|
102
|
+
GetProjectExportResponses,
|
|
103
|
+
GetProjectMailDomainErrors,
|
|
104
|
+
GetProjectMailDomainResponses,
|
|
105
|
+
GetProjectResponses,
|
|
106
|
+
GetProjectSourceAutoDeployErrors,
|
|
107
|
+
GetProjectSourceAutoDeployResponses,
|
|
108
|
+
GetProjectSourceErrors,
|
|
109
|
+
GetProjectSourceResponses,
|
|
110
|
+
GetProjectStatusErrors,
|
|
111
|
+
GetProjectStatusResponses,
|
|
112
|
+
GetPublicDeploymentStatsErrors,
|
|
113
|
+
GetPublicDeploymentStatsResponses,
|
|
114
|
+
LinkProjectSourceErrors,
|
|
115
|
+
LinkProjectSourceRequest,
|
|
116
|
+
LinkProjectSourceResponses,
|
|
117
|
+
ListAuditEventsErrors,
|
|
118
|
+
ListAuditEventsResponses,
|
|
119
|
+
ListDeploymentsErrors,
|
|
120
|
+
ListDeploymentsResponses,
|
|
121
|
+
ListEnvironmentSecretsErrors,
|
|
122
|
+
ListEnvironmentSecretsResponses,
|
|
123
|
+
ListFunctionRunsErrors,
|
|
124
|
+
ListFunctionRunsResponses,
|
|
125
|
+
ListProjectDatabaseAccessErrors,
|
|
126
|
+
ListProjectDatabaseAccessResponses,
|
|
127
|
+
ListProjectsErrors,
|
|
128
|
+
ListProjectsResponses,
|
|
129
|
+
ListUserApiKeysErrors,
|
|
130
|
+
ListUserApiKeysResponses,
|
|
131
|
+
PaidDomainRequest,
|
|
132
|
+
PlanDeploymentErrors,
|
|
133
|
+
PlanDeploymentPromotionErrors,
|
|
134
|
+
PlanDeploymentPromotionResponses,
|
|
135
|
+
PlanDeploymentRequest,
|
|
136
|
+
PlanDeploymentResponses,
|
|
137
|
+
PlanDeploymentRollbackErrors,
|
|
138
|
+
PlanDeploymentRollbackResponses,
|
|
139
|
+
PlanPaidProjectDomainErrors,
|
|
140
|
+
PlanPaidProjectDomainResponses,
|
|
141
|
+
PlanProjectDeletionErrors,
|
|
142
|
+
PlanProjectDeletionResponses,
|
|
143
|
+
ProjectDatabaseAccessRequest,
|
|
144
|
+
ProjectDatabaseQueryRequest,
|
|
145
|
+
ProjectDatabaseWriteRequest,
|
|
146
|
+
PromoteDeploymentErrors,
|
|
147
|
+
PromoteDeploymentResponses,
|
|
148
|
+
PutEnvironmentSecretErrors,
|
|
149
|
+
PutEnvironmentSecretRequest,
|
|
150
|
+
PutEnvironmentSecretResponses,
|
|
151
|
+
QueryProjectDatabaseErrors,
|
|
152
|
+
QueryProjectDatabaseResponses,
|
|
153
|
+
ReconcileOperationErrors,
|
|
154
|
+
ReconcileOperationResponses,
|
|
155
|
+
RecordSignupSourceErrors,
|
|
156
|
+
RecordSignupSourceResponses,
|
|
157
|
+
RegisterFeatureInterestErrors,
|
|
158
|
+
RegisterFeatureInterestResponses,
|
|
159
|
+
RevokeCurrentSessionErrors,
|
|
160
|
+
RevokeCurrentSessionResponses,
|
|
161
|
+
RevokeProjectDatabaseAccessErrors,
|
|
162
|
+
RevokeProjectDatabaseAccessResponses,
|
|
163
|
+
RevokeUserApiKeyErrors,
|
|
164
|
+
RevokeUserApiKeyResponses,
|
|
165
|
+
RollbackDeploymentErrors,
|
|
166
|
+
RollbackDeploymentResponses,
|
|
167
|
+
SetProjectCreditBudgetErrors,
|
|
168
|
+
SetProjectCreditBudgetRequest,
|
|
169
|
+
SetProjectCreditBudgetResponses,
|
|
170
|
+
SetProjectNotesErrors,
|
|
171
|
+
SetProjectNotesResponses,
|
|
172
|
+
StreamDeploymentLogsErrors,
|
|
173
|
+
StreamDeploymentLogsResponse,
|
|
174
|
+
StreamDeploymentLogsResponses,
|
|
175
|
+
StreamOperationEventsErrors,
|
|
176
|
+
StreamOperationEventsResponse,
|
|
177
|
+
StreamOperationEventsResponses,
|
|
178
|
+
SubmitContactRequestErrors,
|
|
179
|
+
SubmitContactRequestResponses,
|
|
180
|
+
SubmitFeedbackErrors,
|
|
181
|
+
SubmitFeedbackResponses,
|
|
182
|
+
Ulid,
|
|
183
|
+
UserApiKeyId,
|
|
184
|
+
WriteProjectDatabaseErrors,
|
|
185
|
+
WriteProjectDatabaseResponses,
|
|
186
|
+
} from "./types.gen.js";
|
|
187
|
+
|
|
188
|
+
export type Options<
|
|
189
|
+
TData extends TDataShape = TDataShape,
|
|
190
|
+
ThrowOnError extends boolean = boolean,
|
|
191
|
+
TResponse = unknown,
|
|
192
|
+
> = Options2<TData, ThrowOnError, TResponse> & {
|
|
193
|
+
/**
|
|
194
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
195
|
+
* individual options. This might be also useful if you want to implement a
|
|
196
|
+
* custom client.
|
|
197
|
+
*/
|
|
198
|
+
client?: Client;
|
|
199
|
+
/**
|
|
200
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
201
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
202
|
+
*/
|
|
203
|
+
meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Read the current interactive user profile and signup attribution
|
|
208
|
+
*/
|
|
209
|
+
export const getAccountProfile = <ThrowOnError extends boolean = true>(
|
|
210
|
+
options?: Options<never, ThrowOnError>,
|
|
211
|
+
): RequestResult<GetAccountProfileResponses, GetAccountProfileErrors, ThrowOnError, "data"> =>
|
|
212
|
+
(options?.client ?? client).get<
|
|
213
|
+
GetAccountProfileResponses,
|
|
214
|
+
GetAccountProfileErrors,
|
|
215
|
+
ThrowOnError,
|
|
216
|
+
"data"
|
|
217
|
+
>({
|
|
218
|
+
responseStyle: "data",
|
|
219
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
220
|
+
url: "/v1/me/profile",
|
|
221
|
+
...options,
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Record the authenticated user signup source once
|
|
226
|
+
*
|
|
227
|
+
* Interactive session required; the first accepted source is immutable, repeat requests return it unchanged and no credits or Paid rights are granted by this endpoint.
|
|
228
|
+
*/
|
|
229
|
+
export const recordSignupSource = <ThrowOnError extends boolean = true>(
|
|
230
|
+
parameters: {
|
|
231
|
+
source: string | null;
|
|
232
|
+
},
|
|
233
|
+
options?: Options<never, ThrowOnError>,
|
|
234
|
+
): RequestResult<RecordSignupSourceResponses, RecordSignupSourceErrors, ThrowOnError, "data"> => {
|
|
235
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "source" }] }]);
|
|
236
|
+
return (options?.client ?? client).put<
|
|
237
|
+
RecordSignupSourceResponses,
|
|
238
|
+
RecordSignupSourceErrors,
|
|
239
|
+
ThrowOnError,
|
|
240
|
+
"data"
|
|
241
|
+
>({
|
|
242
|
+
responseStyle: "data",
|
|
243
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
244
|
+
url: "/v1/me/signup-source",
|
|
245
|
+
...options,
|
|
246
|
+
...params,
|
|
247
|
+
headers: {
|
|
248
|
+
"Content-Type": "application/json",
|
|
249
|
+
...options?.headers,
|
|
250
|
+
...params.headers,
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Connect a GitHub installation to the workspace
|
|
257
|
+
*
|
|
258
|
+
* Owner or Admin connects once through one GitHub browser link. The original user session or user API key is bound to the thirty-minute authorization. Repeat the same request and key to observe its result. No provider credential is returned or retained.
|
|
259
|
+
*/
|
|
260
|
+
export const connectGithubOrganization = <ThrowOnError extends boolean = true>(
|
|
261
|
+
parameters: {
|
|
262
|
+
"X-Request-Id"?: string;
|
|
263
|
+
"Idempotency-Key": string;
|
|
264
|
+
organization_id: Ulid;
|
|
265
|
+
connectGithubOrganizationRequest: ConnectGithubOrganizationRequest;
|
|
266
|
+
},
|
|
267
|
+
options?: Options<never, ThrowOnError>,
|
|
268
|
+
): RequestResult<
|
|
269
|
+
ConnectGithubOrganizationResponses,
|
|
270
|
+
ConnectGithubOrganizationErrors,
|
|
271
|
+
ThrowOnError,
|
|
272
|
+
"data"
|
|
273
|
+
> => {
|
|
274
|
+
const params = buildClientParams(
|
|
275
|
+
[parameters],
|
|
276
|
+
[
|
|
277
|
+
{
|
|
278
|
+
args: [
|
|
279
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
280
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
281
|
+
{ in: "path", key: "organization_id" },
|
|
282
|
+
{ key: "connectGithubOrganizationRequest", map: "body" },
|
|
283
|
+
],
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
);
|
|
287
|
+
return (options?.client ?? client).post<
|
|
288
|
+
ConnectGithubOrganizationResponses,
|
|
289
|
+
ConnectGithubOrganizationErrors,
|
|
290
|
+
ThrowOnError,
|
|
291
|
+
"data"
|
|
292
|
+
>({
|
|
293
|
+
responseStyle: "data",
|
|
294
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
295
|
+
url: "/v1/organizations/{organization_id}/github:connect",
|
|
296
|
+
...options,
|
|
297
|
+
...params,
|
|
298
|
+
headers: {
|
|
299
|
+
"Content-Type": "application/json",
|
|
300
|
+
...options?.headers,
|
|
301
|
+
...params.headers,
|
|
302
|
+
},
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Read the workspace GitHub connection
|
|
308
|
+
*/
|
|
309
|
+
export const getGithubOrganizationConnection = <ThrowOnError extends boolean = true>(
|
|
310
|
+
parameters: {
|
|
311
|
+
"X-Request-Id"?: string;
|
|
312
|
+
organization_id: Ulid;
|
|
313
|
+
},
|
|
314
|
+
options?: Options<never, ThrowOnError>,
|
|
315
|
+
): RequestResult<
|
|
316
|
+
GetGithubOrganizationConnectionResponses,
|
|
317
|
+
GetGithubOrganizationConnectionErrors,
|
|
318
|
+
ThrowOnError,
|
|
319
|
+
"data"
|
|
320
|
+
> => {
|
|
321
|
+
const params = buildClientParams(
|
|
322
|
+
[parameters],
|
|
323
|
+
[
|
|
324
|
+
{
|
|
325
|
+
args: [
|
|
326
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
327
|
+
{ in: "path", key: "organization_id" },
|
|
328
|
+
],
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
);
|
|
332
|
+
return (options?.client ?? client).get<
|
|
333
|
+
GetGithubOrganizationConnectionResponses,
|
|
334
|
+
GetGithubOrganizationConnectionErrors,
|
|
335
|
+
ThrowOnError,
|
|
336
|
+
"data"
|
|
337
|
+
>({
|
|
338
|
+
responseStyle: "data",
|
|
339
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
340
|
+
url: "/v1/organizations/{organization_id}/github",
|
|
341
|
+
...options,
|
|
342
|
+
...params,
|
|
343
|
+
});
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Read effective plan and monthly versus one-time credit balance
|
|
348
|
+
*/
|
|
349
|
+
export const getOrganizationAccount = <ThrowOnError extends boolean = true>(
|
|
350
|
+
parameters: {
|
|
351
|
+
organization_id: Ulid;
|
|
352
|
+
},
|
|
353
|
+
options?: Options<never, ThrowOnError>,
|
|
354
|
+
): RequestResult<
|
|
355
|
+
GetOrganizationAccountResponses,
|
|
356
|
+
GetOrganizationAccountErrors,
|
|
357
|
+
ThrowOnError,
|
|
358
|
+
"data"
|
|
359
|
+
> => {
|
|
360
|
+
const params = buildClientParams(
|
|
361
|
+
[parameters],
|
|
362
|
+
[{ args: [{ in: "path", key: "organization_id" }] }],
|
|
363
|
+
);
|
|
364
|
+
return (options?.client ?? client).get<
|
|
365
|
+
GetOrganizationAccountResponses,
|
|
366
|
+
GetOrganizationAccountErrors,
|
|
367
|
+
ThrowOnError,
|
|
368
|
+
"data"
|
|
369
|
+
>({
|
|
370
|
+
responseStyle: "data",
|
|
371
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
372
|
+
url: "/v1/organizations/{organization_id}/account",
|
|
373
|
+
...options,
|
|
374
|
+
...params,
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Submit a contact or privacy question
|
|
380
|
+
*
|
|
381
|
+
* Stores a private contact request for twelve months, with idempotent replay and no account creation or marketing enrollment.
|
|
382
|
+
*/
|
|
383
|
+
export const submitContactRequest = <ThrowOnError extends boolean = true>(
|
|
384
|
+
parameters: {
|
|
385
|
+
name: string;
|
|
386
|
+
email: string;
|
|
387
|
+
company: string;
|
|
388
|
+
message: string;
|
|
389
|
+
idempotency_key: string;
|
|
390
|
+
},
|
|
391
|
+
options?: Options<never, ThrowOnError>,
|
|
392
|
+
): RequestResult<
|
|
393
|
+
SubmitContactRequestResponses,
|
|
394
|
+
SubmitContactRequestErrors,
|
|
395
|
+
ThrowOnError,
|
|
396
|
+
"data"
|
|
397
|
+
> => {
|
|
398
|
+
const params = buildClientParams(
|
|
399
|
+
[parameters],
|
|
400
|
+
[
|
|
401
|
+
{
|
|
402
|
+
args: [
|
|
403
|
+
{ in: "body", key: "name" },
|
|
404
|
+
{ in: "body", key: "email" },
|
|
405
|
+
{ in: "body", key: "company" },
|
|
406
|
+
{ in: "body", key: "message" },
|
|
407
|
+
{ in: "body", key: "idempotency_key" },
|
|
408
|
+
],
|
|
409
|
+
},
|
|
410
|
+
],
|
|
411
|
+
);
|
|
412
|
+
return (options?.client ?? client).post<
|
|
413
|
+
SubmitContactRequestResponses,
|
|
414
|
+
SubmitContactRequestErrors,
|
|
415
|
+
ThrowOnError,
|
|
416
|
+
"data"
|
|
417
|
+
>({
|
|
418
|
+
responseStyle: "data",
|
|
419
|
+
url: "/v1/contact-requests",
|
|
420
|
+
...options,
|
|
421
|
+
...params,
|
|
422
|
+
headers: {
|
|
423
|
+
"Content-Type": "application/json",
|
|
424
|
+
...options?.headers,
|
|
425
|
+
...params.headers,
|
|
426
|
+
},
|
|
427
|
+
});
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Read this anonymous browser's current roadmap votes
|
|
432
|
+
*/
|
|
433
|
+
export const getFeatureInterests = <ThrowOnError extends boolean = true>(
|
|
434
|
+
parameters: {
|
|
435
|
+
"X-Ohmyho-Voter": string;
|
|
436
|
+
},
|
|
437
|
+
options?: Options<never, ThrowOnError>,
|
|
438
|
+
): RequestResult<GetFeatureInterestsResponses, GetFeatureInterestsErrors, ThrowOnError, "data"> => {
|
|
439
|
+
const params = buildClientParams(
|
|
440
|
+
[parameters],
|
|
441
|
+
[{ args: [{ in: "headers", key: "X-Ohmyho-Voter" }] }],
|
|
442
|
+
);
|
|
443
|
+
return (options?.client ?? client).get<
|
|
444
|
+
GetFeatureInterestsResponses,
|
|
445
|
+
GetFeatureInterestsErrors,
|
|
446
|
+
ThrowOnError,
|
|
447
|
+
"data"
|
|
448
|
+
>({
|
|
449
|
+
responseStyle: "data",
|
|
450
|
+
url: "/v1/beta/feature-interests",
|
|
451
|
+
...options,
|
|
452
|
+
...params,
|
|
453
|
+
});
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Set or remove this anonymous browser's roadmap vote
|
|
458
|
+
*
|
|
459
|
+
* Store a desired choice once per request key for twelve months. Replaying an earlier request never overwrites a later choice. A null choice removes the vote; this is not toggle-on-every-request behavior.
|
|
460
|
+
*/
|
|
461
|
+
export const registerFeatureInterest = <ThrowOnError extends boolean = true>(
|
|
462
|
+
parameters: {
|
|
463
|
+
"X-Ohmyho-Voter": string;
|
|
464
|
+
feature: "eu" | "iso27001" | "soc2";
|
|
465
|
+
choice: "up" | "down" | null;
|
|
466
|
+
idempotency_key: string;
|
|
467
|
+
},
|
|
468
|
+
options?: Options<never, ThrowOnError>,
|
|
469
|
+
): RequestResult<
|
|
470
|
+
RegisterFeatureInterestResponses,
|
|
471
|
+
RegisterFeatureInterestErrors,
|
|
472
|
+
ThrowOnError,
|
|
473
|
+
"data"
|
|
474
|
+
> => {
|
|
475
|
+
const params = buildClientParams(
|
|
476
|
+
[parameters],
|
|
477
|
+
[
|
|
478
|
+
{
|
|
479
|
+
args: [
|
|
480
|
+
{ in: "headers", key: "X-Ohmyho-Voter" },
|
|
481
|
+
{ in: "body", key: "feature" },
|
|
482
|
+
{ in: "body", key: "choice" },
|
|
483
|
+
{ in: "body", key: "idempotency_key" },
|
|
484
|
+
],
|
|
485
|
+
},
|
|
486
|
+
],
|
|
487
|
+
);
|
|
488
|
+
return (options?.client ?? client).post<
|
|
489
|
+
RegisterFeatureInterestResponses,
|
|
490
|
+
RegisterFeatureInterestErrors,
|
|
491
|
+
ThrowOnError,
|
|
492
|
+
"data"
|
|
493
|
+
>({
|
|
494
|
+
responseStyle: "data",
|
|
495
|
+
url: "/v1/beta/feature-interests",
|
|
496
|
+
...options,
|
|
497
|
+
...params,
|
|
498
|
+
headers: {
|
|
499
|
+
"Content-Type": "application/json",
|
|
500
|
+
...options?.headers,
|
|
501
|
+
...params.headers,
|
|
502
|
+
},
|
|
503
|
+
});
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Read distinct active projects successfully deployed in the past seven days
|
|
508
|
+
*/
|
|
509
|
+
export const getPublicDeploymentStats = <ThrowOnError extends boolean = true>(
|
|
510
|
+
options?: Options<never, ThrowOnError>,
|
|
511
|
+
): RequestResult<
|
|
512
|
+
GetPublicDeploymentStatsResponses,
|
|
513
|
+
GetPublicDeploymentStatsErrors,
|
|
514
|
+
ThrowOnError,
|
|
515
|
+
"data"
|
|
516
|
+
> =>
|
|
517
|
+
(options?.client ?? client).get<
|
|
518
|
+
GetPublicDeploymentStatsResponses,
|
|
519
|
+
GetPublicDeploymentStatsErrors,
|
|
520
|
+
ThrowOnError,
|
|
521
|
+
"data"
|
|
522
|
+
>({
|
|
523
|
+
responseStyle: "data",
|
|
524
|
+
url: "/v1/beta/stats",
|
|
525
|
+
...options,
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* List the current user's tokens in one organization
|
|
530
|
+
*
|
|
531
|
+
* Requires an interactive session. Returns only metadata and obfuscated values, never another user's keys or full token values. Use the returned cursor for the next page.
|
|
532
|
+
*/
|
|
533
|
+
export const listUserApiKeys = <ThrowOnError extends boolean = true>(
|
|
534
|
+
parameters: {
|
|
535
|
+
"X-Request-Id"?: string;
|
|
536
|
+
organization_id: Ulid;
|
|
537
|
+
after?: UserApiKeyId;
|
|
538
|
+
},
|
|
539
|
+
options?: Options<never, ThrowOnError>,
|
|
540
|
+
): RequestResult<ListUserApiKeysResponses, ListUserApiKeysErrors, ThrowOnError, "data"> => {
|
|
541
|
+
const params = buildClientParams(
|
|
542
|
+
[parameters],
|
|
543
|
+
[
|
|
544
|
+
{
|
|
545
|
+
args: [
|
|
546
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
547
|
+
{ in: "path", key: "organization_id" },
|
|
548
|
+
{ in: "query", key: "after" },
|
|
549
|
+
],
|
|
550
|
+
},
|
|
551
|
+
],
|
|
552
|
+
);
|
|
553
|
+
return (options?.client ?? client).get<
|
|
554
|
+
ListUserApiKeysResponses,
|
|
555
|
+
ListUserApiKeysErrors,
|
|
556
|
+
ThrowOnError,
|
|
557
|
+
"data"
|
|
558
|
+
>({
|
|
559
|
+
responseStyle: "data",
|
|
560
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
561
|
+
url: "/v1/organizations/{organization_id}/user-api-keys",
|
|
562
|
+
...options,
|
|
563
|
+
...params,
|
|
564
|
+
});
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Create a user-owned API token valid until revoked
|
|
569
|
+
*
|
|
570
|
+
* Requires a current interactive user session. Organization membership and product permissions are revalidated. Only the first creation returns the full value; exact replay returns metadata and a null value. Save the first response locally without putting it in logs or agent prompts. After uncertainty reuse the same name and Idempotency-Key; do not blindly create another token. Available at zero credits.
|
|
571
|
+
*/
|
|
572
|
+
export const createUserApiKey = <ThrowOnError extends boolean = true>(
|
|
573
|
+
parameters: {
|
|
574
|
+
"X-Request-Id"?: string;
|
|
575
|
+
"Idempotency-Key": string;
|
|
576
|
+
organization_id: Ulid;
|
|
577
|
+
name: string;
|
|
578
|
+
},
|
|
579
|
+
options?: Options<never, ThrowOnError>,
|
|
580
|
+
): RequestResult<CreateUserApiKeyResponses, CreateUserApiKeyErrors, ThrowOnError, "data"> => {
|
|
581
|
+
const params = buildClientParams(
|
|
582
|
+
[parameters],
|
|
583
|
+
[
|
|
584
|
+
{
|
|
585
|
+
args: [
|
|
586
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
587
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
588
|
+
{ in: "path", key: "organization_id" },
|
|
589
|
+
{ in: "body", key: "name" },
|
|
590
|
+
],
|
|
591
|
+
},
|
|
592
|
+
],
|
|
593
|
+
);
|
|
594
|
+
return (options?.client ?? client).post<
|
|
595
|
+
CreateUserApiKeyResponses,
|
|
596
|
+
CreateUserApiKeyErrors,
|
|
597
|
+
ThrowOnError,
|
|
598
|
+
"data"
|
|
599
|
+
>({
|
|
600
|
+
responseStyle: "data",
|
|
601
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
602
|
+
url: "/v1/organizations/{organization_id}/user-api-keys",
|
|
603
|
+
...options,
|
|
604
|
+
...params,
|
|
605
|
+
headers: {
|
|
606
|
+
"Content-Type": "application/json",
|
|
607
|
+
...options?.headers,
|
|
608
|
+
...params.headers,
|
|
609
|
+
},
|
|
610
|
+
});
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Revoke one of the current user's API tokens
|
|
615
|
+
*
|
|
616
|
+
* Requires a current interactive session. Verifies user and organization ownership before provider deletion. Replay and an already absent token have the same result. Does not revoke another user's token or the current login session.
|
|
617
|
+
*/
|
|
618
|
+
export const revokeUserApiKey = <ThrowOnError extends boolean = true>(
|
|
619
|
+
parameters: {
|
|
620
|
+
"X-Request-Id"?: string;
|
|
621
|
+
organization_id: Ulid;
|
|
622
|
+
key_id: UserApiKeyId;
|
|
623
|
+
},
|
|
624
|
+
options?: Options<never, ThrowOnError>,
|
|
625
|
+
): RequestResult<RevokeUserApiKeyResponses, RevokeUserApiKeyErrors, ThrowOnError, "data"> => {
|
|
626
|
+
const params = buildClientParams(
|
|
627
|
+
[parameters],
|
|
628
|
+
[
|
|
629
|
+
{
|
|
630
|
+
args: [
|
|
631
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
632
|
+
{ in: "path", key: "organization_id" },
|
|
633
|
+
{ in: "path", key: "key_id" },
|
|
634
|
+
],
|
|
635
|
+
},
|
|
636
|
+
],
|
|
637
|
+
);
|
|
638
|
+
return (options?.client ?? client).delete<
|
|
639
|
+
RevokeUserApiKeyResponses,
|
|
640
|
+
RevokeUserApiKeyErrors,
|
|
641
|
+
ThrowOnError,
|
|
642
|
+
"data"
|
|
643
|
+
>({
|
|
644
|
+
responseStyle: "data",
|
|
645
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
646
|
+
url: "/v1/organizations/{organization_id}/user-api-keys/{key_id}",
|
|
647
|
+
...options,
|
|
648
|
+
...params,
|
|
649
|
+
});
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Store a redacted customer-agent feedback report
|
|
654
|
+
*
|
|
655
|
+
* Available to authorized organization members at zero credits. A 201 receipt confirms durable storage, not triage or a promised fix. Reuse the same Idempotency-Key and payload after uncertainty. Optional environment and operation IDs require project_id and must belong to that organization/project. Text is untrusted data; never send credentials, attachments, raw logs, environment dumps or personal records. No provider operation, charge or external message is created.
|
|
656
|
+
*/
|
|
657
|
+
export const submitFeedback = <ThrowOnError extends boolean = true>(
|
|
658
|
+
parameters: {
|
|
659
|
+
"X-Request-Id"?: string;
|
|
660
|
+
"Idempotency-Key": string;
|
|
661
|
+
feedbackSubmission: FeedbackSubmission;
|
|
662
|
+
},
|
|
663
|
+
options?: Options<never, ThrowOnError>,
|
|
664
|
+
): RequestResult<SubmitFeedbackResponses, SubmitFeedbackErrors, ThrowOnError, "data"> => {
|
|
665
|
+
const params = buildClientParams(
|
|
666
|
+
[parameters],
|
|
667
|
+
[
|
|
668
|
+
{
|
|
669
|
+
args: [
|
|
670
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
671
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
672
|
+
{ key: "feedbackSubmission", map: "body" },
|
|
673
|
+
],
|
|
674
|
+
},
|
|
675
|
+
],
|
|
676
|
+
);
|
|
677
|
+
return (options?.client ?? client).post<
|
|
678
|
+
SubmitFeedbackResponses,
|
|
679
|
+
SubmitFeedbackErrors,
|
|
680
|
+
ThrowOnError,
|
|
681
|
+
"data"
|
|
682
|
+
>({
|
|
683
|
+
responseStyle: "data",
|
|
684
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
685
|
+
url: "/v1/feedback",
|
|
686
|
+
...options,
|
|
687
|
+
...params,
|
|
688
|
+
headers: {
|
|
689
|
+
"Content-Type": "application/json",
|
|
690
|
+
...options?.headers,
|
|
691
|
+
...params.headers,
|
|
692
|
+
},
|
|
693
|
+
});
|
|
694
|
+
};
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Complete the bound GitHub browser authorization
|
|
698
|
+
*
|
|
699
|
+
* Browser callback only. Revalidates the original user session or user API key, workspace Owner/Admin authority and authorization expiry, then privately verifies the GitHub account and installation. A valid installation callback without an OAuth code continues automatically through OAuth. Completion records the workspace connection without building or returning provider credentials. Previously issued project authorizations remain supported during rollout.
|
|
700
|
+
*/
|
|
701
|
+
export const completeGithubSourceAuthorization = <ThrowOnError extends boolean = true>(
|
|
702
|
+
parameters: {
|
|
703
|
+
state: string;
|
|
704
|
+
code?: string;
|
|
705
|
+
error?: string;
|
|
706
|
+
error_description?: string;
|
|
707
|
+
iss?: "https://github.com/login/oauth";
|
|
708
|
+
installation_id?: string;
|
|
709
|
+
setup_action?: "install" | "update" | "request";
|
|
710
|
+
},
|
|
711
|
+
options?: Options<never, ThrowOnError>,
|
|
712
|
+
): RequestResult<unknown, CompleteGithubSourceAuthorizationErrors, ThrowOnError, "data"> => {
|
|
713
|
+
const params = buildClientParams(
|
|
714
|
+
[parameters],
|
|
715
|
+
[
|
|
716
|
+
{
|
|
717
|
+
args: [
|
|
718
|
+
{ in: "query", key: "state" },
|
|
719
|
+
{ in: "query", key: "code" },
|
|
720
|
+
{ in: "query", key: "error" },
|
|
721
|
+
{ in: "query", key: "error_description" },
|
|
722
|
+
{ in: "query", key: "iss" },
|
|
723
|
+
{ in: "query", key: "installation_id" },
|
|
724
|
+
{ in: "query", key: "setup_action" },
|
|
725
|
+
],
|
|
726
|
+
},
|
|
727
|
+
],
|
|
728
|
+
);
|
|
729
|
+
return (options?.client ?? client).get<
|
|
730
|
+
unknown,
|
|
731
|
+
CompleteGithubSourceAuthorizationErrors,
|
|
732
|
+
ThrowOnError,
|
|
733
|
+
"data"
|
|
734
|
+
>({
|
|
735
|
+
responseStyle: "data",
|
|
736
|
+
url: "/v1/github/oauth/callback",
|
|
737
|
+
...options,
|
|
738
|
+
...params,
|
|
739
|
+
});
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Complete one Cloudflare DNS authorization
|
|
744
|
+
*
|
|
745
|
+
* Successful callbacks require code and state and complete one previously authenticated project authorization. Provider rejection instead supplies error and optional error_description, error_uri and state; it returns a static actionable problem without completing authorization or reflecting provider input. Success and error parameters cannot be combined. This callback grants no general unauthenticated product access.
|
|
746
|
+
*/
|
|
747
|
+
export const completeCloudflareDnsAuthorization = <ThrowOnError extends boolean = true>(
|
|
748
|
+
parameters?: {
|
|
749
|
+
code?: string;
|
|
750
|
+
state?: string;
|
|
751
|
+
error?: string;
|
|
752
|
+
error_description?: string;
|
|
753
|
+
error_uri?: string;
|
|
754
|
+
},
|
|
755
|
+
options?: Options<never, ThrowOnError>,
|
|
756
|
+
): RequestResult<
|
|
757
|
+
CompleteCloudflareDnsAuthorizationResponses,
|
|
758
|
+
CompleteCloudflareDnsAuthorizationErrors,
|
|
759
|
+
ThrowOnError,
|
|
760
|
+
"data"
|
|
761
|
+
> => {
|
|
762
|
+
const params = buildClientParams(
|
|
763
|
+
[parameters],
|
|
764
|
+
[
|
|
765
|
+
{
|
|
766
|
+
args: [
|
|
767
|
+
{ in: "query", key: "code" },
|
|
768
|
+
{ in: "query", key: "state" },
|
|
769
|
+
{ in: "query", key: "error" },
|
|
770
|
+
{ in: "query", key: "error_description" },
|
|
771
|
+
{ in: "query", key: "error_uri" },
|
|
772
|
+
],
|
|
773
|
+
},
|
|
774
|
+
],
|
|
775
|
+
);
|
|
776
|
+
return (options?.client ?? client).get<
|
|
777
|
+
CompleteCloudflareDnsAuthorizationResponses,
|
|
778
|
+
CompleteCloudflareDnsAuthorizationErrors,
|
|
779
|
+
ThrowOnError,
|
|
780
|
+
"data"
|
|
781
|
+
>({
|
|
782
|
+
responseStyle: "data",
|
|
783
|
+
url: "/v1/cloudflare/oauth/callback",
|
|
784
|
+
...options,
|
|
785
|
+
...params,
|
|
786
|
+
});
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Get the current authenticated identity
|
|
791
|
+
*
|
|
792
|
+
* Returns the stable ohmyhost actor and internal organization identifiers derived from the bearer credential.
|
|
793
|
+
*/
|
|
794
|
+
export const getCurrentIdentity = <ThrowOnError extends boolean = true>(
|
|
795
|
+
parameters?: {
|
|
796
|
+
"X-Request-Id"?: string;
|
|
797
|
+
},
|
|
798
|
+
options?: Options<never, ThrowOnError>,
|
|
799
|
+
): RequestResult<GetCurrentIdentityResponses, GetCurrentIdentityErrors, ThrowOnError, "data"> => {
|
|
800
|
+
const params = buildClientParams(
|
|
801
|
+
[parameters],
|
|
802
|
+
[{ args: [{ in: "headers", key: "X-Request-Id" }] }],
|
|
803
|
+
);
|
|
804
|
+
return (options?.client ?? client).get<
|
|
805
|
+
GetCurrentIdentityResponses,
|
|
806
|
+
GetCurrentIdentityErrors,
|
|
807
|
+
ThrowOnError,
|
|
808
|
+
"data"
|
|
809
|
+
>({
|
|
810
|
+
responseStyle: "data",
|
|
811
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
812
|
+
url: "/v1/me",
|
|
813
|
+
...options,
|
|
814
|
+
...params,
|
|
815
|
+
});
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Revoke the current signed-in user session
|
|
820
|
+
*
|
|
821
|
+
* Revokes only the session proven by the bearer credential, confirms its absence from active WorkOS sessions and records local terminal denial. No organization is required. The request body and query must be empty; caller-supplied session or user identifiers are not accepted. Repeated private processing cannot revoke another session. Once revoked, the old bearer is no longer authorized, including for a public replay. This synchronous identity-lifecycle operation does not create a project operation.
|
|
822
|
+
*/
|
|
823
|
+
export const revokeCurrentSession = <ThrowOnError extends boolean = true>(
|
|
824
|
+
parameters: {
|
|
825
|
+
"X-Request-Id"?: string;
|
|
826
|
+
"Idempotency-Key": string;
|
|
827
|
+
},
|
|
828
|
+
options?: Options<never, ThrowOnError>,
|
|
829
|
+
): RequestResult<
|
|
830
|
+
RevokeCurrentSessionResponses,
|
|
831
|
+
RevokeCurrentSessionErrors,
|
|
832
|
+
ThrowOnError,
|
|
833
|
+
"data"
|
|
834
|
+
> => {
|
|
835
|
+
const params = buildClientParams(
|
|
836
|
+
[parameters],
|
|
837
|
+
[
|
|
838
|
+
{
|
|
839
|
+
args: [
|
|
840
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
841
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
842
|
+
],
|
|
843
|
+
},
|
|
844
|
+
],
|
|
845
|
+
);
|
|
846
|
+
return (options?.client ?? client).post<
|
|
847
|
+
RevokeCurrentSessionResponses,
|
|
848
|
+
RevokeCurrentSessionErrors,
|
|
849
|
+
ThrowOnError,
|
|
850
|
+
"data"
|
|
851
|
+
>({
|
|
852
|
+
responseStyle: "data",
|
|
853
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
854
|
+
url: "/v1/session:revoke",
|
|
855
|
+
...options,
|
|
856
|
+
...params,
|
|
857
|
+
});
|
|
858
|
+
};
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Create an organization for the signed-in user
|
|
862
|
+
*
|
|
863
|
+
* Creates an organization and its creator's Owner membership. Only a verified user session may call this endpoint; no existing organization is required. Repeating the same Idempotency-Key and name observes the same creation, never recreating revoked membership. Creation does not change the caller's token, because organization scope is carried by the access token; a client must obtain a token for this organization before project mutations. The CLI and MCP do that in the same call and need no second login.
|
|
864
|
+
*/
|
|
865
|
+
export const createOrganization = <ThrowOnError extends boolean = true>(
|
|
866
|
+
parameters: {
|
|
867
|
+
"X-Request-Id"?: string;
|
|
868
|
+
"Idempotency-Key": string;
|
|
869
|
+
createOrganizationRequest: CreateOrganizationRequest;
|
|
870
|
+
},
|
|
871
|
+
options?: Options<never, ThrowOnError>,
|
|
872
|
+
): RequestResult<CreateOrganizationResponses, CreateOrganizationErrors, ThrowOnError, "data"> => {
|
|
873
|
+
const params = buildClientParams(
|
|
874
|
+
[parameters],
|
|
875
|
+
[
|
|
876
|
+
{
|
|
877
|
+
args: [
|
|
878
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
879
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
880
|
+
{ key: "createOrganizationRequest", map: "body" },
|
|
881
|
+
],
|
|
882
|
+
},
|
|
883
|
+
],
|
|
884
|
+
);
|
|
885
|
+
return (options?.client ?? client).post<
|
|
886
|
+
CreateOrganizationResponses,
|
|
887
|
+
CreateOrganizationErrors,
|
|
888
|
+
ThrowOnError,
|
|
889
|
+
"data"
|
|
890
|
+
>({
|
|
891
|
+
responseStyle: "data",
|
|
892
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
893
|
+
url: "/v1/organizations",
|
|
894
|
+
...options,
|
|
895
|
+
...params,
|
|
896
|
+
headers: {
|
|
897
|
+
"Content-Type": "application/json",
|
|
898
|
+
...options?.headers,
|
|
899
|
+
...params.headers,
|
|
900
|
+
},
|
|
901
|
+
});
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* Create or resume an owner's hosted Stripe Checkout
|
|
906
|
+
*
|
|
907
|
+
* Returns a human payment URL, never charges a saved card. Paid is USD 10/month; each top-up pack is USD 10 before tax; a purchase grants 100 credits per dollar up to USD 100 and 125 credits per dollar for the part above, so 10 packs grant 10000 and 20 packs grant 22500 non-expiring credits. Retry the same offer, packs and Idempotency-Key after uncertainty. Browser return is not payment proof; read this checkout and the organization balance. A conflicting or existing subscription returns billing_purchase_conflict (409); read the original checkout or request an owner billing portal URL instead of another purchase. Works at zero credits.
|
|
908
|
+
*/
|
|
909
|
+
export const createBillingCheckout = <ThrowOnError extends boolean = true>(
|
|
910
|
+
parameters: {
|
|
911
|
+
"X-Request-Id"?: string;
|
|
912
|
+
"Idempotency-Key": string;
|
|
913
|
+
organization_id: Ulid;
|
|
914
|
+
offer: "topup" | "paid";
|
|
915
|
+
packs: number;
|
|
916
|
+
},
|
|
917
|
+
options?: Options<never, ThrowOnError>,
|
|
918
|
+
): RequestResult<
|
|
919
|
+
CreateBillingCheckoutResponses,
|
|
920
|
+
CreateBillingCheckoutErrors,
|
|
921
|
+
ThrowOnError,
|
|
922
|
+
"data"
|
|
923
|
+
> => {
|
|
924
|
+
const params = buildClientParams(
|
|
925
|
+
[parameters],
|
|
926
|
+
[
|
|
927
|
+
{
|
|
928
|
+
args: [
|
|
929
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
930
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
931
|
+
{ in: "path", key: "organization_id" },
|
|
932
|
+
{ in: "body", key: "offer" },
|
|
933
|
+
{ in: "body", key: "packs" },
|
|
934
|
+
],
|
|
935
|
+
},
|
|
936
|
+
],
|
|
937
|
+
);
|
|
938
|
+
return (options?.client ?? client).post<
|
|
939
|
+
CreateBillingCheckoutResponses,
|
|
940
|
+
CreateBillingCheckoutErrors,
|
|
941
|
+
ThrowOnError,
|
|
942
|
+
"data"
|
|
943
|
+
>({
|
|
944
|
+
responseStyle: "data",
|
|
945
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
946
|
+
url: "/v1/organizations/{organization_id}/billing/checkouts",
|
|
947
|
+
...options,
|
|
948
|
+
...params,
|
|
949
|
+
headers: {
|
|
950
|
+
"Content-Type": "application/json",
|
|
951
|
+
...options?.headers,
|
|
952
|
+
...params.headers,
|
|
953
|
+
},
|
|
954
|
+
});
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Observe and reconcile an owner's original checkout
|
|
959
|
+
*
|
|
960
|
+
* Reads Stripe and reconciles confirmed credits/refunds idempotently. payment_confirmed describes the original Checkout, not spendable credit or current Paid entitlement. Read organization credits for available funding; paid_until is the current paid coverage. No new purchase intent or payment is created; an uncertain original Checkout can resume using its stored identity.
|
|
961
|
+
*/
|
|
962
|
+
export const getBillingCheckout = <ThrowOnError extends boolean = true>(
|
|
963
|
+
parameters: {
|
|
964
|
+
"X-Request-Id"?: string;
|
|
965
|
+
organization_id: Ulid;
|
|
966
|
+
checkout_id: Ulid;
|
|
967
|
+
},
|
|
968
|
+
options?: Options<never, ThrowOnError>,
|
|
969
|
+
): RequestResult<GetBillingCheckoutResponses, GetBillingCheckoutErrors, ThrowOnError, "data"> => {
|
|
970
|
+
const params = buildClientParams(
|
|
971
|
+
[parameters],
|
|
972
|
+
[
|
|
973
|
+
{
|
|
974
|
+
args: [
|
|
975
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
976
|
+
{ in: "path", key: "organization_id" },
|
|
977
|
+
{ in: "path", key: "checkout_id" },
|
|
978
|
+
],
|
|
979
|
+
},
|
|
980
|
+
],
|
|
981
|
+
);
|
|
982
|
+
return (options?.client ?? client).get<
|
|
983
|
+
GetBillingCheckoutResponses,
|
|
984
|
+
GetBillingCheckoutErrors,
|
|
985
|
+
ThrowOnError,
|
|
986
|
+
"data"
|
|
987
|
+
>({
|
|
988
|
+
responseStyle: "data",
|
|
989
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
990
|
+
url: "/v1/organizations/{organization_id}/billing/checkouts/{checkout_id}",
|
|
991
|
+
...options,
|
|
992
|
+
...params,
|
|
993
|
+
});
|
|
994
|
+
};
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* Open the owner's Stripe billing portal
|
|
998
|
+
*
|
|
999
|
+
* Creates a short-lived human URL for invoices, payment method updates and cancellation at period end. Does not charge or change the subscription itself. Customer and return URL are server-selected. Request a fresh URL if the portal has expired. Works at zero credits.
|
|
1000
|
+
*/
|
|
1001
|
+
export const createBillingPortal = <ThrowOnError extends boolean = true>(
|
|
1002
|
+
parameters: {
|
|
1003
|
+
"X-Request-Id"?: string;
|
|
1004
|
+
organization_id: Ulid;
|
|
1005
|
+
body: {
|
|
1006
|
+
[key: string]: never;
|
|
1007
|
+
};
|
|
1008
|
+
},
|
|
1009
|
+
options?: Options<never, ThrowOnError>,
|
|
1010
|
+
): RequestResult<CreateBillingPortalResponses, CreateBillingPortalErrors, ThrowOnError, "data"> => {
|
|
1011
|
+
const params = buildClientParams(
|
|
1012
|
+
[parameters],
|
|
1013
|
+
[
|
|
1014
|
+
{
|
|
1015
|
+
args: [
|
|
1016
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1017
|
+
{ in: "path", key: "organization_id" },
|
|
1018
|
+
{ key: "body", map: "body" },
|
|
1019
|
+
],
|
|
1020
|
+
},
|
|
1021
|
+
],
|
|
1022
|
+
);
|
|
1023
|
+
return (options?.client ?? client).post<
|
|
1024
|
+
CreateBillingPortalResponses,
|
|
1025
|
+
CreateBillingPortalErrors,
|
|
1026
|
+
ThrowOnError,
|
|
1027
|
+
"data"
|
|
1028
|
+
>({
|
|
1029
|
+
responseStyle: "data",
|
|
1030
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1031
|
+
url: "/v1/organizations/{organization_id}/billing/portal",
|
|
1032
|
+
...options,
|
|
1033
|
+
...params,
|
|
1034
|
+
headers: {
|
|
1035
|
+
"Content-Type": "application/json",
|
|
1036
|
+
...options?.headers,
|
|
1037
|
+
...params.headers,
|
|
1038
|
+
},
|
|
1039
|
+
});
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Read auto-recharge and the current payment handoff
|
|
1044
|
+
*
|
|
1045
|
+
* Owner-only. Reads saved consent and gross UTC-month spending; a pending Stripe card setup may be resumed. No charge is initiated by reading. Private Stripe URLs must not be logged.
|
|
1046
|
+
*/
|
|
1047
|
+
export const getBillingRecharge = <ThrowOnError extends boolean = true>(
|
|
1048
|
+
parameters: {
|
|
1049
|
+
"X-Request-Id"?: string;
|
|
1050
|
+
organization_id: Ulid;
|
|
1051
|
+
},
|
|
1052
|
+
options?: Options<never, ThrowOnError>,
|
|
1053
|
+
): RequestResult<GetBillingRechargeResponses, GetBillingRechargeErrors, ThrowOnError, "data"> => {
|
|
1054
|
+
const params = buildClientParams(
|
|
1055
|
+
[parameters],
|
|
1056
|
+
[
|
|
1057
|
+
{
|
|
1058
|
+
args: [
|
|
1059
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1060
|
+
{ in: "path", key: "organization_id" },
|
|
1061
|
+
],
|
|
1062
|
+
},
|
|
1063
|
+
],
|
|
1064
|
+
);
|
|
1065
|
+
return (options?.client ?? client).get<
|
|
1066
|
+
GetBillingRechargeResponses,
|
|
1067
|
+
GetBillingRechargeErrors,
|
|
1068
|
+
ThrowOnError,
|
|
1069
|
+
"data"
|
|
1070
|
+
>({
|
|
1071
|
+
responseStyle: "data",
|
|
1072
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1073
|
+
url: "/v1/organizations/{organization_id}/billing/recharge",
|
|
1074
|
+
...options,
|
|
1075
|
+
...params,
|
|
1076
|
+
});
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Enable or disable explicitly authorized auto-recharge
|
|
1081
|
+
*
|
|
1082
|
+
* Owner-only. An agent must obtain explicit approval for off-session charges and the gross monthly spending cap before enabling. Each refill costs USD 9 before tax for 1000 non-expiring credits when available credits fall below 100. A saved Stripe card is required; follow setup_url if returned. Current revision prevents stale edits; retry the original Idempotency-Key and payload after uncertainty. Disable prevents new charge initiation; already initiated payments may complete. No subscription or Paid features are created.
|
|
1083
|
+
*/
|
|
1084
|
+
export const configureBillingRecharge = <ThrowOnError extends boolean = true>(
|
|
1085
|
+
parameters: {
|
|
1086
|
+
"X-Request-Id"?: string;
|
|
1087
|
+
"Idempotency-Key": string;
|
|
1088
|
+
organization_id: Ulid;
|
|
1089
|
+
enabled: boolean;
|
|
1090
|
+
monthly_limit_minor: number;
|
|
1091
|
+
consent: "off_session_v1" | null;
|
|
1092
|
+
revision: number;
|
|
1093
|
+
},
|
|
1094
|
+
options?: Options<never, ThrowOnError>,
|
|
1095
|
+
): RequestResult<
|
|
1096
|
+
ConfigureBillingRechargeResponses,
|
|
1097
|
+
ConfigureBillingRechargeErrors,
|
|
1098
|
+
ThrowOnError,
|
|
1099
|
+
"data"
|
|
1100
|
+
> => {
|
|
1101
|
+
const params = buildClientParams(
|
|
1102
|
+
[parameters],
|
|
1103
|
+
[
|
|
1104
|
+
{
|
|
1105
|
+
args: [
|
|
1106
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1107
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
1108
|
+
{ in: "path", key: "organization_id" },
|
|
1109
|
+
{ in: "body", key: "enabled" },
|
|
1110
|
+
{ in: "body", key: "monthly_limit_minor" },
|
|
1111
|
+
{ in: "body", key: "consent" },
|
|
1112
|
+
{ in: "body", key: "revision" },
|
|
1113
|
+
],
|
|
1114
|
+
},
|
|
1115
|
+
],
|
|
1116
|
+
);
|
|
1117
|
+
return (options?.client ?? client).put<
|
|
1118
|
+
ConfigureBillingRechargeResponses,
|
|
1119
|
+
ConfigureBillingRechargeErrors,
|
|
1120
|
+
ThrowOnError,
|
|
1121
|
+
"data"
|
|
1122
|
+
>({
|
|
1123
|
+
responseStyle: "data",
|
|
1124
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1125
|
+
url: "/v1/organizations/{organization_id}/billing/recharge",
|
|
1126
|
+
...options,
|
|
1127
|
+
...params,
|
|
1128
|
+
headers: {
|
|
1129
|
+
"Content-Type": "application/json",
|
|
1130
|
+
...options?.headers,
|
|
1131
|
+
...params.headers,
|
|
1132
|
+
},
|
|
1133
|
+
});
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Read the owner's shared organization credit pool
|
|
1138
|
+
*
|
|
1139
|
+
* Returns posted credits and reservations, in microcredits (one credit is 1000000 microcredits). Monthly entitlement posting is idempotent. Only the organization Owner may read this balance. active_meters names the currently billed sources; unreported usage is not included. platform_overrun_micros is recorded platform exposure, not customer debt. Remains available at zero credit.
|
|
1140
|
+
*/
|
|
1141
|
+
export const getOrganizationCredits = <ThrowOnError extends boolean = true>(
|
|
1142
|
+
parameters: {
|
|
1143
|
+
"X-Request-Id"?: string;
|
|
1144
|
+
organization_id: Ulid;
|
|
1145
|
+
},
|
|
1146
|
+
options?: Options<never, ThrowOnError>,
|
|
1147
|
+
): RequestResult<
|
|
1148
|
+
GetOrganizationCreditsResponses,
|
|
1149
|
+
GetOrganizationCreditsErrors,
|
|
1150
|
+
ThrowOnError,
|
|
1151
|
+
"data"
|
|
1152
|
+
> => {
|
|
1153
|
+
const params = buildClientParams(
|
|
1154
|
+
[parameters],
|
|
1155
|
+
[
|
|
1156
|
+
{
|
|
1157
|
+
args: [
|
|
1158
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1159
|
+
{ in: "path", key: "organization_id" },
|
|
1160
|
+
],
|
|
1161
|
+
},
|
|
1162
|
+
],
|
|
1163
|
+
);
|
|
1164
|
+
return (options?.client ?? client).get<
|
|
1165
|
+
GetOrganizationCreditsResponses,
|
|
1166
|
+
GetOrganizationCreditsErrors,
|
|
1167
|
+
ThrowOnError,
|
|
1168
|
+
"data"
|
|
1169
|
+
>({
|
|
1170
|
+
responseStyle: "data",
|
|
1171
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1172
|
+
url: "/v1/organizations/{organization_id}/credits",
|
|
1173
|
+
...options,
|
|
1174
|
+
...params,
|
|
1175
|
+
});
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* Read monthly measured usage by project and meter
|
|
1180
|
+
*
|
|
1181
|
+
* Owner-only event-month ledger totals, including signed corrections posted by as_of. Returns up to 20 projects per page in ID order; use next_cursor with the same month. Current unresolved reservations are separate from measured consumption. Null environment_id means project-shared cost, never guessed Dev allocation. Only posted measurements are included; this is not a complete provider invoice or zero-usage guarantee. Billing may arrive later. No credit is granted or charged by this read; it remains usable at zero credits.
|
|
1182
|
+
*/
|
|
1183
|
+
export const getOrganizationCreditUsage = <ThrowOnError extends boolean = true>(
|
|
1184
|
+
parameters: {
|
|
1185
|
+
"X-Request-Id"?: string;
|
|
1186
|
+
organization_id: Ulid;
|
|
1187
|
+
month: string;
|
|
1188
|
+
cursor?: Ulid;
|
|
1189
|
+
},
|
|
1190
|
+
options?: Options<never, ThrowOnError>,
|
|
1191
|
+
): RequestResult<
|
|
1192
|
+
GetOrganizationCreditUsageResponses,
|
|
1193
|
+
GetOrganizationCreditUsageErrors,
|
|
1194
|
+
ThrowOnError,
|
|
1195
|
+
"data"
|
|
1196
|
+
> => {
|
|
1197
|
+
const params = buildClientParams(
|
|
1198
|
+
[parameters],
|
|
1199
|
+
[
|
|
1200
|
+
{
|
|
1201
|
+
args: [
|
|
1202
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1203
|
+
{ in: "path", key: "organization_id" },
|
|
1204
|
+
{ in: "query", key: "month" },
|
|
1205
|
+
{ in: "query", key: "cursor" },
|
|
1206
|
+
],
|
|
1207
|
+
},
|
|
1208
|
+
],
|
|
1209
|
+
);
|
|
1210
|
+
return (options?.client ?? client).get<
|
|
1211
|
+
GetOrganizationCreditUsageResponses,
|
|
1212
|
+
GetOrganizationCreditUsageErrors,
|
|
1213
|
+
ThrowOnError,
|
|
1214
|
+
"data"
|
|
1215
|
+
>({
|
|
1216
|
+
responseStyle: "data",
|
|
1217
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1218
|
+
url: "/v1/organizations/{organization_id}/credit-usage",
|
|
1219
|
+
...options,
|
|
1220
|
+
...params,
|
|
1221
|
+
});
|
|
1222
|
+
};
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* Request an asynchronous password-encrypted SQL ZIP
|
|
1226
|
+
*
|
|
1227
|
+
* Owner-only and available at zero credits. Exports each confirmed physical project database once, including separate Dev/Prod SQL or one shared SQL file. Excludes files, source code and configuration. At most one accepted export per project per rolling 24 hours; failed jobs still count and idempotent replay returns the original operation. The user retains the password. Poll getProjectExport; do not create another job while it is running.
|
|
1228
|
+
*/
|
|
1229
|
+
export const createProjectExport = <ThrowOnError extends boolean = true>(
|
|
1230
|
+
parameters: {
|
|
1231
|
+
"X-Request-Id"?: string;
|
|
1232
|
+
"Idempotency-Key": string;
|
|
1233
|
+
project_id: Ulid;
|
|
1234
|
+
password: string;
|
|
1235
|
+
},
|
|
1236
|
+
options?: Options<never, ThrowOnError>,
|
|
1237
|
+
): RequestResult<CreateProjectExportResponses, CreateProjectExportErrors, ThrowOnError, "data"> => {
|
|
1238
|
+
const params = buildClientParams(
|
|
1239
|
+
[parameters],
|
|
1240
|
+
[
|
|
1241
|
+
{
|
|
1242
|
+
args: [
|
|
1243
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1244
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
1245
|
+
{ in: "path", key: "project_id" },
|
|
1246
|
+
{ in: "body", key: "password" },
|
|
1247
|
+
],
|
|
1248
|
+
},
|
|
1249
|
+
],
|
|
1250
|
+
);
|
|
1251
|
+
return (options?.client ?? client).post<
|
|
1252
|
+
CreateProjectExportResponses,
|
|
1253
|
+
CreateProjectExportErrors,
|
|
1254
|
+
ThrowOnError,
|
|
1255
|
+
"data"
|
|
1256
|
+
>({
|
|
1257
|
+
responseStyle: "data",
|
|
1258
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1259
|
+
url: "/v1/projects/{project_id}/exports",
|
|
1260
|
+
...options,
|
|
1261
|
+
...params,
|
|
1262
|
+
headers: {
|
|
1263
|
+
"Content-Type": "application/json",
|
|
1264
|
+
...options?.headers,
|
|
1265
|
+
...params.headers,
|
|
1266
|
+
},
|
|
1267
|
+
});
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Read export progress and its verified 24-hour download capability
|
|
1272
|
+
*
|
|
1273
|
+
* Owner-only, including at zero credits. Poll queued/running jobs after next_poll_after_seconds. A verified SQL ZIP is retained seven days. Its signed download URL is valid 24 hours and is issued only with at least 24 hours of retention left; otherwise download fields are null. Treat the URL as a secret bearer capability. Neither the password nor any permanent storage credential can be retrieved. Generic operation reads never contain this capability.
|
|
1274
|
+
*/
|
|
1275
|
+
export const getProjectExport = <ThrowOnError extends boolean = true>(
|
|
1276
|
+
parameters: {
|
|
1277
|
+
"X-Request-Id"?: string;
|
|
1278
|
+
project_id: Ulid;
|
|
1279
|
+
export_id: Ulid;
|
|
1280
|
+
},
|
|
1281
|
+
options?: Options<never, ThrowOnError>,
|
|
1282
|
+
): RequestResult<GetProjectExportResponses, GetProjectExportErrors, ThrowOnError, "data"> => {
|
|
1283
|
+
const params = buildClientParams(
|
|
1284
|
+
[parameters],
|
|
1285
|
+
[
|
|
1286
|
+
{
|
|
1287
|
+
args: [
|
|
1288
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1289
|
+
{ in: "path", key: "project_id" },
|
|
1290
|
+
{ in: "path", key: "export_id" },
|
|
1291
|
+
],
|
|
1292
|
+
},
|
|
1293
|
+
],
|
|
1294
|
+
);
|
|
1295
|
+
return (options?.client ?? client).get<
|
|
1296
|
+
GetProjectExportResponses,
|
|
1297
|
+
GetProjectExportErrors,
|
|
1298
|
+
ThrowOnError,
|
|
1299
|
+
"data"
|
|
1300
|
+
>({
|
|
1301
|
+
responseStyle: "data",
|
|
1302
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1303
|
+
url: "/v1/projects/{project_id}/exports/{export_id}",
|
|
1304
|
+
...options,
|
|
1305
|
+
...params,
|
|
1306
|
+
});
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* Read a project's optional monthly credit budget
|
|
1311
|
+
*
|
|
1312
|
+
* Owner-only snapshot of UTC-calendar-month measured usage and all open reservations. No budget means shared organization funds; continue mode does not stop at the threshold.
|
|
1313
|
+
*/
|
|
1314
|
+
export const getProjectCreditBudget = <ThrowOnError extends boolean = true>(
|
|
1315
|
+
parameters: {
|
|
1316
|
+
"X-Request-Id"?: string;
|
|
1317
|
+
project_id: Ulid;
|
|
1318
|
+
},
|
|
1319
|
+
options?: Options<never, ThrowOnError>,
|
|
1320
|
+
): RequestResult<
|
|
1321
|
+
GetProjectCreditBudgetResponses,
|
|
1322
|
+
GetProjectCreditBudgetErrors,
|
|
1323
|
+
ThrowOnError,
|
|
1324
|
+
"data"
|
|
1325
|
+
> => {
|
|
1326
|
+
const params = buildClientParams(
|
|
1327
|
+
[parameters],
|
|
1328
|
+
[
|
|
1329
|
+
{
|
|
1330
|
+
args: [
|
|
1331
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1332
|
+
{ in: "path", key: "project_id" },
|
|
1333
|
+
],
|
|
1334
|
+
},
|
|
1335
|
+
],
|
|
1336
|
+
);
|
|
1337
|
+
return (options?.client ?? client).get<
|
|
1338
|
+
GetProjectCreditBudgetResponses,
|
|
1339
|
+
GetProjectCreditBudgetErrors,
|
|
1340
|
+
ThrowOnError,
|
|
1341
|
+
"data"
|
|
1342
|
+
>({
|
|
1343
|
+
responseStyle: "data",
|
|
1344
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1345
|
+
url: "/v1/projects/{project_id}/credit-budget",
|
|
1346
|
+
...options,
|
|
1347
|
+
...params,
|
|
1348
|
+
});
|
|
1349
|
+
};
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* Set or clear the owner's project budget
|
|
1353
|
+
*
|
|
1354
|
+
* Changes only the budget policy, never credit grants or usage. amount_micros null clears the budget and requires continue mode. stop rejects new billable work when measured monthly usage plus reservations reaches the limit. This local setting completes atomically with its operation, audit and idempotent response; no provider job is queued. Replaying an old key returns its original snapshot without restoring its old policy.
|
|
1355
|
+
*/
|
|
1356
|
+
export const setProjectCreditBudget = <ThrowOnError extends boolean = true>(
|
|
1357
|
+
parameters: {
|
|
1358
|
+
"X-Request-Id"?: string;
|
|
1359
|
+
"Idempotency-Key": string;
|
|
1360
|
+
project_id: Ulid;
|
|
1361
|
+
setProjectCreditBudgetRequest: SetProjectCreditBudgetRequest;
|
|
1362
|
+
},
|
|
1363
|
+
options?: Options<never, ThrowOnError>,
|
|
1364
|
+
): RequestResult<
|
|
1365
|
+
SetProjectCreditBudgetResponses,
|
|
1366
|
+
SetProjectCreditBudgetErrors,
|
|
1367
|
+
ThrowOnError,
|
|
1368
|
+
"data"
|
|
1369
|
+
> => {
|
|
1370
|
+
const params = buildClientParams(
|
|
1371
|
+
[parameters],
|
|
1372
|
+
[
|
|
1373
|
+
{
|
|
1374
|
+
args: [
|
|
1375
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1376
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
1377
|
+
{ in: "path", key: "project_id" },
|
|
1378
|
+
{ key: "setProjectCreditBudgetRequest", map: "body" },
|
|
1379
|
+
],
|
|
1380
|
+
},
|
|
1381
|
+
],
|
|
1382
|
+
);
|
|
1383
|
+
return (options?.client ?? client).put<
|
|
1384
|
+
SetProjectCreditBudgetResponses,
|
|
1385
|
+
SetProjectCreditBudgetErrors,
|
|
1386
|
+
ThrowOnError,
|
|
1387
|
+
"data"
|
|
1388
|
+
>({
|
|
1389
|
+
responseStyle: "data",
|
|
1390
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1391
|
+
url: "/v1/projects/{project_id}/credit-budget",
|
|
1392
|
+
...options,
|
|
1393
|
+
...params,
|
|
1394
|
+
headers: {
|
|
1395
|
+
"Content-Type": "application/json",
|
|
1396
|
+
...options?.headers,
|
|
1397
|
+
...params.headers,
|
|
1398
|
+
},
|
|
1399
|
+
});
|
|
1400
|
+
};
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* List projects visible to the current authenticated identity
|
|
1404
|
+
*
|
|
1405
|
+
* Returns a stable ULID-ordered page across only the caller's authorized organizations. A session that selected no workspace can see nothing and returns organization_required (409) instead of an empty page; select a workspace and repeat.
|
|
1406
|
+
*/
|
|
1407
|
+
export const listProjects = <ThrowOnError extends boolean = true>(
|
|
1408
|
+
parameters?: {
|
|
1409
|
+
"X-Request-Id"?: string;
|
|
1410
|
+
cursor?: Ulid;
|
|
1411
|
+
limit?: number;
|
|
1412
|
+
},
|
|
1413
|
+
options?: Options<never, ThrowOnError>,
|
|
1414
|
+
): RequestResult<ListProjectsResponses, ListProjectsErrors, ThrowOnError, "data"> => {
|
|
1415
|
+
const params = buildClientParams(
|
|
1416
|
+
[parameters],
|
|
1417
|
+
[
|
|
1418
|
+
{
|
|
1419
|
+
args: [
|
|
1420
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1421
|
+
{ in: "query", key: "cursor" },
|
|
1422
|
+
{ in: "query", key: "limit" },
|
|
1423
|
+
],
|
|
1424
|
+
},
|
|
1425
|
+
],
|
|
1426
|
+
);
|
|
1427
|
+
return (options?.client ?? client).get<
|
|
1428
|
+
ListProjectsResponses,
|
|
1429
|
+
ListProjectsErrors,
|
|
1430
|
+
ThrowOnError,
|
|
1431
|
+
"data"
|
|
1432
|
+
>({
|
|
1433
|
+
responseStyle: "data",
|
|
1434
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1435
|
+
url: "/v1/projects",
|
|
1436
|
+
...options,
|
|
1437
|
+
...params,
|
|
1438
|
+
});
|
|
1439
|
+
};
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* Create a project
|
|
1443
|
+
*
|
|
1444
|
+
* Atomically records the project and a durable operation for asynchronous processing.
|
|
1445
|
+
*/
|
|
1446
|
+
export const createProject = <ThrowOnError extends boolean = true>(
|
|
1447
|
+
parameters: {
|
|
1448
|
+
"X-Request-Id"?: string;
|
|
1449
|
+
"Idempotency-Key": string;
|
|
1450
|
+
createProjectRequest: CreateProjectRequest;
|
|
1451
|
+
},
|
|
1452
|
+
options?: Options<never, ThrowOnError>,
|
|
1453
|
+
): RequestResult<CreateProjectResponses, CreateProjectErrors, ThrowOnError, "data"> => {
|
|
1454
|
+
const params = buildClientParams(
|
|
1455
|
+
[parameters],
|
|
1456
|
+
[
|
|
1457
|
+
{
|
|
1458
|
+
args: [
|
|
1459
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1460
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
1461
|
+
{ key: "createProjectRequest", map: "body" },
|
|
1462
|
+
],
|
|
1463
|
+
},
|
|
1464
|
+
],
|
|
1465
|
+
);
|
|
1466
|
+
return (options?.client ?? client).post<
|
|
1467
|
+
CreateProjectResponses,
|
|
1468
|
+
CreateProjectErrors,
|
|
1469
|
+
ThrowOnError,
|
|
1470
|
+
"data"
|
|
1471
|
+
>({
|
|
1472
|
+
responseStyle: "data",
|
|
1473
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1474
|
+
url: "/v1/projects",
|
|
1475
|
+
...options,
|
|
1476
|
+
...params,
|
|
1477
|
+
headers: {
|
|
1478
|
+
"Content-Type": "application/json",
|
|
1479
|
+
...options?.headers,
|
|
1480
|
+
...params.headers,
|
|
1481
|
+
},
|
|
1482
|
+
});
|
|
1483
|
+
};
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* Delete a project
|
|
1487
|
+
*
|
|
1488
|
+
* Asynchronously reconciles all project-owned resources and is safe to repeat.
|
|
1489
|
+
*/
|
|
1490
|
+
export const deleteProject = <ThrowOnError extends boolean = true>(
|
|
1491
|
+
parameters: {
|
|
1492
|
+
"X-Request-Id"?: string;
|
|
1493
|
+
"Idempotency-Key": string;
|
|
1494
|
+
"If-Match": string;
|
|
1495
|
+
"X-Confirmation-Token": ConfirmationToken;
|
|
1496
|
+
project_id: Ulid;
|
|
1497
|
+
},
|
|
1498
|
+
options?: Options<never, ThrowOnError>,
|
|
1499
|
+
): RequestResult<DeleteProjectResponses, DeleteProjectErrors, ThrowOnError, "data"> => {
|
|
1500
|
+
const params = buildClientParams(
|
|
1501
|
+
[parameters],
|
|
1502
|
+
[
|
|
1503
|
+
{
|
|
1504
|
+
args: [
|
|
1505
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1506
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
1507
|
+
{ in: "headers", key: "If-Match" },
|
|
1508
|
+
{ in: "headers", key: "X-Confirmation-Token" },
|
|
1509
|
+
{ in: "path", key: "project_id" },
|
|
1510
|
+
],
|
|
1511
|
+
},
|
|
1512
|
+
],
|
|
1513
|
+
);
|
|
1514
|
+
return (options?.client ?? client).delete<
|
|
1515
|
+
DeleteProjectResponses,
|
|
1516
|
+
DeleteProjectErrors,
|
|
1517
|
+
ThrowOnError,
|
|
1518
|
+
"data"
|
|
1519
|
+
>({
|
|
1520
|
+
responseStyle: "data",
|
|
1521
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1522
|
+
url: "/v1/projects/{project_id}",
|
|
1523
|
+
...options,
|
|
1524
|
+
...params,
|
|
1525
|
+
});
|
|
1526
|
+
};
|
|
1527
|
+
|
|
1528
|
+
/**
|
|
1529
|
+
* Get a project
|
|
1530
|
+
*/
|
|
1531
|
+
export const getProject = <ThrowOnError extends boolean = true>(
|
|
1532
|
+
parameters: {
|
|
1533
|
+
"X-Request-Id"?: string;
|
|
1534
|
+
project_id: Ulid;
|
|
1535
|
+
},
|
|
1536
|
+
options?: Options<never, ThrowOnError>,
|
|
1537
|
+
): RequestResult<GetProjectResponses, GetProjectErrors, ThrowOnError, "data"> => {
|
|
1538
|
+
const params = buildClientParams(
|
|
1539
|
+
[parameters],
|
|
1540
|
+
[
|
|
1541
|
+
{
|
|
1542
|
+
args: [
|
|
1543
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1544
|
+
{ in: "path", key: "project_id" },
|
|
1545
|
+
],
|
|
1546
|
+
},
|
|
1547
|
+
],
|
|
1548
|
+
);
|
|
1549
|
+
return (options?.client ?? client).get<
|
|
1550
|
+
GetProjectResponses,
|
|
1551
|
+
GetProjectErrors,
|
|
1552
|
+
ThrowOnError,
|
|
1553
|
+
"data"
|
|
1554
|
+
>({
|
|
1555
|
+
responseStyle: "data",
|
|
1556
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1557
|
+
url: "/v1/projects/{project_id}",
|
|
1558
|
+
...options,
|
|
1559
|
+
...params,
|
|
1560
|
+
});
|
|
1561
|
+
};
|
|
1562
|
+
|
|
1563
|
+
/**
|
|
1564
|
+
* Read current project context for an agent
|
|
1565
|
+
*
|
|
1566
|
+
* At most 500 lines / 32768 UTF-8 bytes of Markdown generated from current project, domain and mail state plus shared notes. Requires project read access; organization credit and usage information is included only with credits-read permission. Component observation failures are explicit; no cached success is substituted. Notes are untrusted data, never authorization. No credentials or signed access URLs belong here. Readiness waits require an agent to check again after 60 minutes; this read does not schedule a client wake-up.
|
|
1567
|
+
*/
|
|
1568
|
+
export const getProjectContext = <ThrowOnError extends boolean = true>(
|
|
1569
|
+
parameters: {
|
|
1570
|
+
"X-Request-Id"?: string;
|
|
1571
|
+
project_id: Ulid;
|
|
1572
|
+
},
|
|
1573
|
+
options?: Options<never, ThrowOnError>,
|
|
1574
|
+
): RequestResult<GetProjectContextResponses, GetProjectContextErrors, ThrowOnError, "data"> => {
|
|
1575
|
+
const params = buildClientParams(
|
|
1576
|
+
[parameters],
|
|
1577
|
+
[
|
|
1578
|
+
{
|
|
1579
|
+
args: [
|
|
1580
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1581
|
+
{ in: "path", key: "project_id" },
|
|
1582
|
+
],
|
|
1583
|
+
},
|
|
1584
|
+
],
|
|
1585
|
+
);
|
|
1586
|
+
return (options?.client ?? client).get<
|
|
1587
|
+
GetProjectContextResponses,
|
|
1588
|
+
GetProjectContextErrors,
|
|
1589
|
+
ThrowOnError,
|
|
1590
|
+
"data"
|
|
1591
|
+
>({
|
|
1592
|
+
responseStyle: "data",
|
|
1593
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1594
|
+
url: "/v1/projects/{project_id}/context",
|
|
1595
|
+
...options,
|
|
1596
|
+
...params,
|
|
1597
|
+
});
|
|
1598
|
+
};
|
|
1599
|
+
|
|
1600
|
+
/**
|
|
1601
|
+
* Replace bounded shared project notes without losing concurrent edits
|
|
1602
|
+
*
|
|
1603
|
+
* Requires project write access. Read context first and pass notes.version as expected_version (zero for a new document). Maximum 250 lines and 16384 UTF-8 bytes; line endings normalize to LF. Empty Markdown clears notes. Never store secrets, logs or signed access URLs. Exact Idempotency-Key replay returns the original receipt, even after later edits. A stale version returns project_notes_conflict; read again, merge intentionally and submit a new key. Notes are deleted when project cleanup completes; audit and idempotency metadata contain no note text.
|
|
1604
|
+
*/
|
|
1605
|
+
export const setProjectNotes = <ThrowOnError extends boolean = true>(
|
|
1606
|
+
parameters: {
|
|
1607
|
+
"X-Request-Id"?: string;
|
|
1608
|
+
"Idempotency-Key": string;
|
|
1609
|
+
project_id: Ulid;
|
|
1610
|
+
markdown: string;
|
|
1611
|
+
expected_version: number;
|
|
1612
|
+
},
|
|
1613
|
+
options?: Options<never, ThrowOnError>,
|
|
1614
|
+
): RequestResult<SetProjectNotesResponses, SetProjectNotesErrors, ThrowOnError, "data"> => {
|
|
1615
|
+
const params = buildClientParams(
|
|
1616
|
+
[parameters],
|
|
1617
|
+
[
|
|
1618
|
+
{
|
|
1619
|
+
args: [
|
|
1620
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1621
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
1622
|
+
{ in: "path", key: "project_id" },
|
|
1623
|
+
{ in: "body", key: "markdown" },
|
|
1624
|
+
{ in: "body", key: "expected_version" },
|
|
1625
|
+
],
|
|
1626
|
+
},
|
|
1627
|
+
],
|
|
1628
|
+
);
|
|
1629
|
+
return (options?.client ?? client).put<
|
|
1630
|
+
SetProjectNotesResponses,
|
|
1631
|
+
SetProjectNotesErrors,
|
|
1632
|
+
ThrowOnError,
|
|
1633
|
+
"data"
|
|
1634
|
+
>({
|
|
1635
|
+
responseStyle: "data",
|
|
1636
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1637
|
+
url: "/v1/projects/{project_id}/context/notes",
|
|
1638
|
+
...options,
|
|
1639
|
+
...params,
|
|
1640
|
+
headers: {
|
|
1641
|
+
"Content-Type": "application/json",
|
|
1642
|
+
...options?.headers,
|
|
1643
|
+
...params.headers,
|
|
1644
|
+
},
|
|
1645
|
+
});
|
|
1646
|
+
};
|
|
1647
|
+
|
|
1648
|
+
/**
|
|
1649
|
+
* Get the current project deployment status
|
|
1650
|
+
*
|
|
1651
|
+
* Returns the immutable project handle, current source, default environment, head deployment, independently evidenced dev and prod gateway origins, latest operation, and cleanup state without exposing provider credentials.
|
|
1652
|
+
*/
|
|
1653
|
+
export const getProjectStatus = <ThrowOnError extends boolean = true>(
|
|
1654
|
+
parameters: {
|
|
1655
|
+
"X-Request-Id"?: string;
|
|
1656
|
+
project_id: Ulid;
|
|
1657
|
+
},
|
|
1658
|
+
options?: Options<never, ThrowOnError>,
|
|
1659
|
+
): RequestResult<GetProjectStatusResponses, GetProjectStatusErrors, ThrowOnError, "data"> => {
|
|
1660
|
+
const params = buildClientParams(
|
|
1661
|
+
[parameters],
|
|
1662
|
+
[
|
|
1663
|
+
{
|
|
1664
|
+
args: [
|
|
1665
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1666
|
+
{ in: "path", key: "project_id" },
|
|
1667
|
+
],
|
|
1668
|
+
},
|
|
1669
|
+
],
|
|
1670
|
+
);
|
|
1671
|
+
return (options?.client ?? client).get<
|
|
1672
|
+
GetProjectStatusResponses,
|
|
1673
|
+
GetProjectStatusErrors,
|
|
1674
|
+
ThrowOnError,
|
|
1675
|
+
"data"
|
|
1676
|
+
>({
|
|
1677
|
+
responseStyle: "data",
|
|
1678
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1679
|
+
url: "/v1/projects/{project_id}/status",
|
|
1680
|
+
...options,
|
|
1681
|
+
...params,
|
|
1682
|
+
});
|
|
1683
|
+
};
|
|
1684
|
+
|
|
1685
|
+
/**
|
|
1686
|
+
* Create a single-use dev access ticket
|
|
1687
|
+
*
|
|
1688
|
+
* Owner-only issuance of a ten-minute single-use ticket for the immutable dev project origin. A new ticket revokes unused tickets previously issued to the same principal.
|
|
1689
|
+
*/
|
|
1690
|
+
export const createProjectDevAccessTicket = <ThrowOnError extends boolean = true>(
|
|
1691
|
+
parameters: {
|
|
1692
|
+
"X-Request-Id"?: string;
|
|
1693
|
+
project_id: Ulid;
|
|
1694
|
+
},
|
|
1695
|
+
options?: Options<never, ThrowOnError>,
|
|
1696
|
+
): RequestResult<
|
|
1697
|
+
CreateProjectDevAccessTicketResponses,
|
|
1698
|
+
CreateProjectDevAccessTicketErrors,
|
|
1699
|
+
ThrowOnError,
|
|
1700
|
+
"data"
|
|
1701
|
+
> => {
|
|
1702
|
+
const params = buildClientParams(
|
|
1703
|
+
[parameters],
|
|
1704
|
+
[
|
|
1705
|
+
{
|
|
1706
|
+
args: [
|
|
1707
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1708
|
+
{ in: "path", key: "project_id" },
|
|
1709
|
+
],
|
|
1710
|
+
},
|
|
1711
|
+
],
|
|
1712
|
+
);
|
|
1713
|
+
return (options?.client ?? client).post<
|
|
1714
|
+
CreateProjectDevAccessTicketResponses,
|
|
1715
|
+
CreateProjectDevAccessTicketErrors,
|
|
1716
|
+
ThrowOnError,
|
|
1717
|
+
"data"
|
|
1718
|
+
>({
|
|
1719
|
+
responseStyle: "data",
|
|
1720
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1721
|
+
url: "/v1/projects/{project_id}/dev-access-tickets",
|
|
1722
|
+
...options,
|
|
1723
|
+
...params,
|
|
1724
|
+
});
|
|
1725
|
+
};
|
|
1726
|
+
|
|
1727
|
+
/**
|
|
1728
|
+
* Plan project deletion
|
|
1729
|
+
*
|
|
1730
|
+
* Produces a non-mutating project deletion plan and a ten-minute action-bound confirmation token.
|
|
1731
|
+
*/
|
|
1732
|
+
export const planProjectDeletion = <ThrowOnError extends boolean = true>(
|
|
1733
|
+
parameters: {
|
|
1734
|
+
"X-Request-Id"?: string;
|
|
1735
|
+
project_id: Ulid;
|
|
1736
|
+
},
|
|
1737
|
+
options?: Options<never, ThrowOnError>,
|
|
1738
|
+
): RequestResult<PlanProjectDeletionResponses, PlanProjectDeletionErrors, ThrowOnError, "data"> => {
|
|
1739
|
+
const params = buildClientParams(
|
|
1740
|
+
[parameters],
|
|
1741
|
+
[
|
|
1742
|
+
{
|
|
1743
|
+
args: [
|
|
1744
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1745
|
+
{ in: "path", key: "project_id" },
|
|
1746
|
+
],
|
|
1747
|
+
},
|
|
1748
|
+
],
|
|
1749
|
+
);
|
|
1750
|
+
return (options?.client ?? client).post<
|
|
1751
|
+
PlanProjectDeletionResponses,
|
|
1752
|
+
PlanProjectDeletionErrors,
|
|
1753
|
+
ThrowOnError,
|
|
1754
|
+
"data"
|
|
1755
|
+
>({
|
|
1756
|
+
responseStyle: "data",
|
|
1757
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1758
|
+
url: "/v1/projects/{project_id}:delete-plan",
|
|
1759
|
+
...options,
|
|
1760
|
+
...params,
|
|
1761
|
+
});
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
/**
|
|
1765
|
+
* Link a GitHub source repository
|
|
1766
|
+
*
|
|
1767
|
+
* Uses the workspace GitHub connection to admit a source-link operation without another browser authorization or a build. The caller must have current sources:link permission and the connected installation must cover the repository. If the workspace is not connected, run github connect first; if repository access is missing, update the installation through its settings URL. Repeat identical arguments and key after uncertainty.
|
|
1768
|
+
*/
|
|
1769
|
+
export const linkProjectSource = <ThrowOnError extends boolean = true>(
|
|
1770
|
+
parameters: {
|
|
1771
|
+
"X-Request-Id"?: string;
|
|
1772
|
+
"Idempotency-Key": string;
|
|
1773
|
+
project_id: Ulid;
|
|
1774
|
+
linkProjectSourceRequest: LinkProjectSourceRequest;
|
|
1775
|
+
},
|
|
1776
|
+
options?: Options<never, ThrowOnError>,
|
|
1777
|
+
): RequestResult<LinkProjectSourceResponses, LinkProjectSourceErrors, ThrowOnError, "data"> => {
|
|
1778
|
+
const params = buildClientParams(
|
|
1779
|
+
[parameters],
|
|
1780
|
+
[
|
|
1781
|
+
{
|
|
1782
|
+
args: [
|
|
1783
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1784
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
1785
|
+
{ in: "path", key: "project_id" },
|
|
1786
|
+
{ key: "linkProjectSourceRequest", map: "body" },
|
|
1787
|
+
],
|
|
1788
|
+
},
|
|
1789
|
+
],
|
|
1790
|
+
);
|
|
1791
|
+
return (options?.client ?? client).post<
|
|
1792
|
+
LinkProjectSourceResponses,
|
|
1793
|
+
LinkProjectSourceErrors,
|
|
1794
|
+
ThrowOnError,
|
|
1795
|
+
"data"
|
|
1796
|
+
>({
|
|
1797
|
+
responseStyle: "data",
|
|
1798
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1799
|
+
url: "/v1/projects/{project_id}/source:link",
|
|
1800
|
+
...options,
|
|
1801
|
+
...params,
|
|
1802
|
+
headers: {
|
|
1803
|
+
"Content-Type": "application/json",
|
|
1804
|
+
...options?.headers,
|
|
1805
|
+
...params.headers,
|
|
1806
|
+
},
|
|
1807
|
+
});
|
|
1808
|
+
};
|
|
1809
|
+
|
|
1810
|
+
/**
|
|
1811
|
+
* Get the linked source status
|
|
1812
|
+
*/
|
|
1813
|
+
export const getProjectSource = <ThrowOnError extends boolean = true>(
|
|
1814
|
+
parameters: {
|
|
1815
|
+
"X-Request-Id"?: string;
|
|
1816
|
+
project_id: Ulid;
|
|
1817
|
+
},
|
|
1818
|
+
options?: Options<never, ThrowOnError>,
|
|
1819
|
+
): RequestResult<GetProjectSourceResponses, GetProjectSourceErrors, ThrowOnError, "data"> => {
|
|
1820
|
+
const params = buildClientParams(
|
|
1821
|
+
[parameters],
|
|
1822
|
+
[
|
|
1823
|
+
{
|
|
1824
|
+
args: [
|
|
1825
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1826
|
+
{ in: "path", key: "project_id" },
|
|
1827
|
+
],
|
|
1828
|
+
},
|
|
1829
|
+
],
|
|
1830
|
+
);
|
|
1831
|
+
return (options?.client ?? client).get<
|
|
1832
|
+
GetProjectSourceResponses,
|
|
1833
|
+
GetProjectSourceErrors,
|
|
1834
|
+
ThrowOnError,
|
|
1835
|
+
"data"
|
|
1836
|
+
>({
|
|
1837
|
+
responseStyle: "data",
|
|
1838
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1839
|
+
url: "/v1/projects/{project_id}/source",
|
|
1840
|
+
...options,
|
|
1841
|
+
...params,
|
|
1842
|
+
});
|
|
1843
|
+
};
|
|
1844
|
+
|
|
1845
|
+
/**
|
|
1846
|
+
* Get automatic GitHub push deployment status
|
|
1847
|
+
*/
|
|
1848
|
+
export const getProjectSourceAutoDeploy = <ThrowOnError extends boolean = true>(
|
|
1849
|
+
parameters: {
|
|
1850
|
+
"X-Request-Id"?: string;
|
|
1851
|
+
project_id: Ulid;
|
|
1852
|
+
},
|
|
1853
|
+
options?: Options<never, ThrowOnError>,
|
|
1854
|
+
): RequestResult<
|
|
1855
|
+
GetProjectSourceAutoDeployResponses,
|
|
1856
|
+
GetProjectSourceAutoDeployErrors,
|
|
1857
|
+
ThrowOnError,
|
|
1858
|
+
"data"
|
|
1859
|
+
> => {
|
|
1860
|
+
const params = buildClientParams(
|
|
1861
|
+
[parameters],
|
|
1862
|
+
[
|
|
1863
|
+
{
|
|
1864
|
+
args: [
|
|
1865
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1866
|
+
{ in: "path", key: "project_id" },
|
|
1867
|
+
],
|
|
1868
|
+
},
|
|
1869
|
+
],
|
|
1870
|
+
);
|
|
1871
|
+
return (options?.client ?? client).get<
|
|
1872
|
+
GetProjectSourceAutoDeployResponses,
|
|
1873
|
+
GetProjectSourceAutoDeployErrors,
|
|
1874
|
+
ThrowOnError,
|
|
1875
|
+
"data"
|
|
1876
|
+
>({
|
|
1877
|
+
responseStyle: "data",
|
|
1878
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1879
|
+
url: "/v1/projects/{project_id}/source/auto-deploy",
|
|
1880
|
+
...options,
|
|
1881
|
+
...params,
|
|
1882
|
+
});
|
|
1883
|
+
};
|
|
1884
|
+
|
|
1885
|
+
/**
|
|
1886
|
+
* Configure automatic GitHub push deployment
|
|
1887
|
+
*
|
|
1888
|
+
* Configures exactly one Git branch whose signed pushes deploy immutable commits to dev. Production remains an explicit promotion.
|
|
1889
|
+
*/
|
|
1890
|
+
export const configureProjectSourceAutoDeploy = <ThrowOnError extends boolean = true>(
|
|
1891
|
+
parameters: {
|
|
1892
|
+
"X-Request-Id"?: string;
|
|
1893
|
+
"Idempotency-Key": string;
|
|
1894
|
+
project_id: Ulid;
|
|
1895
|
+
configureSourceAutoDeployRequest: ConfigureSourceAutoDeployRequest;
|
|
1896
|
+
},
|
|
1897
|
+
options?: Options<never, ThrowOnError>,
|
|
1898
|
+
): RequestResult<
|
|
1899
|
+
ConfigureProjectSourceAutoDeployResponses,
|
|
1900
|
+
ConfigureProjectSourceAutoDeployErrors,
|
|
1901
|
+
ThrowOnError,
|
|
1902
|
+
"data"
|
|
1903
|
+
> => {
|
|
1904
|
+
const params = buildClientParams(
|
|
1905
|
+
[parameters],
|
|
1906
|
+
[
|
|
1907
|
+
{
|
|
1908
|
+
args: [
|
|
1909
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1910
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
1911
|
+
{ in: "path", key: "project_id" },
|
|
1912
|
+
{ key: "configureSourceAutoDeployRequest", map: "body" },
|
|
1913
|
+
],
|
|
1914
|
+
},
|
|
1915
|
+
],
|
|
1916
|
+
);
|
|
1917
|
+
return (options?.client ?? client).put<
|
|
1918
|
+
ConfigureProjectSourceAutoDeployResponses,
|
|
1919
|
+
ConfigureProjectSourceAutoDeployErrors,
|
|
1920
|
+
ThrowOnError,
|
|
1921
|
+
"data"
|
|
1922
|
+
>({
|
|
1923
|
+
responseStyle: "data",
|
|
1924
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1925
|
+
url: "/v1/projects/{project_id}/source/auto-deploy",
|
|
1926
|
+
...options,
|
|
1927
|
+
...params,
|
|
1928
|
+
headers: {
|
|
1929
|
+
"Content-Type": "application/json",
|
|
1930
|
+
...options?.headers,
|
|
1931
|
+
...params.headers,
|
|
1932
|
+
},
|
|
1933
|
+
});
|
|
1934
|
+
};
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* Start project-scoped Cloudflare DNS authorization
|
|
1938
|
+
*
|
|
1939
|
+
* Creates or replays one short-lived authorization URL for the customer Cloudflare zone bound to the project's Paid domain. Pending requests replay the original handoff. Expired or consumed requests return cloudflare_authorization_closed (409); read current DNS authorization status and reuse a valid matching grant, or request a fresh authorization with a new key. No provider credential is returned.
|
|
1940
|
+
*/
|
|
1941
|
+
export const createCloudflareDnsAuthorization = <ThrowOnError extends boolean = true>(
|
|
1942
|
+
parameters: {
|
|
1943
|
+
"X-Request-Id"?: string;
|
|
1944
|
+
"Idempotency-Key": string;
|
|
1945
|
+
project_id: Ulid;
|
|
1946
|
+
createCloudflareDnsAuthorizationRequest: CreateCloudflareDnsAuthorizationRequest;
|
|
1947
|
+
},
|
|
1948
|
+
options?: Options<never, ThrowOnError>,
|
|
1949
|
+
): RequestResult<
|
|
1950
|
+
CreateCloudflareDnsAuthorizationResponses,
|
|
1951
|
+
CreateCloudflareDnsAuthorizationErrors,
|
|
1952
|
+
ThrowOnError,
|
|
1953
|
+
"data"
|
|
1954
|
+
> => {
|
|
1955
|
+
const params = buildClientParams(
|
|
1956
|
+
[parameters],
|
|
1957
|
+
[
|
|
1958
|
+
{
|
|
1959
|
+
args: [
|
|
1960
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
1961
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
1962
|
+
{ in: "path", key: "project_id" },
|
|
1963
|
+
{ key: "createCloudflareDnsAuthorizationRequest", map: "body" },
|
|
1964
|
+
],
|
|
1965
|
+
},
|
|
1966
|
+
],
|
|
1967
|
+
);
|
|
1968
|
+
return (options?.client ?? client).post<
|
|
1969
|
+
CreateCloudflareDnsAuthorizationResponses,
|
|
1970
|
+
CreateCloudflareDnsAuthorizationErrors,
|
|
1971
|
+
ThrowOnError,
|
|
1972
|
+
"data"
|
|
1973
|
+
>({
|
|
1974
|
+
responseStyle: "data",
|
|
1975
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1976
|
+
url: "/v1/projects/{project_id}/cloudflare-dns/authorization",
|
|
1977
|
+
...options,
|
|
1978
|
+
...params,
|
|
1979
|
+
headers: {
|
|
1980
|
+
"Content-Type": "application/json",
|
|
1981
|
+
...options?.headers,
|
|
1982
|
+
...params.headers,
|
|
1983
|
+
},
|
|
1984
|
+
});
|
|
1985
|
+
};
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* Get project-scoped Cloudflare DNS authorization status
|
|
1989
|
+
*
|
|
1990
|
+
* Returns only the fixed zone, closed scope set, expiry, and authorization state; provider credentials are never exposed.
|
|
1991
|
+
*/
|
|
1992
|
+
export const getCloudflareDnsAuthorizationStatus = <ThrowOnError extends boolean = true>(
|
|
1993
|
+
parameters: {
|
|
1994
|
+
"X-Request-Id"?: string;
|
|
1995
|
+
project_id: Ulid;
|
|
1996
|
+
},
|
|
1997
|
+
options?: Options<never, ThrowOnError>,
|
|
1998
|
+
): RequestResult<
|
|
1999
|
+
GetCloudflareDnsAuthorizationStatusResponses,
|
|
2000
|
+
GetCloudflareDnsAuthorizationStatusErrors,
|
|
2001
|
+
ThrowOnError,
|
|
2002
|
+
"data"
|
|
2003
|
+
> => {
|
|
2004
|
+
const params = buildClientParams(
|
|
2005
|
+
[parameters],
|
|
2006
|
+
[
|
|
2007
|
+
{
|
|
2008
|
+
args: [
|
|
2009
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2010
|
+
{ in: "path", key: "project_id" },
|
|
2011
|
+
],
|
|
2012
|
+
},
|
|
2013
|
+
],
|
|
2014
|
+
);
|
|
2015
|
+
return (options?.client ?? client).get<
|
|
2016
|
+
GetCloudflareDnsAuthorizationStatusResponses,
|
|
2017
|
+
GetCloudflareDnsAuthorizationStatusErrors,
|
|
2018
|
+
ThrowOnError,
|
|
2019
|
+
"data"
|
|
2020
|
+
>({
|
|
2021
|
+
responseStyle: "data",
|
|
2022
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2023
|
+
url: "/v1/projects/{project_id}/cloudflare-dns",
|
|
2024
|
+
...options,
|
|
2025
|
+
...params,
|
|
2026
|
+
});
|
|
2027
|
+
};
|
|
2028
|
+
|
|
2029
|
+
/**
|
|
2030
|
+
* Apply the server-derived project domains
|
|
2031
|
+
*
|
|
2032
|
+
* Starts an idempotent durable operation for the exact project-derived development, production, and mail hostnames. The request has no body.
|
|
2033
|
+
*/
|
|
2034
|
+
export const configureProjectDomains = <ThrowOnError extends boolean = true>(
|
|
2035
|
+
parameters: {
|
|
2036
|
+
"X-Request-Id"?: string;
|
|
2037
|
+
"Idempotency-Key": string;
|
|
2038
|
+
project_id: Ulid;
|
|
2039
|
+
},
|
|
2040
|
+
options?: Options<never, ThrowOnError>,
|
|
2041
|
+
): RequestResult<
|
|
2042
|
+
ConfigureProjectDomainsResponses,
|
|
2043
|
+
ConfigureProjectDomainsErrors,
|
|
2044
|
+
ThrowOnError,
|
|
2045
|
+
"data"
|
|
2046
|
+
> => {
|
|
2047
|
+
const params = buildClientParams(
|
|
2048
|
+
[parameters],
|
|
2049
|
+
[
|
|
2050
|
+
{
|
|
2051
|
+
args: [
|
|
2052
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2053
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
2054
|
+
{ in: "path", key: "project_id" },
|
|
2055
|
+
],
|
|
2056
|
+
},
|
|
2057
|
+
],
|
|
2058
|
+
);
|
|
2059
|
+
return (options?.client ?? client).put<
|
|
2060
|
+
ConfigureProjectDomainsResponses,
|
|
2061
|
+
ConfigureProjectDomainsErrors,
|
|
2062
|
+
ThrowOnError,
|
|
2063
|
+
"data"
|
|
2064
|
+
>({
|
|
2065
|
+
responseStyle: "data",
|
|
2066
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2067
|
+
url: "/v1/projects/{project_id}/domains",
|
|
2068
|
+
...options,
|
|
2069
|
+
...params,
|
|
2070
|
+
});
|
|
2071
|
+
};
|
|
2072
|
+
|
|
2073
|
+
/**
|
|
2074
|
+
* Plan one Paid customer-owned hostname
|
|
2075
|
+
*/
|
|
2076
|
+
export const planPaidProjectDomain = <ThrowOnError extends boolean = true>(
|
|
2077
|
+
parameters: {
|
|
2078
|
+
"X-Request-Id"?: string;
|
|
2079
|
+
project_id: Ulid;
|
|
2080
|
+
paidDomainRequest: PaidDomainRequest;
|
|
2081
|
+
},
|
|
2082
|
+
options?: Options<never, ThrowOnError>,
|
|
2083
|
+
): RequestResult<
|
|
2084
|
+
PlanPaidProjectDomainResponses,
|
|
2085
|
+
PlanPaidProjectDomainErrors,
|
|
2086
|
+
ThrowOnError,
|
|
2087
|
+
"data"
|
|
2088
|
+
> => {
|
|
2089
|
+
const params = buildClientParams(
|
|
2090
|
+
[parameters],
|
|
2091
|
+
[
|
|
2092
|
+
{
|
|
2093
|
+
args: [
|
|
2094
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2095
|
+
{ in: "path", key: "project_id" },
|
|
2096
|
+
{ key: "paidDomainRequest", map: "body" },
|
|
2097
|
+
],
|
|
2098
|
+
},
|
|
2099
|
+
],
|
|
2100
|
+
);
|
|
2101
|
+
return (options?.client ?? client).post<
|
|
2102
|
+
PlanPaidProjectDomainResponses,
|
|
2103
|
+
PlanPaidProjectDomainErrors,
|
|
2104
|
+
ThrowOnError,
|
|
2105
|
+
"data"
|
|
2106
|
+
>({
|
|
2107
|
+
responseStyle: "data",
|
|
2108
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2109
|
+
url: "/v1/projects/{project_id}/paid-domain:plan",
|
|
2110
|
+
...options,
|
|
2111
|
+
...params,
|
|
2112
|
+
headers: {
|
|
2113
|
+
"Content-Type": "application/json",
|
|
2114
|
+
...options?.headers,
|
|
2115
|
+
...params.headers,
|
|
2116
|
+
},
|
|
2117
|
+
});
|
|
2118
|
+
};
|
|
2119
|
+
|
|
2120
|
+
/**
|
|
2121
|
+
* Delete one exact Paid customer-owned hostname
|
|
2122
|
+
*/
|
|
2123
|
+
export const deletePaidProjectDomain = <ThrowOnError extends boolean = true>(
|
|
2124
|
+
parameters: {
|
|
2125
|
+
"X-Request-Id"?: string;
|
|
2126
|
+
"Idempotency-Key": string;
|
|
2127
|
+
project_id: Ulid;
|
|
2128
|
+
paidDomainRequest: PaidDomainRequest;
|
|
2129
|
+
},
|
|
2130
|
+
options?: Options<never, ThrowOnError>,
|
|
2131
|
+
): RequestResult<
|
|
2132
|
+
DeletePaidProjectDomainResponses,
|
|
2133
|
+
DeletePaidProjectDomainErrors,
|
|
2134
|
+
ThrowOnError,
|
|
2135
|
+
"data"
|
|
2136
|
+
> => {
|
|
2137
|
+
const params = buildClientParams(
|
|
2138
|
+
[parameters],
|
|
2139
|
+
[
|
|
2140
|
+
{
|
|
2141
|
+
args: [
|
|
2142
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2143
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
2144
|
+
{ in: "path", key: "project_id" },
|
|
2145
|
+
{ key: "paidDomainRequest", map: "body" },
|
|
2146
|
+
],
|
|
2147
|
+
},
|
|
2148
|
+
],
|
|
2149
|
+
);
|
|
2150
|
+
return (options?.client ?? client).delete<
|
|
2151
|
+
DeletePaidProjectDomainResponses,
|
|
2152
|
+
DeletePaidProjectDomainErrors,
|
|
2153
|
+
ThrowOnError,
|
|
2154
|
+
"data"
|
|
2155
|
+
>({
|
|
2156
|
+
responseStyle: "data",
|
|
2157
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2158
|
+
url: "/v1/projects/{project_id}/paid-domain",
|
|
2159
|
+
...options,
|
|
2160
|
+
...params,
|
|
2161
|
+
headers: {
|
|
2162
|
+
"Content-Type": "application/json",
|
|
2163
|
+
...options?.headers,
|
|
2164
|
+
...params.headers,
|
|
2165
|
+
},
|
|
2166
|
+
});
|
|
2167
|
+
};
|
|
2168
|
+
|
|
2169
|
+
/**
|
|
2170
|
+
* Read the Paid customer-owned hostname
|
|
2171
|
+
*/
|
|
2172
|
+
export const getPaidProjectDomain = <ThrowOnError extends boolean = true>(
|
|
2173
|
+
parameters: {
|
|
2174
|
+
"X-Request-Id"?: string;
|
|
2175
|
+
project_id: Ulid;
|
|
2176
|
+
},
|
|
2177
|
+
options?: Options<never, ThrowOnError>,
|
|
2178
|
+
): RequestResult<
|
|
2179
|
+
GetPaidProjectDomainResponses,
|
|
2180
|
+
GetPaidProjectDomainErrors,
|
|
2181
|
+
ThrowOnError,
|
|
2182
|
+
"data"
|
|
2183
|
+
> => {
|
|
2184
|
+
const params = buildClientParams(
|
|
2185
|
+
[parameters],
|
|
2186
|
+
[
|
|
2187
|
+
{
|
|
2188
|
+
args: [
|
|
2189
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2190
|
+
{ in: "path", key: "project_id" },
|
|
2191
|
+
],
|
|
2192
|
+
},
|
|
2193
|
+
],
|
|
2194
|
+
);
|
|
2195
|
+
return (options?.client ?? client).get<
|
|
2196
|
+
GetPaidProjectDomainResponses,
|
|
2197
|
+
GetPaidProjectDomainErrors,
|
|
2198
|
+
ThrowOnError,
|
|
2199
|
+
"data"
|
|
2200
|
+
>({
|
|
2201
|
+
responseStyle: "data",
|
|
2202
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2203
|
+
url: "/v1/projects/{project_id}/paid-domain",
|
|
2204
|
+
...options,
|
|
2205
|
+
...params,
|
|
2206
|
+
});
|
|
2207
|
+
};
|
|
2208
|
+
|
|
2209
|
+
/**
|
|
2210
|
+
* Apply one Paid customer-owned hostname
|
|
2211
|
+
*
|
|
2212
|
+
* Requires a confirmed current Paid service period and no expired credit-exhaustion grace. Returns paid_plan_required without a Paid period, or insufficient_organization_credits after seven days with no available credits, without provider mutation. Top-ups restore exhausted Paid access but do not create or extend a Paid service period.
|
|
2213
|
+
*/
|
|
2214
|
+
export const applyPaidProjectDomain = <ThrowOnError extends boolean = true>(
|
|
2215
|
+
parameters: {
|
|
2216
|
+
"X-Request-Id"?: string;
|
|
2217
|
+
"Idempotency-Key": string;
|
|
2218
|
+
project_id: Ulid;
|
|
2219
|
+
paidDomainRequest: PaidDomainRequest;
|
|
2220
|
+
},
|
|
2221
|
+
options?: Options<never, ThrowOnError>,
|
|
2222
|
+
): RequestResult<
|
|
2223
|
+
ApplyPaidProjectDomainResponses,
|
|
2224
|
+
ApplyPaidProjectDomainErrors,
|
|
2225
|
+
ThrowOnError,
|
|
2226
|
+
"data"
|
|
2227
|
+
> => {
|
|
2228
|
+
const params = buildClientParams(
|
|
2229
|
+
[parameters],
|
|
2230
|
+
[
|
|
2231
|
+
{
|
|
2232
|
+
args: [
|
|
2233
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2234
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
2235
|
+
{ in: "path", key: "project_id" },
|
|
2236
|
+
{ key: "paidDomainRequest", map: "body" },
|
|
2237
|
+
],
|
|
2238
|
+
},
|
|
2239
|
+
],
|
|
2240
|
+
);
|
|
2241
|
+
return (options?.client ?? client).put<
|
|
2242
|
+
ApplyPaidProjectDomainResponses,
|
|
2243
|
+
ApplyPaidProjectDomainErrors,
|
|
2244
|
+
ThrowOnError,
|
|
2245
|
+
"data"
|
|
2246
|
+
>({
|
|
2247
|
+
responseStyle: "data",
|
|
2248
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2249
|
+
url: "/v1/projects/{project_id}/paid-domain",
|
|
2250
|
+
...options,
|
|
2251
|
+
...params,
|
|
2252
|
+
headers: {
|
|
2253
|
+
"Content-Type": "application/json",
|
|
2254
|
+
...options?.headers,
|
|
2255
|
+
...params.headers,
|
|
2256
|
+
},
|
|
2257
|
+
});
|
|
2258
|
+
};
|
|
2259
|
+
|
|
2260
|
+
/**
|
|
2261
|
+
* Get sender-domain delegation status
|
|
2262
|
+
*/
|
|
2263
|
+
export const getProjectMailDomain = <ThrowOnError extends boolean = true>(
|
|
2264
|
+
parameters: {
|
|
2265
|
+
"X-Request-Id"?: string;
|
|
2266
|
+
project_id: Ulid;
|
|
2267
|
+
},
|
|
2268
|
+
options?: Options<never, ThrowOnError>,
|
|
2269
|
+
): RequestResult<
|
|
2270
|
+
GetProjectMailDomainResponses,
|
|
2271
|
+
GetProjectMailDomainErrors,
|
|
2272
|
+
ThrowOnError,
|
|
2273
|
+
"data"
|
|
2274
|
+
> => {
|
|
2275
|
+
const params = buildClientParams(
|
|
2276
|
+
[parameters],
|
|
2277
|
+
[
|
|
2278
|
+
{
|
|
2279
|
+
args: [
|
|
2280
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2281
|
+
{ in: "path", key: "project_id" },
|
|
2282
|
+
],
|
|
2283
|
+
},
|
|
2284
|
+
],
|
|
2285
|
+
);
|
|
2286
|
+
return (options?.client ?? client).get<
|
|
2287
|
+
GetProjectMailDomainResponses,
|
|
2288
|
+
GetProjectMailDomainErrors,
|
|
2289
|
+
ThrowOnError,
|
|
2290
|
+
"data"
|
|
2291
|
+
>({
|
|
2292
|
+
responseStyle: "data",
|
|
2293
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2294
|
+
url: "/v1/projects/{project_id}/mail-domain",
|
|
2295
|
+
...options,
|
|
2296
|
+
...params,
|
|
2297
|
+
});
|
|
2298
|
+
};
|
|
2299
|
+
|
|
2300
|
+
/**
|
|
2301
|
+
* Configure the project sender subdomain
|
|
2302
|
+
*
|
|
2303
|
+
* Create-only admission for one canonical sender subdomain, requiring a confirmed current Paid service period. Top-ups and promotional credits do not enable Paid. Provider mutation occurs only inside a later authorized deployment Workflow.
|
|
2304
|
+
*/
|
|
2305
|
+
export const configureProjectMailDomain = <ThrowOnError extends boolean = true>(
|
|
2306
|
+
parameters: {
|
|
2307
|
+
"X-Request-Id"?: string;
|
|
2308
|
+
"Idempotency-Key": string;
|
|
2309
|
+
project_id: Ulid;
|
|
2310
|
+
configureProjectMailDomainRequest: ConfigureProjectMailDomainRequest;
|
|
2311
|
+
},
|
|
2312
|
+
options?: Options<never, ThrowOnError>,
|
|
2313
|
+
): RequestResult<
|
|
2314
|
+
ConfigureProjectMailDomainResponses,
|
|
2315
|
+
ConfigureProjectMailDomainErrors,
|
|
2316
|
+
ThrowOnError,
|
|
2317
|
+
"data"
|
|
2318
|
+
> => {
|
|
2319
|
+
const params = buildClientParams(
|
|
2320
|
+
[parameters],
|
|
2321
|
+
[
|
|
2322
|
+
{
|
|
2323
|
+
args: [
|
|
2324
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2325
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
2326
|
+
{ in: "path", key: "project_id" },
|
|
2327
|
+
{ key: "configureProjectMailDomainRequest", map: "body" },
|
|
2328
|
+
],
|
|
2329
|
+
},
|
|
2330
|
+
],
|
|
2331
|
+
);
|
|
2332
|
+
return (options?.client ?? client).put<
|
|
2333
|
+
ConfigureProjectMailDomainResponses,
|
|
2334
|
+
ConfigureProjectMailDomainErrors,
|
|
2335
|
+
ThrowOnError,
|
|
2336
|
+
"data"
|
|
2337
|
+
>({
|
|
2338
|
+
responseStyle: "data",
|
|
2339
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2340
|
+
url: "/v1/projects/{project_id}/mail-domain",
|
|
2341
|
+
...options,
|
|
2342
|
+
...params,
|
|
2343
|
+
headers: {
|
|
2344
|
+
"Content-Type": "application/json",
|
|
2345
|
+
...options?.headers,
|
|
2346
|
+
...params.headers,
|
|
2347
|
+
},
|
|
2348
|
+
});
|
|
2349
|
+
};
|
|
2350
|
+
|
|
2351
|
+
/**
|
|
2352
|
+
* Plan a deployment
|
|
2353
|
+
*
|
|
2354
|
+
* Resolves immutable inputs and estimates effects without provider mutation or billable work. Mail and the currently supported mail-backed Better Auth contract require a confirmed Paid service period; it is checked again before build reservation. An old sender configuration is not Paid authority.
|
|
2355
|
+
*/
|
|
2356
|
+
export const planDeployment = <ThrowOnError extends boolean = true>(
|
|
2357
|
+
parameters: {
|
|
2358
|
+
"X-Request-Id"?: string;
|
|
2359
|
+
project_id: Ulid;
|
|
2360
|
+
planDeploymentRequest: PlanDeploymentRequest;
|
|
2361
|
+
},
|
|
2362
|
+
options?: Options<never, ThrowOnError>,
|
|
2363
|
+
): RequestResult<PlanDeploymentResponses, PlanDeploymentErrors, ThrowOnError, "data"> => {
|
|
2364
|
+
const params = buildClientParams(
|
|
2365
|
+
[parameters],
|
|
2366
|
+
[
|
|
2367
|
+
{
|
|
2368
|
+
args: [
|
|
2369
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2370
|
+
{ in: "path", key: "project_id" },
|
|
2371
|
+
{ key: "planDeploymentRequest", map: "body" },
|
|
2372
|
+
],
|
|
2373
|
+
},
|
|
2374
|
+
],
|
|
2375
|
+
);
|
|
2376
|
+
return (options?.client ?? client).post<
|
|
2377
|
+
PlanDeploymentResponses,
|
|
2378
|
+
PlanDeploymentErrors,
|
|
2379
|
+
ThrowOnError,
|
|
2380
|
+
"data"
|
|
2381
|
+
>({
|
|
2382
|
+
responseStyle: "data",
|
|
2383
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2384
|
+
url: "/v1/projects/{project_id}/deployments:plan",
|
|
2385
|
+
...options,
|
|
2386
|
+
...params,
|
|
2387
|
+
headers: {
|
|
2388
|
+
"Content-Type": "application/json",
|
|
2389
|
+
...options?.headers,
|
|
2390
|
+
...params.headers,
|
|
2391
|
+
},
|
|
2392
|
+
});
|
|
2393
|
+
};
|
|
2394
|
+
|
|
2395
|
+
/**
|
|
2396
|
+
* List deployments
|
|
2397
|
+
*/
|
|
2398
|
+
export const listDeployments = <ThrowOnError extends boolean = true>(
|
|
2399
|
+
parameters: {
|
|
2400
|
+
"X-Request-Id"?: string;
|
|
2401
|
+
project_id: Ulid;
|
|
2402
|
+
cursor?: string;
|
|
2403
|
+
limit?: number;
|
|
2404
|
+
},
|
|
2405
|
+
options?: Options<never, ThrowOnError>,
|
|
2406
|
+
): RequestResult<ListDeploymentsResponses, ListDeploymentsErrors, ThrowOnError, "data"> => {
|
|
2407
|
+
const params = buildClientParams(
|
|
2408
|
+
[parameters],
|
|
2409
|
+
[
|
|
2410
|
+
{
|
|
2411
|
+
args: [
|
|
2412
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2413
|
+
{ in: "path", key: "project_id" },
|
|
2414
|
+
{ in: "query", key: "cursor" },
|
|
2415
|
+
{ in: "query", key: "limit" },
|
|
2416
|
+
],
|
|
2417
|
+
},
|
|
2418
|
+
],
|
|
2419
|
+
);
|
|
2420
|
+
return (options?.client ?? client).get<
|
|
2421
|
+
ListDeploymentsResponses,
|
|
2422
|
+
ListDeploymentsErrors,
|
|
2423
|
+
ThrowOnError,
|
|
2424
|
+
"data"
|
|
2425
|
+
>({
|
|
2426
|
+
responseStyle: "data",
|
|
2427
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2428
|
+
url: "/v1/projects/{project_id}/deployments",
|
|
2429
|
+
...options,
|
|
2430
|
+
...params,
|
|
2431
|
+
});
|
|
2432
|
+
};
|
|
2433
|
+
|
|
2434
|
+
/**
|
|
2435
|
+
* Create a deployment
|
|
2436
|
+
*
|
|
2437
|
+
* Reserves the quoted build credits from the shared organization pool and starts the exact reviewed plan as one durable operation. Insufficient available credits or an explicit project stop budget rejects before operation creation or provider work. Repeating the accepted request never reserves twice.
|
|
2438
|
+
*/
|
|
2439
|
+
export const createDeployment = <ThrowOnError extends boolean = true>(
|
|
2440
|
+
parameters: {
|
|
2441
|
+
"X-Request-Id"?: string;
|
|
2442
|
+
"Idempotency-Key": string;
|
|
2443
|
+
project_id: Ulid;
|
|
2444
|
+
createDeploymentRequest: CreateDeploymentRequest;
|
|
2445
|
+
},
|
|
2446
|
+
options?: Options<never, ThrowOnError>,
|
|
2447
|
+
): RequestResult<CreateDeploymentResponses, CreateDeploymentErrors, ThrowOnError, "data"> => {
|
|
2448
|
+
const params = buildClientParams(
|
|
2449
|
+
[parameters],
|
|
2450
|
+
[
|
|
2451
|
+
{
|
|
2452
|
+
args: [
|
|
2453
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2454
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
2455
|
+
{ in: "path", key: "project_id" },
|
|
2456
|
+
{ key: "createDeploymentRequest", map: "body" },
|
|
2457
|
+
],
|
|
2458
|
+
},
|
|
2459
|
+
],
|
|
2460
|
+
);
|
|
2461
|
+
return (options?.client ?? client).post<
|
|
2462
|
+
CreateDeploymentResponses,
|
|
2463
|
+
CreateDeploymentErrors,
|
|
2464
|
+
ThrowOnError,
|
|
2465
|
+
"data"
|
|
2466
|
+
>({
|
|
2467
|
+
responseStyle: "data",
|
|
2468
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2469
|
+
url: "/v1/projects/{project_id}/deployments",
|
|
2470
|
+
...options,
|
|
2471
|
+
...params,
|
|
2472
|
+
headers: {
|
|
2473
|
+
"Content-Type": "application/json",
|
|
2474
|
+
...options?.headers,
|
|
2475
|
+
...params.headers,
|
|
2476
|
+
},
|
|
2477
|
+
});
|
|
2478
|
+
};
|
|
2479
|
+
|
|
2480
|
+
/**
|
|
2481
|
+
* Get deployment status
|
|
2482
|
+
*/
|
|
2483
|
+
export const getDeployment = <ThrowOnError extends boolean = true>(
|
|
2484
|
+
parameters: {
|
|
2485
|
+
"X-Request-Id"?: string;
|
|
2486
|
+
project_id: Ulid;
|
|
2487
|
+
deployment_id: Ulid;
|
|
2488
|
+
},
|
|
2489
|
+
options?: Options<never, ThrowOnError>,
|
|
2490
|
+
): RequestResult<GetDeploymentResponses, GetDeploymentErrors, ThrowOnError, "data"> => {
|
|
2491
|
+
const params = buildClientParams(
|
|
2492
|
+
[parameters],
|
|
2493
|
+
[
|
|
2494
|
+
{
|
|
2495
|
+
args: [
|
|
2496
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2497
|
+
{ in: "path", key: "project_id" },
|
|
2498
|
+
{ in: "path", key: "deployment_id" },
|
|
2499
|
+
],
|
|
2500
|
+
},
|
|
2501
|
+
],
|
|
2502
|
+
);
|
|
2503
|
+
return (options?.client ?? client).get<
|
|
2504
|
+
GetDeploymentResponses,
|
|
2505
|
+
GetDeploymentErrors,
|
|
2506
|
+
ThrowOnError,
|
|
2507
|
+
"data"
|
|
2508
|
+
>({
|
|
2509
|
+
responseStyle: "data",
|
|
2510
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2511
|
+
url: "/v1/projects/{project_id}/deployments/{deployment_id}",
|
|
2512
|
+
...options,
|
|
2513
|
+
...params,
|
|
2514
|
+
});
|
|
2515
|
+
};
|
|
2516
|
+
|
|
2517
|
+
/**
|
|
2518
|
+
* List normalized deployment diagnostics
|
|
2519
|
+
*/
|
|
2520
|
+
export const getDeploymentLogs = <ThrowOnError extends boolean = true>(
|
|
2521
|
+
parameters: {
|
|
2522
|
+
"X-Request-Id"?: string;
|
|
2523
|
+
project_id: Ulid;
|
|
2524
|
+
deployment_id: Ulid;
|
|
2525
|
+
cursor?: string;
|
|
2526
|
+
limit?: number;
|
|
2527
|
+
},
|
|
2528
|
+
options?: Options<never, ThrowOnError>,
|
|
2529
|
+
): RequestResult<GetDeploymentLogsResponses, GetDeploymentLogsErrors, ThrowOnError, "data"> => {
|
|
2530
|
+
const params = buildClientParams(
|
|
2531
|
+
[parameters],
|
|
2532
|
+
[
|
|
2533
|
+
{
|
|
2534
|
+
args: [
|
|
2535
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2536
|
+
{ in: "path", key: "project_id" },
|
|
2537
|
+
{ in: "path", key: "deployment_id" },
|
|
2538
|
+
{ in: "query", key: "cursor" },
|
|
2539
|
+
{ in: "query", key: "limit" },
|
|
2540
|
+
],
|
|
2541
|
+
},
|
|
2542
|
+
],
|
|
2543
|
+
);
|
|
2544
|
+
return (options?.client ?? client).get<
|
|
2545
|
+
GetDeploymentLogsResponses,
|
|
2546
|
+
GetDeploymentLogsErrors,
|
|
2547
|
+
ThrowOnError,
|
|
2548
|
+
"data"
|
|
2549
|
+
>({
|
|
2550
|
+
responseStyle: "data",
|
|
2551
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2552
|
+
url: "/v1/projects/{project_id}/deployments/{deployment_id}/logs",
|
|
2553
|
+
...options,
|
|
2554
|
+
...params,
|
|
2555
|
+
});
|
|
2556
|
+
};
|
|
2557
|
+
|
|
2558
|
+
/**
|
|
2559
|
+
* Stream normalized deployment diagnostics
|
|
2560
|
+
*/
|
|
2561
|
+
export const streamDeploymentLogs = <ThrowOnError extends boolean = true>(
|
|
2562
|
+
parameters: {
|
|
2563
|
+
"X-Request-Id"?: string;
|
|
2564
|
+
project_id: Ulid;
|
|
2565
|
+
deployment_id: Ulid;
|
|
2566
|
+
},
|
|
2567
|
+
options?: Options<never, ThrowOnError, StreamDeploymentLogsResponse>,
|
|
2568
|
+
): Promise<ServerSentEventsResult<StreamDeploymentLogsResponses>> => {
|
|
2569
|
+
const params = buildClientParams(
|
|
2570
|
+
[parameters],
|
|
2571
|
+
[
|
|
2572
|
+
{
|
|
2573
|
+
args: [
|
|
2574
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2575
|
+
{ in: "path", key: "project_id" },
|
|
2576
|
+
{ in: "path", key: "deployment_id" },
|
|
2577
|
+
],
|
|
2578
|
+
},
|
|
2579
|
+
],
|
|
2580
|
+
);
|
|
2581
|
+
return (options?.client ?? client).sse.get<
|
|
2582
|
+
StreamDeploymentLogsResponses,
|
|
2583
|
+
StreamDeploymentLogsErrors,
|
|
2584
|
+
ThrowOnError,
|
|
2585
|
+
"data"
|
|
2586
|
+
>({
|
|
2587
|
+
responseStyle: "data",
|
|
2588
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2589
|
+
url: "/v1/projects/{project_id}/deployments/{deployment_id}/logs/events",
|
|
2590
|
+
...options,
|
|
2591
|
+
...params,
|
|
2592
|
+
});
|
|
2593
|
+
};
|
|
2594
|
+
|
|
2595
|
+
/**
|
|
2596
|
+
* Read actual managed database compute configuration
|
|
2597
|
+
*
|
|
2598
|
+
* Project readers can observe current Dev or Prod compute without receiving provider IDs or credentials and without executing SQL or waking the database. Explicitly shared data resolves to the same physical database for both environments. A null database means the owned environment has no confirmed managed placement. Provider failures return a problem, never invented defaults. Configuration describes observed settings, not a completed resize operation. suspend_timeout_seconds is the configured provider value; 0 means provider default and -1 means never suspend.
|
|
2599
|
+
*/
|
|
2600
|
+
export const getDatabaseCompute = <ThrowOnError extends boolean = true>(
|
|
2601
|
+
parameters: {
|
|
2602
|
+
"X-Request-Id"?: string;
|
|
2603
|
+
project_id: Ulid;
|
|
2604
|
+
environment?: "dev" | "prod";
|
|
2605
|
+
},
|
|
2606
|
+
options?: Options<never, ThrowOnError>,
|
|
2607
|
+
): RequestResult<GetDatabaseComputeResponses, GetDatabaseComputeErrors, ThrowOnError, "data"> => {
|
|
2608
|
+
const params = buildClientParams(
|
|
2609
|
+
[parameters],
|
|
2610
|
+
[
|
|
2611
|
+
{
|
|
2612
|
+
args: [
|
|
2613
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2614
|
+
{ in: "path", key: "project_id" },
|
|
2615
|
+
{ in: "query", key: "environment" },
|
|
2616
|
+
],
|
|
2617
|
+
},
|
|
2618
|
+
],
|
|
2619
|
+
);
|
|
2620
|
+
return (options?.client ?? client).get<
|
|
2621
|
+
GetDatabaseComputeResponses,
|
|
2622
|
+
GetDatabaseComputeErrors,
|
|
2623
|
+
ThrowOnError,
|
|
2624
|
+
"data"
|
|
2625
|
+
>({
|
|
2626
|
+
responseStyle: "data",
|
|
2627
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2628
|
+
url: "/v1/projects/{project_id}/database/compute",
|
|
2629
|
+
...options,
|
|
2630
|
+
...params,
|
|
2631
|
+
});
|
|
2632
|
+
};
|
|
2633
|
+
|
|
2634
|
+
/**
|
|
2635
|
+
* Select standard or Paid performance database compute
|
|
2636
|
+
*
|
|
2637
|
+
* Requires project-write access and explicit confirmation. Reads the organization plan at acceptance (Free 0.25 CU/1 GB/60 idle seconds or Paid 0.5 CU/2 GB/60 idle seconds). Changes the existing database in place without copying or resetting data. Shared Dev/Prod data changes both environments. A brief connection interruption is possible. Poll the returned operation every 60 seconds; do not submit a second change while it runs. Completion requires actual provider settings and settled operations. Actual CU consumption remains metered. Performance requires effective Paid access and an active rate; it selects fixed 1 CU/4 GB/300 idle seconds at 2.5 times Paid-standard database compute credits per equal active minute. Only database compute changes price. Raw CU-second measurements are preserved; mixed or uncertain transition hours waive the premium. Returning to standard restores the effective plan size.
|
|
2638
|
+
*/
|
|
2639
|
+
export const changeDatabaseCompute = <ThrowOnError extends boolean = true>(
|
|
2640
|
+
parameters: {
|
|
2641
|
+
"X-Request-Id"?: string;
|
|
2642
|
+
"Idempotency-Key": string;
|
|
2643
|
+
project_id: Ulid;
|
|
2644
|
+
environment: "dev" | "prod";
|
|
2645
|
+
profile: "standard" | "performance";
|
|
2646
|
+
confirm: true;
|
|
2647
|
+
},
|
|
2648
|
+
options?: Options<never, ThrowOnError>,
|
|
2649
|
+
): RequestResult<
|
|
2650
|
+
ChangeDatabaseComputeResponses,
|
|
2651
|
+
ChangeDatabaseComputeErrors,
|
|
2652
|
+
ThrowOnError,
|
|
2653
|
+
"data"
|
|
2654
|
+
> => {
|
|
2655
|
+
const params = buildClientParams(
|
|
2656
|
+
[parameters],
|
|
2657
|
+
[
|
|
2658
|
+
{
|
|
2659
|
+
args: [
|
|
2660
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2661
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
2662
|
+
{ in: "path", key: "project_id" },
|
|
2663
|
+
{ in: "body", key: "environment" },
|
|
2664
|
+
{ in: "body", key: "profile" },
|
|
2665
|
+
{ in: "body", key: "confirm" },
|
|
2666
|
+
],
|
|
2667
|
+
},
|
|
2668
|
+
],
|
|
2669
|
+
);
|
|
2670
|
+
return (options?.client ?? client).post<
|
|
2671
|
+
ChangeDatabaseComputeResponses,
|
|
2672
|
+
ChangeDatabaseComputeErrors,
|
|
2673
|
+
ThrowOnError,
|
|
2674
|
+
"data"
|
|
2675
|
+
>({
|
|
2676
|
+
responseStyle: "data",
|
|
2677
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2678
|
+
url: "/v1/projects/{project_id}/database/compute",
|
|
2679
|
+
...options,
|
|
2680
|
+
...params,
|
|
2681
|
+
headers: {
|
|
2682
|
+
"Content-Type": "application/json",
|
|
2683
|
+
...options?.headers,
|
|
2684
|
+
...params.headers,
|
|
2685
|
+
},
|
|
2686
|
+
});
|
|
2687
|
+
};
|
|
2688
|
+
|
|
2689
|
+
/**
|
|
2690
|
+
* Execute one bounded database write in Dev or Prod
|
|
2691
|
+
*
|
|
2692
|
+
* Owner-authorized INSERT, UPDATE or DELETE through the restricted runtime role, including ordinary upsert. Environment is mandatory. One direct statement and transaction, five-second timeout and at most 1000 directly affected rows; customer triggers and cascades may affect more rows. Rows are not returned. The durable Idempotency-Key receipt persists until project deletion. Same-key retries observe the original execution attempt; unknown outcomes never automatically execute again. Inspect target data before deliberately choosing a new key. Schema changes use GitHub migrations. Database compute is metered normally and existing credit grace and Stop budgets apply. Application row-level security policies remain effective for writes.
|
|
2693
|
+
*/
|
|
2694
|
+
export const writeProjectDatabase = <ThrowOnError extends boolean = true>(
|
|
2695
|
+
parameters: {
|
|
2696
|
+
"X-Request-Id"?: string;
|
|
2697
|
+
"Idempotency-Key": string;
|
|
2698
|
+
project_id: Ulid;
|
|
2699
|
+
projectDatabaseWriteRequest: ProjectDatabaseWriteRequest;
|
|
2700
|
+
},
|
|
2701
|
+
options?: Options<never, ThrowOnError>,
|
|
2702
|
+
): RequestResult<
|
|
2703
|
+
WriteProjectDatabaseResponses,
|
|
2704
|
+
WriteProjectDatabaseErrors,
|
|
2705
|
+
ThrowOnError,
|
|
2706
|
+
"data"
|
|
2707
|
+
> => {
|
|
2708
|
+
const params = buildClientParams(
|
|
2709
|
+
[parameters],
|
|
2710
|
+
[
|
|
2711
|
+
{
|
|
2712
|
+
args: [
|
|
2713
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2714
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
2715
|
+
{ in: "path", key: "project_id" },
|
|
2716
|
+
{ key: "projectDatabaseWriteRequest", map: "body" },
|
|
2717
|
+
],
|
|
2718
|
+
},
|
|
2719
|
+
],
|
|
2720
|
+
);
|
|
2721
|
+
return (options?.client ?? client).post<
|
|
2722
|
+
WriteProjectDatabaseResponses,
|
|
2723
|
+
WriteProjectDatabaseErrors,
|
|
2724
|
+
ThrowOnError,
|
|
2725
|
+
"data"
|
|
2726
|
+
>({
|
|
2727
|
+
responseStyle: "data",
|
|
2728
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2729
|
+
url: "/v1/projects/{project_id}/database/write",
|
|
2730
|
+
...options,
|
|
2731
|
+
...params,
|
|
2732
|
+
headers: {
|
|
2733
|
+
"Content-Type": "application/json",
|
|
2734
|
+
...options?.headers,
|
|
2735
|
+
...params.headers,
|
|
2736
|
+
},
|
|
2737
|
+
});
|
|
2738
|
+
};
|
|
2739
|
+
|
|
2740
|
+
/**
|
|
2741
|
+
* Run one bounded read-only Dev or Prod database query
|
|
2742
|
+
*
|
|
2743
|
+
* Executes one SELECT through the project's least-privilege read-only role. Application row-level security policies apply and may filter rows; a complete SQL archive uses the separate authorized export workflow. Connection credentials are never returned.
|
|
2744
|
+
*/
|
|
2745
|
+
export const queryProjectDatabase = <ThrowOnError extends boolean = true>(
|
|
2746
|
+
parameters: {
|
|
2747
|
+
"X-Request-Id"?: string;
|
|
2748
|
+
project_id: Ulid;
|
|
2749
|
+
projectDatabaseQueryRequest: ProjectDatabaseQueryRequest;
|
|
2750
|
+
},
|
|
2751
|
+
options?: Options<never, ThrowOnError>,
|
|
2752
|
+
): RequestResult<
|
|
2753
|
+
QueryProjectDatabaseResponses,
|
|
2754
|
+
QueryProjectDatabaseErrors,
|
|
2755
|
+
ThrowOnError,
|
|
2756
|
+
"data"
|
|
2757
|
+
> => {
|
|
2758
|
+
const params = buildClientParams(
|
|
2759
|
+
[parameters],
|
|
2760
|
+
[
|
|
2761
|
+
{
|
|
2762
|
+
args: [
|
|
2763
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2764
|
+
{ in: "path", key: "project_id" },
|
|
2765
|
+
{ key: "projectDatabaseQueryRequest", map: "body" },
|
|
2766
|
+
],
|
|
2767
|
+
},
|
|
2768
|
+
],
|
|
2769
|
+
);
|
|
2770
|
+
return (options?.client ?? client).post<
|
|
2771
|
+
QueryProjectDatabaseResponses,
|
|
2772
|
+
QueryProjectDatabaseErrors,
|
|
2773
|
+
ThrowOnError,
|
|
2774
|
+
"data"
|
|
2775
|
+
>({
|
|
2776
|
+
responseStyle: "data",
|
|
2777
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2778
|
+
url: "/v1/projects/{project_id}/database/query",
|
|
2779
|
+
...options,
|
|
2780
|
+
...params,
|
|
2781
|
+
headers: {
|
|
2782
|
+
"Content-Type": "application/json",
|
|
2783
|
+
...options?.headers,
|
|
2784
|
+
...params.headers,
|
|
2785
|
+
},
|
|
2786
|
+
});
|
|
2787
|
+
};
|
|
2788
|
+
|
|
2789
|
+
/**
|
|
2790
|
+
* List the project's issued database credentials
|
|
2791
|
+
*
|
|
2792
|
+
* Returns at most the 50 newest credentials with their derived state (active, expired or revoked). Connection URIs and passwords are never returned again; only the credential metadata is readable.
|
|
2793
|
+
*/
|
|
2794
|
+
export const listProjectDatabaseAccess = <ThrowOnError extends boolean = true>(
|
|
2795
|
+
parameters: {
|
|
2796
|
+
"X-Request-Id"?: string;
|
|
2797
|
+
project_id: Ulid;
|
|
2798
|
+
environment?: "dev" | "prod";
|
|
2799
|
+
},
|
|
2800
|
+
options?: Options<never, ThrowOnError>,
|
|
2801
|
+
): RequestResult<
|
|
2802
|
+
ListProjectDatabaseAccessResponses,
|
|
2803
|
+
ListProjectDatabaseAccessErrors,
|
|
2804
|
+
ThrowOnError,
|
|
2805
|
+
"data"
|
|
2806
|
+
> => {
|
|
2807
|
+
const params = buildClientParams(
|
|
2808
|
+
[parameters],
|
|
2809
|
+
[
|
|
2810
|
+
{
|
|
2811
|
+
args: [
|
|
2812
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2813
|
+
{ in: "path", key: "project_id" },
|
|
2814
|
+
{ in: "query", key: "environment" },
|
|
2815
|
+
],
|
|
2816
|
+
},
|
|
2817
|
+
],
|
|
2818
|
+
);
|
|
2819
|
+
return (options?.client ?? client).get<
|
|
2820
|
+
ListProjectDatabaseAccessResponses,
|
|
2821
|
+
ListProjectDatabaseAccessErrors,
|
|
2822
|
+
ThrowOnError,
|
|
2823
|
+
"data"
|
|
2824
|
+
>({
|
|
2825
|
+
responseStyle: "data",
|
|
2826
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2827
|
+
url: "/v1/projects/{project_id}/database/access",
|
|
2828
|
+
...options,
|
|
2829
|
+
...params,
|
|
2830
|
+
});
|
|
2831
|
+
};
|
|
2832
|
+
|
|
2833
|
+
/**
|
|
2834
|
+
* Issue one time-bound PostgreSQL credential for Dev or Prod
|
|
2835
|
+
*
|
|
2836
|
+
* Owner-authorized direct PostgreSQL login for the project's own database, returned exactly once and never retrievable again. Mode read joins the read-only role, mode write joins the same restricted runtime role the application uses; neither can change schema, and application row-level security policies remain effective. The lifetime is 5 minutes to 24 hours (3600 seconds by default) and PostgreSQL refuses new logins after it; the platform ends remaining sessions within 15 minutes after expiry, at the latest. At most three active credentials exist per project environment. Database compute wakes and is metered normally, and existing credit grace and Stop budgets apply. Revoke the credential as soon as the work is finished and never store the connection URI in files, notes or source.
|
|
2837
|
+
*/
|
|
2838
|
+
export const createProjectDatabaseAccess = <ThrowOnError extends boolean = true>(
|
|
2839
|
+
parameters: {
|
|
2840
|
+
"X-Request-Id"?: string;
|
|
2841
|
+
project_id: Ulid;
|
|
2842
|
+
projectDatabaseAccessRequest: ProjectDatabaseAccessRequest;
|
|
2843
|
+
},
|
|
2844
|
+
options?: Options<never, ThrowOnError>,
|
|
2845
|
+
): RequestResult<
|
|
2846
|
+
CreateProjectDatabaseAccessResponses,
|
|
2847
|
+
CreateProjectDatabaseAccessErrors,
|
|
2848
|
+
ThrowOnError,
|
|
2849
|
+
"data"
|
|
2850
|
+
> => {
|
|
2851
|
+
const params = buildClientParams(
|
|
2852
|
+
[parameters],
|
|
2853
|
+
[
|
|
2854
|
+
{
|
|
2855
|
+
args: [
|
|
2856
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2857
|
+
{ in: "path", key: "project_id" },
|
|
2858
|
+
{ key: "projectDatabaseAccessRequest", map: "body" },
|
|
2859
|
+
],
|
|
2860
|
+
},
|
|
2861
|
+
],
|
|
2862
|
+
);
|
|
2863
|
+
return (options?.client ?? client).post<
|
|
2864
|
+
CreateProjectDatabaseAccessResponses,
|
|
2865
|
+
CreateProjectDatabaseAccessErrors,
|
|
2866
|
+
ThrowOnError,
|
|
2867
|
+
"data"
|
|
2868
|
+
>({
|
|
2869
|
+
responseStyle: "data",
|
|
2870
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2871
|
+
url: "/v1/projects/{project_id}/database/access",
|
|
2872
|
+
...options,
|
|
2873
|
+
...params,
|
|
2874
|
+
headers: {
|
|
2875
|
+
"Content-Type": "application/json",
|
|
2876
|
+
...options?.headers,
|
|
2877
|
+
...params.headers,
|
|
2878
|
+
},
|
|
2879
|
+
});
|
|
2880
|
+
};
|
|
2881
|
+
|
|
2882
|
+
/**
|
|
2883
|
+
* Revoke one issued database credential
|
|
2884
|
+
*
|
|
2885
|
+
* Ends the credential's open sessions and removes its PostgreSQL role. Revocation is idempotent for an already revoked credential and never affects the application's own roles or any data.
|
|
2886
|
+
*/
|
|
2887
|
+
export const revokeProjectDatabaseAccess = <ThrowOnError extends boolean = true>(
|
|
2888
|
+
parameters: {
|
|
2889
|
+
"X-Request-Id"?: string;
|
|
2890
|
+
project_id: Ulid;
|
|
2891
|
+
access_id: Ulid;
|
|
2892
|
+
},
|
|
2893
|
+
options?: Options<never, ThrowOnError>,
|
|
2894
|
+
): RequestResult<
|
|
2895
|
+
RevokeProjectDatabaseAccessResponses,
|
|
2896
|
+
RevokeProjectDatabaseAccessErrors,
|
|
2897
|
+
ThrowOnError,
|
|
2898
|
+
"data"
|
|
2899
|
+
> => {
|
|
2900
|
+
const params = buildClientParams(
|
|
2901
|
+
[parameters],
|
|
2902
|
+
[
|
|
2903
|
+
{
|
|
2904
|
+
args: [
|
|
2905
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2906
|
+
{ in: "path", key: "project_id" },
|
|
2907
|
+
{ in: "path", key: "access_id" },
|
|
2908
|
+
],
|
|
2909
|
+
},
|
|
2910
|
+
],
|
|
2911
|
+
);
|
|
2912
|
+
return (options?.client ?? client).delete<
|
|
2913
|
+
RevokeProjectDatabaseAccessResponses,
|
|
2914
|
+
RevokeProjectDatabaseAccessErrors,
|
|
2915
|
+
ThrowOnError,
|
|
2916
|
+
"data"
|
|
2917
|
+
>({
|
|
2918
|
+
responseStyle: "data",
|
|
2919
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2920
|
+
url: "/v1/projects/{project_id}/database/access/{access_id}",
|
|
2921
|
+
...options,
|
|
2922
|
+
...params,
|
|
2923
|
+
});
|
|
2924
|
+
};
|
|
2925
|
+
|
|
2926
|
+
/**
|
|
2927
|
+
* Plan a deployment rollback
|
|
2928
|
+
*
|
|
2929
|
+
* Produces a non-mutating rollback plan for an immutable deployment artifact.
|
|
2930
|
+
*/
|
|
2931
|
+
export const planDeploymentRollback = <ThrowOnError extends boolean = true>(
|
|
2932
|
+
parameters: {
|
|
2933
|
+
"X-Request-Id"?: string;
|
|
2934
|
+
project_id: Ulid;
|
|
2935
|
+
target_deployment_id: Ulid;
|
|
2936
|
+
},
|
|
2937
|
+
options?: Options<never, ThrowOnError>,
|
|
2938
|
+
): RequestResult<
|
|
2939
|
+
PlanDeploymentRollbackResponses,
|
|
2940
|
+
PlanDeploymentRollbackErrors,
|
|
2941
|
+
ThrowOnError,
|
|
2942
|
+
"data"
|
|
2943
|
+
> => {
|
|
2944
|
+
const params = buildClientParams(
|
|
2945
|
+
[parameters],
|
|
2946
|
+
[
|
|
2947
|
+
{
|
|
2948
|
+
args: [
|
|
2949
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2950
|
+
{ in: "path", key: "project_id" },
|
|
2951
|
+
{ in: "path", key: "target_deployment_id" },
|
|
2952
|
+
],
|
|
2953
|
+
},
|
|
2954
|
+
],
|
|
2955
|
+
);
|
|
2956
|
+
return (options?.client ?? client).post<
|
|
2957
|
+
PlanDeploymentRollbackResponses,
|
|
2958
|
+
PlanDeploymentRollbackErrors,
|
|
2959
|
+
ThrowOnError,
|
|
2960
|
+
"data"
|
|
2961
|
+
>({
|
|
2962
|
+
responseStyle: "data",
|
|
2963
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2964
|
+
url: "/v1/projects/{project_id}/deployments/{target_deployment_id}:rollback-plan",
|
|
2965
|
+
...options,
|
|
2966
|
+
...params,
|
|
2967
|
+
});
|
|
2968
|
+
};
|
|
2969
|
+
|
|
2970
|
+
/**
|
|
2971
|
+
* Roll back to an immutable deployment
|
|
2972
|
+
*
|
|
2973
|
+
* Republishes the target deployment artifact without starting a new build.
|
|
2974
|
+
*/
|
|
2975
|
+
export const rollbackDeployment = <ThrowOnError extends boolean = true>(
|
|
2976
|
+
parameters: {
|
|
2977
|
+
"X-Request-Id"?: string;
|
|
2978
|
+
"Idempotency-Key": string;
|
|
2979
|
+
"If-Match": string;
|
|
2980
|
+
"X-Confirmation-Token": ConfirmationToken;
|
|
2981
|
+
project_id: Ulid;
|
|
2982
|
+
target_deployment_id: Ulid;
|
|
2983
|
+
},
|
|
2984
|
+
options?: Options<never, ThrowOnError>,
|
|
2985
|
+
): RequestResult<RollbackDeploymentResponses, RollbackDeploymentErrors, ThrowOnError, "data"> => {
|
|
2986
|
+
const params = buildClientParams(
|
|
2987
|
+
[parameters],
|
|
2988
|
+
[
|
|
2989
|
+
{
|
|
2990
|
+
args: [
|
|
2991
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
2992
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
2993
|
+
{ in: "headers", key: "If-Match" },
|
|
2994
|
+
{ in: "headers", key: "X-Confirmation-Token" },
|
|
2995
|
+
{ in: "path", key: "project_id" },
|
|
2996
|
+
{ in: "path", key: "target_deployment_id" },
|
|
2997
|
+
],
|
|
2998
|
+
},
|
|
2999
|
+
],
|
|
3000
|
+
);
|
|
3001
|
+
return (options?.client ?? client).post<
|
|
3002
|
+
RollbackDeploymentResponses,
|
|
3003
|
+
RollbackDeploymentErrors,
|
|
3004
|
+
ThrowOnError,
|
|
3005
|
+
"data"
|
|
3006
|
+
>({
|
|
3007
|
+
responseStyle: "data",
|
|
3008
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3009
|
+
url: "/v1/projects/{project_id}/deployments/{target_deployment_id}:rollback",
|
|
3010
|
+
...options,
|
|
3011
|
+
...params,
|
|
3012
|
+
});
|
|
3013
|
+
};
|
|
3014
|
+
|
|
3015
|
+
/**
|
|
3016
|
+
* Plan promotion of the current dev deployment
|
|
3017
|
+
*
|
|
3018
|
+
* Produces a non-mutating, ten-minute plan that binds the current succeeded dev deployment and current prod head without rebuilding the artifact.
|
|
3019
|
+
*/
|
|
3020
|
+
export const planDeploymentPromotion = <ThrowOnError extends boolean = true>(
|
|
3021
|
+
parameters: {
|
|
3022
|
+
"X-Request-Id"?: string;
|
|
3023
|
+
project_id: Ulid;
|
|
3024
|
+
source_deployment_id: Ulid;
|
|
3025
|
+
},
|
|
3026
|
+
options?: Options<never, ThrowOnError>,
|
|
3027
|
+
): RequestResult<
|
|
3028
|
+
PlanDeploymentPromotionResponses,
|
|
3029
|
+
PlanDeploymentPromotionErrors,
|
|
3030
|
+
ThrowOnError,
|
|
3031
|
+
"data"
|
|
3032
|
+
> => {
|
|
3033
|
+
const params = buildClientParams(
|
|
3034
|
+
[parameters],
|
|
3035
|
+
[
|
|
3036
|
+
{
|
|
3037
|
+
args: [
|
|
3038
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3039
|
+
{ in: "path", key: "project_id" },
|
|
3040
|
+
{ in: "path", key: "source_deployment_id" },
|
|
3041
|
+
],
|
|
3042
|
+
},
|
|
3043
|
+
],
|
|
3044
|
+
);
|
|
3045
|
+
return (options?.client ?? client).post<
|
|
3046
|
+
PlanDeploymentPromotionResponses,
|
|
3047
|
+
PlanDeploymentPromotionErrors,
|
|
3048
|
+
ThrowOnError,
|
|
3049
|
+
"data"
|
|
3050
|
+
>({
|
|
3051
|
+
responseStyle: "data",
|
|
3052
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3053
|
+
url: "/v1/projects/{project_id}/deployments/{source_deployment_id}:promote-plan",
|
|
3054
|
+
...options,
|
|
3055
|
+
...params,
|
|
3056
|
+
});
|
|
3057
|
+
};
|
|
3058
|
+
|
|
3059
|
+
/**
|
|
3060
|
+
* Promote a verified dev artifact to prod
|
|
3061
|
+
*
|
|
3062
|
+
* Activates the immutable artifact from the current succeeded dev deployment in prod without rebuilding it.
|
|
3063
|
+
*/
|
|
3064
|
+
export const promoteDeployment = <ThrowOnError extends boolean = true>(
|
|
3065
|
+
parameters: {
|
|
3066
|
+
"X-Request-Id"?: string;
|
|
3067
|
+
"Idempotency-Key": string;
|
|
3068
|
+
"If-Match": string;
|
|
3069
|
+
"X-Confirmation-Token": ConfirmationToken;
|
|
3070
|
+
project_id: Ulid;
|
|
3071
|
+
source_deployment_id: Ulid;
|
|
3072
|
+
},
|
|
3073
|
+
options?: Options<never, ThrowOnError>,
|
|
3074
|
+
): RequestResult<PromoteDeploymentResponses, PromoteDeploymentErrors, ThrowOnError, "data"> => {
|
|
3075
|
+
const params = buildClientParams(
|
|
3076
|
+
[parameters],
|
|
3077
|
+
[
|
|
3078
|
+
{
|
|
3079
|
+
args: [
|
|
3080
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3081
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
3082
|
+
{ in: "headers", key: "If-Match" },
|
|
3083
|
+
{ in: "headers", key: "X-Confirmation-Token" },
|
|
3084
|
+
{ in: "path", key: "project_id" },
|
|
3085
|
+
{ in: "path", key: "source_deployment_id" },
|
|
3086
|
+
],
|
|
3087
|
+
},
|
|
3088
|
+
],
|
|
3089
|
+
);
|
|
3090
|
+
return (options?.client ?? client).post<
|
|
3091
|
+
PromoteDeploymentResponses,
|
|
3092
|
+
PromoteDeploymentErrors,
|
|
3093
|
+
ThrowOnError,
|
|
3094
|
+
"data"
|
|
3095
|
+
>({
|
|
3096
|
+
responseStyle: "data",
|
|
3097
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3098
|
+
url: "/v1/projects/{project_id}/deployments/{source_deployment_id}:promote",
|
|
3099
|
+
...options,
|
|
3100
|
+
...params,
|
|
3101
|
+
});
|
|
3102
|
+
};
|
|
3103
|
+
|
|
3104
|
+
/**
|
|
3105
|
+
* List environment secret metadata
|
|
3106
|
+
*
|
|
3107
|
+
* Returns names and revisions only. Secret values are never readable through the public API.
|
|
3108
|
+
*/
|
|
3109
|
+
export const listEnvironmentSecrets = <ThrowOnError extends boolean = true>(
|
|
3110
|
+
parameters: {
|
|
3111
|
+
"X-Request-Id"?: string;
|
|
3112
|
+
project_id: Ulid;
|
|
3113
|
+
environment_id: Ulid;
|
|
3114
|
+
},
|
|
3115
|
+
options?: Options<never, ThrowOnError>,
|
|
3116
|
+
): RequestResult<
|
|
3117
|
+
ListEnvironmentSecretsResponses,
|
|
3118
|
+
ListEnvironmentSecretsErrors,
|
|
3119
|
+
ThrowOnError,
|
|
3120
|
+
"data"
|
|
3121
|
+
> => {
|
|
3122
|
+
const params = buildClientParams(
|
|
3123
|
+
[parameters],
|
|
3124
|
+
[
|
|
3125
|
+
{
|
|
3126
|
+
args: [
|
|
3127
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3128
|
+
{ in: "path", key: "project_id" },
|
|
3129
|
+
{ in: "path", key: "environment_id" },
|
|
3130
|
+
],
|
|
3131
|
+
},
|
|
3132
|
+
],
|
|
3133
|
+
);
|
|
3134
|
+
return (options?.client ?? client).get<
|
|
3135
|
+
ListEnvironmentSecretsResponses,
|
|
3136
|
+
ListEnvironmentSecretsErrors,
|
|
3137
|
+
ThrowOnError,
|
|
3138
|
+
"data"
|
|
3139
|
+
>({
|
|
3140
|
+
responseStyle: "data",
|
|
3141
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3142
|
+
url: "/v1/projects/{project_id}/environments/{environment_id}/secrets",
|
|
3143
|
+
...options,
|
|
3144
|
+
...params,
|
|
3145
|
+
});
|
|
3146
|
+
};
|
|
3147
|
+
|
|
3148
|
+
/**
|
|
3149
|
+
* List the newest scheduled function runs of an environment
|
|
3150
|
+
*
|
|
3151
|
+
* Every declared cron produces one run per due UTC minute; the newest runs come first. A run reports its state, attempt, the status the scheduled handler returned and its timing. Values never include request or response bodies.
|
|
3152
|
+
*/
|
|
3153
|
+
export const listFunctionRuns = <ThrowOnError extends boolean = true>(
|
|
3154
|
+
parameters: {
|
|
3155
|
+
"X-Request-Id"?: string;
|
|
3156
|
+
project_id: Ulid;
|
|
3157
|
+
environment_id: Ulid;
|
|
3158
|
+
limit?: number;
|
|
3159
|
+
},
|
|
3160
|
+
options?: Options<never, ThrowOnError>,
|
|
3161
|
+
): RequestResult<ListFunctionRunsResponses, ListFunctionRunsErrors, ThrowOnError, "data"> => {
|
|
3162
|
+
const params = buildClientParams(
|
|
3163
|
+
[parameters],
|
|
3164
|
+
[
|
|
3165
|
+
{
|
|
3166
|
+
args: [
|
|
3167
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3168
|
+
{ in: "path", key: "project_id" },
|
|
3169
|
+
{ in: "path", key: "environment_id" },
|
|
3170
|
+
{ in: "query", key: "limit" },
|
|
3171
|
+
],
|
|
3172
|
+
},
|
|
3173
|
+
],
|
|
3174
|
+
);
|
|
3175
|
+
return (options?.client ?? client).get<
|
|
3176
|
+
ListFunctionRunsResponses,
|
|
3177
|
+
ListFunctionRunsErrors,
|
|
3178
|
+
ThrowOnError,
|
|
3179
|
+
"data"
|
|
3180
|
+
>({
|
|
3181
|
+
responseStyle: "data",
|
|
3182
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3183
|
+
url: "/v1/projects/{project_id}/environments/{environment_id}/function-runs",
|
|
3184
|
+
...options,
|
|
3185
|
+
...params,
|
|
3186
|
+
});
|
|
3187
|
+
};
|
|
3188
|
+
|
|
3189
|
+
/**
|
|
3190
|
+
* Delete an environment secret
|
|
3191
|
+
*/
|
|
3192
|
+
export const deleteEnvironmentSecret = <ThrowOnError extends boolean = true>(
|
|
3193
|
+
parameters: {
|
|
3194
|
+
"X-Request-Id"?: string;
|
|
3195
|
+
"Idempotency-Key": string;
|
|
3196
|
+
project_id: Ulid;
|
|
3197
|
+
environment_id: Ulid;
|
|
3198
|
+
secret_name: string;
|
|
3199
|
+
},
|
|
3200
|
+
options?: Options<never, ThrowOnError>,
|
|
3201
|
+
): RequestResult<
|
|
3202
|
+
DeleteEnvironmentSecretResponses,
|
|
3203
|
+
DeleteEnvironmentSecretErrors,
|
|
3204
|
+
ThrowOnError,
|
|
3205
|
+
"data"
|
|
3206
|
+
> => {
|
|
3207
|
+
const params = buildClientParams(
|
|
3208
|
+
[parameters],
|
|
3209
|
+
[
|
|
3210
|
+
{
|
|
3211
|
+
args: [
|
|
3212
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3213
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
3214
|
+
{ in: "path", key: "project_id" },
|
|
3215
|
+
{ in: "path", key: "environment_id" },
|
|
3216
|
+
{ in: "path", key: "secret_name" },
|
|
3217
|
+
],
|
|
3218
|
+
},
|
|
3219
|
+
],
|
|
3220
|
+
);
|
|
3221
|
+
return (options?.client ?? client).delete<
|
|
3222
|
+
DeleteEnvironmentSecretResponses,
|
|
3223
|
+
DeleteEnvironmentSecretErrors,
|
|
3224
|
+
ThrowOnError,
|
|
3225
|
+
"data"
|
|
3226
|
+
>({
|
|
3227
|
+
responseStyle: "data",
|
|
3228
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3229
|
+
url: "/v1/projects/{project_id}/environments/{environment_id}/secrets/{secret_name}",
|
|
3230
|
+
...options,
|
|
3231
|
+
...params,
|
|
3232
|
+
});
|
|
3233
|
+
};
|
|
3234
|
+
|
|
3235
|
+
/**
|
|
3236
|
+
* Create or rotate an environment secret
|
|
3237
|
+
*
|
|
3238
|
+
* Accepts a write-only value and returns metadata only. Replays require the same canonical value digest.
|
|
3239
|
+
*/
|
|
3240
|
+
export const putEnvironmentSecret = <ThrowOnError extends boolean = true>(
|
|
3241
|
+
parameters: {
|
|
3242
|
+
"X-Request-Id"?: string;
|
|
3243
|
+
"Idempotency-Key": string;
|
|
3244
|
+
project_id: Ulid;
|
|
3245
|
+
environment_id: Ulid;
|
|
3246
|
+
secret_name: string;
|
|
3247
|
+
putEnvironmentSecretRequest: PutEnvironmentSecretRequest;
|
|
3248
|
+
},
|
|
3249
|
+
options?: Options<never, ThrowOnError>,
|
|
3250
|
+
): RequestResult<
|
|
3251
|
+
PutEnvironmentSecretResponses,
|
|
3252
|
+
PutEnvironmentSecretErrors,
|
|
3253
|
+
ThrowOnError,
|
|
3254
|
+
"data"
|
|
3255
|
+
> => {
|
|
3256
|
+
const params = buildClientParams(
|
|
3257
|
+
[parameters],
|
|
3258
|
+
[
|
|
3259
|
+
{
|
|
3260
|
+
args: [
|
|
3261
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3262
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
3263
|
+
{ in: "path", key: "project_id" },
|
|
3264
|
+
{ in: "path", key: "environment_id" },
|
|
3265
|
+
{ in: "path", key: "secret_name" },
|
|
3266
|
+
{ key: "putEnvironmentSecretRequest", map: "body" },
|
|
3267
|
+
],
|
|
3268
|
+
},
|
|
3269
|
+
],
|
|
3270
|
+
);
|
|
3271
|
+
return (options?.client ?? client).put<
|
|
3272
|
+
PutEnvironmentSecretResponses,
|
|
3273
|
+
PutEnvironmentSecretErrors,
|
|
3274
|
+
ThrowOnError,
|
|
3275
|
+
"data"
|
|
3276
|
+
>({
|
|
3277
|
+
responseStyle: "data",
|
|
3278
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3279
|
+
url: "/v1/projects/{project_id}/environments/{environment_id}/secrets/{secret_name}",
|
|
3280
|
+
...options,
|
|
3281
|
+
...params,
|
|
3282
|
+
headers: {
|
|
3283
|
+
"Content-Type": "application/json",
|
|
3284
|
+
...options?.headers,
|
|
3285
|
+
...params.headers,
|
|
3286
|
+
},
|
|
3287
|
+
});
|
|
3288
|
+
};
|
|
3289
|
+
|
|
3290
|
+
/**
|
|
3291
|
+
* Get an operation
|
|
3292
|
+
*/
|
|
3293
|
+
export const getOperation = <ThrowOnError extends boolean = true>(
|
|
3294
|
+
parameters: {
|
|
3295
|
+
"X-Request-Id"?: string;
|
|
3296
|
+
operation_id: Ulid;
|
|
3297
|
+
},
|
|
3298
|
+
options?: Options<never, ThrowOnError>,
|
|
3299
|
+
): RequestResult<GetOperationResponses, GetOperationErrors, ThrowOnError, "data"> => {
|
|
3300
|
+
const params = buildClientParams(
|
|
3301
|
+
[parameters],
|
|
3302
|
+
[
|
|
3303
|
+
{
|
|
3304
|
+
args: [
|
|
3305
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3306
|
+
{ in: "path", key: "operation_id" },
|
|
3307
|
+
],
|
|
3308
|
+
},
|
|
3309
|
+
],
|
|
3310
|
+
);
|
|
3311
|
+
return (options?.client ?? client).get<
|
|
3312
|
+
GetOperationResponses,
|
|
3313
|
+
GetOperationErrors,
|
|
3314
|
+
ThrowOnError,
|
|
3315
|
+
"data"
|
|
3316
|
+
>({
|
|
3317
|
+
responseStyle: "data",
|
|
3318
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3319
|
+
url: "/v1/operations/{operation_id}",
|
|
3320
|
+
...options,
|
|
3321
|
+
...params,
|
|
3322
|
+
});
|
|
3323
|
+
};
|
|
3324
|
+
|
|
3325
|
+
/**
|
|
3326
|
+
* Reconcile an uncertain platform delivery or provider mutation
|
|
3327
|
+
*
|
|
3328
|
+
* Owner-only, idempotent recovery for an operation retained after an uncertain platform delivery or provider mutation. The control plane derives the exact recovery decision, including any deterministic internal Workflow handoff; the request has no body. Exhausted lifecycle recovery returns reconciliation_exhausted (409, retryable false); stop retries and report the original operation through feedback.
|
|
3329
|
+
*/
|
|
3330
|
+
export const reconcileOperation = <ThrowOnError extends boolean = true>(
|
|
3331
|
+
parameters: {
|
|
3332
|
+
"X-Request-Id"?: string;
|
|
3333
|
+
"Idempotency-Key": string;
|
|
3334
|
+
operation_id: Ulid;
|
|
3335
|
+
},
|
|
3336
|
+
options?: Options<never, ThrowOnError>,
|
|
3337
|
+
): RequestResult<ReconcileOperationResponses, ReconcileOperationErrors, ThrowOnError, "data"> => {
|
|
3338
|
+
const params = buildClientParams(
|
|
3339
|
+
[parameters],
|
|
3340
|
+
[
|
|
3341
|
+
{
|
|
3342
|
+
args: [
|
|
3343
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3344
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
3345
|
+
{ in: "path", key: "operation_id" },
|
|
3346
|
+
],
|
|
3347
|
+
},
|
|
3348
|
+
],
|
|
3349
|
+
);
|
|
3350
|
+
return (options?.client ?? client).post<
|
|
3351
|
+
ReconcileOperationResponses,
|
|
3352
|
+
ReconcileOperationErrors,
|
|
3353
|
+
ThrowOnError,
|
|
3354
|
+
"data"
|
|
3355
|
+
>({
|
|
3356
|
+
responseStyle: "data",
|
|
3357
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3358
|
+
url: "/v1/operations/{operation_id}:reconcile",
|
|
3359
|
+
...options,
|
|
3360
|
+
...params,
|
|
3361
|
+
});
|
|
3362
|
+
};
|
|
3363
|
+
|
|
3364
|
+
/**
|
|
3365
|
+
* Stream operation events
|
|
3366
|
+
*/
|
|
3367
|
+
export const streamOperationEvents = <ThrowOnError extends boolean = true>(
|
|
3368
|
+
parameters: {
|
|
3369
|
+
"X-Request-Id"?: string;
|
|
3370
|
+
operation_id: Ulid;
|
|
3371
|
+
},
|
|
3372
|
+
options?: Options<never, ThrowOnError, StreamOperationEventsResponse>,
|
|
3373
|
+
): Promise<ServerSentEventsResult<StreamOperationEventsResponses>> => {
|
|
3374
|
+
const params = buildClientParams(
|
|
3375
|
+
[parameters],
|
|
3376
|
+
[
|
|
3377
|
+
{
|
|
3378
|
+
args: [
|
|
3379
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3380
|
+
{ in: "path", key: "operation_id" },
|
|
3381
|
+
],
|
|
3382
|
+
},
|
|
3383
|
+
],
|
|
3384
|
+
);
|
|
3385
|
+
return (options?.client ?? client).sse.get<
|
|
3386
|
+
StreamOperationEventsResponses,
|
|
3387
|
+
StreamOperationEventsErrors,
|
|
3388
|
+
ThrowOnError,
|
|
3389
|
+
"data"
|
|
3390
|
+
>({
|
|
3391
|
+
responseStyle: "data",
|
|
3392
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3393
|
+
url: "/v1/operations/{operation_id}/events",
|
|
3394
|
+
...options,
|
|
3395
|
+
...params,
|
|
3396
|
+
});
|
|
3397
|
+
};
|
|
3398
|
+
|
|
3399
|
+
/**
|
|
3400
|
+
* List audit events
|
|
3401
|
+
*
|
|
3402
|
+
* Returns events visible to the authenticated organization in stable descending order.
|
|
3403
|
+
*/
|
|
3404
|
+
export const listAuditEvents = <ThrowOnError extends boolean = true>(
|
|
3405
|
+
parameters?: {
|
|
3406
|
+
"X-Request-Id"?: string;
|
|
3407
|
+
project_id?: Ulid;
|
|
3408
|
+
operation_id?: Ulid;
|
|
3409
|
+
cursor?: string;
|
|
3410
|
+
limit?: number;
|
|
3411
|
+
},
|
|
3412
|
+
options?: Options<never, ThrowOnError>,
|
|
3413
|
+
): RequestResult<ListAuditEventsResponses, ListAuditEventsErrors, ThrowOnError, "data"> => {
|
|
3414
|
+
const params = buildClientParams(
|
|
3415
|
+
[parameters],
|
|
3416
|
+
[
|
|
3417
|
+
{
|
|
3418
|
+
args: [
|
|
3419
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3420
|
+
{ in: "query", key: "project_id" },
|
|
3421
|
+
{ in: "query", key: "operation_id" },
|
|
3422
|
+
{ in: "query", key: "cursor" },
|
|
3423
|
+
{ in: "query", key: "limit" },
|
|
3424
|
+
],
|
|
3425
|
+
},
|
|
3426
|
+
],
|
|
3427
|
+
);
|
|
3428
|
+
return (options?.client ?? client).get<
|
|
3429
|
+
ListAuditEventsResponses,
|
|
3430
|
+
ListAuditEventsErrors,
|
|
3431
|
+
ThrowOnError,
|
|
3432
|
+
"data"
|
|
3433
|
+
>({
|
|
3434
|
+
responseStyle: "data",
|
|
3435
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3436
|
+
url: "/v1/audit-events",
|
|
3437
|
+
...options,
|
|
3438
|
+
...params,
|
|
3439
|
+
});
|
|
3440
|
+
};
|