@heroku/heroku-cli-util 9.1.3-beta.6 → 9.1.3-beta.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { APIClient } from '@heroku-cli/command';
|
|
2
2
|
import { Server } from 'node:net';
|
|
3
3
|
import { ExtendedAddonAttachment } from '../../types/pg/data-api';
|
|
4
|
-
import { BastionConfig,
|
|
4
|
+
import { BastionConfig, ConnectionDetails, TunnelConfig } from '../../types/pg/tunnel';
|
|
5
5
|
/**
|
|
6
6
|
* Determines whether the attachment belongs to an add-on installed onto a non-shield Private Space.
|
|
7
7
|
* If true, the bastion information needs to be fetched from the Data API.
|
|
@@ -43,7 +43,7 @@ export declare const getBastionConfig: (config: Record<string, string>, baseName
|
|
|
43
43
|
* @param connectionDetails - The database connection details with attachment information
|
|
44
44
|
* @returns Object containing database environment variables and tunnel configuration
|
|
45
45
|
*/
|
|
46
|
-
export declare function getPsqlConfigs(connectionDetails:
|
|
46
|
+
export declare function getPsqlConfigs(connectionDetails: ConnectionDetails): {
|
|
47
47
|
dbEnv: NodeJS.ProcessEnv;
|
|
48
48
|
dbTunnelConfig: TunnelConfig;
|
|
49
49
|
};
|
|
@@ -58,7 +58,7 @@ export type PsqlConfigs = ReturnType<typeof getPsqlConfigs>;
|
|
|
58
58
|
* @returns Promise that resolves to the tunnel server or null if no bastion key is provided
|
|
59
59
|
* @throws Error if unable to establish the tunnel
|
|
60
60
|
*/
|
|
61
|
-
export declare function sshTunnel(connectionDetails:
|
|
61
|
+
export declare function sshTunnel(connectionDetails: ConnectionDetails, dbTunnelConfig: TunnelConfig, timeout?: number, createSSHTunnel?: typeof createSSHTunnelAdapter): Promise<Server | void>;
|
|
62
62
|
/**
|
|
63
63
|
* Adapter for tunnel-ssh v5 API. Translates our TunnelConfig into the v5
|
|
64
64
|
* createTunnel(tunnelOptions, serverOptions, sshOptions, forwardOptions) call
|
package/dist/utils/pg/psql.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
import { Server } from 'node:net';
|
|
3
|
-
import {
|
|
3
|
+
import { ConnectionDetails, TunnelConfig } from '../../types/pg/tunnel';
|
|
4
4
|
import { getPsqlConfigs, sshTunnel } from './bastion';
|
|
5
5
|
/**
|
|
6
6
|
* A small wrapper around tunnel-ssh so that other code doesn't have to worry about whether there is or is not a tunnel.
|
|
@@ -22,7 +22,7 @@ export declare class Tunnel {
|
|
|
22
22
|
* @param tunnelFn - The function to create the SSH tunnel (default: sshTunnel)
|
|
23
23
|
* @returns Promise that resolves to a new Tunnel instance
|
|
24
24
|
*/
|
|
25
|
-
static connect(connectionDetails:
|
|
25
|
+
static connect(connectionDetails: ConnectionDetails, tunnelConfig: TunnelConfig, tunnelFn: typeof sshTunnel): Promise<Tunnel>;
|
|
26
26
|
/**
|
|
27
27
|
* Closes the tunnel if it exists, or emits a fake close event if no tunnel is needed.
|
|
28
28
|
*
|
|
@@ -42,7 +42,7 @@ export default class PsqlService {
|
|
|
42
42
|
private readonly getPsqlConfigsFn;
|
|
43
43
|
private readonly spawnFn;
|
|
44
44
|
private readonly tunnelFn;
|
|
45
|
-
constructor(connectionDetails:
|
|
45
|
+
constructor(connectionDetails: ConnectionDetails, getPsqlConfigsFn?: typeof getPsqlConfigs, spawnFn?: typeof spawn, tunnelFn?: typeof sshTunnel);
|
|
46
46
|
/**
|
|
47
47
|
* Executes a PostgreSQL query using the instance's database connection details.
|
|
48
48
|
* It uses the `getPsqlConfigs` function to get the configuration for the database and the tunnel,
|