@distilled.cloud/planetscale 0.8.0 → 0.10.0

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.
Files changed (167) hide show
  1. package/lib/credentials.d.ts +2 -2
  2. package/lib/credentials.d.ts.map +1 -1
  3. package/lib/credentials.js +2 -2
  4. package/lib/credentials.js.map +1 -1
  5. package/lib/errors.d.ts +2 -2
  6. package/lib/operations/checkDeployRequestStorage.d.ts +32 -0
  7. package/lib/operations/checkDeployRequestStorage.d.ts.map +1 -0
  8. package/lib/operations/checkDeployRequestStorage.js +45 -0
  9. package/lib/operations/checkDeployRequestStorage.js.map +1 -0
  10. package/lib/operations/createBackup.d.ts +1 -0
  11. package/lib/operations/createBackup.d.ts.map +1 -1
  12. package/lib/operations/createBackup.js +1 -0
  13. package/lib/operations/createBackup.js.map +1 -1
  14. package/lib/operations/createBackupPolicy.d.ts +51 -0
  15. package/lib/operations/createBackupPolicy.d.ts.map +1 -0
  16. package/lib/operations/createBackupPolicy.js +64 -0
  17. package/lib/operations/createBackupPolicy.js.map +1 -0
  18. package/lib/operations/createBranch.d.ts +4 -0
  19. package/lib/operations/createBranch.d.ts.map +1 -1
  20. package/lib/operations/createBranch.js +4 -0
  21. package/lib/operations/createBranch.js.map +1 -1
  22. package/lib/operations/createDatabase.d.ts +4 -0
  23. package/lib/operations/createDatabase.d.ts.map +1 -1
  24. package/lib/operations/createDatabase.js +4 -0
  25. package/lib/operations/createDatabase.js.map +1 -1
  26. package/lib/operations/createTrafficBudget.d.ts +70 -0
  27. package/lib/operations/createTrafficBudget.d.ts.map +1 -0
  28. package/lib/operations/createTrafficBudget.js +83 -0
  29. package/lib/operations/createTrafficBudget.js.map +1 -0
  30. package/lib/operations/createTrafficRule.d.ts +47 -0
  31. package/lib/operations/createTrafficRule.d.ts.map +1 -0
  32. package/lib/operations/createTrafficRule.js +59 -0
  33. package/lib/operations/createTrafficRule.js.map +1 -0
  34. package/lib/operations/deleteBackupPolicy.d.ts +18 -0
  35. package/lib/operations/deleteBackupPolicy.d.ts.map +1 -0
  36. package/lib/operations/deleteBackupPolicy.js +30 -0
  37. package/lib/operations/deleteBackupPolicy.js.map +1 -0
  38. package/lib/operations/deleteBranch.d.ts +2 -0
  39. package/lib/operations/deleteBranch.d.ts.map +1 -1
  40. package/lib/operations/deleteBranch.js +2 -0
  41. package/lib/operations/deleteBranch.js.map +1 -1
  42. package/lib/operations/deleteTrafficBudget.d.ts +20 -0
  43. package/lib/operations/deleteTrafficBudget.d.ts.map +1 -0
  44. package/lib/operations/deleteTrafficBudget.js +33 -0
  45. package/lib/operations/deleteTrafficBudget.js.map +1 -0
  46. package/lib/operations/deleteTrafficRule.d.ts +22 -0
  47. package/lib/operations/deleteTrafficRule.d.ts.map +1 -0
  48. package/lib/operations/deleteTrafficRule.js +33 -0
  49. package/lib/operations/deleteTrafficRule.js.map +1 -0
  50. package/lib/operations/getBackup.d.ts +1 -0
  51. package/lib/operations/getBackup.d.ts.map +1 -1
  52. package/lib/operations/getBackup.js +1 -0
  53. package/lib/operations/getBackup.js.map +1 -1
  54. package/lib/operations/getBackupPolicy.d.ts +35 -0
  55. package/lib/operations/getBackupPolicy.d.ts.map +1 -0
  56. package/lib/operations/getBackupPolicy.js +46 -0
  57. package/lib/operations/getBackupPolicy.js.map +1 -0
  58. package/lib/operations/getDeployQueue.d.ts +4 -0
  59. package/lib/operations/getDeployQueue.d.ts.map +1 -1
  60. package/lib/operations/getDeployQueue.js +4 -0
  61. package/lib/operations/getDeployQueue.js.map +1 -1
  62. package/lib/operations/getMaintenanceSchedule.d.ts +37 -0
  63. package/lib/operations/getMaintenanceSchedule.d.ts.map +1 -0
  64. package/lib/operations/getMaintenanceSchedule.js +50 -0
  65. package/lib/operations/getMaintenanceSchedule.js.map +1 -0
  66. package/lib/operations/getTrafficBudget.d.ts +56 -0
  67. package/lib/operations/getTrafficBudget.d.ts.map +1 -0
  68. package/lib/operations/getTrafficBudget.js +67 -0
  69. package/lib/operations/getTrafficBudget.js.map +1 -0
  70. package/lib/operations/index.d.ts +16 -0
  71. package/lib/operations/index.d.ts.map +1 -1
  72. package/lib/operations/index.js +16 -0
  73. package/lib/operations/index.js.map +1 -1
  74. package/lib/operations/listAuditLogs.d.ts +6 -0
  75. package/lib/operations/listAuditLogs.d.ts.map +1 -1
  76. package/lib/operations/listAuditLogs.js +6 -0
  77. package/lib/operations/listAuditLogs.js.map +1 -1
  78. package/lib/operations/listBackupPolicies.d.ts +44 -0
  79. package/lib/operations/listBackupPolicies.d.ts.map +1 -0
  80. package/lib/operations/listBackupPolicies.js +57 -0
  81. package/lib/operations/listBackupPolicies.js.map +1 -0
  82. package/lib/operations/listBackups.d.ts +1 -0
  83. package/lib/operations/listBackups.d.ts.map +1 -1
  84. package/lib/operations/listBackups.js +1 -0
  85. package/lib/operations/listBackups.js.map +1 -1
  86. package/lib/operations/listDeployRequestReviews.d.ts +4 -0
  87. package/lib/operations/listDeployRequestReviews.d.ts.map +1 -1
  88. package/lib/operations/listDeployRequestReviews.js +4 -0
  89. package/lib/operations/listDeployRequestReviews.js.map +1 -1
  90. package/lib/operations/listGeneratedQueryPatternsReports.d.ts +6 -0
  91. package/lib/operations/listGeneratedQueryPatternsReports.d.ts.map +1 -1
  92. package/lib/operations/listGeneratedQueryPatternsReports.js +6 -0
  93. package/lib/operations/listGeneratedQueryPatternsReports.js.map +1 -1
  94. package/lib/operations/listMaintenanceSchedules.d.ts +46 -0
  95. package/lib/operations/listMaintenanceSchedules.d.ts.map +1 -0
  96. package/lib/operations/listMaintenanceSchedules.js +59 -0
  97. package/lib/operations/listMaintenanceSchedules.js.map +1 -0
  98. package/lib/operations/listMaintenanceWindows.d.ts +35 -0
  99. package/lib/operations/listMaintenanceWindows.d.ts.map +1 -0
  100. package/lib/operations/listMaintenanceWindows.js +48 -0
  101. package/lib/operations/listMaintenanceWindows.js.map +1 -0
  102. package/lib/operations/listOrganizationTeamMembers.d.ts +4 -0
  103. package/lib/operations/listOrganizationTeamMembers.d.ts.map +1 -1
  104. package/lib/operations/listOrganizationTeamMembers.js +4 -0
  105. package/lib/operations/listOrganizationTeamMembers.js.map +1 -1
  106. package/lib/operations/listOrganizationTeams.d.ts +4 -0
  107. package/lib/operations/listOrganizationTeams.d.ts.map +1 -1
  108. package/lib/operations/listOrganizationTeams.js +4 -0
  109. package/lib/operations/listOrganizationTeams.js.map +1 -1
  110. package/lib/operations/listSchemaRecommendations.d.ts +4 -0
  111. package/lib/operations/listSchemaRecommendations.d.ts.map +1 -1
  112. package/lib/operations/listSchemaRecommendations.js +4 -0
  113. package/lib/operations/listSchemaRecommendations.js.map +1 -1
  114. package/lib/operations/listTrafficBudgets.d.ts +71 -0
  115. package/lib/operations/listTrafficBudgets.d.ts.map +1 -0
  116. package/lib/operations/listTrafficBudgets.js +84 -0
  117. package/lib/operations/listTrafficBudgets.js.map +1 -0
  118. package/lib/operations/updateBackup.d.ts +1 -0
  119. package/lib/operations/updateBackup.d.ts.map +1 -1
  120. package/lib/operations/updateBackup.js +1 -0
  121. package/lib/operations/updateBackup.js.map +1 -1
  122. package/lib/operations/updateBackupPolicy.d.ts +53 -0
  123. package/lib/operations/updateBackupPolicy.d.ts.map +1 -0
  124. package/lib/operations/updateBackupPolicy.js +66 -0
  125. package/lib/operations/updateBackupPolicy.js.map +1 -0
  126. package/lib/operations/updateTrafficBudget.d.ts +72 -0
  127. package/lib/operations/updateTrafficBudget.d.ts.map +1 -0
  128. package/lib/operations/updateTrafficBudget.js +85 -0
  129. package/lib/operations/updateTrafficBudget.js.map +1 -0
  130. package/lib/retry.d.ts +2 -2
  131. package/lib/retry.d.ts.map +1 -1
  132. package/lib/retry.js +2 -2
  133. package/lib/retry.js.map +1 -1
  134. package/package.json +4 -4
  135. package/src/credentials.ts +2 -2
  136. package/src/operations/checkDeployRequestStorage.ts +61 -0
  137. package/src/operations/createBackup.ts +1 -0
  138. package/src/operations/createBackupPolicy.ts +74 -0
  139. package/src/operations/createBranch.ts +6 -0
  140. package/src/operations/createDatabase.ts +6 -0
  141. package/src/operations/createTrafficBudget.ts +93 -0
  142. package/src/operations/createTrafficRule.ts +69 -0
  143. package/src/operations/deleteBackupPolicy.ts +36 -0
  144. package/src/operations/deleteBranch.ts +2 -0
  145. package/src/operations/deleteTrafficBudget.ts +39 -0
  146. package/src/operations/deleteTrafficRule.ts +41 -0
  147. package/src/operations/getBackup.ts +1 -0
  148. package/src/operations/getBackupPolicy.ts +52 -0
  149. package/src/operations/getDeployQueue.ts +4 -0
  150. package/src/operations/getMaintenanceSchedule.ts +60 -0
  151. package/src/operations/getTrafficBudget.ts +79 -0
  152. package/src/operations/index.ts +16 -0
  153. package/src/operations/listAuditLogs.ts +6 -0
  154. package/src/operations/listBackupPolicies.ts +65 -0
  155. package/src/operations/listBackups.ts +1 -0
  156. package/src/operations/listDeployRequestReviews.ts +4 -0
  157. package/src/operations/listGeneratedQueryPatternsReports.ts +6 -0
  158. package/src/operations/listMaintenanceSchedules.ts +71 -0
  159. package/src/operations/listMaintenanceWindows.ts +60 -0
  160. package/src/operations/listOrganizationTeamMembers.ts +4 -0
  161. package/src/operations/listOrganizationTeams.ts +4 -0
  162. package/src/operations/listSchemaRecommendations.ts +4 -0
  163. package/src/operations/listTrafficBudgets.ts +96 -0
  164. package/src/operations/updateBackup.ts +1 -0
  165. package/src/operations/updateBackupPolicy.ts +76 -0
  166. package/src/operations/updateTrafficBudget.ts +95 -0
  167. package/src/retry.ts +2 -2
