@northflank/js-client 0.9.3-beta.0 → 0.9.3-buncompat.0
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/dist/cjs/api-client.d.ts +6 -33
- package/dist/cjs/api-client.js +590 -597
- package/dist/esm/api-client.d.ts +6 -33
- package/dist/esm/api-client.js +563 -568
- package/package.json +1 -1
package/dist/esm/api-client.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import * as stream from 'node:stream';
|
|
3
3
|
import { Stream } from 'node:stream';
|
|
4
|
-
import { ClientHttp2Session } from 'node:http2';
|
|
5
4
|
|
|
6
5
|
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
|
|
7
6
|
declare abstract class ApiClientContextProvider {
|
|
@@ -420,9 +419,6 @@ declare class NorthflankPortForwarder extends EventEmitter {
|
|
|
420
419
|
}
|
|
421
420
|
|
|
422
421
|
interface ExecCommand extends EventEmitter {
|
|
423
|
-
readonly stdOut: stream.PassThrough;
|
|
424
|
-
readonly stdErr: stream.PassThrough;
|
|
425
|
-
readonly stdIn: stream.PassThrough;
|
|
426
422
|
on(event: 'auth-success', listener: () => any): any;
|
|
427
423
|
on(event: 'command-started', listener: () => any): any;
|
|
428
424
|
on(event: 'command-completed', listener: () => any): any;
|
|
@@ -433,15 +429,8 @@ interface ExecCommand extends EventEmitter {
|
|
|
433
429
|
on(event: 'error', listener: (error: any) => any): any;
|
|
434
430
|
on(event: 'std-out-data', listener: (data: any) => any): any;
|
|
435
431
|
on(event: 'std-err-data', listener: (data: any) => any): any;
|
|
436
|
-
waitForCommandResult: () => Promise<CommandResult>;
|
|
437
|
-
start: () => Promise<CommandResult>;
|
|
438
|
-
resizeTerminal: (size: {
|
|
439
|
-
rows?: number;
|
|
440
|
-
columns?: number;
|
|
441
|
-
}) => Promise<void>;
|
|
442
432
|
}
|
|
443
|
-
|
|
444
|
-
type ValidExecLocations = (typeof VALID_EXEC_LOCATIONS)[number];
|
|
433
|
+
|
|
445
434
|
type ExecConfig = {
|
|
446
435
|
teamId?: string;
|
|
447
436
|
projectId: string;
|
|
@@ -457,10 +446,7 @@ type ExecConfig = {
|
|
|
457
446
|
tty?: boolean;
|
|
458
447
|
ttyRows?: number;
|
|
459
448
|
ttyColumns?: number;
|
|
460
|
-
execLocationHint?: ValidExecLocations | undefined;
|
|
461
|
-
execLocationOverride?: string | undefined;
|
|
462
449
|
};
|
|
463
|
-
|
|
464
450
|
declare class ExecCommandStandard extends EventEmitter implements ExecCommand {
|
|
465
451
|
private readonly baseUrl;
|
|
466
452
|
readonly execConfig: ExecConfig;
|
|
@@ -470,8 +456,7 @@ declare class ExecCommandStandard extends EventEmitter implements ExecCommand {
|
|
|
470
456
|
readonly stdErr: stream.PassThrough;
|
|
471
457
|
readonly stdIn: stream.PassThrough;
|
|
472
458
|
private remote;
|
|
473
|
-
|
|
474
|
-
private duplex;
|
|
459
|
+
private currentCommand;
|
|
475
460
|
constructor(baseUrl: string, execConfig: ExecConfig, token: string, // readonly timeout: number = 120 // Timeout in seconds
|
|
476
461
|
agent: any, stdOut?: stream.PassThrough, stdErr?: stream.PassThrough, stdIn?: stream.PassThrough);
|
|
477
462
|
private get execEndpoint();
|
|
@@ -500,8 +485,6 @@ type ExecCommandData = {
|
|
|
500
485
|
shell?: string;
|
|
501
486
|
user?: string | number;
|
|
502
487
|
group?: string | number;
|
|
503
|
-
execLocationHint?: ValidExecLocations | undefined;
|
|
504
|
-
execLocationOverride?: string | undefined;
|
|
505
488
|
};
|
|
506
489
|
type ExecCommandDataAddon = ExecCommandData & {
|
|
507
490
|
instanceName: string;
|
|
@@ -521,15 +504,7 @@ type CommandInfo = {
|
|
|
521
504
|
declare class NorthflankExecCommand {
|
|
522
505
|
private readonly contextProvider;
|
|
523
506
|
private readonly agent?;
|
|
524
|
-
|
|
525
|
-
constructor(contextProvider: ApiClientContextProvider, agent?: any | undefined, prewarmExecLocations?: ValidExecLocations[]);
|
|
526
|
-
protected http2Session(opts: {
|
|
527
|
-
execLocationHint: ValidExecLocations;
|
|
528
|
-
execLocationOverride?: never;
|
|
529
|
-
} | {
|
|
530
|
-
execLocationOverride: string;
|
|
531
|
-
execLocationHint?: never;
|
|
532
|
-
}): any;
|
|
507
|
+
constructor(contextProvider: ApiClientContextProvider, agent?: any | undefined);
|
|
533
508
|
/**
|
|
534
509
|
* Runs command on a Northflank service and waits for completion returning command result and
|
|
535
510
|
* standard output and standard error emitted during commmand execution.
|
|
@@ -552,7 +527,7 @@ declare class NorthflankExecCommand {
|
|
|
552
527
|
teamId?: string;
|
|
553
528
|
projectId: string;
|
|
554
529
|
serviceId: string;
|
|
555
|
-
}, data?: ExecSessionData, commandInitCompletedCallback?: (commandInfo: CommandInfo) => void): Promise<
|
|
530
|
+
}, data?: ExecSessionData, commandInitCompletedCallback?: (commandInfo: CommandInfo) => void): Promise<ExecCommandStandard>;
|
|
556
531
|
/**
|
|
557
532
|
* Runs command on a Northflank job and waits for completion returning command result and
|
|
558
533
|
* standard output and standard error emitted during commmand execution.
|
|
@@ -575,7 +550,7 @@ declare class NorthflankExecCommand {
|
|
|
575
550
|
teamId?: string;
|
|
576
551
|
projectId: string;
|
|
577
552
|
jobId: string;
|
|
578
|
-
}, data?: ExecSessionData, commandInitCompletedCallback?: (commandInfo: CommandInfo) => void): Promise<
|
|
553
|
+
}, data?: ExecSessionData, commandInitCompletedCallback?: (commandInfo: CommandInfo) => void): Promise<ExecCommandStandard>;
|
|
579
554
|
/**
|
|
580
555
|
* Runs command on a Northflank job and waits for completion returning command result and
|
|
581
556
|
* standard output and standard error emitted during commmand execution.
|
|
@@ -598,7 +573,7 @@ declare class NorthflankExecCommand {
|
|
|
598
573
|
teamId?: string;
|
|
599
574
|
projectId: string;
|
|
600
575
|
addonId: string;
|
|
601
|
-
}, data?: ExecSessionData, commandInitCompletedCallback?: (commandInfo: CommandInfo) => void): Promise<
|
|
576
|
+
}, data?: ExecSessionData, commandInitCompletedCallback?: (commandInfo: CommandInfo) => void): Promise<ExecCommandStandard>;
|
|
602
577
|
private execCommand;
|
|
603
578
|
private shellSession;
|
|
604
579
|
private getCommandRunner;
|
|
@@ -618,7 +593,6 @@ type DownloadOptions = {
|
|
|
618
593
|
containerName?: string;
|
|
619
594
|
instanceName?: string;
|
|
620
595
|
ignoreList?: string[];
|
|
621
|
-
execLocationHint?: ValidExecLocations;
|
|
622
596
|
};
|
|
623
597
|
type UploadOptions = {
|
|
624
598
|
localPath: string;
|
|
@@ -626,7 +600,6 @@ type UploadOptions = {
|
|
|
626
600
|
containerName?: string;
|
|
627
601
|
instanceName?: string;
|
|
628
602
|
ignoreList?: string[];
|
|
629
|
-
execLocationHint?: ValidExecLocations;
|
|
630
603
|
};
|
|
631
604
|
declare class NorthflankFileCopy {
|
|
632
605
|
private readonly exec;
|