@dagger.io/dagger 0.8.8 → 0.9.0

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.
@@ -50,12 +50,6 @@ export type BuildArg = {
50
50
  */
51
51
  value: string;
52
52
  };
53
- /**
54
- * A global cache volume identifier.
55
- */
56
- export type CacheID = string & {
57
- __CacheID: never;
58
- };
59
53
  /**
60
54
  * Sharing mode of the cache volume.
61
55
  */
@@ -74,6 +68,33 @@ export declare enum CacheSharingMode {
74
68
  */
75
69
  Shared = "SHARED"
76
70
  }
71
+ /**
72
+ * A global cache volume identifier.
73
+ */
74
+ export type CacheVolumeID = string & {
75
+ __CacheVolumeID: never;
76
+ };
77
+ export type ContainerAsTarballOpts = {
78
+ /**
79
+ * Identifiers for other platform specific containers.
80
+ * Used for multi-platform image.
81
+ */
82
+ platformVariants?: Container[];
83
+ /**
84
+ * Force each layer of the image to use the specified compression algorithm.
85
+ * If this is unset, then if a layer already has a compressed blob in the engine's
86
+ * cache, that will be used (this can result in a mix of compression algorithms for
87
+ * different layers). If this is unset and a layer has no compressed blob in the
88
+ * engine's cache, then it will be compressed using Gzip.
89
+ */
90
+ forcedCompression?: ImageLayerCompression;
91
+ /**
92
+ * Use the specified media types for the image's layers. Defaults to OCI, which
93
+ * is largely compatible with most recent container runtimes, but Docker may be needed
94
+ * for older runtimes without OCI support.
95
+ */
96
+ mediaTypes?: ImageMediaTypes;
97
+ };
77
98
  export type ContainerBuildOpts = {
78
99
  /**
79
100
  * Path to the Dockerfile to use.
@@ -100,16 +121,6 @@ export type ContainerBuildOpts = {
100
121
  */
101
122
  secrets?: Secret[];
102
123
  };
103
- export type ContainerEndpointOpts = {
104
- /**
105
- * The exposed port number for the endpoint
106
- */
107
- port?: number;
108
- /**
109
- * Return a URL with the given scheme, eg. http for http://
110
- */
111
- scheme?: string;
112
- };
113
124
  export type ContainerExportOpts = {
114
125
  /**
115
126
  * Identifiers for other platform specific containers.
@@ -379,13 +390,6 @@ export type DirectoryAsModuleOpts = {
379
390
  * directory.
380
391
  */
381
392
  sourceSubpath?: string;
382
- /**
383
- * A pre-built runtime container to use instead of building one from the
384
- * source code. This is useful for bootstrapping.
385
- *
386
- * You should ignore this unless you're building a Dagger SDK.
387
- */
388
- runtime?: Container;
389
393
  };
390
394
  export type DirectoryDockerBuildOpts = {
391
395
  /**
@@ -495,6 +499,12 @@ export type FunctionWithArgOpts = {
495
499
  */
496
500
  defaultValue?: JSON;
497
501
  };
502
+ /**
503
+ * A reference to a FunctionArg.
504
+ */
505
+ export type FunctionArgID = string & {
506
+ __FunctionArgID: never;
507
+ };
498
508
  export type FunctionCallInput = {
499
509
  /**
500
510
  * The name of the argument to the function
@@ -531,6 +541,34 @@ export type HostDirectoryOpts = {
531
541
  */
532
542
  include?: string[];
533
543
  };
544
+ export type HostServiceOpts = {
545
+ /**
546
+ * Upstream host to forward traffic to.
547
+ */
548
+ host?: string;
549
+ };
550
+ export type HostTunnelOpts = {
551
+ /**
552
+ * Map each service port to the same port on the host, as if the service were
553
+ * running natively.
554
+ *
555
+ * Note: enabling may result in port conflicts.
556
+ */
557
+ native?: boolean;
558
+ /**
559
+ * Configure explicit port forwarding rules for the tunnel.
560
+ *
561
+ * If a port's frontend is unspecified or 0, a random port will be chosen by
562
+ * the host.
563
+ *
564
+ * If no ports are given, all of the service's ports are forwarded. If native
565
+ * is true, each port maps to the same port on the host. If native is false,
566
+ * each port maps to a random port chosen by the host.
567
+ *
568
+ * If ports are given and native is true, the ports are additive.
569
+ */
570
+ ports?: PortForward[];
571
+ };
534
572
  /**
535
573
  * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
536
574
  */
