@dagger.io/dagger 0.9.8 → 0.9.9

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.
Files changed (31) hide show
  1. package/dist/api/client.gen.d.ts +309 -49
  2. package/dist/api/client.gen.d.ts.map +1 -1
  3. package/dist/api/client.gen.js +496 -100
  4. package/dist/entrypoint/entrypoint.js +2 -1
  5. package/dist/entrypoint/invoke.d.ts.map +1 -1
  6. package/dist/entrypoint/invoke.js +25 -5
  7. package/dist/entrypoint/load.d.ts +43 -1
  8. package/dist/entrypoint/load.d.ts.map +1 -1
  9. package/dist/entrypoint/load.js +109 -2
  10. package/dist/entrypoint/register.d.ts.map +1 -1
  11. package/dist/entrypoint/register.js +7 -3
  12. package/dist/introspector/decorators/decorators.d.ts +3 -3
  13. package/dist/introspector/decorators/decorators.d.ts.map +1 -1
  14. package/dist/introspector/registry/registry.d.ts +5 -3
  15. package/dist/introspector/registry/registry.d.ts.map +1 -1
  16. package/dist/introspector/registry/registry.js +20 -28
  17. package/dist/introspector/scanner/metadata.d.ts +1 -0
  18. package/dist/introspector/scanner/metadata.d.ts.map +1 -1
  19. package/dist/introspector/scanner/scan.d.ts +5 -1
  20. package/dist/introspector/scanner/scan.d.ts.map +1 -1
  21. package/dist/introspector/scanner/scan.js +38 -5
  22. package/dist/introspector/scanner/serialize.d.ts.map +1 -1
  23. package/dist/introspector/scanner/serialize.js +8 -2
  24. package/dist/introspector/scanner/typeDefs.d.ts +3 -0
  25. package/dist/introspector/scanner/typeDefs.d.ts.map +1 -1
  26. package/dist/introspector/scanner/utils.d.ts +18 -2
  27. package/dist/introspector/scanner/utils.d.ts.map +1 -1
  28. package/dist/introspector/scanner/utils.js +85 -12
  29. package/dist/provisioning/default.d.ts +1 -1
  30. package/dist/provisioning/default.js +1 -1
  31. package/package.json +1 -1
@@ -165,11 +165,11 @@ export type ContainerPublishOpts = {
165
165
  */
166
166
  mediaTypes?: ImageMediaTypes;
167
167
  };
