@dagger.io/dagger 0.18.11 → 0.18.13

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 (31) hide show
  1. package/dist/src/api/client.gen.d.ts +82 -19
  2. package/dist/src/api/client.gen.d.ts.map +1 -1
  3. package/dist/src/api/client.gen.js +377 -34
  4. package/dist/src/common/graphql/client.d.ts.map +1 -1
  5. package/dist/src/common/graphql/client.js +12 -2
  6. package/dist/src/common/graphql/compute_query.d.ts +1 -0
  7. package/dist/src/common/graphql/compute_query.d.ts.map +1 -1
  8. package/dist/src/common/graphql/compute_query.js +1 -1
  9. package/dist/src/common/utils.d.ts +1 -0
  10. package/dist/src/common/utils.d.ts.map +1 -1
  11. package/dist/src/common/utils.js +4 -0
  12. package/dist/src/module/entrypoint/entrypoint.d.ts.map +1 -1
  13. package/dist/src/module/entrypoint/entrypoint.js +7 -2
  14. package/dist/src/module/entrypoint/load.d.ts.map +1 -1
  15. package/dist/src/module/entrypoint/load.js +28 -4
  16. package/dist/src/module/entrypoint/register.d.ts +32 -6
  17. package/dist/src/module/entrypoint/register.d.ts.map +1 -1
  18. package/dist/src/module/entrypoint/register.js +147 -113
  19. package/dist/src/module/executor.d.ts +8 -0
  20. package/dist/src/module/executor.d.ts.map +1 -1
  21. package/dist/src/module/executor.js +17 -0
  22. package/dist/src/module/introspector/dagger_module/enum.d.ts +1 -0
  23. package/dist/src/module/introspector/dagger_module/enum.d.ts.map +1 -1
  24. package/dist/src/module/introspector/dagger_module/enum.js +2 -1
  25. package/dist/src/module/introspector/dagger_module/enumClass.d.ts +1 -0
  26. package/dist/src/module/introspector/dagger_module/enumClass.d.ts.map +1 -1
  27. package/dist/src/module/introspector/dagger_module/enumClass.js +2 -1
  28. package/dist/src/provisioning/default.d.ts +1 -1
  29. package/dist/src/provisioning/default.js +1 -1
  30. package/dist/src/telemetry/init.js +1 -1
  31. package/package.json +1 -1
@@ -30,38 +30,167 @@ export var CacheSharingMode;
30
30
  */
31
31
  CacheSharingMode["Shared"] = "SHARED";
32
32
  })(CacheSharingMode || (CacheSharingMode = {}));
33
+ /**
34
+ * Utility function to convert a CacheSharingMode value to its name so
35
+ * it can be uses as argument to call a exposed function.
36
+ */
37
+ function CacheSharingModeValueToName(value) {
38
+ switch (value) {
39
+ case CacheSharingMode.Locked:
40
+ return "LOCKED";
41
+ case CacheSharingMode.Private:
42
+ return "PRIVATE";
43
+ case CacheSharingMode.Shared:
44
+ return "SHARED";
45
+ default:
46
+ return value;
47
+ }
48
+ }
49
+ /**
50
+ * Utility function to convert a CacheSharingMode name to its value so
51
+ * it can be properly used inside the module runtime.
52
+ */
53
+ function CacheSharingModeNameToValue(name) {
54
+ switch (name) {
55
+ case "LOCKED":
56
+ return CacheSharingMode.Locked;
57
+ case "PRIVATE":
58
+ return CacheSharingMode.Private;
59
+ case "SHARED":
60
+ return CacheSharingMode.Shared;
61
+ default:
62
+ return name;
63
+ }
64
+ }
33
65
  /**
34
66
  * Compression algorithm to use for image layers.
35
67
  */
36
68
  export var ImageLayerCompression;
