@amerged/ohmyhost-sdk 0.1.40 → 0.1.42

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.
@@ -321,15 +321,12 @@ export type OrganizationCredits = {
321
321
  as_of: string;
322
322
  available_micros: CreditMicros;
323
323
  reserved_micros: CreditMicros;
324
- spent_micros: CreditMicros;
325
- expired_micros: CreditMicros;
326
- platform_overrun_micros: CreditMicros;
327
324
  /**
328
- * First confirmed exhaustion in this continuous period; null while funded.
325
+ * When the credit was used up; null while funded or after the monthly credit renewed.
329
326
  */
330
327
  grace_started_at: string | null;
331
328
  /**
332
- * Seven days after first confirmed exhaustion. Existing services and domains are retained during this grace; no automatic data deletion. Explicit project stop budgets are separate.
329
+ * Seven days after the credit was used up. Existing services and domains are retained during this grace; no automatic data deletion. Explicit project stop budgets are separate.
333
330
  */
334
331
  grace_expires_at: string | null;
335
332
  active_meters: Array<string>;
@@ -346,22 +343,38 @@ export type UsageTotal = string;
346
343
 
347
344
  export type OrganizationCreditUsage = {
348
345
  organization_id: Ulid;
349
- month: string;
350
346
  as_of: string;
351
347
  unit: "microcredits";
352
- next_cursor: Ulid | null;
353
- data: Array<{
348
+ /**
349
+ * The UTC month that projects[].used_micros counts.
350
+ */
351
+ period: string;
352
+ /**
353
+ * The start of the oldest UTC day in days.
354
+ */
355
+ from: string;
356
+ /**
357
+ * What each project has used so far in period, in ID order; projects without use are left out.
358
+ */
359
+ projects: Array<{
354
360
  project_id: Ulid;
355
- reserved_micros: UsageTotal;
356
- meters: Array<{
357
- environment_id: Ulid | null;
358
- meter: string;
359
- unit: string;
360
- rate_card_id: string;
361
- quantity: UsageTotal;
362
- charged_micros: UsageTotal;
363
- funded_micros: UsageTotal;
364
- platform_overrun_micros: UsageTotal;
361
+ used_micros: UsageTotal;
362
+ }>;
363
+ /**
364
+ * Billed charges of the last up to 14 UTC days, oldest first.
365
+ */
366
+ days: Array<{
367
+ day: string;
368
+ projects: Array<{
369
+ project_id: Ulid;
370
+ meters: Array<{
371
+ environment_id: Ulid | null;
372
+ meter: string;
373
+ unit: string;
374
+ rate_card_id: string;
375
+ quantity: string;
376
+ charged_micros: UsageTotal;
377
+ }>;
365
378
  }>;
366
379
  }>;
367
380
  };
@@ -384,6 +397,9 @@ export type PublishedCreditRateCard = {
384
397
  };
385
398
 
386
399
  export type SetProjectCreditBudgetRequest = {
400
+ /**
401
+ * The monthly budget, at most 9007199254740991 microcredits (about 9 billion credits); null removes it.
402
+ */
387
403
  amount_micros: CreditMicros | null;
388
404
  mode: "continue" | "stop";
389
405
  };
@@ -894,29 +910,22 @@ export type ProjectDatabaseAccessRequest = {
894
910
  label?: string | null;
895
911
  };
896
912
 
897
- export type ProjectDatabaseAccess = (
898
- | {
899
- database?: "neondb";
900
- }
901
- | {
902
- database?: unknown;
903
- }
904
- ) & {
913
+ export type ProjectDatabaseAccess = {
905
914
  access_id: Ulid;
906
915
  environment: "dev" | "prod";
907
916
  mode: "read" | "write";
908
917
  role_name: string;
909
918
  host: string;
910
919
  /**
911
- * neondb for a transitional Neon credential; the exact 20-character PGCF database identity for WSS.
920
+ * The exact 20-character PGCF database identity for WSS.
912
921
  */
913
922
  database: string;
914
- provider?: "pgcf";
915
- transport?: "wss";
923
+ provider: "pgcf";
924
+ transport: "wss";
916
925
  /**
917
926
  * Verified WSS origin ending in / and matching host. The local bridge adds /v2 and the bound database and user; no public PostgreSQL TCP endpoint.
918
927
  */
919
- websocket_url?: string;
928
+ websocket_url: string;
920
929
  label: string | null;
921
930
  state: "active" | "expired" | "revoked";
922
931
  issued_at: string;
@@ -925,29 +934,22 @@ export type ProjectDatabaseAccess = (
925
934
  revocation_reason: "principal" | "expired" | "budget" | "creation_failed" | "data_change" | null;
926
935
  };
927
936
 
928
- export type ProjectDatabaseAccessCredential = (
929
- | {
930
- database?: "neondb";
931
- }
932
- | {
933
- database?: unknown;
934
- }
935
- ) & {
937
+ export type ProjectDatabaseAccessCredential = {
936
938
  access_id: Ulid;
937
939
  environment: "dev" | "prod";
938
940
  mode: "read" | "write";
939
941
  role_name: string;
940
942
  host: string;
941
943
  /**
942
- * neondb for a transitional Neon credential; the exact 20-character PGCF database identity for WSS.
944
+ * The exact 20-character PGCF database identity for WSS.
943
945
  */
944
946
  database: string;
945
- provider?: "pgcf";
946
- transport?: "wss";
947
+ provider: "pgcf";
948
+ transport: "wss";
947
949
  /**
948
950
  * Verified WSS origin ending in / and matching host. The local bridge adds /v2 and the bound database and user; no public PostgreSQL TCP endpoint.
949
951
  */
950
- websocket_url?: string;
952
+ websocket_url: string;
951
953
  label: string | null;
952
954
  state: "active" | "expired" | "revoked";
953
955
  issued_at: string;
@@ -959,7 +961,7 @@ export type ProjectDatabaseAccessCredential = (
959
961
  */
960
962
  connection_uri: string;
961
963
  /**
962
- * For PGCF, a secret-free ohmyhost database psql invocation that obtains and revokes its own session credential. Transitional Neon responses retain their original direct invocation.
964
+ * For PGCF, a secret-free ohmyhost database psql invocation that obtains and revokes its own session credential.
963
965
  */
964
966
  psql_command: string;
965
967
  };
@@ -968,6 +970,201 @@ export type ProjectDatabaseAccessPage = {
968
970
  items: Array<ProjectDatabaseAccess>;
969
971
  };
970
972
 
973
+ export type DatabaseWebhookEventType =
974
+ | "database.created"
975
+ | "database.ready"
976
+ | "database.woke"
977
+ | "database.slept"
978
+ | "database.suspended"
979
+ | "database.resized"
980
+ | "database.deleted";
981
+
982
+ export type DatabaseWebhookCreateRequest = {
983
+ /**
984
+ * HTTPS receiver URL.
985
+ */
986
+ url: string;
987
+ event_types: Array<DatabaseWebhookEventType>;
988
+ /**
989
+ * Extra headers sent with every delivery. Names are case-insensitive and must be unique; content-type, host, content-length, connection, transfer-encoding, user-agent, te, upgrade, expect and any name starting with pgcf-, cf- or x-forwarded- are refused.
990
+ */
991
+ headers?: {
992
+ [key: string]: string;
993
+ };
994
+ };
995
+
996
+ export type DatabaseWebhook = {
997
+ id: string;
998
+ environment: "dev" | "prod";
999
+ url: string;
1000
+ event_types: Array<DatabaseWebhookEventType>;
1001
+ /**
1002
+ * Names of the extra headers only; their values are never returned.
1003
+ */
1004
+ header_names: Array<string>;
1005
+ created_at: string;
1006
+ };
1007
+
1008
+ export type DatabaseWebhookCreated = {
1009
+ id: string;
1010
+ environment: "dev" | "prod";
1011
+ url: string;
1012
+ event_types: Array<DatabaseWebhookEventType>;
1013
+ header_names: Array<string>;
1014
+ created_at: string;
1015
+ /**
1016
+ * Signing secret, returned only by this creation answer.
1017
+ */
1018
+ secret: string;
1019
+ };
1020
+
1021
+ export type DatabaseWebhookPage = {
1022
+ items: Array<DatabaseWebhook>;
1023
+ };
1024
+
1025
+ export type DatabaseWebhookDeleted = {
1026
+ id: string;
1027
+ deleted: true;
1028
+ };
1029
+
1030
+ export type DatabaseWebhookDelivery = {
1031
+ id: string;
1032
+ event_id: string;
1033
+ event_type: DatabaseWebhookEventType;
1034
+ webhook_id: string;
1035
+ state: "pending" | "delivered" | "dead_lettered";
1036
+ attempts: number;
1037
+ created_at: string;
1038
+ next_attempt_at: string | null;
1039
+ delivered_at: string | null;
1040
+ last_status: number | null;
1041
+ last_error: "timeout" | "network" | "http" | "expired" | "permanent" | null;
1042
+ };
1043
+
1044
+ export type DatabaseWebhookDeliveryPage = {
1045
+ items: Array<DatabaseWebhookDelivery>;
1046
+ next_cursor: string | null;
1047
+ };
1048
+
1049
+ export type DatabaseWebhookTestResult = {
1050
+ delivered: boolean;
1051
+ status: number | null;
1052
+ error: "timeout" | "network" | "http" | null;
1053
+ duration_ms: number;
1054
+ };
1055
+
1056
+ export type DatabaseWebhookReplayAccepted = {
1057
+ delivery_id: string;
1058
+ state: "pending";
1059
+ };
1060
+
1061
+ export type DatabaseScheduleSetRequest = unknown & {
1062
+ /**
1063
+ * Five-field cron expression evaluated in UTC. Send exactly one of cron or every_seconds.
1064
+ */
1065
+ cron?: string;
1066
+ /**
1067
+ * Interval in seconds between runs. Send exactly one of cron or every_seconds.
1068
+ */
1069
+ every_seconds?: number;
1070
+ /**
1071
+ * Statements run in order by the application's runtime role. At most 16 KiB per statement and 64 KiB in total.
1072
+ */
1073
+ statements: Array<string>;
1074
+ timeout_ms?: number;
1075
+ enabled?: boolean;
1076
+ /**
1077
+ * Confirms that the statements run with the application's runtime role.
1078
+ */
1079
+ confirm: true;
1080
+ };
1081
+
1082
+ export type DatabaseSchedule = (
1083
+ | {
1084
+ cron?: string;
1085
+ every_seconds?: null;
1086
+ }
1087
+ | {
1088
+ cron?: null;
1089
+ every_seconds?: number;
1090
+ }
1091
+ ) & {
1092
+ name: string;
1093
+ environment: "dev" | "prod";
1094
+ cron: string | null;
1095
+ every_seconds: number | null;
1096
+ statements: Array<string>;
1097
+ timeout_ms: number;
1098
+ enabled: boolean;
1099
+ next_run_at: string | null;
1100
+ created_at: string;
1101
+ };
1102
+
1103
+ export type DatabaseSchedulePage = {
1104
+ items: Array<DatabaseSchedule>;
1105
+ };
1106
+
1107
+ export type DatabaseScheduleDeleted = {
1108
+ name: string;
1109
+ deleted: true;
1110
+ };
1111
+
1112
+ export type DatabaseScheduleRun = {
1113
+ id: number;
1114
+ schedule: string;
1115
+ scheduled_at: string;
1116
+ started_at: string | null;
1117
+ finished_at: string;
1118
+ outcome:
1119
+ | "succeeded"
1120
+ | "failed"
1121
+ | "timed_out"
1122
+ | "outcome_unknown"
1123
+ | "rejected"
1124
+ | "skipped_capacity"
1125
+ | "skipped_suspended"
1126
+ | "skipped_deleted"
1127
+ | "skipped_missed";
1128
+ sqlstate: string | null;
1129
+ attempts: number;
1130
+ manual: boolean;
1131
+ };
1132
+
1133
+ export type DatabaseScheduleRunPage = {
1134
+ items: Array<DatabaseScheduleRun>;
1135
+ };
1136
+
1137
+ export type DatabaseScheduleRunAccepted = {
1138
+ schedule: string;
1139
+ state: "queued";
1140
+ };
1141
+
1142
+ export type DatabaseExecutionMetrics = {
1143
+ schedule_runs_succeeded: number;
1144
+ schedule_runs_failed: number;
1145
+ schedule_runs_timed_out: number;
1146
+ schedule_runs_outcome_unknown: number;
1147
+ schedule_runs_rejected: number;
1148
+ schedule_runs_skipped: number;
1149
+ events_emitted: number;
1150
+ event_bytes: number;
1151
+ webhook_attempts: number;
1152
+ webhook_deliveries_delivered: number;
1153
+ webhook_deliveries_dead_lettered: number;
1154
+ };
1155
+
1156
+ export type DatabaseExecutionUsageRow = {
1157
+ start: string;
1158
+ end: string;
1159
+ final: boolean;
1160
+ metrics: DatabaseExecutionMetrics;
1161
+ };
1162
+
1163
+ export type DatabaseExecutionUsagePage = {
1164
+ items: Array<DatabaseExecutionUsageRow>;
1165
+ next_cursor: string | null;
1166
+ };
1167
+
971
1168
  export type SetDevAccessModeRequest = {
972
1169
  mode: "protected" | "public";
973
1170
  };
@@ -1264,13 +1461,28 @@ export type OrganizationAccount = {
1264
1461
  plan: "free" | "paid";
1265
1462
  plan_source: "free" | "stripe" | "granted" | "manual";
1266
1463
  /**
1267
- * End of the paid Stripe billing period or the applicable grant; null on Free or for an unbounded grant. During an unpaid renewal the effective Paid plan may remain available for up to 14 days after this Stripe period end, without new monthly credits.
1464
+ * End of the paid coverage: the Stripe billing period plus its 14-day renewal grace, or the end of the grant; null on Free. Paid features stay available until this instant.
1268
1465
  */
1269
1466
  paid_until: string | null;
1467
+ /**
1468
+ * Spendable credit: monthly plus one-time credit minus the open reservations, never below zero.
1469
+ */
1270
1470
  available_micros: CreditMicros;
1471
+ /**
1472
+ * The monthly credit, which ends at next_expiry; the Free allowance is 200 credits and the Paid allowance 1000 credits per period.
1473
+ */
1271
1474
  monthly_micros: CreditMicros;
1475
+ /**
1476
+ * Top-up, bonus and referral credit. It does not expire.
1477
+ */
1272
1478
  one_time_micros: CreditMicros;
1479
+ /**
1480
+ * Credit held for open builds; it is part of the monthly and one-time credit until the build settles.
1481
+ */
1273
1482
  reserved_micros: CreditMicros;
1483
+ /**
1484
+ * When the monthly credit ends and renews; null when none is left.
1485
+ */
1274
1486
  next_expiry: string | null;
1275
1487
  as_of: string;
1276
1488
  };
@@ -1411,6 +1623,10 @@ export type ProblemDetails = {
1411
1623
  | "compute_performance_unavailable"
1412
1624
  | "database_write_pending"
1413
1625
  | "database_access_limit"
1626
+ | "database_webhook_limit"
1627
+ | "database_schedule_limit"
1628
+ | "database_schedule_not_runnable"
1629
+ | "database_webhook_delivery_pending"
1414
1630
  | "compute_change_pending"
1415
1631
  | "compute_change_conflict"
1416
1632
  | "billing_purchase_conflict"
@@ -1785,11 +2001,36 @@ export type ProjectId = Ulid;
1785
2001
  */
1786
2002
  export type DatabaseAccessId = Ulid;
1787
2003
 
2004
+ /**
2005
+ * Application environment to read; dev when omitted.
2006
+ */
2007
+ export type DatabaseEnvironmentRead = "dev" | "prod";
2008
+
1788
2009
  /**
1789
2010
  * Restrict the listing to one application environment.
1790
2011
  */
1791
2012
  export type DatabaseEnvironmentFilter = "dev" | "prod";
1792
2013
 
2014
+ /**
2015
+ * Application environment the mutation applies to.
2016
+ */
2017
+ export type DatabaseEnvironment = "dev" | "prod";
2018
+
2019
+ /**
2020
+ * Database webhook identifier.
2021
+ */
2022
+ export type DatabaseWebhookId = string;
2023
+
2024
+ /**
2025
+ * Database webhook delivery identifier.
2026
+ */
2027
+ export type DatabaseWebhookDeliveryId = string;
2028
+
2029
+ /**
2030
+ * Database schedule name, unique per project environment.
2031
+ */
2032
+ export type DatabaseScheduleName = string;
2033
+
1793
2034
  /**
1794
2035
  * Opaque continuation cursor returned by the preceding project page.
1795
2036
  */
@@ -4396,10 +4637,7 @@ export type GetOrganizationCreditUsageData = {
4396
4637
  path: {
4397
4638
  organization_id: Ulid;
4398
4639
  };
4399
- query: {
4400
- month: string;
4401
- cursor?: Ulid;
4402
- };
4640
+ query?: never;
4403
4641
  url: "/v1/organizations/{organization_id}/credit-usage";
4404
4642
  };
4405
4643
 
@@ -4431,7 +4669,7 @@ export type GetOrganizationCreditUsageError =
4431
4669
 
4432
4670
  export type GetOrganizationCreditUsageResponses = {
4433
4671
  /**
4434
- * Current posted usage for the selected UTC month and project page.
4672
+ * Recent billed usage of the organization.
4435
4673
  */
4436
4674
  200: OrganizationCreditUsage;
4437
4675
  };
@@ -7900,6 +8138,924 @@ export type RevokeProjectDatabaseAccessResponses = {
7900
8138
  export type RevokeProjectDatabaseAccessResponse =
7901
8139
  RevokeProjectDatabaseAccessResponses[keyof RevokeProjectDatabaseAccessResponses];
7902
8140
 
8141
+ export type ListProjectDatabaseWebhooksData = {
8142
+ body?: never;
8143
+ headers?: {
8144
+ /**
8145
+ * Optional caller-provided correlation identifier.
8146
+ */
8147
+ "X-Request-Id"?: string;
8148
+ };
8149
+ path: {
8150
+ /**
8151
+ * Project identifier.
8152
+ */
8153
+ project_id: Ulid;
8154
+ };
8155
+ query?: {
8156
+ /**
8157
+ * Application environment to read; dev when omitted.
8158
+ */
8159
+ environment?: "dev" | "prod";
8160
+ };
8161
+ url: "/v1/projects/{project_id}/database/webhooks";
8162
+ };
8163
+
8164
+ export type ListProjectDatabaseWebhooksErrors = {
8165
+ /**
8166
+ * The request failed.
8167
+ */
8168
+ 400: ProblemDetails;
8169
+ /**
8170
+ * The request failed.
8171
+ */
8172
+ 401: ProblemDetails;
8173
+ /**
8174
+ * The resource does not exist or is not visible to the authenticated principal.
8175
+ */
8176
+ 404: ProblemDetails;
8177
+ /**
8178
+ * The request failed.
8179
+ */
8180
+ 429: ProblemDetails;
8181
+ /**
8182
+ * The request failed.
8183
+ */
8184
+ 503: ProblemDetails;
8185
+ };
8186
+
8187
+ export type ListProjectDatabaseWebhooksError =
8188
+ ListProjectDatabaseWebhooksErrors[keyof ListProjectDatabaseWebhooksErrors];
8189
+
8190
+ export type ListProjectDatabaseWebhooksResponses = {
8191
+ /**
8192
+ * The database webhooks of the environment.
8193
+ */
8194
+ 200: DatabaseWebhookPage;
8195
+ };
8196
+
8197
+ export type ListProjectDatabaseWebhooksResponse =
8198
+ ListProjectDatabaseWebhooksResponses[keyof ListProjectDatabaseWebhooksResponses];
8199
+
8200
+ export type CreateProjectDatabaseWebhookData = {
8201
+ body: DatabaseWebhookCreateRequest;
8202
+ headers: {
8203
+ /**
8204
+ * Optional caller-provided correlation identifier.
8205
+ */
8206
+ "X-Request-Id"?: string;
8207
+ /**
8208
+ * Identifies one mutation and its canonical request payload.
8209
+ */
8210
+ "Idempotency-Key": string;
8211
+ };
8212
+ path: {
8213
+ /**
8214
+ * Project identifier.
8215
+ */
8216
+ project_id: Ulid;
8217
+ };
8218
+ query: {
8219
+ /**
8220
+ * Application environment the mutation applies to.
8221
+ */
8222
+ environment: "dev" | "prod";
8223
+ };
8224
+ url: "/v1/projects/{project_id}/database/webhooks";
8225
+ };
8226
+
8227
+ export type CreateProjectDatabaseWebhookErrors = {
8228
+ /**
8229
+ * The request failed.
8230
+ */
8231
+ 400: ProblemDetails;
8232
+ /**
8233
+ * The request failed.
8234
+ */
8235
+ 401: ProblemDetails;
8236
+ /**
8237
+ * The resource does not exist or is not visible to the authenticated principal.
8238
+ */
8239
+ 404: ProblemDetails;
8240
+ /**
8241
+ * The request failed.
8242
+ */
8243
+ 409: ProblemDetails;
8244
+ /**
8245
+ * The request failed.
8246
+ */
8247
+ 429: ProblemDetails;
8248
+ /**
8249
+ * The request failed.
8250
+ */
8251
+ 503: ProblemDetails;
8252
+ };
8253
+
8254
+ export type CreateProjectDatabaseWebhookError =
8255
+ CreateProjectDatabaseWebhookErrors[keyof CreateProjectDatabaseWebhookErrors];
8256
+
8257
+ export type CreateProjectDatabaseWebhookResponses = {
8258
+ /**
8259
+ * The webhook with its signing secret, returned once and never persisted in plaintext.
8260
+ */
8261
+ 201: DatabaseWebhookCreated;
8262
+ };
8263
+
8264
+ export type CreateProjectDatabaseWebhookResponse =
8265
+ CreateProjectDatabaseWebhookResponses[keyof CreateProjectDatabaseWebhookResponses];
8266
+
8267
+ export type DeleteProjectDatabaseWebhookData = {
8268
+ body?: never;
8269
+ headers?: {
8270
+ /**
8271
+ * Optional caller-provided correlation identifier.
8272
+ */
8273
+ "X-Request-Id"?: string;
8274
+ };
8275
+ path: {
8276
+ /**
8277
+ * Project identifier.
8278
+ */
8279
+ project_id: Ulid;
8280
+ /**
8281
+ * Database webhook identifier.
8282
+ */
8283
+ webhook_id: string;
8284
+ };
8285
+ query: {
8286
+ /**
8287
+ * Application environment the mutation applies to.
8288
+ */
8289
+ environment: "dev" | "prod";
8290
+ };
8291
+ url: "/v1/projects/{project_id}/database/webhooks/{webhook_id}";
8292
+ };
8293
+
8294
+ export type DeleteProjectDatabaseWebhookErrors = {
8295
+ /**
8296
+ * The request failed.
8297
+ */
8298
+ 400: ProblemDetails;
8299
+ /**
8300
+ * The request failed.
8301
+ */
8302
+ 401: ProblemDetails;
8303
+ /**
8304
+ * The resource does not exist or is not visible to the authenticated principal.
8305
+ */
8306
+ 404: ProblemDetails;
8307
+ /**
8308
+ * The request failed.
8309
+ */
8310
+ 429: ProblemDetails;
8311
+ /**
8312
+ * The request failed.
8313
+ */
8314
+ 503: ProblemDetails;
8315
+ };
8316
+
8317
+ export type DeleteProjectDatabaseWebhookError =
8318
+ DeleteProjectDatabaseWebhookErrors[keyof DeleteProjectDatabaseWebhookErrors];
8319
+
8320
+ export type DeleteProjectDatabaseWebhookResponses = {
8321
+ /**
8322
+ * The identifier of the deleted webhook.
8323
+ */
8324
+ 200: DatabaseWebhookDeleted;
8325
+ };
8326
+
8327
+ export type DeleteProjectDatabaseWebhookResponse =
8328
+ DeleteProjectDatabaseWebhookResponses[keyof DeleteProjectDatabaseWebhookResponses];
8329
+
8330
+ export type GetProjectDatabaseWebhookData = {
8331
+ body?: never;
8332
+ headers?: {
8333
+ /**
8334
+ * Optional caller-provided correlation identifier.
8335
+ */
8336
+ "X-Request-Id"?: string;
8337
+ };
8338
+ path: {
8339
+ /**
8340
+ * Project identifier.
8341
+ */
8342
+ project_id: Ulid;
8343
+ /**
8344
+ * Database webhook identifier.
8345
+ */
8346
+ webhook_id: string;
8347
+ };
8348
+ query?: {
8349
+ /**
8350
+ * Application environment to read; dev when omitted.
8351
+ */
8352
+ environment?: "dev" | "prod";
8353
+ };
8354
+ url: "/v1/projects/{project_id}/database/webhooks/{webhook_id}";
8355
+ };
8356
+
8357
+ export type GetProjectDatabaseWebhookErrors = {
8358
+ /**
8359
+ * The request failed.
8360
+ */
8361
+ 400: ProblemDetails;
8362
+ /**
8363
+ * The request failed.
8364
+ */
8365
+ 401: ProblemDetails;
8366
+ /**
8367
+ * The resource does not exist or is not visible to the authenticated principal.
8368
+ */
8369
+ 404: ProblemDetails;
8370
+ /**
8371
+ * The request failed.
8372
+ */
8373
+ 429: ProblemDetails;
8374
+ /**
8375
+ * The request failed.
8376
+ */
8377
+ 503: ProblemDetails;
8378
+ };
8379
+
8380
+ export type GetProjectDatabaseWebhookError =
8381
+ GetProjectDatabaseWebhookErrors[keyof GetProjectDatabaseWebhookErrors];
8382
+
8383
+ export type GetProjectDatabaseWebhookResponses = {
8384
+ /**
8385
+ * The database webhook.
8386
+ */
8387
+ 200: DatabaseWebhook;
8388
+ };
8389
+
8390
+ export type GetProjectDatabaseWebhookResponse =
8391
+ GetProjectDatabaseWebhookResponses[keyof GetProjectDatabaseWebhookResponses];
8392
+
8393
+ export type TestProjectDatabaseWebhookData = {
8394
+ body?: never;
8395
+ headers?: {
8396
+ /**
8397
+ * Optional caller-provided correlation identifier.
8398
+ */
8399
+ "X-Request-Id"?: string;
8400
+ };
8401
+ path: {
8402
+ /**
8403
+ * Project identifier.
8404
+ */
8405
+ project_id: Ulid;
8406
+ /**
8407
+ * Database webhook identifier.
8408
+ */
8409
+ webhook_id: string;
8410
+ };
8411
+ query: {
8412
+ /**
8413
+ * Application environment the mutation applies to.
8414
+ */
8415
+ environment: "dev" | "prod";
8416
+ };
8417
+ url: "/v1/projects/{project_id}/database/webhooks/{webhook_id}/test";
8418
+ };
8419
+
8420
+ export type TestProjectDatabaseWebhookErrors = {
8421
+ /**
8422
+ * The request failed.
8423
+ */
8424
+ 400: ProblemDetails;
8425
+ /**
8426
+ * The request failed.
8427
+ */
8428
+ 401: ProblemDetails;
8429
+ /**
8430
+ * The resource does not exist or is not visible to the authenticated principal.
8431
+ */
8432
+ 404: ProblemDetails;
8433
+ /**
8434
+ * The request failed.
8435
+ */
8436
+ 429: ProblemDetails;
8437
+ /**
8438
+ * The request failed.
8439
+ */
8440
+ 503: ProblemDetails;
8441
+ };
8442
+
8443
+ export type TestProjectDatabaseWebhookError =
8444
+ TestProjectDatabaseWebhookErrors[keyof TestProjectDatabaseWebhookErrors];
8445
+
8446
+ export type TestProjectDatabaseWebhookResponses = {
8447
+ /**
8448
+ * The outcome of the test request.
8449
+ */
8450
+ 200: DatabaseWebhookTestResult;
8451
+ };
8452
+
8453
+ export type TestProjectDatabaseWebhookResponse =
8454
+ TestProjectDatabaseWebhookResponses[keyof TestProjectDatabaseWebhookResponses];
8455
+
8456
+ export type ListProjectDatabaseWebhookDeliveriesData = {
8457
+ body?: never;
8458
+ headers?: {
8459
+ /**
8460
+ * Optional caller-provided correlation identifier.
8461
+ */
8462
+ "X-Request-Id"?: string;
8463
+ };
8464
+ path: {
8465
+ /**
8466
+ * Project identifier.
8467
+ */
8468
+ project_id: Ulid;
8469
+ };
8470
+ query?: {
8471
+ /**
8472
+ * Application environment to read; dev when omitted.
8473
+ */
8474
+ environment?: "dev" | "prod";
8475
+ /**
8476
+ * Restrict the listing to the deliveries of one webhook.
8477
+ */
8478
+ webhook_id?: string;
8479
+ /**
8480
+ * Maximum number of deliveries in this page.
8481
+ */
8482
+ limit?: number;
8483
+ /**
8484
+ * Opaque cursor returned by the previous page.
8485
+ */
8486
+ cursor?: string;
8487
+ };
8488
+ url: "/v1/projects/{project_id}/database/webhook-deliveries";
8489
+ };
8490
+
8491
+ export type ListProjectDatabaseWebhookDeliveriesErrors = {
8492
+ /**
8493
+ * The request failed.
8494
+ */
8495
+ 400: ProblemDetails;
8496
+ /**
8497
+ * The request failed.
8498
+ */
8499
+ 401: ProblemDetails;
8500
+ /**
8501
+ * The resource does not exist or is not visible to the authenticated principal.
8502
+ */
8503
+ 404: ProblemDetails;
8504
+ /**
8505
+ * The request failed.
8506
+ */
8507
+ 429: ProblemDetails;
8508
+ /**
8509
+ * The request failed.
8510
+ */
8511
+ 503: ProblemDetails;
8512
+ };
8513
+
8514
+ export type ListProjectDatabaseWebhookDeliveriesError =
8515
+ ListProjectDatabaseWebhookDeliveriesErrors[keyof ListProjectDatabaseWebhookDeliveriesErrors];
8516
+
8517
+ export type ListProjectDatabaseWebhookDeliveriesResponses = {
8518
+ /**
8519
+ * One page of database webhook deliveries.
8520
+ */
8521
+ 200: DatabaseWebhookDeliveryPage;
8522
+ };
8523
+
8524
+ export type ListProjectDatabaseWebhookDeliveriesResponse =
8525
+ ListProjectDatabaseWebhookDeliveriesResponses[keyof ListProjectDatabaseWebhookDeliveriesResponses];
8526
+
8527
+ export type ReplayProjectDatabaseWebhookDeliveryData = {
8528
+ body?: never;
8529
+ headers?: {
8530
+ /**
8531
+ * Optional caller-provided correlation identifier.
8532
+ */
8533
+ "X-Request-Id"?: string;
8534
+ };
8535
+ path: {
8536
+ /**
8537
+ * Project identifier.
8538
+ */
8539
+ project_id: Ulid;
8540
+ /**
8541
+ * Database webhook delivery identifier.
8542
+ */
8543
+ delivery_id: string;
8544
+ };
8545
+ query: {
8546
+ /**
8547
+ * Application environment the mutation applies to.
8548
+ */
8549
+ environment: "dev" | "prod";
8550
+ };
8551
+ url: "/v1/projects/{project_id}/database/webhook-deliveries/{delivery_id}/replay";
8552
+ };
8553
+
8554
+ export type ReplayProjectDatabaseWebhookDeliveryErrors = {
8555
+ /**
8556
+ * The request failed.
8557
+ */
8558
+ 400: ProblemDetails;
8559
+ /**
8560
+ * The request failed.
8561
+ */
8562
+ 401: ProblemDetails;
8563
+ /**
8564
+ * The resource does not exist or is not visible to the authenticated principal.
8565
+ */
8566
+ 404: ProblemDetails;
8567
+ /**
8568
+ * The request failed.
8569
+ */
8570
+ 409: ProblemDetails;
8571
+ /**
8572
+ * The request failed.
8573
+ */
8574
+ 429: ProblemDetails;
8575
+ /**
8576
+ * The request failed.
8577
+ */
8578
+ 503: ProblemDetails;
8579
+ };
8580
+
8581
+ export type ReplayProjectDatabaseWebhookDeliveryError =
8582
+ ReplayProjectDatabaseWebhookDeliveryErrors[keyof ReplayProjectDatabaseWebhookDeliveryErrors];
8583
+
8584
+ export type ReplayProjectDatabaseWebhookDeliveryResponses = {
8585
+ /**
8586
+ * The delivery was queued for another attempt.
8587
+ */
8588
+ 202: DatabaseWebhookReplayAccepted;
8589
+ };
8590
+
8591
+ export type ReplayProjectDatabaseWebhookDeliveryResponse =
8592
+ ReplayProjectDatabaseWebhookDeliveryResponses[keyof ReplayProjectDatabaseWebhookDeliveryResponses];
8593
+
8594
+ export type ListProjectDatabaseSchedulesData = {
8595
+ body?: never;
8596
+ headers?: {
8597
+ /**
8598
+ * Optional caller-provided correlation identifier.
8599
+ */
8600
+ "X-Request-Id"?: string;
8601
+ };
8602
+ path: {
8603
+ /**
8604
+ * Project identifier.
8605
+ */
8606
+ project_id: Ulid;
8607
+ };
8608
+ query?: {
8609
+ /**
8610
+ * Application environment to read; dev when omitted.
8611
+ */
8612
+ environment?: "dev" | "prod";
8613
+ };
8614
+ url: "/v1/projects/{project_id}/database/schedules";
8615
+ };
8616
+
8617
+ export type ListProjectDatabaseSchedulesErrors = {
8618
+ /**
8619
+ * The request failed.
8620
+ */
8621
+ 400: ProblemDetails;
8622
+ /**
8623
+ * The request failed.
8624
+ */
8625
+ 401: ProblemDetails;
8626
+ /**
8627
+ * The resource does not exist or is not visible to the authenticated principal.
8628
+ */
8629
+ 404: ProblemDetails;
8630
+ /**
8631
+ * The request failed.
8632
+ */
8633
+ 429: ProblemDetails;
8634
+ /**
8635
+ * The request failed.
8636
+ */
8637
+ 503: ProblemDetails;
8638
+ };
8639
+
8640
+ export type ListProjectDatabaseSchedulesError =
8641
+ ListProjectDatabaseSchedulesErrors[keyof ListProjectDatabaseSchedulesErrors];
8642
+
8643
+ export type ListProjectDatabaseSchedulesResponses = {
8644
+ /**
8645
+ * The database schedules of the environment.
8646
+ */
8647
+ 200: DatabaseSchedulePage;
8648
+ };
8649
+
8650
+ export type ListProjectDatabaseSchedulesResponse =
8651
+ ListProjectDatabaseSchedulesResponses[keyof ListProjectDatabaseSchedulesResponses];
8652
+
8653
+ export type DeleteProjectDatabaseScheduleData = {
8654
+ body?: never;
8655
+ headers?: {
8656
+ /**
8657
+ * Optional caller-provided correlation identifier.
8658
+ */
8659
+ "X-Request-Id"?: string;
8660
+ };
8661
+ path: {
8662
+ /**
8663
+ * Project identifier.
8664
+ */
8665
+ project_id: Ulid;
8666
+ /**
8667
+ * Database schedule name, unique per project environment.
8668
+ */
8669
+ name: string;
8670
+ };
8671
+ query: {
8672
+ /**
8673
+ * Application environment the mutation applies to.
8674
+ */
8675
+ environment: "dev" | "prod";
8676
+ };
8677
+ url: "/v1/projects/{project_id}/database/schedules/{name}";
8678
+ };
8679
+
8680
+ export type DeleteProjectDatabaseScheduleErrors = {
8681
+ /**
8682
+ * The request failed.
8683
+ */
8684
+ 400: ProblemDetails;
8685
+ /**
8686
+ * The request failed.
8687
+ */
8688
+ 401: ProblemDetails;
8689
+ /**
8690
+ * The resource does not exist or is not visible to the authenticated principal.
8691
+ */
8692
+ 404: ProblemDetails;
8693
+ /**
8694
+ * The request failed.
8695
+ */
8696
+ 429: ProblemDetails;
8697
+ /**
8698
+ * The request failed.
8699
+ */
8700
+ 503: ProblemDetails;
8701
+ };
8702
+
8703
+ export type DeleteProjectDatabaseScheduleError =
8704
+ DeleteProjectDatabaseScheduleErrors[keyof DeleteProjectDatabaseScheduleErrors];
8705
+
8706
+ export type DeleteProjectDatabaseScheduleResponses = {
8707
+ /**
8708
+ * The name of the deleted schedule.
8709
+ */
8710
+ 200: DatabaseScheduleDeleted;
8711
+ };
8712
+
8713
+ export type DeleteProjectDatabaseScheduleResponse =
8714
+ DeleteProjectDatabaseScheduleResponses[keyof DeleteProjectDatabaseScheduleResponses];
8715
+
8716
+ export type GetProjectDatabaseScheduleData = {
8717
+ body?: never;
8718
+ headers?: {
8719
+ /**
8720
+ * Optional caller-provided correlation identifier.
8721
+ */
8722
+ "X-Request-Id"?: string;
8723
+ };
8724
+ path: {
8725
+ /**
8726
+ * Project identifier.
8727
+ */
8728
+ project_id: Ulid;
8729
+ /**
8730
+ * Database schedule name, unique per project environment.
8731
+ */
8732
+ name: string;
8733
+ };
8734
+ query?: {
8735
+ /**
8736
+ * Application environment to read; dev when omitted.
8737
+ */
8738
+ environment?: "dev" | "prod";
8739
+ };
8740
+ url: "/v1/projects/{project_id}/database/schedules/{name}";
8741
+ };
8742
+
8743
+ export type GetProjectDatabaseScheduleErrors = {
8744
+ /**
8745
+ * The request failed.
8746
+ */
8747
+ 400: ProblemDetails;
8748
+ /**
8749
+ * The request failed.
8750
+ */
8751
+ 401: ProblemDetails;
8752
+ /**
8753
+ * The resource does not exist or is not visible to the authenticated principal.
8754
+ */
8755
+ 404: ProblemDetails;
8756
+ /**
8757
+ * The request failed.
8758
+ */
8759
+ 429: ProblemDetails;
8760
+ /**
8761
+ * The request failed.
8762
+ */
8763
+ 503: ProblemDetails;
8764
+ };
8765
+
8766
+ export type GetProjectDatabaseScheduleError =
8767
+ GetProjectDatabaseScheduleErrors[keyof GetProjectDatabaseScheduleErrors];
8768
+
8769
+ export type GetProjectDatabaseScheduleResponses = {
8770
+ /**
8771
+ * The database schedule.
8772
+ */
8773
+ 200: DatabaseSchedule;
8774
+ };
8775
+
8776
+ export type GetProjectDatabaseScheduleResponse =
8777
+ GetProjectDatabaseScheduleResponses[keyof GetProjectDatabaseScheduleResponses];
8778
+
8779
+ export type SetProjectDatabaseScheduleData = {
8780
+ body: DatabaseScheduleSetRequest;
8781
+ headers?: {
8782
+ /**
8783
+ * Optional caller-provided correlation identifier.
8784
+ */
8785
+ "X-Request-Id"?: string;
8786
+ };
8787
+ path: {
8788
+ /**
8789
+ * Project identifier.
8790
+ */
8791
+ project_id: Ulid;
8792
+ /**
8793
+ * Database schedule name, unique per project environment.
8794
+ */
8795
+ name: string;
8796
+ };
8797
+ query: {
8798
+ /**
8799
+ * Application environment the mutation applies to.
8800
+ */
8801
+ environment: "dev" | "prod";
8802
+ };
8803
+ url: "/v1/projects/{project_id}/database/schedules/{name}";
8804
+ };
8805
+
8806
+ export type SetProjectDatabaseScheduleErrors = {
8807
+ /**
8808
+ * The request failed.
8809
+ */
8810
+ 400: ProblemDetails;
8811
+ /**
8812
+ * The request failed.
8813
+ */
8814
+ 401: ProblemDetails;
8815
+ /**
8816
+ * The resource does not exist or is not visible to the authenticated principal.
8817
+ */
8818
+ 404: ProblemDetails;
8819
+ /**
8820
+ * The request failed.
8821
+ */
8822
+ 409: ProblemDetails;
8823
+ /**
8824
+ * The request failed.
8825
+ */
8826
+ 429: ProblemDetails;
8827
+ /**
8828
+ * The request failed.
8829
+ */
8830
+ 503: ProblemDetails;
8831
+ };
8832
+
8833
+ export type SetProjectDatabaseScheduleError =
8834
+ SetProjectDatabaseScheduleErrors[keyof SetProjectDatabaseScheduleErrors];
8835
+
8836
+ export type SetProjectDatabaseScheduleResponses = {
8837
+ /**
8838
+ * The schedule as stored.
8839
+ */
8840
+ 200: DatabaseSchedule;
8841
+ };
8842
+
8843
+ export type SetProjectDatabaseScheduleResponse =
8844
+ SetProjectDatabaseScheduleResponses[keyof SetProjectDatabaseScheduleResponses];
8845
+
8846
+ export type ListProjectDatabaseScheduleRunsData = {
8847
+ body?: never;
8848
+ headers?: {
8849
+ /**
8850
+ * Optional caller-provided correlation identifier.
8851
+ */
8852
+ "X-Request-Id"?: string;
8853
+ };
8854
+ path: {
8855
+ /**
8856
+ * Project identifier.
8857
+ */
8858
+ project_id: Ulid;
8859
+ /**
8860
+ * Database schedule name, unique per project environment.
8861
+ */
8862
+ name: string;
8863
+ };
8864
+ query?: {
8865
+ /**
8866
+ * Application environment to read; dev when omitted.
8867
+ */
8868
+ environment?: "dev" | "prod";
8869
+ /**
8870
+ * Maximum number of runs in this page.
8871
+ */
8872
+ limit?: number;
8873
+ };
8874
+ url: "/v1/projects/{project_id}/database/schedules/{name}/runs";
8875
+ };
8876
+
8877
+ export type ListProjectDatabaseScheduleRunsErrors = {
8878
+ /**
8879
+ * The request failed.
8880
+ */
8881
+ 400: ProblemDetails;
8882
+ /**
8883
+ * The request failed.
8884
+ */
8885
+ 401: ProblemDetails;
8886
+ /**
8887
+ * The resource does not exist or is not visible to the authenticated principal.
8888
+ */
8889
+ 404: ProblemDetails;
8890
+ /**
8891
+ * The request failed.
8892
+ */
8893
+ 429: ProblemDetails;
8894
+ /**
8895
+ * The request failed.
8896
+ */
8897
+ 503: ProblemDetails;
8898
+ };
8899
+
8900
+ export type ListProjectDatabaseScheduleRunsError =
8901
+ ListProjectDatabaseScheduleRunsErrors[keyof ListProjectDatabaseScheduleRunsErrors];
8902
+
8903
+ export type ListProjectDatabaseScheduleRunsResponses = {
8904
+ /**
8905
+ * The newest runs of the schedule, newest first.
8906
+ */
8907
+ 200: DatabaseScheduleRunPage;
8908
+ };
8909
+
8910
+ export type ListProjectDatabaseScheduleRunsResponse =
8911
+ ListProjectDatabaseScheduleRunsResponses[keyof ListProjectDatabaseScheduleRunsResponses];
8912
+
8913
+ export type RunProjectDatabaseScheduleData = {
8914
+ body?: never;
8915
+ headers?: {
8916
+ /**
8917
+ * Optional caller-provided correlation identifier.
8918
+ */
8919
+ "X-Request-Id"?: string;
8920
+ };
8921
+ path: {
8922
+ /**
8923
+ * Project identifier.
8924
+ */
8925
+ project_id: Ulid;
8926
+ /**
8927
+ * Database schedule name, unique per project environment.
8928
+ */
8929
+ name: string;
8930
+ };
8931
+ query: {
8932
+ /**
8933
+ * Application environment the mutation applies to.
8934
+ */
8935
+ environment: "dev" | "prod";
8936
+ };
8937
+ url: "/v1/projects/{project_id}/database/schedules/{name}/run";
8938
+ };
8939
+
8940
+ export type RunProjectDatabaseScheduleErrors = {
8941
+ /**
8942
+ * The request failed.
8943
+ */
8944
+ 400: ProblemDetails;
8945
+ /**
8946
+ * The request failed.
8947
+ */
8948
+ 401: ProblemDetails;
8949
+ /**
8950
+ * The resource does not exist or is not visible to the authenticated principal.
8951
+ */
8952
+ 404: ProblemDetails;
8953
+ /**
8954
+ * The request failed.
8955
+ */
8956
+ 409: ProblemDetails;
8957
+ /**
8958
+ * The request failed.
8959
+ */
8960
+ 429: ProblemDetails;
8961
+ /**
8962
+ * The request failed.
8963
+ */
8964
+ 503: ProblemDetails;
8965
+ };
8966
+
8967
+ export type RunProjectDatabaseScheduleError =
8968
+ RunProjectDatabaseScheduleErrors[keyof RunProjectDatabaseScheduleErrors];
8969
+
8970
+ export type RunProjectDatabaseScheduleResponses = {
8971
+ /**
8972
+ * The run was queued.
8973
+ */
8974
+ 202: DatabaseScheduleRunAccepted;
8975
+ };
8976
+
8977
+ export type RunProjectDatabaseScheduleResponse =
8978
+ RunProjectDatabaseScheduleResponses[keyof RunProjectDatabaseScheduleResponses];
8979
+
8980
+ export type GetProjectDatabaseExecutionUsageData = {
8981
+ body?: never;
8982
+ headers?: {
8983
+ /**
8984
+ * Optional caller-provided correlation identifier.
8985
+ */
8986
+ "X-Request-Id"?: string;
8987
+ };
8988
+ path: {
8989
+ /**
8990
+ * Project identifier.
8991
+ */
8992
+ project_id: Ulid;
8993
+ };
8994
+ query: {
8995
+ /**
8996
+ * Application environment to read; dev when omitted.
8997
+ */
8998
+ environment?: "dev" | "prod";
8999
+ /**
9000
+ * Inclusive window start in UTC, aligned to the granularity.
9001
+ */
9002
+ from: string;
9003
+ /**
9004
+ * Exclusive window end in UTC, aligned to the granularity.
9005
+ */
9006
+ to: string;
9007
+ /**
9008
+ * Length of each returned window.
9009
+ */
9010
+ granularity: "hour" | "day";
9011
+ /**
9012
+ * Maximum number of windows in this page.
9013
+ */
9014
+ limit?: number;
9015
+ /**
9016
+ * Opaque cursor returned by the previous page.
9017
+ */
9018
+ cursor?: string;
9019
+ };
9020
+ url: "/v1/projects/{project_id}/database/execution-usage";
9021
+ };
9022
+
9023
+ export type GetProjectDatabaseExecutionUsageErrors = {
9024
+ /**
9025
+ * The request failed.
9026
+ */
9027
+ 400: ProblemDetails;
9028
+ /**
9029
+ * The request failed.
9030
+ */
9031
+ 401: ProblemDetails;
9032
+ /**
9033
+ * The resource does not exist or is not visible to the authenticated principal.
9034
+ */
9035
+ 404: ProblemDetails;
9036
+ /**
9037
+ * The request failed.
9038
+ */
9039
+ 429: ProblemDetails;
9040
+ /**
9041
+ * The request failed.
9042
+ */
9043
+ 503: ProblemDetails;
9044
+ };
9045
+
9046
+ export type GetProjectDatabaseExecutionUsageError =
9047
+ GetProjectDatabaseExecutionUsageErrors[keyof GetProjectDatabaseExecutionUsageErrors];
9048
+
9049
+ export type GetProjectDatabaseExecutionUsageResponses = {
9050
+ /**
9051
+ * One page of execution usage windows.
9052
+ */
9053
+ 200: DatabaseExecutionUsagePage;
9054
+ };
9055
+
9056
+ export type GetProjectDatabaseExecutionUsageResponse =
9057
+ GetProjectDatabaseExecutionUsageResponses[keyof GetProjectDatabaseExecutionUsageResponses];
9058
+
7903
9059
  export type PlanDeploymentRollbackData = {
7904
9060
  body?: never;
7905
9061
  headers?: {