168
- export type ContainerShellOpts = {
168
+ export type ContainerTerminalOpts = {
169
169
  /**
170
- * If set, override the container's default shell and invoke these arguments instead.
170
+ * If set, override the container's default terminal command and invoke these command arguments instead.
171
171
  */
172
- args?: string[];
172
+ cmd?: string[];
173
173
  };
174
174
  export type ContainerWithDirectoryOpts = {
175
175
  /**
@@ -377,13 +377,13 @@ export type CurrentModuleID = string & {
377
377
  };
378
378
  export type DirectoryAsModuleOpts = {
379
379
  /**
380
- * An optional subpath of the directory which contains the module's source code.
380
+ * An optional subpath of the directory which contains the module's configuration file.
381
381
  *
382
382
  * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
383
383
  *
384
384
  * If not set, the module source code is loaded from the root of the directory.
385
385
  */
386
- sourceSubpath?: string;
386
+ sourceRootPath?: string;
387
387
  };
388
388
  export type DirectoryDockerBuildOpts = {
389
389
  /**
@@ -774,10 +774,6 @@ export type ClientModuleDependencyOpts = {
774
774
  name?: string;
775
775
  };
776
776
  export type ClientModuleSourceOpts = {
777
- /**
778
- * An explicitly set root directory for the module source. This is required to load local sources as modules; other source types implicitly encode the root directory and do not require this.
779
- */
780
- rootDirectory?: Directory;
781
777
  /**
782
778
  * If true, enforce that the source is a stable version for source kinds that support versioning.
783
779
  */
@@ -816,8 +812,16 @@ export type ServiceStopOpts = {
816
812
  kill?: boolean;
817
813
  };
818
814
  export type ServiceUpOpts = {
815
+ /**
816
+ * List of frontend/backend port mappings to forward.
817
+ *
818
+ * Frontend is the port accepting traffic on the host, backend is the service port.
819
+ */
819
820
  ports?: PortForward[];
820
- native?: boolean;
821
+ /**
822
+ * Bind each tunnel port to a random port on the host.
823
+ */
824
+ random?: boolean;
821
825
  };
822
826
  /**
823
827
  * The `ServiceID` scalar type represents an identifier for an object of type Service.
@@ -1129,11 +1133,6 @@ export declare class Container extends BaseClient {
1129
1133
  * Retrieves this container's root filesystem. Mounts are not included.
1130
1134
  */
1131
1135
  rootfs: () => Directory;
1132
- /**
1133
- * Return an interactive terminal for this container using its configured shell if not overridden by args (or sh as a fallback default).
1134
- * @param opts.args If set, override the container's default shell and invoke these arguments instead.
1135
- */
1136
- shell: (opts?: ContainerShellOpts) => Terminal;
1137
1136
  /**
1138
1137
  * The error stream of the last executed command.
1139
1138
  *
@@ -1152,6 +1151,11 @@ export declare class Container extends BaseClient {
1152
1151
  * It doesn't run the default command if no exec has been set.
1153
1152
  */
1154
1153
  sync: () => Promise<Container>;
1154
+ /**
1155
+ * Return an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
1156
+ * @param opts.cmd If set, override the container's default terminal command and invoke these command arguments instead.
1157
+ */
1158
+ terminal: (opts?: ContainerTerminalOpts) => Terminal;
1155
1159
  /**
1156
1160
  * Retrieves the user to be set for all commands.
1157
1161
  */
@@ -1162,10 +1166,10 @@ export declare class Container extends BaseClient {
1162
1166
  */
1163
1167
  withDefaultArgs: (args: string[]) => Container;
1164
1168
  /**
1165
- * Set the default command to invoke for the "shell" API.
1166
- * @param args The args of the command to set the default shell to.
1169
+ * Set the default command to invoke for the container's terminal API.
1170
+ * @param args The args of the command.
1167
1171
  */
1168
- withDefaultShell: (args: string[]) => Container;
1172
+ withDefaultTerminalCmd: (args: string[]) => Container;
1169
1173
  /**
1170
1174
  * Retrieves this container plus a directory written at the given path.
1171
1175
  * @param path Location of the written directory (e.g., "/tmp/directory").
@@ -1493,7 +1497,7 @@ export declare class Directory extends BaseClient {
1493
1497
  id: () => Promise<DirectoryID>;
1494
1498
  /**
1495
1499
  * Load the directory as a Dagger module
1496
- * @param opts.sourceSubpath An optional subpath of the directory which contains the module's source code.
1500
+ * @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file.
1497
1501
  *
1498
1502
  * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
1499
1503
  *
@@ -1622,7 +1626,13 @@ export declare class EnvVariable extends BaseClient {
1622
1626
  * A unique identifier for this EnvVariable.
1623
1627
  */
1624
1628
  id: () => Promise<EnvVariableID>;
1629
+ /**
1630
+ * The environment variable name.
1631
+ */
1625
1632
  name: () => Promise<string>;
1633
+ /**
1634
+ * The environment variable value.
1635
+ */
1626
1636
  value: () => Promise<string>;
1627
1637
  }
1628
1638
  /**
@@ -1645,8 +1655,17 @@ export declare class FieldTypeDef extends BaseClient {
1645
1655
  * A unique identifier for this FieldTypeDef.
1646
1656
  */
1647
1657
  id: () => Promise<FieldTypeDefID>;
1658
+ /**
1659
+ * A doc string for the field, if any.
1660
+ */
1648
1661
  description: () => Promise<string>;
1662
+ /**
1663
+ * The name of the field in lowerCamelCase format.
1664
+ */
1649
1665
  name: () => Promise<string>;
1666
+ /**
1667
+ * The type of the field.
1668
+ */
1650
1669
  typeDef: () => TypeDef;
1651
1670
  }
1652
1671
  /**
@@ -1726,9 +1745,21 @@ export declare class Function_ extends BaseClient {
1726
1745
  * A unique identifier for this Function.
1727
1746
  */
1728
1747
  id: () => Promise<FunctionID>;
1748
+ /**
1749
+ * Arguments accepted by the function, if any.
1750
+ */
1729
1751
  args: () => Promise<FunctionArg[]>;
1752
+ /**
1753
+ * A doc string for the function, if any.
1754
+ */
1730
1755
  description: () => Promise<string>;
1756
+ /**
1757
+ * The name of the function.
1758
+ */
1731
1759
  name: () => Promise<string>;
1760
+ /**
1761
+ * The type returned by the function.
1762
+ */
1732
1763
  returnType: () => TypeDef;
1733
1764
  /**
1734
1765
  * Returns the function with the provided argument
@@ -1771,9 +1802,21 @@ export declare class FunctionArg extends BaseClient {
1771
1802
  * A unique identifier for this FunctionArg.
1772
1803
  */
1773
1804
  id: () => Promise<FunctionArgID>;
1805
+ /**
1806
+ * A default value to use for this argument when not explicitly set by the caller, if any.
1807
+ */
1774
1808
  defaultValue: () => Promise<JSON>;
1809
+ /**
1810
+ * A doc string for the argument, if any.
1811
+ */
1775
1812
  description: () => Promise<string>;
1813
+ /**
1814
+ * The name of the argument in lowerCamelCase format.
1815
+ */
1776
1816
  name: () => Promise<string>;
1817
+ /**
1818
+ * The type of the argument.
1819
+ */
1777
1820
  typeDef: () => TypeDef;
1778
1821
  }