@@ -0,0 +1,93 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+ import { Forbidden, NotFound } from "../errors";
5
+
6
+ // Input Schema
7
+ export const CreateTrafficBudgetInput =
8
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9
+ organization: Schema.String.pipe(T.PathParam()),
10
+ database: Schema.String.pipe(T.PathParam()),
11
+ branch: Schema.String.pipe(T.PathParam()),
12
+ name: Schema.optional(Schema.String),
13
+ mode: Schema.optional(Schema.Literals(["enforce", "warn", "off"])),
14
+ capacity: Schema.optional(Schema.Number),
15
+ rate: Schema.optional(Schema.Number),
16
+ burst: Schema.optional(Schema.Number),
17
+ concurrency: Schema.optional(Schema.Number),
18
+ warning_threshold: Schema.optional(Schema.Number),
19
+ rules: Schema.optional(Schema.Array(Schema.String)),
20
+ }).pipe(
21
+ T.Http({
22
+ method: "POST",
23
+ path: "/organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets",
24
+ }),
25
+ );
26
+ export type CreateTrafficBudgetInput = typeof CreateTrafficBudgetInput.Type;
27
+
28
+ // Output Schema
29
+ export const CreateTrafficBudgetOutput =
30
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
31
+ id: Schema.String,
32
+ name: Schema.String,
33
+ mode: Schema.Literals(["enforce", "warn", "off"]),
34
+ capacity: Schema.optional(Schema.Number),
35
+ rate: Schema.optional(Schema.Number),
36
+ burst: Schema.optional(Schema.Number),
37
+ concurrency: Schema.optional(Schema.Number),
38
+ warning_threshold: Schema.optional(Schema.Number),
39
+ actor: Schema.Struct({
40
+ id: Schema.String,
41
+ display_name: Schema.String,
42
+ avatar_url: Schema.String,
43
+ }),
44
+ rules: Schema.Array(
45
+ Schema.Struct({
46
+ id: Schema.String,
47
+ kind: Schema.Literals(["match"]),
48
+ tags: Schema.Array(
49
+ Schema.Struct({
50
+ key_id: Schema.String,
51
+ key: Schema.String,
52
+ value: Schema.String,
53
+ source: Schema.Literals(["sql", "system"]),
54
+ }),
55
+ ),
56
+ fingerprint: Schema.optional(Schema.String),
57
+ keyspace: Schema.optional(Schema.String),
58
+ actor: Schema.Struct({
59
+ id: Schema.String,
60
+ display_name: Schema.String,
61
+ avatar_url: Schema.String,
62
+ }),
63
+ syntax_highlighted_sql: Schema.String,
64
+ created_at: Schema.String,
65
+ updated_at: Schema.String,
66
+ }),
67
+ ),
68
+ created_at: Schema.String,
69
+ updated_at: Schema.String,
70
+ });
71
+ export type CreateTrafficBudgetOutput = typeof CreateTrafficBudgetOutput.Type;
72
+
73
+ // The operation
74
+ /**
75
+ * Create a traffic budget
76
+ *
77
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
78
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
79
+ * @param branch - Branch name from `list_branches`. Example: `main`.
80
+ * @param name - Name of the traffic budget
81
+ * @param mode - The mode of the traffic budget
82
+ * @param capacity - The maximum capacity that can be banked, measured as a percentage of seconds of full server usage (0-6000). Unlimited when not set.
83
+ * @param rate - The rate at which capacity refills, as a percentage of server resources (0-100). Unlimited when not set.
84
+ * @param burst - The maximum capacity a single query can consume, measured as a percentage of seconds of full server usage (0-6000). Unlimited when not set.
85
+ * @param concurrency - The percentage of available worker processes this policy can use (0-100). Unlimited when not set.
86
+ * @param warning_threshold - A percentage of capacity, burst, or concurrency thresholds to emit warnings for enforced budgets (0-100).
87
+ * @param rules - Array of traffic rules to apply to the budget
88
+ */
89
+ export const createTrafficBudget = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
90
+ inputSchema: CreateTrafficBudgetInput,
91
+ outputSchema: CreateTrafficBudgetOutput,
92
+ errors: [Forbidden, NotFound] as const,
93
+ }));
@@ -0,0 +1,69 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+ import { Forbidden, NotFound } from "../errors";
5
+
6
+ // Input Schema
7
+ export const CreateTrafficRuleInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
8
+ {
9
+ organization: Schema.String.pipe(T.PathParam()),
10
+ database: Schema.String.pipe(T.PathParam()),
11
+ branch: Schema.String.pipe(T.PathParam()),
12
+ budget_id: Schema.String.pipe(T.PathParam()),
13
+ kind: Schema.optional(Schema.Literals(["match"])),
14
+ keyspace: Schema.optional(Schema.String),
15
+ fingerprint: Schema.optional(Schema.String),
16
+ tags: Schema.optional(Schema.Array(Schema.String)),
17
+ },
18
+ ).pipe(
19
+ T.Http({
20
+ method: "POST",
21
+ path: "/organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{budget_id}/rules",
22
+ }),
23
+ );
24
+ export type CreateTrafficRuleInput = typeof CreateTrafficRuleInput.Type;
25
+
26
+ // Output Schema
27
+ export const CreateTrafficRuleOutput =
28
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
29
+ id: Schema.String,
30
+ kind: Schema.Literals(["match"]),
31
+ tags: Schema.Array(
32
+ Schema.Struct({
33
+ key_id: Schema.String,
34
+ key: Schema.String,
35
+ value: Schema.String,
36
+ source: Schema.Literals(["sql", "system"]),
37
+ }),
38
+ ),
39
+ fingerprint: Schema.optional(Schema.String),
40
+ keyspace: Schema.optional(Schema.String),
41
+ actor: Schema.Struct({
42
+ id: Schema.String,
43
+ display_name: Schema.String,
44
+ avatar_url: Schema.String,
45
+ }),
46
+ syntax_highlighted_sql: Schema.String,
47
+ created_at: Schema.String,
48
+ updated_at: Schema.String,
49
+ });
50
+ export type CreateTrafficRuleOutput = typeof CreateTrafficRuleOutput.Type;
51
+
52
+ // The operation
53
+ /**
54
+ * Create a traffic rule
55
+ *
56
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
57
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
58
+ * @param branch - Branch name from `list_branches`. Example: `main`.
59
+ * @param budget_id - The ID of the traffic budget
60
+ * @param kind - Kind of rule
61
+ * @param keyspace - The keyspace to apply a query pattern rule to
62
+ * @param fingerprint - Query pattern fingerprint to apply rule to
63
+ * @param tags - Optional array of tags for this rule
64
+ */
65
+ export const createTrafficRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
66
+ inputSchema: CreateTrafficRuleInput,
67
+ outputSchema: CreateTrafficRuleOutput,
68
+ errors: [Forbidden, NotFound] as const,
69
+ }));
@@ -0,0 +1,36 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+ import { Forbidden, NotFound } from "../errors";
5
+
6
+ // Input Schema
7
+ export const DeleteBackupPolicyInput =
8
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9
+ id: Schema.String.pipe(T.PathParam()),
10
+ organization: Schema.String.pipe(T.PathParam()),
11
+ database: Schema.String.pipe(T.PathParam()),
12
+ }).pipe(
13
+ T.Http({
14
+ method: "DELETE",
15
+ path: "/organizations/{organization}/databases/{database}/backup-policies/{id}",
16
+ }),
17
+ );
18
+ export type DeleteBackupPolicyInput = typeof DeleteBackupPolicyInput.Type;
19
+
20
+ // Output Schema
21
+ export const DeleteBackupPolicyOutput = /*@__PURE__*/ /*#__PURE__*/ Schema.Void;
22
+ export type DeleteBackupPolicyOutput = typeof DeleteBackupPolicyOutput.Type;
23
+
24
+ // The operation
25
+ /**
26
+ * Delete a backup policy
27
+ *
28
+ * @param id - The ID of the backup policy
29
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
30
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
31
+ */
32
+ export const deleteBackupPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
33
+ inputSchema: DeleteBackupPolicyInput,
34
+ outputSchema: DeleteBackupPolicyOutput,
35
+ errors: [Forbidden, NotFound] as const,
36
+ }));
@@ -8,6 +8,7 @@ export const DeleteBranchInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
8
  organization: Schema.String.pipe(T.PathParam()),
