@dagger.io/dagger 0.19.2 → 0.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/src/api/client.gen.d.ts +131 -2
  2. package/dist/src/api/client.gen.d.ts.map +1 -1
  3. package/dist/src/api/client.gen.js +232 -2
  4. package/dist/src/module/decorators.d.ts.map +1 -1
  5. package/dist/src/module/entrypoint/entrypoint.d.ts.map +1 -1
  6. package/dist/src/module/entrypoint/entrypoint.js +1 -1
  7. package/dist/src/module/entrypoint/introspection_entrypoint.d.ts +2 -0
  8. package/dist/src/module/entrypoint/introspection_entrypoint.d.ts.map +1 -0
  9. package/dist/src/module/entrypoint/introspection_entrypoint.js +52 -0
  10. package/dist/src/module/entrypoint/register.d.ts.map +1 -1
  11. package/dist/src/module/entrypoint/register.js +20 -2
  12. package/dist/src/module/introspector/dagger_module/function.d.ts +2 -2
  13. package/dist/src/module/introspector/dagger_module/function.d.ts.map +1 -1
  14. package/dist/src/module/introspector/dagger_module/function.js +14 -9
  15. package/dist/src/module/introspector/dagger_module/interfaceFunction.d.ts +2 -1
  16. package/dist/src/module/introspector/dagger_module/interfaceFunction.d.ts.map +1 -1
  17. package/dist/src/module/introspector/dagger_module/interfaceFunction.js +3 -2
  18. package/dist/src/module/introspector/dagger_module/module.d.ts.map +1 -1
  19. package/dist/src/module/introspector/dagger_module/module.js +1 -5
  20. package/dist/src/module/introspector/index.d.ts +1 -1
  21. package/dist/src/module/introspector/index.d.ts.map +1 -1
  22. package/dist/src/module/introspector/index.js +5 -2
  23. package/dist/src/module/introspector/typescript_module/ast.d.ts +1 -0
  24. package/dist/src/module/introspector/typescript_module/ast.d.ts.map +1 -1
  25. package/dist/src/module/introspector/typescript_module/ast.js +76 -16
  26. package/dist/src/module/introspector/typescript_module/index.d.ts +0 -1
  27. package/dist/src/module/introspector/typescript_module/index.d.ts.map +1 -1
  28. package/dist/src/module/introspector/typescript_module/index.js +0 -1
  29. package/dist/src/module/registry.d.ts +14 -0
  30. package/dist/src/module/registry.d.ts.map +1 -1
  31. package/dist/src/provisioning/default.d.ts +1 -1
  32. package/dist/src/provisioning/default.js +1 -1
  33. package/package.json +15 -15
  34. package/dist/src/module/introspector/typescript_module/explorer.d.ts +0 -4
  35. package/dist/src/module/introspector/typescript_module/explorer.d.ts.map +0 -1
  36. package/dist/src/module/introspector/typescript_module/explorer.js +0 -16
@@ -17,11 +17,13 @@ declare class BaseClient {
17
17
  export type AddressDirectoryOpts = {
18
18
  exclude?: string[];
19
19
  include?: string[];
20
+ gitignore?: boolean;
20
21
  noCache?: boolean;
21
22
  };
22
23
  export type AddressFileOpts = {
23
24
  exclude?: string[];
24
25
  include?: string[];
26
+ gitignore?: boolean;
25
27
  noCache?: boolean;
26
28
  };
27
29
  /**
@@ -296,6 +298,10 @@ export type ContainerWithDirectoryOpts = {
296
298
  * Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
297
299
  */
298
300
  include?: string[];
301
+ /**
302
+ * Apply .gitignore rules when writing the directory.
303
+ */
304
+ gitignore?: boolean;
299
305
  /**
300
306
  * A user:group to set for the directory and its contents.
301
307
  *
@@ -600,6 +606,10 @@ export type CurrentModuleWorkdirOpts = {
600
606
  * Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
601
607
  */
602
608
  include?: string[];
609
+ /**
610
+ * Apply .gitignore filter rules inside the directory
611
+ */
612
+ gitignore?: boolean;
603
613
  };
604
614
  /**
605
615
  * The `CurrentModuleID` scalar type represents an identifier for an object of type CurrentModule.
@@ -684,6 +694,10 @@ export type DirectoryFilterOpts = {
684
694
  * If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
685
695
  */
686
696
  include?: string[];
697
+ /**
698
+ * If set, apply .gitignore rules when filtering the directory.
699
+ */
700
+ gitignore?: boolean;
687
701
  };