37
69
  (function (ImageLayerCompression) {
70
+ ImageLayerCompression["EstarGz"] = "EStarGZ";
38
71
  ImageLayerCompression["Estargz"] = "EStarGZ";
39
72
  ImageLayerCompression["Gzip"] = "Gzip";
40
73
  ImageLayerCompression["Uncompressed"] = "Uncompressed";
41
74
  ImageLayerCompression["Zstd"] = "Zstd";
42
75
  })(ImageLayerCompression || (ImageLayerCompression = {}));
76
+ /**
77
+ * Utility function to convert a ImageLayerCompression value to its name so
78
+ * it can be uses as argument to call a exposed function.
79
+ */
80
+ function ImageLayerCompressionValueToName(value) {
81
+ switch (value) {
82
+ case ImageLayerCompression.EstarGz:
83
+ return "EStarGZ";
84
+ case ImageLayerCompression.Gzip:
85
+ return "Gzip";
86
+ case ImageLayerCompression.Uncompressed:
87
+ return "Uncompressed";
88
+ case ImageLayerCompression.Zstd:
89
+ return "Zstd";
90
+ default:
91
+ return value;
92
+ }
93
+ }
94
+ /**
95
+ * Utility function to convert a ImageLayerCompression name to its value so
96
+ * it can be properly used inside the module runtime.
97
+ */
98
+ function ImageLayerCompressionNameToValue(name) {
99
+ switch (name) {
100
+ case "EStarGZ":
101
+ return ImageLayerCompression.EstarGz;
102
+ case "Gzip":
103
+ return ImageLayerCompression.Gzip;
104
+ case "Uncompressed":
105
+ return ImageLayerCompression.Uncompressed;
106
+ case "Zstd":
107
+ return ImageLayerCompression.Zstd;
108
+ default:
109
+ return name;
110
+ }
111
+ }
43
112
  /**
44
113
  * Mediatypes to use in published or exported image metadata.
45
114
  */
46
115
  export var ImageMediaTypes;
47
116
  (function (ImageMediaTypes) {
48
- ImageMediaTypes["Docker"] = "DOCKER";
49
- ImageMediaTypes["Dockermediatypes"] = "DockerMediaTypes";
50
- ImageMediaTypes["Oci"] = "OCI";
51
- ImageMediaTypes["Ocimediatypes"] = "OCIMediaTypes";
117
+ ImageMediaTypes["Docker"] = "DockerMediaTypes";
118
+ ImageMediaTypes["DockerMediaTypes"] = "DockerMediaTypes";
119
+ ImageMediaTypes["Oci"] = "OCIMediaTypes";
120
+ ImageMediaTypes["OcimediaTypes"] = "OCIMediaTypes";
52
121
  })(ImageMediaTypes || (ImageMediaTypes = {}));
122
+ /**
123
+ * Utility function to convert a ImageMediaTypes value to its name so
124
+ * it can be uses as argument to call a exposed function.
125
+ */
126
+ function ImageMediaTypesValueToName(value) {
127
+ switch (value) {
128
+ case ImageMediaTypes.Docker:
129
+ return "DOCKER";
130
+ case ImageMediaTypes.Oci:
131
+ return "OCI";
132
+ default:
133
+ return value;
134
+ }
135
+ }
136
+ /**
137
+ * Utility function to convert a ImageMediaTypes name to its value so
138
+ * it can be properly used inside the module runtime.
139
+ */
140
+ function ImageMediaTypesNameToValue(name) {
141
+ switch (name) {
142
+ case "DOCKER":
143
+ return ImageMediaTypes.Docker;
144
+ case "OCI":
145
+ return ImageMediaTypes.Oci;
146
+ default:
147
+ return name;
148
+ }
149
+ }
53
150
  /**
54
151
  * The kind of module source.
55
152
  */
56
153
  export var ModuleSourceKind;