@@ -559,13 +597,6 @@ export declare enum ImageMediaTypes {
559
597
  export type JSON = string & {
560
598
  __JSON: never;
561
599
  };
562
- export type ModuleServeOpts = {
563
- environment?: ModuleEnvironmentVariable[];
564
- };
565
- export type ModuleEnvironmentVariable = {
566
- name: string;
567
- value?: string;
568
- };
569
600
  /**
570
601
  * A reference to a Module.
571
602
  */
@@ -603,6 +634,20 @@ export type PipelineLabel = {
603
634
  export type Platform = string & {
604
635
  __Platform: never;
605
636
  };
637
+ export type PortForward = {
638
+ /**
639
+ * Destination port for traffic.
640
+ */
641
+ backend: number;
642
+ /**
643
+ * Port to expose to clients. If unspecified, a default will be chosen.
644
+ */
645
+ frontend?: number;
646
+ /**
647
+ * Protocol to use for traffic.
648
+ */
649
+ protocol?: NetworkProtocol;
650
+ };
606
651
  export type ClientContainerOpts = {
607
652
  id?: ContainerID;
608
653
  platform?: Platform;
@@ -610,9 +655,6 @@ export type ClientContainerOpts = {
610
655
  export type ClientDirectoryOpts = {
611
656
  id?: DirectoryID;
612
657
  };
613
- export type ClientGeneratedCodeOpts = {
614
- id?: GeneratedCodeID;
615
- };
616
658
  export type ClientGitOpts = {
617
659
  /**
618
660
  * Set to true to keep .git directory.
@@ -621,16 +663,16 @@ export type ClientGitOpts = {
621
663
  /**
622
664
  * A service which must be started before the repo is fetched.
623
665
  */
624
- experimentalServiceHost?: Container;
666
+ experimentalServiceHost?: Service;
625
667
  };
626
668
  export type ClientHttpOpts = {
627
669
  /**
628
670
  * A service which must be started before the URL is fetched.
629
671
  */
630
- experimentalServiceHost?: Container;
672
+ experimentalServiceHost?: Service;
631
673
  };
632
- export type ClientModuleOpts = {
633
- id?: ModuleID;
674
+ export type ClientModuleConfigOpts = {
675
+ subpath?: string;
634
676
  };
635
677
  export type ClientPipelineOpts = {
636
678
  /**
@@ -645,15 +687,28 @@ export type ClientPipelineOpts = {
645
687
  export type ClientSocketOpts = {
646
688
  id?: SocketID;
647
689
  };
648
- export type ClientTypeDefOpts = {
649
- id?: TypeDefID;
650
- };
651
690
  /**
652
691
  * A unique identifier for a secret.
653
692
  */
654
693
  export type SecretID = string & {
655
694
  __SecretID: never;
656
695
  };
696
+ export type ServiceEndpointOpts = {
697
+ /**
698
+ * The exposed port number for the endpoint
699
+ */
700
+ port?: number;
701
+ /**
702
+ * Return a URL with the given scheme, eg. http for http://
703
+ */
704
+ scheme?: string;
705
+ };
706
+ /**
707
+ * A unique service identifier.
708
+ */
709
+ export type ServiceID = string & {
710
+ __ServiceID: never;
711
+ };
657
712
  /**
658
713
  * A content-addressed socket identifier.
659
714
  */
@@ -738,18 +793,16 @@ export declare class CacheVolume extends BaseClient {
738
793
  queryTree?: QueryTree[];
739
794
  host?: string;
740
795
  sessionToken?: string;
741
- }, _id?: CacheID);
742
- id(): Promise<CacheID>;
796
+ }, _id?: CacheVolumeID);
797
+ id(): Promise<CacheVolumeID>;
743
798
  }
744
799
  /**
745
800
  * An OCI-compatible container, also known as a docker container.
746
801
  */
747
802
  export declare class Container extends BaseClient {
748
803
  private readonly _id?;
749
- private readonly _endpoint?;
750
804
  private readonly _envVariable?;
751
805
  private readonly _export?;
752
- private readonly _hostname?;
753
806
  private readonly _imageRef?;
754
807
  private readonly _label?;
755
808
  private readonly _platform?;
@@ -767,11 +820,31 @@ export declare class Container extends BaseClient {
767
820
  queryTree?: QueryTree[];
768
821
  host?: string;
769
822
  sessionToken?: string;
770
- }, _id?: ContainerID, _endpoint?: string, _envVariable?: string, _export?: boolean, _hostname?: string, _imageRef?: string, _label?: string, _platform?: Platform, _publish?: string, _shellEndpoint?: string, _stderr?: string, _stdout?: string, _sync?: ContainerID, _user?: string, _workdir?: string);
823
+ }, _id?: ContainerID, _envVariable?: string, _export?: boolean, _imageRef?: string, _label?: string, _platform?: Platform, _publish?: string, _shellEndpoint?: string, _stderr?: string, _stdout?: string, _sync?: ContainerID, _user?: string, _workdir?: string);
771
824
  /**
772
825
  * A unique identifier for this container.
773
826
  */
