@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.
@@ -62,6 +62,114 @@ function CacheSharingModeNameToValue(name) {
62
62
  return name;
63
63
  }
64
64
  }
65
+ /**
66
+ * Strategy to use when merging changesets with conflicting changes.
67
+ */
68
+ export var ChangesetMergeConflict;
69
+ (function (ChangesetMergeConflict) {
70
+ /**
71
+ * Attempt the merge and fail if git merge fails due to conflicts
72
+ */
73
+ ChangesetMergeConflict["Fail"] = "FAIL";
74
+ /**
75
+ * Fail before attempting merge if file-level conflicts are detected
76
+ */
77
+ ChangesetMergeConflict["FailEarly"] = "FAIL_EARLY";
78
+ /**
79
+ * Let git create conflict markers in files. For modify/delete conflicts, keeps the modified version. Fails on binary conflicts.
80
+ */
81
+ ChangesetMergeConflict["LeaveConflictMarkers"] = "LEAVE_CONFLICT_MARKERS";
82
+ /**
83
+ * The conflict is resolved by applying the version of the calling changeset
84
+ */
85
+ ChangesetMergeConflict["PreferOurs"] = "PREFER_OURS";
86
+ /**
87
+ * The conflict is resolved by applying the version of the other changeset
88
+ */
89
+ ChangesetMergeConflict["PreferTheirs"] = "PREFER_THEIRS";
90
+ })(ChangesetMergeConflict || (ChangesetMergeConflict = {}));
91
+ /**
92
+ * Utility function to convert a ChangesetMergeConflict value to its name so
93
+ * it can be uses as argument to call a exposed function.
94
+ */
95
+ function ChangesetMergeConflictValueToName(value) {
96
+ switch (value) {
97
+ case ChangesetMergeConflict.Fail:
98
+ return "FAIL";
99
+ case ChangesetMergeConflict.FailEarly:
100
+ return "FAIL_EARLY";
101
+ case ChangesetMergeConflict.LeaveConflictMarkers:
102
+ return "LEAVE_CONFLICT_MARKERS";
103
+ case ChangesetMergeConflict.PreferOurs:
104
+ return "PREFER_OURS";
105
+ case ChangesetMergeConflict.PreferTheirs:
106
+ return "PREFER_THEIRS";
107
+ default:
108
+ return value;
109
+ }
110
+ }
111
+ /**
112
+ * Utility function to convert a ChangesetMergeConflict name to its value so
113
+ * it can be properly used inside the module runtime.
114
+ */
115
+ function ChangesetMergeConflictNameToValue(name) {
116
+ switch (name) {
117
+ case "FAIL":
118
+ return ChangesetMergeConflict.Fail;
119
+ case "FAIL_EARLY":
120
+ return ChangesetMergeConflict.FailEarly;
121
+ case "LEAVE_CONFLICT_MARKERS":
122
+ return ChangesetMergeConflict.LeaveConflictMarkers;
123
+ case "PREFER_OURS":
124
+ return ChangesetMergeConflict.PreferOurs;
125
+ case "PREFER_THEIRS":
126
+ return ChangesetMergeConflict.PreferTheirs;
127
+ default:
128
+ return name;
129
+ }
130
+ }
131
+ /**
132
+ * Strategy to use when merging multiple changesets with git octopus merge.
133
+ */
134
+ export var ChangesetsMergeConflict;
135
+ (function (ChangesetsMergeConflict) {
136
+ /**
137
+ * Attempt the octopus merge and fail if git merge fails due to conflicts
138
+ */
139
+ ChangesetsMergeConflict["Fail"] = "FAIL";
140
+ /**
141
+ * Fail before attempting merge if file-level conflicts are detected between any changesets
142
+ */
143
+ ChangesetsMergeConflict["FailEarly"] = "FAIL_EARLY";
144
+ })(ChangesetsMergeConflict || (ChangesetsMergeConflict = {}));
145
+ /**
146
+ * Utility function to convert a ChangesetsMergeConflict value to its name so
147
+ * it can be uses as argument to call a exposed function.
148
+ */
149
+ function ChangesetsMergeConflictValueToName(value) {
150
+ switch (value) {
151
+ case ChangesetsMergeConflict.Fail:
152
+ return "FAIL";
153
+ case ChangesetsMergeConflict.FailEarly:
154
+ return "FAIL_EARLY";
155
+ default:
156
+ return value;
157
+ }
158
+ }
159
+ /**
160
+ * Utility function to convert a ChangesetsMergeConflict name to its value so
161
+ * it can be properly used inside the module runtime.
162
+ */
163
+ function ChangesetsMergeConflictNameToValue(name) {
164
+ switch (name) {
165
+ case "FAIL":
166
+ return ChangesetsMergeConflict.Fail;
167
+ case "FAIL_EARLY":
168
+ return ChangesetsMergeConflict.FailEarly;
169
+ default:
170
+ return name;
171
+ }
172
+ }
65
173
  /**
66
174
  * File type.
67
175
  */
