@distilled.cloud/prisma-postgres 0.0.0-john

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 (202) hide show
  1. package/README.md +58 -0
  2. package/lib/category.d.ts +5 -0
  3. package/lib/category.d.ts.map +1 -0
  4. package/lib/category.js +5 -0
  5. package/lib/category.js.map +1 -0
  6. package/lib/client.d.ts +10 -0
  7. package/lib/client.d.ts.map +1 -0
  8. package/lib/client.js +56 -0
  9. package/lib/client.js.map +1 -0
  10. package/lib/credentials.d.ts +15 -0
  11. package/lib/credentials.d.ts.map +1 -0
  12. package/lib/credentials.js +21 -0
  13. package/lib/credentials.js.map +1 -0
  14. package/lib/errors.d.ts +32 -0
  15. package/lib/errors.d.ts.map +1 -0
  16. package/lib/errors.js +24 -0
  17. package/lib/errors.js.map +1 -0
  18. package/lib/index.d.ts +16 -0
  19. package/lib/index.d.ts.map +1 -0
  20. package/lib/index.js +16 -0
  21. package/lib/index.js.map +1 -0
  22. package/lib/operations/deleteV1ConnectionsById.d.ts +14 -0
  23. package/lib/operations/deleteV1ConnectionsById.d.ts.map +1 -0
  24. package/lib/operations/deleteV1ConnectionsById.js +22 -0
  25. package/lib/operations/deleteV1ConnectionsById.js.map +1 -0
  26. package/lib/operations/deleteV1DatabasesByDatabaseId.d.ts +14 -0
  27. package/lib/operations/deleteV1DatabasesByDatabaseId.d.ts.map +1 -0
  28. package/lib/operations/deleteV1DatabasesByDatabaseId.js +23 -0
  29. package/lib/operations/deleteV1DatabasesByDatabaseId.js.map +1 -0
  30. package/lib/operations/deleteV1IntegrationsById.d.ts +14 -0
  31. package/lib/operations/deleteV1IntegrationsById.d.ts.map +1 -0
  32. package/lib/operations/deleteV1IntegrationsById.js +22 -0
  33. package/lib/operations/deleteV1IntegrationsById.js.map +1 -0
  34. package/lib/operations/deleteV1ProjectsById.d.ts +14 -0
  35. package/lib/operations/deleteV1ProjectsById.d.ts.map +1 -0
  36. package/lib/operations/deleteV1ProjectsById.js +22 -0
  37. package/lib/operations/deleteV1ProjectsById.js.map +1 -0
  38. package/lib/operations/deleteV1WorkspacesByWorkspaceIdIntegrationsByClientId.d.ts +15 -0
  39. package/lib/operations/deleteV1WorkspacesByWorkspaceIdIntegrationsByClientId.d.ts.map +1 -0
  40. package/lib/operations/deleteV1WorkspacesByWorkspaceIdIntegrationsByClientId.js +27 -0
  41. package/lib/operations/deleteV1WorkspacesByWorkspaceIdIntegrationsByClientId.js.map +1 -0
  42. package/lib/operations/getV1Connections.d.ts +53 -0
  43. package/lib/operations/getV1Connections.d.ts.map +1 -0
  44. package/lib/operations/getV1Connections.js +59 -0
  45. package/lib/operations/getV1Connections.js.map +1 -0
  46. package/lib/operations/getV1ConnectionsById.d.ts +47 -0
  47. package/lib/operations/getV1ConnectionsById.d.ts.map +1 -0
  48. package/lib/operations/getV1ConnectionsById.js +55 -0
  49. package/lib/operations/getV1ConnectionsById.js.map +1 -0
  50. package/lib/operations/getV1Databases.d.ts +72 -0
  51. package/lib/operations/getV1Databases.d.ts.map +1 -0
  52. package/lib/operations/getV1Databases.js +83 -0
  53. package/lib/operations/getV1Databases.js.map +1 -0
  54. package/lib/operations/getV1DatabasesByDatabaseId.d.ts +66 -0
  55. package/lib/operations/getV1DatabasesByDatabaseId.d.ts.map +1 -0
  56. package/lib/operations/getV1DatabasesByDatabaseId.js +79 -0
  57. package/lib/operations/getV1DatabasesByDatabaseId.js.map +1 -0
  58. package/lib/operations/getV1DatabasesByDatabaseIdBackups.d.ts +31 -0
  59. package/lib/operations/getV1DatabasesByDatabaseIdBackups.d.ts.map +1 -0
  60. package/lib/operations/getV1DatabasesByDatabaseIdBackups.js +40 -0
  61. package/lib/operations/getV1DatabasesByDatabaseIdBackups.js.map +1 -0
  62. package/lib/operations/getV1DatabasesByDatabaseIdConnections.d.ts +53 -0
  63. package/lib/operations/getV1DatabasesByDatabaseIdConnections.d.ts.map +1 -0
  64. package/lib/operations/getV1DatabasesByDatabaseIdConnections.js +62 -0
  65. package/lib/operations/getV1DatabasesByDatabaseIdConnections.js.map +1 -0
  66. package/lib/operations/getV1DatabasesByDatabaseIdUsage.d.ts +32 -0
  67. package/lib/operations/getV1DatabasesByDatabaseIdUsage.d.ts.map +1 -0
  68. package/lib/operations/getV1DatabasesByDatabaseIdUsage.js +41 -0
  69. package/lib/operations/getV1DatabasesByDatabaseIdUsage.js.map +1 -0
  70. package/lib/operations/getV1Integrations.d.ts +37 -0
  71. package/lib/operations/getV1Integrations.d.ts.map +1 -0
  72. package/lib/operations/getV1Integrations.js +44 -0
  73. package/lib/operations/getV1Integrations.js.map +1 -0
  74. package/lib/operations/getV1IntegrationsById.d.ts +31 -0
  75. package/lib/operations/getV1IntegrationsById.d.ts.map +1 -0
  76. package/lib/operations/getV1IntegrationsById.js +39 -0
  77. package/lib/operations/getV1IntegrationsById.js.map +1 -0
  78. package/lib/operations/getV1Projects.d.ts +33 -0
  79. package/lib/operations/getV1Projects.d.ts.map +1 -0
  80. package/lib/operations/getV1Projects.js +39 -0
  81. package/lib/operations/getV1Projects.js.map +1 -0
  82. package/lib/operations/getV1ProjectsById.d.ts +28 -0
  83. package/lib/operations/getV1ProjectsById.d.ts.map +1 -0
  84. package/lib/operations/getV1ProjectsById.js +35 -0
  85. package/lib/operations/getV1ProjectsById.js.map +1 -0
  86. package/lib/operations/getV1ProjectsByProjectIdDatabases.d.ts +72 -0
  87. package/lib/operations/getV1ProjectsByProjectIdDatabases.d.ts.map +1 -0
  88. package/lib/operations/getV1ProjectsByProjectIdDatabases.js +86 -0
  89. package/lib/operations/getV1ProjectsByProjectIdDatabases.js.map +1 -0
  90. package/lib/operations/getV1Regions.d.ts +22 -0
  91. package/lib/operations/getV1Regions.d.ts.map +1 -0
  92. package/lib/operations/getV1Regions.js +28 -0
  93. package/lib/operations/getV1Regions.js.map +1 -0
  94. package/lib/operations/getV1RegionsAccelerate.d.ts +18 -0
  95. package/lib/operations/getV1RegionsAccelerate.d.ts.map +1 -0
  96. package/lib/operations/getV1RegionsAccelerate.js +26 -0
  97. package/lib/operations/getV1RegionsAccelerate.js.map +1 -0
  98. package/lib/operations/getV1RegionsPostgres.d.ts +19 -0
  99. package/lib/operations/getV1RegionsPostgres.d.ts.map +1 -0
  100. package/lib/operations/getV1RegionsPostgres.js +27 -0
  101. package/lib/operations/getV1RegionsPostgres.js.map +1 -0
  102. package/lib/operations/getV1Workspaces.d.ts +27 -0
  103. package/lib/operations/getV1Workspaces.d.ts.map +1 -0
  104. package/lib/operations/getV1Workspaces.js +33 -0
  105. package/lib/operations/getV1Workspaces.js.map +1 -0
  106. package/lib/operations/getV1WorkspacesById.d.ts +22 -0
  107. package/lib/operations/getV1WorkspacesById.d.ts.map +1 -0
  108. package/lib/operations/getV1WorkspacesById.js +30 -0
  109. package/lib/operations/getV1WorkspacesById.js.map +1 -0
  110. package/lib/operations/getV1WorkspacesByWorkspaceIdIntegrations.d.ts +37 -0
  111. package/lib/operations/getV1WorkspacesByWorkspaceIdIntegrations.d.ts.map +1 -0
  112. package/lib/operations/getV1WorkspacesByWorkspaceIdIntegrations.js +49 -0
  113. package/lib/operations/getV1WorkspacesByWorkspaceIdIntegrations.js.map +1 -0
  114. package/lib/operations/index.d.ts +32 -0
  115. package/lib/operations/index.d.ts.map +1 -0
  116. package/lib/operations/index.js +32 -0
  117. package/lib/operations/index.js.map +1 -0
  118. package/lib/operations/patchV1DatabasesByDatabaseId.d.ts +67 -0
  119. package/lib/operations/patchV1DatabasesByDatabaseId.d.ts.map +1 -0
  120. package/lib/operations/patchV1DatabasesByDatabaseId.js +81 -0
  121. package/lib/operations/patchV1DatabasesByDatabaseId.js.map +1 -0
  122. package/lib/operations/patchV1ProjectsById.d.ts +30 -0
  123. package/lib/operations/patchV1ProjectsById.d.ts.map +1 -0
  124. package/lib/operations/patchV1ProjectsById.js +38 -0
  125. package/lib/operations/patchV1ProjectsById.js.map +1 -0
  126. package/lib/operations/postV1Connections.d.ts +52 -0
  127. package/lib/operations/postV1Connections.d.ts.map +1 -0
  128. package/lib/operations/postV1Connections.js +59 -0
  129. package/lib/operations/postV1Connections.js.map +1 -0
  130. package/lib/operations/postV1Databases.d.ts +69 -0
  131. package/lib/operations/postV1Databases.d.ts.map +1 -0
  132. package/lib/operations/postV1Databases.js +83 -0
  133. package/lib/operations/postV1Databases.js.map +1 -0
  134. package/lib/operations/postV1DatabasesByDatabaseIdConnections.d.ts +55 -0
  135. package/lib/operations/postV1DatabasesByDatabaseIdConnections.d.ts.map +1 -0
  136. package/lib/operations/postV1DatabasesByDatabaseIdConnections.js +64 -0
  137. package/lib/operations/postV1DatabasesByDatabaseIdConnections.js.map +1 -0
  138. package/lib/operations/postV1Projects.d.ts +113 -0
  139. package/lib/operations/postV1Projects.d.ts.map +1 -0
  140. package/lib/operations/postV1Projects.js +126 -0
  141. package/lib/operations/postV1Projects.js.map +1 -0
  142. package/lib/operations/postV1ProjectsByIdTransfer.d.ts +15 -0
  143. package/lib/operations/postV1ProjectsByIdTransfer.d.ts.map +1 -0
  144. package/lib/operations/postV1ProjectsByIdTransfer.js +23 -0
  145. package/lib/operations/postV1ProjectsByIdTransfer.js.map +1 -0
  146. package/lib/operations/postV1ProjectsByProjectIdDatabases.d.ts +110 -0
  147. package/lib/operations/postV1ProjectsByProjectIdDatabases.d.ts.map +1 -0
  148. package/lib/operations/postV1ProjectsByProjectIdDatabases.js +127 -0
  149. package/lib/operations/postV1ProjectsByProjectIdDatabases.js.map +1 -0
  150. package/lib/retry.d.ts +22 -0
  151. package/lib/retry.d.ts.map +1 -0
  152. package/lib/retry.js +21 -0
  153. package/lib/retry.js.map +1 -0
  154. package/lib/sensitive.d.ts +5 -0
  155. package/lib/sensitive.d.ts.map +1 -0
  156. package/lib/sensitive.js +5 -0
  157. package/lib/sensitive.js.map +1 -0
  158. package/lib/traits.d.ts +5 -0
  159. package/lib/traits.d.ts.map +1 -0
  160. package/lib/traits.js +5 -0
  161. package/lib/traits.js.map +1 -0
  162. package/package.json +88 -0
  163. package/src/category.ts +4 -0
  164. package/src/client.ts +69 -0
  165. package/src/credentials.ts +34 -0
  166. package/src/errors.ts +48 -0
  167. package/src/index.ts +15 -0
  168. package/src/operations/deleteV1ConnectionsById.ts +30 -0
  169. package/src/operations/deleteV1DatabasesByDatabaseId.ts +29 -0
  170. package/src/operations/deleteV1IntegrationsById.ts +30 -0
  171. package/src/operations/deleteV1ProjectsById.ts +28 -0
  172. package/src/operations/deleteV1WorkspacesByWorkspaceIdIntegrationsByClientId.ts +35 -0
  173. package/src/operations/getV1Connections.ts +77 -0
  174. package/src/operations/getV1ConnectionsById.ts +71 -0
  175. package/src/operations/getV1Databases.ts +103 -0
  176. package/src/operations/getV1DatabasesByDatabaseId.ts +101 -0
  177. package/src/operations/getV1DatabasesByDatabaseIdBackups.ts +50 -0
  178. package/src/operations/getV1DatabasesByDatabaseIdConnections.ts +82 -0
  179. package/src/operations/getV1DatabasesByDatabaseIdUsage.ts +47 -0
  180. package/src/operations/getV1Integrations.ts +52 -0
  181. package/src/operations/getV1IntegrationsById.ts +46 -0
  182. package/src/operations/getV1Projects.ts +45 -0
  183. package/src/operations/getV1ProjectsById.ts +41 -0
  184. package/src/operations/getV1ProjectsByProjectIdDatabases.ts +110 -0
  185. package/src/operations/getV1Regions.ts +34 -0
  186. package/src/operations/getV1RegionsAccelerate.ts +38 -0
  187. package/src/operations/getV1RegionsPostgres.ts +37 -0
  188. package/src/operations/getV1Workspaces.ts +39 -0
  189. package/src/operations/getV1WorkspacesById.ts +34 -0
  190. package/src/operations/getV1WorkspacesByWorkspaceIdIntegrations.ts +59 -0
  191. package/src/operations/index.ts +31 -0
  192. package/src/operations/patchV1DatabasesByDatabaseId.ts +101 -0
  193. package/src/operations/patchV1ProjectsById.ts +42 -0
  194. package/src/operations/postV1Connections.ts +75 -0
  195. package/src/operations/postV1Databases.ts +103 -0
  196. package/src/operations/postV1DatabasesByDatabaseIdConnections.ts +82 -0
  197. package/src/operations/postV1Projects.ts +160 -0
  198. package/src/operations/postV1ProjectsByIdTransfer.ts +31 -0
  199. package/src/operations/postV1ProjectsByProjectIdDatabases.ts +165 -0
  200. package/src/retry.ts +37 -0
  201. package/src/sensitive.ts +4 -0
  202. package/src/traits.ts +4 -0