774
827
  id(): Promise<ContainerID>;
828
+ /**
829
+ * Turn the container into a Service.
830
+ *
831
+ * Be sure to set any exposed ports before this conversion.
832
+ */
833
+ asService(): Service;
834
+ /**
835
+ * Returns a File representing the container serialized to a tarball.
836
+ * @param opts.platformVariants Identifiers for other platform specific containers.
837
+ * Used for multi-platform image.
838
+ * @param opts.forcedCompression Force each layer of the image to use the specified compression algorithm.
839
+ * If this is unset, then if a layer already has a compressed blob in the engine's
840
+ * cache, that will be used (this can result in a mix of compression algorithms for
841
+ * different layers). If this is unset and a layer has no compressed blob in the
842
+ * engine's cache, then it will be compressed using Gzip.
843
+ * @param opts.mediaTypes Use the specified media types for the image's layers. Defaults to OCI, which
844
+ * is largely compatible with most recent container runtimes, but Docker may be needed
845
+ * for older runtimes without OCI support.
846
+ */
847
+ asTarball(opts?: ContainerAsTarballOpts): File;
775
848
  /**
776
849
  * Initializes this container from a Dockerfile build.
777
850
  * @param context Directory context used by the Dockerfile.
@@ -800,18 +873,6 @@ export declare class Container extends BaseClient {
800
873
  * @param path The path of the directory to retrieve (e.g., "./src").
801
874
  */
802
875
  directory(path: string): Directory;
803
- /**
804
- * Retrieves an endpoint that clients can use to reach this container.
805
- *
806
- * If no port is specified, the first exposed port is used. If none exist an error is returned.
807
- *
808
- * If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
809
- *
810
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
811
- * @param opts.port The exposed port number for the endpoint
812
- * @param opts.scheme Return a URL with the given scheme, eg. http for http://
813
- */
814
- endpoint(opts?: ContainerEndpointOpts): Promise<string>;
815
876
  /**
816
877
  * Retrieves entrypoint to be prepended to the arguments of all commands.
817
878
  */