1779
1822
  /**
@@ -1796,9 +1839,21 @@ export declare class FunctionCall extends BaseClient {
1796
1839
  * A unique identifier for this FunctionCall.
1797
1840
  */
1798
1841
  id: () => Promise<FunctionCallID>;
1842
+ /**
1843
+ * The argument values the function is being invoked with.
1844
+ */
1799
1845
  inputArgs: () => Promise<FunctionCallArgValue[]>;
1846
+ /**
1847
+ * The name of the function being called.
1848
+ */
1800
1849
  name: () => Promise<string>;
1850
+ /**
1851
+ * The value of the parent object of the function being called. If the function is top-level to the module, this is always an empty object.
1852
+ */
1801
1853
  parent: () => Promise<JSON>;
1854
+ /**
1855
+ * The name of the parent object of the function being called. If the function is top-level to the module, this is the name of the module.
1856
+ */
1802
1857
  parentName: () => Promise<string>;
1803
1858
  /**
1804
1859
  * Set the return value of the function call to the provided value.
@@ -1824,7 +1879,13 @@ export declare class FunctionCallArgValue extends BaseClient {
1824
1879
  * A unique identifier for this FunctionCallArgValue.
1825
1880
  */
1826
1881
  id: () => Promise<FunctionCallArgValueID>;
1882
+ /**
1883
+ * The name of the argument.
1884
+ */
1827
1885
  name: () => Promise<string>;
1886
+ /**
1887
+ * The value of the argument represented as a JSON serialized string.
1888
+ */
1828
1889
  value: () => Promise<JSON>;
1829
1890
  }
1830
1891
  /**
@@ -1843,8 +1904,17 @@ export declare class GeneratedCode extends BaseClient {
1843
1904
  * A unique identifier for this GeneratedCode.
1844
1905
  */
1845
1906
  id: () => Promise<GeneratedCodeID>;
1907
+ /**
1908
+ * The directory containing the generated code.
1909
+ */
1846
1910
  code: () => Directory;
1911
+ /**
1912
+ * List of paths to mark generated in version control (i.e. .gitattributes).
1913
+ */
1847
1914
  vcsGeneratedPaths: () => Promise<string[]>;
1915
+ /**
1916
+ * List of paths to ignore in version control (i.e. .gitignore).
1917
+ */
1848
1918
  vcsIgnoredPaths: () => Promise<string[]>;