688
702
  export type DirectorySearchOpts = {
689
703
  /**
@@ -758,6 +772,10 @@ export type DirectoryWithDirectoryOpts = {
758
772
  * Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
759
773
  */
760
774
  include?: string[];
775
+ /**
776
+ * Apply .gitignore filter rules inside the directory
777
+ */
778
+ gitignore?: boolean;
761
779
  /**
762
780
  * A user:group to set for the copied directory and its contents.
763
781
  *
@@ -1017,12 +1035,26 @@ export type FunctionWithArgOpts = {
1017
1035
  */
1018
1036
  sourceMap?: SourceMap;
1019
1037
  };
1038
+ export type FunctionWithCachePolicyOpts = {
1039
+ /**
1040
+ * The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
1041
+ */
1042
+ timeToLive?: string;
1043
+ };
1020
1044
  /**
1021
1045
  * The `FunctionArgID` scalar type represents an identifier for an object of type FunctionArg.
1022
1046
  */
1023
1047
  export type FunctionArgID = string & {
1024
1048
  __FunctionArgID: never;
1025
1049
  };
1050
+ /**
1051
+ * The behavior configured for function result caching.
1052
+ */
1053
+ export declare enum FunctionCachePolicy {
1054
+ Default = "Default",
1055
+ Never = "Never",
1056
+ PerSession = "PerSession"
1057
+ }
1026
1058
  /**
1027
1059
  * The `FunctionCallArgValueID` scalar type represents an identifier for an object of type FunctionCallArgValue.
1028
1060
  */