@@ -849,8 +910,6 @@ export declare class Container extends BaseClient {
849
910
  *
850
911
  * This includes ports already exposed by the image, even if not
851
912
  * explicitly added with dagger.
852
- *
853
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
854
913
  */
855
914
  exposedPorts(): Promise<Port[]>;
856
915
  /**
@@ -867,12 +926,6 @@ export declare class Container extends BaseClient {
867
926
  * Formatted as [host]/[user]/[repo]:[tag] (e.g., "docker.io/dagger/dagger:main").
868
927
  */
869
928
  from(address: string): Container;
870
- /**
871
- * Retrieves a hostname which can be used by clients to reach this container.
872
- *
873
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
874
- */
875
- hostname(): Promise<string>;
876
929
  /**
877
930
  * The unique image reference which can only be retrieved immediately after the 'Container.From' call.
878
931
  */
@@ -1019,8 +1072,6 @@ export declare class Container extends BaseClient {
1019
1072
  * Exposed ports serve two purposes:
1020
1073
  * - For health checks and introspection, when running services
1021
1074
  * - For setting the EXPOSE OCI field when publishing the container
1022
- *
1023
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
1024
1075
  * @param port Port number to expose
1025
1076
  * @param opts.protocol Transport layer network protocol
1026
1077
  * @param opts.description Optional port description
@@ -1151,12 +1202,10 @@ export declare class Container extends BaseClient {
1151
1202
  * The service will be reachable from the container via the provided hostname alias.
1152
1203
  *
1153
1204
  * The service dependency will also convey to any files or directories produced by the container.
1154
- *
1155
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
1156
1205
  * @param alias A name that can be used to reach the service from the container
1157
1206
  * @param service Identifier of the service container
1158
1207
  */
1159
- withServiceBinding(alias: string, service: Container): Container;
1208
+ withServiceBinding(alias: string, service: Service): Container;
1160
1209
  /**
1161
1210
  * Retrieves this container plus a socket forwarded to the given Unix socket path.
1162
1211
  * @param path Location of the forwarded Unix socket (e.g., "/tmp/socket").
@@ -1185,8 +1234,6 @@ export declare class Container extends BaseClient {
1185
1234
  withoutEnvVariable(name: string): Container;
1186
1235
  /**
1187
1236
  * Unexpose a previously exposed port.
1188
- *
1189
- * Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
1190
1237
  * @param port Port number to unexpose
1191
1238
  * @param opts.protocol Port protocol to unexpose
1192
1239
  */
@@ -1261,10 +1308,6 @@ export declare class Directory extends BaseClient {
1261
1308
  *
1262
1309
  * If not set, the module source code is loaded from the root of the
1263
1310
  * directory.
1264
- * @param opts.runtime A pre-built runtime container to use instead of building one from the
1265
- * source code. This is useful for bootstrapping.
1266
- *
1267
- * You should ignore this unless you're building a Dagger SDK.
1268
1311
  */
1269
1312
  asModule(opts?: DirectoryAsModuleOpts): Module_;
1270
1313
  /**
@@ -1555,6 +1598,7 @@ export declare class Function_ extends BaseClient {
1555
1598
  * argument passed at function call time.
1556
1599
  */
1557
1600
  export declare class FunctionArg extends BaseClient {
1601
+ private readonly _id?;
1558
1602
  private readonly _defaultValue?;
1559
1603
  private readonly _description?;
1560
1604
  private readonly _name?;
@@ -1565,7 +1609,11 @@ export declare class FunctionArg extends BaseClient {
1565
1609
  queryTree?: QueryTree[];
1566
1610
  host?: string;
1567
1611
  sessionToken?: string;
1568
- }, _defaultValue?: JSON, _description?: string, _name?: string);
1612
+ }, _id?: FunctionArgID, _defaultValue?: JSON, _description?: string, _name?: string);
1613
+ /**
1614
+ * The ID of the argument
1615
+ */
1616
+ id(): Promise<FunctionArgID>;
1569
1617
  /**
1570
1618
  * A default value to use for this argument when not explicitly set by the caller, if any
1571
1619
  */
@@ -1663,10 +1711,6 @@ export declare class GeneratedCode extends BaseClient {
1663
1711
  * List of paths to ignore in version control (i.e. .gitignore)
1664
1712
  */
1665
1713
  vcsIgnoredPaths(): Promise<string[]>;
1666
- /**
1667
- * Set the directory containing the generated code
1668
- */
1669
- withCode(code: Directory): GeneratedCode;
1670
1714
  /**
1671
1715
  * Set the list of paths to mark generated in version control
1672
1716
  */
@@ -1751,6 +1795,17 @@ export declare class Host extends BaseClient {
1751
1795
  * @param path Location of the file to retrieve (e.g., "README.md").
1752
1796
  */
1753
1797
  file(path: string): File;
1798
+ /**
1799
+ * Creates a service that forwards traffic to a specified address via the host.
1800
+ * @param ports Ports to expose via the service, forwarding through the host network.
1801
+ *
1802
+ * If a port's frontend is unspecified or 0, it defaults to the same as the
1803
+ * backend port.
1804
+ *
1805
+ * An empty set of ports is not valid; an error will be returned.
1806
+ * @param opts.host Upstream host to forward traffic to.
1807
+ */
1808
+ service(ports: PortForward[], opts?: HostServiceOpts): Service;
1754
1809
  /**
1755
1810
  * Sets a secret given a user-defined name and the file path on the host, and returns the secret.
1756
1811
  * The file is limited to a size of 512000 bytes.
@@ -1758,6 +1813,25 @@ export declare class Host extends BaseClient {
1758
1813
  * @param path Location of the file to set as a secret.
1759
1814
  */
1760
1815
  setSecretFile(name: string, path: string): Secret;
1816
+ /**
1817
+ * Creates a tunnel that forwards traffic from the host to a service.
1818
+ * @param service Service to send traffic from the tunnel.
1819
+ * @param opts.native Map each service port to the same port on the host, as if the service were
1820
+ * running natively.
1821
+ *
1822
+ * Note: enabling may result in port conflicts.
1823
+ * @param opts.ports Configure explicit port forwarding rules for the tunnel.
1824
+ *
1825
+ * If a port's frontend is unspecified or 0, a random port will be chosen by
1826
+ * the host.
1827
+ *
1828
+ * If no ports are given, all of the service's ports are forwarded. If native
1829
+ * is true, each port maps to the same port on the host. If native is false,
1830
+ * each port maps to a random port chosen by the host.
1831
+ *
1832
+ * If ports are given and native is true, the ports are additive.
1833
+ */
1834
+ tunnel(service: Service, opts?: HostTunnelOpts): Service;
1761
1835
  /**
1762
1836
  * Accesses a Unix socket on the host.
1763
1837
  * @param path Location of the Unix socket (e.g., "/var/run/docker.sock").
@@ -1809,7 +1883,6 @@ export declare class Module_ extends BaseClient {
1809
1883
  private readonly _description?;
1810
1884
  private readonly _name?;
1811
1885
  private readonly _sdk?;
1812
- private readonly _sdkRuntime?;
1813
1886
  private readonly _serve?;
1814
1887
  private readonly _sourceDirectorySubPath?;
1815
1888
  /**
@@ -1819,7 +1892,7 @@ export declare class Module_ extends BaseClient {
1819
1892
  queryTree?: QueryTree[];
1820
1893
  host?: string;
1821
1894
  sessionToken?: string;
1822
- }, _id?: ModuleID, _description?: string, _name?: string, _sdk?: string, _sdkRuntime?: string, _serve?: Void, _sourceDirectorySubPath?: string);
1895
+ }, _id?: ModuleID, _description?: string, _name?: string, _sdk?: string, _serve?: Void, _sourceDirectorySubPath?: string);
1823
1896
  /**
1824
1897
  * The ID of the module
1825
1898
  */
@@ -1849,19 +1922,15 @@ export declare class Module_ extends BaseClient {
1849
1922
  */
1850
1923
  objects(): Promise<TypeDef[]>;
1851
1924
  /**
1852
- * The SDK used by this module
1925
+ * The SDK used by this module. Either a name of a builtin SDK or a module ref pointing to the SDK's implementation.
1853
1926
  */
1854
1927
  sdk(): Promise<string>;
1855
- /**
1856
- * The SDK runtime module image ref.
1857
- */
1858
- sdkRuntime(): Promise<string>;
1859
1928
  /**
1860
1929
  * Serve a module's API in the current session.
1861
1930
  * Note: this can only be called once per session.
1862
1931
  * In the future, it could return a stream or service to remove the side effect.
1863
1932
  */
1864
- serve(opts?: ModuleServeOpts): Promise<Void>;
1933
+ serve(): Promise<Void>;
1865
1934
  /**
1866
1935
  * The directory containing the module's source code
1867
1936
  */
@@ -1881,6 +1950,46 @@ export declare class Module_ extends BaseClient {
1881
1950
  */
1882
1951
  with(arg: (param: Module_) => Module_): Module_;
1883
1952
  }
1953
+ /**
1954
+ * Static configuration for a module (e.g. parsed contents of dagger.json)
1955
+ */
1956
+ export declare class ModuleConfig extends BaseClient {
1957
+ private readonly _name?;
1958
+ private readonly _root?;
1959
+ private readonly _sdk?;
1960
+ /**
1961
+ * Constructor is used for internal usage only, do not create object from it.
1962
+ */
1963
+ constructor(parent?: {
1964
+ queryTree?: QueryTree[];
1965
+ host?: string;
1966
+ sessionToken?: string;
1967
+ }, _name?: string, _root?: string, _sdk?: string);
1968
+ /**
1969
+ * Modules that this module depends on.
1970
+ */
1971
+ dependencies(): Promise<string[]>;
1972
+ /**
1973
+ * Exclude these file globs when loading the module root.
1974
+ */
1975
+ exclude(): Promise<string[]>;
1976
+ /**
1977
+ * Include only these file globs when loading the module root.
1978
+ */
1979
+ include(): Promise<string[]>;
1980
+ /**
1981
+ * The name of the module.
1982
+ */
1983
+ name(): Promise<string>;
1984
+ /**
1985
+ * The root directory of the module's project, which may be above the module source code.
1986
+ */
1987
+ root(): Promise<string>;
1988
+ /**
1989
+ * Either the name of a built-in SDK ('go', 'python', etc.) OR a module reference pointing to the SDK's module implementation.
1990
+ */
1991
+ sdk(): Promise<string>;
1992
+ }
1884
1993
  /**
1885
1994
  * A definition of a custom object defined in a Module.
1886
1995
  */
@@ -1962,11 +2071,10 @@ export declare class Client extends BaseClient {
1962
2071
  */
1963
2072
  checkVersionCompatibility(version: string): Promise<boolean>;
1964
2073
  /**
1965
- * Loads a container from ID.
2074
+ * Creates a scratch container or loads one by ID.
1966
2075
  *
1967
- * Null ID returns an empty container (scratch).
1968
- * Optional platform argument initializes new containers to execute and publish as that platform.
1969
- * Platform defaults to that of the builder's host.
2076
+ * Optional platform argument initializes new containers to execute and publish
2077
+ * as that platform. Platform defaults to that of the builder's host.
1970
2078
  */
1971
2079
  container(opts?: ClientContainerOpts): Container;
1972
2080
  /**
@@ -1984,21 +2092,23 @@ export declare class Client extends BaseClient {
1984
2092
  */
1985
2093
  defaultPlatform(): Promise<Platform>;
1986
2094
  /**
1987
- * Load a directory by ID. No argument produces an empty directory.
2095
+ * Creates an empty directory or loads one by ID.
1988
2096
  */
1989
2097
  directory(opts?: ClientDirectoryOpts): Directory;
1990
2098
  /**
1991
2099
  * Loads a file by ID.
2100
+ * @deprecated Use loadFileFromID instead.
1992
2101
  */
1993
2102
  file(id: FileID): File;
1994
2103
  /**
1995
- * Load a function by ID
2104
+ * Create a function.
1996
2105
  */
1997
- function_(id: FunctionID): Function_;
2106
+ function_(name: string, returnType: TypeDef): Function_;
1998
2107
  /**
1999
- * Load GeneratedCode by ID, or create a new one if id is unset.
2108
+ * Create a code generation result, given a directory containing the generated
2109
+ * code.
2000
2110
  */
2001
- generatedCode(opts?: ClientGeneratedCodeOpts): GeneratedCode;
2111
+ generatedCode(code: Directory): GeneratedCode;
2002
2112
  /**
2003
2113
  * Queries a git repository.
2004
2114
  * @param url Url of the git repository.
@@ -2019,13 +2129,61 @@ export declare class Client extends BaseClient {
2019
2129
  */
2020
2130
  http(url: string, opts?: ClientHttpOpts): File;
2021
2131
  /**
2022
- * Load a module by ID, or create a new one if id is unset.
2132
+ * Load a CacheVolume from its ID.
2133
+ */
2134
+ loadCacheVolumeFromID(id: CacheVolumeID): CacheVolume;
2135
+ /**
2136
+ * Loads a container from an ID.
2137
+ */
2138
+ loadContainerFromID(id: ContainerID): Container;
2139
+ /**
2140
+ * Load a Directory from its ID.
2141
+ */
2142
+ loadDirectoryFromID(id: DirectoryID): Directory;
2143
+ /**
2144
+ * Load a File from its ID.
2023
2145
  */
2024
- module_(opts?: ClientModuleOpts): Module_;
2146
+ loadFileFromID(id: FileID): File;
2025
2147
  /**
2026
- * Create a new function from the provided definition.
2148
+ * Load a function argument by ID.
2027
2149
  */
2028
- newFunction(name: string, returnType: TypeDef): Function_;
2150
+ loadFunctionArgFromID(id: FunctionArgID): FunctionArg;
2151
+ /**
2152
+ * Load a function by ID.
2153
+ */
2154
+ loadFunctionFromID(id: FunctionID): Function_;
2155
+ /**
2156
+ * Load a GeneratedCode by ID.
2157
+ */
2158
+ loadGeneratedCodeFromID(id: GeneratedCodeID): GeneratedCode;
2159
+ /**
2160
+ * Load a module by ID.
2161
+ */
2162
+ loadModuleFromID(id: ModuleID): Module_;
2163
+ /**
2164
+ * Load a Secret from its ID.
2165
+ */
2166
+ loadSecretFromID(id: SecretID): Secret;
2167
+ /**
2168
+ * Loads a service from ID.
2169
+ */
2170
+ loadServiceFromID(id: ServiceID): Service;
2171
+ /**
2172
+ * Load a Socket from its ID.
2173
+ */
2174
+ loadSocketFromID(id: SocketID): Socket;
2175
+ /**
2176
+ * Load a TypeDef by ID.
2177
+ */
2178
+ loadTypeDefFromID(id: TypeDefID): TypeDef;
2179
+ /**
2180
+ * Create a new module.
2181
+ */
2182
+ module_(): Module_;
2183
+ /**
2184
+ * Load the static configuration for a module from the given source directory and optional subpath.
2185
+ */
2186
+ moduleConfig(sourceDirectory: Directory, opts?: ClientModuleConfigOpts): ModuleConfig;
2029
2187
  /**
2030
2188
  * Creates a named sub-pipeline.
2031
2189
  * @param name Pipeline name.
@@ -2035,6 +2193,7 @@ export declare class Client extends BaseClient {
2035
2193
  pipeline(name: string, opts?: ClientPipelineOpts): Client;
2036
2194
  /**
2037
2195
  * Loads a secret from its ID.
2196
+ * @deprecated Use loadSecretFromID instead
2038
2197
  */
2039
2198
  secret(id: SecretID): Secret;
2040
2199
  /**
@@ -2046,9 +2205,13 @@ export declare class Client extends BaseClient {
2046
2205
  setSecret(name: string, plaintext: string): Secret;
2047
2206
  /**
2048
2207
  * Loads a socket by its ID.
2208
+ * @deprecated Use loadSocketFromID instead.
2049
2209
  */
2050
2210
  socket(opts?: ClientSocketOpts): Socket;
2051
- typeDef(opts?: ClientTypeDefOpts): TypeDef;
2211
+ /**
2212
+ * Create a new TypeDef.
2213
+ */
2214
+ typeDef(): TypeDef;
2052
2215
  /**
2053
2216
  * Call the provided function with current Client.
2054
2217
  *
@@ -2079,6 +2242,53 @@ export declare class Secret extends BaseClient {
2079
2242
  */
2080
2243
  plaintext(): Promise<string>;
2081
2244
  }
2245
+ export declare class Service extends BaseClient {
2246
+ private readonly _id?;
2247
+ private readonly _endpoint?;
2248
+ private readonly _hostname?;
2249
+ private readonly _start?;
2250
+ private readonly _stop?;
2251
+ /**
2252
+ * Constructor is used for internal usage only, do not create object from it.
2253
+ */
2254
+ constructor(parent?: {
2255
+ queryTree?: QueryTree[];
2256
+ host?: string;
2257
+ sessionToken?: string;
2258
+ }, _id?: ServiceID, _endpoint?: string, _hostname?: string, _start?: ServiceID, _stop?: ServiceID);
2259
+ /**
2260
+ * A unique identifier for this service.
2261
+ */
2262
+ id(): Promise<ServiceID>;
2263
+ /**
2264
+ * Retrieves an endpoint that clients can use to reach this container.
2265
+ *
2266
+ * If no port is specified, the first exposed port is used. If none exist an error is returned.
2267
+ *
2268
+ * If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
2269
+ * @param opts.port The exposed port number for the endpoint
2270
+ * @param opts.scheme Return a URL with the given scheme, eg. http for http://
2271
+ */
2272
+ endpoint(opts?: ServiceEndpointOpts): Promise<string>;
2273
+ /**
2274
+ * Retrieves a hostname which can be used by clients to reach this container.
2275
+ */
2276
+ hostname(): Promise<string>;
2277
+ /**
2278
+ * Retrieves the list of ports provided by the service.
2279
+ */
2280
+ ports(): Promise<Port[]>;
2281
+ /**
2282
+ * Start the service and wait for its health checks to succeed.
2283
+ *
2284
+ * Services bound to a Container do not need to be manually started.
2285
+ */
2286
+ start(): Promise<Service>;
2287
+ /**
2288
+ * Stop the service.
2289
+ */
2290
+ stop(): Promise<Service>;
2291
+ }
2082
2292
  export declare class Socket extends BaseClient {
2083
2293
  private readonly _id?;
2084
2294
  /**