@dagger.io/dagger 0.19.9 → 0.19.11

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.
@@ -71,12 +71,62 @@ export declare enum CacheSharingMode {
71
71
  export type CacheVolumeID = string & {
72
72
  __CacheVolumeID: never;
73
73
  };
74
+ export type ChangesetWithChangesetOpts = {
75
+ /**
76
+ * What to do on a merge conflict
77
+ */
78
+ onConflict?: ChangesetMergeConflict;
79
+ };
80
+ export type ChangesetWithChangesetsOpts = {
81
+ /**
82
+ * What to do on a merge conflict
83
+ */
84
+ onConflict?: ChangesetsMergeConflict;
85
+ };
74
86
  /**
75
87
  * The `ChangesetID` scalar type represents an identifier for an object of type Changeset.
76
88
  */
77
89
  export type ChangesetID = string & {
78
90
  __ChangesetID: never;
79
91
  };
92
+ /**
93
+ * Strategy to use when merging changesets with conflicting changes.
94
+ */
95
+ export declare enum ChangesetMergeConflict {
96
+ /**
97
+ * Attempt the merge and fail if git merge fails due to conflicts
98
+ */
99
+ Fail = "FAIL",
100
+ /**
101
+ * Fail before attempting merge if file-level conflicts are detected
102
+ */
103
+ FailEarly = "FAIL_EARLY",
104
+ /**
105
+ * Let git create conflict markers in files. For modify/delete conflicts, keeps the modified version. Fails on binary conflicts.
106
+ */
107
+ LeaveConflictMarkers = "LEAVE_CONFLICT_MARKERS",
108
+ /**
109
+ * The conflict is resolved by applying the version of the calling changeset
110
+ */
111
+ PreferOurs = "PREFER_OURS",
112
+ /**
113
+ * The conflict is resolved by applying the version of the other changeset
114
+ */
115
+ PreferTheirs = "PREFER_THEIRS"
116
+ }
117
+ /**
118
+ * Strategy to use when merging multiple changesets with git octopus merge.
119
+ */
120
+ export declare enum ChangesetsMergeConflict {
121
+ /**
122
+ * Attempt the octopus merge and fail if git merge fails due to conflicts
123
+ */
124
+ Fail = "FAIL",
125
+ /**
126
+ * Fail before attempting merge if file-level conflicts are detected between any changesets
127
+ */
128
+ FailEarly = "FAIL_EARLY"
129
+ }
80
130
  /**
81
131
  * The `CheckGroupID` scalar type represents an identifier for an object of type CheckGroup.
82
132
  */
@@ -615,6 +665,12 @@ export type ContainerWithoutUnixSocketOpts = {
615
665
  export type ContainerID = string & {
616
666
  __ContainerID: never;
617
667
  };
668
+ export type CurrentModuleGeneratorsOpts = {
669
+ /**
670
+ * Only include generators matching the specified patterns
671
+ */
672
+ include?: string[];
673
+ };
618
674
  export type CurrentModuleWorkdirOpts = {
619
675
  /**
620
676
  * Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
@@ -680,6 +736,14 @@ export type DirectoryDockerBuildOpts = {
680
736
  * This should only be used if the user requires that their exec processes be the pid 1 process in the container. Otherwise it may result in unexpected behavior.
681
737
  */
682
738
  noInit?: boolean;
739
+ /**
740
+ * A socket to use for SSH authentication during the build
741
+ *
742
+ * (e.g., for Dockerfile RUN --mount=type=ssh instructions).
743
+ *
744
+ * Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
745
+ */
746
+ ssh?: Socket;
683
747
  };
684
748
  export type DirectoryEntriesOpts = {
685
749
  /**
@@ -892,6 +956,12 @@ export type EnumTypeDefID = string & {
892
956
  export type EnumValueTypeDefID = string & {
893
957
  __EnumValueTypeDefID: never;
894
958
  };
959
+ export type EnvChecksOpts = {
960
+ /**
961
+ * Only include checks matching the specified patterns
962
+ */
963
+ include?: string[];
964
+ };
895
965
  export type EnvFileGetOpts = {
896
966
  /**
897
967
  * Return the value exactly as written to the file. No quote removal or variable expansion
@@ -1097,6 +1167,7 @@ export type FunctionWithArgOpts = {
1097
1167
  * If deprecated, the reason or migration path.
1098
1168
  */
1099
1169
  deprecated?: string;
1170
+ defaultAddress?: string;
1100
1171
  };
1101
1172
  export type FunctionWithCachePolicyOpts = {
1102
1173
  /**
@@ -1148,6 +1219,24 @@ export type FunctionID = string & {
1148
1219
  export type GeneratedCodeID = string & {
1149
1220
  __GeneratedCodeID: never;
1150
1221
  };
1222
+ export type GeneratorGroupChangesOpts = {
1223
+ /**
1224
+ * Strategy to apply on conflicts between generators
1225
+ */
1226
+ onConflict?: ChangesetsMergeConflict;
1227
+ };
1228
+ /**
1229
+ * The `GeneratorGroupID` scalar type represents an identifier for an object of type GeneratorGroup.
1230
+ */
1231
+ export type GeneratorGroupID = string & {
1232
+ __GeneratorGroupID: never;
1233
+ };
1234
+ /**
1235
+ * The `GeneratorID` scalar type represents an identifier for an object of type Generator.
1236
+ */
1237
+ export type GeneratorID = string & {
1238
+ __GeneratorID: never;
1239
+ };
1151
1240
  export type GitRefTreeOpts = {
1152
1241
  /**
1153
1242
  * Set to true to discard .git directory.
@@ -1322,6 +1411,12 @@ export type ModuleChecksOpts = {
1322
1411
  */
1323
1412
  include?: string[];
1324
1413
  };
1414
+ export type ModuleGeneratorsOpts = {
1415
+ /**
1416
+ * Only include generators matching the specified patterns
1417
+ */
1418
+ include?: string[];
1419
+ };
1325
1420
  export type ModuleServeOpts = {
1326
1421
  /**
1327
1422
  * Expose the dependencies of this module to the client
@@ -1540,11 +1635,11 @@ export type ClientSecretOpts = {
1540
1635
  */
1541
1636
  export declare enum ReturnType {
1542
1637
  /**
1543
- * Any execution (exit codes 0-127)
1638
+ * Any execution (exit codes 0-127 and 192-255)
1544
1639
  */
1545
1640
  Any = "ANY",
1546
1641
  /**
1547
- * A failed execution (exit codes 1-127)
1642
+ * A failed execution (exit codes 1-127 and 192-255)
1548
1643
  */
1549
1644
  Failure = "FAILURE",
1550
1645
  /**
@@ -1963,6 +2058,14 @@ export declare class Binding extends BaseClient {
1963
2058
  * Retrieve the binding value, as type File
1964
2059
  */
1965
2060
  asFile: () => File;
2061
+ /**
2062
+ * Retrieve the binding value, as type Generator
2063
+ */
2064
+ asGenerator: () => Generator;
2065
+ /**
2066
+ * Retrieve the binding value, as type GeneratorGroup
2067
+ */
2068
+ asGeneratorGroup: () => GeneratorGroup;
1966
2069
  /**
1967
2070
  * Retrieve the binding value, as type GitRef
1968
2071
  */
@@ -2103,6 +2206,30 @@ export declare class Changeset extends BaseClient {
2103
2206
  * Force evaluation in the engine.
2104
2207
  */
2105
2208
  sync: () => Promise<Changeset>;
2209
+ /**
2210
+ * Add changes to an existing changeset
2211
+ *
2212
+ * By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument
2213
+ * @param changes Changes to merge into the actual changeset
2214
+ * @param opts.onConflict What to do on a merge conflict
2215
+ */
2216
+ withChangeset: (changes: Changeset, opts?: ChangesetWithChangesetOpts) => Changeset;
2217
+ /**
2218
+ * Add changes from multiple changesets using git octopus merge strategy
2219
+ *
2220
+ * This is more efficient than chaining multiple withChangeset calls when merging many changesets.
2221
+ *
2222
+ * Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
2223
+ * @param changes List of changesets to merge into the actual changeset
2224
+ * @param opts.onConflict What to do on a merge conflict
2225
+ */
2226
+ withChangesets: (changes: Changeset[], opts?: ChangesetWithChangesetsOpts) => Changeset;
2227
+ /**
2228
+ * Call the provided function with current Changeset.
2229
+ *
2230
+ * This is useful for reusability and readability by not breaking the calling chain.
2231
+ */
2232
+ with: (arg: (param: Changeset) => Changeset) => Changeset;
2106
2233
  }
2107
2234
  export declare class Check extends BaseClient {
2108
2235
  private readonly _id?;
@@ -2147,10 +2274,6 @@ export declare class Check extends BaseClient {
2147
2274
  * Execute the check
2148
2275
  */
2149
2276
  run: () => Check;
2150
- /**
2151
- * The module source where the check is defined (i.e., toolchains)
2152
- */
2153
- source: () => ModuleSource;
2154
2277
  /**
2155
2278
  * Call the provided function with current Check.
2156
2279
  *
@@ -2858,6 +2981,12 @@ export declare class CurrentModule extends BaseClient {
2858
2981
  * The generated files and directories made on top of the module source's context directory.
2859
2982
  */
2860
2983
  generatedContextDirectory: () => Directory;
2984
+ /**
2985
+ * Return all generators defined by the module
2986
+ * @param opts.include Only include generators matching the specified patterns
2987
+ * @experimental
2988
+ */
2989
+ generators: (opts?: CurrentModuleGeneratorsOpts) => GeneratorGroup;
2861
2990
  /**
2862
2991
  * The name of the module being executed in
2863
2992
  */
@@ -2960,6 +3089,11 @@ export declare class Directory extends BaseClient {
2960
3089
  * @param opts.noInit If set, skip the automatic init process injected into containers created by RUN statements.
2961
3090
  *
2962
3091
  * This should only be used if the user requires that their exec processes be the pid 1 process in the container. Otherwise it may result in unexpected behavior.
3092
+ * @param opts.ssh A socket to use for SSH authentication during the build
3093
+ *
3094
+ * (e.g., for Dockerfile RUN --mount=type=ssh instructions).
3095
+ *
3096
+ * Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
2963
3097
  */
2964
3098
  dockerBuild: (opts?: DirectoryDockerBuildOpts) => Container;
2965
3099
  /**
@@ -3372,6 +3506,18 @@ export declare class Env extends BaseClient {
3372
3506
  * A unique identifier for this Env.
3373
3507
  */
3374
3508
  id: () => Promise<EnvID>;
3509
+ /**
3510
+ * Return the check with the given name from the installed modules. Must match exactly one check.
3511
+ * @param name The name of the check to retrieve
3512
+ * @experimental
3513
+ */
3514
+ check: (name: string) => Check;
3515
+ /**
3516
+ * Return all checks defined by the installed modules
3517
+ * @param opts.include Only include checks matching the specified patterns
3518
+ * @experimental
3519
+ */
3520
+ checks: (opts?: EnvChecksOpts) => CheckGroup;
3375
3521
  /**
3376
3522
  * Retrieves an input binding by name
3377
3523
  */
@@ -3537,6 +3683,32 @@ export declare class Env extends BaseClient {
3537
3683
  * @param description A description of the desired value of the binding
3538
3684
  */
3539
3685
  withFileOutput: (name: string, description: string) => Env;
3686
+ /**
3687
+ * Create or update a binding of type GeneratorGroup in the environment
3688
+ * @param name The name of the binding
3689
+ * @param value The GeneratorGroup value to assign to the binding
3690
+ * @param description The purpose of the input
3691
+ */
3692
+ withGeneratorGroupInput: (name: string, value: GeneratorGroup, description: string) => Env;
3693
+ /**
3694
+ * Declare a desired GeneratorGroup output to be assigned in the environment
3695
+ * @param name The name of the binding
3696
+ * @param description A description of the desired value of the binding
3697
+ */
3698
+ withGeneratorGroupOutput: (name: string, description: string) => Env;
3699
+ /**
3700
+ * Create or update a binding of type Generator in the environment
3701
+ * @param name The name of the binding
3702
+ * @param value The Generator value to assign to the binding
3703
+ * @param description The purpose of the input
3704
+ */
3705
+ withGeneratorInput: (name: string, value: Generator, description: string) => Env;
3706
+ /**
3707
+ * Declare a desired Generator output to be assigned in the environment
3708
+ * @param name The name of the binding
3709
+ * @param description A description of the desired value of the binding
3710
+ */
3711
+ withGeneratorOutput: (name: string, description: string) => Env;
3540
3712
  /**
3541
3713
  * Create or update a binding of type GitRef in the environment
3542
3714
  * @param name The name of the binding
@@ -3576,10 +3748,17 @@ export declare class Env extends BaseClient {
3576
3748
  * @param description A description of the desired value of the binding
3577
3749
  */
3578
3750
  withJSONValueOutput: (name: string, description: string) => Env;
3751
+ /**
3752
+ * Sets the main module for this environment (the project being worked on)
3753
+ *
3754
+ * Contextual path arguments will be populated using the environment's workspace.
3755
+ */
3756
+ withMainModule: (module_: Module_) => Env;
3579
3757
  /**
3580
3758
  * Installs a module into the environment, exposing its functions to the model
3581
3759
  *
3582
3760
  * Contextual path arguments will be populated using the environment's workspace.
3761
+ * @deprecated Use withMainModule instead
3583
3762
  */
3584
3763
  withModule: (module_: Module_) => Env;
3585
3764
  /**
@@ -4097,6 +4276,10 @@ export declare class Function_ extends BaseClient {
4097
4276
  * @param description The doc string to set.
4098
4277
  */
4099
4278
  withDescription: (description: string) => Function_;
4279
+ /**
4280
+ * Returns the function with a flag indicating it's a generator.
4281
+ */
4282
+ withGenerator: () => Function_;
4100
4283
  /**
4101
4284
  * Returns the function with the given source map.
4102
4285
  * @param sourceMap The source map for the function definition.
@@ -4116,6 +4299,7 @@ export declare class Function_ extends BaseClient {
4116
4299
  */
4117
4300
  export declare class FunctionArg extends BaseClient {
4118
4301
  private readonly _id?;
4302
+ private readonly _defaultAddress?;
4119
4303
  private readonly _defaultPath?;
4120
4304
  private readonly _defaultValue?;
4121
4305
  private readonly _deprecated?;
@@ -4124,11 +4308,15 @@ export declare class FunctionArg extends BaseClient {
4124
4308
  /**
4125
4309
  * Constructor is used for internal usage only, do not create object from it.
4126
4310
  */
4127
- constructor(ctx?: Context, _id?: FunctionArgID, _defaultPath?: string, _defaultValue?: JSON, _deprecated?: string, _description?: string, _name?: string);
4311
+ constructor(ctx?: Context, _id?: FunctionArgID, _defaultAddress?: string, _defaultPath?: string, _defaultValue?: JSON, _deprecated?: string, _description?: string, _name?: string);
4128
4312
  /**
4129
4313
  * A unique identifier for this FunctionArg.
4130
4314
  */
4131
4315
  id: () => Promise<FunctionArgID>;
4316
+ /**
4317
+ * Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
4318
+ */
4319
+ defaultAddress: () => Promise<string>;
4132
4320
  /**
4133
4321
  * Only applies to arguments of type File or Directory. If the argument is not set, load it from the given path in the context directory
4134
4322
  */
@@ -4271,6 +4459,90 @@ export declare class GeneratedCode extends BaseClient {
4271
4459
  */
4272
4460
  with: (arg: (param: GeneratedCode) => GeneratedCode) => GeneratedCode;
4273
4461
  }
4462
+ export declare class Generator extends BaseClient {
4463
+ private readonly _id?;
4464
+ private readonly _completed?;
4465
+ private readonly _description?;
4466
+ private readonly _isEmpty?;
4467
+ private readonly _name?;
4468
+ /**
4469
+ * Constructor is used for internal usage only, do not create object from it.
4470
+ */
4471
+ constructor(ctx?: Context, _id?: GeneratorID, _completed?: boolean, _description?: string, _isEmpty?: boolean, _name?: string);
4472
+ /**
4473
+ * A unique identifier for this Generator.
4474
+ */
4475
+ id: () => Promise<GeneratorID>;
4476
+ /**
4477
+ * The generated changeset
4478
+ */
4479
+ changes: () => Changeset;
4480
+ /**
4481
+ * Whether the generator complete
4482
+ */
4483
+ completed: () => Promise<boolean>;
4484
+ /**
4485
+ * Return the description of the generator
4486
+ */
4487
+ description: () => Promise<string>;
4488
+ /**
4489
+ * Wether changeset from the generator execution is empty or not
4490
+ */
4491
+ isEmpty: () => Promise<boolean>;
4492
+ /**
4493
+ * Return the fully qualified name of the generator
4494
+ */
4495
+ name: () => Promise<string>;
4496
+ /**
4497
+ * Execute the generator
4498
+ */
4499
+ run: () => Generator;
4500
+ /**
4501
+ * Call the provided function with current Generator.
4502
+ *
4503
+ * This is useful for reusability and readability by not breaking the calling chain.
4504
+ */
4505
+ with: (arg: (param: Generator) => Generator) => Generator;
4506
+ }
4507
+ export declare class GeneratorGroup extends BaseClient {
4508
+ private readonly _id?;
4509
+ private readonly _isEmpty?;
4510
+ /**
4511
+ * Constructor is used for internal usage only, do not create object from it.
4512
+ */
4513
+ constructor(ctx?: Context, _id?: GeneratorGroupID, _isEmpty?: boolean);
4514
+ /**
4515
+ * A unique identifier for this GeneratorGroup.
4516
+ */
4517
+ id: () => Promise<GeneratorGroupID>;
4518
+ /**
4519
+ * The combined changes from the generators execution
4520
+ *
4521
+ * If any conflict occurs, for instance if the same file is modified by multiple generators, or if a file is both modified and deleted, an error is raised and the merge of the changesets will failed.
4522
+ *
4523
+ * Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
4524
+ * @param opts.onConflict Strategy to apply on conflicts between generators
4525
+ */
4526
+ changes: (opts?: GeneratorGroupChangesOpts) => Changeset;
4527
+ /**
4528
+ * Whether the generated changeset is empty or not
4529
+ */
4530
+ isEmpty: () => Promise<boolean>;
4531
+ /**
4532
+ * Return a list of individual generators and their details
4533
+ */
4534
+ list: () => Promise<Generator[]>;
4535
+ /**
4536
+ * Execute all selected generators
4537
+ */
4538
+ run: () => GeneratorGroup;
4539
+ /**
4540
+ * Call the provided function with current GeneratorGroup.
4541
+ *
4542
+ * This is useful for reusability and readability by not breaking the calling chain.
4543
+ */
4544
+ with: (arg: (param: GeneratorGroup) => GeneratorGroup) => GeneratorGroup;
4545
+ }
4274
4546
  /**
4275
4547
  * A git ref (tag, branch, or commit).
4276
4548
  */
@@ -4827,6 +5099,18 @@ export declare class Module_ extends BaseClient {
4827
5099
  * The generated files and directories made on top of the module source's context directory.
4828
5100
  */
4829
5101
  generatedContextDirectory: () => Directory;
5102
+ /**
5103
+ * Return the generator defined by the module with the given name. Must match to exactly one generator.
5104
+ * @param name The name of the generator to retrieve
5105
+ * @experimental
5106
+ */
5107
+ generator: (name: string) => Generator;
5108
+ /**
5109
+ * Return all generators defined by the module
5110
+ * @param opts.include Only include generators matching the specified patterns
5111
+ * @experimental
5112
+ */
5113
+ generators: (opts?: ModuleGeneratorsOpts) => GeneratorGroup;
4830
5114
  /**
4831
5115
  * Interfaces served by this module.
4832
5116
  */
@@ -5519,6 +5803,14 @@ export declare class Client extends BaseClient {
5519
5803
  * Load a GeneratedCode from its ID.
5520
5804
  */
5521
5805
  loadGeneratedCodeFromID: (id: GeneratedCodeID) => GeneratedCode;
5806
+ /**
5807
+ * Load a Generator from its ID.
5808
+ */
5809
+ loadGeneratorFromID: (id: GeneratorID) => Generator;
5810
+ /**
5811
+ * Load a GeneratorGroup from its ID.
5812
+ */
5813
+ loadGeneratorGroupFromID: (id: GeneratorGroupID) => GeneratorGroup;
5522
5814
  /**
5523
5815
  * Load a GitRef from its ID.
5524
5816
  */