alchemy 0.12.6 → 0.12.7

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 (44) hide show
  1. package/lib/cloudflare/ai-gateway.d.ts.map +1 -1
  2. package/lib/cloudflare/ai-gateway.js +1 -2
  3. package/lib/cloudflare/ai-gateway.js.map +1 -1
  4. package/lib/cloudflare/bindings.d.ts +2 -1
  5. package/lib/cloudflare/bindings.d.ts.map +1 -1
  6. package/lib/cloudflare/bound.d.ts +2 -1
  7. package/lib/cloudflare/bound.d.ts.map +1 -1
  8. package/lib/cloudflare/hyperdrive.d.ts +216 -0
  9. package/lib/cloudflare/hyperdrive.d.ts.map +1 -0
  10. package/lib/cloudflare/hyperdrive.js +184 -0
  11. package/lib/cloudflare/hyperdrive.js.map +1 -0
  12. package/lib/cloudflare/index.d.ts +1 -0
  13. package/lib/cloudflare/index.d.ts.map +1 -1
  14. package/lib/cloudflare/index.js +1 -0
  15. package/lib/cloudflare/index.js.map +1 -1
  16. package/lib/cloudflare/worker.js +8 -0
  17. package/lib/cloudflare/worker.js.map +1 -1
  18. package/lib/neon/api-error.d.ts +31 -0
  19. package/lib/neon/api-error.d.ts.map +1 -0
  20. package/lib/neon/api-error.js +73 -0
  21. package/lib/neon/api-error.js.map +1 -0
  22. package/lib/neon/api.d.ts +70 -0
  23. package/lib/neon/api.d.ts.map +1 -0
  24. package/lib/neon/api.js +128 -0
  25. package/lib/neon/api.js.map +1 -0
  26. package/lib/neon/index.d.ts +4 -0
  27. package/lib/neon/index.d.ts.map +1 -0
  28. package/lib/neon/index.js +4 -0
  29. package/lib/neon/index.js.map +1 -0
  30. package/lib/neon/project.d.ts +345 -0
  31. package/lib/neon/project.d.ts.map +1 -0
  32. package/lib/neon/project.js +305 -0
  33. package/lib/neon/project.js.map +1 -0
  34. package/package.json +2 -1
  35. package/src/cloudflare/ai-gateway.ts +0 -1
  36. package/src/cloudflare/bindings.ts +4 -2
  37. package/src/cloudflare/bound.ts +20 -17
  38. package/src/cloudflare/hyperdrive.ts +375 -0
  39. package/src/cloudflare/index.ts +1 -0
  40. package/src/cloudflare/worker.ts +7 -0
  41. package/src/neon/api-error.ts +81 -0
  42. package/src/neon/api.ts +178 -0
  43. package/src/neon/index.ts +3 -0
  44. package/src/neon/project.ts +870 -0