57
154
  (function (ModuleSourceKind) {
58
- ModuleSourceKind["Dir"] = "DIR";
155
+ ModuleSourceKind["Dir"] = "DIR_SOURCE";
59
156
  ModuleSourceKind["DirSource"] = "DIR_SOURCE";
60
- ModuleSourceKind["Git"] = "GIT";
157
+ ModuleSourceKind["Git"] = "GIT_SOURCE";
61
158
  ModuleSourceKind["GitSource"] = "GIT_SOURCE";
62
- ModuleSourceKind["Local"] = "LOCAL";
159
+ ModuleSourceKind["Local"] = "LOCAL_SOURCE";
63
160
  ModuleSourceKind["LocalSource"] = "LOCAL_SOURCE";
64
161
  })(ModuleSourceKind || (ModuleSourceKind = {}));
162
+ /**
163
+ * Utility function to convert a ModuleSourceKind value to its name so
164
+ * it can be uses as argument to call a exposed function.
165
+ */
166
+ function ModuleSourceKindValueToName(value) {
167
+ switch (value) {
168
+ case ModuleSourceKind.Dir:
169
+ return "DIR";
170
+ case ModuleSourceKind.Git:
171
+ return "GIT";
172
+ case ModuleSourceKind.Local:
173
+ return "LOCAL";
174
+ default:
175
+ return value;
176
+ }
177
+ }
178
+ /**
179
+ * Utility function to convert a ModuleSourceKind name to its value so
180
+ * it can be properly used inside the module runtime.
181
+ */
182
+ function ModuleSourceKindNameToValue(name) {
183
+ switch (name) {
184
+ case "DIR":
185
+ return ModuleSourceKind.Dir;
186
+ case "GIT":
187
+ return ModuleSourceKind.Git;
188
+ case "LOCAL":
189
+ return ModuleSourceKind.Local;
190
+ default:
191
+ return name;
192
+ }
193
+ }
65
194
  /**
66
195
  * Transport layer network protocol associated to a port.
67
196
  */
@@ -70,6 +199,34 @@ export var NetworkProtocol;
70
199
  NetworkProtocol["Tcp"] = "TCP";
71
200
  NetworkProtocol["Udp"] = "UDP";
72
201
  })(NetworkProtocol || (NetworkProtocol = {}));
202
+ /**
203
+ * Utility function to convert a NetworkProtocol value to its name so
204
+ * it can be uses as argument to call a exposed function.
205
+ */
206
+ function NetworkProtocolValueToName(value) {
207
+ switch (value) {
208
+ case NetworkProtocol.Tcp:
209
+ return "TCP";
210
+ case NetworkProtocol.Udp:
211
+ return "UDP";
212
+ default:
213
+ return value;
214
+ }
215
+ }
216
+ /**
217
+ * Utility function to convert a NetworkProtocol name to its value so
218
+ * it can be properly used inside the module runtime.
219
+ */
220
+ function NetworkProtocolNameToValue(name) {
221
+ switch (name) {
222
+ case "TCP":
223
+ return NetworkProtocol.Tcp;
224
+ case "UDP":
225
+ return NetworkProtocol.Udp;
226
+ default:
227
+ return name;
228
+ }
229
+ }
73
230
  /**
74
231
  * Expected return type of an execution
75
232
  */
@@ -88,6 +245,38 @@ export var ReturnType;
88
245
  */
89
246
  ReturnType["Success"] = "SUCCESS";
90
247
  })(ReturnType || (ReturnType = {}));
248
+ /**
249
+ * Utility function to convert a ReturnType value to its name so
250
+ * it can be uses as argument to call a exposed function.
251
+ */
252
+ function ReturnTypeValueToName(value) {
253
+ switch (value) {
254
+ case ReturnType.Any:
255
+ return "ANY";
256
+ case ReturnType.Failure:
257
+ return "FAILURE";
258
+ case ReturnType.Success:
259
+ return "SUCCESS";
260
+ default:
261
+ return value;
262
+ }
263
+ }
264
+ /**
265
+ * Utility function to convert a ReturnType name to its value so
266
+ * it can be properly used inside the module runtime.
267
+ */
268
+ function ReturnTypeNameToValue(name) {
269
+ switch (name) {
270
+ case "ANY":
271
+ return ReturnType.Any;
272
+ case "FAILURE":
273
+ return ReturnType.Failure;
274
+ case "SUCCESS":
275
+ return ReturnType.Success;
276
+ default:
277
+ return name;
278
+ }
279
+ }
91
280
  /**
92
281
  * Distinguishes the different kinds of TypeDefs.
93
282
  */