9
9
  database: Schema.String.pipe(T.PathParam()),
10
10
  branch: Schema.String.pipe(T.PathParam()),
11
+ delete_descendants: Schema.optional(Schema.Boolean),
11
12
  }).pipe(
12
13
  T.Http({
13
14
  method: "DELETE",
@@ -27,6 +28,7 @@ export type DeleteBranchOutput = typeof DeleteBranchOutput.Type;
27
28
  * @param organization - The name of the organization the branch belongs to
28
29
  * @param database - The name of the database the branch belongs to
29
30
  * @param branch - The name of the branch
31
+ * @param delete_descendants - If true, recursively delete all descendant branches along with this branch
30
32
  */
31
33
  export const deleteBranch = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
32
34
  inputSchema: DeleteBranchInput,
@@ -0,0 +1,39 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+ import { Forbidden, NotFound } from "../errors";
5
+
6
+ // Input Schema
7
+ export const DeleteTrafficBudgetInput =
8
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9
+ organization: Schema.String.pipe(T.PathParam()),
10
+ database: Schema.String.pipe(T.PathParam()),
11
+ branch: Schema.String.pipe(T.PathParam()),
12
+ id: Schema.String.pipe(T.PathParam()),
13
+ }).pipe(
14
+ T.Http({
15
+ method: "DELETE",
16
+ path: "/organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{id}",
17
+ }),
18
+ );
19
+ export type DeleteTrafficBudgetInput = typeof DeleteTrafficBudgetInput.Type;
20
+
21
+ // Output Schema
22
+ export const DeleteTrafficBudgetOutput =
23
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Void;
24
+ export type DeleteTrafficBudgetOutput = typeof DeleteTrafficBudgetOutput.Type;
25
+
26
+ // The operation
27
+ /**
28
+ * Delete a traffic budget
29
+ *
30
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
31
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
32
+ * @param branch - Branch name from `list_branches`. Example: `main`.
33
+ * @param id - The ID of the traffic budget
34
+ */
35
+ export const deleteTrafficBudget = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
36
+ inputSchema: DeleteTrafficBudgetInput,
37
+ outputSchema: DeleteTrafficBudgetOutput,
38
+ errors: [Forbidden, NotFound] as const,
39
+ }));
@@ -0,0 +1,41 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+ import { Forbidden, NotFound } from "../errors";
5
+
6
+ // Input Schema
7
+ export const DeleteTrafficRuleInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
8
+ {
9
+ organization: Schema.String.pipe(T.PathParam()),
10
+ database: Schema.String.pipe(T.PathParam()),
11
+ branch: Schema.String.pipe(T.PathParam()),
12
+ budget_id: Schema.String.pipe(T.PathParam()),
13
+ id: Schema.String.pipe(T.PathParam()),
14
+ },
15
+ ).pipe(
16
+ T.Http({
17
+ method: "DELETE",
18
+ path: "/organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{budget_id}/rules/{id}",
19
+ }),
20
+ );
21
+ export type DeleteTrafficRuleInput = typeof DeleteTrafficRuleInput.Type;
22
+
23
+ // Output Schema
24
+ export const DeleteTrafficRuleOutput = /*@__PURE__*/ /*#__PURE__*/ Schema.Void;
25
+ export type DeleteTrafficRuleOutput = typeof DeleteTrafficRuleOutput.Type;
26
+
27
+ // The operation
28
+ /**
29
+ * Delete a traffic rule
30
+ *
31
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
32
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
33
+ * @param branch - Branch name from `list_branches`. Example: `main`.
34
+ * @param budget_id - The ID of the traffic budget
35
+ * @param id - The ID of the traffic rule
36
+ */
37
+ export const deleteTrafficRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
38
+ inputSchema: DeleteTrafficRuleInput,
39
+ outputSchema: DeleteTrafficRuleOutput,
40
+ errors: [Forbidden, NotFound] as const,
41
+ }));
@@ -57,6 +57,7 @@ export const GetBackupOutput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
57
57
  backup_policy: Schema.NullOr(
58
58
  Schema.Struct({
59
59
  id: Schema.String,
60
+ display_name: Schema.String,
60
61
  name: Schema.String,
61
62
  target: Schema.Literals(["production", "development"]),
62
63
  retention_value: Schema.Number,
@@ -0,0 +1,52 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+ import { Forbidden, NotFound } from "../errors";
5
+
6
+ // Input Schema
7
+ export const GetBackupPolicyInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ id: Schema.String.pipe(T.PathParam()),
9
+ organization: Schema.String.pipe(T.PathParam()),
10
+ database: Schema.String.pipe(T.PathParam()),
11
+ }).pipe(
12
+ T.Http({
13
+ method: "GET",
14
+ path: "/organizations/{organization}/databases/{database}/backup-policies/{id}",
15
+ }),
16
+ );
17
+ export type GetBackupPolicyInput = typeof GetBackupPolicyInput.Type;
18
+
19
+ // Output Schema
20
+ export const GetBackupPolicyOutput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
21
+ id: Schema.String,
22
+ display_name: Schema.String,
23
+ name: Schema.String,
24
+ target: Schema.Literals(["production", "development"]),
25
+ retention_value: Schema.Number,
26
+ retention_unit: Schema.String,
27
+ frequency_value: Schema.Number,
28
+ frequency_unit: Schema.String,
29
+ schedule_time: Schema.String,
30
+ schedule_day: Schema.Number,
31
+ schedule_week: Schema.Number,
32
+ created_at: Schema.String,
33
+ updated_at: Schema.String,
34
+ last_ran_at: Schema.String,
35
+ next_run_at: Schema.String,
36
+ required: Schema.Boolean,
37
+ });
38
+ export type GetBackupPolicyOutput = typeof GetBackupPolicyOutput.Type;
39
+
40
+ // The operation
41
+ /**
42
+ * Get a backup policy
43
+ *
44
+ * @param id - The ID of the backup policy
45
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
46
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
47
+ */
48
+ export const getBackupPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
49
+ inputSchema: GetBackupPolicyInput,
50
+ outputSchema: GetBackupPolicyOutput,
51
+ errors: [Forbidden, NotFound] as const,
52
+ }));
@@ -7,6 +7,8 @@ import { Forbidden, NotFound } from "../errors";
7
7
  export const GetDeployQueueInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