1849
1919
  /**
1850
1920
  * Set the list of paths to mark generated in version control.
@@ -1869,7 +1939,7 @@ export declare class GitModuleSource extends BaseClient {
1869
1939
  private readonly _cloneURL?;
1870
1940
  private readonly _commit?;
1871
1941
  private readonly _htmlURL?;
1872
- private readonly _sourceSubpath?;
1942
+ private readonly _rootSubpath?;
1873
1943
  private readonly _version?;
1874
1944
  /**
1875
1945
  * Constructor is used for internal usage only, do not create object from it.
@@ -1877,7 +1947,7 @@ export declare class GitModuleSource extends BaseClient {
1877
1947
  constructor(parent?: {
1878
1948
  queryTree?: QueryTree[];
1879
1949
  ctx: Context;
1880
- }, _id?: GitModuleSourceID, _cloneURL?: string, _commit?: string, _htmlURL?: string, _sourceSubpath?: string, _version?: string);
1950
+ }, _id?: GitModuleSourceID, _cloneURL?: string, _commit?: string, _htmlURL?: string, _rootSubpath?: string, _version?: string);
1881
1951
  /**
1882
1952
  * A unique identifier for this GitModuleSource.
1883
1953
  */
@@ -1886,12 +1956,25 @@ export declare class GitModuleSource extends BaseClient {
1886
1956
  * The URL from which the source's git repo can be cloned.
1887
1957
  */
1888
1958
  cloneURL: () => Promise<string>;
1959
+ /**
1960
+ * The resolved commit of the git repo this source points to.
1961
+ */
1889
1962
  commit: () => Promise<string>;
1963
+ /**
1964
+ * The directory containing everything needed to load load and use the module.
1965
+ */
1966
+ contextDirectory: () => Directory;
1890
1967
  /**
1891
1968
  * The URL to the source's git repo in a web browser
1892
1969
  */
1893
1970
  htmlURL: () => Promise<string>;
1894
- sourceSubpath: () => Promise<string>;
1971
+ /**
1972
+ * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory).
1973
+ */
1974
+ rootSubpath: () => Promise<string>;
1975
+ /**
1976
+ * The specified version of the git repo this source points to.
1977
+ */
1895
1978
  version: () => Promise<string>;
1896
1979
  }
1897
1980
  /**
@@ -1948,6 +2031,11 @@ export declare class GitRepository extends BaseClient {
1948
2031
  * @param id Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
1949
2032
  */
1950
2033
  commit: (id: string) => GitRef;
2034
+ /**
2035
+ * Returns details of a ref.
2036
+ * @param name Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
2037
+ */
2038
+ ref: (name: string) => GitRef;
1951
2039
  /**
1952
2040
  * Returns details of a tag.
1953
2041
  * @param name Tag's name (e.g., "v0.3.9").
@@ -2041,7 +2129,13 @@ export declare class InputTypeDef extends BaseClient {
2041
2129
  * A unique identifier for this InputTypeDef.
2042
2130
  */
2043
2131
  id: () => Promise<InputTypeDefID>;
2132
+ /**
2133
+ * Static fields defined on this input object, if any.
2134
+ */
2044
2135
  fields: () => Promise<FieldTypeDef[]>;
2136
+ /**
2137
+ * The name of the input object.
2138
+ */
2045
2139
  name: () => Promise<string>;
2046
2140
  }
2047
2141
  /**
@@ -2063,9 +2157,21 @@ export declare class InterfaceTypeDef extends BaseClient {
2063
2157
  * A unique identifier for this InterfaceTypeDef.
2064
2158
  */
2065
2159
  id: () => Promise<InterfaceTypeDefID>;
2160
+ /**
2161
+ * The doc string for the interface, if any.
2162
+ */
2066
2163
  description: () => Promise<string>;
2164
+ /**
2165
+ * Functions defined on this interface, if any.
2166
+ */
2067
2167
  functions: () => Promise<Function_[]>;
2168
+ /**
2169
+ * The name of the interface.
2170
+ */
2068
2171
  name: () => Promise<string>;
2172
+ /**
2173
+ * If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
2174
+ */
2069
2175
  sourceModuleName: () => Promise<string>;
