@empiricalrun/playwright-utils 0.34.1 → 0.34.2
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/CHANGELOG.md +6 -0
- package/dist/postgres.d.ts +1 -1
- package/dist/postgres.d.ts.map +1 -1
- package/dist/postgres.js +18 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/postgres.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class PostgresClient {
|
|
|
10
10
|
constructor();
|
|
11
11
|
get(name: string, options?: GetOptions): Promise<PostgresDatabase>;
|
|
12
12
|
private getConnectionUri;
|
|
13
|
-
delete(
|
|
13
|
+
delete(name: string): Promise<void>;
|
|
14
14
|
query<T = Record<string, unknown>>(connectionUri: string, sql: string): Promise<T[]>;
|
|
15
15
|
execute(connectionUri: string, sql: string): Promise<{
|
|
16
16
|
statement: string;
|
package/dist/postgres.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../src/postgres.ts"],"names":[],"mappings":"AAgDA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAqB;;IAW7B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAqD1D,gBAAgB;IAwBxB,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../src/postgres.ts"],"names":[],"mappings":"AAgDA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAqB;;IAW7B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAqD1D,gBAAgB;IAwBxB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCnC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,CAAC,EAAE,CAAC;IAWT,OAAO,CACX,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAsBrD,OAAO,CAAC,eAAe;CAsBxB"}
|
package/dist/postgres.js
CHANGED
|
@@ -66,16 +66,29 @@ class PostgresClient {
|
|
|
66
66
|
}
|
|
67
67
|
return response.data.uri;
|
|
68
68
|
}
|
|
69
|
-
async delete(
|
|
70
|
-
const
|
|
69
|
+
async delete(name) {
|
|
70
|
+
const listResponse = await this.client.request("/api/neon/proxy", {
|
|
71
|
+
method: "POST",
|
|
72
|
+
body: {
|
|
73
|
+
action: "list",
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
if (listResponse.error) {
|
|
77
|
+
throw new Error(`Postgres list failed: ${listResponse.error}`);
|
|
78
|
+
}
|
|
79
|
+
const project = listResponse.data.projects.find((p) => p.name === name);
|
|
80
|
+
if (!project) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const deleteResponse = await this.client.request("/api/neon/proxy", {
|
|
71
84
|
method: "POST",
|
|
72
85
|
body: {
|
|
73
86
|
action: "delete",
|
|
74
|
-
projectId,
|
|
87
|
+
projectId: project.id,
|
|
75
88
|
},
|
|
76
89
|
});
|
|
77
|
-
if (
|
|
78
|
-
throw new Error(`Postgres delete failed: ${
|
|
90
|
+
if (deleteResponse.error) {
|
|
91
|
+
throw new Error(`Postgres delete failed: ${deleteResponse.error}`);
|
|
79
92
|
}
|
|
80
93
|
}
|
|
81
94
|
async query(connectionUri, sql) {
|