8
  organization: Schema.String.pipe(T.PathParam()),
9
9
  database: Schema.String.pipe(T.PathParam()),
10
+ page: Schema.optional(Schema.Number),
11
+ per_page: Schema.optional(Schema.Number),
10
12
  }).pipe(
11
13
  T.Http({
12
14
  method: "GET",
@@ -184,6 +186,8 @@ export type GetDeployQueueOutput = typeof GetDeployQueueOutput.Type;
184
186
  *
185
187
  * @param organization - The name of the deploy request's organization
186
188
  * @param database - The name of the deploy request's database
189
+ * @param page - If provided, specifies the page offset of returned results
190
+ * @param per_page - If provided, specifies the number of returned results
187
191
  */
188
192
  export const getDeployQueue = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
189
193
  inputSchema: GetDeployQueueInput,
@@ -0,0 +1,60 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+ import { Forbidden, NotFound } from "../errors";
5
+
6
+ // Input Schema
7
+ export const GetMaintenanceScheduleInput =
8
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9
+ id: Schema.String.pipe(T.PathParam()),
10
+ organization: Schema.String.pipe(T.PathParam()),
11
+ database: Schema.String.pipe(T.PathParam()),
12
+ }).pipe(
13
+ T.Http({
14
+ method: "GET",
15
+ path: "/organizations/{organization}/databases/{database}/maintenance-schedules/{id}",
16
+ }),
17
+ );
18
+ export type GetMaintenanceScheduleInput =
19
+ typeof GetMaintenanceScheduleInput.Type;
20
+
21
+ // Output Schema
22
+ export const GetMaintenanceScheduleOutput =
23
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
24
+ id: Schema.String,
25
+ name: Schema.String,
26
+ created_at: Schema.String,
27
+ updated_at: Schema.String,
28
+ last_window_datetime: Schema.String,
29
+ next_window_datetime: Schema.String,
30
+ duration: Schema.Number,
31
+ day: Schema.Number,
32
+ hour: Schema.Number,
33
+ week: Schema.Number,
34
+ frequency_value: Schema.Number,
35
+ frequency_unit: Schema.Literals(["day", "week", "month", "once"]),
36
+ enabled: Schema.Boolean,
37
+ expires_at: Schema.String,
38
+ deadline_at: Schema.String,
39
+ required: Schema.Boolean,
40
+ pending_vitess_version_update: Schema.Boolean,
41
+ pending_vitess_version: Schema.String,
42
+ });
43
+ export type GetMaintenanceScheduleOutput =
44
+ typeof GetMaintenanceScheduleOutput.Type;
45
+
46
+ // The operation
47
+ /**
48
+ * Get a maintenance schedule
49
+ *
50
+ * @param id - The ID of the maintenance schedule
51
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
52
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
53
+ */
54
+ export const getMaintenanceSchedule = /*@__PURE__*/ /*#__PURE__*/ API.make(
55
+ () => ({
56
+ inputSchema: GetMaintenanceScheduleInput,
57
+ outputSchema: GetMaintenanceScheduleOutput,
58
+ errors: [Forbidden, NotFound] as const,
59
+ }),
60
+ );
@@ -0,0 +1,79 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+ import { Forbidden, NotFound } from "../errors";
5
+
6
+ // Input Schema
7
+ export const GetTrafficBudgetInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ organization: Schema.String.pipe(T.PathParam()),
9
+ database: Schema.String.pipe(T.PathParam()),
10
+ branch: Schema.String.pipe(T.PathParam()),
11
+ id: Schema.String.pipe(T.PathParam()),
12
+ }).pipe(
13
+ T.Http({
14
+ method: "GET",
15
+ path: "/organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{id}",
16
+ }),
17
+ );
18
+ export type GetTrafficBudgetInput = typeof GetTrafficBudgetInput.Type;
19
+
20
+ // Output Schema
21
+ export const GetTrafficBudgetOutput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
22
+ {
23
+ id: Schema.String,
24
+ name: Schema.String,
25
+ mode: Schema.Literals(["enforce", "warn", "off"]),
26
+ capacity: Schema.optional(Schema.Number),
27
+ rate: Schema.optional(Schema.Number),
28
+ burst: Schema.optional(Schema.Number),
29
+ concurrency: Schema.optional(Schema.Number),
30
+ warning_threshold: Schema.optional(Schema.Number),
31
+ actor: Schema.Struct({
32
+ id: Schema.String,
33
+ display_name: Schema.String,
34
+ avatar_url: Schema.String,
35
+ }),
36
+ rules: Schema.Array(
37
+ Schema.Struct({
38
+ id: Schema.String,
39
+ kind: Schema.Literals(["match"]),
40
+ tags: Schema.Array(
41
+ Schema.Struct({
42
+ key_id: Schema.String,
43
+ key: Schema.String,
44
+ value: Schema.String,
45
+ source: Schema.Literals(["sql", "system"]),
46
+ }),
47
+ ),
48
+ fingerprint: Schema.optional(Schema.String),
49
+ keyspace: Schema.optional(Schema.String),
50
+ actor: Schema.Struct({
51
+ id: Schema.String,
52
+ display_name: Schema.String,
53
+ avatar_url: Schema.String,
54
+ }),
55
+ syntax_highlighted_sql: Schema.String,
56
+ created_at: Schema.String,
57
+ updated_at: Schema.String,
58
+ }),
59
+ ),
60
+ created_at: Schema.String,
61
+ updated_at: Schema.String,
62
+ },
63
+ );
64
+ export type GetTrafficBudgetOutput = typeof GetTrafficBudgetOutput.Type;
65
+
66
+ // The operation
67
+ /**
68
+ * Get a traffic budget
69
+ *
70
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
71
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
72
+ * @param branch - Branch name from `list_branches`. Example: `main`.
73
+ * @param id - The ID of the traffic budget
74
+ */
75
+ export const getTrafficBudget = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
76
+ inputSchema: GetTrafficBudgetInput,
77
+ outputSchema: GetTrafficBudgetOutput,
78
+ errors: [Forbidden, NotFound] as const,
79
+ }));
@@ -8,6 +8,11 @@ export * from "./createDatabase";
8
8
  export * from "./getDatabase";