2070
2176
  }
2071
2177
  /**
@@ -2086,7 +2192,13 @@ export declare class Label extends BaseClient {
2086
2192
  * A unique identifier for this Label.
2087
2193
  */
2088
2194
  id: () => Promise<LabelID>;
2195
+ /**
2196
+ * The label name.
2197
+ */
2089
2198
  name: () => Promise<string>;
2199
+ /**
2200
+ * The label value.
2201
+ */
2090
2202
  value: () => Promise<string>;
2091
2203
  }
2092
2204
  /**
@@ -2105,6 +2217,9 @@ export declare class ListTypeDef extends BaseClient {
2105
2217
  * A unique identifier for this ListTypeDef.
2106
2218
  */
2107
2219
  id: () => Promise<ListTypeDefID>;
2220
+ /**
2221
+ * The type of the elements in the list.
2222
+ */
2108
2223
  elementTypeDef: () => TypeDef;
2109
2224
  }
2110
2225
  /**
@@ -2112,19 +2227,26 @@ export declare class ListTypeDef extends BaseClient {
2112
2227
  */
2113
2228
  export declare class LocalModuleSource extends BaseClient {
2114
2229
  private readonly _id?;
2115
- private readonly _sourceSubpath?;
2230
+ private readonly _rootSubpath?;
2116
2231
  /**
2117
2232
  * Constructor is used for internal usage only, do not create object from it.
2118
2233
  */
2119
2234
  constructor(parent?: {
2120
2235
  queryTree?: QueryTree[];
2121
2236
  ctx: Context;
2122
- }, _id?: LocalModuleSourceID, _sourceSubpath?: string);
2237
+ }, _id?: LocalModuleSourceID, _rootSubpath?: string);
2123
2238
  /**
2124
2239
  * A unique identifier for this LocalModuleSource.
2125
2240
  */
2126
2241
  id: () => Promise<LocalModuleSourceID>;
2127
- sourceSubpath: () => Promise<string>;
2242
+ /**
2243
+ * The directory containing everything needed to load load and use the module.
2244
+ */
2245
+ contextDirectory: () => Directory;
2246
+ /**
2247
+ * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory).
2248
+ */
2249
+ rootSubpath: () => Promise<string>;
2128
2250
  }
2129
2251
  /**
2130
2252
  * A Dagger module.
@@ -2146,21 +2268,49 @@ export declare class Module_ extends BaseClient {
2146
2268
  * A unique identifier for this Module.
2147
2269
  */
2148
2270
  id: () => Promise<ModuleID>;
2271
+ /**
2272
+ * Modules used by this module.
2273
+ */
2149
2274
  dependencies: () => Promise<Module_[]>;
2275
+ /**
2276
+ * The dependencies as configured by the module.
2277
+ */
2150
2278
  dependencyConfig: () => Promise<ModuleDependency[]>;
2279
+ /**
2280
+ * The doc string of the module, if any
2281
+ */
2151
2282
  description: () => Promise<string>;
2152
2283
  /**
2153
- * The module's root directory containing the config file for it and its source (possibly as a subdir). It includes any generated code or updated config files created after initial load, but not any files/directories that were unchanged after sdk codegen was run.
2284
+ * The generated files and directories made on top of the module source's context directory.
2285
+ */
2286
+ generatedContextDiff: () => Directory;
2287
+ /**
2288
+ * The module source's context plus any configuration and source files created by codegen.
2154
2289
  */
2155
- generatedSourceRootDirectory: () => Directory;
2290
+ generatedContextDirectory: () => Directory;
2156
2291
  /**
2157
2292
  * Retrieves the module with the objects loaded via its SDK.
2158
2293
  */
2159
2294
  initialize: () => Module_;
2295
+ /**
2296
+ * Interfaces served by this module.
2297
+ */
2160
2298
  interfaces: () => Promise<TypeDef[]>;
2299
+ /**
2300
+ * The name of the module
2301
+ */
2161
2302
  name: () => Promise<string>;
2303
+ /**
2304
+ * Objects served by this module.
2305
+ */
2162
2306
  objects: () => Promise<TypeDef[]>;
