@amerged/ohmyhost-cli 0.1.56 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-HNFWXGDN.js → chunk-GODV5QDC.js} +579 -76
- package/dist/index.js +7 -1
- package/package.json +1 -1
- package/src/apps/product-cli/package.json +1 -1
- package/src/apps/product-cli/src/cli.ts +150 -11
- package/src/apps/product-cli/src/command.ts +185 -4
- package/src/apps/product-cli/src/product-api.ts +126 -3
- package/src/apps/product-cli/src/repository-init.ts +8 -0
- package/src/apps/product-cli/src/runtime-contract.ts +43 -5
- package/src/apps/product-cli/src/user-token-file.ts +73 -0
- package/src/packages/contracts/src/credit-pricing.ts +1 -1
- package/src/packages/contracts/src/database-events.ts +67 -0
- package/src/packages/contracts/src/framework-admission.ts +5 -4
- package/src/packages/contracts/src/framework-source-rules.ts +9 -2
- package/src/packages/contracts/src/index.ts +9 -0
- package/src/packages/contracts/src/operation-deployment-result.ts +121 -1
- package/src/packages/contracts/src/operation-failure.ts +72 -1
- package/src/packages/contracts/src/problem-policy.ts +13 -1
- package/src/packages/contracts/src/secret-names.ts +3 -2
- package/src/packages/sdk-ts/package.json +1 -1
- package/src/packages/sdk-ts/src/generated/index.ts +30 -0
- package/src/packages/sdk-ts/src/generated/sdk.gen.ts +216 -2
- package/src/packages/sdk-ts/src/generated/types.gen.ts +370 -1
|
@@ -96,6 +96,34 @@ const deploymentProgressActions = {
|
|
|
96
96
|
"Mail readiness could not be observed. Read 'ohmyhost mail status --project PROJECT --environment PROD_ENVIRONMENT_ULID --json' (MCP mail_status) with the Prod environment ID from 'ohmyhost project status', and report a persistent error; keep this operation.",
|
|
97
97
|
} as const;
|
|
98
98
|
export type DeploymentProgressPhase = keyof typeof deploymentProgressActions;
|
|
99
|
+
export interface DeploymentMailProgress {
|
|
100
|
+
readonly domain: string;
|
|
101
|
+
readonly status:
|
|
102
|
+
| "configured"
|
|
103
|
+
| "delegation_required"
|
|
104
|
+
| "ready"
|
|
105
|
+
| "verification_pending"
|
|
106
|
+
| "verification_failed";
|
|
107
|
+
readonly configured_at: string;
|
|
108
|
+
readonly observed_at?: string;
|
|
109
|
+
readonly verification_issue?:
|
|
110
|
+
| "identity_missing"
|
|
111
|
+
| "identity_verification_failed"
|
|
112
|
+
| "dkim_verification_failed"
|
|
113
|
+
| "dkim_records_changed"
|
|
114
|
+
| "tenant_association_missing"
|
|
115
|
+
| null;
|
|
116
|
+
readonly next_check_after_seconds?: 60 | 3600 | null;
|
|
117
|
+
readonly sending?: "disabled" | "pending" | "ready" | "failed";
|
|
118
|
+
readonly receiving?: "disabled" | "pending" | "ready" | "failed";
|
|
119
|
+
readonly dns_records: {
|
|
120
|
+
readonly type: "MX" | "TXT" | "CNAME";
|
|
121
|
+
readonly name: string;
|
|
122
|
+
readonly value: string;
|
|
123
|
+
readonly status: string;
|
|
124
|
+
readonly priority?: number;
|
|
125
|
+
}[];
|
|
126
|
+
}
|
|
99
127
|
export interface OperationDeploymentProgress {
|
|
100
128
|
readonly build_completed_at?: string;
|
|
101
129
|
readonly phase: DeploymentProgressPhase;
|
|
@@ -104,6 +132,7 @@ export interface OperationDeploymentProgress {
|
|
|
104
132
|
readonly observed_at: string;
|
|
105
133
|
readonly next_poll_after_seconds: 60;
|
|
106
134
|
readonly suggested_action: string;
|
|
135
|
+
readonly mail?: DeploymentMailProgress;
|
|
107
136
|
}
|
|
108
137
|
export function createOperationDeploymentProgress(input: {
|
|
109
138
|
build_completed_at?: string;
|
|
@@ -111,6 +140,7 @@ export function createOperationDeploymentProgress(input: {
|
|
|
111
140
|
project_id: string;
|
|
112
141
|
deployment_id: string;
|
|
113
142
|
observed_at: string;
|
|
143
|
+
mail?: DeploymentMailProgress;
|
|
114
144
|
}): OperationDeploymentProgress {
|
|
115
145
|
const project = ulid(input.project_id);
|
|
116
146
|
ulid(input.deployment_id);
|
|
@@ -126,6 +156,8 @@ export function createOperationDeploymentProgress(input: {
|
|
|
126
156
|
new Date(input.build_completed_at).toISOString() !== input.build_completed_at)
|
|
127
157
|
)
|
|
128
158
|
invalid();
|
|
159
|
+
const mail = input.mail === undefined ? undefined : parseDeploymentMailProgress(input.mail);
|
|
160
|
+
if (mail !== undefined && input.phase !== "waiting_for_mail") invalid();
|
|
129
161
|
return Object.freeze({
|
|
130
162
|
...(input.build_completed_at === undefined
|
|
131
163
|
? {}
|
|
@@ -135,8 +167,93 @@ export function createOperationDeploymentProgress(input: {
|
|
|
135
167
|
deployment_id: input.deployment_id,
|
|
136
168
|
observed_at: input.observed_at,
|
|
137
169
|
next_poll_after_seconds: 60 as const,
|
|
138
|
-
suggested_action:
|
|
170
|
+
suggested_action:
|
|
171
|
+
mail === undefined || mail.dns_records.length === 0
|
|
172
|
+
? deploymentProgressActions[input.phase].replace("PROJECT", project)
|
|
173
|
+
: "Follow the mail readiness and DNS records shown here, then poll this same operation. Do not rebuild or repeat correct DNS changes.",
|
|
174
|
+
...(mail === undefined ? {} : { mail }),
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function parseDeploymentMailProgress(value: unknown): DeploymentMailProgress {
|
|
178
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) invalid();
|
|
179
|
+
const raw = value as Record<string, unknown>;
|
|
180
|
+
const keys = ["domain", "status", "configured_at", "dns_records"];
|
|
181
|
+
for (const optional of [
|
|
182
|
+
"observed_at",
|
|
183
|
+
"verification_issue",
|
|
184
|
+
"next_check_after_seconds",
|
|
185
|
+
"sending",
|
|
186
|
+
"receiving",
|
|
187
|
+
])
|
|
188
|
+
if (raw[optional] !== undefined) keys.push(optional);
|
|
189
|
+
const row = exactRecord(raw, keys),
|
|
190
|
+
time = (v: unknown) =>
|
|
191
|
+
typeof v === "string" && Number.isFinite(Date.parse(v)) && new Date(v).toISOString() === v,
|
|
192
|
+
state = ["disabled", "pending", "ready", "failed"];
|
|
193
|
+
if (
|
|
194
|
+
typeof row["domain"] !== "string" ||
|
|
195
|
+
row["domain"].length > 253 ||
|
|
196
|
+
!/^[a-z0-9.-]+$/u.test(row["domain"]) ||
|
|
197
|
+
![
|
|
198
|
+
"configured",
|
|
199
|
+
"delegation_required",
|
|
200
|
+
"ready",
|
|
201
|
+
"verification_pending",
|
|
202
|
+
"verification_failed",
|
|
203
|
+
].includes(String(row["status"])) ||
|
|
204
|
+
!time(row["configured_at"]) ||
|
|
205
|
+
(row["observed_at"] !== undefined && !time(row["observed_at"])) ||
|
|
206
|
+
(row["verification_issue"] !== undefined &&
|
|
207
|
+
row["verification_issue"] !== null &&
|
|
208
|
+
![
|
|
209
|
+
"identity_missing",
|
|
210
|
+
"identity_verification_failed",
|
|
211
|
+
"dkim_verification_failed",
|
|
212
|
+
"dkim_records_changed",
|
|
213
|
+
"tenant_association_missing",
|
|
214
|
+
].includes(String(row["verification_issue"]))) ||
|
|
215
|
+
(row["next_check_after_seconds"] !== undefined &&
|
|
216
|
+
![60, 3600, null].includes(row["next_check_after_seconds"] as 60 | 3600 | null)) ||
|
|
217
|
+
(row["sending"] !== undefined && !state.includes(String(row["sending"]))) ||
|
|
218
|
+
(row["receiving"] !== undefined && !state.includes(String(row["receiving"]))) ||
|
|
219
|
+
!Array.isArray(row["dns_records"]) ||
|
|
220
|
+
row["dns_records"].length > 16
|
|
221
|
+
)
|
|
222
|
+
invalid();
|
|
223
|
+
const records = row["dns_records"].map((value: unknown) => {
|
|
224
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) invalid();
|
|
225
|
+
const item = value as Record<string, unknown>;
|
|
226
|
+
const record = exactRecord(
|
|
227
|
+
item,
|
|
228
|
+
item["priority"] === undefined
|
|
229
|
+
? ["type", "name", "value", "status"]
|
|
230
|
+
: ["type", "name", "value", "status", "priority"],
|
|
231
|
+
);
|
|
232
|
+
if (
|
|
233
|
+
!["MX", "TXT", "CNAME"].includes(String(record["type"])) ||
|
|
234
|
+
typeof record["name"] !== "string" ||
|
|
235
|
+
record["name"].length === 0 ||
|
|
236
|
+
record["name"].length > 253 ||
|
|
237
|
+
/[\r\n\0]/u.test(record["name"]) ||
|
|
238
|
+
!(record["name"] === row["domain"] || record["name"].endsWith(`.${row["domain"]}`)) ||
|
|
239
|
+
typeof record["value"] !== "string" ||
|
|
240
|
+
record["value"].length === 0 ||
|
|
241
|
+
record["value"].length > 4096 ||
|
|
242
|
+
/[\r\n\0]/u.test(record["value"]) ||
|
|
243
|
+
typeof record["status"] !== "string" ||
|
|
244
|
+
record["status"].length === 0 ||
|
|
245
|
+
record["status"].length > 32 ||
|
|
246
|
+
/[\r\n\0]/u.test(record["status"]) ||
|
|
247
|
+
(record["type"] === "MX" &&
|
|
248
|
+
(!Number.isSafeInteger(record["priority"]) ||
|
|
249
|
+
Number(record["priority"]) < 0 ||
|
|
250
|
+
Number(record["priority"]) > 65535)) ||
|
|
251
|
+
(record["type"] !== "MX" && record["priority"] !== undefined)
|
|
252
|
+
)
|
|
253
|
+
invalid();
|
|
254
|
+
return Object.freeze({ ...record }) as DeploymentMailProgress["dns_records"][number];
|
|
139
255
|
});
|
|
256
|
+
return Object.freeze({ ...row, dns_records: records }) as unknown as DeploymentMailProgress;
|
|
140
257
|
}
|
|
141
258
|
export function parseOperationDeploymentProgress(value: unknown): OperationDeploymentProgress {
|
|
142
259
|
const keys = [
|
|
@@ -149,6 +266,8 @@ export function parseOperationDeploymentProgress(value: unknown): OperationDeplo
|
|
|
149
266
|
];
|
|
150
267
|
if (typeof value === "object" && value !== null && Object.hasOwn(value, "build_completed_at"))
|
|
151
268
|
keys.push("build_completed_at");
|
|
269
|
+
if (typeof value === "object" && value !== null && Object.hasOwn(value, "mail"))
|
|
270
|
+
keys.push("mail");
|
|
152
271
|
const row = exactRecord(value, keys);
|
|
153
272
|
const parsed = createOperationDeploymentProgress({
|
|
154
273
|
...(row["build_completed_at"] === undefined
|
|
@@ -158,6 +277,7 @@ export function parseOperationDeploymentProgress(value: unknown): OperationDeplo
|
|
|
158
277
|
project_id: row["project_id"] as string,
|
|
159
278
|
deployment_id: row["deployment_id"] as string,
|
|
160
279
|
observed_at: row["observed_at"] as string,
|
|
280
|
+
...(row["mail"] === undefined ? {} : { mail: parseDeploymentMailProgress(row["mail"]) }),
|
|
161
281
|
});
|
|
162
282
|
if (row["next_poll_after_seconds"] !== 60 || row["suggested_action"] !== parsed.suggested_action)
|
|
163
283
|
invalid();
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
frameworkConversionDetail,
|
|
3
|
+
parseFrameworkConversionDiagnostic,
|
|
4
|
+
type FrameworkConversionDiagnostic,
|
|
5
|
+
} from "./framework-admission.js";
|
|
2
6
|
|
|
3
7
|
const failures = {
|
|
4
8
|
authorization_changed: [
|
|
@@ -147,6 +151,70 @@ export interface PublicOperationFailure {
|
|
|
147
151
|
readonly suggested_action: string;
|
|
148
152
|
/** The catalog sentence naming the refused file and its fix, only for an auto-deploy rejection. */
|
|
149
153
|
readonly detail?: string;
|
|
154
|
+
readonly migration?: MigrationFailureDiagnostic;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface MigrationFailureDiagnostic {
|
|
158
|
+
readonly reason: "catalog_changed" | "execution_failed" | "ledger_conflict" | "not_admitted";
|
|
159
|
+
readonly file: string | null;
|
|
160
|
+
readonly statement_index?: number;
|
|
161
|
+
readonly sqlstate?: string;
|
|
162
|
+
}
|
|
163
|
+
export type OperationFailureDiagnostic = FrameworkConversionDiagnostic | MigrationFailureDiagnostic;
|
|
164
|
+
|
|
165
|
+
/** Each diagnostic variant validates its exact closed shape before crossing a read boundary. */
|
|
166
|
+
export function parseOperationFailureDiagnostic(value: unknown): OperationFailureDiagnostic | null {
|
|
167
|
+
return parseFrameworkConversionDiagnostic(value) ?? parseMigrationFailureDiagnostic(value);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Closed metadata only: PostgreSQL messages, SQL and parameters are never public diagnostics. */
|
|
171
|
+
export function parseMigrationFailureDiagnostic(value: unknown): MigrationFailureDiagnostic | null {
|
|
172
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
|
|
173
|
+
const r = value as Record<string, unknown>;
|
|
174
|
+
if (
|
|
175
|
+
Object.keys(r).some(
|
|
176
|
+
(key) => !["reason", "file", "statement_index", "sqlstate"].includes(key),
|
|
177
|
+
) ||
|
|
178
|
+
!["catalog_changed", "execution_failed", "ledger_conflict", "not_admitted"].includes(
|
|
179
|
+
String(r["reason"]),
|
|
180
|
+
) ||
|
|
181
|
+
!(
|
|
182
|
+
r["file"] === null ||
|
|
183
|
+
(typeof r["file"] === "string" &&
|
|
184
|
+
r["file"].length <= 512 &&
|
|
185
|
+
/^(?:[A-Za-z0-9][A-Za-z0-9._-]*\/)*\d{14}_[a-z0-9][a-z0-9_-]*\.sql$/u.test(r["file"]))
|
|
186
|
+
)
|
|
187
|
+
)
|
|
188
|
+
return null;
|
|
189
|
+
const ordinal = r["statement_index"],
|
|
190
|
+
state = r["sqlstate"];
|
|
191
|
+
if (
|
|
192
|
+
(Object.hasOwn(r, "statement_index") && ordinal === undefined) ||
|
|
193
|
+
(Object.hasOwn(r, "sqlstate") && state === undefined)
|
|
194
|
+
)
|
|
195
|
+
return null;
|
|
196
|
+
if (
|
|
197
|
+
(ordinal === undefined) !== (state === undefined) ||
|
|
198
|
+
(ordinal !== undefined &&
|
|
199
|
+
(r["reason"] !== "execution_failed" ||
|
|
200
|
+
r["file"] === null ||
|
|
201
|
+
typeof ordinal !== "number" ||
|
|
202
|
+
!Number.isSafeInteger(ordinal) ||
|
|
203
|
+
ordinal < 1)) ||
|
|
204
|
+
(state !== undefined &&
|
|
205
|
+
(ordinal === undefined ||
|
|
206
|
+
typeof state !== "string" ||
|
|
207
|
+
!/^[0-9A-Z]{5}$/u.test(state) ||
|
|
208
|
+
state.startsWith("08") ||
|
|
209
|
+
/^57P0[123]$/u.test(state)))
|
|
210
|
+
)
|
|
211
|
+
return null;
|
|
212
|
+
return Object.freeze({
|
|
213
|
+
reason: r["reason"] as MigrationFailureDiagnostic["reason"],
|
|
214
|
+
file: r["file"] as string | null,
|
|
215
|
+
...(ordinal === undefined ? {} : { statement_index: ordinal as number }),
|
|
216
|
+
...(state === undefined ? {} : { sqlstate: state as string }),
|
|
217
|
+
});
|
|
150
218
|
}
|
|
151
219
|
|
|
152
220
|
export interface OperationReconciliationObservation {
|
|
@@ -198,11 +266,14 @@ export function publicOperationFailure(
|
|
|
198
266
|
const [message, suggested_action] = failures[code];
|
|
199
267
|
const detail =
|
|
200
268
|
code === "auto_deploy_plan_rejected" ? frameworkConversionDetail(diagnostic) : null;
|
|
269
|
+
const migration =
|
|
270
|
+
code === "database_migration_failed" ? parseMigrationFailureDiagnostic(diagnostic) : null;
|
|
201
271
|
return Object.freeze({
|
|
202
272
|
code,
|
|
203
273
|
message,
|
|
204
274
|
retryable: false,
|
|
205
275
|
suggested_action,
|
|
206
276
|
...(detail === null ? {} : { detail }),
|
|
277
|
+
...(migration === null ? {} : { migration }),
|
|
207
278
|
});
|
|
208
279
|
}
|
|
@@ -441,9 +441,21 @@ export const PROBLEM_POLICY = {
|
|
|
441
441
|
status: 409,
|
|
442
442
|
retryable: false,
|
|
443
443
|
action:
|
|
444
|
-
"
|
|
444
|
+
"This is a legacy deployment restriction. Update the CLI and MCP to the current release, then plan with environment prod. The current platform permits direct Prod deployment with shared data; its migrations affect both environments when Dev exists. If the restriction persists, report the request ID.",
|
|
445
445
|
title: "Shared data requires promotion",
|
|
446
446
|
},
|
|
447
|
+
development_environment_exists: {
|
|
448
|
+
status: 409,
|
|
449
|
+
retryable: false,
|
|
450
|
+
action: "Read project status and use the existing Dev environment ID.",
|
|
451
|
+
title: "Development environment already exists",
|
|
452
|
+
},
|
|
453
|
+
development_environment_missing: {
|
|
454
|
+
status: 409,
|
|
455
|
+
retryable: false,
|
|
456
|
+
action: "Select environment prod, or add Dev with 'ohmyhost project dev add'.",
|
|
457
|
+
title: "Development environment is missing",
|
|
458
|
+
},
|
|
447
459
|
production_deployment_required: {
|
|
448
460
|
status: 409,
|
|
449
461
|
retryable: false,
|
|
@@ -10,16 +10,17 @@ const FIXED_PLATFORM_NAMES = new Set([
|
|
|
10
10
|
"IMAGES",
|
|
11
11
|
"STORAGE",
|
|
12
12
|
]);
|
|
13
|
-
/** The
|
|
13
|
+
/** The five keys the platform installs; control-store's rotation accepts exactly these names. */
|
|
14
14
|
export const INSTALLED_PLATFORM_KEY_NAMES = [
|
|
15
15
|
"OHMYHOST_STORAGE_KEY",
|
|
16
16
|
"OHMYHOST_MAIL_KEY",
|
|
17
17
|
"OHMYHOST_AI_KEY",
|
|
18
|
+
"OHMYHOST_BROWSER_KEY",
|
|
18
19
|
"BETTER_AUTH_SECRET",
|
|
19
20
|
] as const;
|
|
20
21
|
const INSTALLED_PLATFORM_KEYS = new Set<string>(INSTALLED_PLATFORM_KEY_NAMES);
|
|
21
22
|
|
|
22
|
-
/** The
|
|
23
|
+
/** The five keys the platform installs. An owner may rotate them; a customer may never set or delete them. */
|
|
23
24
|
export function isInstalledPlatformKeyName(value: unknown): value is string {
|
|
24
25
|
return typeof value === "string" && INSTALLED_PLATFORM_KEYS.has(value);
|
|
25
26
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
3
|
export {
|
|
4
|
+
activateDatabaseWebhookSubscription,
|
|
5
|
+
addProjectDevelopmentEnvironment,
|
|
4
6
|
applyPaidProjectDomain,
|
|
5
7
|
authorizeApplicationDomainIdentityDns,
|
|
6
8
|
authorizeWorkspaceMailDomainDns,
|
|
@@ -33,6 +35,7 @@ export {
|
|
|
33
35
|
createProjectExportDownloadLink,
|
|
34
36
|
createUserApiKey,
|
|
35
37
|
createWorkspaceMailDomain,
|
|
38
|
+
deactivateDatabaseWebhookSubscription,
|
|
36
39
|
declareApplicationDomainIdentity,
|
|
37
40
|
deleteEnvironmentSecret,
|
|
38
41
|
deleteManagedMailDomain,
|
|
@@ -55,6 +58,7 @@ export {
|
|
|
55
58
|
getCloudflareDnsAuthorizationStatus,
|
|
56
59
|
getCurrentIdentity,
|
|
57
60
|
getDatabaseCompute,
|
|
61
|
+
getDatabaseWebhookSubscription,
|
|
58
62
|
getDeployment,
|
|
59
63
|
getDeploymentLogs,
|
|
60
64
|
getFeatureInterests,
|
|
@@ -165,6 +169,16 @@ export {
|
|
|
165
169
|
} from "./sdk.gen.js";
|
|
166
170
|
export type {
|
|
167
171
|
AccountProfile,
|
|
172
|
+
ActivateDatabaseWebhookSubscriptionData,
|
|
173
|
+
ActivateDatabaseWebhookSubscriptionError,
|
|
174
|
+
ActivateDatabaseWebhookSubscriptionErrors,
|
|
175
|
+
ActivateDatabaseWebhookSubscriptionResponse,
|
|
176
|
+
ActivateDatabaseWebhookSubscriptionResponses,
|
|
177
|
+
AddProjectDevelopmentEnvironmentData,
|
|
178
|
+
AddProjectDevelopmentEnvironmentError,
|
|
179
|
+
AddProjectDevelopmentEnvironmentErrors,
|
|
180
|
+
AddProjectDevelopmentEnvironmentResponse,
|
|
181
|
+
AddProjectDevelopmentEnvironmentResponses,
|
|
168
182
|
ApplicationDomainIdentity,
|
|
169
183
|
ApplicationDomainIdentityRequest,
|
|
170
184
|
ApplicationDomainIdentitySummary,
|
|
@@ -388,10 +402,19 @@ export type {
|
|
|
388
402
|
DatabaseWebhookEventPattern,
|
|
389
403
|
DatabaseWebhookEventPatternWritable,
|
|
390
404
|
DatabaseWebhookEventType,
|
|
405
|
+
DatabaseWebhookGeneration,
|
|
391
406
|
DatabaseWebhookId,
|
|
392
407
|
DatabaseWebhookPage,
|
|
393
408
|
DatabaseWebhookReplayAccepted,
|
|
409
|
+
DatabaseWebhookSubscription,
|
|
410
|
+
DatabaseWebhookSubscriptionActivation,
|
|
411
|
+
DatabaseWebhookSubscriptionId,
|
|
394
412
|
DatabaseWebhookTestResult,
|
|
413
|
+
DeactivateDatabaseWebhookSubscriptionData,
|
|
414
|
+
DeactivateDatabaseWebhookSubscriptionError,
|
|
415
|
+
DeactivateDatabaseWebhookSubscriptionErrors,
|
|
416
|
+
DeactivateDatabaseWebhookSubscriptionResponse,
|
|
417
|
+
DeactivateDatabaseWebhookSubscriptionResponses,
|
|
395
418
|
DeclareApplicationDomainIdentityData,
|
|
396
419
|
DeclareApplicationDomainIdentityError,
|
|
397
420
|
DeclareApplicationDomainIdentityErrors,
|
|
@@ -444,6 +467,7 @@ export type {
|
|
|
444
467
|
DeploymentDiagnosticPage,
|
|
445
468
|
DeploymentId,
|
|
446
469
|
DeploymentLimit,
|
|
470
|
+
DeploymentMailProgress,
|
|
447
471
|
DeploymentPage,
|
|
448
472
|
DeploymentPlan,
|
|
449
473
|
DeploymentPlanWritable,
|
|
@@ -527,6 +551,11 @@ export type {
|
|
|
527
551
|
GetDatabaseComputeErrors,
|
|
528
552
|
GetDatabaseComputeResponse,
|
|
529
553
|
GetDatabaseComputeResponses,
|
|
554
|
+
GetDatabaseWebhookSubscriptionData,
|
|
555
|
+
GetDatabaseWebhookSubscriptionError,
|
|
556
|
+
GetDatabaseWebhookSubscriptionErrors,
|
|
557
|
+
GetDatabaseWebhookSubscriptionResponse,
|
|
558
|
+
GetDatabaseWebhookSubscriptionResponses,
|
|
530
559
|
GetDeploymentData,
|
|
531
560
|
GetDeploymentError,
|
|
532
561
|
GetDeploymentErrors,
|
|
@@ -838,6 +867,7 @@ export type {
|
|
|
838
867
|
ManagedSourceUploadReceipt,
|
|
839
868
|
ManagedSourceUploadRequest,
|
|
840
869
|
ManagedSourceVersions,
|
|
870
|
+
MigrationFailureDiagnostic,
|
|
841
871
|
NativeAuthConfiguration,
|
|
842
872
|
NativeAuthConfigurationUpdate,
|
|
843
873
|
NativeAuthProviderStatus,
|
|
@@ -11,6 +11,10 @@ import {
|
|
|
11
11
|
type TDataShape,
|
|
12
12
|
} from "./client/index.js";
|
|
13
13
|
import type {
|
|
14
|
+
ActivateDatabaseWebhookSubscriptionErrors,
|
|
15
|
+
ActivateDatabaseWebhookSubscriptionResponses,
|
|
16
|
+
AddProjectDevelopmentEnvironmentErrors,
|
|
17
|
+
AddProjectDevelopmentEnvironmentResponses,
|
|
14
18
|
ApplicationDomainIdentityRequest,
|
|
15
19
|
ApplyPaidProjectDomainErrors,
|
|
16
20
|
ApplyPaidProjectDomainResponses,
|
|
@@ -88,6 +92,8 @@ import type {
|
|
|
88
92
|
DatabaseTableCreateRequest,
|
|
89
93
|
DatabaseWatchCreateRequest,
|
|
90
94
|
DatabaseWebhookCreateRequest,
|
|
95
|
+
DeactivateDatabaseWebhookSubscriptionErrors,
|
|
96
|
+
DeactivateDatabaseWebhookSubscriptionResponses,
|
|
91
97
|
DeclareApplicationDomainIdentityErrors,
|
|
92
98
|
DeclareApplicationDomainIdentityResponses,
|
|
93
99
|
DeleteEnvironmentSecretErrors,
|
|
@@ -133,6 +139,8 @@ import type {
|
|
|
133
139
|
GetCurrentIdentityResponses,
|
|
134
140
|
GetDatabaseComputeErrors,
|
|
135
141
|
GetDatabaseComputeResponses,
|
|
142
|
+
GetDatabaseWebhookSubscriptionErrors,
|
|
143
|
+
GetDatabaseWebhookSubscriptionResponses,
|
|
136
144
|
GetDeploymentErrors,
|
|
137
145
|
GetDeploymentLogsErrors,
|
|
138
146
|
GetDeploymentLogsResponses,
|
|
@@ -3495,6 +3503,59 @@ export const setProjectNotes = <ThrowOnError extends boolean = true>(
|
|
|
3495
3503
|
});
|
|
3496
3504
|
};
|
|
3497
3505
|
|
|
3506
|
+
/**
|
|
3507
|
+
* Add Dev to a production-only project
|
|
3508
|
+
*
|
|
3509
|
+
* Creates a Dev environment without changing Prod. Shared data reuses the current Prod data assignment; isolated data receives its own assignment. An identical idempotent retry returns the original accepted operation. Projects that already have Dev return development_environment_exists.
|
|
3510
|
+
*/
|
|
3511
|
+
export const addProjectDevelopmentEnvironment = <ThrowOnError extends boolean = true>(
|
|
3512
|
+
parameters: {
|
|
3513
|
+
"X-Request-Id"?: string;
|
|
3514
|
+
"Idempotency-Key": string;
|
|
3515
|
+
project_id: Ulid;
|
|
3516
|
+
body: {
|
|
3517
|
+
[key: string]: never;
|
|
3518
|
+
};
|
|
3519
|
+
},
|
|
3520
|
+
options?: Options<never, ThrowOnError>,
|
|
3521
|
+
): RequestResult<
|
|
3522
|
+
AddProjectDevelopmentEnvironmentResponses,
|
|
3523
|
+
AddProjectDevelopmentEnvironmentErrors,
|
|
3524
|
+
ThrowOnError,
|
|
3525
|
+
"data"
|
|
3526
|
+
> => {
|
|
3527
|
+
const params = buildClientParams(
|
|
3528
|
+
[parameters],
|
|
3529
|
+
[
|
|
3530
|
+
{
|
|
3531
|
+
args: [
|
|
3532
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
3533
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
3534
|
+
{ in: "path", key: "project_id" },
|
|
3535
|
+
{ key: "body", map: "body" },
|
|
3536
|
+
],
|
|
3537
|
+
},
|
|
3538
|
+
],
|
|
3539
|
+
);
|
|
3540
|
+
return (options?.client ?? client).post<
|
|
3541
|
+
AddProjectDevelopmentEnvironmentResponses,
|
|
3542
|
+
AddProjectDevelopmentEnvironmentErrors,
|
|
3543
|
+
ThrowOnError,
|
|
3544
|
+
"data"
|
|
3545
|
+
>({
|
|
3546
|
+
responseStyle: "data",
|
|
3547
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3548
|
+
url: "/v1/projects/{project_id}/environments/dev",
|
|
3549
|
+
...options,
|
|
3550
|
+
...params,
|
|
3551
|
+
headers: {
|
|
3552
|
+
"Content-Type": "application/json",
|
|
3553
|
+
...options?.headers,
|
|
3554
|
+
...params.headers,
|
|
3555
|
+
},
|
|
3556
|
+
});
|
|
3557
|
+
};
|
|
3558
|
+
|
|
3498
3559
|
/**
|
|
3499
3560
|
* Get the current project deployment status
|
|
3500
3561
|
*
|
|
@@ -4986,7 +5047,7 @@ export const applyPaidProjectDomain = <ThrowOnError extends boolean = true>(
|
|
|
4986
5047
|
/**
|
|
4987
5048
|
* Plan a deployment
|
|
4988
5049
|
*
|
|
4989
|
-
* Resolves immutable inputs and estimates effects without provider mutation or billable work.
|
|
5050
|
+
* Resolves immutable inputs and estimates effects without provider mutation or billable work. An omitted `environment` selects Dev when it exists, otherwise Prod. A Prod plan builds straight into Prod, including for a project with shared data; database migrations then affect both environments when Dev exists. Managed mail requires a confirmed Paid service period; it is checked again before build reservation. Selecting the managed Better Auth bridge does not require managed mail or Paid access. An old sender configuration is not Paid authority. A commit the platform does not admit answers 409 with a nonretryable problem code; for framework_conversion_required, detail is a fixed catalog sentence that names the file, the rule and the required change whenever the refusal is typed.
|
|
4990
5051
|
*/
|
|
4991
5052
|
export const planDeployment = <ThrowOnError extends boolean = true>(
|
|
4992
5053
|
parameters: {
|
|
@@ -5755,6 +5816,159 @@ export const deleteProjectDatabaseWatch = <ThrowOnError extends boolean = true>(
|
|
|
5755
5816
|
});
|
|
5756
5817
|
};
|
|
5757
5818
|
|
|
5819
|
+
/**
|
|
5820
|
+
* Read a database webhook subscription
|
|
5821
|
+
*
|
|
5822
|
+
* Returns the current activation generation and state. This read never returns a signing secret.
|
|
5823
|
+
*/
|
|
5824
|
+
export const getDatabaseWebhookSubscription = <ThrowOnError extends boolean = true>(
|
|
5825
|
+
parameters: {
|
|
5826
|
+
"X-Request-Id"?: string;
|
|
5827
|
+
project_id: Ulid;
|
|
5828
|
+
subscription_id: Ulid;
|
|
5829
|
+
environment: "dev" | "prod";
|
|
5830
|
+
},
|
|
5831
|
+
options?: Options<never, ThrowOnError>,
|
|
5832
|
+
): RequestResult<
|
|
5833
|
+
GetDatabaseWebhookSubscriptionResponses,
|
|
5834
|
+
GetDatabaseWebhookSubscriptionErrors,
|
|
5835
|
+
ThrowOnError,
|
|
5836
|
+
"data"
|
|
5837
|
+
> => {
|
|
5838
|
+
const params = buildClientParams(
|
|
5839
|
+
[parameters],
|
|
5840
|
+
[
|
|
5841
|
+
{
|
|
5842
|
+
args: [
|
|
5843
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
5844
|
+
{ in: "path", key: "project_id" },
|
|
5845
|
+
{ in: "path", key: "subscription_id" },
|
|
5846
|
+
{ in: "query", key: "environment" },
|
|
5847
|
+
],
|
|
5848
|
+
},
|
|
5849
|
+
],
|
|
5850
|
+
);
|
|
5851
|
+
return (options?.client ?? client).get<
|
|
5852
|
+
GetDatabaseWebhookSubscriptionResponses,
|
|
5853
|
+
GetDatabaseWebhookSubscriptionErrors,
|
|
5854
|
+
ThrowOnError,
|
|
5855
|
+
"data"
|
|
5856
|
+
>({
|
|
5857
|
+
responseStyle: "data",
|
|
5858
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5859
|
+
url: "/v1/projects/{project_id}/database/webhook-subscriptions/{subscription_id}",
|
|
5860
|
+
...options,
|
|
5861
|
+
...params,
|
|
5862
|
+
});
|
|
5863
|
+
};
|
|
5864
|
+
|
|
5865
|
+
/**
|
|
5866
|
+
* Deactivate one webhook subscription generation
|
|
5867
|
+
*
|
|
5868
|
+
* Deactivation is confirmed before a new generation can start. Repeat the same key after an uncertain response. Pending deliveries have no delivery guarantee while the generation is deactivating or inactive.
|
|
5869
|
+
*/
|
|
5870
|
+
export const deactivateDatabaseWebhookSubscription = <ThrowOnError extends boolean = true>(
|
|
5871
|
+
parameters: {
|
|
5872
|
+
"X-Request-Id"?: string;
|
|
5873
|
+
"Idempotency-Key": string;
|
|
5874
|
+
project_id: Ulid;
|
|
5875
|
+
subscription_id: Ulid;
|
|
5876
|
+
generation: number;
|
|
5877
|
+
environment: "dev" | "prod";
|
|
5878
|
+
},
|
|
5879
|
+
options?: Options<never, ThrowOnError>,
|
|
5880
|
+
): RequestResult<
|
|
5881
|
+
DeactivateDatabaseWebhookSubscriptionResponses,
|
|
5882
|
+
DeactivateDatabaseWebhookSubscriptionErrors,
|
|
5883
|
+
ThrowOnError,
|
|
5884
|
+
"data"
|
|
5885
|
+
> => {
|
|
5886
|
+
const params = buildClientParams(
|
|
5887
|
+
[parameters],
|
|
5888
|
+
[
|
|
5889
|
+
{
|
|
5890
|
+
args: [
|
|
5891
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
5892
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
5893
|
+
{ in: "path", key: "project_id" },
|
|
5894
|
+
{ in: "path", key: "subscription_id" },
|
|
5895
|
+
{ in: "path", key: "generation" },
|
|
5896
|
+
{ in: "query", key: "environment" },
|
|
5897
|
+
],
|
|
5898
|
+
},
|
|
5899
|
+
],
|
|
5900
|
+
);
|
|
5901
|
+
return (options?.client ?? client).delete<
|
|
5902
|
+
DeactivateDatabaseWebhookSubscriptionResponses,
|
|
5903
|
+
DeactivateDatabaseWebhookSubscriptionErrors,
|
|
5904
|
+
ThrowOnError,
|
|
5905
|
+
"data"
|
|
5906
|
+
>({
|
|
5907
|
+
responseStyle: "data",
|
|
5908
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5909
|
+
url: "/v1/projects/{project_id}/database/webhook-subscriptions/{subscription_id}/activations/{generation}",
|
|
5910
|
+
...options,
|
|
5911
|
+
...params,
|
|
5912
|
+
});
|
|
5913
|
+
};
|
|
5914
|
+
|
|
5915
|
+
/**
|
|
5916
|
+
* Activate or reconcile one webhook subscription generation
|
|
5917
|
+
*
|
|
5918
|
+
* The client chooses a stable subscription ULID and starts with generation 1. Repeat the identical request and Idempotency-Key after an uncertain reply to recover the original signing secret. A new generation needs a new key and is accepted only after the previous one is confirmed inactive. A late retry of an old generation is refused. Status reads never reveal the secret; save this authorized response privately. If the provider outcome remains unknown near the end of its 24-hour idempotency window, the operation stays pending rather than risk creating a duplicate. The five-webhook database limit includes existing webhooks.
|
|
5919
|
+
*/
|
|
5920
|
+
export const activateDatabaseWebhookSubscription = <ThrowOnError extends boolean = true>(
|
|
5921
|
+
parameters: {
|
|
5922
|
+
"X-Request-Id"?: string;
|
|
5923
|
+
"Idempotency-Key": string;
|
|
5924
|
+
project_id: Ulid;
|
|
5925
|
+
subscription_id: Ulid;
|
|
5926
|
+
generation: number;
|
|
5927
|
+
environment: "dev" | "prod";
|
|
5928
|
+
databaseWebhookCreateRequest: DatabaseWebhookCreateRequest;
|
|
5929
|
+
},
|
|
5930
|
+
options?: Options<never, ThrowOnError>,
|
|
5931
|
+
): RequestResult<
|
|
5932
|
+
ActivateDatabaseWebhookSubscriptionResponses,
|
|
5933
|
+
ActivateDatabaseWebhookSubscriptionErrors,
|
|
5934
|
+
ThrowOnError,
|
|
5935
|
+
"data"
|
|
5936
|
+
> => {
|
|
5937
|
+
const params = buildClientParams(
|
|
5938
|
+
[parameters],
|
|
5939
|
+
[
|
|
5940
|
+
{
|
|
5941
|
+
args: [
|
|
5942
|
+
{ in: "headers", key: "X-Request-Id" },
|
|
5943
|
+
{ in: "headers", key: "Idempotency-Key" },
|
|
5944
|
+
{ in: "path", key: "project_id" },
|
|
5945
|
+
{ in: "path", key: "subscription_id" },
|
|
5946
|
+
{ in: "path", key: "generation" },
|
|
5947
|
+
{ in: "query", key: "environment" },
|
|
5948
|
+
{ key: "databaseWebhookCreateRequest", map: "body" },
|
|
5949
|
+
],
|
|
5950
|
+
},
|
|
5951
|
+
],
|
|
5952
|
+
);
|
|
5953
|
+
return (options?.client ?? client).put<
|
|
5954
|
+
ActivateDatabaseWebhookSubscriptionResponses,
|
|
5955
|
+
ActivateDatabaseWebhookSubscriptionErrors,
|
|
5956
|
+
ThrowOnError,
|
|
5957
|
+
"data"
|
|
5958
|
+
>({
|
|
5959
|
+
responseStyle: "data",
|
|
5960
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5961
|
+
url: "/v1/projects/{project_id}/database/webhook-subscriptions/{subscription_id}/activations/{generation}",
|
|
5962
|
+
...options,
|
|
5963
|
+
...params,
|
|
5964
|
+
headers: {
|
|
5965
|
+
"Content-Type": "application/json",
|
|
5966
|
+
...options?.headers,
|
|
5967
|
+
...params.headers,
|
|
5968
|
+
},
|
|
5969
|
+
});
|
|
5970
|
+
};
|
|
5971
|
+
|
|
5758
5972
|
/**
|
|
5759
5973
|
* List the project's database webhooks
|
|
5760
5974
|
*
|
|
@@ -6796,7 +7010,7 @@ export const putEnvironmentSecret = <ThrowOnError extends boolean = true>(
|
|
|
6796
7010
|
/**
|
|
6797
7011
|
* Rotate an installed platform key
|
|
6798
7012
|
*
|
|
6799
|
-
* Replaces the value of an installed platform key (OHMYHOST_AI_KEY, OHMYHOST_MAIL_KEY, OHMYHOST_STORAGE_KEY or BETTER_AUTH_SECRET) with a value the platform generates. The request has no body and the value is never returned. The earlier value stops authorizing at once, and the new value reaches the running environment without a deployment. Other names answer 400; an installed key the environment does not hold answers 404. Repeating the same idempotency key replays the stored metadata.
|
|
7013
|
+
* Replaces the value of an installed platform key (OHMYHOST_AI_KEY, OHMYHOST_BROWSER_KEY, OHMYHOST_MAIL_KEY, OHMYHOST_STORAGE_KEY or BETTER_AUTH_SECRET) with a value the platform generates. The request has no body and the value is never returned. The earlier value stops authorizing at once, and the new value reaches the running environment without a deployment. Other names answer 400; an installed key the environment does not hold answers 404. Repeating the same idempotency key replays the stored metadata.
|
|
6800
7014
|
*/
|
|
6801
7015
|
export const rotateEnvironmentSecret = <ThrowOnError extends boolean = true>(
|
|
6802
7016
|
parameters: {
|