9
9
  export * from "./updateDatabaseSettings";
10
10
  export * from "./deleteDatabase";
11
+ export * from "./listBackupPolicies";
12
+ export * from "./createBackupPolicy";
13
+ export * from "./getBackupPolicy";
14
+ export * from "./updateBackupPolicy";
15
+ export * from "./deleteBackupPolicy";
11
16
  export * from "./listBranches";
12
17
  export * from "./createBranch";
13
18
  export * from "./getBranch";
@@ -68,6 +73,13 @@ export * from "./enableSafeMigrations";
68
73
  export * from "./disableSafeMigrations";
69
74
  export * from "./getBranchSchema";
70
75
  export * from "./lintBranchSchema";
76
+ export * from "./listTrafficBudgets";
77
+ export * from "./createTrafficBudget";
78
+ export * from "./createTrafficRule";
79
+ export * from "./deleteTrafficRule";
80
+ export * from "./getTrafficBudget";
81
+ export * from "./updateTrafficBudget";
82
+ export * from "./deleteTrafficBudget";
71
83
  export * from "./listDatabasePostgresCidrs";
72
84
  export * from "./createDatabasePostgresCidr";
73
85
  export * from "./getDatabasePostgresCidr";
@@ -90,8 +102,12 @@ export * from "./completeRevert";
90
102
  export * from "./listDeployRequestReviews";
