Skip to main content

Dagger NodeJS SDK

api/client.gen.Module_

A Dagger module.

Hierarchy​

  • BaseClient

    ↳ Module_

Constructors​

constructor​

new Module_(parent?, _id?, _description?, _name?, _sdk?, _serve?): Module_

Constructor is used for internal usage only, do not create object from it.

Parameters​

NameType
parent?Object
parent.ctxContext
parent.queryTree?QueryTree[]
_id?ModuleID
_description?string
_name?string
_sdk?string
_serve?Void

Returns​

Module_

Overrides​

BaseClient.constructor

Properties​

_description​

Private Optional Readonly _description: string = undefined


_id​

Private Optional Readonly _id: ModuleID = undefined


_name​

Private Optional Readonly _name: string = undefined


_sdk​

Private Optional Readonly _sdk: string = undefined


_serve​

Private Optional Readonly _serve: Void = undefined

Methods​

dependencies​

dependencies(): Promise<Module_[]>

Modules used by this module.

Returns​

Promise<Module_[]>


dependencyConfig​

dependencyConfig(): Promise<ModuleDependency[]>

The dependencies as configured by the module.

Returns​

Promise<ModuleDependency[]>


description​

description(): Promise<string>

The doc string of the module, if any

Returns​

Promise<string>


generatedContextDiff​

generatedContextDiff(): Directory

The generated files and directories made on top of the module source's context directory.

Returns​

Directory


generatedContextDirectory​

generatedContextDirectory(): Directory

The module source's context plus any configuration and source files created by codegen.

Returns​

Directory


id​

id(): Promise<ModuleID>

A unique identifier for this Module.

Returns​

Promise<ModuleID>


initialize​

initialize(): Module_

Retrieves the module with the objects loaded via its SDK.

Returns​

Module_


interfaces​

interfaces(): Promise<TypeDef[]>

Interfaces served by this module.

Returns​

Promise<TypeDef[]>


name​

name(): Promise<string>

The name of the module

Returns​

Promise<string>


objects​

objects(): Promise<TypeDef[]>

Objects served by this module.

Returns​

Promise<TypeDef[]>


runtime​

runtime(): Container

The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.

Returns​

Container


sdk​

sdk(): Promise<string>

The SDK used by this module. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.

Returns​

Promise<string>


serve​

serve(): Promise<Void>

Serve a module's API in the current session.

Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.

Returns​

Promise<Void>


source​

source(): ModuleSource

The source for the module.

Returns​

ModuleSource


with​

with(arg): Module_

Call the provided function with current Module.

This is useful for reusability and readability by not breaking the calling chain.

Parameters​

NameType
arg(param: Module_) => Module_

Returns​

Module_


withDescription​

withDescription(description): Module_

Retrieves the module with the given description

Parameters​

NameTypeDescription
descriptionstringThe description to set

Returns​

Module_


withInterface​

withInterface(iface): Module_

This module plus the given Interface type and associated functions

Parameters​

NameType
ifaceTypeDef

Returns​

Module_


withObject​

withObject(object): Module_

This module plus the given Object type and associated functions.

Parameters​

NameType
objectTypeDef

Returns​

Module_


withSource​

withSource(source): Module_

Retrieves the module with basic configuration loaded if present.

Parameters​

NameTypeDescription
sourceModuleSourceThe module source to initialize from.

Returns​

Module_