@dagger.io/dagger 0.9.3 → 0.9.5
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.
- package/dist/api/client.gen.d.ts +323 -280
- package/dist/api/client.gen.d.ts.map +1 -1
- package/dist/api/client.gen.js +1725 -1879
- package/dist/api/utils.js +73 -90
- package/dist/common/errors/DaggerSDKError.js +5 -1
- package/dist/common/errors/DockerImageRefValidationError.js +7 -3
- package/dist/common/errors/EngineSessionConnectParamsParseError.js +6 -2
- package/dist/common/errors/EngineSessionConnectionTimeoutError.js +6 -2
- package/dist/common/errors/EngineSessionErrorOptions.js +2 -2
- package/dist/common/errors/ExecError.js +18 -2
- package/dist/common/errors/GraphQLRequestError.js +10 -2
- package/dist/common/errors/InitEngineSessionBinaryError.js +2 -2
- package/dist/common/errors/NotAwaitedRequestError.js +2 -2
- package/dist/common/errors/TooManyNestedObjectsError.js +6 -2
- package/dist/common/errors/UnknownDaggerError.js +2 -2
- package/dist/common/errors/errors-codes.js +1 -1
- package/dist/common/utils.d.ts +4 -4
- package/dist/connect.d.ts +22 -27
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +43 -49
- package/dist/connectOpts.d.ts +25 -0
- package/dist/connectOpts.d.ts.map +1 -0
- package/dist/connectOpts.js +1 -0
- package/dist/context/builder.d.ts +9 -0
- package/dist/context/builder.d.ts.map +1 -0
- package/dist/context/builder.js +34 -0
- package/dist/context/context.d.ts +39 -0
- package/dist/context/context.d.ts.map +1 -0
- package/dist/context/context.js +51 -0
- package/dist/entrypoint/entrypoint.d.ts +2 -0
- package/dist/entrypoint/entrypoint.d.ts.map +1 -0
- package/dist/entrypoint/entrypoint.js +70 -0
- package/dist/entrypoint/invoke.d.ts +11 -0
- package/dist/entrypoint/invoke.d.ts.map +1 -0
- package/dist/entrypoint/invoke.js +14 -0
- package/dist/entrypoint/load.d.ts +16 -0
- package/dist/entrypoint/load.d.ts.map +1 -0
- package/dist/entrypoint/load.js +44 -0
- package/dist/entrypoint/register.d.ts +6 -0
- package/dist/entrypoint/register.d.ts.map +1 -0
- package/dist/entrypoint/register.js +93 -0
- package/dist/graphql/client.d.ts +3 -0
- package/dist/graphql/client.d.ts.map +1 -0
- package/dist/graphql/client.js +8 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/introspector/decorators/decorators.d.ts +4 -0
- package/dist/introspector/decorators/decorators.d.ts.map +1 -0
- package/dist/introspector/decorators/decorators.js +7 -0
- package/dist/introspector/registry/registry.d.ts +65 -0
- package/dist/introspector/registry/registry.d.ts.map +1 -0
- package/dist/introspector/registry/registry.js +125 -0
- package/dist/introspector/scanner/metadata.d.ts +23 -0
- package/dist/introspector/scanner/metadata.d.ts.map +1 -0
- package/dist/introspector/scanner/metadata.js +1 -0
- package/dist/introspector/scanner/scan.d.ts +17 -0
- package/dist/introspector/scanner/scan.d.ts.map +1 -0
- package/dist/introspector/scanner/scan.js +158 -0
- package/dist/introspector/scanner/serialize.d.ts +34 -0
- package/dist/introspector/scanner/serialize.d.ts.map +1 -0
- package/dist/introspector/scanner/serialize.js +62 -0
- package/dist/introspector/scanner/typeDefs.d.ts +70 -0
- package/dist/introspector/scanner/typeDefs.d.ts.map +1 -0
- package/dist/introspector/scanner/typeDefs.js +1 -0
- package/dist/introspector/scanner/utils.d.ts +62 -0
- package/dist/introspector/scanner/utils.d.ts.map +1 -0
- package/dist/introspector/scanner/utils.js +124 -0
- package/dist/introspector/utils/files.d.ts +5 -0
- package/dist/introspector/utils/files.d.ts.map +1 -0
- package/dist/introspector/utils/files.js +28 -0
- package/dist/provisioning/bin.d.ts +5 -3
- package/dist/provisioning/bin.d.ts.map +1 -1
- package/dist/provisioning/bin.js +185 -233
- package/dist/provisioning/default.d.ts +1 -1
- package/dist/provisioning/default.js +1 -1
- package/dist/provisioning/engineconn.d.ts +6 -2
- package/dist/provisioning/engineconn.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/api/client.gen.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by `client-gen`.
|
|
3
3
|
* Do not make direct changes to the file.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { Context } from "../context/context.js";
|
|
6
6
|
/**
|
|
7
7
|
* @hidden
|
|
8
8
|
*/
|
|
@@ -20,21 +20,15 @@ export type Metadata = {
|
|
|
20
20
|
};
|
|
21
21
|
interface ClientConfig {
|
|
22
22
|
queryTree?: QueryTree[];
|
|
23
|
-
|
|
24
|
-
sessionToken?: string;
|
|
23
|
+
ctx?: Context;
|
|
25
24
|
}
|
|
26
25
|
declare class BaseClient {
|
|
27
26
|
protected _queryTree: QueryTree[];
|
|
28
|
-
protected
|
|
29
|
-
/**
|
|
30
|
-
* @defaultValue `127.0.0.1:8080`
|
|
31
|
-
*/
|
|
32
|
-
clientHost: string;
|
|
33
|
-
sessionToken: string;
|
|
27
|
+
protected _ctx: Context;
|
|
34
28
|
/**
|
|
35
29
|
* @hidden
|
|
36
30
|
*/
|
|
37
|
-
constructor({ queryTree,
|
|
31
|
+
constructor({ queryTree, ctx }?: ClientConfig);
|
|
38
32
|
/**
|
|
39
33
|
* @hidden
|
|
40
34
|
*/
|
|
@@ -204,9 +198,15 @@ export type ContainerWithDirectoryOpts = {
|
|
|
204
198
|
*/
|
|
205
199
|
owner?: string;
|
|
206
200
|
};
|
|
201
|
+
export type ContainerWithEntrypointOpts = {
|
|
202
|
+
/**
|
|
203
|
+
* Don't remove the default arguments when setting the entrypoint.
|
|
204
|
+
*/
|
|
205
|
+
keepDefaultArgs?: boolean;
|
|
206
|
+
};
|
|
207
207
|
export type ContainerWithEnvVariableOpts = {
|
|
208
208
|
/**
|
|
209
|
-
* Replace
|
|
209
|
+
* Replace `${VAR}` or $VAR in the value according to the current environment
|
|
210
210
|
* variables defined in the container (e.g., "/opt/bin:$PATH").
|
|
211
211
|
*/
|
|
212
212
|
expand?: boolean;
|
|
@@ -358,6 +358,12 @@ export type ContainerWithUnixSocketOpts = {
|
|
|
358
358
|
*/
|
|
359
359
|
owner?: string;
|
|
360
360
|
};
|
|
361
|
+
export type ContainerWithoutEntrypointOpts = {
|
|
362
|
+
/**
|
|
363
|
+
* Don't remove the default arguments when unsetting the entrypoint.
|
|
364
|
+
*/
|
|
365
|
+
keepDefaultArgs?: boolean;
|
|
366
|
+
};
|
|
361
367
|
export type ContainerWithoutExposedPortOpts = {
|
|
362
368
|
/**
|
|
363
369
|
* Port protocol to unexpose
|
|
@@ -518,6 +524,18 @@ export type GitRefTreeOpts = {
|
|
|
518
524
|
sshKnownHosts?: string;
|
|
519
525
|
sshAuthSocket?: Socket;
|
|
520
526
|
};
|
|
527
|
+
/**
|
|
528
|
+
* A git reference identifier.
|
|
529
|
+
*/
|
|
530
|
+
export type GitRefID = string & {
|
|
531
|
+
__GitRefID: never;
|
|
532
|
+
};
|
|
533
|
+
/**
|
|
534
|
+
* A git repository identifier.
|
|
535
|
+
*/
|
|
536
|
+
export type GitRepositoryID = string & {
|
|
537
|
+
__GitRepositoryID: never;
|
|
538
|
+
};
|
|
521
539
|
export type HostDirectoryOpts = {
|
|
522
540
|
/**
|
|
523
541
|
* Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
|
|
@@ -786,10 +804,9 @@ export declare class CacheVolume extends BaseClient {
|
|
|
786
804
|
*/
|
|
787
805
|
constructor(parent?: {
|
|
788
806
|
queryTree?: QueryTree[];
|
|
789
|
-
|
|
790
|
-
sessionToken?: string;
|
|
807
|
+
ctx: Context;
|
|
791
808
|
}, _id?: CacheVolumeID);
|
|
792
|
-
id()
|
|
809
|
+
id: () => Promise<CacheVolumeID>;
|
|
793
810
|
}
|
|
794
811
|
/**
|
|
795
812
|
* An OCI-compatible container, also known as a docker container.
|
|
@@ -813,19 +830,18 @@ export declare class Container extends BaseClient {
|
|
|
813
830
|
*/
|
|
814
831
|
constructor(parent?: {
|
|
815
832
|
queryTree?: QueryTree[];
|
|
816
|
-
|
|
817
|
-
sessionToken?: string;
|
|
833
|
+
ctx: Context;
|
|
818
834
|
}, _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);
|
|
819
835
|
/**
|
|
820
836
|
* A unique identifier for this container.
|
|
821
837
|
*/
|
|
822
|
-
id()
|
|
838
|
+
id: () => Promise<ContainerID>;
|
|
823
839
|
/**
|
|
824
840
|
* Turn the container into a Service.
|
|
825
841
|
*
|
|
826
842
|
* Be sure to set any exposed ports before this conversion.
|
|
827
843
|
*/
|
|
828
|
-
asService()
|
|
844
|
+
asService: () => Service;
|
|
829
845
|
/**
|
|
830
846
|
* Returns a File representing the container serialized to a tarball.
|
|
831
847
|
* @param opts.platformVariants Identifiers for other platform specific containers.
|
|
@@ -839,7 +855,7 @@ export declare class Container extends BaseClient {
|
|
|
839
855
|
* is largely compatible with most recent container runtimes, but Docker may be needed
|
|
840
856
|
* for older runtimes without OCI support.
|
|
841
857
|
*/
|
|
842
|
-
asTarball(opts?: ContainerAsTarballOpts)
|
|
858
|
+
asTarball: (opts?: ContainerAsTarballOpts) => File;
|
|
843
859
|
/**
|
|
844
860
|
* Initializes this container from a Dockerfile build.
|
|
845
861
|
* @param context Directory context used by the Dockerfile.
|
|
@@ -856,45 +872,45 @@ export declare class Container extends BaseClient {
|
|
|
856
872
|
* and mount path /run/secrets/[secret-name]
|
|
857
873
|
* e.g. RUN --mount=type=secret,id=my-secret curl url?token=$(cat /run/secrets/my-secret)"
|
|
858
874
|
*/
|
|
859
|
-
build(context: Directory, opts?: ContainerBuildOpts)
|
|
875
|
+
build: (context: Directory, opts?: ContainerBuildOpts) => Container;
|
|
860
876
|
/**
|
|
861
877
|
* Retrieves default arguments for future commands.
|
|
862
878
|
*/
|
|
863
|
-
defaultArgs()
|
|
879
|
+
defaultArgs: () => Promise<string[]>;
|
|
864
880
|
/**
|
|
865
881
|
* Retrieves a directory at the given path.
|
|
866
882
|
*
|
|
867
883
|
* Mounts are included.
|
|
868
884
|
* @param path The path of the directory to retrieve (e.g., "./src").
|
|
869
885
|
*/
|
|
870
|
-
directory(path: string)
|
|
886
|
+
directory: (path: string) => Directory;
|
|
871
887
|
/**
|
|
872
888
|
* Retrieves entrypoint to be prepended to the arguments of all commands.
|
|
873
889
|
*/
|
|
874
|
-
entrypoint()
|
|
890
|
+
entrypoint: () => Promise<string[]>;
|
|
875
891
|
/**
|
|
876
892
|
* Retrieves the value of the specified environment variable.
|
|
877
893
|
* @param name The name of the environment variable to retrieve (e.g., "PATH").
|
|
878
894
|
*/
|
|
879
|
-
envVariable(name: string)
|
|
895
|
+
envVariable: (name: string) => Promise<string>;
|
|
880
896
|
/**
|
|
881
897
|
* Retrieves the list of environment variables passed to commands.
|
|
882
898
|
*/
|
|
883
|
-
envVariables()
|
|
899
|
+
envVariables: () => Promise<EnvVariable[]>;
|
|
884
900
|
/**
|
|
885
901
|
* EXPERIMENTAL API! Subject to change/removal at any time.
|
|
886
902
|
*
|
|
887
903
|
* experimentalWithAllGPUs configures all available GPUs on the host to be accessible to this container.
|
|
888
904
|
* This currently works for Nvidia devices only.
|
|
889
905
|
*/
|
|
890
|
-
experimentalWithAllGPUs()
|
|
906
|
+
experimentalWithAllGPUs: () => Container;
|
|
891
907
|
/**
|
|
892
908
|
* EXPERIMENTAL API! Subject to change/removal at any time.
|
|
893
909
|
*
|
|
894
910
|
* experimentalWithGPU configures the provided list of devices to be accesible to this container.
|
|
895
911
|
* This currently works for Nvidia devices only.
|
|
896
912
|
*/
|
|
897
|
-
experimentalWithGPU(devices: string[])
|
|
913
|
+
experimentalWithGPU: (devices: string[]) => Container;
|
|
898
914
|
/**
|
|
899
915
|
* Writes the container as an OCI tarball to the destination file path on the host for the specified platform variants.
|
|
900
916
|
*
|
|
@@ -913,32 +929,32 @@ export declare class Container extends BaseClient {
|
|
|
913
929
|
* is largely compatible with most recent container runtimes, but Docker may be needed
|
|
914
930
|
* for older runtimes without OCI support.
|
|
915
931
|
*/
|
|
916
|
-
export(path: string, opts?: ContainerExportOpts)
|
|
932
|
+
export: (path: string, opts?: ContainerExportOpts) => Promise<boolean>;
|
|
917
933
|
/**
|
|
918
934
|
* Retrieves the list of exposed ports.
|
|
919
935
|
*
|
|
920
936
|
* This includes ports already exposed by the image, even if not
|
|
921
937
|
* explicitly added with dagger.
|
|
922
938
|
*/
|
|
923
|
-
exposedPorts()
|
|
939
|
+
exposedPorts: () => Promise<Port[]>;
|
|
924
940
|
/**
|
|
925
941
|
* Retrieves a file at the given path.
|
|
926
942
|
*
|
|
927
943
|
* Mounts are included.
|
|
928
944
|
* @param path The path of the file to retrieve (e.g., "./README.md").
|
|
929
945
|
*/
|
|
930
|
-
file(path: string)
|
|
946
|
+
file: (path: string) => File;
|
|
931
947
|
/**
|
|
932
948
|
* Initializes this container from a pulled base image.
|
|
933
949
|
* @param address Image's address from its registry.
|
|
934
950
|
*
|
|
935
951
|
* Formatted as [host]/[user]/[repo]:[tag] (e.g., "docker.io/dagger/dagger:main").
|
|
936
952
|
*/
|
|
937
|
-
from(address: string)
|
|
953
|
+
from: (address: string) => Container;
|
|
938
954
|
/**
|
|
939
955
|
* The unique image reference which can only be retrieved immediately after the 'Container.From' call.
|
|
940
956
|
*/
|
|
941
|
-
imageRef()
|
|
957
|
+
imageRef: () => Promise<string>;
|
|
942
958
|
/**
|
|
943
959
|
* Reads the container from an OCI tarball.
|
|
944
960
|
*
|
|
@@ -948,30 +964,30 @@ export declare class Container extends BaseClient {
|
|
|
948
964
|
* @param opts.tag Identifies the tag to import from the archive, if the archive bundles
|
|
949
965
|
* multiple tags.
|
|
950
966
|
*/
|
|
951
|
-
import_(source: File, opts?: ContainerImportOpts)
|
|
967
|
+
import_: (source: File, opts?: ContainerImportOpts) => Container;
|
|
952
968
|
/**
|
|
953
969
|
* Retrieves the value of the specified label.
|
|
954
970
|
*/
|
|
955
|
-
label(name: string)
|
|
971
|
+
label: (name: string) => Promise<string>;
|
|
956
972
|
/**
|
|
957
973
|
* Retrieves the list of labels passed to container.
|
|
958
974
|
*/
|
|
959
|
-
labels()
|
|
975
|
+
labels: () => Promise<Label[]>;
|
|
960
976
|
/**
|
|
961
977
|
* Retrieves the list of paths where a directory is mounted.
|
|
962
978
|
*/
|
|
963
|
-
mounts()
|
|
979
|
+
mounts: () => Promise<string[]>;
|
|
964
980
|
/**
|
|
965
981
|
* Creates a named sub-pipeline
|
|
966
982
|
* @param name Pipeline name.
|
|
967
983
|
* @param opts.description Pipeline description.
|
|
968
984
|
* @param opts.labels Pipeline labels.
|
|
969
985
|
*/
|
|
970
|
-
pipeline(name: string, opts?: ContainerPipelineOpts)
|
|
986
|
+
pipeline: (name: string, opts?: ContainerPipelineOpts) => Container;
|
|
971
987
|
/**
|
|
972
988
|
* The platform this container executes and publishes as.
|
|
973
989
|
*/
|
|
974
|
-
platform()
|
|
990
|
+
platform: () => Promise<Platform>;
|
|
975
991
|
/**
|
|
976
992
|
* Publishes this container as a new image to the specified address.
|
|
977
993
|
*
|
|
@@ -991,45 +1007,45 @@ export declare class Container extends BaseClient {
|
|
|
991
1007
|
* is largely compatible with most recent registries, but Docker may be needed for older
|
|
992
1008
|
* registries without OCI support.
|
|
993
1009
|
*/
|
|
994
|
-
publish(address: string, opts?: ContainerPublishOpts)
|
|
1010
|
+
publish: (address: string, opts?: ContainerPublishOpts) => Promise<string>;
|
|
995
1011
|
/**
|
|
996
1012
|
* Retrieves this container's root filesystem. Mounts are not included.
|
|
997
1013
|
*/
|
|
998
|
-
rootfs()
|
|
1014
|
+
rootfs: () => Directory;
|
|
999
1015
|
/**
|
|
1000
1016
|
* Return a websocket endpoint that, if connected to, will start the container with a TTY streamed
|
|
1001
1017
|
* over the websocket.
|
|
1002
1018
|
*
|
|
1003
1019
|
* Primarily intended for internal use with the dagger CLI.
|
|
1004
1020
|
*/
|
|
1005
|
-
shellEndpoint()
|
|
1021
|
+
shellEndpoint: () => Promise<string>;
|
|
1006
1022
|
/**
|
|
1007
1023
|
* The error stream of the last executed command.
|
|
1008
1024
|
*
|
|
1009
1025
|
* Will execute default command if none is set, or error if there's no default.
|
|
1010
1026
|
*/
|
|
1011
|
-
stderr()
|
|
1027
|
+
stderr: () => Promise<string>;
|
|
1012
1028
|
/**
|
|
1013
1029
|
* The output stream of the last executed command.
|
|
1014
1030
|
*
|
|
1015
1031
|
* Will execute default command if none is set, or error if there's no default.
|
|
1016
1032
|
*/
|
|
1017
|
-
stdout()
|
|
1033
|
+
stdout: () => Promise<string>;
|
|
1018
1034
|
/**
|
|
1019
1035
|
* Forces evaluation of the pipeline in the engine.
|
|
1020
1036
|
*
|
|
1021
1037
|
* It doesn't run the default command if no exec has been set.
|
|
1022
1038
|
*/
|
|
1023
|
-
sync()
|
|
1039
|
+
sync: () => Promise<Container>;
|
|
1024
1040
|
/**
|
|
1025
1041
|
* Retrieves the user to be set for all commands.
|
|
1026
1042
|
*/
|
|
1027
|
-
user()
|
|
1043
|
+
user: () => Promise<string>;
|
|
1028
1044
|
/**
|
|
1029
1045
|
* Configures default arguments for future commands.
|
|
1030
1046
|
* @param opts.args Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
|
|
1031
1047
|
*/
|
|
1032
|
-
withDefaultArgs(opts?: ContainerWithDefaultArgsOpts)
|
|
1048
|
+
withDefaultArgs: (opts?: ContainerWithDefaultArgsOpts) => Container;
|
|
1033
1049
|
/**
|
|
1034
1050
|
* Retrieves this container plus a directory written at the given path.
|
|
1035
1051
|
* @param path Location of the written directory (e.g., "/tmp/directory").
|
|
@@ -1042,20 +1058,21 @@ export declare class Container extends BaseClient {
|
|
|
1042
1058
|
*
|
|
1043
1059
|
* If the group is omitted, it defaults to the same as the user.
|
|
1044
1060
|
*/
|
|
1045
|
-
withDirectory(path: string, directory: Directory, opts?: ContainerWithDirectoryOpts)
|
|
1061
|
+
withDirectory: (path: string, directory: Directory, opts?: ContainerWithDirectoryOpts) => Container;
|
|
1046
1062
|
/**
|
|
1047
1063
|
* Retrieves this container but with a different command entrypoint.
|
|
1048
1064
|
* @param args Entrypoint to use for future executions (e.g., ["go", "run"]).
|
|
1065
|
+
* @param opts.keepDefaultArgs Don't remove the default arguments when setting the entrypoint.
|
|
1049
1066
|
*/
|
|
1050
|
-
withEntrypoint(args: string[])
|
|
1067
|
+
withEntrypoint: (args: string[], opts?: ContainerWithEntrypointOpts) => Container;
|
|
1051
1068
|
/**
|
|
1052
1069
|
* Retrieves this container plus the given environment variable.
|
|
1053
1070
|
* @param name The name of the environment variable (e.g., "HOST").
|
|
1054
1071
|
* @param value The value of the environment variable. (e.g., "localhost").
|
|
1055
|
-
* @param opts.expand Replace
|
|
1072
|
+
* @param opts.expand Replace `${VAR}` or $VAR in the value according to the current environment
|
|
1056
1073
|
* variables defined in the container (e.g., "/opt/bin:$PATH").
|
|
1057
1074
|
*/
|
|
1058
|
-
withEnvVariable(name: string, value: string, opts?: ContainerWithEnvVariableOpts)
|
|
1075
|
+
withEnvVariable: (name: string, value: string, opts?: ContainerWithEnvVariableOpts) => Container;
|
|
1059
1076
|
/**
|
|
1060
1077
|
* Retrieves this container after executing the specified command inside it.
|
|
1061
1078
|
* @param args Command to run instead of the container's default command (e.g., ["run", "main.go"]).
|
|
@@ -1074,18 +1091,19 @@ export declare class Container extends BaseClient {
|
|
|
1074
1091
|
* does not provide any security guarantees when using this option. It should only be used
|
|
1075
1092
|
* when absolutely necessary and only with trusted commands.
|
|
1076
1093
|
*/
|
|
1077
|
-
withExec(args: string[], opts?: ContainerWithExecOpts)
|
|
1094
|
+
withExec: (args: string[], opts?: ContainerWithExecOpts) => Container;
|
|
1078
1095
|
/**
|
|
1079
1096
|
* Expose a network port.
|
|
1080
1097
|
*
|
|
1081
1098
|
* Exposed ports serve two purposes:
|
|
1082
|
-
*
|
|
1083
|
-
*
|
|
1099
|
+
*
|
|
1100
|
+
* - For health checks and introspection, when running services
|
|
1101
|
+
* - For setting the EXPOSE OCI field when publishing the container
|
|
1084
1102
|
* @param port Port number to expose
|
|
1085
1103
|
* @param opts.protocol Transport layer network protocol
|
|
1086
1104
|
* @param opts.description Optional port description
|
|
1087
1105
|
*/
|
|
1088
|
-
withExposedPort(port: number, opts?: ContainerWithExposedPortOpts)
|
|
1106
|
+
withExposedPort: (port: number, opts?: ContainerWithExposedPortOpts) => Container;
|
|
1089
1107
|
/**
|
|
1090
1108
|
* Retrieves this container plus the contents of the given file copied to the given path.
|
|
1091
1109
|
* @param path Location of the copied file (e.g., "/tmp/file.txt").
|
|
@@ -1099,18 +1117,18 @@ export declare class Container extends BaseClient {
|
|
|
1099
1117
|
*
|
|
1100
1118
|
* If the group is omitted, it defaults to the same as the user.
|
|
1101
1119
|
*/
|
|
1102
|
-
withFile(path: string, source: File, opts?: ContainerWithFileOpts)
|
|
1120
|
+
withFile: (path: string, source: File, opts?: ContainerWithFileOpts) => Container;
|
|
1103
1121
|
/**
|
|
1104
1122
|
* Indicate that subsequent operations should be featured more prominently in
|
|
1105
1123
|
* the UI.
|
|
1106
1124
|
*/
|
|
1107
|
-
withFocus()
|
|
1125
|
+
withFocus: () => Container;
|
|
1108
1126
|
/**
|
|
1109
1127
|
* Retrieves this container plus the given label.
|
|
1110
1128
|
* @param name The name of the label (e.g., "org.opencontainers.artifact.created").
|
|
1111
1129
|
* @param value The value of the label (e.g., "2023-01-01T00:00:00Z").
|
|
1112
1130
|
*/
|
|
1113
|
-
withLabel(name: string, value: string)
|
|
1131
|
+
withLabel: (name: string, value: string) => Container;
|
|
1114
1132
|
/**
|
|
1115
1133
|
* Retrieves this container plus a cache volume mounted at the given path.
|
|
1116
1134
|
* @param path Location of the cache directory (e.g., "/cache/node_modules").
|
|
@@ -1127,7 +1145,7 @@ export declare class Container extends BaseClient {
|
|
|
1127
1145
|
*
|
|
1128
1146
|
* If the group is omitted, it defaults to the same as the user.
|
|
1129
1147
|
*/
|
|
1130
|
-
withMountedCache(path: string, cache: CacheVolume, opts?: ContainerWithMountedCacheOpts)
|
|
1148
|
+
withMountedCache: (path: string, cache: CacheVolume, opts?: ContainerWithMountedCacheOpts) => Container;
|
|
1131
1149
|
/**
|
|
1132
1150
|
* Retrieves this container plus a directory mounted at the given path.
|
|
1133
1151
|
* @param path Location of the mounted directory (e.g., "/mnt/directory").
|
|
@@ -1138,7 +1156,7 @@ export declare class Container extends BaseClient {
|
|
|
1138
1156
|
*
|
|
1139
1157
|
* If the group is omitted, it defaults to the same as the user.
|
|
1140
1158
|
*/
|
|
1141
|
-
withMountedDirectory(path: string, source: Directory, opts?: ContainerWithMountedDirectoryOpts)
|
|
1159
|
+
withMountedDirectory: (path: string, source: Directory, opts?: ContainerWithMountedDirectoryOpts) => Container;
|
|
1142
1160
|
/**
|
|
1143
1161
|
* Retrieves this container plus a file mounted at the given path.
|
|
1144
1162
|
* @param path Location of the mounted file (e.g., "/tmp/file.txt").
|
|
@@ -1149,7 +1167,7 @@ export declare class Container extends BaseClient {
|
|
|
1149
1167
|
*
|
|
1150
1168
|
* If the group is omitted, it defaults to the same as the user.
|
|
1151
1169
|
*/
|
|
1152
|
-
withMountedFile(path: string, source: File, opts?: ContainerWithMountedFileOpts)
|
|
1170
|
+
withMountedFile: (path: string, source: File, opts?: ContainerWithMountedFileOpts) => Container;
|
|
1153
1171
|
/**
|
|
1154
1172
|
* Retrieves this container plus a secret mounted into a file at the given path.
|
|
1155
1173
|
* @param path Location of the secret file (e.g., "/tmp/secret.txt").
|
|
@@ -1164,12 +1182,12 @@ export declare class Container extends BaseClient {
|
|
|
1164
1182
|
*
|
|
1165
1183
|
* Default: 0400.
|
|
1166
1184
|
*/
|
|
1167
|
-
withMountedSecret(path: string, source: Secret, opts?: ContainerWithMountedSecretOpts)
|
|
1185
|
+
withMountedSecret: (path: string, source: Secret, opts?: ContainerWithMountedSecretOpts) => Container;
|
|
1168
1186
|
/**
|
|
1169
1187
|
* Retrieves this container plus a temporary directory mounted at the given path.
|
|
1170
1188
|
* @param path Location of the temporary directory (e.g., "/tmp/temp_dir").
|
|
1171
1189
|
*/
|
|
1172
|
-
withMountedTemp(path: string)
|
|
1190
|
+
withMountedTemp: (path: string) => Container;
|
|
1173
1191
|
/**
|
|
1174
1192
|
* Retrieves this container plus a new file written at the given path.
|
|
1175
1193
|
* @param path Location of the written file (e.g., "/tmp/file.txt").
|
|
@@ -1183,7 +1201,7 @@ export declare class Container extends BaseClient {
|
|
|
1183
1201
|
*
|
|
1184
1202
|
* If the group is omitted, it defaults to the same as the user.
|
|
1185
1203
|
*/
|
|
1186
|
-
withNewFile(path: string, opts?: ContainerWithNewFileOpts)
|
|
1204
|
+
withNewFile: (path: string, opts?: ContainerWithNewFileOpts) => Container;
|
|
1187
1205
|
/**
|
|
1188
1206
|
* Retrieves this container with a registry authentication for a given address.
|
|
1189
1207
|
* @param address Registry's address to bind the authentication to.
|
|
@@ -1191,17 +1209,17 @@ export declare class Container extends BaseClient {
|
|
|
1191
1209
|
* @param username The username of the registry's account (e.g., "Dagger").
|
|
1192
1210
|
* @param secret The API key, password or token to authenticate to this registry.
|
|
1193
1211
|
*/
|
|
1194
|
-
withRegistryAuth(address: string, username: string, secret: Secret)
|
|
1212
|
+
withRegistryAuth: (address: string, username: string, secret: Secret) => Container;
|
|
1195
1213
|
/**
|
|
1196
1214
|
* Initializes this container from this DirectoryID.
|
|
1197
1215
|
*/
|
|
1198
|
-
withRootfs(directory: Directory)
|
|
1216
|
+
withRootfs: (directory: Directory) => Container;
|
|
1199
1217
|
/**
|
|
1200
1218
|
* Retrieves this container plus an env variable containing the given secret.
|
|
1201
1219
|
* @param name The name of the secret variable (e.g., "API_SECRET").
|
|
1202
1220
|
* @param secret The identifier of the secret value.
|
|
1203
1221
|
*/
|
|
1204
|
-
withSecretVariable(name: string, secret: Secret)
|
|
1222
|
+
withSecretVariable: (name: string, secret: Secret) => Container;
|
|
1205
1223
|
/**
|
|
1206
1224
|
* Establish a runtime dependency on a service.
|
|
1207
1225
|
*
|
|
@@ -1214,7 +1232,7 @@ export declare class Container extends BaseClient {
|
|
|
1214
1232
|
* @param alias A name that can be used to reach the service from the container
|
|
1215
1233
|
* @param service Identifier of the service container
|
|
1216
1234
|
*/
|
|
1217
|
-
withServiceBinding(alias: string, service: Service)
|
|
1235
|
+
withServiceBinding: (alias: string, service: Service) => Container;
|
|
1218
1236
|
/**
|
|
1219
1237
|
* Retrieves this container plus a socket forwarded to the given Unix socket path.
|
|
1220
1238
|
* @param path Location of the forwarded Unix socket (e.g., "/tmp/socket").
|
|
@@ -1225,66 +1243,87 @@ export declare class Container extends BaseClient {
|
|
|
1225
1243
|
*
|
|
1226
1244
|
* If the group is omitted, it defaults to the same as the user.
|
|
1227
1245
|
*/
|
|
1228
|
-
withUnixSocket(path: string, source: Socket, opts?: ContainerWithUnixSocketOpts)
|
|
1246
|
+
withUnixSocket: (path: string, source: Socket, opts?: ContainerWithUnixSocketOpts) => Container;
|
|
1229
1247
|
/**
|
|
1230
1248
|
* Retrieves this container with a different command user.
|
|
1231
1249
|
* @param name The user to set (e.g., "root").
|
|
1232
1250
|
*/
|
|
1233
|
-
withUser(name: string)
|
|
1251
|
+
withUser: (name: string) => Container;
|
|
1234
1252
|
/**
|
|
1235
1253
|
* Retrieves this container with a different working directory.
|
|
1236
1254
|
* @param path The path to set as the working directory (e.g., "/app").
|
|
1237
1255
|
*/
|
|
1238
|
-
withWorkdir(path: string)
|
|
1256
|
+
withWorkdir: (path: string) => Container;
|
|
1257
|
+
/**
|
|
1258
|
+
* Retrieves this container with unset default arguments for future commands.
|
|
1259
|
+
*/
|
|
1260
|
+
withoutDefaultArgs: () => Container;
|
|
1261
|
+
/**
|
|
1262
|
+
* Retrieves this container with an unset command entrypoint.
|
|
1263
|
+
* @param opts.keepDefaultArgs Don't remove the default arguments when unsetting the entrypoint.
|
|
1264
|
+
*/
|
|
1265
|
+
withoutEntrypoint: (opts?: ContainerWithoutEntrypointOpts) => Container;
|
|
1239
1266
|
/**
|
|
1240
1267
|
* Retrieves this container minus the given environment variable.
|
|
1241
1268
|
* @param name The name of the environment variable (e.g., "HOST").
|
|
1242
1269
|
*/
|
|
1243
|
-
withoutEnvVariable(name: string)
|
|
1270
|
+
withoutEnvVariable: (name: string) => Container;
|
|
1244
1271
|
/**
|
|
1245
1272
|
* Unexpose a previously exposed port.
|
|
1246
1273
|
* @param port Port number to unexpose
|
|
1247
1274
|
* @param opts.protocol Port protocol to unexpose
|
|
1248
1275
|
*/
|
|
1249
|
-
withoutExposedPort(port: number, opts?: ContainerWithoutExposedPortOpts)
|
|
1276
|
+
withoutExposedPort: (port: number, opts?: ContainerWithoutExposedPortOpts) => Container;
|
|
1250
1277
|
/**
|
|
1251
1278
|
* Indicate that subsequent operations should not be featured more prominently
|
|
1252
1279
|
* in the UI.
|
|
1253
1280
|
*
|
|
1254
1281
|
* This is the initial state of all containers.
|
|
1255
1282
|
*/
|
|
1256
|
-
withoutFocus()
|
|
1283
|
+
withoutFocus: () => Container;
|
|
1257
1284
|
/**
|
|
1258
1285
|
* Retrieves this container minus the given environment label.
|
|
1259
1286
|
* @param name The name of the label to remove (e.g., "org.opencontainers.artifact.created").
|
|
1260
1287
|
*/
|
|
1261
|
-
withoutLabel(name: string)
|
|
1288
|
+
withoutLabel: (name: string) => Container;
|
|
1262
1289
|
/**
|
|
1263
1290
|
* Retrieves this container after unmounting everything at the given path.
|
|
1264
1291
|
* @param path Location of the cache directory (e.g., "/cache/node_modules").
|
|
1265
1292
|
*/
|
|
1266
|
-
withoutMount(path: string)
|
|
1293
|
+
withoutMount: (path: string) => Container;
|
|
1267
1294
|
/**
|
|
1268
1295
|
* Retrieves this container without the registry authentication of a given address.
|
|
1269
1296
|
* @param address Registry's address to remove the authentication from.
|
|
1270
1297
|
* Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
|
|
1271
1298
|
*/
|
|
1272
|
-
withoutRegistryAuth(address: string)
|
|
1299
|
+
withoutRegistryAuth: (address: string) => Container;
|
|
1273
1300
|
/**
|
|
1274
1301
|
* Retrieves this container with a previously added Unix socket removed.
|
|
1275
1302
|
* @param path Location of the socket to remove (e.g., "/tmp/socket").
|
|
1276
1303
|
*/
|
|
1277
|
-
withoutUnixSocket(path: string)
|
|
1304
|
+
withoutUnixSocket: (path: string) => Container;
|
|
1305
|
+
/**
|
|
1306
|
+
* Retrieves this container with an unset command user.
|
|
1307
|
+
*
|
|
1308
|
+
* Should default to root.
|
|
1309
|
+
*/
|
|
1310
|
+
withoutUser: () => Container;
|
|
1311
|
+
/**
|
|
1312
|
+
* Retrieves this container with an unset working directory.
|
|
1313
|
+
*
|
|
1314
|
+
* Should default to "/".
|
|
1315
|
+
*/
|
|
1316
|
+
withoutWorkdir: () => Container;
|
|
1278
1317
|
/**
|
|
1279
1318
|
* Retrieves the working directory for all commands.
|
|
1280
1319
|
*/
|
|
1281
|
-
workdir()
|
|
1320
|
+
workdir: () => Promise<string>;
|
|
1282
1321
|
/**
|
|
1283
1322
|
* Call the provided function with current Container.
|
|
1284
1323
|
*
|
|
1285
1324
|
* This is useful for reusability and readability by not breaking the calling chain.
|
|
1286
1325
|
*/
|
|
1287
|
-
with(arg: (param: Container) => Container)
|
|
1326
|
+
with: (arg: (param: Container) => Container) => Container;
|
|
1288
1327
|
}
|
|
1289
1328
|
/**
|
|
1290
1329
|
* A directory.
|
|
@@ -1298,13 +1337,12 @@ export declare class Directory extends BaseClient {
|
|
|
1298
1337
|
*/
|
|
1299
1338
|
constructor(parent?: {
|
|
1300
1339
|
queryTree?: QueryTree[];
|
|
1301
|
-
|
|
1302
|
-
sessionToken?: string;
|
|
1340
|
+
ctx: Context;
|
|
1303
1341
|
}, _id?: DirectoryID, _export?: boolean, _sync?: DirectoryID);
|
|
1304
1342
|
/**
|
|
1305
1343
|
* The content-addressed identifier of the directory.
|
|
1306
1344
|
*/
|
|
1307
|
-
id()
|
|
1345
|
+
id: () => Promise<DirectoryID>;
|
|
1308
1346
|
/**
|
|
1309
1347
|
* Load the directory as a Dagger module
|
|
1310
1348
|
* @param opts.sourceSubpath An optional subpath of the directory which contains the module's source
|
|
@@ -1318,17 +1356,17 @@ export declare class Directory extends BaseClient {
|
|
|
1318
1356
|
* If not set, the module source code is loaded from the root of the
|
|
1319
1357
|
* directory.
|
|
1320
1358
|
*/
|
|
1321
|
-
asModule(opts?: DirectoryAsModuleOpts)
|
|
1359
|
+
asModule: (opts?: DirectoryAsModuleOpts) => Module_;
|
|
1322
1360
|
/**
|
|
1323
1361
|
* Gets the difference between this directory and an another directory.
|
|
1324
1362
|
* @param other Identifier of the directory to compare.
|
|
1325
1363
|
*/
|
|
1326
|
-
diff(other: Directory)
|
|
1364
|
+
diff: (other: Directory) => Directory;
|
|
1327
1365
|
/**
|
|
1328
1366
|
* Retrieves a directory at the given path.
|
|
1329
1367
|
* @param path Location of the directory to retrieve (e.g., "/src").
|
|
1330
1368
|
*/
|
|
1331
|
-
directory(path: string)
|
|
1369
|
+
directory: (path: string) => Directory;
|
|
1332
1370
|
/**
|
|
1333
1371
|
* Builds a new Docker container from this directory.
|
|
1334
1372
|
* @param opts.dockerfile Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
|
|
@@ -1341,38 +1379,38 @@ export declare class Directory extends BaseClient {
|
|
|
1341
1379
|
*
|
|
1342
1380
|
* They will be mounted at /run/secrets/[secret-name].
|
|
1343
1381
|
*/
|
|
1344
|
-
dockerBuild(opts?: DirectoryDockerBuildOpts)
|
|
1382
|
+
dockerBuild: (opts?: DirectoryDockerBuildOpts) => Container;
|
|
1345
1383
|
/**
|
|
1346
1384
|
* Returns a list of files and directories at the given path.
|
|
1347
1385
|
* @param opts.path Location of the directory to look at (e.g., "/src").
|
|
1348
1386
|
*/
|
|
1349
|
-
entries(opts?: DirectoryEntriesOpts)
|
|
1387
|
+
entries: (opts?: DirectoryEntriesOpts) => Promise<string[]>;
|
|
1350
1388
|
/**
|
|
1351
1389
|
* Writes the contents of the directory to a path on the host.
|
|
1352
1390
|
* @param path Location of the copied directory (e.g., "logs/").
|
|
1353
1391
|
*/
|
|
1354
|
-
export(path: string)
|
|
1392
|
+
export: (path: string) => Promise<boolean>;
|
|
1355
1393
|
/**
|
|
1356
1394
|
* Retrieves a file at the given path.
|
|
1357
1395
|
* @param path Location of the file to retrieve (e.g., "README.md").
|
|
1358
1396
|
*/
|
|
1359
|
-
file(path: string)
|
|
1397
|
+
file: (path: string) => File;
|
|
1360
1398
|
/**
|
|
1361
1399
|
* Returns a list of files and directories that matche the given pattern.
|
|
1362
1400
|
* @param pattern Pattern to match (e.g., "*.md").
|
|
1363
1401
|
*/
|
|
1364
|
-
glob(pattern: string)
|
|
1402
|
+
glob: (pattern: string) => Promise<string[]>;
|
|
1365
1403
|
/**
|
|
1366
1404
|
* Creates a named sub-pipeline
|
|
1367
1405
|
* @param name Pipeline name.
|
|
1368
1406
|
* @param opts.description Pipeline description.
|
|
1369
1407
|
* @param opts.labels Pipeline labels.
|
|
1370
1408
|
*/
|
|
1371
|
-
pipeline(name: string, opts?: DirectoryPipelineOpts)
|
|
1409
|
+
pipeline: (name: string, opts?: DirectoryPipelineOpts) => Directory;
|
|
1372
1410
|
/**
|
|
1373
1411
|
* Force evaluation in the engine.
|
|
1374
1412
|
*/
|
|
1375
|
-
sync()
|
|
1413
|
+
sync: () => Promise<Directory>;
|
|
1376
1414
|
/**
|
|
1377
1415
|
* Retrieves this directory plus a directory written at the given path.
|
|
1378
1416
|
* @param path Location of the written directory (e.g., "/src/").
|
|
@@ -1380,7 +1418,7 @@ export declare class Directory extends BaseClient {
|
|
|
1380
1418
|
* @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
|
|
1381
1419
|
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
|
|
1382
1420
|
*/
|
|
1383
|
-
withDirectory(path: string, directory: Directory, opts?: DirectoryWithDirectoryOpts)
|
|
1421
|
+
withDirectory: (path: string, directory: Directory, opts?: DirectoryWithDirectoryOpts) => Directory;
|
|
1384
1422
|
/**
|
|
1385
1423
|
* Retrieves this directory plus the contents of the given file copied to the given path.
|
|
1386
1424
|
* @param path Location of the copied file (e.g., "/file.txt").
|
|
@@ -1389,7 +1427,7 @@ export declare class Directory extends BaseClient {
|
|
|
1389
1427
|
*
|
|
1390
1428
|
* Default: 0644.
|
|
1391
1429
|
*/
|
|
1392
|
-
withFile(path: string, source: File, opts?: DirectoryWithFileOpts)
|
|
1430
|
+
withFile: (path: string, source: File, opts?: DirectoryWithFileOpts) => Directory;
|
|
1393
1431
|
/**
|
|
1394
1432
|
* Retrieves this directory plus a new directory created at the given path.
|
|
1395
1433
|
* @param path Location of the directory created (e.g., "/logs").
|
|
@@ -1397,7 +1435,7 @@ export declare class Directory extends BaseClient {
|
|
|
1397
1435
|
*
|
|
1398
1436
|
* Default: 0755.
|
|
1399
1437
|
*/
|
|
1400
|
-
withNewDirectory(path: string, opts?: DirectoryWithNewDirectoryOpts)
|
|
1438
|
+
withNewDirectory: (path: string, opts?: DirectoryWithNewDirectoryOpts) => Directory;
|
|
1401
1439
|
/**
|
|
1402
1440
|
* Retrieves this directory plus a new file written at the given path.
|
|
1403
1441
|
* @param path Location of the written file (e.g., "/file.txt").
|
|
@@ -1406,30 +1444,30 @@ export declare class Directory extends BaseClient {
|
|
|
1406
1444
|
*
|
|
1407
1445
|
* Default: 0644.
|
|
1408
1446
|
*/
|
|
1409
|
-
withNewFile(path: string, contents: string, opts?: DirectoryWithNewFileOpts)
|
|
1447
|
+
withNewFile: (path: string, contents: string, opts?: DirectoryWithNewFileOpts) => Directory;
|
|
1410
1448
|
/**
|
|
1411
1449
|
* Retrieves this directory with all file/dir timestamps set to the given time.
|
|
1412
1450
|
* @param timestamp Timestamp to set dir/files in.
|
|
1413
1451
|
*
|
|
1414
1452
|
* Formatted in seconds following Unix epoch (e.g., 1672531199).
|
|
1415
1453
|
*/
|
|
1416
|
-
withTimestamps(timestamp: number)
|
|
1454
|
+
withTimestamps: (timestamp: number) => Directory;
|
|
1417
1455
|
/**
|
|
1418
1456
|
* Retrieves this directory with the directory at the given path removed.
|
|
1419
1457
|
* @param path Location of the directory to remove (e.g., ".github/").
|
|
1420
1458
|
*/
|
|
1421
|
-
withoutDirectory(path: string)
|
|
1459
|
+
withoutDirectory: (path: string) => Directory;
|
|
1422
1460
|
/**
|
|
1423
1461
|
* Retrieves this directory with the file at the given path removed.
|
|
1424
1462
|
* @param path Location of the file to remove (e.g., "/file.txt").
|
|
1425
1463
|
*/
|
|
1426
|
-
withoutFile(path: string)
|
|
1464
|
+
withoutFile: (path: string) => Directory;
|
|
1427
1465
|
/**
|
|
1428
1466
|
* Call the provided function with current Directory.
|
|
1429
1467
|
*
|
|
1430
1468
|
* This is useful for reusability and readability by not breaking the calling chain.
|
|
1431
1469
|
*/
|
|
1432
|
-
with(arg: (param: Directory) => Directory)
|
|
1470
|
+
with: (arg: (param: Directory) => Directory) => Directory;
|
|
1433
1471
|
}
|
|
1434
1472
|
/**
|
|
1435
1473
|
* A simple key value object that represents an environment variable.
|
|
@@ -1442,17 +1480,16 @@ export declare class EnvVariable extends BaseClient {
|
|
|
1442
1480
|
*/
|
|
1443
1481
|
constructor(parent?: {
|
|
1444
1482
|
queryTree?: QueryTree[];
|
|
1445
|
-
|
|
1446
|
-
sessionToken?: string;
|
|
1483
|
+
ctx: Context;
|
|
1447
1484
|
}, _name?: string, _value?: string);
|
|
1448
1485
|
/**
|
|
1449
1486
|
* The environment variable name.
|
|
1450
1487
|
*/
|
|
1451
|
-
name()
|
|
1488
|
+
name: () => Promise<string>;
|
|
1452
1489
|
/**
|
|
1453
1490
|
* The environment variable value.
|
|
1454
1491
|
*/
|
|
1455
|
-
value()
|
|
1492
|
+
value: () => Promise<string>;
|
|
1456
1493
|
}
|
|
1457
1494
|
/**
|
|
1458
1495
|
* A definition of a field on a custom object defined in a Module.
|
|
@@ -1467,21 +1504,20 @@ export declare class FieldTypeDef extends BaseClient {
|
|
|
1467
1504
|
*/
|
|
1468
1505
|
constructor(parent?: {
|
|
1469
1506
|
queryTree?: QueryTree[];
|
|
1470
|
-
|
|
1471
|
-
sessionToken?: string;
|
|
1507
|
+
ctx: Context;
|
|
1472
1508
|
}, _description?: string, _name?: string);
|
|
1473
1509
|
/**
|
|
1474
1510
|
* A doc string for the field, if any
|
|
1475
1511
|
*/
|
|
1476
|
-
description()
|
|
1512
|
+
description: () => Promise<string>;
|
|
1477
1513
|
/**
|
|
1478
1514
|
* The name of the field in the object
|
|
1479
1515
|
*/
|
|
1480
|
-
name()
|
|
1516
|
+
name: () => Promise<string>;
|
|
1481
1517
|
/**
|
|
1482
1518
|
* The type of the field
|
|
1483
1519
|
*/
|
|
1484
|
-
typeDef()
|
|
1520
|
+
typeDef: () => TypeDef;
|
|
1485
1521
|
}
|
|
1486
1522
|
/**
|
|
1487
1523
|
* A file.
|
|
@@ -1497,45 +1533,44 @@ export declare class File extends BaseClient {
|
|
|
1497
1533
|
*/
|
|
1498
1534
|
constructor(parent?: {
|
|
1499
1535
|
queryTree?: QueryTree[];
|
|
1500
|
-
|
|
1501
|
-
sessionToken?: string;
|
|
1536
|
+
ctx: Context;
|
|
1502
1537
|
}, _id?: FileID, _contents?: string, _export?: boolean, _size?: number, _sync?: FileID);
|
|
1503
1538
|
/**
|
|
1504
1539
|
* Retrieves the content-addressed identifier of the file.
|
|
1505
1540
|
*/
|
|
1506
|
-
id()
|
|
1541
|
+
id: () => Promise<FileID>;
|
|
1507
1542
|
/**
|
|
1508
1543
|
* Retrieves the contents of the file.
|
|
1509
1544
|
*/
|
|
1510
|
-
contents()
|
|
1545
|
+
contents: () => Promise<string>;
|
|
1511
1546
|
/**
|
|
1512
1547
|
* Writes the file to a file path on the host.
|
|
1513
1548
|
* @param path Location of the written directory (e.g., "output.txt").
|
|
1514
1549
|
* @param opts.allowParentDirPath If allowParentDirPath is true, the path argument can be a directory path, in which case
|
|
1515
1550
|
* the file will be created in that directory.
|
|
1516
1551
|
*/
|
|
1517
|
-
export(path: string, opts?: FileExportOpts)
|
|
1552
|
+
export: (path: string, opts?: FileExportOpts) => Promise<boolean>;
|
|
1518
1553
|
/**
|
|
1519
1554
|
* Gets the size of the file, in bytes.
|
|
1520
1555
|
*/
|
|
1521
|
-
size()
|
|
1556
|
+
size: () => Promise<number>;
|
|
1522
1557
|
/**
|
|
1523
1558
|
* Force evaluation in the engine.
|
|
1524
1559
|
*/
|
|
1525
|
-
sync()
|
|
1560
|
+
sync: () => Promise<File>;
|
|
1526
1561
|
/**
|
|
1527
1562
|
* Retrieves this file with its created/modified timestamps set to the given time.
|
|
1528
1563
|
* @param timestamp Timestamp to set dir/files in.
|
|
1529
1564
|
*
|
|
1530
1565
|
* Formatted in seconds following Unix epoch (e.g., 1672531199).
|
|
1531
1566
|
*/
|
|
1532
|
-
withTimestamps(timestamp: number)
|
|
1567
|
+
withTimestamps: (timestamp: number) => File;
|
|
1533
1568
|
/**
|
|
1534
1569
|
* Call the provided function with current File.
|
|
1535
1570
|
*
|
|
1536
1571
|
* This is useful for reusability and readability by not breaking the calling chain.
|
|
1537
1572
|
*/
|
|
1538
|
-
with(arg: (param: File) => File)
|
|
1573
|
+
with: (arg: (param: File) => File) => File;
|
|
1539
1574
|
}
|
|
1540
1575
|
/**
|
|
1541
1576
|
* Function represents a resolver provided by a Module.
|
|
@@ -1552,29 +1587,28 @@ export declare class Function_ extends BaseClient {
|
|
|
1552
1587
|
*/
|
|
1553
1588
|
constructor(parent?: {
|
|
1554
1589
|
queryTree?: QueryTree[];
|
|
1555
|
-
|
|
1556
|
-
sessionToken?: string;
|
|
1590
|
+
ctx: Context;
|
|
1557
1591
|
}, _id?: FunctionID, _description?: string, _name?: string);
|
|
1558
1592
|
/**
|
|
1559
1593
|
* The ID of the function
|
|
1560
1594
|
*/
|
|
1561
|
-
id()
|
|
1595
|
+
id: () => Promise<FunctionID>;
|
|
1562
1596
|
/**
|
|
1563
1597
|
* Arguments accepted by this function, if any
|
|
1564
1598
|
*/
|
|
1565
|
-
args()
|
|
1599
|
+
args: () => Promise<FunctionArg[]>;
|
|
1566
1600
|
/**
|
|
1567
1601
|
* A doc string for the function, if any
|
|
1568
1602
|
*/
|
|
1569
|
-
description()
|
|
1603
|
+
description: () => Promise<string>;
|
|
1570
1604
|
/**
|
|
1571
1605
|
* The name of the function
|
|
1572
1606
|
*/
|
|
1573
|
-
name()
|
|
1607
|
+
name: () => Promise<string>;
|
|
1574
1608
|
/**
|
|
1575
1609
|
* The type returned by this function
|
|
1576
1610
|
*/
|
|
1577
|
-
returnType()
|
|
1611
|
+
returnType: () => TypeDef;
|
|
1578
1612
|
/**
|
|
1579
1613
|
* Returns the function with the provided argument
|
|
1580
1614
|
* @param name The name of the argument
|
|
@@ -1582,17 +1616,17 @@ export declare class Function_ extends BaseClient {
|
|
|
1582
1616
|
* @param opts.description A doc string for the argument, if any
|
|
1583
1617
|
* @param opts.defaultValue A default value to use for this argument if not explicitly set by the caller, if any
|
|
1584
1618
|
*/
|
|
1585
|
-
withArg(name: string, typeDef: TypeDef, opts?: FunctionWithArgOpts)
|
|
1619
|
+
withArg: (name: string, typeDef: TypeDef, opts?: FunctionWithArgOpts) => Function_;
|
|
1586
1620
|
/**
|
|
1587
1621
|
* Returns the function with the doc string
|
|
1588
1622
|
*/
|
|
1589
|
-
withDescription(description: string)
|
|
1623
|
+
withDescription: (description: string) => Function_;
|
|
1590
1624
|
/**
|
|
1591
1625
|
* Call the provided function with current Function.
|
|
1592
1626
|
*
|
|
1593
1627
|
* This is useful for reusability and readability by not breaking the calling chain.
|
|
1594
1628
|
*/
|
|
1595
|
-
with(arg: (param: Function_) => Function_)
|
|
1629
|
+
with: (arg: (param: Function_) => Function_) => Function_;
|
|
1596
1630
|
}
|
|
1597
1631
|
/**
|
|
1598
1632
|
* An argument accepted by a function.
|
|
@@ -1610,29 +1644,28 @@ export declare class FunctionArg extends BaseClient {
|
|
|
1610
1644
|
*/
|
|
1611
1645
|
constructor(parent?: {
|
|
1612
1646
|
queryTree?: QueryTree[];
|
|
1613
|
-
|
|
1614
|
-
sessionToken?: string;
|
|
1647
|
+
ctx: Context;
|
|
1615
1648
|
}, _id?: FunctionArgID, _defaultValue?: JSON, _description?: string, _name?: string);
|
|
1616
1649
|
/**
|
|
1617
1650
|
* The ID of the argument
|
|
1618
1651
|
*/
|
|
1619
|
-
id()
|
|
1652
|
+
id: () => Promise<FunctionArgID>;
|
|
1620
1653
|
/**
|
|
1621
1654
|
* A default value to use for this argument when not explicitly set by the caller, if any
|
|
1622
1655
|
*/
|
|
1623
|
-
defaultValue()
|
|
1656
|
+
defaultValue: () => Promise<JSON>;
|
|
1624
1657
|
/**
|
|
1625
1658
|
* A doc string for the argument, if any
|
|
1626
1659
|
*/
|
|
1627
|
-
description()
|
|
1660
|
+
description: () => Promise<string>;
|
|
1628
1661
|
/**
|
|
1629
1662
|
* The name of the argument
|
|
1630
1663
|
*/
|
|
1631
|
-
name()
|
|
1664
|
+
name: () => Promise<string>;
|
|
1632
1665
|
/**
|
|
1633
1666
|
* The type of the argument
|
|
1634
1667
|
*/
|
|
1635
|
-
typeDef()
|
|
1668
|
+
typeDef: () => TypeDef;
|
|
1636
1669
|
}
|
|
1637
1670
|
export declare class FunctionCall extends BaseClient {
|
|
1638
1671
|
private readonly _name?;
|
|
@@ -1644,32 +1677,31 @@ export declare class FunctionCall extends BaseClient {
|
|
|
1644
1677
|
*/
|
|
1645
1678
|
constructor(parent?: {
|
|
1646
1679
|
queryTree?: QueryTree[];
|
|
1647
|
-
|
|
1648
|
-
sessionToken?: string;
|
|
1680
|
+
ctx: Context;
|
|
1649
1681
|
}, _name?: string, _parent?: JSON, _parentName?: string, _returnValue?: Void);
|
|
1650
1682
|
/**
|
|
1651
1683
|
* The argument values the function is being invoked with.
|
|
1652
1684
|
*/
|
|
1653
|
-
inputArgs()
|
|
1685
|
+
inputArgs: () => Promise<FunctionCallArgValue[]>;
|
|
1654
1686
|
/**
|
|
1655
1687
|
* The name of the function being called.
|
|
1656
1688
|
*/
|
|
1657
|
-
name()
|
|
1689
|
+
name: () => Promise<string>;
|
|
1658
1690
|
/**
|
|
1659
1691
|
* The value of the parent object of the function being called.
|
|
1660
1692
|
* If the function is "top-level" to the module, this is always an empty object.
|
|
1661
1693
|
*/
|
|
1662
|
-
parent()
|
|
1694
|
+
parent: () => Promise<JSON>;
|
|
1663
1695
|
/**
|
|
1664
1696
|
* The name of the parent object of the function being called.
|
|
1665
1697
|
* If the function is "top-level" to the module, this is the name of the module.
|
|
1666
1698
|
*/
|
|
1667
|
-
parentName()
|
|
1699
|
+
parentName: () => Promise<string>;
|
|
1668
1700
|
/**
|
|
1669
1701
|
* Set the return value of the function call to the provided value.
|
|
1670
1702
|
* The value should be a string of the JSON serialization of the return value.
|
|
1671
1703
|
*/
|
|
1672
|
-
returnValue(value: JSON)
|
|
1704
|
+
returnValue: (value: JSON) => Promise<Void>;
|
|
1673
1705
|
}
|
|
1674
1706
|
export declare class FunctionCallArgValue extends BaseClient {
|
|
1675
1707
|
private readonly _name?;
|
|
@@ -1679,17 +1711,16 @@ export declare class FunctionCallArgValue extends BaseClient {
|
|
|
1679
1711
|
*/
|
|
1680
1712
|
constructor(parent?: {
|
|
1681
1713
|
queryTree?: QueryTree[];
|
|
1682
|
-
|
|
1683
|
-
sessionToken?: string;
|
|
1714
|
+
ctx: Context;
|
|
1684
1715
|
}, _name?: string, _value?: JSON);
|
|
1685
1716
|
/**
|
|
1686
1717
|
* The name of the argument.
|
|
1687
1718
|
*/
|
|
1688
|
-
name()
|
|
1719
|
+
name: () => Promise<string>;
|
|
1689
1720
|
/**
|
|
1690
1721
|
* The value of the argument represented as a string of the JSON serialization.
|
|
1691
1722
|
*/
|
|
1692
|
-
value()
|
|
1723
|
+
value: () => Promise<JSON>;
|
|
1693
1724
|
}
|
|
1694
1725
|
export declare class GeneratedCode extends BaseClient {
|
|
1695
1726
|
private readonly _id?;
|
|
@@ -1698,86 +1729,93 @@ export declare class GeneratedCode extends BaseClient {
|
|
|
1698
1729
|
*/
|
|
1699
1730
|
constructor(parent?: {
|
|
1700
1731
|
queryTree?: QueryTree[];
|
|
1701
|
-
|
|
1702
|
-
sessionToken?: string;
|
|
1732
|
+
ctx: Context;
|
|
1703
1733
|
}, _id?: GeneratedCodeID);
|
|
1704
|
-
id()
|
|
1734
|
+
id: () => Promise<GeneratedCodeID>;
|
|
1705
1735
|
/**
|
|
1706
1736
|
* The directory containing the generated code
|
|
1707
1737
|
*/
|
|
1708
|
-
code()
|
|
1738
|
+
code: () => Directory;
|
|
1709
1739
|
/**
|
|
1710
1740
|
* List of paths to mark generated in version control (i.e. .gitattributes)
|
|
1711
1741
|
*/
|
|
1712
|
-
vcsGeneratedPaths()
|
|
1742
|
+
vcsGeneratedPaths: () => Promise<string[]>;
|
|
1713
1743
|
/**
|
|
1714
1744
|
* List of paths to ignore in version control (i.e. .gitignore)
|
|
1715
1745
|
*/
|
|
1716
|
-
vcsIgnoredPaths()
|
|
1746
|
+
vcsIgnoredPaths: () => Promise<string[]>;
|
|
1717
1747
|
/**
|
|
1718
1748
|
* Set the list of paths to mark generated in version control
|
|
1719
1749
|
*/
|
|
1720
|
-
withVCSGeneratedPaths(paths: string[])
|
|
1750
|
+
withVCSGeneratedPaths: (paths: string[]) => GeneratedCode;
|
|
1721
1751
|
/**
|
|
1722
1752
|
* Set the list of paths to ignore in version control
|
|
1723
1753
|
*/
|
|
1724
|
-
withVCSIgnoredPaths(paths: string[])
|
|
1754
|
+
withVCSIgnoredPaths: (paths: string[]) => GeneratedCode;
|
|
1725
1755
|
/**
|
|
1726
1756
|
* Call the provided function with current GeneratedCode.
|
|
1727
1757
|
*
|
|
1728
1758
|
* This is useful for reusability and readability by not breaking the calling chain.
|
|
1729
1759
|
*/
|
|
1730
|
-
with(arg: (param: GeneratedCode) => GeneratedCode)
|
|
1760
|
+
with: (arg: (param: GeneratedCode) => GeneratedCode) => GeneratedCode;
|
|
1731
1761
|
}
|
|
1732
1762
|
/**
|
|
1733
1763
|
* A git ref (tag, branch or commit).
|
|
1734
1764
|
*/
|
|
1735
1765
|
export declare class GitRef extends BaseClient {
|
|
1766
|
+
private readonly _id?;
|
|
1736
1767
|
private readonly _commit?;
|
|
1737
1768
|
/**
|
|
1738
1769
|
* Constructor is used for internal usage only, do not create object from it.
|
|
1739
1770
|
*/
|
|
1740
1771
|
constructor(parent?: {
|
|
1741
1772
|
queryTree?: QueryTree[];
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1773
|
+
ctx: Context;
|
|
1774
|
+
}, _id?: GitRefID, _commit?: string);
|
|
1775
|
+
/**
|
|
1776
|
+
* Retrieves the content-addressed identifier of the git ref.
|
|
1777
|
+
*/
|
|
1778
|
+
id: () => Promise<GitRefID>;
|
|
1745
1779
|
/**
|
|
1746
1780
|
* The resolved commit id at this ref.
|
|
1747
1781
|
*/
|
|
1748
|
-
commit()
|
|
1782
|
+
commit: () => Promise<string>;
|
|
1749
1783
|
/**
|
|
1750
1784
|
* The filesystem tree at this ref.
|
|
1751
1785
|
*/
|
|
1752
|
-
tree(opts?: GitRefTreeOpts)
|
|
1786
|
+
tree: (opts?: GitRefTreeOpts) => Directory;
|
|
1753
1787
|
}
|
|
1754
1788
|
/**
|
|
1755
1789
|
* A git repository.
|
|
1756
1790
|
*/
|
|
1757
1791
|
export declare class GitRepository extends BaseClient {
|
|
1792
|
+
private readonly _id?;
|
|
1758
1793
|
/**
|
|
1759
1794
|
* Constructor is used for internal usage only, do not create object from it.
|
|
1760
1795
|
*/
|
|
1761
1796
|
constructor(parent?: {
|
|
1762
1797
|
queryTree?: QueryTree[];
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1798
|
+
ctx: Context;
|
|
1799
|
+
}, _id?: GitRepositoryID);
|
|
1800
|
+
/**
|
|
1801
|
+
* Retrieves the content-addressed identifier of the git repository.
|
|
1802
|
+
*/
|
|
1803
|
+
id: () => Promise<GitRepositoryID>;
|
|
1766
1804
|
/**
|
|
1767
1805
|
* Returns details on one branch.
|
|
1768
1806
|
* @param name Branch's name (e.g., "main").
|
|
1769
1807
|
*/
|
|
1770
|
-
branch(name: string)
|
|
1808
|
+
branch: (name: string) => GitRef;
|
|
1771
1809
|
/**
|
|
1772
1810
|
* Returns details on one commit.
|
|
1773
1811
|
* @param id Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
|
|
1774
1812
|
*/
|
|
1775
|
-
commit(id: string)
|
|
1813
|
+
commit: (id: string) => GitRef;
|
|
1776
1814
|
/**
|
|
1777
1815
|
* Returns details on one tag.
|
|
1778
1816
|
* @param name Tag's name (e.g., "v0.3.9").
|
|
1779
1817
|
*/
|
|
1780
|
-
tag(name: string)
|
|
1818
|
+
tag: (name: string) => GitRef;
|
|
1781
1819
|
}
|
|
1782
1820
|
/**
|
|
1783
1821
|
* Information about the host execution environment.
|
|
@@ -1788,8 +1826,7 @@ export declare class Host extends BaseClient {
|
|
|
1788
1826
|
*/
|
|
1789
1827
|
constructor(parent?: {
|
|
1790
1828
|
queryTree?: QueryTree[];
|
|
1791
|
-
|
|
1792
|
-
sessionToken?: string;
|
|
1829
|
+
ctx: Context;
|
|
1793
1830
|
});
|
|
1794
1831
|
/**
|
|
1795
1832
|
* Accesses a directory on the host.
|
|
@@ -1797,12 +1834,12 @@ export declare class Host extends BaseClient {
|
|
|
1797
1834
|
* @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
|
|
1798
1835
|
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
|
|
1799
1836
|
*/
|
|
1800
|
-
directory(path: string, opts?: HostDirectoryOpts)
|
|
1837
|
+
directory: (path: string, opts?: HostDirectoryOpts) => Directory;
|
|
1801
1838
|
/**
|
|
1802
1839
|
* Accesses a file on the host.
|
|
1803
1840
|
* @param path Location of the file to retrieve (e.g., "README.md").
|
|
1804
1841
|
*/
|
|
1805
|
-
file(path: string)
|
|
1842
|
+
file: (path: string) => File;
|
|
1806
1843
|
/**
|
|
1807
1844
|
* Creates a service that forwards traffic to a specified address via the host.
|
|
1808
1845
|
* @param ports Ports to expose via the service, forwarding through the host network.
|
|
@@ -1813,14 +1850,14 @@ export declare class Host extends BaseClient {
|
|
|
1813
1850
|
* An empty set of ports is not valid; an error will be returned.
|
|
1814
1851
|
* @param opts.host Upstream host to forward traffic to.
|
|
1815
1852
|
*/
|
|
1816
|
-
service(ports: PortForward[], opts?: HostServiceOpts)
|
|
1853
|
+
service: (ports: PortForward[], opts?: HostServiceOpts) => Service;
|
|
1817
1854
|
/**
|
|
1818
1855
|
* Sets a secret given a user-defined name and the file path on the host, and returns the secret.
|
|
1819
1856
|
* The file is limited to a size of 512000 bytes.
|
|
1820
1857
|
* @param name The user defined name for this secret.
|
|
1821
1858
|
* @param path Location of the file to set as a secret.
|
|
1822
1859
|
*/
|
|
1823
|
-
setSecretFile(name: string, path: string)
|
|
1860
|
+
setSecretFile: (name: string, path: string) => Secret;
|
|
1824
1861
|
/**
|
|
1825
1862
|
* Creates a tunnel that forwards traffic from the host to a service.
|
|
1826
1863
|
* @param service Service to send traffic from the tunnel.
|
|
@@ -1839,12 +1876,12 @@ export declare class Host extends BaseClient {
|
|
|
1839
1876
|
*
|
|
1840
1877
|
* If ports are given and native is true, the ports are additive.
|
|
1841
1878
|
*/
|
|
1842
|
-
tunnel(service: Service, opts?: HostTunnelOpts)
|
|
1879
|
+
tunnel: (service: Service, opts?: HostTunnelOpts) => Service;
|
|
1843
1880
|
/**
|
|
1844
1881
|
* Accesses a Unix socket on the host.
|
|
1845
1882
|
* @param path Location of the Unix socket (e.g., "/var/run/docker.sock").
|
|
1846
1883
|
*/
|
|
1847
|
-
unixSocket(path: string)
|
|
1884
|
+
unixSocket: (path: string) => Socket;
|
|
1848
1885
|
}
|
|
1849
1886
|
/**
|
|
1850
1887
|
* A simple key value object that represents a label.
|
|
@@ -1857,17 +1894,16 @@ export declare class Label extends BaseClient {
|
|
|
1857
1894
|
*/
|
|
1858
1895
|
constructor(parent?: {
|
|
1859
1896
|
queryTree?: QueryTree[];
|
|
1860
|
-
|
|
1861
|
-
sessionToken?: string;
|
|
1897
|
+
ctx: Context;
|
|
1862
1898
|
}, _name?: string, _value?: string);
|
|
1863
1899
|
/**
|
|
1864
1900
|
* The label name.
|
|
1865
1901
|
*/
|
|
1866
|
-
name()
|
|
1902
|
+
name: () => Promise<string>;
|
|
1867
1903
|
/**
|
|
1868
1904
|
* The label value.
|
|
1869
1905
|
*/
|
|
1870
|
-
value()
|
|
1906
|
+
value: () => Promise<string>;
|
|
1871
1907
|
}
|
|
1872
1908
|
/**
|
|
1873
1909
|
* A definition of a list type in a Module.
|
|
@@ -1878,13 +1914,12 @@ export declare class ListTypeDef extends BaseClient {
|
|
|
1878
1914
|
*/
|
|
1879
1915
|
constructor(parent?: {
|
|
1880
1916
|
queryTree?: QueryTree[];
|
|
1881
|
-
|
|
1882
|
-
sessionToken?: string;
|
|
1917
|
+
ctx: Context;
|
|
1883
1918
|
});
|
|
1884
1919
|
/**
|
|
1885
1920
|
* The type of the elements in the list
|
|
1886
1921
|
*/
|
|
1887
|
-
elementTypeDef()
|
|
1922
|
+
elementTypeDef: () => TypeDef;
|
|
1888
1923
|
}
|
|
1889
1924
|
export declare class Module_ extends BaseClient {
|
|
1890
1925
|
private readonly _id?;
|
|
@@ -1898,65 +1933,64 @@ export declare class Module_ extends BaseClient {
|
|
|
1898
1933
|
*/
|
|
1899
1934
|
constructor(parent?: {
|
|
1900
1935
|
queryTree?: QueryTree[];
|
|
1901
|
-
|
|
1902
|
-
sessionToken?: string;
|
|
1936
|
+
ctx: Context;
|
|
1903
1937
|
}, _id?: ModuleID, _description?: string, _name?: string, _sdk?: string, _serve?: Void, _sourceDirectorySubPath?: string);
|
|
1904
1938
|
/**
|
|
1905
1939
|
* The ID of the module
|
|
1906
1940
|
*/
|
|
1907
|
-
id()
|
|
1941
|
+
id: () => Promise<ModuleID>;
|
|
1908
1942
|
/**
|
|
1909
1943
|
* Modules used by this module
|
|
1910
1944
|
*/
|
|
1911
|
-
dependencies()
|
|
1945
|
+
dependencies: () => Promise<Module_[]>;
|
|
1912
1946
|
/**
|
|
1913
1947
|
* The dependencies as configured by the module
|
|
1914
1948
|
*/
|
|
1915
|
-
dependencyConfig()
|
|
1949
|
+
dependencyConfig: () => Promise<string[]>;
|
|
1916
1950
|
/**
|
|
1917
1951
|
* The doc string of the module, if any
|
|
1918
1952
|
*/
|
|
1919
|
-
description()
|
|
1953
|
+
description: () => Promise<string>;
|
|
1920
1954
|
/**
|
|
1921
1955
|
* The code generated by the SDK's runtime
|
|
1922
1956
|
*/
|
|
1923
|
-
generatedCode()
|
|
1957
|
+
generatedCode: () => GeneratedCode;
|
|
1924
1958
|
/**
|
|
1925
1959
|
* The name of the module
|
|
1926
1960
|
*/
|
|
1927
|
-
name()
|
|
1961
|
+
name: () => Promise<string>;
|
|
1928
1962
|
/**
|
|
1929
1963
|
* Objects served by this module
|
|
1930
1964
|
*/
|
|
1931
|
-
objects()
|
|
1965
|
+
objects: () => Promise<TypeDef[]>;
|
|
1932
1966
|
/**
|
|
1933
1967
|
* The SDK used by this module. Either a name of a builtin SDK or a module ref pointing to the SDK's implementation.
|
|
1934
1968
|
*/
|
|
1935
|
-
sdk()
|
|
1969
|
+
sdk: () => Promise<string>;
|
|
1936
1970
|
/**
|
|
1937
1971
|
* Serve a module's API in the current session.
|
|
1938
1972
|
* Note: this can only be called once per session.
|
|
1939
1973
|
* In the future, it could return a stream or service to remove the side effect.
|
|
1940
1974
|
*/
|
|
1941
|
-
serve()
|
|
1975
|
+
serve: () => Promise<Void>;
|
|
1942
1976
|
/**
|
|
1943
1977
|
* The directory containing the module's source code
|
|
1944
1978
|
*/
|
|
1945
|
-
sourceDirectory()
|
|
1979
|
+
sourceDirectory: () => Directory;
|
|
1946
1980
|
/**
|
|
1947
1981
|
* The module's subpath within the source directory
|
|
1948
1982
|
*/
|
|
1949
|
-
sourceDirectorySubPath()
|
|
1983
|
+
sourceDirectorySubPath: () => Promise<string>;
|
|
1950
1984
|
/**
|
|
1951
1985
|
* This module plus the given Object type and associated functions
|
|
1952
1986
|
*/
|
|
1953
|
-
withObject(object: TypeDef)
|
|
1987
|
+
withObject: (object: TypeDef) => Module_;
|
|
1954
1988
|
/**
|
|
1955
1989
|
* Call the provided function with current Module.
|
|
1956
1990
|
*
|
|
1957
1991
|
* This is useful for reusability and readability by not breaking the calling chain.
|
|
1958
1992
|
*/
|
|
1959
|
-
with(arg: (param: Module_) => Module_)
|
|
1993
|
+
with: (arg: (param: Module_) => Module_) => Module_;
|
|
1960
1994
|
}
|
|
1961
1995
|
/**
|
|
1962
1996
|
* Static configuration for a module (e.g. parsed contents of dagger.json)
|
|
@@ -1970,33 +2004,32 @@ export declare class ModuleConfig extends BaseClient {
|
|
|
1970
2004
|
*/
|
|
1971
2005
|
constructor(parent?: {
|
|
1972
2006
|
queryTree?: QueryTree[];
|
|
1973
|
-
|
|
1974
|
-
sessionToken?: string;
|
|
2007
|
+
ctx: Context;
|
|
1975
2008
|
}, _name?: string, _root?: string, _sdk?: string);
|
|
1976
2009
|
/**
|
|
1977
2010
|
* Modules that this module depends on.
|
|
1978
2011
|
*/
|
|
1979
|
-
dependencies()
|
|
2012
|
+
dependencies: () => Promise<string[]>;
|
|
1980
2013
|
/**
|
|
1981
2014
|
* Exclude these file globs when loading the module root.
|
|
1982
2015
|
*/
|
|
1983
|
-
exclude()
|
|
2016
|
+
exclude: () => Promise<string[]>;
|
|
1984
2017
|
/**
|
|
1985
2018
|
* Include only these file globs when loading the module root.
|
|
1986
2019
|
*/
|
|
1987
|
-
include()
|
|
2020
|
+
include: () => Promise<string[]>;
|
|
1988
2021
|
/**
|
|
1989
2022
|
* The name of the module.
|
|
1990
2023
|
*/
|
|
1991
|
-
name()
|
|
2024
|
+
name: () => Promise<string>;
|
|
1992
2025
|
/**
|
|
1993
2026
|
* The root directory of the module's project, which may be above the module source code.
|
|
1994
2027
|
*/
|
|
1995
|
-
root()
|
|
2028
|
+
root: () => Promise<string>;
|
|
1996
2029
|
/**
|
|
1997
2030
|
* Either the name of a built-in SDK ('go', 'python', etc.) OR a module reference pointing to the SDK's module implementation.
|
|
1998
2031
|
*/
|
|
1999
|
-
sdk()
|
|
2032
|
+
sdk: () => Promise<string>;
|
|
2000
2033
|
}
|
|
2001
2034
|
/**
|
|
2002
2035
|
* A definition of a custom object defined in a Module.
|
|
@@ -2009,25 +2042,28 @@ export declare class ObjectTypeDef extends BaseClient {
|
|
|
2009
2042
|
*/
|
|
2010
2043
|
constructor(parent?: {
|
|
2011
2044
|
queryTree?: QueryTree[];
|
|
2012
|
-
|
|
2013
|
-
sessionToken?: string;
|
|
2045
|
+
ctx: Context;
|
|
2014
2046
|
}, _description?: string, _name?: string);
|
|
2047
|
+
/**
|
|
2048
|
+
* The function used to construct new instances of this object, if any
|
|
2049
|
+
*/
|
|
2050
|
+
constructor_: () => Function_;
|
|
2015
2051
|
/**
|
|
2016
2052
|
* The doc string for the object, if any
|
|
2017
2053
|
*/
|
|
2018
|
-
description()
|
|
2054
|
+
description: () => Promise<string>;
|
|
2019
2055
|
/**
|
|
2020
2056
|
* Static fields defined on this object, if any
|
|
2021
2057
|
*/
|
|
2022
|
-
fields()
|
|
2058
|
+
fields: () => Promise<FieldTypeDef[]>;
|
|
2023
2059
|
/**
|
|
2024
2060
|
* Functions defined on this object, if any
|
|
2025
2061
|
*/
|
|
2026
|
-
functions()
|
|
2062
|
+
functions: () => Promise<Function_[]>;
|
|
2027
2063
|
/**
|
|
2028
2064
|
* The name of the object
|
|
2029
2065
|
*/
|
|
2030
|
-
name()
|
|
2066
|
+
name: () => Promise<string>;
|
|
2031
2067
|
}
|
|
2032
2068
|
/**
|
|
2033
2069
|
* A port exposed by a container.
|
|
@@ -2041,21 +2077,20 @@ export declare class Port extends BaseClient {
|
|
|
2041
2077
|
*/
|
|
2042
2078
|
constructor(parent?: {
|
|
2043
2079
|
queryTree?: QueryTree[];
|
|
2044
|
-
|
|
2045
|
-
sessionToken?: string;
|
|
2080
|
+
ctx: Context;
|
|
2046
2081
|
}, _description?: string, _port?: number, _protocol?: NetworkProtocol);
|
|
2047
2082
|
/**
|
|
2048
2083
|
* The port description.
|
|
2049
2084
|
*/
|
|
2050
|
-
description()
|
|
2085
|
+
description: () => Promise<string>;
|
|
2051
2086
|
/**
|
|
2052
2087
|
* The port number.
|
|
2053
2088
|
*/
|
|
2054
|
-
port()
|
|
2089
|
+
port: () => Promise<number>;
|
|
2055
2090
|
/**
|
|
2056
2091
|
* The transport layer network protocol.
|
|
2057
2092
|
*/
|
|
2058
|
-
protocol()
|
|
2093
|
+
protocol: () => Promise<NetworkProtocol>;
|
|
2059
2094
|
}
|
|
2060
2095
|
export declare class Client extends BaseClient {
|
|
2061
2096
|
private readonly _checkVersionCompatibility?;
|
|
@@ -2065,169 +2100,176 @@ export declare class Client extends BaseClient {
|
|
|
2065
2100
|
*/
|
|
2066
2101
|
constructor(parent?: {
|
|
2067
2102
|
queryTree?: QueryTree[];
|
|
2068
|
-
|
|
2069
|
-
sessionToken?: string;
|
|
2103
|
+
ctx: Context;
|
|
2070
2104
|
}, _checkVersionCompatibility?: boolean, _defaultPlatform?: Platform);
|
|
2071
2105
|
/**
|
|
2072
2106
|
* Constructs a cache volume for a given cache key.
|
|
2073
2107
|
* @param key A string identifier to target this cache volume (e.g., "modules-cache").
|
|
2074
2108
|
*/
|
|
2075
|
-
cacheVolume(key: string)
|
|
2109
|
+
cacheVolume: (key: string) => CacheVolume;
|
|
2076
2110
|
/**
|
|
2077
2111
|
* Checks if the current Dagger Engine is compatible with an SDK's required version.
|
|
2078
2112
|
* @param version The SDK's required version.
|
|
2079
2113
|
*/
|
|
2080
|
-
checkVersionCompatibility(version: string)
|
|
2114
|
+
checkVersionCompatibility: (version: string) => Promise<boolean>;
|
|
2081
2115
|
/**
|
|
2082
2116
|
* Creates a scratch container or loads one by ID.
|
|
2083
2117
|
*
|
|
2084
2118
|
* Optional platform argument initializes new containers to execute and publish
|
|
2085
2119
|
* as that platform. Platform defaults to that of the builder's host.
|
|
2086
2120
|
*/
|
|
2087
|
-
container(opts?: ClientContainerOpts)
|
|
2121
|
+
container: (opts?: ClientContainerOpts) => Container;
|
|
2088
2122
|
/**
|
|
2089
2123
|
* The FunctionCall context that the SDK caller is currently executing in.
|
|
2090
2124
|
* If the caller is not currently executing in a function, this will return
|
|
2091
2125
|
* an error.
|
|
2092
2126
|
*/
|
|
2093
|
-
currentFunctionCall()
|
|
2127
|
+
currentFunctionCall: () => FunctionCall;
|
|
2094
2128
|
/**
|
|
2095
2129
|
* The module currently being served in the session, if any.
|
|
2096
2130
|
*/
|
|
2097
|
-
currentModule()
|
|
2131
|
+
currentModule: () => Module_;
|
|
2098
2132
|
/**
|
|
2099
2133
|
* The default platform of the builder.
|
|
2100
2134
|
*/
|
|
2101
|
-
defaultPlatform()
|
|
2135
|
+
defaultPlatform: () => Promise<Platform>;
|
|
2102
2136
|
/**
|
|
2103
2137
|
* Creates an empty directory or loads one by ID.
|
|
2104
2138
|
*/
|
|
2105
|
-
directory(opts?: ClientDirectoryOpts)
|
|
2139
|
+
directory: (opts?: ClientDirectoryOpts) => Directory;
|
|
2106
2140
|
/**
|
|
2107
2141
|
* Loads a file by ID.
|
|
2108
2142
|
* @deprecated Use loadFileFromID instead.
|
|
2109
2143
|
*/
|
|
2110
|
-
file(id: FileID)
|
|
2144
|
+
file: (id: FileID) => File;
|
|
2111
2145
|
/**
|
|
2112
2146
|
* Create a function.
|
|
2113
2147
|
*/
|
|
2114
|
-
function_(name: string, returnType: TypeDef)
|
|
2148
|
+
function_: (name: string, returnType: TypeDef) => Function_;
|
|
2115
2149
|
/**
|
|
2116
2150
|
* Create a code generation result, given a directory containing the generated
|
|
2117
2151
|
* code.
|
|
2118
2152
|
*/
|
|
2119
|
-
generatedCode(code: Directory)
|
|
2153
|
+
generatedCode: (code: Directory) => GeneratedCode;
|
|
2120
2154
|
/**
|
|
2121
2155
|
* Queries a git repository.
|
|
2122
2156
|
* @param url Url of the git repository.
|
|
2123
|
-
* Can be formatted as https://{host}/{owner}/{repo}
|
|
2157
|
+
* Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`
|
|
2124
2158
|
* Suffix ".git" is optional.
|
|
2125
2159
|
* @param opts.keepGitDir Set to true to keep .git directory.
|
|
2126
2160
|
* @param opts.sshKnownHosts Set SSH known hosts
|
|
2127
2161
|
* @param opts.sshAuthSocket Set SSH auth socket
|
|
2128
2162
|
* @param opts.experimentalServiceHost A service which must be started before the repo is fetched.
|
|
2129
2163
|
*/
|
|
2130
|
-
git(url: string, opts?: ClientGitOpts)
|
|
2164
|
+
git: (url: string, opts?: ClientGitOpts) => GitRepository;
|
|
2131
2165
|
/**
|
|
2132
2166
|
* Queries the host environment.
|
|
2133
2167
|
*/
|
|
2134
|
-
host()
|
|
2168
|
+
host: () => Host;
|
|
2135
2169
|
/**
|
|
2136
2170
|
* Returns a file containing an http remote url content.
|
|
2137
2171
|
* @param url HTTP url to get the content from (e.g., "https://docs.dagger.io").
|
|
2138
2172
|
* @param opts.experimentalServiceHost A service which must be started before the URL is fetched.
|
|
2139
2173
|
*/
|
|
2140
|
-
http(url: string, opts?: ClientHttpOpts)
|
|
2174
|
+
http: (url: string, opts?: ClientHttpOpts) => File;
|
|
2141
2175
|
/**
|
|
2142
2176
|
* Load a CacheVolume from its ID.
|
|
2143
2177
|
*/
|
|
2144
|
-
loadCacheVolumeFromID(id: CacheVolumeID)
|
|
2178
|
+
loadCacheVolumeFromID: (id: CacheVolumeID) => CacheVolume;
|
|
2145
2179
|
/**
|
|
2146
2180
|
* Loads a container from an ID.
|
|
2147
2181
|
*/
|
|
2148
|
-
loadContainerFromID(id: ContainerID)
|
|
2182
|
+
loadContainerFromID: (id: ContainerID) => Container;
|
|
2149
2183
|
/**
|
|
2150
2184
|
* Load a Directory from its ID.
|
|
2151
2185
|
*/
|
|
2152
|
-
loadDirectoryFromID(id: DirectoryID)
|
|
2186
|
+
loadDirectoryFromID: (id: DirectoryID) => Directory;
|
|
2153
2187
|
/**
|
|
2154
2188
|
* Load a File from its ID.
|
|
2155
2189
|
*/
|
|
2156
|
-
loadFileFromID(id: FileID)
|
|
2190
|
+
loadFileFromID: (id: FileID) => File;
|
|
2157
2191
|
/**
|
|
2158
2192
|
* Load a function argument by ID.
|
|
2159
2193
|
*/
|
|
2160
|
-
loadFunctionArgFromID(id: FunctionArgID)
|
|
2194
|
+
loadFunctionArgFromID: (id: FunctionArgID) => FunctionArg;
|
|
2161
2195
|
/**
|
|
2162
2196
|
* Load a function by ID.
|
|
2163
2197
|
*/
|
|
2164
|
-
loadFunctionFromID(id: FunctionID)
|
|
2198
|
+
loadFunctionFromID: (id: FunctionID) => Function_;
|
|
2165
2199
|
/**
|
|
2166
2200
|
* Load a GeneratedCode by ID.
|
|
2167
2201
|
*/
|
|
2168
|
-
loadGeneratedCodeFromID(id: GeneratedCodeID)
|
|
2202
|
+
loadGeneratedCodeFromID: (id: GeneratedCodeID) => GeneratedCode;
|
|
2203
|
+
/**
|
|
2204
|
+
* Load a git ref from its ID.
|
|
2205
|
+
*/
|
|
2206
|
+
loadGitRefFromID: (id: GitRefID) => GitRef;
|
|
2207
|
+
/**
|
|
2208
|
+
* Load a git repository from its ID.
|
|
2209
|
+
*/
|
|
2210
|
+
loadGitRepositoryFromID: (id: GitRepositoryID) => GitRepository;
|
|
2169
2211
|
/**
|
|
2170
2212
|
* Load a module by ID.
|
|
2171
2213
|
*/
|
|
2172
|
-
loadModuleFromID(id: ModuleID)
|
|
2214
|
+
loadModuleFromID: (id: ModuleID) => Module_;
|
|
2173
2215
|
/**
|
|
2174
2216
|
* Load a Secret from its ID.
|
|
2175
2217
|
*/
|
|
2176
|
-
loadSecretFromID(id: SecretID)
|
|
2218
|
+
loadSecretFromID: (id: SecretID) => Secret;
|
|
2177
2219
|
/**
|
|
2178
2220
|
* Loads a service from ID.
|
|
2179
2221
|
*/
|
|
2180
|
-
loadServiceFromID(id: ServiceID)
|
|
2222
|
+
loadServiceFromID: (id: ServiceID) => Service;
|
|
2181
2223
|
/**
|
|
2182
2224
|
* Load a Socket from its ID.
|
|
2183
2225
|
*/
|
|
2184
|
-
loadSocketFromID(id: SocketID)
|
|
2226
|
+
loadSocketFromID: (id: SocketID) => Socket;
|
|
2185
2227
|
/**
|
|
2186
2228
|
* Load a TypeDef by ID.
|
|
2187
2229
|
*/
|
|
2188
|
-
loadTypeDefFromID(id: TypeDefID)
|
|
2230
|
+
loadTypeDefFromID: (id: TypeDefID) => TypeDef;
|
|
2189
2231
|
/**
|
|
2190
2232
|
* Create a new module.
|
|
2191
2233
|
*/
|
|
2192
|
-
module_()
|
|
2234
|
+
module_: () => Module_;
|
|
2193
2235
|
/**
|
|
2194
2236
|
* Load the static configuration for a module from the given source directory and optional subpath.
|
|
2195
2237
|
*/
|
|
2196
|
-
moduleConfig(sourceDirectory: Directory, opts?: ClientModuleConfigOpts)
|
|
2238
|
+
moduleConfig: (sourceDirectory: Directory, opts?: ClientModuleConfigOpts) => ModuleConfig;
|
|
2197
2239
|
/**
|
|
2198
2240
|
* Creates a named sub-pipeline.
|
|
2199
2241
|
* @param name Pipeline name.
|
|
2200
2242
|
* @param opts.description Pipeline description.
|
|
2201
2243
|
* @param opts.labels Pipeline labels.
|
|
2202
2244
|
*/
|
|
2203
|
-
pipeline(name: string, opts?: ClientPipelineOpts)
|
|
2245
|
+
pipeline: (name: string, opts?: ClientPipelineOpts) => Client;
|
|
2204
2246
|
/**
|
|
2205
2247
|
* Loads a secret from its ID.
|
|
2206
2248
|
* @deprecated Use loadSecretFromID instead
|
|
2207
2249
|
*/
|
|
2208
|
-
secret(id: SecretID)
|
|
2250
|
+
secret: (id: SecretID) => Secret;
|
|
2209
2251
|
/**
|
|
2210
2252
|
* Sets a secret given a user defined name to its plaintext and returns the secret.
|
|
2211
2253
|
* The plaintext value is limited to a size of 128000 bytes.
|
|
2212
2254
|
* @param name The user defined name for this secret
|
|
2213
2255
|
* @param plaintext The plaintext of the secret
|
|
2214
2256
|
*/
|
|
2215
|
-
setSecret(name: string, plaintext: string)
|
|
2257
|
+
setSecret: (name: string, plaintext: string) => Secret;
|
|
2216
2258
|
/**
|
|
2217
2259
|
* Loads a socket by its ID.
|
|
2218
2260
|
* @deprecated Use loadSocketFromID instead.
|
|
2219
2261
|
*/
|
|
2220
|
-
socket(opts?: ClientSocketOpts)
|
|
2262
|
+
socket: (opts?: ClientSocketOpts) => Socket;
|
|
2221
2263
|
/**
|
|
2222
2264
|
* Create a new TypeDef.
|
|
2223
2265
|
*/
|
|
2224
|
-
typeDef()
|
|
2266
|
+
typeDef: () => TypeDef;
|
|
2225
2267
|
/**
|
|
2226
2268
|
* Call the provided function with current Client.
|
|
2227
2269
|
*
|
|
2228
2270
|
* This is useful for reusability and readability by not breaking the calling chain.
|
|
2229
2271
|
*/
|
|
2230
|
-
with(arg: (param: Client) => Client)
|
|
2272
|
+
with: (arg: (param: Client) => Client) => Client;
|
|
2231
2273
|
}
|
|
2232
2274
|
/**
|
|
2233
2275
|
* A reference to a secret value, which can be handled more safely than the value itself.
|
|
@@ -2240,17 +2282,16 @@ export declare class Secret extends BaseClient {
|
|
|
2240
2282
|
*/
|
|
2241
2283
|
constructor(parent?: {
|
|
2242
2284
|
queryTree?: QueryTree[];
|
|
2243
|
-
|
|
2244
|
-
sessionToken?: string;
|
|
2285
|
+
ctx: Context;
|
|
2245
2286
|
}, _id?: SecretID, _plaintext?: string);
|
|
2246
2287
|
/**
|
|
2247
2288
|
* The identifier for this secret.
|
|
2248
2289
|
*/
|
|
2249
|
-
id()
|
|
2290
|
+
id: () => Promise<SecretID>;
|
|
2250
2291
|
/**
|
|
2251
2292
|
* The value of this secret.
|
|
2252
2293
|
*/
|
|
2253
|
-
plaintext()
|
|
2294
|
+
plaintext: () => Promise<string>;
|
|
2254
2295
|
}
|
|
2255
2296
|
export declare class Service extends BaseClient {
|
|
2256
2297
|
private readonly _id?;
|
|
@@ -2263,13 +2304,12 @@ export declare class Service extends BaseClient {
|
|
|
2263
2304
|
*/
|
|
2264
2305
|
constructor(parent?: {
|
|
2265
2306
|
queryTree?: QueryTree[];
|
|
2266
|
-
|
|
2267
|
-
sessionToken?: string;
|
|
2307
|
+
ctx: Context;
|
|
2268
2308
|
}, _id?: ServiceID, _endpoint?: string, _hostname?: string, _start?: ServiceID, _stop?: ServiceID);
|
|
2269
2309
|
/**
|
|
2270
2310
|
* A unique identifier for this service.
|
|
2271
2311
|
*/
|
|
2272
|
-
id()
|
|
2312
|
+
id: () => Promise<ServiceID>;
|
|
2273
2313
|
/**
|
|
2274
2314
|
* Retrieves an endpoint that clients can use to reach this container.
|
|
2275
2315
|
*
|
|
@@ -2279,25 +2319,25 @@ export declare class Service extends BaseClient {
|
|
|
2279
2319
|
* @param opts.port The exposed port number for the endpoint
|
|
2280
2320
|
* @param opts.scheme Return a URL with the given scheme, eg. http for http://
|
|
2281
2321
|
*/
|
|
2282
|
-
endpoint(opts?: ServiceEndpointOpts)
|
|
2322
|
+
endpoint: (opts?: ServiceEndpointOpts) => Promise<string>;
|
|
2283
2323
|
/**
|
|
2284
2324
|
* Retrieves a hostname which can be used by clients to reach this container.
|
|
2285
2325
|
*/
|
|
2286
|
-
hostname()
|
|
2326
|
+
hostname: () => Promise<string>;
|
|
2287
2327
|
/**
|
|
2288
2328
|
* Retrieves the list of ports provided by the service.
|
|
2289
2329
|
*/
|
|
2290
|
-
ports()
|
|
2330
|
+
ports: () => Promise<Port[]>;
|
|
2291
2331
|
/**
|
|
2292
2332
|
* Start the service and wait for its health checks to succeed.
|
|
2293
2333
|
*
|
|
2294
2334
|
* Services bound to a Container do not need to be manually started.
|
|
2295
2335
|
*/
|
|
2296
|
-
start()
|
|
2336
|
+
start: () => Promise<Service>;
|
|
2297
2337
|
/**
|
|
2298
2338
|
* Stop the service.
|
|
2299
2339
|
*/
|
|
2300
|
-
stop()
|
|
2340
|
+
stop: () => Promise<Service>;
|
|
2301
2341
|
}
|
|
2302
2342
|
export declare class Socket extends BaseClient {
|
|
2303
2343
|
private readonly _id?;
|
|
@@ -2306,13 +2346,12 @@ export declare class Socket extends BaseClient {
|
|
|
2306
2346
|
*/
|
|
2307
2347
|
constructor(parent?: {
|
|
2308
2348
|
queryTree?: QueryTree[];
|
|
2309
|
-
|
|
2310
|
-
sessionToken?: string;
|
|
2349
|
+
ctx: Context;
|
|
2311
2350
|
}, _id?: SocketID);
|
|
2312
2351
|
/**
|
|
2313
2352
|
* The content-addressed identifier of the socket.
|
|
2314
2353
|
*/
|
|
2315
|
-
id()
|
|
2354
|
+
id: () => Promise<SocketID>;
|
|
2316
2355
|
}
|
|
2317
2356
|
/**
|
|
2318
2357
|
* A definition of a parameter or return type in a Module.
|
|
@@ -2326,47 +2365,50 @@ export declare class TypeDef extends BaseClient {
|
|
|
2326
2365
|
*/
|
|
2327
2366
|
constructor(parent?: {
|
|
2328
2367
|
queryTree?: QueryTree[];
|
|
2329
|
-
|
|
2330
|
-
sessionToken?: string;
|
|
2368
|
+
ctx: Context;
|
|
2331
2369
|
}, _id?: TypeDefID, _kind?: TypeDefKind, _optional?: boolean);
|
|
2332
|
-
id()
|
|
2370
|
+
id: () => Promise<TypeDefID>;
|
|
2333
2371
|
/**
|
|
2334
2372
|
* If kind is LIST, the list-specific type definition.
|
|
2335
2373
|
* If kind is not LIST, this will be null.
|
|
2336
2374
|
*/
|
|
2337
|
-
asList()
|
|
2375
|
+
asList: () => ListTypeDef;
|
|
2338
2376
|
/**
|
|
2339
2377
|
* If kind is OBJECT, the object-specific type definition.
|
|
2340
2378
|
* If kind is not OBJECT, this will be null.
|
|
2341
2379
|
*/
|
|
2342
|
-
asObject()
|
|
2380
|
+
asObject: () => ObjectTypeDef;
|
|
2343
2381
|
/**
|
|
2344
2382
|
* The kind of type this is (e.g. primitive, list, object)
|
|
2345
2383
|
*/
|
|
2346
|
-
kind()
|
|
2384
|
+
kind: () => Promise<TypeDefKind>;
|
|
2347
2385
|
/**
|
|
2348
2386
|
* Whether this type can be set to null. Defaults to false.
|
|
2349
2387
|
*/
|
|
2350
|
-
optional()
|
|
2388
|
+
optional: () => Promise<boolean>;
|
|
2389
|
+
/**
|
|
2390
|
+
* Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.
|
|
2391
|
+
*/
|
|
2392
|
+
withConstructor: (function_: Function_) => TypeDef;
|
|
2351
2393
|
/**
|
|
2352
2394
|
* Adds a static field for an Object TypeDef, failing if the type is not an object.
|
|
2353
2395
|
* @param name The name of the field in the object
|
|
2354
2396
|
* @param typeDef The type of the field
|
|
2355
2397
|
* @param opts.description A doc string for the field, if any
|
|
2356
2398
|
*/
|
|
2357
|
-
withField(name: string, typeDef: TypeDef, opts?: TypeDefWithFieldOpts)
|
|
2399
|
+
withField: (name: string, typeDef: TypeDef, opts?: TypeDefWithFieldOpts) => TypeDef;
|
|
2358
2400
|
/**
|
|
2359
2401
|
* Adds a function for an Object TypeDef, failing if the type is not an object.
|
|
2360
2402
|
*/
|
|
2361
|
-
withFunction(function_: Function_)
|
|
2403
|
+
withFunction: (function_: Function_) => TypeDef;
|
|
2362
2404
|
/**
|
|
2363
2405
|
* Sets the kind of the type.
|
|
2364
2406
|
*/
|
|
2365
|
-
withKind(kind: TypeDefKind)
|
|
2407
|
+
withKind: (kind: TypeDefKind) => TypeDef;
|
|
2366
2408
|
/**
|
|
2367
2409
|
* Returns a TypeDef of kind List with the provided type for its elements.
|
|
2368
2410
|
*/
|
|
2369
|
-
withListOf(elementType: TypeDef)
|
|
2411
|
+
withListOf: (elementType: TypeDef) => TypeDef;
|
|
2370
2412
|
/**
|
|
2371
2413
|
* Returns a TypeDef of kind Object with the provided name.
|
|
2372
2414
|
*
|
|
@@ -2374,17 +2416,18 @@ export declare class TypeDef extends BaseClient {
|
|
|
2374
2416
|
* only to refer to an object. This is how functions are able to return their
|
|
2375
2417
|
* own object, or any other circular reference.
|
|
2376
2418
|
*/
|
|
2377
|
-
withObject(name: string, opts?: TypeDefWithObjectOpts)
|
|
2419
|
+
withObject: (name: string, opts?: TypeDefWithObjectOpts) => TypeDef;
|
|
2378
2420
|
/**
|
|
2379
2421
|
* Sets whether this type can be set to null.
|
|
2380
2422
|
*/
|
|
2381
|
-
withOptional(optional: boolean)
|
|
2423
|
+
withOptional: (optional: boolean) => TypeDef;
|
|
2382
2424
|
/**
|
|
2383
2425
|
* Call the provided function with current TypeDef.
|
|
2384
2426
|
*
|
|
2385
2427
|
* This is useful for reusability and readability by not breaking the calling chain.
|
|
2386
2428
|
*/
|
|
2387
|
-
with(arg: (param: TypeDef) => TypeDef)
|
|
2429
|
+
with: (arg: (param: TypeDef) => TypeDef) => TypeDef;
|
|
2388
2430
|
}
|
|
2431
|
+
export declare const dag: Client;
|
|
2389
2432
|
export {};
|
|
2390
2433
|
//# sourceMappingURL=client.gen.d.ts.map
|