91
103
  export * from "./reviewDeployRequest";
92
104
  export * from "./skipRevertPeriod";
105
+ export * from "./checkDeployRequestStorage";
93
106
  export * from "./getDeployRequestThrottler";
94
107
  export * from "./updateDeployRequestThrottler";
108
+ export * from "./listMaintenanceSchedules";
109
+ export * from "./getMaintenanceSchedule";
110
+ export * from "./listMaintenanceWindows";
95
111
  export * from "./listReadOnlyRegions";
96
112
  export * from "./listDatabaseRegions";
97
113
  export * from "./listSchemaRecommendations";
@@ -6,6 +6,9 @@ import { Forbidden, NotFound } from "../errors";
6
6
  // Input Schema
7
7
  export const ListAuditLogsInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
8
  organization: Schema.String.pipe(T.PathParam()),
9
+ starting_after: Schema.optional(Schema.String),
10
+ ending_before: Schema.optional(Schema.String),
11
+ limit: Schema.optional(Schema.Number),
9
12
  }).pipe(
10
13
  T.Http({ method: "GET", path: "/organizations/{organization}/audit-log" }),
11
14
  );
@@ -46,6 +49,9 @@ export type ListAuditLogsOutput = typeof ListAuditLogsOutput.Type;
46
49
  * List audit logs
