@distilled.cloud/planetscale 0.9.0 → 0.10.1

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 (156) hide show
  1. package/lib/operations/checkDeployRequestStorage.d.ts +32 -0
  2. package/lib/operations/checkDeployRequestStorage.d.ts.map +1 -0
  3. package/lib/operations/checkDeployRequestStorage.js +45 -0
  4. package/lib/operations/checkDeployRequestStorage.js.map +1 -0
  5. package/lib/operations/createBackup.d.ts +1 -0
  6. package/lib/operations/createBackup.d.ts.map +1 -1
  7. package/lib/operations/createBackup.js +1 -0
  8. package/lib/operations/createBackup.js.map +1 -1
  9. package/lib/operations/createBackupPolicy.d.ts +51 -0
  10. package/lib/operations/createBackupPolicy.d.ts.map +1 -0
  11. package/lib/operations/createBackupPolicy.js +64 -0
  12. package/lib/operations/createBackupPolicy.js.map +1 -0
  13. package/lib/operations/createBranch.d.ts +4 -0
  14. package/lib/operations/createBranch.d.ts.map +1 -1
  15. package/lib/operations/createBranch.js +4 -0
  16. package/lib/operations/createBranch.js.map +1 -1
  17. package/lib/operations/createDatabase.d.ts +4 -0
  18. package/lib/operations/createDatabase.d.ts.map +1 -1
  19. package/lib/operations/createDatabase.js +4 -0
  20. package/lib/operations/createDatabase.js.map +1 -1
  21. package/lib/operations/createTrafficBudget.d.ts +70 -0
  22. package/lib/operations/createTrafficBudget.d.ts.map +1 -0
  23. package/lib/operations/createTrafficBudget.js +83 -0
  24. package/lib/operations/createTrafficBudget.js.map +1 -0
  25. package/lib/operations/createTrafficRule.d.ts +47 -0
  26. package/lib/operations/createTrafficRule.d.ts.map +1 -0
  27. package/lib/operations/createTrafficRule.js +59 -0
  28. package/lib/operations/createTrafficRule.js.map +1 -0
  29. package/lib/operations/deleteBackupPolicy.d.ts +18 -0
  30. package/lib/operations/deleteBackupPolicy.d.ts.map +1 -0
  31. package/lib/operations/deleteBackupPolicy.js +30 -0
  32. package/lib/operations/deleteBackupPolicy.js.map +1 -0
  33. package/lib/operations/deleteBranch.d.ts +2 -0
  34. package/lib/operations/deleteBranch.d.ts.map +1 -1
  35. package/lib/operations/deleteBranch.js +2 -0
  36. package/lib/operations/deleteBranch.js.map +1 -1
  37. package/lib/operations/deleteTrafficBudget.d.ts +20 -0
  38. package/lib/operations/deleteTrafficBudget.d.ts.map +1 -0
  39. package/lib/operations/deleteTrafficBudget.js +33 -0
  40. package/lib/operations/deleteTrafficBudget.js.map +1 -0
  41. package/lib/operations/deleteTrafficRule.d.ts +22 -0
  42. package/lib/operations/deleteTrafficRule.d.ts.map +1 -0
  43. package/lib/operations/deleteTrafficRule.js +33 -0
  44. package/lib/operations/deleteTrafficRule.js.map +1 -0
  45. package/lib/operations/getBackup.d.ts +1 -0
  46. package/lib/operations/getBackup.d.ts.map +1 -1
  47. package/lib/operations/getBackup.js +1 -0
  48. package/lib/operations/getBackup.js.map +1 -1
  49. package/lib/operations/getBackupPolicy.d.ts +35 -0
  50. package/lib/operations/getBackupPolicy.d.ts.map +1 -0
  51. package/lib/operations/getBackupPolicy.js +46 -0
  52. package/lib/operations/getBackupPolicy.js.map +1 -0
  53. package/lib/operations/getDeployQueue.d.ts +4 -0
  54. package/lib/operations/getDeployQueue.d.ts.map +1 -1
  55. package/lib/operations/getDeployQueue.js +4 -0
  56. package/lib/operations/getDeployQueue.js.map +1 -1
  57. package/lib/operations/getMaintenanceSchedule.d.ts +37 -0
  58. package/lib/operations/getMaintenanceSchedule.d.ts.map +1 -0
  59. package/lib/operations/getMaintenanceSchedule.js +50 -0
  60. package/lib/operations/getMaintenanceSchedule.js.map +1 -0
  61. package/lib/operations/getTrafficBudget.d.ts +56 -0
  62. package/lib/operations/getTrafficBudget.d.ts.map +1 -0
  63. package/lib/operations/getTrafficBudget.js +67 -0
  64. package/lib/operations/getTrafficBudget.js.map +1 -0
  65. package/lib/operations/index.d.ts +16 -0
  66. package/lib/operations/index.d.ts.map +1 -1
  67. package/lib/operations/index.js +16 -0
  68. package/lib/operations/index.js.map +1 -1
  69. package/lib/operations/listAuditLogs.d.ts +6 -0
  70. package/lib/operations/listAuditLogs.d.ts.map +1 -1
  71. package/lib/operations/listAuditLogs.js +6 -0
  72. package/lib/operations/listAuditLogs.js.map +1 -1
  73. package/lib/operations/listBackupPolicies.d.ts +44 -0
  74. package/lib/operations/listBackupPolicies.d.ts.map +1 -0
  75. package/lib/operations/listBackupPolicies.js +57 -0
  76. package/lib/operations/listBackupPolicies.js.map +1 -0
  77. package/lib/operations/listBackups.d.ts +1 -0
  78. package/lib/operations/listBackups.d.ts.map +1 -1
  79. package/lib/operations/listBackups.js +1 -0
  80. package/lib/operations/listBackups.js.map +1 -1
  81. package/lib/operations/listDeployRequestReviews.d.ts +4 -0
  82. package/lib/operations/listDeployRequestReviews.d.ts.map +1 -1
  83. package/lib/operations/listDeployRequestReviews.js +4 -0
  84. package/lib/operations/listDeployRequestReviews.js.map +1 -1
  85. package/lib/operations/listGeneratedQueryPatternsReports.d.ts +6 -0
  86. package/lib/operations/listGeneratedQueryPatternsReports.d.ts.map +1 -1
  87. package/lib/operations/listGeneratedQueryPatternsReports.js +6 -0
  88. package/lib/operations/listGeneratedQueryPatternsReports.js.map +1 -1
  89. package/lib/operations/listMaintenanceSchedules.d.ts +46 -0
  90. package/lib/operations/listMaintenanceSchedules.d.ts.map +1 -0
  91. package/lib/operations/listMaintenanceSchedules.js +59 -0
  92. package/lib/operations/listMaintenanceSchedules.js.map +1 -0
  93. package/lib/operations/listMaintenanceWindows.d.ts +35 -0
  94. package/lib/operations/listMaintenanceWindows.d.ts.map +1 -0
  95. package/lib/operations/listMaintenanceWindows.js +48 -0
  96. package/lib/operations/listMaintenanceWindows.js.map +1 -0
  97. package/lib/operations/listOrganizationTeamMembers.d.ts +4 -0
  98. package/lib/operations/listOrganizationTeamMembers.d.ts.map +1 -1
  99. package/lib/operations/listOrganizationTeamMembers.js +4 -0
  100. package/lib/operations/listOrganizationTeamMembers.js.map +1 -1
  101. package/lib/operations/listOrganizationTeams.d.ts +4 -0
  102. package/lib/operations/listOrganizationTeams.d.ts.map +1 -1
  103. package/lib/operations/listOrganizationTeams.js +4 -0
  104. package/lib/operations/listOrganizationTeams.js.map +1 -1
  105. package/lib/operations/listSchemaRecommendations.d.ts +4 -0
  106. package/lib/operations/listSchemaRecommendations.d.ts.map +1 -1
  107. package/lib/operations/listSchemaRecommendations.js +4 -0
  108. package/lib/operations/listSchemaRecommendations.js.map +1 -1
  109. package/lib/operations/listTrafficBudgets.d.ts +71 -0
  110. package/lib/operations/listTrafficBudgets.d.ts.map +1 -0
  111. package/lib/operations/listTrafficBudgets.js +84 -0
  112. package/lib/operations/listTrafficBudgets.js.map +1 -0
  113. package/lib/operations/updateBackup.d.ts +1 -0
  114. package/lib/operations/updateBackup.d.ts.map +1 -1
  115. package/lib/operations/updateBackup.js +1 -0
  116. package/lib/operations/updateBackup.js.map +1 -1
  117. package/lib/operations/updateBackupPolicy.d.ts +53 -0
  118. package/lib/operations/updateBackupPolicy.d.ts.map +1 -0
  119. package/lib/operations/updateBackupPolicy.js +66 -0
  120. package/lib/operations/updateBackupPolicy.js.map +1 -0
  121. package/lib/operations/updateTrafficBudget.d.ts +72 -0
  122. package/lib/operations/updateTrafficBudget.d.ts.map +1 -0
  123. package/lib/operations/updateTrafficBudget.js +85 -0
  124. package/lib/operations/updateTrafficBudget.js.map +1 -0
  125. package/package.json +4 -4
  126. package/src/operations/checkDeployRequestStorage.ts +61 -0
  127. package/src/operations/createBackup.ts +1 -0
  128. package/src/operations/createBackupPolicy.ts +74 -0
  129. package/src/operations/createBranch.ts +6 -0
  130. package/src/operations/createDatabase.ts +6 -0
  131. package/src/operations/createTrafficBudget.ts +93 -0
  132. package/src/operations/createTrafficRule.ts +69 -0
  133. package/src/operations/deleteBackupPolicy.ts +36 -0
  134. package/src/operations/deleteBranch.ts +2 -0
  135. package/src/operations/deleteTrafficBudget.ts +39 -0
  136. package/src/operations/deleteTrafficRule.ts +41 -0
  137. package/src/operations/getBackup.ts +1 -0
  138. package/src/operations/getBackupPolicy.ts +52 -0
  139. package/src/operations/getDeployQueue.ts +4 -0
  140. package/src/operations/getMaintenanceSchedule.ts +60 -0
  141. package/src/operations/getTrafficBudget.ts +79 -0
  142. package/src/operations/index.ts +16 -0
  143. package/src/operations/listAuditLogs.ts +6 -0
  144. package/src/operations/listBackupPolicies.ts +65 -0
  145. package/src/operations/listBackups.ts +1 -0
  146. package/src/operations/listDeployRequestReviews.ts +4 -0
  147. package/src/operations/listGeneratedQueryPatternsReports.ts +6 -0
  148. package/src/operations/listMaintenanceSchedules.ts +71 -0
  149. package/src/operations/listMaintenanceWindows.ts +60 -0
  150. package/src/operations/listOrganizationTeamMembers.ts +4 -0
  151. package/src/operations/listOrganizationTeams.ts +4 -0
  152. package/src/operations/listSchemaRecommendations.ts +4 -0
  153. package/src/operations/listTrafficBudgets.ts +96 -0
  154. package/src/operations/updateBackup.ts +1 -0
  155. package/src/operations/updateBackupPolicy.ts +76 -0
  156. package/src/operations/updateTrafficBudget.ts +95 -0
