@openstrap/plugin-contract 0.2.0 → 0.2.1
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/Provider.d.ts +10 -0
- package/Transport.d.ts +20 -0
- package/index.d.ts +4 -0
- package/package.json +1 -1
package/Provider.d.ts
CHANGED
|
@@ -226,4 +226,14 @@ export type Provider = {
|
|
|
226
226
|
* runs says so in the outcome.
|
|
227
227
|
*/
|
|
228
228
|
publish?(machine: MachineHandle, ports: readonly number[], options?: MachineStartOptions): Promise<PublishedPorts>;
|
|
229
|
+
/** Every machine this provider holds on this host, made by openstrap or not. */
|
|
230
|
+
discover?(): Promise<Array<{ name: string; resourceId: string; status: "running" | "stopped" | "suspended" | "unknown" }>>;
|
|
231
|
+
/**
|
|
232
|
+
* Where a machine's disk came from, read from the provider's own records: a clone names its source
|
|
233
|
+
* machine (and snapshot); a machine that is not a clone answers null.
|
|
234
|
+
*
|
|
235
|
+
* `reference` is the image reference a blueprint would write for that source — the same form
|
|
236
|
+
* `resolveSource` produces for it.
|
|
237
|
+
*/
|
|
238
|
+
diskOrigin?(machine: MachineHandle): Promise<{ source: MachineSource; reference: string; detail: string } | null>;
|
|
229
239
|
};
|
package/Transport.d.ts
CHANGED
|
@@ -76,6 +76,20 @@ export type OpenSshAccess = {
|
|
|
76
76
|
options?: Readonly<Record<string, string>>;
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
+
export type SshConfigTarget = { machine: string; host: string; port: number };
|
|
80
|
+
|
|
81
|
+
export type SshConfigEntry = {
|
|
82
|
+
alias: string;
|
|
83
|
+
user: string;
|
|
84
|
+
hostName: string;
|
|
85
|
+
port: number;
|
|
86
|
+
/** Paths on the transport host. Key material is never returned. */
|
|
87
|
+
identityFiles: string[];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type SshConfigReport = { file: string; entries: SshConfigEntry[] };
|
|
91
|
+
export type TransportAuthenticationFailure = "connector" | "provided";
|
|
92
|
+
|
|
79
93
|
/**
|
|
80
94
|
* Opens a transport to a target.
|
|
81
95
|
*
|
|
@@ -104,10 +118,16 @@ export type TransportConnector = {
|
|
|
104
118
|
* key it was given rather than one of the connector's own. Nothing is kept.
|
|
105
119
|
*/
|
|
106
120
|
publicKeyOf?(privateKey: string): Promise<string>;
|
|
121
|
+
/** Loads a caller-declared key path on the transport host. The connector resolves the path. */
|
|
122
|
+
readIdentityFile?(target: string, path: string): Promise<string>;
|
|
107
123
|
/**
|
|
108
124
|
* How an OpenSSH client reaches the machine the way this transport does. Optional: a transport
|
|
109
125
|
* that is not SSH underneath has nothing to say to OpenSSH.
|
|
110
126
|
*/
|
|
111
127
|
openSshAccess?(request: TransportConnectionRequest): Promise<OpenSshAccess>;
|
|
128
|
+
/** Resolves existing OpenSSH client settings for a target, when supported. */
|
|
129
|
+
sshConfigFor?(target: SshConfigTarget): Promise<SshConfigReport>;
|
|
130
|
+
/** Identifies a rejected login and whether the connector or caller supplied the identity. */
|
|
131
|
+
authenticationFailure?(error: unknown): TransportAuthenticationFailure | undefined;
|
|
112
132
|
connect(request: TransportConnectionRequest): Promise<TransportConnection>;
|
|
113
133
|
};
|
package/index.d.ts
CHANGED
package/package.json
CHANGED