@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.
- package/lib/operations/checkDeployRequestStorage.d.ts +32 -0
- package/lib/operations/checkDeployRequestStorage.d.ts.map +1 -0
- package/lib/operations/checkDeployRequestStorage.js +45 -0
- package/lib/operations/checkDeployRequestStorage.js.map +1 -0
- package/lib/operations/createBackup.d.ts +1 -0
- package/lib/operations/createBackup.d.ts.map +1 -1
- package/lib/operations/createBackup.js +1 -0
- package/lib/operations/createBackup.js.map +1 -1
- package/lib/operations/createBackupPolicy.d.ts +51 -0
- package/lib/operations/createBackupPolicy.d.ts.map +1 -0
- package/lib/operations/createBackupPolicy.js +64 -0
- package/lib/operations/createBackupPolicy.js.map +1 -0
- package/lib/operations/createBranch.d.ts +4 -0
- package/lib/operations/createBranch.d.ts.map +1 -1
- package/lib/operations/createBranch.js +4 -0
- package/lib/operations/createBranch.js.map +1 -1
- package/lib/operations/createDatabase.d.ts +4 -0
- package/lib/operations/createDatabase.d.ts.map +1 -1
- package/lib/operations/createDatabase.js +4 -0
- package/lib/operations/createDatabase.js.map +1 -1
- package/lib/operations/createTrafficBudget.d.ts +70 -0
- package/lib/operations/createTrafficBudget.d.ts.map +1 -0
- package/lib/operations/createTrafficBudget.js +83 -0
- package/lib/operations/createTrafficBudget.js.map +1 -0
- package/lib/operations/createTrafficRule.d.ts +47 -0
- package/lib/operations/createTrafficRule.d.ts.map +1 -0
- package/lib/operations/createTrafficRule.js +59 -0
- package/lib/operations/createTrafficRule.js.map +1 -0
- package/lib/operations/deleteBackupPolicy.d.ts +18 -0
- package/lib/operations/deleteBackupPolicy.d.ts.map +1 -0
- package/lib/operations/deleteBackupPolicy.js +30 -0
- package/lib/operations/deleteBackupPolicy.js.map +1 -0
- package/lib/operations/deleteBranch.d.ts +2 -0
- package/lib/operations/deleteBranch.d.ts.map +1 -1
- package/lib/operations/deleteBranch.js +2 -0
- package/lib/operations/deleteBranch.js.map +1 -1
- package/lib/operations/deleteTrafficBudget.d.ts +20 -0
- package/lib/operations/deleteTrafficBudget.d.ts.map +1 -0
- package/lib/operations/deleteTrafficBudget.js +33 -0
- package/lib/operations/deleteTrafficBudget.js.map +1 -0
- package/lib/operations/deleteTrafficRule.d.ts +22 -0
- package/lib/operations/deleteTrafficRule.d.ts.map +1 -0
- package/lib/operations/deleteTrafficRule.js +33 -0
- package/lib/operations/deleteTrafficRule.js.map +1 -0
- package/lib/operations/getBackup.d.ts +1 -0
- package/lib/operations/getBackup.d.ts.map +1 -1
- package/lib/operations/getBackup.js +1 -0
- package/lib/operations/getBackup.js.map +1 -1
- package/lib/operations/getBackupPolicy.d.ts +35 -0
- package/lib/operations/getBackupPolicy.d.ts.map +1 -0
- package/lib/operations/getBackupPolicy.js +46 -0
- package/lib/operations/getBackupPolicy.js.map +1 -0
- package/lib/operations/getDeployQueue.d.ts +4 -0
- package/lib/operations/getDeployQueue.d.ts.map +1 -1
- package/lib/operations/getDeployQueue.js +4 -0
- package/lib/operations/getDeployQueue.js.map +1 -1
- package/lib/operations/getMaintenanceSchedule.d.ts +37 -0
- package/lib/operations/getMaintenanceSchedule.d.ts.map +1 -0
- package/lib/operations/getMaintenanceSchedule.js +50 -0
- package/lib/operations/getMaintenanceSchedule.js.map +1 -0
- package/lib/operations/getTrafficBudget.d.ts +56 -0
- package/lib/operations/getTrafficBudget.d.ts.map +1 -0
- package/lib/operations/getTrafficBudget.js +67 -0
- package/lib/operations/getTrafficBudget.js.map +1 -0
- package/lib/operations/index.d.ts +16 -0
- package/lib/operations/index.d.ts.map +1 -1
- package/lib/operations/index.js +16 -0
- package/lib/operations/index.js.map +1 -1
- package/lib/operations/listAuditLogs.d.ts +6 -0
- package/lib/operations/listAuditLogs.d.ts.map +1 -1
- package/lib/operations/listAuditLogs.js +6 -0
- package/lib/operations/listAuditLogs.js.map +1 -1
- package/lib/operations/listBackupPolicies.d.ts +44 -0
- package/lib/operations/listBackupPolicies.d.ts.map +1 -0
- package/lib/operations/listBackupPolicies.js +57 -0
- package/lib/operations/listBackupPolicies.js.map +1 -0
- package/lib/operations/listBackups.d.ts +1 -0
- package/lib/operations/listBackups.d.ts.map +1 -1
- package/lib/operations/listBackups.js +1 -0
- package/lib/operations/listBackups.js.map +1 -1
- package/lib/operations/listDeployRequestReviews.d.ts +4 -0
- package/lib/operations/listDeployRequestReviews.d.ts.map +1 -1
- package/lib/operations/listDeployRequestReviews.js +4 -0
- package/lib/operations/listDeployRequestReviews.js.map +1 -1
- package/lib/operations/listGeneratedQueryPatternsReports.d.ts +6 -0
- package/lib/operations/listGeneratedQueryPatternsReports.d.ts.map +1 -1
- package/lib/operations/listGeneratedQueryPatternsReports.js +6 -0
- package/lib/operations/listGeneratedQueryPatternsReports.js.map +1 -1
- package/lib/operations/listMaintenanceSchedules.d.ts +46 -0
- package/lib/operations/listMaintenanceSchedules.d.ts.map +1 -0
- package/lib/operations/listMaintenanceSchedules.js +59 -0
- package/lib/operations/listMaintenanceSchedules.js.map +1 -0
- package/lib/operations/listMaintenanceWindows.d.ts +35 -0
- package/lib/operations/listMaintenanceWindows.d.ts.map +1 -0
- package/lib/operations/listMaintenanceWindows.js +48 -0
- package/lib/operations/listMaintenanceWindows.js.map +1 -0
- package/lib/operations/listOrganizationTeamMembers.d.ts +4 -0
- package/lib/operations/listOrganizationTeamMembers.d.ts.map +1 -1
- package/lib/operations/listOrganizationTeamMembers.js +4 -0
- package/lib/operations/listOrganizationTeamMembers.js.map +1 -1
- package/lib/operations/listOrganizationTeams.d.ts +4 -0
- package/lib/operations/listOrganizationTeams.d.ts.map +1 -1
- package/lib/operations/listOrganizationTeams.js +4 -0
- package/lib/operations/listOrganizationTeams.js.map +1 -1
- package/lib/operations/listSchemaRecommendations.d.ts +4 -0
- package/lib/operations/listSchemaRecommendations.d.ts.map +1 -1
- package/lib/operations/listSchemaRecommendations.js +4 -0
- package/lib/operations/listSchemaRecommendations.js.map +1 -1
- package/lib/operations/listTrafficBudgets.d.ts +71 -0
- package/lib/operations/listTrafficBudgets.d.ts.map +1 -0
- package/lib/operations/listTrafficBudgets.js +84 -0
- package/lib/operations/listTrafficBudgets.js.map +1 -0
- package/lib/operations/updateBackup.d.ts +1 -0
- package/lib/operations/updateBackup.d.ts.map +1 -1
- package/lib/operations/updateBackup.js +1 -0
- package/lib/operations/updateBackup.js.map +1 -1
- package/lib/operations/updateBackupPolicy.d.ts +53 -0
- package/lib/operations/updateBackupPolicy.d.ts.map +1 -0
- package/lib/operations/updateBackupPolicy.js +66 -0
- package/lib/operations/updateBackupPolicy.js.map +1 -0
- package/lib/operations/updateTrafficBudget.d.ts +72 -0
- package/lib/operations/updateTrafficBudget.d.ts.map +1 -0
- package/lib/operations/updateTrafficBudget.js +85 -0
- package/lib/operations/updateTrafficBudget.js.map +1 -0
- package/package.json +4 -4
- package/src/operations/checkDeployRequestStorage.ts +61 -0
- package/src/operations/createBackup.ts +1 -0
- package/src/operations/createBackupPolicy.ts +74 -0
- package/src/operations/createBranch.ts +6 -0
- package/src/operations/createDatabase.ts +6 -0
- package/src/operations/createTrafficBudget.ts +93 -0
- package/src/operations/createTrafficRule.ts +69 -0
- package/src/operations/deleteBackupPolicy.ts +36 -0
- package/src/operations/deleteBranch.ts +2 -0
- package/src/operations/deleteTrafficBudget.ts +39 -0
- package/src/operations/deleteTrafficRule.ts +41 -0
- package/src/operations/getBackup.ts +1 -0
- package/src/operations/getBackupPolicy.ts +52 -0
- package/src/operations/getDeployQueue.ts +4 -0
- package/src/operations/getMaintenanceSchedule.ts +60 -0
- package/src/operations/getTrafficBudget.ts +79 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/listAuditLogs.ts +6 -0
- package/src/operations/listBackupPolicies.ts +65 -0
- package/src/operations/listBackups.ts +1 -0
- package/src/operations/listDeployRequestReviews.ts +4 -0
- package/src/operations/listGeneratedQueryPatternsReports.ts +6 -0
- package/src/operations/listMaintenanceSchedules.ts +71 -0
- package/src/operations/listMaintenanceWindows.ts +60 -0
- package/src/operations/listOrganizationTeamMembers.ts +4 -0
- package/src/operations/listOrganizationTeams.ts +4 -0
- package/src/operations/listSchemaRecommendations.ts +4 -0
- package/src/operations/listTrafficBudgets.ts +96 -0
- package/src/operations/updateBackup.ts +1 -0
- package/src/operations/updateBackupPolicy.ts +76 -0
- package/src/operations/updateTrafficBudget.ts +95 -0
|
@@ -14,6 +14,8 @@ export const ListOrganizationTeamMembersInput =
|
|
|
14
14
|
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
15
15
|
organization: Schema.String.pipe(T.PathParam()),
|
|
16
16
|
team: Schema.String.pipe(T.PathParam()),
|
|
17
|
+
page: Schema.optional(Schema.Number),
|
|
18
|
+
per_page: Schema.optional(Schema.Number),
|
|
17
19
|
}).pipe(
|
|
18
20
|
T.Http({
|
|
19
21
|
method: "GET",
|
|
@@ -119,6 +121,8 @@ export type ListOrganizationTeamMembersOutput =
|
|
|
119
121
|
*
|
|
120
122
|
* @param organization - The name of the organization
|
|
121
123
|
* @param team - The slug of the team
|
|
124
|
+
* @param page - If provided, specifies the page offset of returned results
|
|
125
|
+
* @param per_page - If provided, specifies the number of returned results
|
|
122
126
|
*/
|
|
123
127
|
export const listOrganizationTeamMembers = /*@__PURE__*/ /*#__PURE__*/ API.make(
|
|
124
128
|
() => ({
|
|
@@ -13,6 +13,8 @@ export const ListOrganizationTeamsInput =
|
|
|
13
13
|
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
14
14
|
organization: Schema.String.pipe(T.PathParam()),
|
|
15
15
|
q: Schema.optional(Schema.String),
|
|
16
|
+
page: Schema.optional(Schema.Number),
|
|
17
|
+
per_page: Schema.optional(Schema.Number),
|
|
16
18
|
}).pipe(
|
|
17
19
|
T.Http({ method: "GET", path: "/organizations/{organization}/teams" }),
|
|
18
20
|
);
|
|
@@ -84,6 +86,8 @@ export type ListOrganizationTeamsOutput =
|
|
|
84
86
|
*
|
|
85
87
|
* @param organization - The name of the organization
|
|
86
88
|
* @param q - Search term to filter teams by name
|
|
89
|
+
* @param page - If provided, specifies the page offset of returned results
|
|
90
|
+
* @param per_page - If provided, specifies the number of returned results
|
|
87
91
|
*/
|
|
88
92
|
export const listOrganizationTeams = /*@__PURE__*/ /*#__PURE__*/ API.make(
|
|
89
93
|
() => ({
|
|
@@ -9,6 +9,8 @@ export const ListSchemaRecommendationsInput =
|
|
|
9
9
|
organization: Schema.String.pipe(T.PathParam()),
|
|
10
10
|
database: Schema.String.pipe(T.PathParam()),
|
|
11
11
|
state: Schema.optional(Schema.Literals(["open", "closed"])),
|
|
12
|
+
page: Schema.optional(Schema.Number),
|
|
13
|
+
per_page: Schema.optional(Schema.Number),
|
|
12
14
|
}).pipe(
|
|
13
15
|
T.Http({
|
|
14
16
|
method: "GET",
|
|
@@ -74,6 +76,8 @@ export type ListSchemaRecommendationsOutput =
|
|
|
74
76
|
* @param organization - Organization name slug from `list_organizations`. Example: `acme`.
|
|
75
77
|
* @param database - Database name slug from `list_databases`. Example: `app-db`.
|
|
76
78
|
* @param state - Filter by recommendation state
|
|
79
|
+
* @param page - If provided, specifies the page offset of returned results
|
|
80
|
+
* @param per_page - If provided, specifies the number of returned results
|
|
77
81
|
*/
|
|
78
82
|
export const listSchemaRecommendations = /*@__PURE__*/ /*#__PURE__*/ API.make(
|
|
79
83
|
() => ({
|
|
@@ -0,0 +1,96 @@
|
|
|
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 ListTrafficBudgetsInput =
|
|
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
|
+
page: Schema.optional(Schema.Number),
|
|
13
|
+
per_page: Schema.optional(Schema.Number),
|
|
14
|
+
period: Schema.optional(Schema.String),
|
|
15
|
+
created_at: Schema.optional(Schema.String),
|
|
16
|
+
fingerprint: Schema.optional(Schema.String),
|
|
17
|
+
}).pipe(
|
|
18
|
+
T.Http({
|
|
19
|
+
method: "GET",
|
|
20
|
+
path: "/organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets",
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
23
|
+
export type ListTrafficBudgetsInput = typeof ListTrafficBudgetsInput.Type;
|
|
24
|
+
|
|
25
|
+
// Output Schema
|
|
26
|
+
export const ListTrafficBudgetsOutput =
|
|
27
|
+
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
28
|
+
current_page: Schema.Number,
|
|
29
|
+
next_page: Schema.Number,
|
|
30
|
+
next_page_url: Schema.String,
|
|
31
|
+
prev_page: Schema.Number,
|
|
32
|
+
prev_page_url: Schema.String,
|
|
33
|
+
data: Schema.Array(
|
|
34
|
+
Schema.Struct({
|
|
35
|
+
id: Schema.String,
|
|
36
|
+
name: Schema.String,
|
|
37
|
+
mode: Schema.Literals(["enforce", "warn", "off"]),
|
|
38
|
+
capacity: Schema.optional(Schema.Number),
|
|
39
|
+
rate: Schema.optional(Schema.Number),
|
|
40
|
+
burst: Schema.optional(Schema.Number),
|
|
41
|
+
concurrency: Schema.optional(Schema.Number),
|
|
42
|
+
warning_threshold: Schema.optional(Schema.Number),
|
|
43
|
+
actor: Schema.Struct({
|
|
44
|
+
id: Schema.String,
|
|
45
|
+
display_name: Schema.String,
|
|
46
|
+
avatar_url: Schema.String,
|
|
47
|
+
}),
|
|
48
|
+
rules: Schema.Array(
|
|
49
|
+
Schema.Struct({
|
|
50
|
+
id: Schema.String,
|
|
51
|
+
kind: Schema.Literals(["match"]),
|
|
52
|
+
tags: Schema.Array(
|
|
53
|
+
Schema.Struct({
|
|
54
|
+
key_id: Schema.String,
|
|
55
|
+
key: Schema.String,
|
|
56
|
+
value: Schema.String,
|
|
57
|
+
source: Schema.Literals(["sql", "system"]),
|
|
58
|
+
}),
|
|
59
|
+
),
|
|
60
|
+
fingerprint: Schema.optional(Schema.String),
|
|
61
|
+
keyspace: Schema.optional(Schema.String),
|
|
62
|
+
actor: Schema.Struct({
|
|
63
|
+
id: Schema.String,
|
|
64
|
+
display_name: Schema.String,
|
|
65
|
+
avatar_url: Schema.String,
|
|
66
|
+
}),
|
|
67
|
+
syntax_highlighted_sql: Schema.String,
|
|
68
|
+
created_at: Schema.String,
|
|
69
|
+
updated_at: Schema.String,
|
|
70
|
+
}),
|
|
71
|
+
),
|
|
72
|
+
created_at: Schema.String,
|
|
73
|
+
updated_at: Schema.String,
|
|
74
|
+
}),
|
|
75
|
+
),
|
|
76
|
+
});
|
|
77
|
+
export type ListTrafficBudgetsOutput = typeof ListTrafficBudgetsOutput.Type;
|
|
78
|
+
|
|
79
|
+
// The operation
|
|
80
|
+
/**
|
|
81
|
+
* List traffic budgets
|
|
82
|
+
*
|
|
83
|
+
* @param organization - Organization name slug from `list_organizations`. Example: `acme`.
|
|
84
|
+
* @param database - Database name slug from `list_databases`. Example: `app-db`.
|
|
85
|
+
* @param branch - Branch name from `list_branches`. Example: `main`.
|
|
86
|
+
* @param page - If provided, specifies the page offset of returned results
|
|
87
|
+
* @param per_page - If provided, specifies the number of returned results
|
|
88
|
+
* @param period - Time period filter (e.g., '1h', '24h', '7d')
|
|
89
|
+
* @param created_at - Filter by creation date range (format: 'start..end')
|
|
90
|
+
* @param fingerprint - Filter budgets by query fingerprint
|
|
91
|
+
*/
|
|
92
|
+
export const listTrafficBudgets = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
|
|
93
|
+
inputSchema: ListTrafficBudgetsInput,
|
|
94
|
+
outputSchema: ListTrafficBudgetsOutput,
|
|
95
|
+
errors: [Forbidden, NotFound] as const,
|
|
96
|
+
}));
|
|
@@ -58,6 +58,7 @@ export const UpdateBackupOutput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
|
58
58
|
backup_policy: Schema.NullOr(
|
|
59
59
|
Schema.Struct({
|
|
60
60
|
id: Schema.String,
|
|
61
|
+
display_name: Schema.String,
|
|
61
62
|
name: Schema.String,
|
|
62
63
|
target: Schema.Literals(["production", "development"]),
|
|
63
64
|
retention_value: Schema.Number,
|
|
@@ -0,0 +1,76 @@
|
|
|
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 UpdateBackupPolicyInput =
|
|
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
|
+
name: Schema.optional(Schema.String),
|
|
13
|
+
target: Schema.optional(Schema.Literals(["production", "development"])),
|
|
14
|
+
retention_value: Schema.optional(Schema.Number),
|
|
15
|
+
retention_unit: Schema.optional(
|
|
16
|
+
Schema.Literals(["hour", "day", "week", "month", "year"]),
|
|
17
|
+
),
|
|
18
|
+
frequency_value: Schema.optional(Schema.Number),
|
|
19
|
+
frequency_unit: Schema.optional(
|
|
20
|
+
Schema.Literals(["hour", "day", "week", "month"]),
|
|
21
|
+
),
|
|
22
|
+
schedule_time: Schema.optional(Schema.String),
|
|
23
|
+
schedule_day: Schema.optional(Schema.Number),
|
|
24
|
+
schedule_week: Schema.optional(Schema.Number),
|
|
25
|
+
}).pipe(
|
|
26
|
+
T.Http({
|
|
27
|
+
method: "PATCH",
|
|
28
|
+
path: "/organizations/{organization}/databases/{database}/backup-policies/{id}",
|
|
29
|
+
}),
|
|
30
|
+
);
|
|
31
|
+
export type UpdateBackupPolicyInput = typeof UpdateBackupPolicyInput.Type;
|
|
32
|
+
|
|
33
|
+
// Output Schema
|
|
34
|
+
export const UpdateBackupPolicyOutput =
|
|
35
|
+
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
36
|
+
id: Schema.String,
|
|
37
|
+
display_name: Schema.String,
|
|
38
|
+
name: Schema.String,
|
|
39
|
+
target: Schema.Literals(["production", "development"]),
|
|
40
|
+
retention_value: Schema.Number,
|
|
41
|
+
retention_unit: Schema.String,
|
|
42
|
+
frequency_value: Schema.Number,
|
|
43
|
+
frequency_unit: Schema.String,
|
|
44
|
+
schedule_time: Schema.String,
|
|
45
|
+
schedule_day: Schema.Number,
|
|
46
|
+
schedule_week: Schema.Number,
|
|
47
|
+
created_at: Schema.String,
|
|
48
|
+
updated_at: Schema.String,
|
|
49
|
+
last_ran_at: Schema.String,
|
|
50
|
+
next_run_at: Schema.String,
|
|
51
|
+
required: Schema.Boolean,
|
|
52
|
+
});
|
|
53
|
+
export type UpdateBackupPolicyOutput = typeof UpdateBackupPolicyOutput.Type;
|
|
54
|
+
|
|
55
|
+
// The operation
|
|
56
|
+
/**
|
|
57
|
+
* Update a backup policy
|
|
58
|
+
*
|
|
59
|
+
* @param id - The ID of the backup policy
|
|
60
|
+
* @param organization - Organization name slug from `list_organizations`. Example: `acme`.
|
|
61
|
+
* @param database - Database name slug from `list_databases`. Example: `app-db`.
|
|
62
|
+
* @param name - The name of the backup policy
|
|
63
|
+
* @param target - Whether the policy is for production or development branches
|
|
64
|
+
* @param retention_value - A number value for the retention period of the backup policy
|
|
65
|
+
* @param retention_unit - The unit for the retention period of the backup policy
|
|
66
|
+
* @param frequency_value - A number value for the frequency of the backup policy
|
|
67
|
+
* @param frequency_unit - The unit for the frequency of the backup policy
|
|
68
|
+
* @param schedule_time - The time of day that the backup is scheduled, in HH:MM format
|
|
69
|
+
* @param schedule_day - Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday
|
|
70
|
+
* @param schedule_week - Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week
|
|
71
|
+
*/
|
|
72
|
+
export const updateBackupPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
|
|
73
|
+
inputSchema: UpdateBackupPolicyInput,
|
|
74
|
+
outputSchema: UpdateBackupPolicyOutput,
|
|
75
|
+
errors: [Forbidden, NotFound] as const,
|
|
76
|
+
}));
|
|
@@ -0,0 +1,95 @@
|
|
|
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 UpdateTrafficBudgetInput =
|
|
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
|
+
name: Schema.optional(Schema.String),
|
|
14
|
+
mode: Schema.optional(Schema.Literals(["enforce", "warn", "off"])),
|
|
15
|
+
capacity: Schema.optional(Schema.Number),
|
|
16
|
+
rate: Schema.optional(Schema.Number),
|
|
17
|
+
burst: Schema.optional(Schema.Number),
|
|
18
|
+
concurrency: Schema.optional(Schema.Number),
|
|
19
|
+
warning_threshold: Schema.optional(Schema.Number),
|
|
20
|
+
rules: Schema.optional(Schema.Array(Schema.String)),
|
|
21
|
+
}).pipe(
|
|
22
|
+
T.Http({
|
|
23
|
+
method: "PATCH",
|
|
24
|
+
path: "/organizations/{organization}/databases/{database}/branches/{branch}/traffic/budgets/{id}",
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
|
+
export type UpdateTrafficBudgetInput = typeof UpdateTrafficBudgetInput.Type;
|
|
28
|
+
|
|
29
|
+
// Output Schema
|
|
30
|
+
export const UpdateTrafficBudgetOutput =
|
|
31
|
+
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
32
|
+
id: Schema.String,
|
|
33
|
+
name: Schema.String,
|
|
34
|
+
mode: Schema.Literals(["enforce", "warn", "off"]),
|
|
35
|
+
capacity: Schema.optional(Schema.Number),
|
|
36
|
+
rate: Schema.optional(Schema.Number),
|
|
37
|
+
burst: Schema.optional(Schema.Number),
|
|
38
|
+
concurrency: Schema.optional(Schema.Number),
|
|
39
|
+
warning_threshold: Schema.optional(Schema.Number),
|
|
40
|
+
actor: Schema.Struct({
|
|
41
|
+
id: Schema.String,
|
|
42
|
+
display_name: Schema.String,
|
|
43
|
+
avatar_url: Schema.String,
|
|
44
|
+
}),
|
|
45
|
+
rules: Schema.Array(
|
|
46
|
+
Schema.Struct({
|
|
47
|
+
id: Schema.String,
|
|
48
|
+
kind: Schema.Literals(["match"]),
|
|
49
|
+
tags: Schema.Array(
|
|
50
|
+
Schema.Struct({
|
|
51
|
+
key_id: Schema.String,
|
|
52
|
+
key: Schema.String,
|
|
53
|
+
value: Schema.String,
|
|
54
|
+
source: Schema.Literals(["sql", "system"]),
|
|
55
|
+
}),
|
|
56
|
+
),
|
|
57
|
+
fingerprint: Schema.optional(Schema.String),
|
|
58
|
+
keyspace: Schema.optional(Schema.String),
|
|
59
|
+
actor: Schema.Struct({
|
|
60
|
+
id: Schema.String,
|
|
61
|
+
display_name: Schema.String,
|
|
62
|
+
avatar_url: Schema.String,
|
|
63
|
+
}),
|
|
64
|
+
syntax_highlighted_sql: Schema.String,
|
|
65
|
+
created_at: Schema.String,
|
|
66
|
+
updated_at: Schema.String,
|
|
67
|
+
}),
|
|
68
|
+
),
|
|
69
|
+
created_at: Schema.String,
|
|
70
|
+
updated_at: Schema.String,
|
|
71
|
+
});
|
|
72
|
+
export type UpdateTrafficBudgetOutput = typeof UpdateTrafficBudgetOutput.Type;
|
|
73
|
+
|
|
74
|
+
// The operation
|
|
75
|
+
/**
|
|
76
|
+
* Update a traffic budget
|
|
77
|
+
*
|
|
78
|
+
* @param organization - Organization name slug from `list_organizations`. Example: `acme`.
|
|
79
|
+
* @param database - Database name slug from `list_databases`. Example: `app-db`.
|
|
80
|
+
* @param branch - Branch name from `list_branches`. Example: `main`.
|
|
81
|
+
* @param id - The ID of the traffic budget
|
|
82
|
+
* @param name - Name of the traffic budget
|
|
83
|
+
* @param mode - The mode of the traffic budget
|
|
84
|
+
* @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.
|
|
85
|
+
* @param rate - The rate at which capacity refills, as a percentage of server resources (0-100). Unlimited when not set.
|
|
86
|
+
* @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.
|
|
87
|
+
* @param concurrency - The percentage of available worker processes this policy can use (0-100). Unlimited when not set.
|
|
88
|
+
* @param warning_threshold - A percentage of capacity, burst, or concurrency thresholds to emit warnings for enforced budgets (0-100).
|
|
89
|
+
* @param rules - Array of traffic rules to apply to the budget
|
|
90
|
+
*/
|
|
91
|
+
export const updateTrafficBudget = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
|
|
92
|
+
inputSchema: UpdateTrafficBudgetInput,
|
|
93
|
+
outputSchema: UpdateTrafficBudgetOutput,
|
|
94
|
+
errors: [Forbidden, NotFound] as const,
|
|
95
|
+
}));
|