2307
+ /**
2308
+ * The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
2309
+ */
2163
2310
  runtime: () => Container;
2311
+ /**
2312
+ * 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.
2313
+ */
2164
2314
  sdk: () => Promise<string>;
2165
2315
  /**
2166
2316
  * Serve a module's API in the current session.
@@ -2168,12 +2318,10 @@ export declare class Module_ extends BaseClient {
2168
2318
  * Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
2169
2319
  */
2170
2320
  serve: () => Promise<Void>;
2171
- source: () => ModuleSource;
2172
2321
  /**
2173
- * Update the module configuration to use the given dependencies.
2174
- * @param dependencies The dependency modules to install.
2322
+ * The source for the module.
2175
2323
  */
2176
- withDependencies: (dependencies: ModuleDependency[]) => Module_;
2324
+ source: () => ModuleSource;
2177
2325
  /**
2178
2326
  * Retrieves the module with the given description
2179
2327
  * @param description The description to set
@@ -2183,20 +2331,10 @@ export declare class Module_ extends BaseClient {
2183
2331
  * This module plus the given Interface type and associated functions
2184
2332
  */
2185
2333
  withInterface: (iface: TypeDef) => Module_;
2186
- /**
2187
- * Update the module configuration to use the given name.
2188
- * @param name The name to use.
2189
- */
2190
- withName: (name: string) => Module_;
2191
2334
  /**
2192
2335
  * This module plus the given Object type and associated functions.
2193
2336
  */
2194
2337
  withObject: (object: TypeDef) => Module_;
2195
- /**
2196
- * Update the module configuration to use the given SDK.
2197
- * @param sdk The SDK to use.
2198
- */
2199
- withSDK: (sdk: string) => Module_;
2200
2338
  /**
2201
2339
  * Retrieves the module with basic configuration loaded if present.
2202
2340
  * @param source The module source to initialize from.
@@ -2226,7 +2364,13 @@ export declare class ModuleDependency extends BaseClient {
2226
2364
  * A unique identifier for this ModuleDependency.
2227
2365
  */
2228
2366
  id: () => Promise<ModuleDependencyID>;
2367
+ /**
2368
+ * The name of the dependency module.
2369
+ */
2229
2370
  name: () => Promise<string>;
2371
+ /**
2372
+ * The source for the dependency module.
2373
+ */
2230
2374
  source: () => ModuleSource;
2231
2375
  }
2232
2376
  /**
@@ -2235,21 +2379,31 @@ export declare class ModuleDependency extends BaseClient {
2235
2379
  export declare class ModuleSource extends BaseClient {
2236
2380
  private readonly _id?;
2237
2381
  private readonly _asString?;
2382
+ private readonly _configExists?;
2238
2383
  private readonly _kind?;
2239
2384
  private readonly _moduleName?;
2240
- private readonly _subpath?;
2385
+ private readonly _moduleOriginalName?;
2386
+ private readonly _resolveContextPathFromCaller?;
2387
+ private readonly _sourceRootSubpath?;
2388
+ private readonly _sourceSubpath?;
2241
2389
  /**
2242
2390
  * Constructor is used for internal usage only, do not create object from it.
2243
2391
  */
2244
2392
  constructor(parent?: {
2245
2393
  queryTree?: QueryTree[];
2246
2394
  ctx: Context;
2247
- }, _id?: ModuleSourceID, _asString?: string, _kind?: ModuleSourceKind, _moduleName?: string, _subpath?: string);
2395
+ }, _id?: ModuleSourceID, _asString?: string, _configExists?: boolean, _kind?: ModuleSourceKind, _moduleName?: string, _moduleOriginalName?: string, _resolveContextPathFromCaller?: string, _sourceRootSubpath?: string, _sourceSubpath?: string);
2248
2396
  /**
2249
2397
  * A unique identifier for this ModuleSource.
2250
2398
  */
2251
2399
  id: () => Promise<ModuleSourceID>;
2400
+ /**
2401
+ * If the source is a of kind git, the git source representation of it.
2402
+ */
2252
2403
  asGitSource: () => GitModuleSource;