@@ -428,11 +536,11 @@ function NetworkProtocolNameToValue(name) {
428
536
  export var ReturnType;
429
537
  (function (ReturnType) {
430
538
  /**
431
- * Any execution (exit codes 0-127)
539
+ * Any execution (exit codes 0-127 and 192-255)
432
540
  */
433
541
  ReturnType["Any"] = "ANY";
434
542
  /**
435
- * A failed execution (exit codes 1-127)
543
+ * A failed execution (exit codes 1-127 and 192-255)
436
544
  */
437
545
  ReturnType["Failure"] = "FAILURE";
438
546
  /**
@@ -850,6 +958,20 @@ export class Binding extends BaseClient {
850
958
  const ctx = this._ctx.select("asFile");
851
959
  return new File(ctx);
852
960
  };
961
+ /**
962
+ * Retrieve the binding value, as type Generator
963
+ */
964
+ asGenerator = () => {
965
+ const ctx = this._ctx.select("asGenerator");
966
+ return new Generator(ctx);
967
+ };
968
+ /**
969
+ * Retrieve the binding value, as type GeneratorGroup
970
+ */
971
+ asGeneratorGroup = () => {
972
+ const ctx = this._ctx.select("asGeneratorGroup");
973
+ return new GeneratorGroup(ctx);
974
+ };
853
975
  /**
854
976
  * Retrieve the binding value, as type GitRef
855
977
  */
@@ -1126,6 +1248,58 @@ export class Changeset extends BaseClient {
1126
1248
  const response = await ctx.execute();
1127
1249
  return new Client(ctx.copy()).loadChangesetFromID(response);
1128
1250
  };
1251
+ /**
1252
+ * Add changes to an existing changeset
1253
+ *
1254
+ * 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
1255
+ * @param changes Changes to merge into the actual changeset
1256
+ * @param opts.onConflict What to do on a merge conflict
1257
+ */
1258
+ withChangeset = (changes, opts) => {
1259
+ const metadata = {
1260
+ onConflict: {
1261
+ is_enum: true,
1262
+ value_to_name: ChangesetMergeConflictValueToName,
1263
+ },
1264
+ };
1265
+ const ctx = this._ctx.select("withChangeset", {
1266
+ changes,
1267
+ ...opts,
1268
+ __metadata: metadata,
1269
+ });
1270
+ return new Changeset(ctx);
1271
+ };
1272
+ /**
1273
+ * Add changes from multiple changesets using git octopus merge strategy
1274
+ *
1275
+ * This is more efficient than chaining multiple withChangeset calls when merging many changesets.
1276
+ *
1277
+ * Only FAIL and FAIL_EARLY conflict strategies are supported (octopus merge cannot use -X ours/theirs).
1278
+ * @param changes List of changesets to merge into the actual changeset
1279
+ * @param opts.onConflict What to do on a merge conflict
1280
+ */
1281
+ withChangesets = (changes, opts) => {
1282
+ const metadata = {
1283
+ onConflict: {
1284
+ is_enum: true,
1285
+ value_to_name: ChangesetsMergeConflictValueToName,
1286
+ },
1287
+ };
1288
+ const ctx = this._ctx.select("withChangesets", {
1289
+ changes,
1290
+ ...opts,
1291
+ __metadata: metadata,
1292
+ });
1293
+ return new Changeset(ctx);
1294
+ };
1295
+ /**
1296
+ * Call the provided function with current Changeset.
1297
+ *
1298
+ * This is useful for reusability and readability by not breaking the calling chain.
1299
+ */
1300
+ with = (arg) => {
1301
+ return arg(this);
1302
+ };
1129
1303
  }
1130
1304
  export class Check extends BaseClient {
1131
1305
  _id = undefined;
@@ -1227,13 +1401,6 @@ export class Check extends BaseClient {
1227
1401
  const ctx = this._ctx.select("run");
1228
1402
  return new Check(ctx);
1229
1403
  };
1230
- /**
1231
- * The module source where the check is defined (i.e., toolchains)
1232
- */
1233
- source = () => {
1234
- const ctx = this._ctx.select("source");
1235
- return new ModuleSource(ctx);
1236
- };
1237
1404
  /**
1238
1405
  * Call the provided function with current Check.
1239
1406
  *
@@ -2403,6 +2570,15 @@ export class CurrentModule extends BaseClient {
2403
2570
  const ctx = this._ctx.select("generatedContextDirectory");
2404
2571
  return new Directory(ctx);
2405
2572
  };
2573
+ /**
2574
+ * Return all generators defined by the module
2575
+ * @param opts.include Only include generators matching the specified patterns
2576
+ * @experimental
2577
+ */
2578
+ generators = (opts) => {
2579
+ const ctx = this._ctx.select("generators", { ...opts });
2580
+ return new GeneratorGroup(ctx);
2581
+ };
2406
2582
  /**
2407
2583
  * The name of the module being executed in
2408
2584
  */
@@ -2565,6 +2741,11 @@ export class Directory extends BaseClient {
2565
2741
  * @param opts.noInit If set, skip the automatic init process injected into containers created by RUN statements.
2566
2742
  *
2567
2743
  * 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.
2744
+ * @param opts.ssh A socket to use for SSH authentication during the build
2745
+ *
2746
+ * (e.g., for Dockerfile RUN --mount=type=ssh instructions).
2747
+ *
2748
+ * Typically obtained via host.unixSocket() pointing to the SSH_AUTH_SOCK.
2568
2749
  */
2569
2750
  dockerBuild = (opts) => {
2570
2751
  const ctx = this._ctx.select("dockerBuild", { ...opts });
@@ -3344,6 +3525,24 @@ export class Env extends BaseClient {
3344
3525
  const response = await ctx.execute();
3345
3526
  return response;
3346
3527
  };
3528
+ /**
3529
+ * Return the check with the given name from the installed modules. Must match exactly one check.
3530
+ * @param name The name of the check to retrieve
3531
+ * @experimental
3532
+ */
3533
+ check = (name) => {
3534
+ const ctx = this._ctx.select("check", { name });
3535
+ return new Check(ctx);
3536
+ };
3537
+ /**
3538
+ * Return all checks defined by the installed modules
3539
+ * @param opts.include Only include checks matching the specified patterns
3540
+ * @experimental
3541
+ */
3542
+ checks = (opts) => {
3543
+ const ctx = this._ctx.select("checks", { ...opts });
3544
+ return new CheckGroup(ctx);
3545
+ };
3347
3546
  /**
3348
3547
  * Retrieves an input binding by name
3349
3548
  */
@@ -3620,6 +3819,55 @@ export class Env extends BaseClient {
3620
3819
  const ctx = this._ctx.select("withFileOutput", { name, description });
3621
3820
  return new Env(ctx);
3622
3821
  };
3822
+ /**
3823
+ * Create or update a binding of type GeneratorGroup in the environment
3824
+ * @param name The name of the binding
3825
+ * @param value The GeneratorGroup value to assign to the binding
3826
+ * @param description The purpose of the input
3827
+ */
3828
+ withGeneratorGroupInput = (name, value, description) => {
3829
+ const ctx = this._ctx.select("withGeneratorGroupInput", {
3830
+ name,
3831
+ value,
3832
+ description,
3833
+ });
3834
+ return new Env(ctx);
3835
+ };
3836
+ /**
3837
+ * Declare a desired GeneratorGroup output to be assigned in the environment
3838
+ * @param name The name of the binding
3839
+ * @param description A description of the desired value of the binding
3840
+ */
3841
+ withGeneratorGroupOutput = (name, description) => {
3842
+ const ctx = this._ctx.select("withGeneratorGroupOutput", {
3843
+ name,
3844
+ description,
3845
+ });
3846
+ return new Env(ctx);
3847
+ };
3848
+ /**
3849
+ * Create or update a binding of type Generator in the environment
3850
+ * @param name The name of the binding
3851
+ * @param value The Generator value to assign to the binding
3852
+ * @param description The purpose of the input
3853
+ */
3854
+ withGeneratorInput = (name, value, description) => {
3855
+ const ctx = this._ctx.select("withGeneratorInput", {
3856
+ name,
3857
+ value,
3858
+ description,
3859
+ });
3860
+ return new Env(ctx);
3861
+ };
3862
+ /**
3863
+ * Declare a desired Generator output to be assigned in the environment
3864
+ * @param name The name of the binding
3865
+ * @param description A description of the desired value of the binding
3866
+ */
3867
+ withGeneratorOutput = (name, description) => {
3868
+ const ctx = this._ctx.select("withGeneratorOutput", { name, description });
3869
+ return new Env(ctx);
3870
+ };
3623
3871
  /**
3624
3872
  * Create or update a binding of type GitRef in the environment
3625
3873
  * @param name The name of the binding
@@ -3692,10 +3940,22 @@ export class Env extends BaseClient {
3692
3940
  const ctx = this._ctx.select("withJSONValueOutput", { name, description });
3693
3941
  return new Env(ctx);
3694
3942
  };
3943
+ /**
3944
+ * Sets the main module for this environment (the project being worked on)
3945
+ *
3946
+ * Contextual path arguments will be populated using the environment's workspace.
3947
+ */
3948
+ withMainModule = (module_) => {
3949
+ const ctx = this._ctx.select("withMainModule", {
3950
+ module: module_,
3951
+ });
3952
+ return new Env(ctx);
3953
+ };
3695
3954
  /**
3696
3955
  * Installs a module into the environment, exposing its functions to the model
3697
3956
  *
3698
3957
  * Contextual path arguments will be populated using the environment's workspace.
3958
+ * @deprecated Use withMainModule instead
3699
3959
  */
3700
3960
  withModule = (module_) => {
3701
3961
  const ctx = this._ctx.select("withModule", {
@@ -4652,6 +4912,13 @@ export class Function_ extends BaseClient {
4652
4912
  const ctx = this._ctx.select("withDescription", { description });
4653
4913
  return new Function_(ctx);
4654
4914
  };
4915
+ /**
4916
+ * Returns the function with a flag indicating it's a generator.
4917
+ */
4918
+ withGenerator = () => {
4919
+ const ctx = this._ctx.select("withGenerator");
4920
+ return new Function_(ctx);
4921
+ };
4655
4922
  /**
4656
4923
  * Returns the function with the given source map.
4657
4924
  * @param sourceMap The source map for the function definition.
@@ -4676,6 +4943,7 @@ export class Function_ extends BaseClient {
4676
4943
  */
4677
4944
  export class FunctionArg extends BaseClient {
4678
4945
  _id = undefined;
4946
+ _defaultAddress = undefined;
4679
4947
  _defaultPath = undefined;
4680
4948
  _defaultValue = undefined;
4681
4949
  _deprecated = undefined;
@@ -4684,9 +4952,10 @@ export class FunctionArg extends BaseClient {
4684
4952
  /**
4685
4953
  * Constructor is used for internal usage only, do not create object from it.
4686
4954
  */
4687
- constructor(ctx, _id, _defaultPath, _defaultValue, _deprecated, _description, _name) {
4955
+ constructor(ctx, _id, _defaultAddress, _defaultPath, _defaultValue, _deprecated, _description, _name) {
4688
4956
  super(ctx);
4689
4957
  this._id = _id;
4958
+ this._defaultAddress = _defaultAddress;
4690
4959
  this._defaultPath = _defaultPath;
4691
4960
  this._defaultValue = _defaultValue;
4692
4961
  this._deprecated = _deprecated;
@@ -4704,6 +4973,17 @@ export class FunctionArg extends BaseClient {
4704
4973
  const response = await ctx.execute();
4705
4974
  return response;
4706
4975
  };
4976
+ /**
4977
+ * Only applies to arguments of type Container. If the argument is not set, load it from the given address (e.g. alpine:latest)
4978
+ */
4979
+ defaultAddress = async () => {
4980
+ if (this._defaultAddress) {
4981
+ return this._defaultAddress;
4982
+ }
4983
+ const ctx = this._ctx.select("defaultAddress");
4984
+ const response = await ctx.execute();
4985
+ return response;
4986
+ };
4707
4987
  /**
4708
4988
  * 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
4709
4989
  */
@@ -4998,6 +5278,176 @@ export class GeneratedCode extends BaseClient {
4998
5278
  return arg(this);
4999
5279
  };
5000
5280
  }
5281
+ export class Generator extends BaseClient {
5282
+ _id = undefined;
5283
+ _completed = undefined;
5284
+ _description = undefined;
5285
+ _isEmpty = undefined;
5286
+ _name = undefined;
5287
+ /**
5288
+ * Constructor is used for internal usage only, do not create object from it.
5289
+ */
5290
+ constructor(ctx, _id, _completed, _description, _isEmpty, _name) {
5291
+ super(ctx);
5292
+ this._id = _id;
5293
+ this._completed = _completed;
5294
+ this._description = _description;
5295
+ this._isEmpty = _isEmpty;
5296
+ this._name = _name;
5297
+ }
5298
+ /**
5299
+ * A unique identifier for this Generator.
5300
+ */
5301
+ id = async () => {
5302
+ if (this._id) {
5303
+ return this._id;
5304
+ }
5305
+ const ctx = this._ctx.select("id");
5306
+ const response = await ctx.execute();
5307
+ return response;
5308
+ };
5309
+ /**
5310
+ * The generated changeset
5311
+ */
5312
+ changes = () => {
5313
+ const ctx = this._ctx.select("changes");
5314
+ return new Changeset(ctx);
5315
+ };
5316
+ /**
5317
+ * Whether the generator complete
5318
+ */
5319
+ completed = async () => {
5320
+ if (this._completed) {
5321
+ return this._completed;
5322
+ }
5323
+ const ctx = this._ctx.select("completed");
5324
+ const response = await ctx.execute();
5325
+ return response;
5326
+ };
5327
+ /**
5328
+ * Return the description of the generator
5329
+ */
5330
+ description = async () => {
5331
+ if (this._description) {
5332
+ return this._description;
5333
+ }
5334
+ const ctx = this._ctx.select("description");
5335
+ const response = await ctx.execute();
5336
+ return response;
5337
+ };
5338
+ /**
5339
+ * Wether changeset from the generator execution is empty or not
5340
+ */
5341
+ isEmpty = async () => {
5342
+ if (this._isEmpty) {
5343
+ return this._isEmpty;
5344
+ }
5345
+ const ctx = this._ctx.select("isEmpty");
5346
+ const response = await ctx.execute();
5347
+ return response;
5348
+ };
5349
+ /**
5350
+ * Return the fully qualified name of the generator
5351
+ */
5352
+ name = async () => {
5353
+ if (this._name) {
5354
+ return this._name;
5355
+ }
5356
+ const ctx = this._ctx.select("name");
5357
+ const response = await ctx.execute();
5358
+ return response;
5359
+ };
5360
+ /**
5361
+ * Execute the generator
5362
+ */
5363
+ run = () => {
5364
+ const ctx = this._ctx.select("run");
5365
+ return new Generator(ctx);
5366
+ };
5367
+ /**
5368
+ * Call the provided function with current Generator.
5369
+ *
5370
+ * This is useful for reusability and readability by not breaking the calling chain.
5371
+ */
5372
+ with = (arg) => {
5373
+ return arg(this);
5374
+ };
5375
+ }
5376
+ export class GeneratorGroup extends BaseClient {
5377
+ _id = undefined;
5378
+ _isEmpty = undefined;
5379
+ /**
5380
+ * Constructor is used for internal usage only, do not create object from it.
5381
+ */
5382
+ constructor(ctx, _id, _isEmpty) {
5383
+ super(ctx);
5384
+ this._id = _id;
5385
+ this._isEmpty = _isEmpty;
5386
+ }
5387
+ /**
5388
+ * A unique identifier for this GeneratorGroup.
5389
+ */
5390
+ id = async () => {
5391
+ if (this._id) {
5392
+ return this._id;
5393
+ }
5394
+ const ctx = this._ctx.select("id");
5395
+ const response = await ctx.execute();
5396
+ return response;
5397
+ };
5398
+ /**
5399
+ * The combined changes from the generators execution
5400
+ *
5401
+ * 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.
5402
+ *
5403
+ * Set 'continueOnConflicts' flag to force to merge the changes in a 'last write wins' strategy.
5404
+ * @param opts.onConflict Strategy to apply on conflicts between generators
5405
+ */
5406
+ changes = (opts) => {
5407
+ const metadata = {
5408
+ onConflict: {
5409
+ is_enum: true,
5410
+ value_to_name: ChangesetsMergeConflictValueToName,
5411
+ },
5412
+ };
5413
+ const ctx = this._ctx.select("changes", { ...opts, __metadata: metadata });
5414
+ return new Changeset(ctx);
5415
+ };
5416
+ /**
5417
+ * Whether the generated changeset is empty or not
5418
+ */
5419
+ isEmpty = async () => {
5420
+ if (this._isEmpty) {
5421
+ return this._isEmpty;
5422
+ }
5423
+ const ctx = this._ctx.select("isEmpty");
5424
+ const response = await ctx.execute();
5425
+ return response;
5426
+ };
5427
+ /**
5428
+ * Return a list of individual generators and their details
5429
+ */
5430
+ list = async () => {
5431
+ const ctx = this._ctx.select("list").select("id");
5432
+ const response = await ctx.execute();
5433
+ return response.map((r) => new Client(ctx.copy()).loadGeneratorFromID(r.id));
5434
+ };
5435
+ /**
5436
+ * Execute all selected generators
5437
+ */
5438
+ run = () => {
5439
+ const ctx = this._ctx.select("run");
5440
+ return new GeneratorGroup(ctx);
5441
+ };
5442
+ /**
5443
+ * Call the provided function with current GeneratorGroup.
5444
+ *
5445
+ * This is useful for reusability and readability by not breaking the calling chain.
5446
+ */
5447
+ with = (arg) => {
5448
+ return arg(this);
5449
+ };
5450
+ }
5001
5451
  /**
5002
5452
  * A git ref (tag, branch, or commit).
5003
5453
  */
@@ -6058,6 +6508,24 @@ export class Module_ extends BaseClient {
6058
6508
  const ctx = this._ctx.select("generatedContextDirectory");
6059
6509
  return new Directory(ctx);
6060
6510
  };
6511
+ /**
6512
+ * Return the generator defined by the module with the given name. Must match to exactly one generator.
6513
+ * @param name The name of the generator to retrieve
6514
+ * @experimental
6515
+ */
6516
+ generator = (name) => {
6517
+ const ctx = this._ctx.select("generator", { name });
6518
+ return new Generator(ctx);
6519
+ };
6520
+ /**
6521
+ * Return all generators defined by the module
6522
+ * @param opts.include Only include generators matching the specified patterns
6523
+ * @experimental
6524
+ */
6525
+ generators = (opts) => {
6526
+ const ctx = this._ctx.select("generators", { ...opts });
6527
+ return new GeneratorGroup(ctx);
6528
+ };
6061
6529
  /**
6062
6530
  * Interfaces served by this module.
6063
6531
  */
@@ -7342,6 +7810,20 @@ export class Client extends BaseClient {
7342
7810
  const ctx = this._ctx.select("loadGeneratedCodeFromID", { id });
7343
7811
  return new GeneratedCode(ctx);
7344
7812
  };
7813
+ /**
7814
+ * Load a Generator from its ID.
7815
+ */
7816
+ loadGeneratorFromID = (id) => {
7817
+ const ctx = this._ctx.select("loadGeneratorFromID", { id });
7818
+ return new Generator(ctx);
7819
+ };
7820
+ /**
7821
+ * Load a GeneratorGroup from its ID.
7822
+ */
7823
+ loadGeneratorGroupFromID = (id) => {
7824
+ const ctx = this._ctx.select("loadGeneratorGroupFromID", { id });
7825
+ return new GeneratorGroup(ctx);
7826
+ };
7345
7827
  /**
7346
7828
  * Load a GitRef from its ID.
7347
7829
  */
@@ -17,6 +17,11 @@ export declare const func: (opts?: import("./registry.js").FunctionOptions | str
17
17
  * Checks are functions that return void/error to indicate pass/fail.
18
18
  */
19
19
  export declare const check: () => ((target: object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => void);
20
+ /**
21
+ * The definition of @generate decorator that marks a function as a generator.
22
+ * Generators are functions that return a Changeset representing changes to be applied.
23
+ */
24
+ export declare const generate: () => ((target: object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => void);
20
25
  /**
21
26
  * The definition of @field decorator that should be on top of any
22
27
  * class' property that must be exposed to the Dagger API.
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/module/decorators.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,MAAM,wEAAkB,CAAA;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,yHA0C2+C,CAAC,8BA1C59C,CAAA;AAEjC;;;GAGG;AACH,eAAO,MAAM,KAAK,kEAoC6zD,CAAC,8BApC7yD,CAAA;AAEnC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,qEAAiB,CAAA;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,wEAAoB,CAAA;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,yIAAoB,CAAA"}
1
+ {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/module/decorators.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,MAAM,wEAAkB,CAAA;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,yHAgDkgD,CAAC,8BAhDn/C,CAAA;AAEjC;;;GAGG;AACH,eAAO,MAAM,KAAK,kEA0Co1D,CAAC,8BA1Cp0D,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,QAAQ,kEAoC8qE,CAAC,8BApC3pE,CAAA;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,qEAAiB,CAAA;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,wEAAoB,CAAA;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,yIAAoB,CAAA"}
@@ -21,6 +21,11 @@ export const func = registry.func;
21
21
  * Checks are functions that return void/error to indicate pass/fail.
22
22
  */
23
23
  export const check = registry.check;
24
+ /**
25
+ * The definition of @generate decorator that marks a function as a generator.
26
+ * Generators are functions that return a Changeset representing changes to be applied.
27
+ */
28
+ export const generate = registry.generate;
24
29
  /**
25
30
  * The definition of @field decorator that should be on top of any
26
31
  * class' property that must be exposed to the Dagger API.
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAET,QAAQ,EACR,OAAO,EAQR,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,eAAe,IAAI,SAAS,EAC5B,iBAAiB,IAAI,WAAW,EAChC,cAAc,IAAI,MAAM,EACxB,YAAY,EAEZ,cAAc,EACf,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAA;AAU5F,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAEjD;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;IAyF9B;;OAEG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS;IAInE;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IAoC7D;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,SAAS;IAmDtD;;;;;;;OAOG;IACH,sBAAsB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,GAAG,SAAS;CA4BjE"}
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAET,QAAQ,EACR,OAAO,EAQR,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,eAAe,IAAI,SAAS,EAC5B,iBAAiB,IAAI,WAAW,EAChC,cAAc,IAAI,MAAM,EACxB,YAAY,EAEZ,cAAc,EACf,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAA;AAU5F,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAEjD;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;IAyF9B;;OAEG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS;IAInE;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IAwC7D;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,SAAS;IA2DtD;;;;;;;OAOG;IACH,sBAAsB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,GAAG,SAAS;CA4BjE"}
@@ -111,6 +111,9 @@ export class Register {
111
111
  if (fct.isCheck) {
112
112
  fnDef = fnDef.withCheck();
113
113
  }
114
+ if (fct.isGenerator) {
115
+ fnDef = fnDef.withGenerator();
116
+ }
114
117
  return fnDef;
115
118
  }
116
119
  /**
@@ -129,7 +132,7 @@ export class Register {
129
132
  typeDef = typeDef.withOptional(true);
130
133
  }
131
134
  // Check if both values are used, return an error if so.
132
- if ([arg.defaultValue, arg.defaultPath].filter((v) => v).length > 1) {
135
+ if ([arg.defaultValue, arg.defaultPath, arg.defaultAddress].filter((v) => v).length > 1) {
133
136
  throw new Error("cannot set multiple defaults");
134
137
  }
135
138
  // We do not set the default value if it's not a primitive type, we let TypeScript
@@ -150,6 +153,9 @@ export class Register {
150
153
  if (arg.defaultPath) {
151
154
  opts.defaultPath = arg.defaultPath;
152
155
  }
156
+ if (arg.defaultAddress) {
157
+ opts.defaultAddress = arg.defaultAddress;
158
+ }
153
159
  if (arg.ignore) {
154
160
  opts.ignore = arg.ignore;
155
161
  }