@@ -0,0 +1,53 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const UpdateBackupPolicyInput: Schema.Struct<{
3
+ readonly id: Schema.String;
4
+ readonly organization: Schema.String;
5
+ readonly database: Schema.String;
6
+ readonly name: Schema.optional<Schema.String>;
7
+ readonly target: Schema.optional<Schema.Literals<readonly ["production", "development"]>>;
8
+ readonly retention_value: Schema.optional<Schema.Number>;
9
+ readonly retention_unit: Schema.optional<Schema.Literals<readonly ["hour", "day", "week", "month", "year"]>>;
10
+ readonly frequency_value: Schema.optional<Schema.Number>;
11
+ readonly frequency_unit: Schema.optional<Schema.Literals<readonly ["hour", "day", "week", "month"]>>;
12
+ readonly schedule_time: Schema.optional<Schema.String>;
13
+ readonly schedule_day: Schema.optional<Schema.Number>;
14
+ readonly schedule_week: Schema.optional<Schema.Number>;
15
+ }>;
16
+ export type UpdateBackupPolicyInput = typeof UpdateBackupPolicyInput.Type;
17
+ export declare const UpdateBackupPolicyOutput: Schema.Struct<{
18
+ readonly id: Schema.String;
19
+ readonly display_name: Schema.String;
20
+ readonly name: Schema.String;
21
+ readonly target: Schema.Literals<readonly ["production", "development"]>;
22
+ readonly retention_value: Schema.Number;
23
+ readonly retention_unit: Schema.String;
24
+ readonly frequency_value: Schema.Number;
25
+ readonly frequency_unit: Schema.String;
26
+ readonly schedule_time: Schema.String;
27
+ readonly schedule_day: Schema.Number;
28
+ readonly schedule_week: Schema.Number;
29
+ readonly created_at: Schema.String;
30
+ readonly updated_at: Schema.String;
31
+ readonly last_ran_at: Schema.String;
32
+ readonly next_run_at: Schema.String;
33
+ readonly required: Schema.Boolean;
34
+ }>;
35
+ export type UpdateBackupPolicyOutput = typeof UpdateBackupPolicyOutput.Type;
36
+ /**
37
+ * Update a backup policy
38
+ *
39
+ * @param id - The ID of the backup policy
40
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
41
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
42
+ * @param name - The name of the backup policy
43
+ * @param target - Whether the policy is for production or development branches
44
+ * @param retention_value - A number value for the retention period of the backup policy
45
+ * @param retention_unit - The unit for the retention period of the backup policy
46
+ * @param frequency_value - A number value for the frequency of the backup policy
47
+ * @param frequency_unit - The unit for the frequency of the backup policy
48
+ * @param schedule_time - The time of day that the backup is scheduled, in HH:MM format
49
+ * @param schedule_day - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
50
+ * @param schedule_week - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
51
+ */
52
+ export declare const updateBackupPolicy: any;
53
+ //# sourceMappingURL=updateBackupPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateBackupPolicy.d.ts","sourceRoot":"","sources":["../../src/operations/updateBackupPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAMxC,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;EAuBjC,CAAC;AACJ,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAC,IAAI,CAAC;AAG1E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;EAkBjC,CAAC;AACL,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAC,IAAI,CAAC;AAG5E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,KAI5B,CAAC"}
@@ -0,0 +1,66 @@
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
+ // Input Schema
6
+ export const UpdateBackupPolicyInput =
7
+ /*@__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
+ name: Schema.optional(Schema.String),
12
+ target: Schema.optional(Schema.Literals(["production", "development"])),
13
+ retention_value: Schema.optional(Schema.Number),
14
+ retention_unit: Schema.optional(Schema.Literals(["hour", "day", "week", "month", "year"])),
15
+ frequency_value: Schema.optional(Schema.Number),
16
+ frequency_unit: Schema.optional(Schema.Literals(["hour", "day", "week", "month"])),
17
+ schedule_time: Schema.optional(Schema.String),
18
+ schedule_day: Schema.optional(Schema.Number),
19
+ schedule_week: Schema.optional(Schema.Number),
20
+ }).pipe(T.Http({
21
+ method: "PATCH",
22
+ path: "/organizations/{organization}/databases/{database}/backup-policies/{id}",
23
+ }));
24
+ // Output Schema
25
+ export const UpdateBackupPolicyOutput =
26
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
27
+ id: Schema.String,
28
+ display_name: Schema.String,
29
+ name: Schema.String,
30
+ target: Schema.Literals(["production", "development"]),
31
+ retention_value: Schema.Number,
32
+ retention_unit: Schema.String,
33
+ frequency_value: Schema.Number,
34
+ frequency_unit: Schema.String,
35
+ schedule_time: Schema.String,
36
+ schedule_day: Schema.Number,
37
+ schedule_week: Schema.Number,
38
+ created_at: Schema.String,
39
+ updated_at: Schema.String,
40
+ last_ran_at: Schema.String,
41
+ next_run_at: Schema.String,
42
+ required: Schema.Boolean,
43
+ });
44
+ // The operation
45
+ /**
46
+ * Update a backup policy
47
+ *
48
+ * @param id - The ID of the backup policy
49
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
50
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
51
+ * @param name - The name of the backup policy
52
+ * @param target - Whether the policy is for production or development branches
53
+ * @param retention_value - A number value for the retention period of the backup policy
54
+ * @param retention_unit - The unit for the retention period of the backup policy
55
+ * @param frequency_value - A number value for the frequency of the backup policy
56
+ * @param frequency_unit - The unit for the frequency of the backup policy
57
+ * @param schedule_time - The time of day that the backup is scheduled, in HH:MM format
58
+ * @param schedule_day - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
59
+ * @param schedule_week - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
60
+ */
61
+ export const updateBackupPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
62
+ inputSchema: UpdateBackupPolicyInput,
63
+ outputSchema: UpdateBackupPolicyOutput,
64
+ errors: [Forbidden, NotFound],
65
+ }));
66
+ //# sourceMappingURL=updateBackupPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateBackupPolicy.js","sourceRoot":"","sources":["../../src/operations/updateBackupPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,CAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEhD,eAAe;AACf,MAAM,CAAC,MAAM,uBAAuB;AAClC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SA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AE,MAAM,CAAC,MAAM;IACjB,YAAY,EAAE,MAAM,CAAC,MAAM;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACtD,eAAe,EAAE,MAAM,CAAC,MAAM;IAC9B,cAAc,EAAE,MAAM,CAAC,MAAM;IAC7B,eAAe,EAAE,MAAM,CAAC,MAAM;IAC9B,cAAc,EAAE,MAAM,CAAC,MAAM;IAC7B,aAAa,EAAE,MAAM,CAAC,MAAM;IAC5B,YAAY,EAAE,MAAM,CAAC,MAAM;IAC3B,aAAa,EAAE,MAAM,CAAC,MAAM;IAC5B,UAAU,EAAE,MAAM,CAAC,MAAM;IACzB,UAAU,EAAE,MAAM,CAAC,MAAM;IACzB,WAAW,EAAE,MAAM,CAAC,MAAM;IAC1B,WAAW,EAAE,MAAM,CAAC,MAAM;IAC1B,QAAQ,EAAE,MAAM,CAAC,OAAO;CACzB,CAAC,CAAC;AAGL,gBAAgB;AAChB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5E,WAAW,EAAE,uBAAuB;IACpC,YAAY,EAAE,wBAAwB;IACtC,MAAM,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAU;CACvC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,72 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const UpdateTrafficBudgetInput: Schema.Struct<{
3
+ readonly organization: Schema.String;
4
+ readonly database: Schema.String;
5
+ readonly branch: Schema.String;
6
+ readonly id: Schema.String;
7
+ readonly name: Schema.optional<Schema.String>;
8
+ readonly mode: Schema.optional<Schema.Literals<readonly ["enforce", "warn", "off"]>>;
9
+ readonly capacity: Schema.optional<Schema.Number>;
10
+ readonly rate: Schema.optional<Schema.Number>;
11
+ readonly burst: Schema.optional<Schema.Number>;
12
+ readonly concurrency: Schema.optional<Schema.Number>;
13
+ readonly warning_threshold: Schema.optional<Schema.Number>;
14
+ readonly rules: Schema.optional<Schema.$Array<Schema.String>>;
15
+ }>;
16
+ export type UpdateTrafficBudgetInput = typeof UpdateTrafficBudgetInput.Type;
17
+ export declare const UpdateTrafficBudgetOutput: Schema.Struct<{
18
+ readonly id: Schema.String;
19
+ readonly name: Schema.String;
20
+ readonly mode: Schema.Literals<readonly ["enforce", "warn", "off"]>;
21
+ readonly capacity: Schema.optional<Schema.Number>;
22
+ readonly rate: Schema.optional<Schema.Number>;
23
+ readonly burst: Schema.optional<Schema.Number>;
24
+ readonly concurrency: Schema.optional<Schema.Number>;
25
+ readonly warning_threshold: Schema.optional<Schema.Number>;
26
+ readonly actor: Schema.Struct<{
27
+ readonly id: Schema.String;
28
+ readonly display_name: Schema.String;
29
+ readonly avatar_url: Schema.String;
30
+ }>;
31
+ readonly rules: Schema.$Array<Schema.Struct<{
32
+ readonly id: Schema.String;
33
+ readonly kind: Schema.Literals<readonly ["match"]>;
34
+ readonly tags: Schema.$Array<Schema.Struct<{
35
+ readonly key_id: Schema.String;
36
+ readonly key: Schema.String;
37
+ readonly value: Schema.String;
38
+ readonly source: Schema.Literals<readonly ["sql", "system"]>;
39
+ }>>;
40
+ readonly fingerprint: Schema.optional<Schema.String>;
41
+ readonly keyspace: Schema.optional<Schema.String>;
42
+ readonly actor: Schema.Struct<{
43
+ readonly id: Schema.String;
44
+ readonly display_name: Schema.String;
45
+ readonly avatar_url: Schema.String;
46
+ }>;
47
+ readonly syntax_highlighted_sql: Schema.String;
48
+ readonly created_at: Schema.String;
49
+ readonly updated_at: Schema.String;
50
+ }>>;
51
+ readonly created_at: Schema.String;
52
+ readonly updated_at: Schema.String;
53
+ }>;
54
+ export type UpdateTrafficBudgetOutput = typeof UpdateTrafficBudgetOutput.Type;
55
+ /**
56
+ * Update a traffic budget
57
+ *
58
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
59
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
60
+ * @param branch - Branch name from `list_branches`. Example: `main`.
61
+ * @param id - The ID of the traffic budget
62
+ * @param name - Name of the traffic budget
63
+ * @param mode - The mode of the traffic budget
64
+ * @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.
65
+ * @param rate - The rate at which capacity refills, as a percentage of server resources (0-100). Unlimited when not set.
66
+ * @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.
67
+ * @param concurrency - The percentage of available worker processes this policy can use (0-100). Unlimited when not set.
68
+ * @param warning_threshold - A percentage of capacity, burst, or concurrency thresholds to emit warnings for enforced budgets (0-100).
69
+ * @param rules - Array of traffic rules to apply to the budget
70
+ */
71
+ export declare const updateTrafficBudget: any;
72
+ //# sourceMappingURL=updateTrafficBudget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateTrafficBudget.d.ts","sourceRoot":"","sources":["../../src/operations/updateTrafficBudget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAMxC,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;EAmBlC,CAAC;AACJ,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAC,IAAI,CAAC;AAG5E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyClC,CAAC;AACL,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC,IAAI,CAAC;AAG9E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,KAI7B,CAAC"}
@@ -0,0 +1,85 @@
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
+ // Input Schema
6
+ export const UpdateTrafficBudgetInput =
7
+ /*@__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
+ 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(T.Http({
21
+ method: "PATCH",
22
+ path: "/organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{id}",
23
+ }));
24
+ // Output Schema
25
+ export const UpdateTrafficBudgetOutput =
26
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
27
+ id: Schema.String,
28
+ name: Schema.String,
29
+ mode: Schema.Literals(["enforce", "warn", "off"]),
30
+ capacity: Schema.optional(Schema.Number),
31
+ rate: Schema.optional(Schema.Number),
32
+ burst: Schema.optional(Schema.Number),
33
+ concurrency: Schema.optional(Schema.Number),
34
+ warning_threshold: Schema.optional(Schema.Number),
35
+ actor: Schema.Struct({
36
+ id: Schema.String,
37
+ display_name: Schema.String,
38
+ avatar_url: Schema.String,
39
+ }),
40
+ rules: Schema.Array(Schema.Struct({
41
+ id: Schema.String,
42
+ kind: Schema.Literals(["match"]),
43
+ tags: Schema.Array(Schema.Struct({
44
+ key_id: Schema.String,
45
+ key: Schema.String,
46
+ value: Schema.String,
47
+ source: Schema.Literals(["sql", "system"]),
48
+ })),
49
+ fingerprint: Schema.optional(Schema.String),
50
+ keyspace: Schema.optional(Schema.String),
51
+ actor: Schema.Struct({
52
+ id: Schema.String,
53
+ display_name: Schema.String,
54
+ avatar_url: Schema.String,
55
+ }),
56
+ syntax_highlighted_sql: Schema.String,
57
+ created_at: Schema.String,
58
+ updated_at: Schema.String,
59
+ })),
60
+ created_at: Schema.String,
61
+ updated_at: Schema.String,
62
+ });
63
+ // The operation
64
+ /**
65
+ * Update a traffic budget
66
+ *
67
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
68
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
69
+ * @param branch - Branch name from `list_branches`. Example: `main`.
70
+ * @param id - The ID of the traffic budget
71
+ * @param name - Name of the traffic budget
72
+ * @param mode - The mode of the traffic budget
73
+ * @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.
74
+ * @param rate - The rate at which capacity refills, as a percentage of server resources (0-100). Unlimited when not set.
75
+ * @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.
76
+ * @param concurrency - The percentage of available worker processes this policy can use (0-100). Unlimited when not set.
77
+ * @param warning_threshold - A percentage of capacity, burst, or concurrency thresholds to emit warnings for enforced budgets (0-100).
78
+ * @param rules - Array of traffic rules to apply to the budget
79
+ */
80
+ export const updateTrafficBudget = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
81
+ inputSchema: UpdateTrafficBudgetInput,
82
+ outputSchema: UpdateTrafficBudgetOutput,
83
+ errors: [Forbidden, NotFound],
84
+ }));
85
+ //# sourceMappingURL=updateTrafficBudget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateTrafficBudget.js","sourceRoot":"","sources":["../../src/operations/updateTrafficBudget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,CAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEhD,eAAe;AACf,MAAM,CAAC,MAAM,wBAAwB;AACnC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,YAA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MAAM,CAAC;YACnB,EAAE,EAAE,MAAM,CAAC,MAAM;YACjB,YAAY,EAAE,MAAM,CAAC,MAAM;YAC3B,UAAU,EAAE,MAAM,CAAC,MAAM;SAC1B,CAAC;QACF,sBAAsB,EAAE,MAAM,CAAC,MAAM;QACrC,UAAU,EAAE,MAAM,CAAC,MAAM;QACzB,UAAU,EAAE,MAAM,CAAC,MAAM;KAC1B,CAAC,CACH;IACD,UAAU,EAAE,MAAM,CAAC,MAAM;IACzB,UAAU,EAAE,MAAM,CAAC,MAAM;CAC1B,CAAC,CAAC;AAGL,gBAAgB;AAChB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7E,WAAW,EAAE,wBAAwB;IACrC,YAAY,EAAE,yBAAyB;IACvC,MAAM,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAU;CACvC,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/planetscale",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/alchemy-run/distilled",
@@ -73,8 +73,8 @@
73
73
  "specs:update": "git -C specs/distilled-spec-planetscale fetch && git -C specs/distilled-spec-planetscale checkout main && git -C specs/distilled-spec-planetscale pull"