2404
+ /**
2405
+ * If the source is of kind local, the local source representation of it.
2406
+ */
2253
2407
  asLocalSource: () => LocalModuleSource;
2254
2408
  /**
2255
2409
  * Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
@@ -2260,25 +2414,80 @@ export declare class ModuleSource extends BaseClient {
2260
2414
  */
2261
2415
  asString: () => Promise<string>;
2262
2416
  /**
2263
- * The directory containing the actual module's source code, as determined from the root directory and subpath.
2417
+ * Returns whether the module source has a configuration file.
2418
+ */
2419
+ configExists: () => Promise<boolean>;
2420
+ /**
2421
+ * The directory containing everything needed to load load and use the module.
2422
+ */
2423
+ contextDirectory: () => Directory;
2424
+ /**
2425
+ * The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.
2426
+ */
2427
+ dependencies: () => Promise<ModuleDependency[]>;
2428
+ /**
2429
+ * The directory containing the module configuration and source code (source code may be in a subdir).
2264
2430
  * @param path The path from the source directory to select.
2265
2431
  */
2266
2432
  directory: (path: string) => Directory;
2433
+ /**
2434
+ * The kind of source (e.g. local, git, etc.)
2435
+ */
2267
2436
  kind: () => Promise<ModuleSourceKind>;
2268
2437
  /**
2269
- * If set, the name of the module this source references
2438
+ * If set, the name of the module this source references, including any overrides at runtime by callers.
2270
2439
  */
2271
2440
  moduleName: () => Promise<string>;
2441
+ /**
2442
+ * The original name of the module this source references, as defined in the module configuration.
2443
+ */
2444
+ moduleOriginalName: () => Promise<string>;
2445
+ /**
2446
+ * The path to the module source's context directory on the caller's filesystem. Only valid for local sources.
2447
+ */
2448
+ resolveContextPathFromCaller: () => Promise<string>;
2272
2449
  /**
2273
2450
  * Resolve the provided module source arg as a dependency relative to this module source.
2274
2451
  * @param dep The dependency module source to resolve.
2275
2452
  */
2276
2453
  resolveDependency: (dep: ModuleSource) => ModuleSource;
2277
- rootDirectory: () => Directory;
2278
2454
  /**
2279
- * The path to the module subdirectory containing the actual module's source code.
2455
+ * Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.
2280
2456
  */
2281
- subpath: () => Promise<string>;
2457
+ resolveFromCaller: () => ModuleSource;
2458
+ /**
2459
+ * The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root.
2460
+ */
2461
+ sourceRootSubpath: () => Promise<string>;
2462
+ /**
2463
+ * The path relative to context of the module implementation source code.
2464
+ */
2465
+ sourceSubpath: () => Promise<string>;
2466
+ /**
2467
+ * Update the module source with a new context directory. Only valid for local sources.
2468
+ * @param dir The directory to set as the context directory.
2469
+ */
2470
+ withContextDirectory: (dir: Directory) => ModuleSource;
2471
+ /**
2472
+ * Append the provided dependencies to the module source's dependency list.
2473
+ * @param dependencies The dependencies to append.
2474
+ */
2475
+ withDependencies: (dependencies: ModuleDependency[]) => ModuleSource;
2476
+ /**
2477
+ * Update the module source with a new name.
2478
+ * @param name The name to set.
2479
+ */
2480
+ withName: (name: string) => ModuleSource;
2481
+ /**
2482
+ * Update the module source with a new SDK.
2483
+ * @param sdk The SDK to set.
2484
+ */
2485
+ withSDK: (sdk: string) => ModuleSource;
2486
+ /**
2487
+ * Update the module source with a new source subpath.
2488
+ * @param path The path to set as the source subpath.
2489
+ */
2490
+ withSourceSubpath: (path: string) => ModuleSource;
2282
2491
  /**
2283
2492
  * Call the provided function with current ModuleSource.
2284
2493
  *
@@ -2305,11 +2514,29 @@ export declare class ObjectTypeDef extends BaseClient {
2305
2514
  * A unique identifier for this ObjectTypeDef.
2306
2515
  */