package/src/client.ts ADDED
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Prisma Postgres API Client.
3
+ *
4
+ * Wraps the shared REST client from sdk-core with Prisma Postgres-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 {
12
+ HTTP_STATUS_MAP,
13
+ UnknownPrismaPostgresError,
14
+ PrismaPostgresParseError,
15
+ } from "./errors.ts";
16
+
17
+ // Re-export for backwards compatibility
18
+ export { UnknownPrismaPostgresError } from "./errors.ts";
19
+ import { Credentials } from "./credentials.ts";
20
+
21
+ // API Error Response Schema — Prisma Postgres wraps errors in { error: { code, message, hint? } }
22
+ const ApiErrorResponse = Schema.Struct({
23
+ error: Schema.Struct({
24
+ code: Schema.optional(Schema.String),
25
+ message: Schema.String,
26
+ hint: Schema.optional(Schema.String),
27
+ }),
28
+ });
29
+
30
+ /**
31
+ * Match a Prisma Postgres API error response to the appropriate error class based on HTTP status.
32
+ */
33
+ const matchError = (
34
+ status: number,
35
+ errorBody: unknown,
36
+ ): Effect.Effect<never, unknown> => {
37
+ try {
38
+ const parsed = Schema.decodeUnknownSync(ApiErrorResponse)(errorBody);
39
+ const ErrorClass = (HTTP_STATUS_MAP as any)[status];
40
+ if (ErrorClass) {
41
+ return Effect.fail(
42
+ new ErrorClass({ message: parsed.error.message ?? "" }),
43
+ );
44
+ }
45
+ return Effect.fail(
46
+ new UnknownPrismaPostgresError({
47
+ code: parsed.error.code,
48
+ message: parsed.error.message,
49
+ hint: parsed.error.hint,
50
+ body: errorBody,
51
+ }),
52
+ );
53
+ } catch {
54
+ return Effect.fail(new UnknownPrismaPostgresError({ body: errorBody }));
55
+ }
56
+ };
57
+
58
+ /**
59
+ * Prisma Postgres API client.
60
+ */
61
+ export const API = makeAPI({
62
+ credentials: Credentials as any,
63
+ getBaseUrl: (creds: any) => creds.apiBaseUrl,
64
+ getAuthHeaders: (creds: any) => ({
65
+ Authorization: `Bearer ${Redacted.value(creds.apiToken)}`,
66
+ }),
67
+ matchError,
68
+ ParseError: PrismaPostgresParseError as any,
69
+ });
@@ -0,0 +1,34 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Layer from "effect/Layer";
3
+ import * as Redacted from "effect/Redacted";
4
+ import * as ServiceMap from "effect/ServiceMap";
5
+ import { ConfigError } from "@distilled.cloud/core/errors";
6
+
7
+ export const DEFAULT_API_BASE_URL = "https://api.prisma.io";
8
+
9
+ export interface Config {
10
+ readonly apiToken: Redacted.Redacted<string>;
11
+ readonly apiBaseUrl: string;
12
+ }
13
+
14
+ export class Credentials extends ServiceMap.Service<Credentials, Config>()(
15
+ "PrismaPostgresCredentials",
16
+ ) {}
17
+
18
+ export const CredentialsFromEnv = Layer.effect(
19
+ Credentials,
20
+ Effect.gen(function* () {
21
+ const apiToken = process.env.PRISMA_POSTGRES_API_TOKEN;
22
+
23
+ if (!apiToken) {
24
+ return yield* new ConfigError({
25
+ message: "PRISMA_POSTGRES_API_TOKEN environment variable is required",
26
+ });
27
+ }
28
+
29
+ return {
30
+ apiToken: Redacted.make(apiToken),
31
+ apiBaseUrl: DEFAULT_API_BASE_URL,
32
+ };
33
+ }),
34
+ );
package/src/errors.ts ADDED
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Prisma Postgres-specific error types.
3
+ *
4
+ * Re-exports common HTTP errors from sdk-core and adds Prisma Postgres-specific
5
+ * error matching and API error types.
6
+ */
7
+ export {
8
+ BadGateway,
9
+ BadRequest,
10
+ Conflict,
11
+ ConfigError,
12
+ Forbidden,
13
+ GatewayTimeout,
14
+ InternalServerError,
15
+ Locked,
16
+ NotFound,
17
+ ServiceUnavailable,
18
+ TooManyRequests,
19
+ Unauthorized,
20
+ UnprocessableEntity,
21
+ HTTP_STATUS_MAP,
22
+ DEFAULT_ERRORS,
23
+ API_ERRORS,
24
+ } from "@distilled.cloud/core/errors";
25
+ export type { DefaultErrors } from "@distilled.cloud/core/errors";
26
+
27
+ import * as Schema from "effect/Schema";
28
+ import * as Category from "@distilled.cloud/core/category";
29
+
30
+ // Unknown Prisma Postgres error - returned when an error code is not recognized
31
+ export class UnknownPrismaPostgresError extends Schema.TaggedErrorClass<UnknownPrismaPostgresError>()(
32
+ "UnknownPrismaPostgresError",
33
+ {
34
+ code: Schema.optional(Schema.String),
35
+ message: Schema.optional(Schema.String),
36
+ hint: Schema.optional(Schema.String),
37
+ body: Schema.Unknown,
38
+ },
39
+ ).pipe(Category.withServerError) {}
40
+
41
+ // Schema parse error wrapper
42
+ export class PrismaPostgresParseError extends Schema.TaggedErrorClass<PrismaPostgresParseError>()(
43
+ "PrismaPostgresParseError",
44
+ {
45
+ body: Schema.Unknown,
46
+ cause: Schema.Unknown,
47
+ },
48
+ ).pipe(Category.withParseError) {}
package/src/index.ts ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Prisma Postgres SDK for Effect
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import * as PrismaPostgres from "@distilled.cloud/prisma-postgres";
7
+ * ```
8
+ */
9
+ export * from "./credentials.ts";
10
+ export * as Category from "./category.ts";
11
+ export * as T from "./traits.ts";
12
+ export * as Retry from "./retry.ts";
13
+ export { API } from "./client.ts";
14
+ export * from "./errors.ts";
15
+ export { SensitiveString, SensitiveNullableString } from "./sensitive.ts";
@@ -0,0 +1,30 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+
5
+ // Input Schema
6
+ export const DeleteV1ConnectionsByIdInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ id: Schema.String.pipe(T.PathParam()),
9
+ }).pipe(T.Http({ method: "DELETE", path: "/v1/connections/{id}" }));
10
+ export type DeleteV1ConnectionsByIdInput =
11
+ typeof DeleteV1ConnectionsByIdInput.Type;
12
+
13
+ // Output Schema
14
+ export const DeleteV1ConnectionsByIdOutput =
15
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Void;
16
+ export type DeleteV1ConnectionsByIdOutput =
17
+ typeof DeleteV1ConnectionsByIdOutput.Type;
18
+
19
+ // The operation
20
+ /**
21
+ * Delete connection
22
+ *
23
+ * Deletes the connection with the given ID.
24
+ */
25
+ export const deleteV1ConnectionsById = /*@__PURE__*/ /*#__PURE__*/ API.make(
26
+ () => ({
27
+ inputSchema: DeleteV1ConnectionsByIdInput,
28
+ outputSchema: DeleteV1ConnectionsByIdOutput,
29
+ }),
30
+ );
@@ -0,0 +1,29 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+
5
+ // Input Schema
6
+ export const DeleteV1DatabasesByDatabaseIdInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ databaseId: Schema.String.pipe(T.PathParam()),
9
+ }).pipe(T.Http({ method: "DELETE", path: "/v1/databases/{databaseId}" }));
10
+ export type DeleteV1DatabasesByDatabaseIdInput =
11
+ typeof DeleteV1DatabasesByDatabaseIdInput.Type;
12
+
13
+ // Output Schema
14
+ export const DeleteV1DatabasesByDatabaseIdOutput =
15
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Void;
16
+ export type DeleteV1DatabasesByDatabaseIdOutput =
17
+ typeof DeleteV1DatabasesByDatabaseIdOutput.Type;
18
+
19
+ // The operation
20
+ /**
21
+ * Delete database
22
+ *
23
+ * Deletes the database with the given ID.
24
+ */
25
+ export const deleteV1DatabasesByDatabaseId =
26
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
27
+ inputSchema: DeleteV1DatabasesByDatabaseIdInput,
28
+ outputSchema: DeleteV1DatabasesByDatabaseIdOutput,
29
+ }));
@@ -0,0 +1,30 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+
5
+ // Input Schema
6
+ export const DeleteV1IntegrationsByIdInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ id: Schema.String.pipe(T.PathParam()),
9
+ }).pipe(T.Http({ method: "DELETE", path: "/v1/integrations/{id}" }));
10
+ export type DeleteV1IntegrationsByIdInput =
11
+ typeof DeleteV1IntegrationsByIdInput.Type;
12
+
13
+ // Output Schema
14
+ export const DeleteV1IntegrationsByIdOutput =
15
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Void;
16
+ export type DeleteV1IntegrationsByIdOutput =
17
+ typeof DeleteV1IntegrationsByIdOutput.Type;
18
+
19
+ // The operation
20
+ /**
21
+ * Delete integration
22
+ *
23
+ * Revokes the integration tokens by integration ID.
24
+ */
25
+ export const deleteV1IntegrationsById = /*@__PURE__*/ /*#__PURE__*/ API.make(
26
+ () => ({
27
+ inputSchema: DeleteV1IntegrationsByIdInput,
28
+ outputSchema: DeleteV1IntegrationsByIdOutput,
29
+ }),
30
+ );
@@ -0,0 +1,28 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+
5
+ // Input Schema
6
+ export const DeleteV1ProjectsByIdInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ id: Schema.String.pipe(T.PathParam()),
9
+ }).pipe(T.Http({ method: "DELETE", path: "/v1/projects/{id}" }));
10
+ export type DeleteV1ProjectsByIdInput = typeof DeleteV1ProjectsByIdInput.Type;
11
+
12
+ // Output Schema
13
+ export const DeleteV1ProjectsByIdOutput =
14
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Void;
15
+ export type DeleteV1ProjectsByIdOutput = typeof DeleteV1ProjectsByIdOutput.Type;
16
+
17
+ // The operation
18
+ /**
19
+ * Delete project
20
+ *
21
+ * Deletes the project with the given ID.
22
+ */
23
+ export const deleteV1ProjectsById = /*@__PURE__*/ /*#__PURE__*/ API.make(
24
+ () => ({
25
+ inputSchema: DeleteV1ProjectsByIdInput,
26
+ outputSchema: DeleteV1ProjectsByIdOutput,
27
+ }),
28
+ );
@@ -0,0 +1,35 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+
5
+ // Input Schema
6
+ export const DeleteV1WorkspacesByWorkspaceIdIntegrationsByClientIdInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ clientId: Schema.String.pipe(T.PathParam()),
9
+ workspaceId: Schema.String.pipe(T.PathParam()),
10
+ }).pipe(
11
+ T.Http({
12
+ method: "DELETE",
13
+ path: "/v1/workspaces/{workspaceId}/integrations/{clientId}",
14
+ }),
15
+ );
16
+ export type DeleteV1WorkspacesByWorkspaceIdIntegrationsByClientIdInput =
17
+ typeof DeleteV1WorkspacesByWorkspaceIdIntegrationsByClientIdInput.Type;
18
+
19
+ // Output Schema
20
+ export const DeleteV1WorkspacesByWorkspaceIdIntegrationsByClientIdOutput =
21
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Void;
22
+ export type DeleteV1WorkspacesByWorkspaceIdIntegrationsByClientIdOutput =
23
+ typeof DeleteV1WorkspacesByWorkspaceIdIntegrationsByClientIdOutput.Type;
24
+
25
+ // The operation
26
+ /**
27
+ * Revoke integration tokens
28
+ *
29
+ * Revokes the integration tokens with the given client ID.
30
+ */
31
+ export const deleteV1WorkspacesByWorkspaceIdIntegrationsByClientId =
32
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
33
+ inputSchema: DeleteV1WorkspacesByWorkspaceIdIntegrationsByClientIdInput,
34
+ outputSchema: DeleteV1WorkspacesByWorkspaceIdIntegrationsByClientIdOutput,
35
+ }));
@@ -0,0 +1,77 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+
5
+ // Input Schema
6
+ export const GetV1ConnectionsInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ cursor: Schema.optional(Schema.String),
8
+ limit: Schema.optional(Schema.Number),
9
+ databaseId: Schema.optional(Schema.String),
10
+ }).pipe(T.Http({ method: "GET", path: "/v1/connections" }));
11
+ export type GetV1ConnectionsInput = typeof GetV1ConnectionsInput.Type;
12
+
13
+ // Output Schema
14
+ export const GetV1ConnectionsOutput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
15
+ {
16
+ data: Schema.Array(
17
+ Schema.Struct({
18
+ id: Schema.String,
19
+ type: Schema.String,
20
+ url: Schema.String,
21
+ name: Schema.String,
22
+ createdAt: Schema.String,
23
+ kind: Schema.Literals(["postgres", "accelerate"]),
24
+ endpoints: Schema.Struct({
25
+ direct: Schema.optional(
26
+ Schema.Struct({
27
+ host: Schema.String,
28
+ port: Schema.Number,
29
+ }),
30
+ ),
31
+ pooled: Schema.optional(
32
+ Schema.Struct({
33
+ host: Schema.String,
34
+ port: Schema.Number,
35
+ }),
36
+ ),
37
+ accelerate: Schema.optional(
38
+ Schema.Struct({
39
+ host: Schema.String,
40
+ port: Schema.Number,
41
+ }),
42
+ ),
43
+ }),
44
+ directConnection: Schema.optional(
45
+ Schema.NullOr(
46
+ Schema.Struct({
47
+ host: Schema.String,
48
+ pass: Schema.String,
49
+ user: Schema.String,
50
+ }),
51
+ ),
52
+ ),
53
+ database: Schema.Struct({
54
+ id: Schema.String,
55
+ url: Schema.String,
56
+ name: Schema.String,
57
+ }),
58
+ }),
59
+ ),
60
+ pagination: Schema.Struct({
61
+ nextCursor: Schema.NullOr(Schema.String),
62
+ hasMore: Schema.Boolean,
63
+ }),
64
+ },
65
+ );
66
+ export type GetV1ConnectionsOutput = typeof GetV1ConnectionsOutput.Type;
67
+
68
+ // The operation
69
+ /**
70
+ * List connections
71
+ *
72
+ * Returns all connections the actor has access to, with optional database filter.
73
+ */
74
+ export const getV1Connections = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
75
+ inputSchema: GetV1ConnectionsInput,
76
+ outputSchema: GetV1ConnectionsOutput,
77
+ }));
@@ -0,0 +1,71 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+
5
+ // Input Schema
6
+ export const GetV1ConnectionsByIdInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ id: Schema.String.pipe(T.PathParam()),
9
+ }).pipe(T.Http({ method: "GET", path: "/v1/connections/{id}" }));
10
+ export type GetV1ConnectionsByIdInput = typeof GetV1ConnectionsByIdInput.Type;
11
+
12
+ // Output Schema
13
+ export const GetV1ConnectionsByIdOutput =
14
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
15
+ data: Schema.Struct({
16
+ id: Schema.String,
17
+ type: Schema.String,
18
+ url: Schema.String,
19
+ name: Schema.String,
20
+ createdAt: Schema.String,
21
+ kind: Schema.Literals(["postgres", "accelerate"]),
22
+ endpoints: Schema.Struct({
23
+ direct: Schema.optional(
24
+ Schema.Struct({
25
+ host: Schema.String,
26
+ port: Schema.Number,
27
+ }),
28
+ ),
29
+ pooled: Schema.optional(
30
+ Schema.Struct({
31
+ host: Schema.String,
32
+ port: Schema.Number,
33
+ }),
34
+ ),
35
+ accelerate: Schema.optional(
36
+ Schema.Struct({
37
+ host: Schema.String,
38
+ port: Schema.Number,
39
+ }),
40
+ ),
41
+ }),
42
+ directConnection: Schema.optional(
43
+ Schema.NullOr(
44
+ Schema.Struct({
45
+ host: Schema.String,
46
+ pass: Schema.String,
47
+ user: Schema.String,
48
+ }),
49
+ ),
50
+ ),
51
+ database: Schema.Struct({
52
+ id: Schema.String,
53
+ url: Schema.String,
54
+ name: Schema.String,
55
+ }),
56
+ }),
57
+ });
58
+ export type GetV1ConnectionsByIdOutput = typeof GetV1ConnectionsByIdOutput.Type;
59
+
60
+ // The operation
61
+ /**
62
+ * Get connection
63
+ *
64
+ * Returns the connection with the given ID.
65
+ */
66
+ export const getV1ConnectionsById = /*@__PURE__*/ /*#__PURE__*/ API.make(
67
+ () => ({
68
+ inputSchema: GetV1ConnectionsByIdInput,
69
+ outputSchema: GetV1ConnectionsByIdOutput,
70
+ }),
71
+ );
@@ -0,0 +1,103 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+
5
+ // Input Schema
6
+ export const GetV1DatabasesInput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ cursor: Schema.optional(Schema.String),
8
+ limit: Schema.optional(Schema.Number),
9
+ projectId: Schema.optional(Schema.String),
10
+ }).pipe(T.Http({ method: "GET", path: "/v1/databases" }));
11
+ export type GetV1DatabasesInput = typeof GetV1DatabasesInput.Type;
12
+
13
+ // Output Schema
14
+ export const GetV1DatabasesOutput = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
15
+ data: Schema.Array(
16
+ Schema.Struct({
17
+ id: Schema.String,
18
+ type: Schema.String,
19
+ url: Schema.String,
20
+ name: Schema.String,
21
+ status: Schema.Literals([
22
+ "failure",
23
+ "provisioning",
24
+ "ready",
25
+ "recovering",
26
+ ]),
27
+ createdAt: Schema.String,
28
+ isDefault: Schema.Boolean,
29
+ defaultConnectionId: Schema.NullOr(Schema.String),
30
+ connections: Schema.Array(
31
+ Schema.Struct({
32
+ id: Schema.String,
33
+ type: Schema.String,
34
+ url: Schema.String,
35
+ name: Schema.String,
36
+ createdAt: Schema.String,
37
+ kind: Schema.Literals(["postgres", "accelerate"]),
38
+ endpoints: Schema.Struct({
39
+ direct: Schema.optional(
40
+ Schema.Struct({
41
+ host: Schema.String,
42
+ port: Schema.Number,
43
+ }),
44
+ ),
45
+ pooled: Schema.optional(
46
+ Schema.Struct({
47
+ host: Schema.String,
48
+ port: Schema.Number,
49
+ }),
50
+ ),
51
+ accelerate: Schema.optional(
52
+ Schema.Struct({
53
+ host: Schema.String,
54
+ port: Schema.Number,
55
+ }),
56
+ ),
57
+ }),
58
+ directConnection: Schema.optional(
59
+ Schema.NullOr(
60
+ Schema.Struct({
61
+ host: Schema.String,
62
+ pass: Schema.String,
63
+ user: Schema.String,
64
+ }),
65
+ ),
66
+ ),
67
+ database: Schema.Struct({
68
+ id: Schema.String,
69
+ url: Schema.String,
70
+ name: Schema.String,
71
+ }),
72
+ }),
73
+ ),
74
+ project: Schema.Struct({
75
+ id: Schema.String,
76
+ url: Schema.String,
77
+ name: Schema.String,
78
+ }),
79
+ region: Schema.NullOr(
80
+ Schema.Struct({
81
+ id: Schema.String,
82
+ name: Schema.String,
83
+ }),
84
+ ),
85
+ }),
86
+ ),
87
+ pagination: Schema.Struct({
88
+ nextCursor: Schema.NullOr(Schema.String),
89
+ hasMore: Schema.Boolean,
90
+ }),
91
+ });
92
+ export type GetV1DatabasesOutput = typeof GetV1DatabasesOutput.Type;
93
+
94
+ // The operation
95
+ /**
96
+ * List databases
97
+ *
98
+ * Returns all databases the token has access to. Optionally filter by project ID.
99
+ */
100
+ export const getV1Databases = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
101
+ inputSchema: GetV1DatabasesInput,
102
+ outputSchema: GetV1DatabasesOutput,
103
+ }));
@@ -0,0 +1,101 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client";
3
+ import * as T from "../traits";
4
+
5
+ // Input Schema
6
+ export const GetV1DatabasesByDatabaseIdInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ databaseId: Schema.String.pipe(T.PathParam()),
9
+ }).pipe(T.Http({ method: "GET", path: "/v1/databases/{databaseId}" }));
10
+ export type GetV1DatabasesByDatabaseIdInput =
11
+ typeof GetV1DatabasesByDatabaseIdInput.Type;
12
+
13
+ // Output Schema
14
+ export const GetV1DatabasesByDatabaseIdOutput =
15
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
16
+ data: Schema.Struct({
17
+ id: Schema.String,
18
+ type: Schema.String,
19
+ url: Schema.String,
20
+ name: Schema.String,
21
+ status: Schema.Literals([
22
+ "failure",
23
+ "provisioning",
24
+ "ready",
25
+ "recovering",
26
+ ]),
27
+ createdAt: Schema.String,
28
+ isDefault: Schema.Boolean,
29
+ defaultConnectionId: Schema.NullOr(Schema.String),
30
+ connections: Schema.Array(
31
+ Schema.Struct({
32
+ id: Schema.String,
33
+ type: Schema.String,
34
+ url: Schema.String,
35
+ name: Schema.String,
36
+ createdAt: Schema.String,
37
+ kind: Schema.Literals(["postgres", "accelerate"]),
38
+ endpoints: Schema.Struct({
39
+ direct: Schema.optional(
40
+ Schema.Struct({
41
+ host: Schema.String,
42
+ port: Schema.Number,
43
+ }),
44
+ ),
45
+ pooled: Schema.optional(
46
+ Schema.Struct({
47
+ host: Schema.String,
48
+ port: Schema.Number,
49
+ }),
50
+ ),
51
+ accelerate: Schema.optional(
52
+ Schema.Struct({
53
+ host: Schema.String,
54
+ port: Schema.Number,
55
+ }),
56
+ ),
57
+ }),
58
+ directConnection: Schema.optional(
59
+ Schema.NullOr(
60
+ Schema.Struct({
61
+ host: Schema.String,
62
+ pass: Schema.String,
63
+ user: Schema.String,
64
+ }),
65
+ ),
66
+ ),
67
+ database: Schema.Struct({
68
+ id: Schema.String,
69
+ url: Schema.String,
70
+ name: Schema.String,
71
+ }),
72
+ }),
73
+ ),
74
+ project: Schema.Struct({
75
+ id: Schema.String,
76
+ url: Schema.String,
77
+ name: Schema.String,
78
+ }),
79
+ region: Schema.NullOr(
80
+ Schema.Struct({
81
+ id: Schema.String,
82
+ name: Schema.String,
83
+ }),
84
+ ),
85
+ }),
86
+ });
87
+ export type GetV1DatabasesByDatabaseIdOutput =
88
+ typeof GetV1DatabasesByDatabaseIdOutput.Type;
89
+
90
+ // The operation
91
+ /**
92
+ * Get database
93
+ *
94
+ * Returns the database with the given ID.
95
+ */
96
+ export const getV1DatabasesByDatabaseId = /*@__PURE__*/ /*#__PURE__*/ API.make(
97
+ () => ({
98
+ inputSchema: GetV1DatabasesByDatabaseIdInput,
99
+ outputSchema: GetV1DatabasesByDatabaseIdOutput,
100
+ }),
101
+ );