@amerged/ohmyhost-cli 0.1.11 → 0.1.14

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.
@@ -129,6 +129,29 @@ const PROBLEM_POLICY = {
129
129
  retryable: true,
130
130
  action: "Retry project creation with the same idempotency key.",
131
131
  },
132
+ project_handle_taken: {
133
+ status: 409,
134
+ retryable: false,
135
+ action:
136
+ "Run 'ohmyhost project handle check' for a free address, then rename to one of the alternatives it returns.",
137
+ },
138
+ project_handle_invalid: {
139
+ status: 409,
140
+ retryable: false,
141
+ action:
142
+ "Choose one to five lowercase words of letters and digits, three to fifty-nine characters, avoiding reserved words.",
143
+ },
144
+ project_handle_unchanged: {
145
+ status: 409,
146
+ retryable: false,
147
+ action: "The project already answers on this address; no rename is needed.",
148
+ },
149
+ project_rename_blocked: {
150
+ status: 409,
151
+ retryable: true,
152
+ action:
153
+ "Wait for the running operation to finish, read the project again, then rename with the new ETag.",
154
+ },
132
155
  project_identity_unavailable: {
133
156
  status: 503,
134
157
  retryable: true,
@@ -196,6 +219,12 @@ const PROBLEM_POLICY = {
196
219
  action:
197
220
  "Run 'ohmyhost init', apply the matching ohmyhost framework skill, then plan the new commit.",
198
221
  },
222
+ repository_configuration_missing: {
223
+ status: 409,
224
+ retryable: false,
225
+ action:
226
+ "Place ohmyhost.yaml at the Git repository root and set applicationRoot to the application directory (for example website). Commit and push the change, then plan the new commit.",
227
+ },
199
228
  migration_filename_noncanonical: {
200
229
  status: 409,
201
230
  retryable: false,
@@ -278,6 +307,7 @@ export class ResponseContractError extends Error {
278
307
  }
279
308
 
280
309
  export interface SafeProblem {
310
+ readonly requestId: string;
281
311
  readonly retryAfterSeconds?: number;
282
312
  readonly code: ProblemCode;
283
313
  readonly retryable: boolean;
@@ -676,9 +706,9 @@ export const parseDevAccessTicket = (value: unknown): PublicDevAccessTicket => {
676
706
  !isUlid(input["project_id"]) ||
677
707
  !isUlid(input["environment_id"]) ||
678
708
  typeof origin !== "string" ||
679
- !/^https:\/\/dev-[a-z]+-[a-z]+-[a-z]+\.(?:dev\.)?check\.omh\.st$/u.test(origin) ||
709
+ !/^https:\/\/dev-[a-z0-9]+(?:-[a-z0-9]+){0,4}\.(?:dev\.)?check\.omh\.st$/u.test(origin) ||
680
710
  typeof redeemUrl !== "string" ||
681
- !/^https:\/\/dev-[a-z]+-[a-z]+-[a-z]+\.(?:dev\.)?check\.omh\.st\/\.ohmyhost\/dev-access\/redeem\?stage=dev&ticket=[A-Za-z0-9_-]{43}$/u.test(
711
+ !/^https:\/\/dev-[a-z0-9]+(?:-[a-z0-9]+){0,4}\.(?:dev\.)?check\.omh\.st\/\.ohmyhost\/dev-access\/redeem\?stage=dev&ticket=[A-Za-z0-9_-]{43}$/u.test(
682
712
  redeemUrl,
683
713
  ) ||
684
714
  new URL(redeemUrl).origin !== origin ||
@@ -880,8 +910,8 @@ const parseProject = (value: unknown): PublicProject => {
880
910
  !isUlid(input["organization_id"]) ||
881
911
  !boundedString(input["name"], 1, 128) ||
882
912
  input["name"] !== input["name"].trim() ||
883
- !boundedString(input["handle"], 5, 59) ||
884
- !/^[a-z]+-[a-z]+-[a-z]+$/u.test(input["handle"]) ||
913
+ !boundedString(input["handle"], 3, 59) ||
914
+ !/^[a-z0-9]+(?:-[a-z0-9]+){0,4}$/u.test(input["handle"]) ||
885
915
  (input["data_mode"] !== "shared" && input["data_mode"] !== "isolated") ||
886
916
  (input["region"] !== "us" && input["region"] !== "eu") ||
887
917
  !isIsoInstant(input["created_at"])
@@ -910,6 +940,7 @@ export const parseProjectPage = (
910
940
  export const parseProjectStatus = (value: unknown): Readonly<Record<string, unknown>> => {
911
941
  const input = exactRecord(value, [
912
942
  "project_id",
943
+ "etag",
913
944
  "handle",
914
945
  "region",
915
946
  "lifecycle",
@@ -925,8 +956,10 @@ export const parseProjectStatus = (value: unknown): Readonly<Record<string, unkn
925
956
  const handle = input["handle"];
926
957
  if (
927
958
  !isUlid(input["project_id"]) ||
928
- !boundedString(handle, 5, 59) ||
929
- !/^[a-z]+-[a-z]+-[a-z]+$/u.test(handle) ||
959
+ typeof input["etag"] !== "string" ||
960
+ !/^"sha256-[a-f0-9]{64}"$/u.test(input["etag"]) ||
961
+ !boundedString(handle, 3, 59) ||
962
+ !/^[a-z0-9]+(?:-[a-z0-9]+){0,4}$/u.test(handle) ||
930
963
  (input["region"] !== "us" && input["region"] !== "eu") ||
931
964
  (input["lifecycle"] !== "active" &&
932
965
  input["lifecycle"] !== "deleting" &&
@@ -1271,100 +1304,6 @@ function validDelivery(input: Readonly<Record<string, unknown>>): boolean {
1271
1304
  );
1272
1305
  }
1273
1306
 
1274
- export type PublicProjectMailDomain =
1275
- | Readonly<{ domain: string; status: "configured"; configured_at: string }>
1276
- | Readonly<{
1277
- domain: string;
1278
- status: "delegation_required" | "ready" | "verification_pending" | "verification_failed";
1279
- observed_at?: string;
1280
- verification_issue?:
1281
- | "identity_missing"
1282
- | "identity_verification_failed"
1283
- | "dkim_verification_failed"
1284
- | "dkim_records_changed"
1285
- | "tenant_association_missing"
1286
- | null;
1287
- next_check_after_seconds?: 3600 | null;
1288
- configured_at: string;
1289
- name_servers: readonly [string, string, string, string];
1290
- change_id: string;
1291
- }>;
1292
-
1293
- export const parseProjectMailDomain = (value: unknown): PublicProjectMailDomain => {
1294
- const input = exactRecord(value, [
1295
- "domain",
1296
- "status",
1297
- "configured_at",
1298
- "name_servers",
1299
- "change_id",
1300
- "observed_at",
1301
- "verification_issue",
1302
- "next_check_after_seconds",
1303
- ]);
1304
- if (
1305
- typeof input["domain"] !== "string" ||
1306
- !/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/u.test(
1307
- input["domain"],
1308
- ) ||
1309
- !isIsoInstant(input["configured_at"])
1310
- ) {
1311
- throw new ResponseContractError();
1312
- }
1313
- if (input["status"] === "configured") {
1314
- if (
1315
- input["name_servers"] !== undefined ||
1316
- input["change_id"] !== undefined ||
1317
- input["observed_at"] !== undefined ||
1318
- input["verification_issue"] !== undefined ||
1319
- input["next_check_after_seconds"] !== undefined
1320
- ) {
1321
- throw new ResponseContractError();
1322
- }
1323
- return input as unknown as PublicProjectMailDomain;
1324
- }
1325
- if (
1326
- !["delegation_required", "ready", "verification_pending", "verification_failed"].includes(
1327
- String(input["status"]),
1328
- ) ||
1329
- !Array.isArray(input["name_servers"]) ||
1330
- input["name_servers"].length !== 4 ||
1331
- new Set(input["name_servers"]).size !== 4 ||
1332
- input["name_servers"].some(
1333
- (nameServer) =>
1334
- typeof nameServer !== "string" ||
1335
- !/^ns-[0-9]{1,4}\.awsdns-[0-9]{1,2}\.(?:com|net|org|co\.uk)$/u.test(nameServer),
1336
- ) ||
1337
- typeof input["change_id"] !== "string" ||
1338
- !/^C[A-Z0-9]{8,31}$/u.test(input["change_id"])
1339
- ) {
1340
- throw new ResponseContractError();
1341
- }
1342
- if (input["observed_at"] !== undefined) {
1343
- if (
1344
- ![
1345
- null,
1346
- "identity_missing",
1347
- "identity_verification_failed",
1348
- "dkim_verification_failed",
1349
- "dkim_records_changed",
1350
- "tenant_association_missing",
1351
- ].includes(input["verification_issue"] as string | null)
1352
- )
1353
- throw new ResponseContractError();
1354
- if (
1355
- !isIsoInstant(input["observed_at"]) ||
1356
- input["next_check_after_seconds"] !== (input["status"] === "ready" ? null : 3600)
1357
- )
1358
- throw new ResponseContractError();
1359
- } else if (
1360
- input["next_check_after_seconds"] !== undefined ||
1361
- input["verification_issue"] !== undefined ||
1362
- ["verification_pending", "verification_failed"].includes(String(input["status"]))
1363
- )
1364
- throw new ResponseContractError();
1365
- return input as unknown as PublicProjectMailDomain;
1366
- };
1367
-
1368
1307
  export const parseDeploymentPlan = (value: unknown): Readonly<Record<string, unknown>> => {
1369
1308
  const input = exactRecord(value, [
1370
1309
  "id",
@@ -1540,6 +1479,7 @@ export const parseSafeProblem = (value: unknown): SafeProblem => {
1540
1479
  !isHttpsUrl(input["type"]) ||
1541
1480
  !boundedString(input["title"], 1, 160) ||
1542
1481
  !boundedString(input["request_id"], 1, 128) ||
1482
+ /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(input["request_id"]) ||
1543
1483
  typeof input["retryable"] !== "boolean" ||
1544
1484
  !boundedString(input["suggested_action"], 1, 500) ||
1545
1485
  (input["detail"] !== undefined && !boundedString(input["detail"], 1, 2_000)) ||
@@ -1558,6 +1498,7 @@ export const parseSafeProblem = (value: unknown): SafeProblem => {
1558
1498
  )
1559
1499
  throw new ResponseContractError();
1560
1500
  return {
1501
+ requestId: input["request_id"],
1561
1502
  code: code as ProblemCode,
1562
1503
  retryable: policy.retryable,
1563
1504
  suggestedAction:
@@ -208,9 +208,9 @@ const FRAMEWORK_CONVERSION_DETAILS: Readonly<
208
208
  > = Object.freeze({
209
209
  database_binding_private: Object.freeze({
210
210
  render: (path: string) =>
211
- `"${path}" reads a managed database connection string. Hyperdrive, DATABASE_URL and postgres:// URLs never reach a customer Worker; call the database with createPrivateDatabaseClient from "@ohmyhost/customer-runtime/database". Commit the change, then plan again.`,
211
+ `"${path}" reads a managed database connection string. HYPERDRIVE is retired; DATABASE_URL and postgres:// URLs never reach a customer Worker. Call the database with createPrivateDatabaseClient from "@ohmyhost/customer-runtime/database". Commit the change, then plan again.`,
212
212
  pattern:
213
- /^"([^"]+)" reads a managed database connection string\. Hyperdrive, DATABASE_URL and postgres:\/\/ URLs never reach a customer Worker; call the database with createPrivateDatabaseClient from "@ohmyhost\/customer-runtime\/database"\. Commit the change, then plan again\.$/u,
213
+ /^"([^"]+)" reads a managed database connection string\. HYPERDRIVE is retired; DATABASE_URL and postgres:\/\/ URLs never reach a customer Worker\. Call the database with createPrivateDatabaseClient from "@ohmyhost\/customer-runtime\/database"\. Commit the change, then plan again\.$/u,
214
214
  }),
215
215
  database_driver_unsupported: Object.freeze({
216
216
  render: (path: string) =>
@@ -3,11 +3,12 @@
3
3
  export {
4
4
  applyPaidProjectDomain,
5
5
  changeDatabaseCompute,
6
+ changeProjectHandle,
6
7
  completeCloudflareDnsAuthorization,
7
8
  completeGithubSourceAuthorization,
8
9
  configureBillingRecharge,
10
+ configureManagedMailDomain,
9
11
  configureProjectDomains,
10
- configureProjectMailDomain,
11
12
  configureProjectSourceAutoDeploy,
12
13
  connectGithubOrganization,
13
14
  createBillingCheckout,
@@ -23,6 +24,7 @@ export {
23
24
  deleteEnvironmentSecret,
24
25
  deletePaidProjectDomain,
25
26
  deleteProject,
27
+ disableManagedMailReceiving,
26
28
  getAccountProfile,
27
29
  getBillingCheckout,
28
30
  getBillingRecharge,
@@ -33,6 +35,9 @@ export {
33
35
  getDeploymentLogs,
34
36
  getFeatureInterests,
35
37
  getGithubOrganizationConnection,
38
+ getManagedMailAttachment,
39
+ getManagedMailDomain,
40
+ getManagedMailMessage,
36
41
  getOperation,
37
42
  getOrganizationAccount,
38
43
  getOrganizationCredits,
@@ -43,7 +48,6 @@ export {
43
48
  getProjectCreditBudget,
44
49
  getProjectExport,
45
50
  getProjectHandleAvailability,
46
- getProjectMailDomain,
47
51
  getProjectSource,
48
52
  getProjectSourceAutoDeploy,
49
53
  getProjectStatus,
@@ -53,6 +57,7 @@ export {
53
57
  listDeployments,
54
58
  listEnvironmentSecrets,
55
59
  listFunctionRuns,
60
+ listManagedMailMessages,
56
61
  listProjectDatabaseAccess,
57
62
  listProjects,
58
63
  listUserApiKeys,
@@ -62,12 +67,14 @@ export {
62
67
  planDeploymentRollback,
63
68
  planPaidProjectDomain,
64
69
  planProjectDeletion,
70
+ prepareManagedMailWebhook,
65
71
  promoteDeployment,
66
72
  putEnvironmentSecret,
67
73
  queryProjectDatabase,
68
74
  reconcileOperation,
69
75
  recordSignupSource,
70
76
  registerFeatureInterest,
77
+ retryManagedMailMessage,
71
78
  revokeCurrentSession,
72
79
  revokeProjectDatabaseAccess,
73
80
  revokeUserApiKey,
@@ -78,6 +85,7 @@ export {
78
85
  streamOperationEvents,
79
86
  submitContactRequest,
80
87
  submitFeedback,
88
+ verifyManagedMailWebhook,
81
89
  writeProjectDatabase,
82
90
  } from "./sdk.gen.js";
83
91
  export type {
@@ -101,6 +109,11 @@ export type {
101
109
  ChangeDatabaseComputeErrors,
102
110
  ChangeDatabaseComputeResponse,
103
111
  ChangeDatabaseComputeResponses,
112
+ ChangeProjectHandleData,
113
+ ChangeProjectHandleError,
114
+ ChangeProjectHandleErrors,
115
+ ChangeProjectHandleResponse,
116
+ ChangeProjectHandleResponses,
104
117
  ClientOptions,
105
118
  CloudflareDnsAuthorization,
106
119
  CloudflareDnsAuthorizationStatus,
@@ -117,18 +130,16 @@ export type {
117
130
  ConfigureBillingRechargeErrors,
118
131
  ConfigureBillingRechargeResponse,
119
132
  ConfigureBillingRechargeResponses,
120
- ConfiguredProjectMailDomain,
133
+ ConfigureManagedMailDomainData,
134
+ ConfigureManagedMailDomainError,
135
+ ConfigureManagedMailDomainErrors,
136
+ ConfigureManagedMailDomainResponse,
137
+ ConfigureManagedMailDomainResponses,
121
138
  ConfigureProjectDomainsData,
122
139
  ConfigureProjectDomainsError,
123
140
  ConfigureProjectDomainsErrors,
124
141
  ConfigureProjectDomainsResponse,
125
142
  ConfigureProjectDomainsResponses,
126
- ConfigureProjectMailDomainData,
127
- ConfigureProjectMailDomainError,
128
- ConfigureProjectMailDomainErrors,
129
- ConfigureProjectMailDomainRequest,
130
- ConfigureProjectMailDomainResponse,
131
- ConfigureProjectMailDomainResponses,
132
143
  ConfigureProjectSourceAutoDeployData,
133
144
  ConfigureProjectSourceAutoDeployError,
134
145
  ConfigureProjectSourceAutoDeployErrors,
@@ -203,7 +214,6 @@ export type {
203
214
  DatabaseAccessId,
204
215
  DatabaseCompute,
205
216
  DatabaseEnvironmentFilter,
206
- DelegatedProjectMailDomain,
207
217
  DeleteEnvironmentSecretData,
208
218
  DeleteEnvironmentSecretError,
209
219
  DeleteEnvironmentSecretErrors,
@@ -230,6 +240,11 @@ export type {
230
240
  DeploymentPlan,
231
241
  DeploymentPlanWritable,
232
242
  DevAccessTicket,
243
+ DisableManagedMailReceivingData,
244
+ DisableManagedMailReceivingError,
245
+ DisableManagedMailReceivingErrors,
246
+ DisableManagedMailReceivingResponse,
247
+ DisableManagedMailReceivingResponses,
233
248
  EnvironmentId,
234
249
  EnvironmentSecret,
235
250
  EnvironmentSecretPage,
@@ -289,6 +304,21 @@ export type {
289
304
  GetGithubOrganizationConnectionErrors,
290
305
  GetGithubOrganizationConnectionResponse,
291
306
  GetGithubOrganizationConnectionResponses,
307
+ GetManagedMailAttachmentData,
308
+ GetManagedMailAttachmentError,
309
+ GetManagedMailAttachmentErrors,
310
+ GetManagedMailAttachmentResponse,
311
+ GetManagedMailAttachmentResponses,
312
+ GetManagedMailDomainData,
313
+ GetManagedMailDomainError,
314
+ GetManagedMailDomainErrors,
315
+ GetManagedMailDomainResponse,
316
+ GetManagedMailDomainResponses,
317
+ GetManagedMailMessageData,
318
+ GetManagedMailMessageError,
319
+ GetManagedMailMessageErrors,
320
+ GetManagedMailMessageResponse,
321
+ GetManagedMailMessageResponses,
292
322
  GetOperationData,
293
323
  GetOperationError,
294
324
  GetOperationErrors,
@@ -337,11 +367,6 @@ export type {
337
367
  GetProjectHandleAvailabilityErrors,
338
368
  GetProjectHandleAvailabilityResponse,
339
369
  GetProjectHandleAvailabilityResponses,
340
- GetProjectMailDomainData,
341
- GetProjectMailDomainError,
342
- GetProjectMailDomainErrors,
343
- GetProjectMailDomainResponse,
344
- GetProjectMailDomainResponses,
345
370
  GetProjectResponse,
346
371
  GetProjectResponses,
347
372
  GetProjectSourceAutoDeployData,
@@ -400,6 +425,11 @@ export type {
400
425
  ListFunctionRunsErrors,
401
426
  ListFunctionRunsResponse,
402
427
  ListFunctionRunsResponses,
428
+ ListManagedMailMessagesData,
429
+ ListManagedMailMessagesError,
430
+ ListManagedMailMessagesErrors,
431
+ ListManagedMailMessagesResponse,
432
+ ListManagedMailMessagesResponses,
403
433
  ListProjectDatabaseAccessData,
404
434
  ListProjectDatabaseAccessError,
405
435
  ListProjectDatabaseAccessErrors,
@@ -415,6 +445,17 @@ export type {
415
445
  ListUserApiKeysErrors,
416
446
  ListUserApiKeysResponse,
417
447
  ListUserApiKeysResponses,
448
+ ManagedMailContent,
449
+ ManagedMailContentResult,
450
+ ManagedMailDisabled,
451
+ ManagedMailDnsRecord,
452
+ ManagedMailDomain,
453
+ ManagedMailDomainRequest,
454
+ ManagedMailExpired,
455
+ ManagedMailMessagePage,
456
+ ManagedMailRetryResult,
457
+ ManagedMailWebhook,
458
+ ManagedMailWebhookRequest,
418
459
  Operation,
419
460
  OperationDeploymentProgress,
420
461
  OperationEvent,
@@ -455,6 +496,11 @@ export type {
455
496
  PlanProjectDeletionErrors,
456
497
  PlanProjectDeletionResponse,
457
498
  PlanProjectDeletionResponses,
499
+ PrepareManagedMailWebhookData,
500
+ PrepareManagedMailWebhookError,
501
+ PrepareManagedMailWebhookErrors,
502
+ PrepareManagedMailWebhookResponse,
503
+ PrepareManagedMailWebhookResponses,
458
504
  ProblemDetails,
459
505
  Project,
460
506
  ProjectContext,
@@ -476,7 +522,6 @@ export type {
476
522
  ProjectHandleAvailability,
477
523
  ProjectId,
478
524
  ProjectLimit,
479
- ProjectMailDomain,
480
525
  ProjectNotesReceipt,
481
526
  ProjectPage,
482
527
  ProjectSource,
@@ -515,6 +560,11 @@ export type {
515
560
  RegisterFeatureInterestResponse,
516
561
  RegisterFeatureInterestResponses,
517
562
  RequestId,
563
+ RetryManagedMailMessageData,
564
+ RetryManagedMailMessageError,
565
+ RetryManagedMailMessageErrors,
566
+ RetryManagedMailMessageResponse,
567
+ RetryManagedMailMessageResponses,
518
568
  RevokeCurrentSessionData,
519
569
  RevokeCurrentSessionError,
520
570
  RevokeCurrentSessionErrors,
@@ -577,6 +627,11 @@ export type {
577
627
  UserApiKeyCreation,
578
628
  UserApiKeyId,
579
629
  UserApiKeyPage,
630
+ VerifyManagedMailWebhookData,
631
+ VerifyManagedMailWebhookError,
632
+ VerifyManagedMailWebhookErrors,
633
+ VerifyManagedMailWebhookResponse,
634
+ VerifyManagedMailWebhookResponses,
580
635
  WriteProjectDatabaseData,
581
636
  WriteProjectDatabaseError,
582
637
  WriteProjectDatabaseErrors,