@@ -0,0 +1,345 @@
1
+ import type { Context } from "../context.js";
2
+ import { Resource } from "../resource.js";
3
+ import type { Secret } from "../secret.js";
4
+ import { type NeonApiOptions } from "./api.js";
5
+ /**
6
+ * A Neon region where projects can be provisioned
7
+ */
8
+ export type NeonRegion = "aws-us-east-1" | "aws-us-east-2" | "aws-us-west-2" | "aws-eu-central-1" | "aws-eu-west-2" | "aws-ap-southeast-1" | "aws-ap-southeast-2" | "aws-sa-east-1" | "azure-eastus2" | "azure-westus3" | "azure-gwc";
9
+ /**
10
+ * Properties for creating or updating a Neon project
11
+ */
12
+ export interface NeonProjectProps extends NeonApiOptions {
13
+ /**
14
+ * Name of the project
15
+ */
16
+ name: string;
17
+ /**
18
+ * Region where the project will be provisioned
19
+ * @default "aws-us-east-1"
20
+ */
21
+ region_id?: NeonRegion;
22
+ /**
23
+ * PostgreSQL version to use
24
+ * @default 15
25
+ */
26
+ pg_version?: 14 | 15 | 16;
27
+ /**
28
+ * Whether to create a default branch and endpoint
29
+ * @default true
30
+ */
31
+ default_endpoint?: boolean;
32
+ /**
33
+ * Default branch name
34
+ * @default "main"
35
+ */
36
+ default_branch_name?: string;
37
+ /**
38
+ * Existing project ID to update
39
+ * Used internally during update operations
40
+ * @internal
41
+ */
42
+ existing_project_id?: string;
43
+ }
44
+ /**
45
+ * A Neon database
46
+ */
47
+ export interface NeonDatabase {
48
+ /**
49
+ * Database ID
50
+ */
51
+ id: number;
52
+ /**
53
+ * ID of the branch this database belongs to
54
+ */
55
+ branch_id: string;
56
+ /**
57
+ * Database name
58
+ */
59
+ name: string;
60
+ /**
61
+ * Name of the database owner role
62
+ */
63
+ owner_name: string;
64
+ /**
65
+ * Time at which the database was created
66
+ */
67
+ created_at: string;
68
+ /**
69
+ * Time at which the database was last updated
70
+ */
71
+ updated_at: string;
72
+ }
73
+ /**
74
+ * A Neon database role
75
+ */
76
+ export interface NeonRole {
77
+ /**
78
+ * ID of the branch this role belongs to
79
+ */
80
+ branch_id: string;
81
+ /**
82
+ * Role name
83
+ */
84
+ name: string;
85
+ /**
86
+ * Role password (only included during creation)
87
+ */
88
+ password?: string;
89
+ /**
90
+ * Whether this role is protected from deletion
91
+ */
92
+ protected: boolean;
93
+ /**
94
+ * Time at which the role was created
95
+ */
96
+ created_at: string;
97
+ /**
98
+ * Time at which the role was last updated
99
+ */
100
+ updated_at: string;
101
+ }
102
+ /**
103
+ * A Neon branch
104
+ */
105
+ export interface NeonBranch {
106
+ /**
107
+ * Branch ID
108
+ */
109
+ id: string;
110
+ /**
111
+ * ID of the project this branch belongs to
112
+ */
113
+ project_id: string;
114
+ /**
115
+ * Branch name
116
+ */
117
+ name: string;
118
+ /**
119
+ * Current state of the branch
120
+ */
121
+ current_state: string;
122
+ /**
123
+ * Pending state of the branch
124
+ */
125
+ pending_state: string;
126
+ /**
127
+ * Time at which the branch was created
128
+ */
129
+ created_at: string;
130
+ /**
131
+ * Time at which the branch was last updated
132
+ */
133
+ updated_at: string;
134
+ }
135
+ /**
136
+ * A Neon compute endpoint
137
+ */
138
+ export interface NeonEndpoint {
139
+ /**
140
+ * Endpoint ID
141
+ */
142
+ id: string;
143
+ /**
144
+ * Host for connecting to this endpoint
145
+ */
146
+ host: string;
147
+ /**
148
+ * ID of the project this endpoint belongs to
149
+ */
150
+ project_id: string;
151
+ /**
152
+ * ID of the branch this endpoint belongs to
153
+ */
154
+ branch_id: string;
155
+ /**
156
+ * Endpoint type (read_write, read_only)
157
+ */
158
+ type: string;
159
+ /**
160
+ * Current state of the endpoint
161
+ */
162
+ current_state: string;
163
+ /**
164
+ * Pending state of the endpoint
165
+ */
166
+ pending_state: string;
167
+ /**
168
+ * Region ID where this endpoint is provisioned
169
+ */
170
+ region_id: string;
171
+ /**
172
+ * Minimum compute units for autoscaling
173
+ */
174
+ autoscaling_limit_min_cu: number;
175
+ /**
176
+ * Maximum compute units for autoscaling
177
+ */
178
+ autoscaling_limit_max_cu: number;
179
+ /**
180
+ * Whether connection pooler is enabled
181
+ */
182
+ pooler_enabled: boolean;
183
+ /**
184
+ * Connection pooler mode
185
+ */
186
+ pooler_mode: string;
187
+ /**
188
+ * Whether this endpoint is disabled
189
+ */
190
+ disabled: boolean;
191
+ /**
192
+ * Whether passwordless access is enabled
193
+ */
194
+ passwordless_access: boolean;
195
+ /**
196
+ * Time at which the endpoint was created
197
+ */
198
+ created_at: string;
199
+ /**
200
+ * Time at which the endpoint was last updated
201
+ */
202
+ updated_at: string;
203
+ /**
204
+ * Proxy host for this endpoint
205
+ */
206
+ proxy_host: string;
207
+ /**
208
+ * Endpoint settings
209
+ */
210
+ settings: {
211
+ /**
212
+ * PostgreSQL settings
213
+ */
214
+ pg_settings: Record<string, any>;
215
+ };
216
+ }
217
+ /**
218
+ * A Neon connection URI
219
+ */
220
+ export interface NeonConnectionUri {
221
+ /**
222
+ * Connection URI string
223
+ */
224
+ connection_uri: Secret;
225
+ /**
226
+ * Connection parameters
227
+ */
228
+ connection_parameters: {
229
+ database: string;
230
+ host: string;
231
+ port: number;
232
+ user: string;
233
+ password: Secret;
234
+ };
235
+ }
236
+ /**
237
+ * A Neon operation
238
+ */
239
+ export interface NeonOperation {
240
+ /**
241
+ * Operation ID
242
+ */
243
+ id: string;
244
+ /**
245
+ * ID of the project this operation belongs to
246
+ */
247
+ project_id: string;
248
+ /**
249
+ * ID of the branch this operation affects, if applicable
250
+ */
251
+ branch_id?: string;
252
+ /**
253
+ * ID of the endpoint this operation affects, if applicable
254
+ */
255
+ endpoint_id?: string;
256
+ /**
257
+ * Action being performed
258
+ */
259
+ action: string;
260
+ /**
261
+ * Current status of the operation
262
+ */
263
+ status: string;
264
+ /**
265
+ * Number of failures encountered
266
+ */
267
+ failures_count: number;
268
+ /**
269
+ * Time at which the operation was created
270
+ */
271
+ created_at: string;
272
+ /**
273
+ * Time at which the operation was last updated
274
+ */
275
+ updated_at: string;
276
+ }
277
+ /**
278
+ * Output returned after Neon project creation/update
279
+ * IMPORTANT: The interface name MUST match the exported resource name
280
+ */
281
+ export interface NeonProject extends Resource<"neon::Project">, Omit<NeonProjectProps, "apiKey" | "existing_project_id"> {
282
+ /**
283
+ * The ID of the project
284
+ */
285
+ id: string;
286
+ /**
287
+ * Time at which the project was created
288
+ */
289
+ created_at: string;
290
+ /**
291
+ * Time at which the project was last updated
292
+ */
293
+ updated_at: string;
294
+ /**
295
+ * Hostname for proxy access
296
+ */
297
+ proxy_host?: string;
298
+ /**
299
+ * Connection URIs for the databases
300
+ */
301
+ connection_uris: [NeonConnectionUri, ...NeonConnectionUri[]];
302
+ /**
303
+ * Database roles created with the project
304
+ */
305
+ roles: [NeonRole, ...NeonRole[]];
306
+ /**
307
+ * Databases created with the project
308
+ */
309
+ databases?: [NeonDatabase, ...NeonDatabase[]];
310
+ /**
311
+ * Default branch information
312
+ */
313
+ branch?: NeonBranch;
314
+ /**
315
+ * Compute endpoints for the project
316
+ */
317
+ endpoints: [NeonEndpoint, ...NeonEndpoint[]];
318
+ }
319
+ /**
320
+ * Creates a Neon serverless PostgreSQL project.
321
+ *
322
+ * @example
323
+ * // Create a basic Neon project with default settings:
324
+ * const project = await NeonProject("my-project", {
325
+ * name: "My Project"
326
+ * });
327
+ *
328
+ * @example
329
+ * // Create a Neon project in a specific region with a specific PostgreSQL version:
330
+ * const euProject = await NeonProject("my-eu-project", {
331
+ * name: "My EU Project",
332
+ * region_id: "aws-eu-west-1",
333
+ * pg_version: 16,
334
+ * apiKey: alchemy.secret(process.env.NEON_API_KEY)
335
+ * });
336
+ *
337
+ * @example
338
+ * // Create a Neon project with a custom default branch name:
339
+ * const devProject = await NeonProject("dev-project", {
340
+ * name: "Development Project",
341
+ * default_branch_name: "development"
342
+ * });
343
+ */
344
+ export declare const NeonProject: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<NeonProject>, id: string, props: NeonProjectProps) => Promise<NeonProject>);
345
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/neon/project.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,oBAAoB,GACpB,oBAAoB,GACpB,eAAe,GACf,eAAe,GACf,eAAe,GACf,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;;OAGG;IACH,UAAU,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IAE1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,U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;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,eAAe,EAAE,CAAC,iBAAiB,EAAE,GAAG,iBAAiB,EAAE,CAAC,CAAC;IAE7D;;OAEG;IACH,KAAK,EAAE,CAAC,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;IAE9C;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,CAAC,YAAY,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,WAAW,yFAGd,OAAO,CAAC,WAAW,CAAC,MACtB,MAAM,SACH,gBAAgB,KACtB,OAAO,CAAC,WAAW,CAAC,CAyHxB,CAAC"}
@@ -0,0 +1,305 @@
1
+ import { alchemy } from "../alchemy.js";
2
+ import { Resource } from "../resource.js";
3
+ import { handleApiError } from "./api-error.js";
4
+ import { createNeonApi } from "./api.js";
5
+ /**
6
+ * Creates a Neon serverless PostgreSQL project.
7
+ *
8
+ * @example
9
+ * // Create a basic Neon project with default settings:
10
+ * const project = await NeonProject("my-project", {
11
+ * name: "My Project"
12
+ * });
13
+ *
14
+ * @example
15
+ * // Create a Neon project in a specific region with a specific PostgreSQL version:
16
+ * const euProject = await NeonProject("my-eu-project", {
17
+ * name: "My EU Project",
18
+ * region_id: "aws-eu-west-1",
19
+ * pg_version: 16,
20
+ * apiKey: alchemy.secret(process.env.NEON_API_KEY)
21
+ * });
22
+ *
23
+ * @example
24
+ * // Create a Neon project with a custom default branch name:
25
+ * const devProject = await NeonProject("dev-project", {
26
+ * name: "Development Project",
27
+ * default_branch_name: "development"
28
+ * });
29
+ */
30
+ export const NeonProject = Resource("neon::Project", async function (id, props) {
31
+ const api = createNeonApi(props);
32
+ const projectId = props.existing_project_id || this.output?.id;
33
+ if (this.phase === "delete") {
34
+ try {
35
+ // Check if the project exists before attempting to delete
36
+ if (projectId) {
37
+ const deleteResponse = await api.delete(`/projects/${projectId}`);
38
+ if (!deleteResponse.ok && deleteResponse.status !== 404) {
39
+ await handleApiError(deleteResponse, "delete", "project", id);
40
+ }
41
+ }
42
+ }
43
+ catch (error) {
44
+ console.error(`Error deleting Neon project ${id}:`, error);
45
+ throw error;
46
+ }
47
+ return this.destroy();
48
+ }
49
+ let response;
50
+ try {
51
+ if (this.phase === "update" && projectId) {
52
+ // Update existing project
53
+ // Neon only allows updating the project name
54
+ const projectResponse = await api.patch(`/projects/${projectId}`, {
55
+ project: {
56
+ name: props.name,
57
+ },
58
+ });
59
+ if (!projectResponse.ok) {
60
+ await handleApiError(projectResponse, "update", "project", id);
61
+ }
62
+ const initialData = await projectResponse.json();
63
+ // Reify project properties to get complete data
64
+ response = await getProject(api, projectId, initialData);
65
+ }
66
+ else {
67
+ // Check if a project with this ID already exists
68
+ if (projectId) {
69
+ const getResponse = await api.get(`/projects/${projectId}`);
70
+ if (getResponse.ok) {
71
+ // Project exists, update it
72
+ const projectResponse = await api.patch(`/projects/${projectId}`, {
73
+ project: {
74
+ name: props.name,
75
+ },
76
+ });
77
+ if (!projectResponse.ok) {
78
+ await handleApiError(projectResponse, "update", "project", id);
79
+ }
80
+ const initialData = await projectResponse.json();
81
+ // Reify project properties to get complete data
82
+ response = await getProject(api, projectId, initialData);
83
+ }
84
+ else if (getResponse.status !== 404) {
85
+ // Unexpected error during GET check
86
+ await handleApiError(getResponse, "get", "project", id);
87
+ throw new Error("Failed to check if project exists");
88
+ }
89
+ else {
90
+ // Project doesn't exist, create new
91
+ response = await createNewProject(api, props);
92
+ }
93
+ }
94
+ else {
95
+ // No output ID, create new project
96
+ response = await createNewProject(api, props);
97
+ }
98
+ }
99
+ // Wait for any pending operations to complete
100
+ if (response.operations && response.operations.length > 0) {
101
+ await waitForOperations(api, response.operations);
102
+ }
103
+ // Get the latest project state after operations complete
104
+ if (response.project?.id) {
105
+ // Reify project properties to get complete data
106
+ response = await getProject(api, response.project.id, response);
107
+ }
108
+ return this({
109
+ id: response.project.id,
110
+ name: response.project.name,
111
+ region_id: response.project.region_id,
112
+ pg_version: response.project.pg_version,
113
+ created_at: response.project.created_at,
114
+ updated_at: response.project.updated_at,
115
+ proxy_host: response.project.proxy_host,
116
+ // Pass through the provided props except apiKey (which is sensitive)
117
+ default_endpoint: props.default_endpoint,
118
+ default_branch_name: props.default_branch_name,
119
+ baseUrl: props.baseUrl,
120
+ // Add all available data
121
+ // @ts-ignore - api ensures they're non-empty
122
+ connection_uris: response.connection_uris,
123
+ // @ts-ignore
124
+ roles: response.roles,
125
+ // @ts-ignore
126
+ databases: response.databases,
127
+ // @ts-ignore
128
+ branch: response.branch,
129
+ // @ts-ignore
130
+ endpoints: response.endpoints,
131
+ });
132
+ }
133
+ catch (error) {
134
+ console.error(`Error ${this.phase} Neon project '${id}':`, error);
135
+ throw error;
136
+ }
137
+ });
138
+ /**
139
+ * Helper function to create a new Neon project
140
+ */
141
+ async function createNewProject(api, props) {
142
+ const defaultEndpoint = props.default_endpoint ?? true;
143
+ const projectResponse = await api.post("/projects", {
144
+ project: {
145
+ name: props.name,
146
+ region_id: props.region_id || "aws-us-east-1",
147
+ pg_version: props.pg_version || 15,
148
+ default_endpoint: defaultEndpoint,
149
+ branch: defaultEndpoint
150
+ ? { name: props.default_branch_name || "main" }
151
+ : undefined,
152
+ },
153
+ });
154
+ if (!projectResponse.ok) {
155
+ await handleApiError(projectResponse, "create", "project");
156
+ }
157
+ return (await projectResponse.json());
158
+ }
159
+ /**
160
+ * Helper function to get complete project details by fetching all related data
161
+ *
162
+ * @param api The Neon API client
163
+ * @param projectId The project ID
164
+ * @param initialData Initial project data (optional)
165
+ * @returns Complete project data with all related resources
166
+ */
167
+ async function getProject(api, projectId, initialData = {}) {
168
+ // Get the latest project details
169
+ const updatedData = await getProjectDetails(api, projectId);
170
+ // Start with a copy of the initial data
171
+ let responseData = { ...initialData };
172
+ // Check if we have a branch ID from the initial data
173
+ const branchId = initialData.branch?.id;
174
+ if (branchId) {
175
+ // Get the branch details
176
+ const branchData = await getBranchDetails(api, projectId, branchId);
177
+ // Update with the latest branch data
178
+ responseData.branch = branchData.branch;
179
+ // Also fetch the latest endpoint details for this branch
180
+ const endpointData = await getEndpointDetails(api, projectId, branchId);
181
+ // Update with the latest endpoint data if available
182
+ if (endpointData.endpoints && endpointData.endpoints.length > 0) {
183
+ responseData.endpoints = endpointData.endpoints;
184
+ }
185
+ }
186
+ // Preserve all data from the original response
187
+ // Only update properties that might have changed during operations
188
+ return {
189
+ ...responseData,
190
+ connection_uris: (updatedData.connection_uris || responseData.connection_uris)?.map((uri) => ({
191
+ connection_uri: alchemy.secret(uri.connection_uri),
192
+ connection_parameters: {
193
+ database: uri.connection_parameters.database,
194
+ host: uri.connection_parameters.host,
195
+ port: uri.connection_parameters.port ?? 5432,
196
+ user: uri.connection_parameters.user ?? "neondb_owner",
197
+ password: alchemy.secret(uri.connection_parameters.password),
198
+ },
199
+ })),
200
+ project: updatedData.project,
201
+ branch: updatedData.branch || responseData.branch,
202
+ endpoints: updatedData.endpoints || responseData.endpoints,
203
+ };
204
+ }
205
+ /**
206
+ * Wait for operations to complete
207
+ *
208
+ * @param api The Neon API client
209
+ * @param operations Operations to wait for
210
+ * @throws Error if an operation fails or times out
211
+ * @returns Promise that resolves when all operations complete
212
+ */
213
+ async function waitForOperations(api, operations) {
214
+ const pendingOperations = operations.filter((op) => op.status !== "finished" && op.status !== "failed");
215
+ if (pendingOperations.length === 0) {
216
+ return;
217
+ }
218
+ // Maximum wait time in milliseconds (5 minutes)
219
+ const maxWaitTime = 5 * 60 * 1000;
220
+ // Initial delay between retries in milliseconds
221
+ const initialRetryDelay = 500;
222
+ // Maximum delay between retries
223
+ const maxRetryDelay = 10000;
224
+ // Backoff factor for exponential backoff
225
+ const backoffFactor = 1.5;
226
+ for (const operation of pendingOperations) {
227
+ let totalWaitTime = 0;
228
+ let retryDelay = initialRetryDelay;
229
+ let operationStatus = operation.status;
230
+ while (operationStatus !== "finished" &&
231
+ operationStatus !== "failed" &&
232
+ totalWaitTime < maxWaitTime) {
233
+ // Wait before checking again with exponential backoff
234
+ await new Promise((resolve) => setTimeout(resolve, retryDelay));
235
+ totalWaitTime += retryDelay;
236
+ // Increase delay for next retry with exponential backoff, up to max
237
+ retryDelay = Math.min(retryDelay * backoffFactor, maxRetryDelay);
238
+ // Check operation status
239
+ const operationResponse = await api.get(`/projects/${operation.project_id}/operations/${operation.id}`);
240
+ if (operationResponse.ok) {
241
+ const operationData = await operationResponse.json();
242
+ operationStatus = operationData.operation?.status;
243
+ }
244
+ else {
245
+ throw new Error(`Failed to check operation ${operation.id} status: HTTP ${operationResponse.status}`);
246
+ }
247
+ }
248
+ if (operationStatus === "failed") {
249
+ throw new Error(`Operation ${operation.id} (${operation.action}) failed`);
250
+ }
251
+ else if (totalWaitTime >= maxWaitTime) {
252
+ throw new Error(`Timeout waiting for operation ${operation.id} (${operation.action}) to complete`);
253
+ }
254
+ }
255
+ // Explicitly return when all operations are complete
256
+ return;
257
+ }
258
+ /**
259
+ * Get the latest project details
260
+ *
261
+ * @param api The Neon API client
262
+ * @param projectId The project ID
263
+ * @returns Project details including branch and endpoints
264
+ * @throws Error if project details cannot be retrieved
265
+ */
266
+ async function getProjectDetails(api, projectId) {
267
+ const response = await api.get(`/projects/${projectId}`);
268
+ if (!response.ok) {
269
+ throw new Error(`Failed to get project details: HTTP ${response.status}`);
270
+ }
271
+ return (await response.json());
272
+ }
273
+ /**
274
+ * Get the latest branch details
275
+ *
276
+ * @param api The Neon API client
277
+ * @param projectId The project ID
278
+ * @param branchId The branch ID
279
+ * @returns Branch details
280
+ * @throws Error if branch details cannot be retrieved
281
+ */
282
+ async function getBranchDetails(api, projectId, branchId) {
283
+ const response = await api.get(`/projects/${projectId}/branches/${branchId}`);
284
+ if (!response.ok) {
285
+ throw new Error(`Failed to get branch details: HTTP ${response.status}`);
286
+ }
287
+ return (await response.json());
288
+ }
289
+ /**
290
+ * Get the latest endpoint details for a branch
291
+ *
292
+ * @param api The Neon API client
293
+ * @param projectId The project ID
294
+ * @param branchId The branch ID
295
+ * @returns Endpoint details for the branch
296
+ * @throws Error if endpoint details cannot be retrieved
297
+ */
298
+ async function getEndpointDetails(api, projectId, branchId) {
299
+ const response = await api.get(`/projects/${projectId}/branches/${branchId}/endpoints`);
300
+ if (!response.ok) {
301
+ throw new Error(`Failed to get endpoint details: HTTP ${response.status}`);
302
+ }
303
+ return (await response.json());
304
+ }
305
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/neon/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAuB,MAAM,UAAU,CAAC;AA6d9D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CACjC,eAAe,EACf,KAAK,WAEH,EAAU,EACV,KAAuB;IAEvB,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,SAAS,GAAG,KAAK,CAAC,mBAAmB,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;IAE/D,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,0DAA0D;YAC1D,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,cAAc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Q,GAAG,MAAM,GAAG,CAAC,GAAG,CAC5B,aAAa,SAAS,aAAa,QAAQ,YAAY,CACxD,CAAC;IAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,wCAAwC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkC,CAAC;AAClE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alchemy",
3
- "version": "0.12.6",
3
+ "version": "0.12.7",
4
4
  "type": "module",
5
5
  "module": "./lib/index.js",
6
6
  "scripts": {
@@ -21,6 +21,7 @@
21
21
  "./esbuild": "./lib/esbuild/index.js",
22
22
  "./fs": "./lib/fs/index.js",
23
23
  "./github": "./lib/github/index.js",
24
+ "./neon": "./lib/neon/index.js",
24
25
  "./os": "./lib/os/index.js",
25
26
  "./shadcn": "./lib/shadcn/index.js",
26
27
  "./stripe": "./lib/stripe/index.js",