2307
2516
  id: () => Promise<ObjectTypeDefID>;
2517
+ /**
2518
+ * The function used to construct new instances of this object, if any
2519
+ */
2308
2520
  constructor_: () => Function_;
2521
+ /**
2522
+ * The doc string for the object, if any.
2523
+ */
2309
2524
  description: () => Promise<string>;
2525
+ /**
2526
+ * Static fields defined on this object, if any.
2527
+ */
2310
2528
  fields: () => Promise<FieldTypeDef[]>;
2529
+ /**
2530
+ * Functions defined on this object, if any.
2531
+ */
2311
2532
  functions: () => Promise<Function_[]>;
2533
+ /**
2534
+ * The name of the object.
2535
+ */
2312
2536
  name: () => Promise<string>;
2537
+ /**
2538
+ * If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
2539
+ */
2313
2540
  sourceModuleName: () => Promise<string>;
2314
2541
  }
2315
2542
  /**
@@ -2332,9 +2559,21 @@ export declare class Port extends BaseClient {
2332
2559
  * A unique identifier for this Port.
2333
2560
  */
2334
2561
  id: () => Promise<PortID>;
2562
+ /**
2563
+ * The port description.
2564
+ */
2335
2565
  description: () => Promise<string>;
2566
+ /**
2567
+ * Skip the health check when run as a service.
2568
+ */
2336
2569
  experimentalSkipHealthcheck: () => Promise<boolean>;
2570
+ /**
2571
+ * The port number.
2572
+ */
2337
2573
  port: () => Promise<number>;
2574
+ /**
2575
+ * The transport layer protocol.
2576
+ */
2338
2577
  protocol: () => Promise<NetworkProtocol>;
2339
2578
  }
2340
2579
  /**
@@ -2573,7 +2812,6 @@ export declare class Client extends BaseClient {
2573
2812
  /**
2574
2813
  * Create a new module source instance from a source ref string.
2575
2814
  * @param refString The string ref representation of the module source
2576
- * @param opts.rootDirectory An explicitly set root directory for the module source. This is required to load local sources as modules; other source types implicitly encode the root directory and do not require this.
2577
2815
  * @param opts.stable If true, enforce that the source is a stable version for source kinds that support versioning.
2578
2816
  */
2579
2817
  moduleSource: (refString: string, opts?: ClientModuleSourceOpts) => ModuleSource;
@@ -2686,6 +2924,10 @@ export declare class Service extends BaseClient {
2686
2924
  stop: (opts?: ServiceStopOpts) => Promise<Service>;
2687
2925
  /**
2688
2926
  * Creates a tunnel that forwards traffic from the caller's network to this service.
2927
+ * @param opts.ports List of frontend/backend port mappings to forward.
2928
+ *
2929
+ * Frontend is the port accepting traffic on the host, backend is the service port.
2930
+ * @param opts.random Bind each tunnel port to a random port on the host.
2689
2931
  */
2690
2932
  up: (opts?: ServiceUpOpts) => Promise<Void>;
2691
2933
  }
@@ -2746,11 +2988,29 @@ export declare class TypeDef extends BaseClient {
2746
2988
  * A unique identifier for this TypeDef.
2747
2989
  */
2748
2990
  id: () => Promise<TypeDefID>;
2991
+ /**
2992
+ * If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
2993
+ */
2749
2994
  asInput: () => InputTypeDef;
2995
+ /**
2996
+ * If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
2997
+ */
2750
2998
  asInterface: () => InterfaceTypeDef;
2999
+ /**
3000
+ * If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
3001
+ */
2751
3002
  asList: () => ListTypeDef;
3003
+ /**
3004
+ * If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
3005
+ */
2752
3006
  asObject: () => ObjectTypeDef;
3007
+ /**
3008
+ * The kind of type this is (e.g. primitive, list, object).
3009
+ */
2753
3010
  kind: () => Promise<TypeDefKind>;
3011
+ /**
3012
+ * Whether this type can be set to null. Defaults to false.
3013
+ */
2754
3014
  optional: () => Promise<boolean>;
2755
3015
  /**
2756
3016
  * Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.