47
50
  *
48
51
  * @param organization - The name of the organization
52
+ * @param starting_after - If provided, returns results after the specified cursor
53
+ * @param ending_before - If provided, returns results before the specified cursor
54
+ * @param limit - If provided, specifies the number of returned results (max 100)
49
55
  */
50
56
  export const listAuditLogs = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
51
57
  inputSchema: ListAuditLogsInput,
@@ -0,0 +1,65 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+ import { Forbidden, NotFound } from "../errors";
5
+
6
+ // Input Schema
7
+ export const ListBackupPoliciesInput =
8
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9
+ organization: Schema.String.pipe(T.PathParam()),
10
+ database: Schema.String.pipe(T.PathParam()),
11
+ page: Schema.optional(Schema.Number),
12
+ per_page: Schema.optional(Schema.Number),
13
+ }).pipe(
14
+ T.Http({
15
+ method: "GET",
16
+ path: "/organizations/{organization}/databases/{database}/backup-policies",
17
+ }),
18
+ );
19
+ export type ListBackupPoliciesInput = typeof ListBackupPoliciesInput.Type;
20
+
21
+ // Output Schema
22
+ export const ListBackupPoliciesOutput =
23
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
24
+ current_page: Schema.Number,
25
+ next_page: Schema.Number,
26
+ next_page_url: Schema.String,
27
+ prev_page: Schema.Number,
28
+ prev_page_url: Schema.String,
29
+ data: Schema.Array(
30
+ Schema.Struct({
31
+ id: Schema.String,
32
+ display_name: Schema.String,
33
+ name: Schema.String,
34
+ target: Schema.Literals(["production", "development"]),
35
+ retention_value: Schema.Number,
36
+ retention_unit: Schema.String,
37
+ frequency_value: Schema.Number,
38
+ frequency_unit: Schema.String,
39
+ schedule_time: Schema.String,
40
+ schedule_day: Schema.Number,
41
+ schedule_week: Schema.Number,
42
+ created_at: Schema.String,
43
+ updated_at: Schema.String,
44
+ last_ran_at: Schema.String,
45
+ next_run_at: Schema.String,
46
+ required: Schema.Boolean,
47
+ }),
48
+ ),
49
+ });
50
+ export type ListBackupPoliciesOutput = typeof ListBackupPoliciesOutput.Type;
51
+
52
+ // The operation
53
+ /**
54
+ * List backup policies
55
+ *
56
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
57
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
58
+ * @param page - If provided, specifies the page offset of returned results
59
+ * @param per_page - If provided, specifies the number of returned results
60
+ */
61
+ export const listBackupPolicies = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
62
+ inputSchema: ListBackupPoliciesInput,
63
+ outputSchema: ListBackupPoliciesOutput,
64
+ errors: [Forbidden, NotFound] as const,
65
+ }));
@@ -81,6 +81,7 @@ export const ListBackupsOutput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
81
81
  backup_policy: Schema.NullOr(
82
82
  Schema.Struct({
83
83
  id: Schema.String,
84
+ display_name: Schema.String,
84
85
  name: Schema.String,
85
86
  target: Schema.Literals(["production", "development"]),
86
87
  retention_value: Schema.Number,
@@ -9,6 +9,8 @@ export const ListDeployRequestReviewsInput =
9
9
  organization: Schema.String.pipe(T.PathParam()),
10
10
  database: Schema.String.pipe(T.PathParam()),
11
11
  number: Schema.Number.pipe(T.PathParam()),
12
+ page: Schema.optional(Schema.Number),
13
+ per_page: Schema.optional(Schema.Number),
12
14
  }).pipe(
13
15
  T.Http({
14
16
  method: "GET",
@@ -52,6 +54,8 @@ export type ListDeployRequestReviewsOutput =
52
54
  * @param organization - The name of the organization the deploy request belongs to
53
55
  * @param database - The name of the database the deploy request belongs to
54
56
  * @param number - The number of the deploy request
57
+ * @param page - If provided, specifies the page offset of returned results
58
+ * @param per_page - If provided, specifies the number of returned results
55
59
  */
56
60
  export const listDeployRequestReviews = /*@__PURE__*/ /*#__PURE__*/ API.make(
57
61
  () => ({