@@ -96,7 +285,7 @@ export var TypeDefKind;
96
285
  /**
97
286
  * A boolean value.
98
287
  */
99
- TypeDefKind["Boolean"] = "BOOLEAN";
288
+ TypeDefKind["Boolean"] = "BOOLEAN_KIND";
100
289
  /**
101
290
  * A boolean value.
102
291
  */
@@ -106,7 +295,7 @@ export var TypeDefKind;
106
295
  *
107
296
  * Always paired with an EnumTypeDef.
108
297
  */
109
- TypeDefKind["Enum"] = "ENUM";
298
+ TypeDefKind["Enum"] = "ENUM_KIND";
110
299
  /**
111
300
  * A GraphQL enum type and its values
112
301
  *
@@ -116,7 +305,7 @@ export var TypeDefKind;
116
305
  /**
117
306
  * A float value.
118
307
  */
119
- TypeDefKind["Float"] = "FLOAT";
308
+ TypeDefKind["Float"] = "FLOAT_KIND";
120
309
  /**
121
310
  * A float value.
122
311
  */
@@ -124,7 +313,7 @@ export var TypeDefKind;
124
313
  /**
125
314
  * A graphql input type, used only when representing the core API via TypeDefs.
126
315
  */
127
- TypeDefKind["Input"] = "INPUT";
316
+ TypeDefKind["Input"] = "INPUT_KIND";
128
317
  /**
129
318
  * A graphql input type, used only when representing the core API via TypeDefs.
130
319
  */
@@ -132,7 +321,7 @@ export var TypeDefKind;
132
321
  /**
133
322
  * An integer value.
134
323
  */
135
- TypeDefKind["Integer"] = "INTEGER";
324
+ TypeDefKind["Integer"] = "INTEGER_KIND";
136
325
  /**
137
326
  * An integer value.
138
327
  */
@@ -142,7 +331,7 @@ export var TypeDefKind;
142
331
  *
143
332
  * A named type of functions that can be matched+implemented by other objects+interfaces.
144
333
  */
145
- TypeDefKind["Interface"] = "INTERFACE";
334
+ TypeDefKind["Interface"] = "INTERFACE_KIND";
146
335
  /**
147
336
  * Always paired with an InterfaceTypeDef.
148
337
  *
@@ -154,7 +343,7 @@ export var TypeDefKind;
154
343
  *
155
344
  * A list of values all having the same type.
156
345
  */
157
- TypeDefKind["List"] = "LIST";
346
+ TypeDefKind["List"] = "LIST_KIND";
158
347
  /**
159
348
  * Always paired with a ListTypeDef.
160
349
  *
@@ -166,7 +355,7 @@ export var TypeDefKind;
166
355
  *
167
356
  * A named type defined in the GraphQL schema, with fields and functions.
168
357
  */
169
- TypeDefKind["Object"] = "OBJECT";
358
+ TypeDefKind["Object"] = "OBJECT_KIND";
170
359
  /**
171
360
  * Always paired with an ObjectTypeDef.
172
361
  *
@@ -176,7 +365,7 @@ export var TypeDefKind;
176
365
  /**
177
366
  * A scalar value of any basic kind.
178
367
  */
179
- TypeDefKind["Scalar"] = "SCALAR";
368
+ TypeDefKind["Scalar"] = "SCALAR_KIND";
180
369
  /**
181
370
  * A scalar value of any basic kind.
182
371
  */
@@ -184,7 +373,7 @@ export var TypeDefKind;
184
373
  /**
185
374
  * A string value.
186
375
  */
