1 |
|
2 | import { APIClient } from '@heroku-cli/command';
|
3 | import { IOptions } from '@heroku-cli/command/lib/api-client';
|
4 | import { Dyno as APIDyno } from '@heroku-cli/schema';
|
5 | import { HTTP } from 'http-call';
|
6 | import * as net from 'net';
|
7 | import { Duplex } from 'stream';
|
8 | import * as tls from 'tls';
|
9 | import * as url from 'url';
|
10 | interface HerokuApiClientRun extends APIClient {
|
11 | options: IOptions & {
|
12 | rejectUnauthorized?: boolean;
|
13 | };
|
14 | }
|
15 | interface DynoOpts {
|
16 | 'exit-code'?: boolean;
|
17 | 'no-tty'?: boolean;
|
18 | app: string;
|
19 | attach?: boolean;
|
20 | command: string;
|
21 | dyno?: string;
|
22 | env?: string;
|
23 | heroku: APIClient;
|
24 | listen?: boolean;
|
25 | notify?: boolean;
|
26 | showStatus?: boolean;
|
27 | size?: string;
|
28 | type?: string;
|
29 | }
|
30 | export default class Dyno extends Duplex {
|
31 | opts: DynoOpts;
|
32 | readonly _useSSH: boolean;
|
33 | dyno?: APIDyno;
|
34 | heroku: HerokuApiClientRun;
|
35 | input: any;
|
36 | p: any;
|
37 | reject?: (reason?: any) => void;
|
38 | resolve?: (value?: unknown) => void;
|
39 | uri?: url.UrlWithStringQuery;
|
40 | unpipeStdin: any;
|
41 | useSSH: any;
|
42 | private _notified?;
|
43 | private _startedAt?;
|
44 | constructor(opts: DynoOpts);
|
45 | /**
|
46 | * Starts the dyno
|
47 | */
|
48 | start(): Promise<void>;
|
49 | _doStart(retries?: number): Promise<HTTP<unknown>>;
|
50 | /**
|
51 | * Attaches stdin/stdout to dyno
|
52 | */
|
53 | attach(): any;
|
54 | _rendezvous(): Promise<unknown>;
|
55 | _ssh(retries?: number): Promise<unknown>;
|
56 | _connect(): Promise<unknown>;
|
57 | _handle(localServer: net.Server): void;
|
58 | _isDebug(): boolean;
|
59 | _env(): {
|
60 | [key: string]: any;
|
61 | };
|
62 | _status(status: any): string;
|
63 | _readData(c?: tls.TLSSocket): (data: any) => void;
|
64 | _readStdin(c: any): void;
|
65 | _read(): void;
|
66 | _write(chunk: any, encoding: any, callback: any): void;
|
67 | _notify(): void;
|
68 | }
|
69 | export {};
|