74
74
  },
75
75
  "dependencies": {
76
- "@distilled.cloud/core": "0.9.0",
77
- "effect": "4.0.0-beta.46"
76
+ "@distilled.cloud/core": "0.10.1",
77
+ "effect": "4.0.0-beta.48"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@types/bun": "^1.3.0",
@@ -83,6 +83,6 @@
83
83
  "vitest": "^3.2.3"
84
84
  },
85
85
  "peerDependencies": {
86
- "effect": "4.0.0-beta.46"
86
+ "effect": "4.0.0-beta.48"
87
87
  }
88
88
  }
@@ -0,0 +1,61 @@
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 CheckDeployRequestStorageInput =
8
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9
+ organization: Schema.String.pipe(T.PathParam()),
10
+ database: Schema.String.pipe(T.PathParam()),
11
+ number: Schema.Number.pipe(T.PathParam()),
12
+ }).pipe(
13
+ T.Http({
14
+ method: "GET",
15
+ path: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/storage-check",
16
+ }),
17
+ );
18
+ export type CheckDeployRequestStorageInput =
19
+ typeof CheckDeployRequestStorageInput.Type;
20
+
21
+ // Output Schema
22
+ export const CheckDeployRequestStorageOutput =
23
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
24
+ enough_storage: Schema.Boolean,
25
+ upgradeable: Schema.Boolean,
26
+ storage_bytes_needed: Schema.Number,
27
+ storage_report: Schema.Record(
28
+ Schema.String,
29
+ Schema.Record(
30
+ Schema.String,
31
+ Schema.Struct({
32
+ used: Schema.optional(Schema.Number),
33
+ capacity: Schema.optional(Schema.Number),
34
+ remaining: Schema.optional(Schema.Number),
35
+ percentage_used: Schema.optional(Schema.Number),
36
+ storage_needed: Schema.optional(Schema.Number),
37
+ has_enough: Schema.optional(Schema.Boolean),
38
+ }),
39
+ ),
40
+ ),
41
+ });
42
+ export type CheckDeployRequestStorageOutput =
43
+ typeof CheckDeployRequestStorageOutput.Type;
44
+
45
+ // The operation
46
+ /**
47
+ * Check deploy request storage
48
+ *
49
+ * Checks whether the deploy request's target branch cluster has enough storage to safely deploy the schema changes.
50
+ *
51
+ * @param organization - The name of the deploy request's organization
52
+ * @param database - The name of the deploy request's database
53
+ * @param number - The number of the deploy request
54
+ */
55
+ export const checkDeployRequestStorage = /*@__PURE__*/ /*#__PURE__*/ API.make(
56
+ () => ({
57
+ inputSchema: CheckDeployRequestStorageInput,
58
+ outputSchema: CheckDeployRequestStorageOutput,
59
+ errors: [Forbidden, NotFound] as const,
60
+ }),
61
+ );
@@ -62,6 +62,7 @@ export const CreateBackupOutput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
62
62
  backup_policy: Schema.NullOr(
63
63
  Schema.Struct({
64
64
  id: Schema.String,
65
+ display_name: Schema.String,
65
66
  name: Schema.String,
66
67
  target: Schema.Literals(["production", "development"]),
67
68
  retention_value: Schema.Number,
@@ -0,0 +1,74 @@
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 CreateBackupPolicyInput =
8
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
9
+ organization: Schema.String.pipe(T.PathParam()),
10
+ database: Schema.String.pipe(T.PathParam()),
11
+ name: Schema.optional(Schema.String),
12
+ target: Schema.optional(Schema.Literals(["production", "development"])),
13
+ retention_value: Schema.optional(Schema.Number),
14
+ retention_unit: Schema.optional(
15
+ Schema.Literals(["hour", "day", "week", "month", "year"]),
16
+ ),
17
+ frequency_value: Schema.optional(Schema.Number),
18
+ frequency_unit: Schema.optional(
19
+ Schema.Literals(["hour", "day", "week", "month"]),
20
+ ),
21
+ schedule_time: Schema.optional(Schema.String),
22
+ schedule_day: Schema.optional(Schema.Number),
23
+ schedule_week: Schema.optional(Schema.Number),
24
+ }).pipe(
25
+ T.Http({
26
+ method: "POST",
27
+ path: "/organizations/{organization}/databases/{database}/backup-policies",
28
+ }),
29
+ );
30
+ export type CreateBackupPolicyInput = typeof CreateBackupPolicyInput.Type;
31
+
32
+ // Output Schema
33
+ export const CreateBackupPolicyOutput =
34
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
35
+ id: Schema.String,
36
+ display_name: Schema.String,
37
+ name: Schema.String,
38
+ target: Schema.Literals(["production", "development"]),
39
+ retention_value: Schema.Number,
40
+ retention_unit: Schema.String,
41
+ frequency_value: Schema.Number,
42
+ frequency_unit: Schema.String,
43
+ schedule_time: Schema.String,
44
+ schedule_day: Schema.Number,
45
+ schedule_week: Schema.Number,
46
+ created_at: Schema.String,
47
+ updated_at: Schema.String,
48
+ last_ran_at: Schema.String,
49
+ next_run_at: Schema.String,
50
+ required: Schema.Boolean,
51
+ });
52
+ export type CreateBackupPolicyOutput = typeof CreateBackupPolicyOutput.Type;
53
+
54
+ // The operation
55
+ /**
56
+ * Create a backup policy
57
+ *
58
+ * @param organization - Organization name slug from `list_organizations`. Example: `acme`.
59
+ * @param database - Database name slug from `list_databases`. Example: `app-db`.
60
+ * @param name - The name of the backup policy
61
+ * @param target - Whether the policy is for production or development branches
62
+ * @param retention_value - A number value for the retention period of the backup policy
63
+ * @param retention_unit - The unit for the retention period of the backup policy
64
+ * @param frequency_value - A number value for the frequency of the backup policy
65
+ * @param frequency_unit - The unit for the frequency of the backup policy
66
+ * @param schedule_time - The time of day that the backup is scheduled, in HH:MM format
67
+ * @param schedule_day - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
68
+ * @param schedule_week - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
69
+ */
70
+ export const createBackupPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
71
+ inputSchema: CreateBackupPolicyInput,
72
+ outputSchema: CreateBackupPolicyOutput,
73
+ errors: [Forbidden, NotFound] as const,
74
+ }));
@@ -14,6 +14,12 @@ export const CreateBranchInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
14
14
  restore_point: Schema.optional(Schema.String),
15
15
  seed_data: Schema.optional(Schema.Literals(["last_successful_backup"])),
16
16
  cluster_size: Schema.optional(Schema.String),
17
+ storage: Schema.optional(
18
+ Schema.Struct({
19
+ minimum_storage_bytes: Schema.optional(Schema.Number),
20
+ maximum_storage_bytes: Schema.optional(Schema.Number),
21
+ }),
22
+ ),
17
23
  major_version: Schema.optional(Schema.String),
18
24
  }).pipe(
19
25
  T.Http({
@@ -12,6 +12,12 @@ export const CreateDatabaseInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
12
12
  replicas: Schema.optional(Schema.Number),
13
13
  kind: Schema.optional(Schema.Literals(["mysql", "postgresql"])),
14
14
  major_version: Schema.optional(Schema.String),
15
+ storage: Schema.optional(
16
+ Schema.Struct({
17
+ minimum_storage_bytes: Schema.optional(Schema.Number),
18
+ maximum_storage_bytes: Schema.optional(Schema.Number),
19
+ }),
20
+ ),
15
21
  }).pipe(
16
22
  T.Http({ method: "POST", path: "/organizations/{organization}/databases" }),
17
23
  );
@@ -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
+ }));