187
- TypeDefKind["String"] = "STRING";
376
+ TypeDefKind["String"] = "STRING_KIND";
188
377
  /**
189
378
  * A string value.
190
379
  */
@@ -194,7 +383,7 @@ export var TypeDefKind;
194
383
  *
195
384
  * This is used for functions that have no return value. The outer TypeDef specifying this Kind is always Optional, as the Void is never actually represented.
196
385
  */
197
- TypeDefKind["Void"] = "VOID";
386
+ TypeDefKind["Void"] = "VOID_KIND";
198
387
  /**
199
388
  * A special kind used to signify that no value is returned.
200
389
  *
@@ -202,6 +391,70 @@ export var TypeDefKind;
202
391
  */
203
392
  TypeDefKind["VoidKind"] = "VOID_KIND";
204
393
  })(TypeDefKind || (TypeDefKind = {}));
394
+ /**
395
+ * Utility function to convert a TypeDefKind value to its name so
396
+ * it can be uses as argument to call a exposed function.
397
+ */
398
+ function TypeDefKindValueToName(value) {
399
+ switch (value) {
400
+ case TypeDefKind.Boolean:
401
+ return "BOOLEAN";
402
+ case TypeDefKind.Enum:
403
+ return "ENUM";
404
+ case TypeDefKind.Float:
405
+ return "FLOAT";
406
+ case TypeDefKind.Input:
407
+ return "INPUT";
408
+ case TypeDefKind.Integer:
409
+ return "INTEGER";
410
+ case TypeDefKind.Interface:
411
+ return "INTERFACE";
412
+ case TypeDefKind.List:
413
+ return "LIST";
414
+ case TypeDefKind.Object:
415
+ return "OBJECT";
416
+ case TypeDefKind.Scalar:
417
+ return "SCALAR";
418
+ case TypeDefKind.String:
419
+ return "STRING";
420
+ case TypeDefKind.Void:
421
+ return "VOID";
422
+ default:
423
+ return value;
424
+ }
425
+ }
426
+ /**
427
+ * Utility function to convert a TypeDefKind name to its value so
428
+ * it can be properly used inside the module runtime.
429
+ */
430
+ function TypeDefKindNameToValue(name) {
431
+ switch (name) {
432
+ case "BOOLEAN":
433
+ return TypeDefKind.Boolean;
434
+ case "ENUM":
435
+ return TypeDefKind.Enum;
436
+ case "FLOAT":
437
+ return TypeDefKind.Float;
438
+ case "INPUT":
439
+ return TypeDefKind.Input;
440
+ case "INTEGER":
441
+ return TypeDefKind.Integer;
442
+ case "INTERFACE":
443
+ return TypeDefKind.Interface;
444
+ case "LIST":
445
+ return TypeDefKind.List;
446
+ case "OBJECT":
447
+ return TypeDefKind.Object;
448
+ case "SCALAR":
449
+ return TypeDefKind.Scalar;
450
+ case "STRING":
451
+ return TypeDefKind.String;
452
+ case "VOID":
453
+ return TypeDefKind.Void;
454
+ default:
455
+ return name;
456
+ }
457
+ }
205
458
  export class Binding extends BaseClient {
206
459
  _id = undefined;
207
460
  _asString = undefined;
@@ -462,6 +715,7 @@ export class Container extends BaseClient {
462
715
  _envVariable = undefined;
463
716
  _exitCode = undefined;
464
717
  _export = undefined;
718
+ _exportImage = undefined;
465
719
  _imageRef = undefined;
466
720
  _label = undefined;
467
721
  _platform = undefined;
@@ -475,12 +729,13 @@ export class Container extends BaseClient {
475
729
  /**
476
730
  * Constructor is used for internal usage only, do not create object from it.
477
731
  */
478
- constructor(ctx, _id, _envVariable, _exitCode, _export, _imageRef, _label, _platform, _publish, _stderr, _stdout, _sync, _up, _user, _workdir) {
732
+ constructor(ctx, _id, _envVariable, _exitCode, _export, _exportImage, _imageRef, _label, _platform, _publish, _stderr, _stdout, _sync, _up, _user, _workdir) {
479
733
  super(ctx);
480
734
  this._id = _id;
481
735
  this._envVariable = _envVariable;
482
736
  this._exitCode = _exitCode;
483
737
  this._export = _export;
738
+ this._exportImage = _exportImage;
484
739
  this._imageRef = _imageRef;
485
740
  this._label = _label;
486
741
  this._platform = _platform;
@@ -536,8 +791,11 @@ export class Container extends BaseClient {
536
791
  */
537
792
  asTarball = (opts) => {
538
793
  const metadata = {
539
- forcedCompression: { is_enum: true },
540
- mediaTypes: { is_enum: true },
794
+ forcedCompression: {
795
+ is_enum: true,
796
+ value_to_name: ImageLayerCompressionValueToName,
797
+ },
798
+ mediaTypes: { is_enum: true, value_to_name: ImageMediaTypesValueToName },
541
799
  };
542
800
  const ctx = this._ctx.select("asTarball", { ...opts, __metadata: metadata });
543
801
  return new File(ctx);
@@ -667,8 +925,11 @@ export class Container extends BaseClient {
667
925
  return this._export;
668
926
  }
669
927
  const metadata = {
670
- forcedCompression: { is_enum: true },
671
- mediaTypes: { is_enum: true },
928
+ forcedCompression: {
929
+ is_enum: true,
930
+ value_to_name: ImageLayerCompressionValueToName,
931
+ },
932
+ mediaTypes: { is_enum: true, value_to_name: ImageMediaTypesValueToName },
672
933
  };
673
934
  const ctx = this._ctx.select("export", {
674
935
  path,
@@ -678,6 +939,37 @@ export class Container extends BaseClient {
678
939
  const response = await ctx.execute();
679
940
  return response;
680
941
  };
942
+ /**
943
+ * Exports the container as an image to the host's container image store.
944
+ * @param name Name of image to export to in the host's store
945
+ * @param opts.platformVariants Identifiers for other platform specific containers.
946
+ *
947
+ * Used for multi-platform image.
948
+ * @param opts.forcedCompression Force each layer of the exported image to use the specified compression algorithm.
949
+ *
950
+ * If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
951
+ * @param opts.mediaTypes Use the specified media types for the exported image's layers.
952
+ *
953
+ * Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
954
+ */
955
+ exportImage = async (name, opts) => {
956
+ if (this._exportImage) {
957
+ return;
958
+ }
959
+ const metadata = {
960
+ forcedCompression: {
961
+ is_enum: true,
962
+ value_to_name: ImageLayerCompressionValueToName,
963
+ },
964
+ mediaTypes: { is_enum: true, value_to_name: ImageMediaTypesValueToName },
965
+ };
966
+ const ctx = this._ctx.select("exportImage", {
967
+ name,
968
+ ...opts,
969
+ __metadata: metadata,
970
+ });
971
+ await ctx.execute();
972
+ };
681
973
  /**
682
974
  * Retrieves the list of exposed ports.
683
975
  *
@@ -788,8 +1080,11 @@ export class Container extends BaseClient {
788
1080
  return this._publish;
789
1081
  }
790
1082
  const metadata = {
791
- forcedCompression: { is_enum: true },
792
- mediaTypes: { is_enum: true },
1083
+ forcedCompression: {
1084
+ is_enum: true,
1085
+ value_to_name: ImageLayerCompressionValueToName,
1086
+ },
1087
+ mediaTypes: { is_enum: true, value_to_name: ImageMediaTypesValueToName },
793
1088
  };
794
1089
  const ctx = this._ctx.select("publish", {
795
1090
  address,
@@ -975,7 +1270,7 @@ export class Container extends BaseClient {
975
1270
  */
976
1271
  withExec = (args, opts) => {
977
1272
  const metadata = {
978
- expect: { is_enum: true },
1273
+ expect: { is_enum: true, value_to_name: ReturnTypeValueToName },
979
1274
  };
980
1275
  const ctx = this._ctx.select("withExec", {
981
1276
  args,
@@ -999,7 +1294,7 @@ export class Container extends BaseClient {
999
1294
  */
1000
1295
  withExposedPort = (port, opts) => {
1001
1296
  const metadata = {
1002
- protocol: { is_enum: true },
1297
+ protocol: { is_enum: true, value_to_name: NetworkProtocolValueToName },
1003
1298
  };
1004
1299
  const ctx = this._ctx.select("withExposedPort", {
1005
1300
  port,
@@ -1066,7 +1361,7 @@ export class Container extends BaseClient {
1066
1361
  */
1067
1362
  withMountedCache = (path, cache, opts) => {
1068
1363
  const metadata = {
1069
- sharing: { is_enum: true },
1364
+ sharing: { is_enum: true, value_to_name: CacheSharingModeValueToName },
1070
1365
  };
1071
1366
  const ctx = this._ctx.select("withMountedCache", {
1072
1367
  path,
@@ -1289,7 +1584,7 @@ export class Container extends BaseClient {
1289
1584
  */
1290
1585
  withoutExposedPort = (port, opts) => {
1291
1586
  const metadata = {
1292
- protocol: { is_enum: true },
1587
+ protocol: { is_enum: true, value_to_name: NetworkProtocolValueToName },
1293
1588
  };
1294
1589
  const ctx = this._ctx.select("withoutExposedPort", {
1295
1590
  port,
@@ -1690,6 +1985,15 @@ export class Directory extends BaseClient {
1690
1985
  const ctx = this._ctx.select("withNewFile", { path, contents, ...opts });
1691
1986
  return new Directory(ctx);
1692
1987
  };
1988
+ /**
1989
+ * Retrieves this directory with the given Git-compatible patch applied.
1990
+ * @param patch Patch to apply (e.g., "diff --git a/file.txt b/file.txt\nindex 1234567..abcdef8 100644\n--- a/file.txt\n+++ b/file.txt\n@@ -1,1 +1,1 @@\n-Hello\n+World\n").
1991
+ * @experimental
1992
+ */
1993
+ withPatch = (patch) => {
1994
+ const ctx = this._ctx.select("withPatch", { patch });
1995
+ return new Directory(ctx);
1996
+ };
1693
1997
  /**
1694
1998
  * Return a snapshot with a symlink
1695
1999
  * @param target Location of the file or directory to link to (e.g., "/existing/file").
@@ -3498,6 +3802,13 @@ export class GitRepository extends BaseClient {
3498
3802
  const ctx = this._ctx.select("head");
3499
3803
  return new GitRef(ctx);
3500
3804
  };
3805
+ /**
3806
+ * Returns details for the latest semver tag.
3807
+ */
3808
+ latestVersion = () => {
3809
+ const ctx = this._ctx.select("latestVersion");
3810
+ return new GitRef(ctx);
3811
+ };
3501
3812
  /**
3502
3813
  * Returns details of a ref.
3503
3814
  * @param name Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
@@ -4421,6 +4732,13 @@ export class ModuleSource extends BaseClient {
4421
4732
  const response = await ctx.execute();
4422
4733
  return response;
4423
4734
  };
4735
+ /**
4736
+ * The blueprint referenced by the module source.
4737
+ */
4738
+ blueprint = () => {
4739
+ const ctx = this._ctx.select("blueprint");
4740
+ return new ModuleSource(ctx);
4741
+ };
4424
4742
  /**
4425
4743
  * The ref to clone the root of the git repo from. Only valid for git sources.
4426
4744
  */
@@ -4545,7 +4863,7 @@ export class ModuleSource extends BaseClient {
4545
4863
  }
4546
4864
  const ctx = this._ctx.select("kind");
4547
4865
  const response = await ctx.execute();
4548
- return response;
4866
+ return ModuleSourceKindNameToValue(response);
4549
4867
  };
4550
4868
  /**
4551
4869
  * The full absolute path to the context directory on the caller's host filesystem that this module source is loaded from. Only valid for local module sources.
@@ -4661,6 +4979,14 @@ export class ModuleSource extends BaseClient {
4661
4979
  const response = await ctx.execute();
4662
4980
  return response;
4663
4981
  };
4982
+ /**
4983
+ * Set a blueprint for the module source.
4984
+ * @param blueprint The blueprint module to set.
4985
+ */
4986
+ withBlueprint = (blueprint) => {
4987
+ const ctx = this._ctx.select("withBlueprint", { blueprint });
4988
+ return new ModuleSource(ctx);
4989
+ };
4664
4990
  /**
4665
4991
  * Update the module source with a new client to generate.
4666
4992
  * @param generator The generator to use
@@ -4718,6 +5044,13 @@ export class ModuleSource extends BaseClient {
4718
5044
  const ctx = this._ctx.select("withSourceSubpath", { path });
4719
5045
  return new ModuleSource(ctx);
4720
5046
  };
5047
+ /**
5048
+ * Update the blueprint module to the latest version.
5049
+ */
5050
+ withUpdateBlueprint = () => {
5051
+ const ctx = this._ctx.select("withUpdateBlueprint");
5052
+ return new ModuleSource(ctx);
5053
+ };
4721
5054
  /**
4722
5055
  * Update one or more module dependencies.
4723
5056
  * @param dependencies The dependencies to update.
@@ -4726,6 +5059,13 @@ export class ModuleSource extends BaseClient {
4726
5059
  const ctx = this._ctx.select("withUpdateDependencies", { dependencies });
4727
5060
  return new ModuleSource(ctx);
4728
5061
  };
5062
+ /**
5063
+ * Remove the current blueprint from the module source.
5064
+ */
5065
+ withoutBlueprint = () => {
5066
+ const ctx = this._ctx.select("withoutBlueprint");
5067
+ return new ModuleSource(ctx);
5068
+ };
4729
5069
  /**
4730
5070
  * Remove a client from the module source.
4731
5071
  * @param path The path of the client to remove.
@@ -4917,7 +5257,7 @@ export class Port extends BaseClient {
4917
5257
  }
4918
5258
  const ctx = this._ctx.select("protocol");
4919
5259
  const response = await ctx.execute();
4920
- return response;
5260
+ return NetworkProtocolNameToValue(response);
4921
5261
  };
4922
5262
  }
4923
5263
  /**
@@ -5435,7 +5775,10 @@ export class Client extends BaseClient {
5435
5775
  */
5436
5776
  moduleSource = (refString, opts) => {
5437
5777
  const metadata = {
5438
- requireKind: { is_enum: true },
5778
+ requireKind: {
5779
+ is_enum: true,
5780
+ value_to_name: ModuleSourceKindValueToName,
5781
+ },
5439
5782
  };
5440
5783
  const ctx = this._ctx.select("moduleSource", {
5441
5784
  refString,
@@ -5990,7 +6333,7 @@ export class TypeDef extends BaseClient {
5990
6333
  }
5991
6334
  const ctx = this._ctx.select("kind");
5992
6335
  const response = await ctx.execute();
5993
- return response;
6336
+ return TypeDefKindNameToValue(response);
5994
6337
  };
5995
6338
  /**
5996
6339
  * Whether this type can be set to null. Defaults to false.
@@ -6078,7 +6421,7 @@ export class TypeDef extends BaseClient {
6078
6421
  */
6079
6422
  withKind = (kind) => {
6080
6423
  const metadata = {
6081
- kind: { is_enum: true },
6424
+ kind: { is_enum: true, value_to_name: TypeDefKindValueToName },
6082
6425
  };
6083
6426
  const ctx = this._ctx.select("withKind", { kind, __metadata: metadata });
6084
6427
  return new TypeDef(ctx);
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/common/graphql/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AA2C/C,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAsB1E"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/common/graphql/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAuD/C,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAsB1E"}