Extension sdk update (#15687)

* Update extension SDK with new APIs for exec with ENV vars and CWD

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>

* Update extension SDK with new APIs for exec with ENV vars and CWD

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
Guillaume Tardif 2022-09-20 10:46:44 +02:00 committed by GitHub
parent 86e82cba7a
commit efb9ca8caf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 137 additions and 15 deletions

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: DesktopUI
**`since`** 0.2.0
## Properties
### toast

View File

@ -8,6 +8,8 @@ skip_read_time: true
Allows opening native dialog boxes.
**`since`** 0.2.3
## Methods
### showOpenDialog

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: Docker
**`since`** 0.2.0
## Properties
### cli
@ -79,9 +81,9 @@ const containers = await ddClient.docker.listContainers();
#### Parameters
| Name | Type | Description |
|:-----------|:------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `options?` | `any` | (Optional). A JSON like `{ "all": true, "limit": 10, "size": true, "filters": JSON.stringify({ status: ["exited"] }), }` For more information about the different properties see [the Docker API endpoint documentation](../../../../../../engine/api/v1.37.md#operation/ContainerList). |
| Name | Type | Description |
| :------ | :------ | :------ |
| `options?` | `any` | (Optional). A JSON like `{ "all": true, "limit": 10, "size": true, "filters": JSON.stringify({ status: ["exited"] }), }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#operation/ContainerList). |
#### Returns
@ -101,9 +103,9 @@ const images = await ddClient.docker.listImages();
#### Parameters
| Name | Type | Description |
|:-----------|:------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `options?` | `any` | (Optional). A JSON like `{ "all": true, "filters": JSON.stringify({ dangling: ["true"] }), "digests": true }` For more information about the different properties see [the Docker API endpoint documentation](../../../../../../engine/api/v1.37.md#tag/Image). |
| Name | Type | Description |
| :------ | :------ | :------ |
| `options?` | `any` | (Optional). A JSON like `{ "all": true, "filters": JSON.stringify({ dangling: ["true"] }), "digests": true }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#tag/Image). |
#### Returns

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: DockerCommand
**`since`** 0.2.0
## Properties
### exec

View File

@ -89,9 +89,9 @@ const containers = await window.ddClient.listContainers();
#### Parameters
| Name | Type | Description |
|:----------|:--------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `options` | `never` | (Optional). A JSON like `{ "all": true, "limit": 10, "size": true, "filters": JSON.stringify({ status: ["exited"] }), }` For more information about the different properties see [the Docker API endpoint documentation](../../../../../../engine/api/v1.37.md#operation/ContainerList). |
| Name | Type | Description |
| :------ | :------ | :------ |
| `options` | `never` | (Optional). A JSON like `{ "all": true, "limit": 10, "size": true, "filters": JSON.stringify({ status: ["exited"] }), }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#operation/ContainerList). |
#### Returns
@ -119,9 +119,9 @@ const images = await window.ddClient.listImages();
#### Parameters
| Name | Type | Description |
|:----------|:--------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `options` | `never` | (Optional). A JSON like `{ "all": true, "filters": JSON.stringify({ dangling: ["true"] }), "digests": true }` For more information about the different properties see [the Docker API endpoint documentation](../../../../../../engine/api/v1.37.md#tag/Image). |
| Name | Type | Description |
| :------ | :------ | :------ |
| `options` | `never` | (Optional). A JSON like `{ "all": true, "filters": JSON.stringify({ dangling: ["true"] }), "digests": true }` For more information about the different properties see [the Docker API endpoint documentation](https://docs.docker.com/engine/api/v1.37/#tag/Image). |
#### Returns

View File

@ -10,16 +10,19 @@ skip_read_time: true
### Exec
**Exec**(`cmd`, `args`): `Promise`<[`ExecResult`](ExecResult.md)\>
**Exec**(`cmd`, `args`, `options?`): `Promise`<[`ExecResult`](ExecResult.md)\>
Executes a command.
**`since`** 0.2.0
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `cmd` | `string` | The command to execute. |
| `args` | `string`[] | The arguments of the command to execute. |
| `options?` | [`ExecOptions`](ExecOptions.md) | The list of options. |
#### Returns
@ -35,15 +38,18 @@ Streams the result of a command if `stream` is specified in the `options` parame
Specify the `stream` if the output of your command is too long or if you need to stream things indefinitely (for example container logs).
**`since`** 0.2.2
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `cmd` | `string` | The command to execute. |
| `args` | `string`[] | The arguments of the command to execute. |
| `options` | `Object` | The list of options. |
| `options.stream` | [`ExecStreamOptions`](ExecStreamOptions.md) | Provides three functions: `onOutput` (invoked every time `stdout` or `stderr` is received), `onError` and `onClose` (invoked when the stream has ended). |
| `options` | [`SpawnOptions`](SpawnOptions.md) | The list of options. |
#### Returns
[`ExecProcess`](ExecProcess.md)
The spawned process.

View File

@ -0,0 +1,27 @@
---
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: ExecOptions
**`since`** 0.3.0
## Hierarchy
- **`ExecOptions`**
↳ [`SpawnOptions`](SpawnOptions.md)
## Properties
### cwd
`Optional` **cwd**: `string`
___
### env
`Optional` **env**: `ProcessEnv`

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: ExecProcess
**`since`** 0.2.3
## Methods
### close

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: ExecResult
**`since`** 0.2.0
## Hierarchy
- [`RawExecResult`](RawExecResult.md)

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: ExecStreamOptions
**`since`** 0.2.2
## Methods
### onOutput
@ -17,6 +19,8 @@ By default, the output is split into chunks at arbitrary boundaries.
If you prefer the output to be split into complete lines, set `splitOutputLines`
to true. The callback is then invoked once for each line.
**`since`** 0.2.0
#### Parameters
| Name | Type | Description |

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: Extension
**`since`** 0.2.0
## Properties
### vm

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: ExtensionCli
**`since`** 0.2.0
## Properties
### exec

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: ExtensionHost
**`since`** 0.2.0
## Properties
### cli

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: ExtensionVM
**`since`** 0.2.0
## Properties
### cli

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: Host
**`since`** 0.2.0
## Methods
### openExternal
@ -14,6 +16,8 @@ skip_read_time: true
Opens an external URL with the system default browser.
**`since`** 0.2.0
```typescript
ddClient.host.openExternal("https://docker.com");
```
@ -36,6 +40,8 @@ ddClient.host.openExternal("https://docker.com");
Returns a string identifying the operating system platform. See https://nodejs.org/api/os.html#osplatform
**`since`** 0.2.2
___
### arch
@ -44,6 +50,8 @@ ___
Returns the operating system CPU architecture. See https://nodejs.org/api/os.html#osarch
**`since`** 0.2.2
___
### hostname
@ -51,3 +59,5 @@ ___
**hostname**: `string`
Returns the host name of the operating system. See https://nodejs.org/api/os.html#oshostname
**`since`** 0.2.2

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: HttpService
**`since`** 0.2.0
## Methods
### get

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: NavigationIntents
**`since`** 0.2.0
## Container Methods
### viewContainers

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: OpenDialogResult
**`since`** 0.2.3
## Properties
### canceled

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: RawExecResult
**`since`** 0.2.0
## Hierarchy
- **`RawExecResult`**

View File

@ -6,6 +6,8 @@ skip_read_time: true
# Interface: RequestConfig
**`since`** 0.2.0
## Properties
### url

View File

@ -9,6 +9,8 @@ skip_read_time: true
Error thrown when an HTTP response is received with a status code that falls
out to the range of 2xx.
**`since`** 0.2.0
## Properties
### name

View File

@ -0,0 +1,41 @@
---
description: Docker extension API reference
keywords: Docker, extensions, sdk, API, reference
skip_read_time: true
---
# Interface: SpawnOptions
**`since`** 0.3.0
## Hierarchy
- [`ExecOptions`](ExecOptions.md)
**`SpawnOptions`**
## Properties
### cwd
`Optional` **cwd**: `string`
#### Inherited from
[ExecOptions](ExecOptions.md).[cwd](ExecOptions.md#cwd)
___
### env
`Optional` **env**: `ProcessEnv`
#### Inherited from
[ExecOptions](ExecOptions.md).[env](ExecOptions.md#env)
___
### stream
**stream**: [`ExecStreamOptions`](ExecStreamOptions.md)

View File

@ -10,6 +10,8 @@ Toasts provide a brief notification to the user.
They appear temporarily and shouldn't interrupt the user experience.
They also don't require user input to disappear.
**`since`** 0.2.0
## Methods
### success