@distilled.cloud/turso 0.30.2 → 1.0.0-rc.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/credentials.d.ts.map +1 -1
- package/lib/credentials.js +8 -0
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts +24 -3
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +13 -4
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +8 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -6
- package/lib/index.js.map +1 -1
- package/lib/protocol.d.ts +18 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +46 -0
- package/lib/protocol.js.map +1 -0
- package/lib/retry.d.ts +4 -4
- package/lib/retry.js +4 -4
- package/lib/services/index.d.ts +2 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +3 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/turso.d.ts +1280 -0
- package/lib/services/turso.d.ts.map +1 -0
- package/lib/services/turso.js +1463 -0
- package/lib/services/turso.js.map +1 -0
- package/lib/traits.d.ts +10 -2
- package/lib/traits.d.ts.map +1 -1
- package/lib/traits.js +10 -2
- package/lib/traits.js.map +1 -1
- package/package.json +31 -37
- package/src/credentials.ts +8 -0
- package/src/errors.ts +42 -5
- package/src/index.ts +12 -6
- package/src/protocol.ts +68 -0
- package/src/retry.ts +4 -4
- package/src/services/index.ts +2 -0
- package/src/services/turso.ts +3426 -0
- package/src/traits.ts +44 -2
- package/README.md +0 -36
- package/lib/category.d.ts +0 -5
- package/lib/category.d.ts.map +0 -1
- package/lib/category.js +0 -5
- package/lib/category.js.map +0 -1
- package/lib/client.d.ts +0 -11
- package/lib/client.d.ts.map +0 -1
- package/lib/client.js +0 -59
- package/lib/client.js.map +0 -1
- package/lib/operations/addLocationToGroup.d.ts +0 -30
- package/lib/operations/addLocationToGroup.d.ts.map +0 -1
- package/lib/operations/addLocationToGroup.js +0 -40
- package/lib/operations/addLocationToGroup.js.map +0 -1
- package/lib/operations/addOrganizationMember.d.ts +0 -22
- package/lib/operations/addOrganizationMember.d.ts.map +0 -1
- package/lib/operations/addOrganizationMember.js +0 -32
- package/lib/operations/addOrganizationMember.js.map +0 -1
- package/lib/operations/createAPIToken.d.ts +0 -28
- package/lib/operations/createAPIToken.d.ts.map +0 -1
- package/lib/operations/createAPIToken.js +0 -44
- package/lib/operations/createAPIToken.js.map +0 -1
- package/lib/operations/createDatabase.d.ts +0 -35
- package/lib/operations/createDatabase.d.ts.map +0 -1
- package/lib/operations/createDatabase.js +0 -53
- package/lib/operations/createDatabase.js.map +0 -1
- package/lib/operations/createDatabaseToken.d.ts +0 -30
- package/lib/operations/createDatabaseToken.d.ts.map +0 -1
- package/lib/operations/createDatabaseToken.js +0 -40
- package/lib/operations/createDatabaseToken.js.map +0 -1
- package/lib/operations/createGroup.d.ts +0 -29
- package/lib/operations/createGroup.d.ts.map +0 -1
- package/lib/operations/createGroup.js +0 -51
- package/lib/operations/createGroup.js.map +0 -1
- package/lib/operations/createGroupToken.d.ts +0 -30
- package/lib/operations/createGroupToken.d.ts.map +0 -1
- package/lib/operations/createGroupToken.js +0 -38
- package/lib/operations/createGroupToken.js.map +0 -1
- package/lib/operations/deleteDatabase.d.ts +0 -21
- package/lib/operations/deleteDatabase.d.ts.map +0 -1
- package/lib/operations/deleteDatabase.js +0 -29
- package/lib/operations/deleteDatabase.js.map +0 -1
- package/lib/operations/deleteGroup.d.ts +0 -28
- package/lib/operations/deleteGroup.d.ts.map +0 -1
- package/lib/operations/deleteGroup.js +0 -36
- package/lib/operations/deleteGroup.js.map +0 -1
- package/lib/operations/deleteOrganizationInviteByEmail.d.ts +0 -21
- package/lib/operations/deleteOrganizationInviteByEmail.d.ts.map +0 -1
- package/lib/operations/deleteOrganizationInviteByEmail.js +0 -30
- package/lib/operations/deleteOrganizationInviteByEmail.js.map +0 -1
- package/lib/operations/deleteOrganizationInviteByEmailV2.d.ts +0 -18
- package/lib/operations/deleteOrganizationInviteByEmailV2.d.ts.map +0 -1
- package/lib/operations/deleteOrganizationInviteByEmailV2.js +0 -29
- package/lib/operations/deleteOrganizationInviteByEmailV2.js.map +0 -1
- package/lib/operations/getCurrentUser.d.ts +0 -23
- package/lib/operations/getCurrentUser.d.ts.map +0 -1
- package/lib/operations/getCurrentUser.js +0 -26
- package/lib/operations/getCurrentUser.js.map +0 -1
- package/lib/operations/getDatabase.d.ts +0 -36
- package/lib/operations/getDatabase.d.ts.map +0 -1
- package/lib/operations/getDatabase.js +0 -44
- package/lib/operations/getDatabase.js.map +0 -1
- package/lib/operations/getDatabaseConfiguration.d.ts +0 -27
- package/lib/operations/getDatabaseConfiguration.d.ts.map +0 -1
- package/lib/operations/getDatabaseConfiguration.js +0 -37
- package/lib/operations/getDatabaseConfiguration.js.map +0 -1
- package/lib/operations/getDatabaseInstance.d.ts +0 -29
- package/lib/operations/getDatabaseInstance.d.ts.map +0 -1
- package/lib/operations/getDatabaseInstance.js +0 -39
- package/lib/operations/getDatabaseInstance.js.map +0 -1
- package/lib/operations/getDatabaseStats.d.ts +0 -25
- package/lib/operations/getDatabaseStats.d.ts.map +0 -1
- package/lib/operations/getDatabaseStats.js +0 -33
- package/lib/operations/getDatabaseStats.js.map +0 -1
- package/lib/operations/getDatabaseUsage.d.ts +0 -42
- package/lib/operations/getDatabaseUsage.d.ts.map +0 -1
- package/lib/operations/getDatabaseUsage.js +0 -50
- package/lib/operations/getDatabaseUsage.js.map +0 -1
- package/lib/operations/getGroup.d.ts +0 -28
- package/lib/operations/getGroup.d.ts.map +0 -1
- package/lib/operations/getGroup.js +0 -36
- package/lib/operations/getGroup.js.map +0 -1
- package/lib/operations/getGroupConfiguration.d.ts +0 -21
- package/lib/operations/getGroupConfiguration.d.ts.map +0 -1
- package/lib/operations/getGroupConfiguration.js +0 -31
- package/lib/operations/getGroupConfiguration.js.map +0 -1
- package/lib/operations/getOrganization.d.ts +0 -30
- package/lib/operations/getOrganization.d.ts.map +0 -1
- package/lib/operations/getOrganization.js +0 -35
- package/lib/operations/getOrganization.js.map +0 -1
- package/lib/operations/getOrganizationMember.d.ts +0 -25
- package/lib/operations/getOrganizationMember.d.ts.map +0 -1
- package/lib/operations/getOrganizationMember.js +0 -35
- package/lib/operations/getOrganizationMember.js.map +0 -1
- package/lib/operations/getOrganizationSubscription.d.ts +0 -23
- package/lib/operations/getOrganizationSubscription.d.ts.map +0 -1
- package/lib/operations/getOrganizationSubscription.js +0 -32
- package/lib/operations/getOrganizationSubscription.js.map +0 -1
- package/lib/operations/getOrganizationUsage.d.ts +0 -47
- package/lib/operations/getOrganizationUsage.d.ts.map +0 -1
- package/lib/operations/getOrganizationUsage.js +0 -56
- package/lib/operations/getOrganizationUsage.js.map +0 -1
- package/lib/operations/index.d.ts +0 -50
- package/lib/operations/index.d.ts.map +0 -1
- package/lib/operations/index.js +0 -50
- package/lib/operations/index.js.map +0 -1
- package/lib/operations/invalidateDatabaseTokens.d.ts +0 -19
- package/lib/operations/invalidateDatabaseTokens.d.ts.map +0 -1
- package/lib/operations/invalidateDatabaseTokens.js +0 -29
- package/lib/operations/invalidateDatabaseTokens.js.map +0 -1
- package/lib/operations/invalidateGroupTokens.d.ts +0 -19
- package/lib/operations/invalidateGroupTokens.d.ts.map +0 -1
- package/lib/operations/invalidateGroupTokens.js +0 -29
- package/lib/operations/invalidateGroupTokens.js.map +0 -1
- package/lib/operations/inviteOrganizationMember.d.ts +0 -69
- package/lib/operations/inviteOrganizationMember.d.ts.map +0 -1
- package/lib/operations/inviteOrganizationMember.js +0 -54
- package/lib/operations/inviteOrganizationMember.js.map +0 -1
- package/lib/operations/inviteOrganizationMemberV2.d.ts +0 -25
- package/lib/operations/inviteOrganizationMemberV2.d.ts.map +0 -1
- package/lib/operations/inviteOrganizationMemberV2.js +0 -34
- package/lib/operations/inviteOrganizationMemberV2.js.map +0 -1
- package/lib/operations/listAPITokens.d.ts +0 -22
- package/lib/operations/listAPITokens.d.ts.map +0 -1
- package/lib/operations/listAPITokens.js +0 -25
- package/lib/operations/listAPITokens.js.map +0 -1
- package/lib/operations/listDatabaseInstances.d.ts +0 -27
- package/lib/operations/listDatabaseInstances.d.ts.map +0 -1
- package/lib/operations/listDatabaseInstances.js +0 -37
- package/lib/operations/listDatabaseInstances.js.map +0 -1
- package/lib/operations/listDatabases.d.ts +0 -39
- package/lib/operations/listDatabases.d.ts.map +0 -1
- package/lib/operations/listDatabases.js +0 -46
- package/lib/operations/listDatabases.js.map +0 -1
- package/lib/operations/listGroups.d.ts +0 -25
- package/lib/operations/listGroups.d.ts.map +0 -1
- package/lib/operations/listGroups.js +0 -32
- package/lib/operations/listGroups.js.map +0 -1
- package/lib/operations/listLocations.d.ts +0 -15
- package/lib/operations/listLocations.d.ts.map +0 -1
- package/lib/operations/listLocations.js +0 -18
- package/lib/operations/listLocations.js.map +0 -1
- package/lib/operations/listOrganizationAPITokens.d.ts +0 -33
- package/lib/operations/listOrganizationAPITokens.d.ts.map +0 -1
- package/lib/operations/listOrganizationAPITokens.js +0 -42
- package/lib/operations/listOrganizationAPITokens.js.map +0 -1
- package/lib/operations/listOrganizationAuditLogs.d.ts +0 -35
- package/lib/operations/listOrganizationAuditLogs.d.ts.map +0 -1
- package/lib/operations/listOrganizationAuditLogs.js +0 -69
- package/lib/operations/listOrganizationAuditLogs.js.map +0 -1
- package/lib/operations/listOrganizationInvites.d.ts +0 -64
- package/lib/operations/listOrganizationInvites.d.ts.map +0 -1
- package/lib/operations/listOrganizationInvites.js +0 -50
- package/lib/operations/listOrganizationInvites.js.map +0 -1
- package/lib/operations/listOrganizationInvitesV2.d.ts +0 -23
- package/lib/operations/listOrganizationInvitesV2.d.ts.map +0 -1
- package/lib/operations/listOrganizationInvitesV2.js +0 -32
- package/lib/operations/listOrganizationInvitesV2.js.map +0 -1
- package/lib/operations/listOrganizationInvoices.d.ts +0 -27
- package/lib/operations/listOrganizationInvoices.d.ts.map +0 -1
- package/lib/operations/listOrganizationInvoices.js +0 -36
- package/lib/operations/listOrganizationInvoices.js.map +0 -1
- package/lib/operations/listOrganizationMembers.d.ts +0 -22
- package/lib/operations/listOrganizationMembers.d.ts.map +0 -1
- package/lib/operations/listOrganizationMembers.js +0 -31
- package/lib/operations/listOrganizationMembers.js.map +0 -1
- package/lib/operations/listOrganizationPlans.d.ts +0 -34
- package/lib/operations/listOrganizationPlans.d.ts.map +0 -1
- package/lib/operations/listOrganizationPlans.js +0 -43
- package/lib/operations/listOrganizationPlans.js.map +0 -1
- package/lib/operations/listOrganizations.d.ts +0 -24
- package/lib/operations/listOrganizations.d.ts.map +0 -1
- package/lib/operations/listOrganizations.js +0 -27
- package/lib/operations/listOrganizations.js.map +0 -1
- package/lib/operations/removeLocationFromGroup.d.ts +0 -30
- package/lib/operations/removeLocationFromGroup.d.ts.map +0 -1
- package/lib/operations/removeLocationFromGroup.js +0 -40
- package/lib/operations/removeLocationFromGroup.js.map +0 -1
- package/lib/operations/removeOrganizationMember.d.ts +0 -21
- package/lib/operations/removeOrganizationMember.d.ts.map +0 -1
- package/lib/operations/removeOrganizationMember.js +0 -31
- package/lib/operations/removeOrganizationMember.js.map +0 -1
- package/lib/operations/revokeAPIToken.d.ts +0 -19
- package/lib/operations/revokeAPIToken.d.ts.map +0 -1
- package/lib/operations/revokeAPIToken.js +0 -24
- package/lib/operations/revokeAPIToken.js.map +0 -1
- package/lib/operations/revokeOrganizationAPIToken.d.ts +0 -25
- package/lib/operations/revokeOrganizationAPIToken.d.ts.map +0 -1
- package/lib/operations/revokeOrganizationAPIToken.js +0 -34
- package/lib/operations/revokeOrganizationAPIToken.js.map +0 -1
- package/lib/operations/transferGroup.d.ts +0 -27
- package/lib/operations/transferGroup.d.ts.map +0 -1
- package/lib/operations/transferGroup.js +0 -35
- package/lib/operations/transferGroup.js.map +0 -1
- package/lib/operations/unarchiveGroup.d.ts +0 -28
- package/lib/operations/unarchiveGroup.d.ts.map +0 -1
- package/lib/operations/unarchiveGroup.js +0 -36
- package/lib/operations/unarchiveGroup.js.map +0 -1
- package/lib/operations/updateDatabaseConfiguration.d.ts +0 -34
- package/lib/operations/updateDatabaseConfiguration.d.ts.map +0 -1
- package/lib/operations/updateDatabaseConfiguration.js +0 -44
- package/lib/operations/updateDatabaseConfiguration.js.map +0 -1
- package/lib/operations/updateGroupConfiguration.d.ts +0 -22
- package/lib/operations/updateGroupConfiguration.d.ts.map +0 -1
- package/lib/operations/updateGroupConfiguration.js +0 -32
- package/lib/operations/updateGroupConfiguration.js.map +0 -1
- package/lib/operations/updateGroupDatabases.d.ts +0 -19
- package/lib/operations/updateGroupDatabases.d.ts.map +0 -1
- package/lib/operations/updateGroupDatabases.js +0 -29
- package/lib/operations/updateGroupDatabases.js.map +0 -1
- package/lib/operations/updateMemberRole.d.ts +0 -26
- package/lib/operations/updateMemberRole.d.ts.map +0 -1
- package/lib/operations/updateMemberRole.js +0 -34
- package/lib/operations/updateMemberRole.js.map +0 -1
- package/lib/operations/updateOrganization.d.ts +0 -31
- package/lib/operations/updateOrganization.d.ts.map +0 -1
- package/lib/operations/updateOrganization.js +0 -37
- package/lib/operations/updateOrganization.js.map +0 -1
- package/lib/operations/validateAPIToken.d.ts +0 -15
- package/lib/operations/validateAPIToken.d.ts.map +0 -1
- package/lib/operations/validateAPIToken.js +0 -18
- package/lib/operations/validateAPIToken.js.map +0 -1
- package/lib/sensitive.d.ts +0 -5
- package/lib/sensitive.d.ts.map +0 -1
- package/lib/sensitive.js +0 -5
- package/lib/sensitive.js.map +0 -1
- package/src/category.ts +0 -4
- package/src/client.ts +0 -74
- package/src/operations/addLocationToGroup.ts +0 -63
- package/src/operations/addOrganizationMember.ts +0 -49
- package/src/operations/createAPIToken.ts +0 -77
- package/src/operations/createDatabase.ts +0 -94
- package/src/operations/createDatabaseToken.ts +0 -62
- package/src/operations/createGroup.ts +0 -92
- package/src/operations/createGroupToken.ts +0 -58
- package/src/operations/deleteDatabase.ts +0 -42
- package/src/operations/deleteGroup.ts +0 -58
- package/src/operations/deleteOrganizationInviteByEmail.ts +0 -38
- package/src/operations/deleteOrganizationInviteByEmailV2.ts +0 -40
- package/src/operations/getCurrentUser.ts +0 -46
- package/src/operations/getDatabase.ts +0 -74
- package/src/operations/getDatabaseConfiguration.ts +0 -56
- package/src/operations/getDatabaseInstance.ts +0 -61
- package/src/operations/getDatabaseStats.ts +0 -54
- package/src/operations/getDatabaseUsage.ts +0 -92
- package/src/operations/getGroup.ts +0 -58
- package/src/operations/getGroupConfiguration.ts +0 -44
- package/src/operations/getOrganization.ts +0 -60
- package/src/operations/getOrganizationMember.ts +0 -56
- package/src/operations/getOrganizationSubscription.ts +0 -51
- package/src/operations/getOrganizationUsage.ts +0 -113
- package/src/operations/index.ts +0 -49
- package/src/operations/invalidateDatabaseTokens.ts +0 -40
- package/src/operations/invalidateGroupTokens.ts +0 -40
- package/src/operations/inviteOrganizationMember.ts +0 -66
- package/src/operations/inviteOrganizationMemberV2.ts +0 -55
- package/src/operations/listAPITokens.ts +0 -46
- package/src/operations/listDatabaseInstances.ts +0 -60
- package/src/operations/listDatabases.ts +0 -80
- package/src/operations/listGroups.ts +0 -55
- package/src/operations/listLocations.ts +0 -28
- package/src/operations/listOrganizationAPITokens.ts +0 -68
- package/src/operations/listOrganizationAuditLogs.ts +0 -128
- package/src/operations/listOrganizationInvites.ts +0 -64
- package/src/operations/listOrganizationInvitesV2.ts +0 -53
- package/src/operations/listOrganizationInvoices.ts +0 -60
- package/src/operations/listOrganizationMembers.ts +0 -53
- package/src/operations/listOrganizationPlans.ts +0 -78
- package/src/operations/listOrganizations.ts +0 -48
- package/src/operations/removeLocationFromGroup.ts +0 -63
- package/src/operations/removeOrganizationMember.ts +0 -44
- package/src/operations/revokeAPIToken.ts +0 -36
- package/src/operations/revokeOrganizationAPIToken.ts +0 -47
- package/src/operations/transferGroup.ts +0 -54
- package/src/operations/unarchiveGroup.ts +0 -58
- package/src/operations/updateDatabaseConfiguration.ts +0 -70
- package/src/operations/updateGroupConfiguration.ts +0 -46
- package/src/operations/updateGroupDatabases.ts +0 -40
- package/src/operations/updateMemberRole.ts +0 -54
- package/src/operations/updateOrganization.ts +0 -64
- package/src/operations/validateAPIToken.ts +0 -28
- package/src/sensitive.ts +0 -4
package/src/client.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Turso API Client.
|
|
3
|
-
*
|
|
4
|
-
* Wraps the shared REST client from sdk-core with Turso-specific
|
|
5
|
-
* error matching and credential handling.
|
|
6
|
-
*/
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import * as Redacted from "effect/Redacted";
|
|
9
|
-
import * as Schema from "effect/Schema";
|
|
10
|
-
import { makeAPI } from "@distilled.cloud/core/client";
|
|
11
|
-
import { parseRetryAfterForStatus } from "@distilled.cloud/core/retry-after";
|
|
12
|
-
import { Retry } from "./retry.ts";
|
|
13
|
-
import {
|
|
14
|
-
HTTP_STATUS_MAP,
|
|
15
|
-
UnknownTursoError,
|
|
16
|
-
TursoParseError,
|
|
17
|
-
} from "./errors.ts";
|
|
18
|
-
|
|
19
|
-
// Re-export for backwards compatibility
|
|
20
|
-
export { UnknownTursoError } from "./errors.ts";
|
|
21
|
-
import { Credentials } from "./credentials.ts";
|
|
22
|
-
|
|
23
|
-
// API Error Response Schema
|
|
24
|
-
// Turso returns { error: string, code?: string }
|
|
25
|
-
const ApiErrorResponse = Schema.Struct({
|
|
26
|
-
error: Schema.String,
|
|
27
|
-
code: Schema.optional(Schema.String),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Match a Turso API error response to the appropriate error class based on HTTP status.
|
|
32
|
-
*/
|
|
33
|
-
const matchError = (
|
|
34
|
-
status: number,
|
|
35
|
-
errorBody: unknown,
|
|
36
|
-
_errors?: readonly unknown[],
|
|
37
|
-
headers?: Record<string, string | undefined>,
|
|
38
|
-
): Effect.Effect<never, unknown> => {
|
|
39
|
-
try {
|
|
40
|
-
const parsed = Schema.decodeUnknownSync(ApiErrorResponse)(errorBody);
|
|
41
|
-
const ErrorClass = (HTTP_STATUS_MAP as any)[status];
|
|
42
|
-
if (ErrorClass) {
|
|
43
|
-
return Effect.fail(
|
|
44
|
-
new ErrorClass({
|
|
45
|
-
message: parsed.error,
|
|
46
|
-
retryAfter: parseRetryAfterForStatus(status, headers),
|
|
47
|
-
}),
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
return Effect.fail(
|
|
51
|
-
new UnknownTursoError({
|
|
52
|
-
code: parsed.code,
|
|
53
|
-
message: parsed.error,
|
|
54
|
-
body: errorBody,
|
|
55
|
-
}),
|
|
56
|
-
);
|
|
57
|
-
} catch {
|
|
58
|
-
return Effect.fail(new UnknownTursoError({ body: errorBody }));
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Turso API client.
|
|
64
|
-
*/
|
|
65
|
-
export const API = makeAPI<Credentials>({
|
|
66
|
-
credentials: Credentials as any,
|
|
67
|
-
getBaseUrl: (creds: any) => creds.apiBaseUrl,
|
|
68
|
-
getAuthHeaders: (creds: any) => ({
|
|
69
|
-
Authorization: `Bearer ${Redacted.value(creds.apiKey)}`,
|
|
70
|
-
}),
|
|
71
|
-
matchError,
|
|
72
|
-
ParseError: TursoParseError as any,
|
|
73
|
-
retry: Retry as any,
|
|
74
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { API } from "../client.ts";
|
|
3
|
-
import * as T from "../traits.ts";
|
|
4
|
-
import { BadRequest, NotFound } from "../errors.ts";
|
|
5
|
-
|
|
6
|
-
// Input Schema
|
|
7
|
-
export interface AddLocationToGroupInput {
|
|
8
|
-
organizationSlug: string;
|
|
9
|
-
groupName: string;
|
|
10
|
-
location: string;
|
|
11
|
-
}
|
|
12
|
-
export const AddLocationToGroupInput =
|
|
13
|
-
/*@__PURE__*/ Schema.Struct({
|
|
14
|
-
organizationSlug: Schema.String.pipe(T.PathParam()),
|
|
15
|
-
groupName: Schema.String.pipe(T.PathParam()),
|
|
16
|
-
location: Schema.String.pipe(T.PathParam()),
|
|
17
|
-
}).pipe(
|
|
18
|
-
T.Http({
|
|
19
|
-
method: "POST",
|
|
20
|
-
path: "/v1/organizations/{organizationSlug}/groups/{groupName}/locations/{location}",
|
|
21
|
-
}),
|
|
22
|
-
) as unknown as Schema.Codec<AddLocationToGroupInput>;
|
|
23
|
-
|
|
24
|
-
// Output Schema
|
|
25
|
-
export interface AddLocationToGroupOutput {
|
|
26
|
-
group?: {
|
|
27
|
-
name?: string;
|
|
28
|
-
version?: string;
|
|
29
|
-
uuid?: string;
|
|
30
|
-
locations?: string[];
|
|
31
|
-
primary?: string;
|
|
32
|
-
delete_protection?: boolean;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export const AddLocationToGroupOutput =
|
|
36
|
-
/*@__PURE__*/ Schema.Struct({
|
|
37
|
-
group: Schema.optional(
|
|
38
|
-
Schema.Struct({
|
|
39
|
-
name: Schema.optional(Schema.String),
|
|
40
|
-
version: Schema.optional(Schema.String),
|
|
41
|
-
uuid: Schema.optional(Schema.String),
|
|
42
|
-
locations: Schema.optional(Schema.Array(Schema.String)),
|
|
43
|
-
primary: Schema.optional(Schema.String),
|
|
44
|
-
delete_protection: Schema.optional(Schema.Boolean),
|
|
45
|
-
}),
|
|
46
|
-
),
|
|
47
|
-
}) as unknown as Schema.Codec<AddLocationToGroupOutput>;
|
|
48
|
-
|
|
49
|
-
// The operation
|
|
50
|
-
/**
|
|
51
|
-
* Add Location to Group
|
|
52
|
-
*
|
|
53
|
-
* Adds a location to the specified group.
|
|
54
|
-
*
|
|
55
|
-
* @param organizationSlug - The slug of the organization or user account.
|
|
56
|
-
* @param groupName - The name of the group.
|
|
57
|
-
* @param location - The location code to add to the group.
|
|
58
|
-
*/
|
|
59
|
-
export const addLocationToGroup = /*@__PURE__*/ API.make(() => ({
|
|
60
|
-
inputSchema: AddLocationToGroupInput,
|
|
61
|
-
outputSchema: AddLocationToGroupOutput,
|
|
62
|
-
errors: [BadRequest, NotFound] as const,
|
|
63
|
-
}));
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { API } from "../client.ts";
|
|
3
|
-
import * as T from "../traits.ts";
|
|
4
|
-
import { BadRequest, NotFound, Conflict } from "../errors.ts";
|
|
5
|
-
|
|
6
|
-
// Input Schema
|
|
7
|
-
export interface AddOrganizationMemberInput {
|
|
8
|
-
organizationSlug: string;
|
|
9
|
-
username?: string;
|
|
10
|
-
role?: "admin" | "member" | "viewer";
|
|
11
|
-
}
|
|
12
|
-
export const AddOrganizationMemberInput =
|
|
13
|
-
/*@__PURE__*/ Schema.Struct({
|
|
14
|
-
organizationSlug: Schema.String.pipe(T.PathParam()),
|
|
15
|
-
username: Schema.optional(Schema.String),
|
|
16
|
-
role: Schema.optional(Schema.Literals(["admin", "member", "viewer"])),
|
|
17
|
-
}).pipe(
|
|
18
|
-
T.Http({
|
|
19
|
-
method: "POST",
|
|
20
|
-
path: "/v1/organizations/{organizationSlug}/members",
|
|
21
|
-
}),
|
|
22
|
-
) as unknown as Schema.Codec<AddOrganizationMemberInput>;
|
|
23
|
-
|
|
24
|
-
// Output Schema
|
|
25
|
-
export interface AddOrganizationMemberOutput {
|
|
26
|
-
member?: string;
|
|
27
|
-
role?: "owner" | "admin" | "member" | "viewer";
|
|
28
|
-
}
|
|
29
|
-
export const AddOrganizationMemberOutput =
|
|
30
|
-
/*@__PURE__*/ Schema.Struct({
|
|
31
|
-
member: Schema.optional(Schema.String),
|
|
32
|
-
role: Schema.optional(
|
|
33
|
-
Schema.Literals(["owner", "admin", "member", "viewer"]),
|
|
34
|
-
),
|
|
35
|
-
}) as unknown as Schema.Codec<AddOrganizationMemberOutput>;
|
|
36
|
-
|
|
37
|
-
// The operation
|
|
38
|
-
/**
|
|
39
|
-
* Add Member
|
|
40
|
-
*
|
|
41
|
-
* Add an existing Turso user to an organization.
|
|
42
|
-
*
|
|
43
|
-
* @param organizationSlug - The slug of the organization or user account.
|
|
44
|
-
*/
|
|
45
|
-
export const addOrganizationMember = /*@__PURE__*/ API.make(() => ({
|
|
46
|
-
inputSchema: AddOrganizationMemberInput,
|
|
47
|
-
outputSchema: AddOrganizationMemberOutput,
|
|
48
|
-
errors: [BadRequest, NotFound, Conflict] as const,
|
|
49
|
-
}));
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { API } from "../client.ts";
|
|
3
|
-
import * as T from "../traits.ts";
|
|
4
|
-
|
|
5
|
-
// Input Schema
|
|
6
|
-
export interface CreateAPITokenInput {
|
|
7
|
-
tokenName: string;
|
|
8
|
-
organization?: string;
|
|
9
|
-
group?: string;
|
|
10
|
-
scopes?: (
|
|
11
|
-
| "read"
|
|
12
|
-
| "db:create"
|
|
13
|
-
| "db:delete"
|
|
14
|
-
| "db:configure"
|
|
15
|
-
| "db:mint-token"
|
|
16
|
-
| "db:rotate-creds"
|
|
17
|
-
| "group:configure"
|
|
18
|
-
| "group:mint-token"
|
|
19
|
-
| "group:rotate-creds"
|
|
20
|
-
| "read-only"
|
|
21
|
-
| "full-access"
|
|
22
|
-
)[];
|
|
23
|
-
}
|
|
24
|
-
export const CreateAPITokenInput = /*@__PURE__*/ Schema.Struct({
|
|
25
|
-
tokenName: Schema.String.pipe(T.PathParam()),
|
|
26
|
-
organization: Schema.optional(Schema.String),
|
|
27
|
-
group: Schema.optional(Schema.String),
|
|
28
|
-
scopes: Schema.optional(
|
|
29
|
-
Schema.Array(
|
|
30
|
-
Schema.Literals([
|
|
31
|
-
"read",
|
|
32
|
-
"db:create",
|
|
33
|
-
"db:delete",
|
|
34
|
-
"db:configure",
|
|
35
|
-
"db:mint-token",
|
|
36
|
-
"db:rotate-creds",
|
|
37
|
-
"group:configure",
|
|
38
|
-
"group:mint-token",
|
|
39
|
-
"group:rotate-creds",
|
|
40
|
-
"read-only",
|
|
41
|
-
"full-access",
|
|
42
|
-
]),
|
|
43
|
-
),
|
|
44
|
-
),
|
|
45
|
-
}).pipe(
|
|
46
|
-
T.Http({ method: "POST", path: "/v1/auth/api-tokens/{tokenName}" }),
|
|
47
|
-
) as unknown as Schema.Codec<CreateAPITokenInput>;
|
|
48
|
-
|
|
49
|
-
// Output Schema
|
|
50
|
-
export interface CreateAPITokenOutput {
|
|
51
|
-
name?: string;
|
|
52
|
-
id?: string;
|
|
53
|
-
token?: string;
|
|
54
|
-
}
|
|
55
|
-
export const CreateAPITokenOutput = /*@__PURE__*/ Schema.Struct({
|
|
56
|
-
name: Schema.optional(Schema.String),
|
|
57
|
-
id: Schema.optional(Schema.String),
|
|
58
|
-
token: Schema.optional(Schema.String),
|
|
59
|
-
}) as unknown as Schema.Codec<CreateAPITokenOutput>;
|
|
60
|
-
|
|
61
|
-
// The operation
|
|
62
|
-
/**
|
|
63
|
-
* Create API Token
|
|
64
|
-
*
|
|
65
|
-
* Returns a new API token belonging to a user.
|
|
66
|
-
* The token can be minted at three levels of restriction, in increasing order of narrowness:
|
|
67
|
-
* - **Organization-scoped** — pass `organization`. The token can only act on resources inside that organization.
|
|
68
|
-
* - **Group-scoped** — pass `organization`, `group`, and `scopes`. The token is pinned to a single group inside the organization and only the operations listed in `scopes` are allowed. The caller must be an admin or owner of the organization.
|
|
69
|
-
* - **Unrestricted** *(deprecated)* — no request body. The token can act on every organization the caller belongs to. **Unrestricted tokens are deprecated and will be removed in a future release.** Always pass `organization` for new tokens and rotate existing unrestricted tokens to scoped tokens.
|
|
70
|
-
* Group-scoped tokens are designed for automations that should be able to provision and manage databases inside a single group without being able to touch the rest of the organization.
|
|
71
|
-
*
|
|
72
|
-
* @param tokenName - The name of the api token.
|
|
73
|
-
*/
|
|
74
|
-
export const createAPIToken = /*@__PURE__*/ API.make(() => ({
|
|
75
|
-
inputSchema: CreateAPITokenInput,
|
|
76
|
-
outputSchema: CreateAPITokenOutput,
|
|
77
|
-
}));
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { API } from "../client.ts";
|
|
3
|
-
import * as T from "../traits.ts";
|
|
4
|
-
import { BadRequest, Conflict } from "../errors.ts";
|
|
5
|
-
|
|
6
|
-
// Input Schema
|
|
7
|
-
export interface CreateDatabaseInput {
|
|
8
|
-
organizationSlug: string;
|
|
9
|
-
name: string;
|
|
10
|
-
group: string;
|
|
11
|
-
seed?: {
|
|
12
|
-
type?: "database" | "database_upload";
|
|
13
|
-
name?: string;
|
|
14
|
-
timestamp?: string;
|
|
15
|
-
};
|
|
16
|
-
size_limit?: string;
|
|
17
|
-
remote_encryption?: {
|
|
18
|
-
encryption_key?: string;
|
|
19
|
-
encryption_cipher?:
|
|
20
|
-
| "aes256gcm"
|
|
21
|
-
| "aes128gcm"
|
|
22
|
-
| "chacha20poly1305"
|
|
23
|
-
| "aegis128l"
|
|
24
|
-
| "aegis128x2"
|
|
25
|
-
| "aegis128x4"
|
|
26
|
-
| "aegis256"
|
|
27
|
-
| "aegis256x2"
|
|
28
|
-
| "aegis256x4";
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export const CreateDatabaseInput = /*@__PURE__*/ Schema.Struct({
|
|
32
|
-
organizationSlug: Schema.String.pipe(T.PathParam()),
|
|
33
|
-
name: Schema.String,
|
|
34
|
-
group: Schema.String,
|
|
35
|
-
seed: Schema.optional(
|
|
36
|
-
Schema.Struct({
|
|
37
|
-
type: Schema.optional(Schema.Literals(["database", "database_upload"])),
|
|
38
|
-
name: Schema.optional(Schema.String),
|
|
39
|
-
timestamp: Schema.optional(Schema.String),
|
|
40
|
-
}),
|
|
41
|
-
),
|
|
42
|
-
size_limit: Schema.optional(Schema.String),
|
|
43
|
-
remote_encryption: Schema.optional(
|
|
44
|
-
Schema.Struct({
|
|
45
|
-
encryption_key: Schema.optional(Schema.String),
|
|
46
|
-
encryption_cipher: Schema.optional(
|
|
47
|
-
Schema.Literals([
|
|
48
|
-
"aes256gcm",
|
|
49
|
-
"aes128gcm",
|
|
50
|
-
"chacha20poly1305",
|
|
51
|
-
"aegis128l",
|
|
52
|
-
"aegis128x2",
|
|
53
|
-
"aegis128x4",
|
|
54
|
-
"aegis256",
|
|
55
|
-
"aegis256x2",
|
|
56
|
-
"aegis256x4",
|
|
57
|
-
]),
|
|
58
|
-
),
|
|
59
|
-
}),
|
|
60
|
-
),
|
|
61
|
-
}).pipe(
|
|
62
|
-
T.Http({
|
|
63
|
-
method: "POST",
|
|
64
|
-
path: "/v1/organizations/{organizationSlug}/databases",
|
|
65
|
-
}),
|
|
66
|
-
) as unknown as Schema.Codec<CreateDatabaseInput>;
|
|
67
|
-
|
|
68
|
-
// Output Schema
|
|
69
|
-
export interface CreateDatabaseOutput {
|
|
70
|
-
database?: { DbId?: string; Hostname?: string; Name?: string };
|
|
71
|
-
}
|
|
72
|
-
export const CreateDatabaseOutput = /*@__PURE__*/ Schema.Struct({
|
|
73
|
-
database: Schema.optional(
|
|
74
|
-
Schema.Struct({
|
|
75
|
-
DbId: Schema.optional(Schema.String),
|
|
76
|
-
Hostname: Schema.optional(Schema.String),
|
|
77
|
-
Name: Schema.optional(Schema.String),
|
|
78
|
-
}),
|
|
79
|
-
),
|
|
80
|
-
}) as unknown as Schema.Codec<CreateDatabaseOutput>;
|
|
81
|
-
|
|
82
|
-
// The operation
|
|
83
|
-
/**
|
|
84
|
-
* Create Database
|
|
85
|
-
*
|
|
86
|
-
* Creates a new database in a group for the organization or user.
|
|
87
|
-
*
|
|
88
|
-
* @param organizationSlug - The slug of the organization or user account.
|
|
89
|
-
*/
|
|
90
|
-
export const createDatabase = /*@__PURE__*/ API.make(() => ({
|
|
91
|
-
inputSchema: CreateDatabaseInput,
|
|
92
|
-
outputSchema: CreateDatabaseOutput,
|
|
93
|
-
errors: [BadRequest, Conflict] as const,
|
|
94
|
-
}));
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { API } from "../client.ts";
|
|
3
|
-
import * as T from "../traits.ts";
|
|
4
|
-
import { BadRequest, NotFound } from "../errors.ts";
|
|
5
|
-
|
|
6
|
-
// Input Schema
|
|
7
|
-
export interface CreateDatabaseTokenInput {
|
|
8
|
-
organizationSlug: string;
|
|
9
|
-
databaseName: string;
|
|
10
|
-
expiration?: string;
|
|
11
|
-
authorization?: "full-access" | "read-only";
|
|
12
|
-
permissions?: { read_attach?: { databases?: string[] } };
|
|
13
|
-
}
|
|
14
|
-
export const CreateDatabaseTokenInput =
|
|
15
|
-
/*@__PURE__*/ Schema.Struct({
|
|
16
|
-
organizationSlug: Schema.String.pipe(T.PathParam()),
|
|
17
|
-
databaseName: Schema.String.pipe(T.PathParam()),
|
|
18
|
-
expiration: Schema.optional(Schema.String),
|
|
19
|
-
authorization: Schema.optional(
|
|
20
|
-
Schema.Literals(["full-access", "read-only"]),
|
|
21
|
-
),
|
|
22
|
-
permissions: Schema.optional(
|
|
23
|
-
Schema.Struct({
|
|
24
|
-
read_attach: Schema.optional(
|
|
25
|
-
Schema.Struct({
|
|
26
|
-
databases: Schema.optional(Schema.Array(Schema.String)),
|
|
27
|
-
}),
|
|
28
|
-
),
|
|
29
|
-
}),
|
|
30
|
-
),
|
|
31
|
-
}).pipe(
|
|
32
|
-
T.Http({
|
|
33
|
-
method: "POST",
|
|
34
|
-
path: "/v1/organizations/{organizationSlug}/databases/{databaseName}/auth/tokens",
|
|
35
|
-
}),
|
|
36
|
-
) as unknown as Schema.Codec<CreateDatabaseTokenInput>;
|
|
37
|
-
|
|
38
|
-
// Output Schema
|
|
39
|
-
export interface CreateDatabaseTokenOutput {
|
|
40
|
-
jwt?: string;
|
|
41
|
-
}
|
|
42
|
-
export const CreateDatabaseTokenOutput =
|
|
43
|
-
/*@__PURE__*/ Schema.Struct({
|
|
44
|
-
jwt: Schema.optional(Schema.String),
|
|
45
|
-
}) as unknown as Schema.Codec<CreateDatabaseTokenOutput>;
|
|
46
|
-
|
|
47
|
-
// The operation
|
|
48
|
-
/**
|
|
49
|
-
* Generate Database Auth Token
|
|
50
|
-
*
|
|
51
|
-
* Generates an authorization token for the specified database.
|
|
52
|
-
*
|
|
53
|
-
* @param organizationSlug - The slug of the organization or user account.
|
|
54
|
-
* @param databaseName - The name of the database.
|
|
55
|
-
* @param expiration - Expiration time for the token (e.g., 2w1d30m).
|
|
56
|
-
* @param authorization - Authorization level for the token (full-access or read-only).
|
|
57
|
-
*/
|
|
58
|
-
export const createDatabaseToken = /*@__PURE__*/ API.make(() => ({
|
|
59
|
-
inputSchema: CreateDatabaseTokenInput,
|
|
60
|
-
outputSchema: CreateDatabaseTokenOutput,
|
|
61
|
-
errors: [BadRequest, NotFound] as const,
|
|
62
|
-
}));
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { API } from "../client.ts";
|
|
3
|
-
import * as T from "../traits.ts";
|
|
4
|
-
import { BadRequest, Conflict } from "../errors.ts";
|
|
5
|
-
|
|
6
|
-
// Input Schema
|
|
7
|
-
export interface CreateGroupInput {
|
|
8
|
-
organizationSlug: string;
|
|
9
|
-
name: string;
|
|
10
|
-
location: string;
|
|
11
|
-
extensions?:
|
|
12
|
-
| "all"
|
|
13
|
-
| (
|
|
14
|
-
| "vector"
|
|
15
|
-
| "crypto"
|
|
16
|
-
| "fuzzy"
|
|
17
|
-
| "math"
|
|
18
|
-
| "stats"
|
|
19
|
-
| "text"
|
|
20
|
-
| "unicode"
|
|
21
|
-
| "uuid"
|
|
22
|
-
| "regexp"
|
|
23
|
-
| "vec"
|
|
24
|
-
)[];
|
|
25
|
-
}
|
|
26
|
-
export const CreateGroupInput = /*@__PURE__*/ Schema.Struct({
|
|
27
|
-
organizationSlug: Schema.String.pipe(T.PathParam()),
|
|
28
|
-
name: Schema.String,
|
|
29
|
-
location: Schema.String,
|
|
30
|
-
extensions: Schema.optional(
|
|
31
|
-
Schema.Union([
|
|
32
|
-
Schema.Literals(["all"]),
|
|
33
|
-
Schema.Array(
|
|
34
|
-
Schema.Literals([
|
|
35
|
-
"vector",
|
|
36
|
-
"crypto",
|
|
37
|
-
"fuzzy",
|
|
38
|
-
"math",
|
|
39
|
-
"stats",
|
|
40
|
-
"text",
|
|
41
|
-
"unicode",
|
|
42
|
-
"uuid",
|
|
43
|
-
"regexp",
|
|
44
|
-
"vec",
|
|
45
|
-
]),
|
|
46
|
-
),
|
|
47
|
-
]),
|
|
48
|
-
),
|
|
49
|
-
}).pipe(
|
|
50
|
-
T.Http({
|
|
51
|
-
method: "POST",
|
|
52
|
-
path: "/v1/organizations/{organizationSlug}/groups",
|
|
53
|
-
}),
|
|
54
|
-
) as unknown as Schema.Codec<CreateGroupInput>;
|
|
55
|
-
|
|
56
|
-
// Output Schema
|
|
57
|
-
export interface CreateGroupOutput {
|
|
58
|
-
group?: {
|
|
59
|
-
name?: string;
|
|
60
|
-
version?: string;
|
|
61
|
-
uuid?: string;
|
|
62
|
-
locations?: string[];
|
|
63
|
-
primary?: string;
|
|
64
|
-
delete_protection?: boolean;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export const CreateGroupOutput = /*@__PURE__*/ Schema.Struct({
|
|
68
|
-
group: Schema.optional(
|
|
69
|
-
Schema.Struct({
|
|
70
|
-
name: Schema.optional(Schema.String),
|
|
71
|
-
version: Schema.optional(Schema.String),
|
|
72
|
-
uuid: Schema.optional(Schema.String),
|
|
73
|
-
locations: Schema.optional(Schema.Array(Schema.String)),
|
|
74
|
-
primary: Schema.optional(Schema.String),
|
|
75
|
-
delete_protection: Schema.optional(Schema.Boolean),
|
|
76
|
-
}),
|
|
77
|
-
),
|
|
78
|
-
}) as unknown as Schema.Codec<CreateGroupOutput>;
|
|
79
|
-
|
|
80
|
-
// The operation
|
|
81
|
-
/**
|
|
82
|
-
* Create Group
|
|
83
|
-
*
|
|
84
|
-
* Creates a new group for the organization or user.
|
|
85
|
-
*
|
|
86
|
-
* @param organizationSlug - The slug of the organization or user account.
|
|
87
|
-
*/
|
|
88
|
-
export const createGroup = /*@__PURE__*/ API.make(() => ({
|
|
89
|
-
inputSchema: CreateGroupInput,
|
|
90
|
-
outputSchema: CreateGroupOutput,
|
|
91
|
-
errors: [BadRequest, Conflict] as const,
|
|
92
|
-
}));
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { API } from "../client.ts";
|
|
3
|
-
import * as T from "../traits.ts";
|
|
4
|
-
import { BadRequest, NotFound } from "../errors.ts";
|
|
5
|
-
|
|
6
|
-
// Input Schema
|
|
7
|
-
export interface CreateGroupTokenInput {
|
|
8
|
-
organizationSlug: string;
|
|
9
|
-
groupName: string;
|
|
10
|
-
expiration?: string;
|
|
11
|
-
authorization?: "full-access" | "read-only";
|
|
12
|
-
permissions?: { read_attach?: { databases?: string[] } };
|
|
13
|
-
}
|
|
14
|
-
export const CreateGroupTokenInput = /*@__PURE__*/ Schema.Struct({
|
|
15
|
-
organizationSlug: Schema.String.pipe(T.PathParam()),
|
|
16
|
-
groupName: Schema.String.pipe(T.PathParam()),
|
|
17
|
-
expiration: Schema.optional(Schema.String),
|
|
18
|
-
authorization: Schema.optional(Schema.Literals(["full-access", "read-only"])),
|
|
19
|
-
permissions: Schema.optional(
|
|
20
|
-
Schema.Struct({
|
|
21
|
-
read_attach: Schema.optional(
|
|
22
|
-
Schema.Struct({
|
|
23
|
-
databases: Schema.optional(Schema.Array(Schema.String)),
|
|
24
|
-
}),
|
|
25
|
-
),
|
|
26
|
-
}),
|
|
27
|
-
),
|
|
28
|
-
}).pipe(
|
|
29
|
-
T.Http({
|
|
30
|
-
method: "POST",
|
|
31
|
-
path: "/v1/organizations/{organizationSlug}/groups/{groupName}/auth/tokens",
|
|
32
|
-
}),
|
|
33
|
-
) as unknown as Schema.Codec<CreateGroupTokenInput>;
|
|
34
|
-
|
|
35
|
-
// Output Schema
|
|
36
|
-
export interface CreateGroupTokenOutput {
|
|
37
|
-
jwt?: string;
|
|
38
|
-
}
|
|
39
|
-
export const CreateGroupTokenOutput = /*@__PURE__*/ Schema.Struct({
|
|
40
|
-
jwt: Schema.optional(Schema.String),
|
|
41
|
-
}) as unknown as Schema.Codec<CreateGroupTokenOutput>;
|
|
42
|
-
|
|
43
|
-
// The operation
|
|
44
|
-
/**
|
|
45
|
-
* Create Group Auth Token
|
|
46
|
-
*
|
|
47
|
-
* Generates an authorization token for the specified group.
|
|
48
|
-
*
|
|
49
|
-
* @param organizationSlug - The slug of the organization or user account.
|
|
50
|
-
* @param groupName - The name of the group.
|
|
51
|
-
* @param expiration - Expiration time for the token (e.g., 2w1d30m).
|
|
52
|
-
* @param authorization - Authorization level for the token (full-access or read-only).
|
|
53
|
-
*/
|
|
54
|
-
export const createGroupToken = /*@__PURE__*/ API.make(() => ({
|
|
55
|
-
inputSchema: CreateGroupTokenInput,
|
|
56
|
-
outputSchema: CreateGroupTokenOutput,
|
|
57
|
-
errors: [BadRequest, NotFound] as const,
|
|
58
|
-
}));
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { API } from "../client.ts";
|
|
3
|
-
import * as T from "../traits.ts";
|
|
4
|
-
import { NotFound } from "../errors.ts";
|
|
5
|
-
|
|
6
|
-
// Input Schema
|
|
7
|
-
export interface DeleteDatabaseInput {
|
|
8
|
-
organizationSlug: string;
|
|
9
|
-
databaseName: string;
|
|
10
|
-
}
|
|
11
|
-
export const DeleteDatabaseInput = /*@__PURE__*/ Schema.Struct({
|
|
12
|
-
organizationSlug: Schema.String.pipe(T.PathParam()),
|
|
13
|
-
databaseName: Schema.String.pipe(T.PathParam()),
|
|
14
|
-
}).pipe(
|
|
15
|
-
T.Http({
|
|
16
|
-
method: "DELETE",
|
|
17
|
-
path: "/v1/organizations/{organizationSlug}/databases/{databaseName}",
|
|
18
|
-
}),
|
|
19
|
-
) as unknown as Schema.Codec<DeleteDatabaseInput>;
|
|
20
|
-
|
|
21
|
-
// Output Schema
|
|
22
|
-
export interface DeleteDatabaseOutput {
|
|
23
|
-
database?: string;
|
|
24
|
-
}
|
|
25
|
-
export const DeleteDatabaseOutput = /*@__PURE__*/ Schema.Struct({
|
|
26
|
-
database: Schema.optional(Schema.String),
|
|
27
|
-
}) as unknown as Schema.Codec<DeleteDatabaseOutput>;
|
|
28
|
-
|
|
29
|
-
// The operation
|
|
30
|
-
/**
|
|
31
|
-
* Delete Database
|
|
32
|
-
*
|
|
33
|
-
* Delete a database belonging to the organization or user.
|
|
34
|
-
*
|
|
35
|
-
* @param organizationSlug - The slug of the organization or user account.
|
|
36
|
-
* @param databaseName - The name of the database.
|
|
37
|
-
*/
|
|
38
|
-
export const deleteDatabase = /*@__PURE__*/ API.make(() => ({
|
|
39
|
-
inputSchema: DeleteDatabaseInput,
|
|
40
|
-
outputSchema: DeleteDatabaseOutput,
|
|
41
|
-
errors: [NotFound] as const,
|
|
42
|
-
}));
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { API } from "../client.ts";
|
|
3
|
-
import * as T from "../traits.ts";
|
|
4
|
-
import { NotFound } from "../errors.ts";
|
|
5
|
-
|
|
6
|
-
// Input Schema
|
|
7
|
-
export interface DeleteGroupInput {
|
|
8
|
-
organizationSlug: string;
|
|
9
|
-
groupName: string;
|
|
10
|
-
}
|
|
11
|
-
export const DeleteGroupInput = /*@__PURE__*/ Schema.Struct({
|
|
12
|
-
organizationSlug: Schema.String.pipe(T.PathParam()),
|
|
13
|
-
groupName: Schema.String.pipe(T.PathParam()),
|
|
14
|
-
}).pipe(
|
|
15
|
-
T.Http({
|
|
16
|
-
method: "DELETE",
|
|
17
|
-
path: "/v1/organizations/{organizationSlug}/groups/{groupName}",
|
|
18
|
-
}),
|
|
19
|
-
) as unknown as Schema.Codec<DeleteGroupInput>;
|
|
20
|
-
|
|
21
|
-
// Output Schema
|
|
22
|
-
export interface DeleteGroupOutput {
|
|
23
|
-
group?: {
|
|
24
|
-
name?: string;
|
|
25
|
-
version?: string;
|
|
26
|
-
uuid?: string;
|
|
27
|
-
locations?: string[];
|
|
28
|
-
primary?: string;
|
|
29
|
-
delete_protection?: boolean;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export const DeleteGroupOutput = /*@__PURE__*/ Schema.Struct({
|
|
33
|
-
group: Schema.optional(
|
|
34
|
-
Schema.Struct({
|
|
35
|
-
name: Schema.optional(Schema.String),
|
|
36
|
-
version: Schema.optional(Schema.String),
|
|
37
|
-
uuid: Schema.optional(Schema.String),
|
|
38
|
-
locations: Schema.optional(Schema.Array(Schema.String)),
|
|
39
|
-
primary: Schema.optional(Schema.String),
|
|
40
|
-
delete_protection: Schema.optional(Schema.Boolean),
|
|
41
|
-
}),
|
|
42
|
-
),
|
|
43
|
-
}) as unknown as Schema.Codec<DeleteGroupOutput>;
|
|
44
|
-
|
|
45
|
-
// The operation
|
|
46
|
-
/**
|
|
47
|
-
* Delete Group
|
|
48
|
-
*
|
|
49
|
-
* Delete a group belonging to the organization or user.
|
|
50
|
-
*
|
|
51
|
-
* @param organizationSlug - The slug of the organization or user account.
|
|
52
|
-
* @param groupName - The name of the group.
|
|
53
|
-
*/
|
|
54
|
-
export const deleteGroup = /*@__PURE__*/ API.make(() => ({
|
|
55
|
-
inputSchema: DeleteGroupInput,
|
|
56
|
-
outputSchema: DeleteGroupOutput,
|
|
57
|
-
errors: [NotFound] as const,
|
|
58
|
-
}));
|