@@ -1233,6 +1265,15 @@ export type ModuleConfigClientID = string & {
1233
1265
  export type ModuleID = string & {
1234
1266
  __ModuleID: never;
1235
1267
  };
1268
+ /**
1269
+ * Experimental features of a module
1270
+ */
1271
+ export declare enum ModuleSourceExperimentalFeature {
1272
+ /**
1273
+ * Self calls
1274
+ */
1275
+ SelfCalls = "SELF_CALLS"
1276
+ }
1236
1277
  /**
1237
1278
  * The `ModuleSourceID` scalar type represents an identifier for an object of type ModuleSource.
1238
1279
  */
@@ -1901,11 +1942,12 @@ export declare class CacheVolume extends BaseClient {
1901
1942
  export declare class Changeset extends BaseClient {
1902
1943
  private readonly _id?;
1903
1944
  private readonly _export?;
1945
+ private readonly _isEmpty?;
1904
1946
  private readonly _sync?;
1905
1947
  /**
1906
1948
  * Constructor is used for internal usage only, do not create object from it.
1907
1949
  */
1908
- constructor(ctx?: Context, _id?: ChangesetID, _export?: string, _sync?: ChangesetID);
1950
+ constructor(ctx?: Context, _id?: ChangesetID, _export?: string, _isEmpty?: boolean, _sync?: ChangesetID);
1909
1951
  /**
1910
1952
  * A unique identifier for this Changeset.
1911
1953
  */
@@ -1931,6 +1973,10 @@ export declare class Changeset extends BaseClient {
1931
1973
  * @param path Location of the copied directory (e.g., "logs/").
1932
1974
  */
1933
1975
  export: (path: string) => Promise<string>;
1976
+ /**
1977
+ * Returns true if the changeset is empty (i.e. there are no changes).
1978
+ */
1979
+ isEmpty: () => Promise<boolean>;
1934
1980
  /**
1935
1981
  * Return a snapshot containing only the created and modified files
1936
1982
  */
@@ -2260,6 +2306,7 @@ export declare class Container extends BaseClient {
2260
2306
  * @param source Identifier of the directory to write
2261
2307
  * @param opts.exclude Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
2262
2308
  * @param opts.include Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
2309
+ * @param opts.gitignore Apply .gitignore rules when writing the directory.
2263
2310
  * @param opts.owner A user:group to set for the directory and its contents.
2264
2311
  *
2265
2312
  * The user and group can either be an ID (1000:1000) or a name (foo:bar).
@@ -2281,6 +2328,11 @@ export declare class Container extends BaseClient {
2281
2328
  * @param opts.expand Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
2282
2329
  */
2283
2330
  withEnvVariable: (name: string, value: string, opts?: ContainerWithEnvVariableOpts) => Container;
2331
+ /**
2332
+ * Raise an error.
2333
+ * @param err Message of the error to raise. If empty, the error will be ignored.
2334
+ */
2335
+ withError: (err: string) => Container;
2284
2336
  /**
2285
2337
  * Execute a command in the container, and return a new snapshot of the container state after execution.
2286
2338
  * @param args Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
@@ -2607,6 +2659,7 @@ export declare class CurrentModule extends BaseClient {
2607
2659
  * @param path Location of the directory to access (e.g., ".").
2608
2660
  * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
2609
2661
  * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
2662
+ * @param opts.gitignore Apply .gitignore filter rules inside the directory
2610
2663
  */
2611
2664
  workdir: (path: string, opts?: CurrentModuleWorkdirOpts) => Directory;
2612
2665
  /**
@@ -2724,6 +2777,7 @@ export declare class Directory extends BaseClient {
2724
2777
  * Return a snapshot with some paths included or excluded
2725
2778
  * @param opts.exclude If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
2726
2779
  * @param opts.include If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
2780
+ * @param opts.gitignore If set, apply .gitignore rules when filtering the directory.
2727
2781
  */
2728
2782
  filter: (opts?: DirectoryFilterOpts) => Directory;
2729
2783
  /**
@@ -2781,6 +2835,7 @@ export declare class Directory extends BaseClient {
2781
2835
  * @param source Identifier of the directory to copy.
2782
2836
  * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
2783
2837
  * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
2838
+ * @param opts.gitignore Apply .gitignore filter rules inside the directory
2784
2839
  * @param opts.owner A user:group to set for the copied directory and its contents.
2785
2840
  *
2786
2841
  * The user and group must be an ID (1000:1000), not a name (foo:bar).
@@ -2788,6 +2843,11 @@ export declare class Directory extends BaseClient {
2788
2843
  * If the group is omitted, it defaults to the same as the user.
2789
2844
  */
2790
2845
  withDirectory: (path: string, source: Directory, opts?: DirectoryWithDirectoryOpts) => Directory;
2846
+ /**
2847
+ * Raise an error.
2848
+ * @param err Message of the error to raise. If empty, the error will be ignored.
2849
+ */
2850
+ withError: (err: string) => Directory;
2791
2851
  /**
2792
2852
  * Retrieves this directory plus the contents of the given file copied to the given path.
2793
2853
  * @param path Location of the copied file (e.g., "/file.txt").
@@ -2872,18 +2932,27 @@ export declare class Directory extends BaseClient {
2872
2932
  */
2873
2933
  export declare class Engine extends BaseClient {
2874
2934
  private readonly _id?;
2935
+ private readonly _name?;
2875
2936
  /**
2876
2937
  * Constructor is used for internal usage only, do not create object from it.
2877
2938
  */
2878
- constructor(ctx?: Context, _id?: EngineID);
2939
+ constructor(ctx?: Context, _id?: EngineID, _name?: string);
2879
2940
  /**
2880
2941
  * A unique identifier for this Engine.
2881
2942
  */
2882
2943
  id: () => Promise<EngineID>;
2944
+ /**
2945
+ * The list of connected client IDs
2946
+ */
2947
+ clients: () => Promise<string[]>;
2883
2948
  /**
2884
2949
  * The local (on-disk) cache for the Dagger engine
2885
2950
  */
2886
2951
  localCache: () => EngineCache;
2952
+ /**
2953
+ * The name of the engine instance.
2954
+ */
2955
+ name: () => Promise<string>;
2887
2956
  }
2888
2957
  /**
2889
2958
  * A cache storage for the Dagger engine
@@ -3428,6 +3497,11 @@ export declare class EnvFile extends BaseClient {
3428
3497
  * @param opts.raw Return the value exactly as written to the file. No quote removal or variable expansion
3429
3498
  */
3430
3499
  get: (name: string, opts?: EnvFileGetOpts) => Promise<string>;
3500
+ /**
3501
+ * Filters variables by prefix and removes the pref from keys. Variables without the prefix are excluded. For example, with the prefix "MY_APP_" and variables: MY_APP_TOKEN=topsecret MY_APP_NAME=hello FOO=bar the resulting environment will contain: TOKEN=topsecret NAME=hello
3502
+ * @param prefix The prefix to filter by
3503
+ */
3504
+ namespace_: (prefix: string) => EnvFile;
3431
3505
  /**
3432
3506
  * Return all variables
3433
3507
  * @param opts.raw Return values exactly as written to the file. No quote removal or variable expansion
@@ -3722,6 +3796,12 @@ export declare class Function_ extends BaseClient {
3722
3796
  * @param opts.sourceMap The source map for the argument definition.
3723
3797
  */
3724
3798
  withArg: (name: string, typeDef: TypeDef, opts?: FunctionWithArgOpts) => Function_;
3799
+ /**
3800
+ * Returns the function updated to use the provided cache policy.
3801
+ * @param policy The cache policy to use.
3802
+ * @param opts.timeToLive The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
3803
+ */
3804
+ withCachePolicy: (policy: FunctionCachePolicy, opts?: FunctionWithCachePolicyOpts) => Function_;
3725
3805
  /**
3726
3806
  * Returns the function with the given doc string.
3727
3807
  * @param description The doc string to set.
@@ -3989,6 +4069,10 @@ export declare class GitRepository extends BaseClient {
3989
4069
  * @param opts.patterns Glob patterns (e.g., "refs/tags/v*").
3990
4070
  */
3991
4071
  tags: (opts?: GitRepositoryTagsOpts) => Promise<string[]>;
4072
+ /**
4073
+ * Returns the changeset of uncommitted changes in the git repository.
4074
+ */
4075
+ uncommitted: () => Changeset;
3992
4076
  /**
3993
4077
  * The URL of the git repository.
3994
4078
  */
@@ -4432,6 +4516,14 @@ export declare class Module_ extends BaseClient {
4432
4516
  * Interfaces served by this module.
4433
4517
  */
4434
4518
  interfaces: () => Promise<TypeDef[]>;
4519
+ /**
4520
+ * The introspection schema JSON file for this module.
4521
+ *
4522
+ * This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
4523
+ *
4524
+ * Note: this is in the context of a module, so some core types may be hidden.
4525
+ */
4526
+ introspectionSchemaJSON: () => File;
4435
4527
  /**
4436
4528
  * The name of the module
4437
4529
  */
@@ -4608,6 +4700,14 @@ export declare class ModuleSource extends BaseClient {
4608
4700
  * The URL to the source's git repo in a web browser. Only valid for git sources.
4609
4701
  */
4610
4702
  htmlURL: () => Promise<string>;
4703
+ /**
4704
+ * The introspection schema JSON file for this module source.
4705
+ *
4706
+ * This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
4707
+ *
4708
+ * Note: this is in the context of a module, so some core types may be hidden.
4709
+ */
4710
+ introspectionSchemaJSON: () => File;
4611
4711
  /**
4612
4712
  * The kind of module source (currently local, git or dir).
4613
4713
  */
@@ -4652,6 +4752,10 @@ export declare class ModuleSource extends BaseClient {
4652
4752
  * Forces evaluation of the module source, including any loading into the engine and associated validation.
4653
4753
  */
4654
4754
  sync: () => Promise<ModuleSource>;
4755
+ /**
4756
+ * The toolchains referenced by the module source.
4757
+ */
4758
+ toolchains: () => Promise<ModuleSource[]>;
4655
4759
  /**
4656
4760
  * User-defined defaults read from local .env files
4657
4761
  */
@@ -4681,6 +4785,11 @@ export declare class ModuleSource extends BaseClient {
4681
4785
  * @param version The engine version to upgrade to.
4682
4786
  */
4683
4787
  withEngineVersion: (version: string) => ModuleSource;
4788
+ /**
4789
+ * Enable the experimental features for the module source.
4790
+ * @param features The experimental features to enable.
4791
+ */
4792
+ withExperimentalFeatures: (features: ModuleSourceExperimentalFeature[]) => ModuleSource;
4684
4793
  /**
4685
4794
  * Update the module source with additional include patterns for files+directories from its context that are required for building it
4686
4795
  * @param patterns The new additional include patterns.
@@ -4701,6 +4810,11 @@ export declare class ModuleSource extends BaseClient {
4701
4810
  * @param path The path to set as the source subpath. Must be relative to the module source's source root directory.
4702
4811
  */
4703
4812
  withSourceSubpath: (path: string) => ModuleSource;
4813
+ /**
4814
+ * Add toolchains to the module source.
4815
+ * @param toolchains The toolchain modules to add.
4816
+ */
4817
+ withToolchains: (toolchains: ModuleSource[]) => ModuleSource;
4704
4818
  /**
4705
4819
  * Update the blueprint module to the latest version.
4706
4820
  */
@@ -4710,6 +4824,11 @@ export declare class ModuleSource extends BaseClient {
4710
4824
  * @param dependencies The dependencies to update.
4711
4825
  */
4712
4826
  withUpdateDependencies: (dependencies: string[]) => ModuleSource;
4827
+ /**
4828
+ * Update one or more toolchains.
4829
+ * @param toolchains The toolchains to update.
4830
+ */
4831
+ withUpdateToolchains: (toolchains: string[]) => ModuleSource;
4713
4832
  /**
4714
4833
  * Update one or more clients.
4715
4834
  * @param clients The clients to update
@@ -4729,6 +4848,16 @@ export declare class ModuleSource extends BaseClient {
4729
4848
  * @param dependencies The dependencies to remove.
4730
4849
  */
4731
4850
  withoutDependencies: (dependencies: string[]) => ModuleSource;
4851
+ /**
4852
+ * Disable experimental features for the module source.
4853
+ * @param features The experimental features to disable.
4854
+ */
4855
+ withoutExperimentalFeatures: (features: ModuleSourceExperimentalFeature[]) => ModuleSource;
4856
+ /**
4857
+ * Remove the provided toolchains from the module source.
4858
+ * @param toolchains The toolchains to remove.
4859
+ */
4860
+ withoutToolchains: (toolchains: string[]) => ModuleSource;
4732
4861
  /**
4733
4862
  * Call the provided function with current ModuleSource.
4734
4863
  *