Dagger NodeJS SDK
api/client.gen.Client
The root of the DAG.
Hierarchy
-
BaseClient
↳
Client
Constructors
constructor
new Client(parent?
, _checkVersionCompatibility?
, _defaultPlatform?
): Client
Constructor is used for internal usage only, do not create object from it.
Parameters
Name | Type |
---|---|
parent? | Object |
parent.ctx | Context |
parent.queryTree? | QueryTree [] |
_checkVersionCompatibility? | boolean |
_defaultPlatform? | Platform |
Returns
Overrides
BaseClient.constructor
Properties
_checkVersionCompatibility
Private
Optional
Readonly
_checkVersionCompatibility: boolean
= undefined
_defaultPlatform
Private
Optional
Readonly
_defaultPlatform: Platform
= undefined
Methods
blob
blob(digest
, size
, mediaType
, uncompressed
): Directory
Retrieves a content-addressed blob.
Parameters
Name | Type | Description |
---|---|---|
digest | string | Digest of the blob |
size | number | Size of the blob |
mediaType | string | Media type of the blob |
uncompressed | string | Digest of the uncompressed blob |
Returns
cacheVolume
cacheVolume(key
): CacheVolume
Constructs a cache volume for a given cache key.
Parameters
Name | Type | Description |
---|---|---|
key | string | A string identifier to target this cache volume (e.g., "modules-cache"). |
Returns
checkVersionCompatibility
checkVersionCompatibility(version
): Promise
<boolean
>
Checks if the current Dagger Engine is compatible with an SDK's required version.
Parameters
Name | Type | Description |
---|---|---|
version | string | Version required by the SDK. |
Returns
Promise
<boolean
>
container
container(opts?
): Container
Creates a scratch container.
Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
Parameters
Name | Type |
---|---|
opts? | ClientContainerOpts |
Returns
currentFunctionCall
currentFunctionCall(): FunctionCall
The FunctionCall context that the SDK caller is currently executing in.
If the caller is not currently executing in a function, this will return an error.
Returns
currentModule
currentModule(): CurrentModule
The module currently being served in the session, if any.
Returns
currentTypeDefs
currentTypeDefs(): Promise
<TypeDef
[]>
The TypeDef representations of the objects currently being served in the session.
Returns
Promise
<TypeDef
[]>
defaultPlatform
defaultPlatform(): Promise
<Platform
>
The default platform of the engine.
Returns
Promise
<Platform
>
directory
directory(opts?
): Directory
Creates an empty directory.
Parameters
Name | Type |
---|---|
opts? | ClientDirectoryOpts |
Returns
file
file(id
): File
Parameters
Name | Type |
---|---|
id | FileID |
Returns
Deprecated
Use loadFileFromID instead.
function_
function_(name
, returnType
): Function_
Creates a function.
Parameters
Name | Type | Description |
---|---|---|
name | string | Name of the function, in its original format from the implementation language. |
returnType | TypeDef | Return type of the function. |
Returns
generatedCode
generatedCode(code
): GeneratedCode
Create a code generation result, given a directory containing the generated code.
Parameters
Name | Type |
---|---|
code | Directory |
Returns
git
git(url
, opts?
): GitRepository
Queries a Git repository.
Parameters
Name | Type | Description |
---|---|---|
url | string | URL of the git repository. Can be formatted as https://{host}/{owner}/{repo} , git@{host}:{owner}/{repo} . Suffix ".git" is optional. |
opts? | ClientGitOpts | - |
Returns
host
host(): Host
Queries the host environment.
Returns
http
http(url
, opts?
): File
Returns a file containing an http remote url content.
Parameters
Name | Type | Description |
---|---|---|
url | string | HTTP url to get the content from (e.g., "https://docs.dagger.io"). |
opts? | ClientHttpOpts | - |
Returns
loadCacheVolumeFromID
loadCacheVolumeFromID(id
): CacheVolume
Load a CacheVolume from its ID.
Parameters
Name | Type |
---|---|
id | CacheVolumeID |
Returns
loadContainerFromID
loadContainerFromID(id
): Container
Load a Container from its ID.
Parameters
Name | Type |
---|---|
id | ContainerID |
Returns
loadCurrentModuleFromID
loadCurrentModuleFromID(id
): CurrentModule
Load a CurrentModule from its ID.
Parameters
Name | Type |
---|---|
id | CurrentModuleID |
Returns
loadDirectoryFromID
loadDirectoryFromID(id
): Directory
Load a Directory from its ID.
Parameters
Name | Type |
---|---|
id | DirectoryID |
Returns
loadEnvVariableFromID
loadEnvVariableFromID(id
): EnvVariable
Load a EnvVariable from its ID.
Parameters
Name | Type |
---|---|
id | EnvVariableID |
Returns
loadFieldTypeDefFromID
loadFieldTypeDefFromID(id
): FieldTypeDef
Load a FieldTypeDef from its ID.
Parameters
Name | Type |
---|---|
id | FieldTypeDefID |
Returns
loadFileFromID
loadFileFromID(id
): File
Load a File from its ID.
Parameters
Name | Type |
---|---|
id | FileID |
Returns
loadFunctionArgFromID
loadFunctionArgFromID(id
): FunctionArg
Load a FunctionArg from its ID.
Parameters
Name | Type |
---|---|
id | FunctionArgID |
Returns
loadFunctionCallArgValueFromID
loadFunctionCallArgValueFromID(id
): FunctionCallArgValue
Load a FunctionCallArgValue from its ID.
Parameters
Name | Type |
---|---|
id | FunctionCallArgValueID |
Returns
loadFunctionCallFromID
loadFunctionCallFromID(id
): FunctionCall
Load a FunctionCall from its ID.
Parameters
Name | Type |
---|---|
id | FunctionCallID |
Returns
loadFunctionFromID
loadFunctionFromID(id
): Function_
Load a Function from its ID.
Parameters
Name | Type |
---|---|
id | FunctionID |
Returns
loadGeneratedCodeFromID
loadGeneratedCodeFromID(id
): GeneratedCode
Load a GeneratedCode from its ID.
Parameters
Name | Type |
---|---|
id | GeneratedCodeID |
Returns
loadGitModuleSourceFromID
loadGitModuleSourceFromID(id
): GitModuleSource
Load a GitModuleSource from its ID.
Parameters
Name | Type |
---|---|
id | GitModuleSourceID |
Returns
loadGitRefFromID
loadGitRefFromID(id
): GitRef
Load a GitRef from its ID.
Parameters
Name | Type |
---|---|
id | GitRefID |
Returns
loadGitRepositoryFromID
loadGitRepositoryFromID(id
): GitRepository
Load a GitRepository from its ID.
Parameters
Name | Type |
---|---|
id | GitRepositoryID |
Returns
loadHostFromID
loadHostFromID(id
): Host
Load a Host from its ID.
Parameters
Name | Type |
---|---|
id | HostID |
Returns
loadInputTypeDefFromID
loadInputTypeDefFromID(id
): InputTypeDef
Load a InputTypeDef from its ID.
Parameters
Name | Type |
---|---|
id | InputTypeDefID |
Returns
loadInterfaceTypeDefFromID
loadInterfaceTypeDefFromID(id
): InterfaceTypeDef
Load a InterfaceTypeDef from its ID.
Parameters
Name | Type |
---|---|
id | InterfaceTypeDefID |
Returns
loadLabelFromID
loadLabelFromID(id
): Label
Load a Label from its ID.
Parameters
Name | Type |
---|---|
id | LabelID |
Returns
loadListTypeDefFromID
loadListTypeDefFromID(id
): ListTypeDef
Load a ListTypeDef from its ID.
Parameters
Name | Type |
---|---|
id | ListTypeDefID |
Returns
loadLocalModuleSourceFromID
loadLocalModuleSourceFromID(id
): LocalModuleSource
Load a LocalModuleSource from its ID.
Parameters
Name | Type |
---|---|
id | LocalModuleSourceID |
Returns
loadModuleDependencyFromID
loadModuleDependencyFromID(id
): ModuleDependency
Load a ModuleDependency from its ID.
Parameters
Name | Type |
---|---|
id | ModuleDependencyID |
Returns
loadModuleFromID
loadModuleFromID(id
): Module_
Load a Module from its ID.
Parameters
Name | Type |
---|---|
id | ModuleID |
Returns
loadModuleSourceFromID
loadModuleSourceFromID(id
): ModuleSource
Load a ModuleSource from its ID.
Parameters
Name | Type |
---|---|
id | ModuleSourceID |
Returns
loadObjectTypeDefFromID
loadObjectTypeDefFromID(id
): ObjectTypeDef
Load a ObjectTypeDef from its ID.
Parameters
Name | Type |
---|---|
id | ObjectTypeDefID |
Returns
loadPortFromID
loadPortFromID(id
): Port
Load a Port from its ID.
Parameters
Name | Type |
---|---|
id | PortID |
Returns
loadSecretFromID
loadSecretFromID(id
): Secret
Load a Secret from its ID.
Parameters
Name | Type |
---|---|
id | SecretID |
Returns
loadServiceFromID
loadServiceFromID(id
): Service
Load a Service from its ID.
Parameters
Name | Type |
---|---|
id | ServiceID |
Returns
loadSocketFromID
loadSocketFromID(id
): Socket
Load a Socket from its ID.
Parameters
Name | Type |
---|---|
id | SocketID |
Returns
loadTerminalFromID
loadTerminalFromID(id
): Terminal
Load a Terminal from its ID.
Parameters
Name | Type |
---|---|
id | TerminalID |
Returns
loadTypeDefFromID
loadTypeDefFromID(id
): TypeDef
Load a TypeDef from its ID.
Parameters
Name | Type |
---|---|
id | TypeDefID |
Returns
moduleDependency
moduleDependency(source
, opts?
): ModuleDependency
Create a new module dependency configuration from a module source and name
Parameters
Name | Type | Description |
---|---|---|
source | ModuleSource | The source of the dependency |
opts? | ClientModuleDependencyOpts | - |
Returns
moduleSource
moduleSource(refString
, opts?
): ModuleSource
Create a new module source instance from a source ref string.
Parameters
Name | Type | Description |
---|---|---|
refString | string | The string ref representation of the module source |
opts? | ClientModuleSourceOpts | - |
Returns
module_
module_(): Module_
Create a new module.
Returns
pipeline
pipeline(name
, opts?
): Client
Creates a named sub-pipeline.
Parameters
Name | Type | Description |
---|---|---|
name | string | Name of the sub-pipeline. |
opts? | ClientPipelineOpts | - |
Returns
secret
secret(name
): Secret
Reference a secret by name.
Parameters
Name | Type |
---|---|
name | string |
Returns
setSecret
setSecret(name
, plaintext
): Secret
Sets a secret given a user defined name to its plaintext and returns the secret.
The plaintext value is limited to a size of 128000 bytes.
Parameters
Name | Type | Description |
---|---|---|
name | string | The user defined name for this secret |
plaintext | string | The plaintext of the secret |
Returns
socket
socket(id
): Socket
Loads a socket by its ID.
Parameters
Name | Type |
---|---|
id | SocketID |
Returns
Deprecated
Use loadSocketFromID instead.
typeDef
typeDef(): TypeDef
Create a new TypeDef.
Returns
with
with(arg
): Client
Call the provided function with current Client.
This is useful for reusability and readability by not breaking the calling chain.
Parameters
Name | Type |
---|---|
arg | (param : Client ) => Client |