@amerged/ohmyhost-sdk 0.1.15 → 0.1.18

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.
@@ -57,6 +57,15 @@ export type ManagedMailDisabled = {
57
57
  status: "disabled";
58
58
  };
59
59
 
60
+ export type ManagedMailDomainDeleted = {
61
+ status: "deleted";
62
+ domain: string;
63
+ /**
64
+ * Records ohmyho.st no longer manages; remove them from the domain's DNS.
65
+ */
66
+ dns_records: Array<ManagedMailDnsRecord>;
67
+ };
68
+
60
69
  export type ManagedMailExpired = {
61
70
  status: "expired";
62
71
  };
@@ -430,14 +439,17 @@ export type ConfigureSourceAutoDeployRequest = {
430
439
  enabled: boolean;
431
440
  };
432
441
 
442
+ /**
443
+ * Push-to-deploy configuration. Generation 0 with null branch, ref, grant_status and updated_at means auto-deploy was never configured for this project.
444
+ */
433
445
  export type SourceAutoDeploy = {
434
- branch: string;
435
- ref: string;
446
+ branch: string | null;
447
+ ref: string | null;
436
448
  environment: "dev";
437
449
  enabled: boolean;
438
450
  generation: number;
439
- grant_status: "active" | "revoked";
440
- updated_at: string;
451
+ grant_status: "active" | "revoked" | null;
452
+ updated_at: string | null;
441
453
  };
442
454
 
443
455
  export type ConnectGithubOrganizationRequest = {
@@ -654,6 +666,19 @@ export type ProjectDatabaseAccessPage = {
654
666
  items: Array<ProjectDatabaseAccess>;
655
667
  };
656
668
 
669
+ export type SetDevAccessModeRequest = {
670
+ mode: "protected" | "public";
671
+ };
672
+
673
+ export type DevAccessState = {
674
+ project_id: Ulid;
675
+ mode: "protected" | "public";
676
+ /**
677
+ * Owner-only persistent bearer link in protected mode; null when public or revoked.
678
+ */
679
+ share_url: string | null;
680
+ };
681
+
657
682
  export type DevAccessTicket = {
658
683
  ticket_id: Ulid;
659
684
  project_id: Ulid;
@@ -665,6 +690,10 @@ export type DevAccessTicket = {
665
690
 
666
691
  export type PlanDeploymentRequest = {
667
692
  commit_sha: GitCommitSha;
693
+ /**
694
+ * The environment the deployment builds into. Prod skips Dev and switches Prod traffic once activated.
695
+ */
696
+ environment?: "dev" | "prod";
668
697
  };
669
698
 
670
699
  export type CreateDeploymentRequest = {
@@ -672,11 +701,15 @@ export type CreateDeploymentRequest = {
672
701
  };
673
702
 
674
703
  /**
675
- * Immutable pre-build deployment plan. It expires exactly fifteen minutes after creation.
704
+ * Immutable pre-build deployment plan. It expires exactly 24 hours after creation.
676
705
  */
677
706
  export type DeploymentPlan = {
678
707
  id: Ulid;
679
708
  project_id: Ulid;
709
+ /**
710
+ * The environment this plan builds into.
711
+ */
712
+ environment: "dev" | "prod";
680
713
  commit_sha: GitCommitSha;
681
714
  source_digest: Sha256Digest;
682
715
  build_plan_digest: Sha256Digest;
@@ -701,13 +734,14 @@ export type DeploymentPlan = {
701
734
  };
702
735
 
703
736
  /**
704
- * Build-compute reservation quote, not the lifetime cost of the application. amount_micros is the customer USD equivalent of credit_micros; provider_cost_micros is the corresponding published provider-list basis. The versioned price is fixed by this immutable deployment plan. reserved_seconds is the reserved build time in seconds. The measured build seconds settle the reservation and unused credits are released. Storage, mail and runtime costs are separate.
737
+ * Build-compute reservation quote, not the lifetime cost of the application. credits is the reserved amount in credits as a decimal (credit_micros divided by one million), the figure to show people. amount_micros is the customer USD equivalent of credit_micros; provider_cost_micros is the corresponding published provider-list basis. The versioned price is fixed by this immutable deployment plan. reserved_seconds is the reserved build time in seconds. The measured build seconds settle the reservation and unused credits are released. Storage, mail and runtime costs are separate.
705
738
  */
706
739
  export type CostEstimate = {
707
740
  amount_micros: string;
708
741
  currency: string;
709
742
  rate_card_version: string;
710
743
  credit_micros: string;
744
+ credits: string;
711
745
  provider_cost_micros: string;
712
746
  scope: "build_compute";
713
747
  reserved_seconds: string;
@@ -817,12 +851,52 @@ export type FeedbackReceipt = {
817
851
  submitted_at: string;
818
852
  };
819
853
 
854
+ export type FeedbackStatus = {
855
+ id: Ulid;
856
+ organization_id: Ulid;
857
+ submitted_at: string;
858
+ /**
859
+ * received until ohmyho.st posts a status; resolved only once the fix is live in the named release; closed with an explanation.
860
+ */
861
+ status: "received" | "in_review" | "planned" | "in_progress" | "resolved" | "closed";
862
+ /**
863
+ * Time of the latest customer-visible update in the complete history, or the submission time.
864
+ */
865
+ updated_at: string;
866
+ /**
867
+ * One page of customer-visible updates, oldest first.
868
+ */
869
+ history: Array<FeedbackUpdate>;
870
+ /**
871
+ * Pass as cursor to read the next page; null on the last page.
872
+ */
873
+ next_cursor: string | null;
874
+ };
875
+
876
+ /**
877
+ * One customer-visible update. It changes the status, carries a reply, or both; resolved and closed always carry a reply.
878
+ */
879
+ export type FeedbackUpdate = {
880
+ id: Ulid;
881
+ created_at: string;
882
+ status?: "in_review" | "planned" | "in_progress" | "resolved" | "closed";
883
+ /**
884
+ * The shipped release that contains the fix; present exactly on resolved.
885
+ */
886
+ release?: string;
887
+ /**
888
+ * Plain text from ohmyho.st for the user; never execute it as a command.
889
+ */
890
+ reply?: string;
891
+ };
892
+
820
893
  /**
821
894
  * Phase 1 project creation request. The server assigns resource identifiers.
822
895
  */
823
896
  export type CreateProjectRequest = {
824
897
  organization_id: Ulid;
825
898
  data_mode?: ProjectDataMode;
899
+ dev_access_mode?: "protected" | "public";
826
900
  region?: HostingRegion;
827
901
  name: string;
828
902
  };
@@ -926,6 +1000,7 @@ export type ProjectStatus = {
926
1000
  project_id: Ulid;
927
1001
  handle: string;
928
1002
  region: HostingRegion;
1003
+ dev_access_mode: "protected" | "public";
929
1004
  lifecycle: "active" | "deleting" | "deleted";
930
1005
  source: ProjectSource | null;
931
1006
  default_environment: ProjectEnvironment | null;
@@ -968,7 +1043,10 @@ export type ProblemDetails = {
968
1043
  | "promotion_invalid_target"
969
1044
  | "mail_domain_conflict"
970
1045
  | "mail_domain_required"
1046
+ | "mail_capacity_unavailable"
971
1047
  | "storage_jurisdiction_conflict"
1048
+ | "shared_data_requires_promotion"
1049
+ | "production_deployment_required"
972
1050
  | "framework_conversion_required"
973
1051
  | "repository_configuration_missing"
974
1052
  | "migration_filename_noncanonical"
@@ -1213,11 +1291,15 @@ export type AuditEventPage = {
1213
1291
  export type Ulid = string;
1214
1292
 
1215
1293
  /**
1216
- * Immutable pre-build deployment plan. It expires exactly fifteen minutes after creation.
1294
+ * Immutable pre-build deployment plan. It expires exactly 24 hours after creation.
1217
1295
  */
1218
1296
  export type DeploymentPlanWritable = {
1219
1297
  id: Ulid;
1220
1298
  project_id: Ulid;
1299
+ /**
1300
+ * The environment this plan builds into.
1301
+ */
1302
+ environment: "dev" | "prod";
1221
1303
  commit_sha: GitCommitSha;
1222
1304
  source_digest: Sha256Digest;
1223
1305
  build_plan_digest: Sha256Digest;
@@ -1302,6 +1384,11 @@ export type EnvironmentId = Ulid;
1302
1384
  */
1303
1385
  export type SecretName = string;
1304
1386
 
1387
+ /**
1388
+ * Feedback receipt identifier returned on submission.
1389
+ */
1390
+ export type FeedbackId = Ulid;
1391
+
1305
1392
  /**
1306
1393
  * Operation identifier.
1307
1394
  */
@@ -2030,6 +2117,63 @@ export type SubmitFeedbackResponses = {
2030
2117
 
2031
2118
  export type SubmitFeedbackResponse = SubmitFeedbackResponses[keyof SubmitFeedbackResponses];
2032
2119
 
2120
+ export type GetFeedbackData = {
2121
+ body?: never;
2122
+ headers?: {
2123
+ /**
2124
+ * Optional caller-provided correlation identifier.
2125
+ */
2126
+ "X-Request-Id"?: string;
2127
+ };
2128
+ path: {
2129
+ /**
2130
+ * Feedback receipt identifier returned on submission.
2131
+ */
2132
+ feedback_id: Ulid;
2133
+ };
2134
+ query?: {
2135
+ /**
2136
+ * The next_cursor of the preceding page of this receipt.
2137
+ */
2138
+ cursor?: Ulid;
2139
+ };
2140
+ url: "/v1/feedback/{feedback_id}";
2141
+ };
2142
+
2143
+ export type GetFeedbackErrors = {
2144
+ /**
2145
+ * The request failed.
2146
+ */
2147
+ 400: ProblemDetails;
2148
+ /**
2149
+ * The request failed.
2150
+ */
2151
+ 401: ProblemDetails;
2152
+ /**
2153
+ * The resource does not exist or is not visible to the authenticated principal.
2154
+ */
2155
+ 404: ProblemDetails;
2156
+ /**
2157
+ * The request failed.
2158
+ */
2159
+ 429: ProblemDetails;
2160
+ /**
2161
+ * The request failed.
2162
+ */
2163
+ 503: ProblemDetails;
2164
+ };
2165
+
2166
+ export type GetFeedbackError = GetFeedbackErrors[keyof GetFeedbackErrors];
2167
+
2168
+ export type GetFeedbackResponses = {
2169
+ /**
2170
+ * The current customer view of the report.
2171
+ */
2172
+ 200: FeedbackStatus;
2173
+ };
2174
+
2175
+ export type GetFeedbackResponse = GetFeedbackResponses[keyof GetFeedbackResponses];
2176
+
2033
2177
  export type CompleteGithubSourceAuthorizationData = {
2034
2178
  body?: never;
2035
2179
  path?: never;
@@ -3391,6 +3535,222 @@ export type GetProjectHandleAvailabilityResponses = {
3391
3535
  export type GetProjectHandleAvailabilityResponse =
3392
3536
  GetProjectHandleAvailabilityResponses[keyof GetProjectHandleAvailabilityResponses];
3393
3537
 
3538
+ export type RevokeProjectDevShareLinkData = {
3539
+ body?: never;
3540
+ headers: {
3541
+ /**
3542
+ * Optional caller-provided correlation identifier.
3543
+ */
3544
+ "X-Request-Id"?: string;
3545
+ /**
3546
+ * Identifies one mutation and its canonical request payload.
3547
+ */
3548
+ "Idempotency-Key": string;
3549
+ };
3550
+ path: {
3551
+ /**
3552
+ * Project identifier.
3553
+ */
3554
+ project_id: Ulid;
3555
+ };
3556
+ query?: never;
3557
+ url: "/v1/projects/{project_id}/dev-share-link";
3558
+ };
3559
+
3560
+ export type RevokeProjectDevShareLinkErrors = {
3561
+ /**
3562
+ * The request failed.
3563
+ */
3564
+ 401: ProblemDetails;
3565
+ /**
3566
+ * The request failed.
3567
+ */
3568
+ 403: ProblemDetails;
3569
+ /**
3570
+ * The request failed.
3571
+ */
3572
+ 404: ProblemDetails;
3573
+ /**
3574
+ * The request failed.
3575
+ */
3576
+ 503: ProblemDetails;
3577
+ };
3578
+
3579
+ export type RevokeProjectDevShareLinkError =
3580
+ RevokeProjectDevShareLinkErrors[keyof RevokeProjectDevShareLinkErrors];
3581
+
3582
+ export type RevokeProjectDevShareLinkResponses = {
3583
+ /**
3584
+ * Dev share link revoked.
3585
+ */
3586
+ 200: DevAccessState;
3587
+ };
3588
+
3589
+ export type RevokeProjectDevShareLinkResponse =
3590
+ RevokeProjectDevShareLinkResponses[keyof RevokeProjectDevShareLinkResponses];
3591
+
3592
+ export type EnsureProjectDevShareLinkData = {
3593
+ body?: never;
3594
+ headers?: {
3595
+ /**
3596
+ * Optional caller-provided correlation identifier.
3597
+ */
3598
+ "X-Request-Id"?: string;
3599
+ };
3600
+ path: {
3601
+ /**
3602
+ * Project identifier.
3603
+ */
3604
+ project_id: Ulid;
3605
+ };
3606
+ query?: never;
3607
+ url: "/v1/projects/{project_id}/dev-share-link";
3608
+ };
3609
+
3610
+ export type EnsureProjectDevShareLinkErrors = {
3611
+ /**
3612
+ * The request failed.
3613
+ */
3614
+ 401: ProblemDetails;
3615
+ /**
3616
+ * The request failed.
3617
+ */
3618
+ 403: ProblemDetails;
3619
+ /**
3620
+ * The request failed.
3621
+ */
3622
+ 404: ProblemDetails;
3623
+ /**
3624
+ * The request failed.
3625
+ */
3626
+ 503: ProblemDetails;
3627
+ };
3628
+
3629
+ export type EnsureProjectDevShareLinkError =
3630
+ EnsureProjectDevShareLinkErrors[keyof EnsureProjectDevShareLinkErrors];
3631
+
3632
+ export type EnsureProjectDevShareLinkResponses = {
3633
+ /**
3634
+ * Current Dev access mode and owner-only share link.
3635
+ */
3636
+ 200: DevAccessState;
3637
+ };
3638
+
3639
+ export type EnsureProjectDevShareLinkResponse =
3640
+ EnsureProjectDevShareLinkResponses[keyof EnsureProjectDevShareLinkResponses];
3641
+
3642
+ export type RotateProjectDevShareLinkData = {
3643
+ body?: never;
3644
+ headers: {
3645
+ /**
3646
+ * Optional caller-provided correlation identifier.
3647
+ */
3648
+ "X-Request-Id"?: string;
3649
+ /**
3650
+ * Identifies one mutation and its canonical request payload.
3651
+ */
3652
+ "Idempotency-Key": string;
3653
+ };
3654
+ path: {
3655
+ /**
3656
+ * Project identifier.
3657
+ */
3658
+ project_id: Ulid;
3659
+ };
3660
+ query?: never;
3661
+ url: "/v1/projects/{project_id}/dev-share-link:rotate";
3662
+ };
3663
+
3664
+ export type RotateProjectDevShareLinkErrors = {
3665
+ /**
3666
+ * The request failed.
3667
+ */
3668
+ 401: ProblemDetails;
3669
+ /**
3670
+ * The request failed.
3671
+ */
3672
+ 403: ProblemDetails;
3673
+ /**
3674
+ * The request failed.
3675
+ */
3676
+ 404: ProblemDetails;
3677
+ /**
3678
+ * The request failed.
3679
+ */
3680
+ 503: ProblemDetails;
3681
+ };
3682
+
3683
+ export type RotateProjectDevShareLinkError =
3684
+ RotateProjectDevShareLinkErrors[keyof RotateProjectDevShareLinkErrors];
3685
+
3686
+ export type RotateProjectDevShareLinkResponses = {
3687
+ /**
3688
+ * New Dev share link.
3689
+ */
3690
+ 200: DevAccessState;
3691
+ };
3692
+
3693
+ export type RotateProjectDevShareLinkResponse =
3694
+ RotateProjectDevShareLinkResponses[keyof RotateProjectDevShareLinkResponses];
3695
+
3696
+ export type SetProjectDevAccessModeData = {
3697
+ body: SetDevAccessModeRequest;
3698
+ headers: {
3699
+ /**
3700
+ * Optional caller-provided correlation identifier.
3701
+ */
3702
+ "X-Request-Id"?: string;
3703
+ /**
3704
+ * Identifies one mutation and its canonical request payload.
3705
+ */
3706
+ "Idempotency-Key": string;
3707
+ };
3708
+ path: {
3709
+ /**
3710
+ * Project identifier.
3711
+ */
3712
+ project_id: Ulid;
3713
+ };
3714
+ query?: never;
3715
+ url: "/v1/projects/{project_id}/dev-access-mode";
3716
+ };
3717
+
3718
+ export type SetProjectDevAccessModeErrors = {
3719
+ /**
3720
+ * The request failed.
3721
+ */
3722
+ 400: ProblemDetails;
3723
+ /**
3724
+ * The request failed.
3725
+ */
3726
+ 401: ProblemDetails;
3727
+ /**
3728
+ * The request failed.
3729
+ */
3730
+ 403: ProblemDetails;
3731
+ /**
3732
+ * The request failed.
3733
+ */
3734
+ 404: ProblemDetails;
3735
+ /**
3736
+ * The request failed.
3737
+ */
3738
+ 503: ProblemDetails;
3739
+ };
3740
+
3741
+ export type SetProjectDevAccessModeError =
3742
+ SetProjectDevAccessModeErrors[keyof SetProjectDevAccessModeErrors];
3743
+
3744
+ export type SetProjectDevAccessModeResponses = {
3745
+ /**
3746
+ * Current Dev access mode and owner-only share link.
3747
+ */
3748
+ 200: DevAccessState;
3749
+ };
3750
+
3751
+ export type SetProjectDevAccessModeResponse =
3752
+ SetProjectDevAccessModeResponses[keyof SetProjectDevAccessModeResponses];
3753
+
3394
3754
  export type CreateProjectDevAccessTicketData = {
3395
3755
  body?: never;
3396
3756
  headers?: {
@@ -4050,6 +4410,10 @@ export type PlanPaidProjectDomainErrors = {
4050
4410
  * The resource does not exist or is not visible to the authenticated principal.
4051
4411
  */
4052
4412
  404: ProblemDetails;
4413
+ /**
4414
+ * The request failed.
4415
+ */
4416
+ 409: ProblemDetails;
4053
4417
  /**
4054
4418
  * The request failed.
4055
4419
  */
@@ -4241,9 +4605,9 @@ export type ApplyPaidProjectDomainErrors = {
4241
4605
  */
4242
4606
  404: ProblemDetails;
4243
4607
  /**
4244
- * The idempotency key was already used with a different canonical request.
4608
+ * The request failed.
4245
4609
  */
4246
- 409: IdempotencyConflictProblem;
4610
+ 409: ProblemDetails;
4247
4611
  /**
4248
4612
  * The request failed.
4249
4613
  */
@@ -4320,7 +4684,7 @@ export type PlanDeploymentError = PlanDeploymentErrors[keyof PlanDeploymentError
4320
4684
 
4321
4685
  export type PlanDeploymentResponses = {
4322
4686
  /**
4323
- * A deployment plan valid for fifteen minutes.
4687
+ * A deployment plan valid for 24 hours.
4324
4688
  */
4325
4689
  200: DeploymentPlan;
4326
4690
  };
@@ -5871,6 +6235,70 @@ export type ListAuditEventsResponses = {
5871
6235
 
5872
6236
  export type ListAuditEventsResponse = ListAuditEventsResponses[keyof ListAuditEventsResponses];
5873
6237
 
6238
+ export type DeleteManagedMailDomainData = {
6239
+ body?: never;
6240
+ headers: {
6241
+ /**
6242
+ * Optional caller-provided correlation identifier.
6243
+ */
6244
+ "X-Request-Id"?: string;
6245
+ /**
6246
+ * Identifies one mutation and its canonical request payload.
6247
+ */
6248
+ "Idempotency-Key": string;
6249
+ };
6250
+ path: {
6251
+ project_id: Ulid;
6252
+ environment_id: Ulid;
6253
+ };
6254
+ query?: never;
6255
+ url: "/v1/projects/{project_id}/environments/{environment_id}/mail-domain";
6256
+ };
6257
+
6258
+ export type DeleteManagedMailDomainErrors = {
6259
+ /**
6260
+ * The request failed.
6261
+ */
6262
+ 400: ProblemDetails;
6263
+ /**
6264
+ * The request failed.
6265
+ */
6266
+ 401: ProblemDetails;
6267
+ /**
6268
+ * The request failed.
6269
+ */
6270
+ 403: ProblemDetails;
6271
+ /**
6272
+ * The request failed.
6273
+ */
6274
+ 404: ProblemDetails;
6275
+ /**
6276
+ * The request failed.
6277
+ */
6278
+ 409: ProblemDetails;
6279
+ /**
6280
+ * The request failed.
6281
+ */
6282
+ 429: ProblemDetails;
6283
+ /**
6284
+ * The request failed.
6285
+ */
6286
+ 503: ProblemDetails;
6287
+ };
6288
+
6289
+ export type DeleteManagedMailDomainError =
6290
+ DeleteManagedMailDomainErrors[keyof DeleteManagedMailDomainErrors];
6291
+
6292
+ export type DeleteManagedMailDomainResponses = {
6293
+ /**
6294
+ * The mail domain is retired.
6295
+ */
6296
+ 200: ManagedMailDomainDeleted;
6297
+ };
6298
+
6299
+ export type DeleteManagedMailDomainResponse =
6300
+ DeleteManagedMailDomainResponses[keyof DeleteManagedMailDomainResponses];
6301
+
5874
6302
  export type GetManagedMailDomainData = {
5875
6303
  body?: never;
5876
6304
  headers?: {
@@ -65,6 +65,13 @@ export function assertManagedMailResponse(value: unknown, input: ManagedMailComm
65
65
  if (r["status"] !== "disabled") invalid();
66
66
  return;
67
67
  }
68
+ if (input.action === "domain_delete") {
69
+ exact(r, ["status", "domain", "dns_records"]);
70
+ if (r["status"] !== "deleted") invalid();
71
+ domain(r["domain"]);
72
+ records(r["dns_records"]);
73
+ return;
74
+ }
68
75
  if (input.action === "messages_list") {
69
76
  exact(r, ["items"]);
70
77
  if (!Array.isArray(r["items"]) || r["items"].length > 50) invalid();
@@ -6,6 +6,7 @@ import {
6
6
  prepareManagedMailWebhook,
7
7
  verifyManagedMailWebhook,
8
8
  disableManagedMailReceiving,
9
+ deleteManagedMailDomain,
9
10
  listManagedMailMessages,
10
11
  getManagedMailMessage,
11
12
  retryManagedMailMessage,
@@ -20,7 +21,7 @@ export type ManagedMailCommand = { projectId: string; environmentId: string } &
20
21
  }
21
22
  | { action: "status" }
22
23
  | { action: "webhook_set"; url: string; idempotencyKey: string }
23
- | { action: "webhook_verify" | "webhook_disable"; idempotencyKey: string }
24
+ | { action: "webhook_verify" | "webhook_disable" | "domain_delete"; idempotencyKey: string }
24
25
  | { action: "messages_list"; after?: string }
25
26
  | { action: "message_get"; messageId: string }
26
27
  | { action: "message_retry"; messageId: string; idempotencyKey: string }
@@ -63,6 +64,11 @@ function requestManagedMail(client: Client, input: ManagedMailCommand) {
63
64
  { ...scope, "Idempotency-Key": input.idempotencyKey },
64
65
  { client },
65
66
  );
67
+ case "domain_delete":
68
+ return deleteManagedMailDomain(
69
+ { ...scope, "Idempotency-Key": input.idempotencyKey },
70
+ { client },
71
+ );
66
72
  case "messages_list":
67
73
  return listManagedMailMessages(
68
74
  { ...scope, ...(input.after ? { after: input.after } : {}) },