@dagger.io/dagger 0.9.6 → 0.9.7

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.
@@ -27,8 +27,7 @@ class BaseClient {
27
27
  export var CacheSharingMode;
28
28
  (function (CacheSharingMode) {
29
29
  /**
30
- * Shares the cache volume amongst many build pipelines,
31
- * but will serialize the writes
30
+ * Shares the cache volume amongst many build pipelines, but will serialize the writes
32
31
  */
33
32
  CacheSharingMode["Locked"] = "LOCKED";
34
33
  /**
@@ -63,13 +62,7 @@ export var ImageMediaTypes;
63
62
  */
64
63
  export var NetworkProtocol;
65
64
  (function (NetworkProtocol) {
66
- /**
67
- * TCP (Transmission Control Protocol)
68
- */
69
65
  NetworkProtocol["Tcp"] = "TCP";
70
- /**
71
- * UDP (User Datagram Protocol)
72
- */
73
66
  NetworkProtocol["Udp"] = "UDP";
74
67
  })(NetworkProtocol || (NetworkProtocol = {}));
75
68
  /**
@@ -78,43 +71,41 @@ export var NetworkProtocol;
78
71
  export var TypeDefKind;
79
72
  (function (TypeDefKind) {
80
73
  /**
81
- * A boolean value
74
+ * A boolean value.
82
75
  */
83
- TypeDefKind["Booleankind"] = "BooleanKind";
76
+ TypeDefKind["BooleanKind"] = "BOOLEAN_KIND";
84
77
  /**
85
- * An integer value
78
+ * An integer value.
86
79
  */
87
- TypeDefKind["Integerkind"] = "IntegerKind";
80
+ TypeDefKind["IntegerKind"] = "INTEGER_KIND";
88
81
  /**
89
82
  * A named type of functions that can be matched+implemented by other objects+interfaces.
90
83
  *
91
84
  * Always paired with an InterfaceTypeDef.
92
85
  */
93
- TypeDefKind["Interfacekind"] = "InterfaceKind";
86
+ TypeDefKind["InterfaceKind"] = "INTERFACE_KIND";
94
87
  /**
95
88
  * A list of values all having the same type.
96
89
  *
97
90
  * Always paired with a ListTypeDef.
98
91
  */
99
- TypeDefKind["Listkind"] = "ListKind";
92
+ TypeDefKind["ListKind"] = "LIST_KIND";
100
93
  /**
101
94
  * A named type defined in the GraphQL schema, with fields and functions.
102
95
  *
103
96
  * Always paired with an ObjectTypeDef.
104
97
  */
105
- TypeDefKind["Objectkind"] = "ObjectKind";
98
+ TypeDefKind["ObjectKind"] = "OBJECT_KIND";
106
99
  /**
107
- * A string value
100
+ * A string value.
108
101
  */
109
- TypeDefKind["Stringkind"] = "StringKind";
102
+ TypeDefKind["StringKind"] = "STRING_KIND";
110
103
  /**
111
104
  * A special kind used to signify that no value is returned.
112
105
  *
113
- * This is used for functions that have no return value. The outer TypeDef
114
- * specifying this Kind is always Optional, as the Void is never actually
115
- * represented.
106
+ * 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.
116
107
  */
117
- TypeDefKind["Voidkind"] = "VoidKind";
108
+ TypeDefKind["VoidKind"] = "VOID_KIND";
118
109
  })(TypeDefKind || (TypeDefKind = {}));
119
110
  /**
120
111
  * A directory whose contents persist across runs.
@@ -128,6 +119,9 @@ export class CacheVolume extends BaseClient {
128
119
  super(parent);
129
120
  this._id = _id;
130
121
  }
122
+ /**
123
+ * A unique identifier for this CacheVolume.
124
+ */
131
125
  id = async () => {
132
126
  if (this._id) {
133
127
  return this._id;
@@ -142,7 +136,7 @@ export class CacheVolume extends BaseClient {
142
136
  };
143
137
  }
144
138
  /**
145
- * An OCI-compatible container, also known as a docker container.
139
+ * An OCI-compatible container, also known as a Docker container.
146
140
  */
147
141
  export class Container extends BaseClient {
148
142
  _id = undefined;
@@ -178,7 +172,7 @@ export class Container extends BaseClient {
178
172
  this._workdir = _workdir;
179
173
  }
180
174
  /**
181
- * A unique identifier for this container.
175
+ * A unique identifier for this Container.
182
176
  */
183
177
  id = async () => {
184
178
  if (this._id) {
@@ -211,15 +205,14 @@ export class Container extends BaseClient {
211
205
  /**
212
206
  * Returns a File representing the container serialized to a tarball.
213
207
  * @param opts.platformVariants Identifiers for other platform specific containers.
214
- * Used for multi-platform image.
208
+ *
209
+ * Used for multi-platform images.
215
210
  * @param opts.forcedCompression Force each layer of the image to use the specified compression algorithm.
216
- * If this is unset, then if a layer already has a compressed blob in the engine's
217
- * cache, that will be used (this can result in a mix of compression algorithms for
218
- * different layers). If this is unset and a layer has no compressed blob in the
219
- * engine's cache, then it will be compressed using Gzip.
220
- * @param opts.mediaTypes Use the specified media types for the image's layers. Defaults to OCI, which
221
- * is largely compatible with most recent container runtimes, but Docker may be needed
222
- * for older runtimes without OCI support.
211
+ *
212
+ * 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.
213
+ * @param opts.mediaTypes Use the specified media types for the image's layers.
214
+ *
215
+ * Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
223
216
  */
224
217
  asTarball = (opts) => {
225
218
  const metadata = {
@@ -241,17 +234,13 @@ export class Container extends BaseClient {
241
234
  * Initializes this container from a Dockerfile build.
242
235
  * @param context Directory context used by the Dockerfile.
243
236
  * @param opts.dockerfile Path to the Dockerfile to use.
244
- *
245
- * Default: './Dockerfile'.
246
- * @param opts.buildArgs Additional build arguments.
247
237
  * @param opts.target Target build stage to build.
238
+ * @param opts.buildArgs Additional build arguments.
248
239
  * @param opts.secrets Secrets to pass to the build.
249
240
  *
250
241
  * They will be mounted at /run/secrets/[secret-name] in the build container
251
242
  *
252
- * They can be accessed in the Dockerfile using the "secret" mount type
253
- * and mount path /run/secrets/[secret-name]
254
- * e.g. RUN --mount=type=secret,id=my-secret curl url?token=$(cat /run/secrets/my-secret)"
243
+ * They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl http://example.com?token=$(cat /run/secrets/my-secret)
255
244
  */
256
245
  build = (context, opts) => {
257
246
  return new Container({
@@ -334,18 +323,24 @@ export class Container extends BaseClient {
334
323
  operation: "envVariables",
335
324
  },
336
325
  {
337
- operation: "name value",
326
+ operation: "id",
338
327
  },
339
328
  ], await this._ctx.connection());
340
329
  return response.map((r) => new EnvVariable({
341
- queryTree: this.queryTree,
330
+ queryTree: [
331
+ {
332
+ operation: "loadEnvVariableFromID",
333
+ args: { id: r.id },
334
+ },
335
+ ],
342
336
  ctx: this._ctx,
343
- }, r.name, r.value));
337
+ }, r.id));
344
338
  };
345
339
  /**
346
340
  * EXPERIMENTAL API! Subject to change/removal at any time.
347
341
  *
348
- * experimentalWithAllGPUs configures all available GPUs on the host to be accessible to this container.
342
+ * Configures all available GPUs on the host to be accessible to this container.
343
+ *
349
344
  * This currently works for Nvidia devices only.
350
345
  */
351
346
  experimentalWithAllGPUs = () => {
@@ -362,8 +357,10 @@ export class Container extends BaseClient {
362
357
  /**
363
358
  * EXPERIMENTAL API! Subject to change/removal at any time.
364
359
  *
365
- * experimentalWithGPU configures the provided list of devices to be accesible to this container.
360
+ * Configures the provided list of devices to be accesible to this container.
361
+ *
366
362
  * This currently works for Nvidia devices only.
363
+ * @param devices List of devices to be accessible to this container.
367
364
  */
368
365
  experimentalWithGPU = (devices) => {
369
366
  return new Container({
@@ -378,22 +375,23 @@ export class Container extends BaseClient {
378
375
  });
379
376
  };
380
377
  /**
381
- * Writes the container as an OCI tarball to the destination file path on the host for the specified platform variants.
378
+ * Writes the container as an OCI tarball to the destination file path on the host.
382
379
  *
383
380
  * Return true on success.
384
- * It can also publishes platform variants.
381
+ *
382
+ * It can also export platform variants.
385
383
  * @param path Host's destination path (e.g., "./tarball").
384
+ *
386
385
  * Path can be relative to the engine's workdir or absolute.
387
386
  * @param opts.platformVariants Identifiers for other platform specific containers.
387
+ *
388
388
  * Used for multi-platform image.
389
389
  * @param opts.forcedCompression Force each layer of the exported image to use the specified compression algorithm.
390
- * If this is unset, then if a layer already has a compressed blob in the engine's
391
- * cache, that will be used (this can result in a mix of compression algorithms for
392
- * different layers). If this is unset and a layer has no compressed blob in the
393
- * engine's cache, then it will be compressed using Gzip.
394
- * @param opts.mediaTypes Use the specified media types for the exported image's layers. Defaults to OCI, which
395
- * is largely compatible with most recent container runtimes, but Docker may be needed
396
- * for older runtimes without OCI support.
390
+ *
391
+ * 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.
392
+ * @param opts.mediaTypes Use the specified media types for the exported image's layers.
393
+ *
394
+ * Defaults to OCI, which is largely compatible with most recent container runtimes, but Docker may be needed for older runtimes without OCI support.
397
395
  */
398
396
  export = async (path, opts) => {
399
397
  if (this._export) {
@@ -415,8 +413,7 @@ export class Container extends BaseClient {
415
413
  /**
416
414
  * Retrieves the list of exposed ports.
417
415
  *
418
- * This includes ports already exposed by the image, even if not
419
- * explicitly added with dagger.
416
+ * This includes ports already exposed by the image, even if not explicitly added with dagger.
420
417
  */
421
418
  exposedPorts = async () => {
422
419
  const response = await computeQuery([
@@ -425,13 +422,18 @@ export class Container extends BaseClient {
425
422
  operation: "exposedPorts",
426
423
  },
427
424
  {
428
- operation: "description port protocol",
425
+ operation: "id",
429
426
  },
430
427
  ], await this._ctx.connection());
431
428
  return response.map((r) => new Port({
432
- queryTree: this.queryTree,
429
+ queryTree: [
430
+ {
431
+ operation: "loadPortFromID",
432
+ args: { id: r.id },
433
+ },
434
+ ],
433
435
  ctx: this._ctx,
434
- }, r.description, r.port, r.protocol));
436
+ }, r.id));
435
437
  };
436
438
  /**
437
439
  * Retrieves a file at the given path.
@@ -486,12 +488,8 @@ export class Container extends BaseClient {
486
488
  };
487
489
  /**
488
490
  * Reads the container from an OCI tarball.
489
- *
490
- * NOTE: this involves unpacking the tarball to an OCI store on the host at
491
- * $XDG_CACHE_DIR/dagger/oci. This directory can be removed whenever you like.
492
491
  * @param source File to read the container from.
493
- * @param opts.tag Identifies the tag to import from the archive, if the archive bundles
494
- * multiple tags.
492
+ * @param opts.tag Identifies the tag to import from the archive, if the archive bundles multiple tags.
495
493
  */
496
494
  import_ = (source, opts) => {
497
495
  return new Container({
@@ -507,6 +505,7 @@ export class Container extends BaseClient {
507
505
  };
508
506
  /**
509
507
  * Retrieves the value of the specified label.
508
+ * @param name The name of the label (e.g., "org.opencontainers.artifact.created").
510
509
  */
511
510
  label = async (name) => {
512
511
  if (this._label) {
@@ -531,13 +530,18 @@ export class Container extends BaseClient {
531
530
  operation: "labels",
532
531
  },
533
532
  {
534
- operation: "name value",
533
+ operation: "id",
535
534
  },
536
535
  ], await this._ctx.connection());
537
536
  return response.map((r) => new Label({
538
- queryTree: this.queryTree,
537
+ queryTree: [
538
+ {
539
+ operation: "loadLabelFromID",
540
+ args: { id: r.id },
541
+ },
542
+ ],
539
543
  ctx: this._ctx,
540
- }, r.name, r.value));
544
+ }, r.id));
541
545
  };
542
546
  /**
543
547
  * Retrieves the list of paths where a directory is mounted.
@@ -552,10 +556,10 @@ export class Container extends BaseClient {
552
556
  return response;
553
557
  };
554
558
  /**
555
- * Creates a named sub-pipeline
556
- * @param name Pipeline name.
557
- * @param opts.description Pipeline description.
558
- * @param opts.labels Pipeline labels.
559
+ * Creates a named sub-pipeline.
560
+ * @param name Name of the sub-pipeline.
561
+ * @param opts.description Description of the sub-pipeline.
562
+ * @param opts.labels Labels to apply to the sub-pipeline.
559
563
  */
560
564
  pipeline = (name, opts) => {
561
565
  return new Container({
@@ -588,20 +592,20 @@ export class Container extends BaseClient {
588
592
  * Publishes this container as a new image to the specified address.
589
593
  *
590
594
  * Publish returns a fully qualified ref.
595
+ *
591
596
  * It can also publish platform variants.
592
597
  * @param address Registry's address to publish the image to.
593
598
  *
594
599
  * Formatted as [host]/[user]/[repo]:[tag] (e.g. "docker.io/dagger/dagger:main").
595
600
  * @param opts.platformVariants Identifiers for other platform specific containers.
601
+ *
596
602
  * Used for multi-platform image.
597
603
  * @param opts.forcedCompression Force each layer of the published image to use the specified compression algorithm.
598
- * If this is unset, then if a layer already has a compressed blob in the engine's
599
- * cache, that will be used (this can result in a mix of compression algorithms for
600
- * different layers). If this is unset and a layer has no compressed blob in the
601
- * engine's cache, then it will be compressed using Gzip.
602
- * @param opts.mediaTypes Use the specified media types for the published image's layers. Defaults to OCI, which
603
- * is largely compatible with most recent registries, but Docker may be needed for older
604
- * registries without OCI support.
604
+ *
605
+ * 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.
606
+ * @param opts.mediaTypes Use the specified media types for the published image's layers.
607
+ *
608
+ * Defaults to OCI, which is largely compatible with most recent registries, but Docker may be needed for older registries without OCI support.
605
609
  */
606
610
  publish = async (address, opts) => {
607
611
  if (this._publish) {
@@ -635,8 +639,7 @@ export class Container extends BaseClient {
635
639
  });
636
640
  };
637
641
  /**
638
- * Return a websocket endpoint that, if connected to, will start the container with a TTY streamed
639
- * over the websocket.
642
+ * Return a websocket endpoint that, if connected to, will start the container with a TTY streamed over the websocket.
640
643
  *
641
644
  * Primarily intended for internal use with the dagger CLI.
642
645
  */
@@ -735,8 +738,8 @@ export class Container extends BaseClient {
735
738
  * Retrieves this container plus a directory written at the given path.
736
739
  * @param path Location of the written directory (e.g., "/tmp/directory").
737
740
  * @param directory Identifier of the directory to write
738
- * @param opts.exclude Patterns to exclude in the written directory (e.g., ["node_modules/**", ".gitignore", ".git/"]).
739
- * @param opts.include Patterns to include in the written directory (e.g., ["*.go", "go.mod", "go.sum"]).
741
+ * @param opts.exclude Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
742
+ * @param opts.include Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
740
743
  * @param opts.owner A user:group to set for the directory and its contents.
741
744
  *
742
745
  * The user and group can either be an ID (1000:1000) or a name (foo:bar).
@@ -776,8 +779,7 @@ export class Container extends BaseClient {
776
779
  * Retrieves this container plus the given environment variable.
777
780
  * @param name The name of the environment variable (e.g., "HOST").
778
781
  * @param value The value of the environment variable. (e.g., "localhost").
779
- * @param opts.expand Replace `${VAR}` or $VAR in the value according to the current environment
780
- * variables defined in the container (e.g., "/opt/bin:$PATH").
782
+ * @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").
781
783
  */
782
784
  withEnvVariable = (name, value, opts) => {
783
785
  return new Container({
@@ -802,12 +804,8 @@ export class Container extends BaseClient {
802
804
  * @param opts.redirectStderr Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
803
805
  * @param opts.experimentalPrivilegedNesting Provides dagger access to the executed command.
804
806
  *
805
- * Do not use this option unless you trust the command being executed.
806
- * The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
807
- * @param opts.insecureRootCapabilities Execute the command with all root capabilities. This is similar to running a command
808
- * with "sudo" or executing `docker run` with the `--privileged` flag. Containerization
809
- * does not provide any security guarantees when using this option. It should only be used
810
- * when absolutely necessary and only with trusted commands.
807
+ * Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
808
+ * @param opts.insecureRootCapabilities Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
811
809
  */
812
810
  withExec = (args, opts) => {
813
811
  return new Container({
@@ -827,6 +825,7 @@ export class Container extends BaseClient {
827
825
  * Exposed ports serve two purposes:
828
826
  *
829
827
  * - For health checks and introspection, when running services
828
+ *
830
829
  * - For setting the EXPOSE OCI field when publishing the container
831
830
  * @param port Port number to expose
832
831
  * @param opts.protocol Transport layer network protocol
@@ -852,8 +851,6 @@ export class Container extends BaseClient {
852
851
  * @param path Location of the copied file (e.g., "/tmp/file.txt").
853
852
  * @param source Identifier of the file to copy.
854
853
  * @param opts.permissions Permission given to the copied file (e.g., 0600).
855
- *
856
- * Default: 0644.
857
854
  * @param opts.owner A user:group to set for the file.
858
855
  *
859
856
  * The user and group can either be an ID (1000:1000) or a name (foo:bar).
@@ -873,8 +870,7 @@ export class Container extends BaseClient {
873
870
  });
874
871
  };
875
872
  /**
876
- * Indicate that subsequent operations should be featured more prominently in
877
- * the UI.
873
+ * Indicate that subsequent operations should be featured more prominently in the UI.
878
874
  */
879
875
  withFocus = () => {
880
876
  return new Container({
@@ -912,9 +908,7 @@ export class Container extends BaseClient {
912
908
  * @param opts.sharing Sharing mode of the cache volume.
913
909
  * @param opts.owner A user:group to set for the mounted cache directory.
914
910
  *
915
- * Note that this changes the ownership of the specified mount along with the
916
- * initial filesystem provided by source (if any). It does not have any effect
917
- * if/when the cache has already been created.
911
+ * Note that this changes the ownership of the specified mount along with the initial filesystem provided by source (if any). It does not have any effect if/when the cache has already been created.
918
912
  *
919
913
  * The user and group can either be an ID (1000:1000) or a name (foo:bar).
920
914
  *
@@ -989,9 +983,8 @@ export class Container extends BaseClient {
989
983
  *
990
984
  * If the group is omitted, it defaults to the same as the user.
991
985
  * @param opts.mode Permission given to the mounted secret (e.g., 0600).
992
- * This option requires an owner to be set to be active.
993
986
  *
994
- * Default: 0400.
987
+ * This option requires an owner to be set to be active.
995
988
  */
996
989
  withMountedSecret = (path, source, opts) => {
997
990
  return new Container({
@@ -1026,8 +1019,6 @@ export class Container extends BaseClient {
1026
1019
  * @param path Location of the written file (e.g., "/tmp/file.txt").
1027
1020
  * @param opts.contents Content of the file to write (e.g., "Hello world!").
1028
1021
  * @param opts.permissions Permission given to the written file (e.g., 0600).
1029
- *
1030
- * Default: 0644.
1031
1022
  * @param opts.owner A user:group to set for the file.
1032
1023
  *
1033
1024
  * The user and group can either be an ID (1000:1000) or a name (foo:bar).
@@ -1049,6 +1040,7 @@ export class Container extends BaseClient {
1049
1040
  /**
1050
1041
  * Retrieves this container with a registry authentication for a given address.
1051
1042
  * @param address Registry's address to bind the authentication to.
1043
+ *
1052
1044
  * Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
1053
1045
  * @param username The username of the registry's account (e.g., "Dagger").
1054
1046
  * @param secret The API key, password or token to authenticate to this registry.
@@ -1066,7 +1058,8 @@ export class Container extends BaseClient {
1066
1058
  });
1067
1059
  };
1068
1060
  /**
1069
- * Initializes this container from this DirectoryID.
1061
+ * Retrieves the container with the given directory mounted to /.
1062
+ * @param directory Directory to mount.
1070
1063
  */
1071
1064
  withRootfs = (directory) => {
1072
1065
  return new Container({
@@ -1100,8 +1093,7 @@ export class Container extends BaseClient {
1100
1093
  /**
1101
1094
  * Establish a runtime dependency on a service.
1102
1095
  *
1103
- * The service will be started automatically when needed and detached when it is
1104
- * no longer needed, executing the default command if none is set.
1096
+ * The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
1105
1097
  *
1106
1098
  * The service will be reachable from the container via the provided hostname alias.
1107
1099
  *
@@ -1242,8 +1234,7 @@ export class Container extends BaseClient {
1242
1234
  });
1243
1235
  };
1244
1236
  /**
1245
- * Indicate that subsequent operations should not be featured more prominently
1246
- * in the UI.
1237
+ * Indicate that subsequent operations should not be featured more prominently in the UI.
1247
1238
  *
1248
1239
  * This is the initial state of all containers.
1249
1240
  */
@@ -1293,6 +1284,7 @@ export class Container extends BaseClient {
1293
1284
  /**
1294
1285
  * Retrieves this container without the registry authentication of a given address.
1295
1286
  * @param address Registry's address to remove the authentication from.
1287
+ *
1296
1288
  * Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
1297
1289
  */
1298
1290
  withoutRegistryAuth = (address) => {
@@ -1396,7 +1388,7 @@ export class Directory extends BaseClient {
1396
1388
  this._sync = _sync;
1397
1389
  }
1398
1390
  /**
1399
- * The content-addressed identifier of the directory.
1391
+ * A unique identifier for this Directory.
1400
1392
  */
1401
1393
  id = async () => {
1402
1394
  if (this._id) {
@@ -1412,16 +1404,11 @@ export class Directory extends BaseClient {
1412
1404
  };
1413
1405
  /**
1414
1406
  * Load the directory as a Dagger module
1415
- * @param opts.sourceSubpath An optional subpath of the directory which contains the module's source
1416
- * code.
1407
+ * @param opts.sourceSubpath An optional subpath of the directory which contains the module's source code.
1417
1408
  *
1418
- * This is needed when the module code is in a subdirectory but requires
1419
- * parent directories to be loaded in order to execute. For example, the
1420
- * module source code may need a go.mod, project.toml, package.json, etc. file
1421
- * from a parent directory.
1409
+ * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
1422
1410
  *
1423
- * If not set, the module source code is loaded from the root of the
1424
- * directory.
1411
+ * If not set, the module source code is loaded from the root of the directory.
1425
1412
  */
1426
1413
  asModule = (opts) => {
1427
1414
  return new Module_({
@@ -1469,12 +1456,10 @@ export class Directory extends BaseClient {
1469
1456
  };
1470
1457
  /**
1471
1458
  * Builds a new Docker container from this directory.
1472
- * @param opts.dockerfile Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
1473
- *
1474
- * Defaults: './Dockerfile'.
1475
1459
  * @param opts.platform The platform to build.
1476
- * @param opts.buildArgs Build arguments to use in the build.
1460
+ * @param opts.dockerfile Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
1477
1461
  * @param opts.target Target build stage to build.
1462
+ * @param opts.buildArgs Build arguments to use in the build.
1478
1463
  * @param opts.secrets Secrets to pass to the build.
1479
1464
  *
1480
1465
  * They will be mounted at /run/secrets/[secret-name].
@@ -1553,10 +1538,10 @@ export class Directory extends BaseClient {
1553
1538
  return response;
1554
1539
  };
1555
1540
  /**
1556
- * Creates a named sub-pipeline
1557
- * @param name Pipeline name.
1558
- * @param opts.description Pipeline description.
1559
- * @param opts.labels Pipeline labels.
1541
+ * Creates a named sub-pipeline.
1542
+ * @param name Name of the sub-pipeline.
1543
+ * @param opts.description Description of the sub-pipeline.
1544
+ * @param opts.labels Labels to apply to the sub-pipeline.
1560
1545
  */
1561
1546
  pipeline = (name, opts) => {
1562
1547
  return new Directory({
@@ -1606,8 +1591,6 @@ export class Directory extends BaseClient {
1606
1591
  * @param path Location of the copied file (e.g., "/file.txt").
1607
1592
  * @param source Identifier of the file to copy.
1608
1593
  * @param opts.permissions Permission given to the copied file (e.g., 0600).
1609
- *
1610
- * Default: 0644.
1611
1594
  */
1612
1595
  withFile = (path, source, opts) => {
1613
1596
  return new Directory({
@@ -1625,8 +1608,6 @@ export class Directory extends BaseClient {
1625
1608
  * Retrieves this directory plus a new directory created at the given path.
1626
1609
  * @param path Location of the directory created (e.g., "/logs").
1627
1610
  * @param opts.permissions Permission granted to the created directory (e.g., 0777).
1628
- *
1629
- * Default: 0755.
1630
1611
  */
1631
1612
  withNewDirectory = (path, opts) => {
1632
1613
  return new Directory({
@@ -1645,8 +1626,6 @@ export class Directory extends BaseClient {
1645
1626
  * @param path Location of the written file (e.g., "/file.txt").
1646
1627
  * @param contents Content of the written file (e.g., "Hello world!").
1647
1628
  * @param opts.permissions Permission given to the copied file (e.g., 0600).
1648
- *
1649
- * Default: 0644.
1650
1629
  */
1651
1630
  withNewFile = (path, contents, opts) => {
1652
1631
  return new Directory({
@@ -1720,22 +1699,36 @@ export class Directory extends BaseClient {
1720
1699
  };
1721
1700
  }
1722
1701
  /**
1723
- * A simple key value object that represents an environment variable.
1702
+ * An environment variable name and value.
1724
1703
  */
1725
1704
  export class EnvVariable extends BaseClient {
1705
+ _id = undefined;
1726
1706
  _name = undefined;
1727
1707
  _value = undefined;
1728
1708
  /**
1729
1709
  * Constructor is used for internal usage only, do not create object from it.
1730
1710
  */
1731
- constructor(parent, _name, _value) {
1711
+ constructor(parent, _id, _name, _value) {
1732
1712
  super(parent);
1713
+ this._id = _id;
1733
1714
  this._name = _name;
1734
1715
  this._value = _value;
1735
1716
  }
1736
1717
  /**
1737
- * The environment variable name.
1718
+ * A unique identifier for this EnvVariable.
1738
1719
  */
1720
+ id = async () => {
1721
+ if (this._id) {
1722
+ return this._id;
1723
+ }
1724
+ const response = await computeQuery([
1725
+ ...this._queryTree,
1726
+ {
1727
+ operation: "id",
1728
+ },
1729
+ ], await this._ctx.connection());
1730
+ return response;
1731
+ };
1739
1732
  name = async () => {
1740
1733
  if (this._name) {
1741
1734
  return this._name;
@@ -1748,9 +1741,6 @@ export class EnvVariable extends BaseClient {
1748
1741
  ], await this._ctx.connection());
1749
1742
  return response;
1750
1743
  };
1751
- /**
1752
- * The environment variable value.
1753
- */
1754
1744
  value = async () => {
1755
1745
  if (this._value) {
1756
1746
  return this._value;
@@ -1766,23 +1756,37 @@ export class EnvVariable extends BaseClient {
1766
1756
  }
1767
1757
  /**
1768
1758
  * A definition of a field on a custom object defined in a Module.
1769
- * A field on an object has a static value, as opposed to a function on an
1770
- * object whose value is computed by invoking code (and can accept arguments).
1759
+ *
1760
+ * A field on an object has a static value, as opposed to a function on an object whose value is computed by invoking code (and can accept arguments).
1771
1761
  */
1772
1762
  export class FieldTypeDef extends BaseClient {
1763
+ _id = undefined;
1773
1764
  _description = undefined;
1774
1765
  _name = undefined;
1775
1766
  /**
1776
1767
  * Constructor is used for internal usage only, do not create object from it.
1777
1768
  */
1778
- constructor(parent, _description, _name) {
1769
+ constructor(parent, _id, _description, _name) {
1779
1770
  super(parent);
1771
+ this._id = _id;
1780
1772
  this._description = _description;
1781
1773
  this._name = _name;
1782
1774
  }
1783
1775
  /**
1784
- * A doc string for the field, if any
1776
+ * A unique identifier for this FieldTypeDef.
1785
1777
  */
1778
+ id = async () => {
1779
+ if (this._id) {
1780
+ return this._id;
1781
+ }
1782
+ const response = await computeQuery([
1783
+ ...this._queryTree,
1784
+ {
1785
+ operation: "id",
1786
+ },
1787
+ ], await this._ctx.connection());
1788
+ return response;
1789
+ };
1786
1790
  description = async () => {
1787
1791
  if (this._description) {
1788
1792
  return this._description;
@@ -1795,9 +1799,6 @@ export class FieldTypeDef extends BaseClient {
1795
1799
  ], await this._ctx.connection());
1796
1800
  return response;
1797
1801
  };
1798
- /**
1799
- * The name of the field in the object
1800
- */
1801
1802
  name = async () => {
1802
1803
  if (this._name) {
1803
1804
  return this._name;
@@ -1810,9 +1811,6 @@ export class FieldTypeDef extends BaseClient {
1810
1811
  ], await this._ctx.connection());
1811
1812
  return response;
1812
1813
  };
1813
- /**
1814
- * The type of the field
1815
- */
1816
1814
  typeDef = () => {
1817
1815
  return new TypeDef({
1818
1816
  queryTree: [
@@ -1832,21 +1830,23 @@ export class File extends BaseClient {
1832
1830
  _id = undefined;
1833
1831
  _contents = undefined;
1834
1832
  _export = undefined;
1833
+ _name = undefined;
1835
1834
  _size = undefined;
1836
1835
  _sync = undefined;
1837
1836
  /**
1838
1837
  * Constructor is used for internal usage only, do not create object from it.
1839
1838
  */
1840
- constructor(parent, _id, _contents, _export, _size, _sync) {
1839
+ constructor(parent, _id, _contents, _export, _name, _size, _sync) {
1841
1840
  super(parent);
1842
1841
  this._id = _id;
1843
1842
  this._contents = _contents;
1844
1843
  this._export = _export;
1844
+ this._name = _name;
1845
1845
  this._size = _size;
1846
1846
  this._sync = _sync;
1847
1847
  }
1848
1848
  /**
1849
- * Retrieves the content-addressed identifier of the file.
1849
+ * A unique identifier for this File.
1850
1850
  */
1851
1851
  id = async () => {
1852
1852
  if (this._id) {
@@ -1878,8 +1878,7 @@ export class File extends BaseClient {
1878
1878
  /**
1879
1879
  * Writes the file to a file path on the host.
1880
1880
  * @param path Location of the written directory (e.g., "output.txt").
1881
- * @param opts.allowParentDirPath If allowParentDirPath is true, the path argument can be a directory path, in which case
1882
- * the file will be created in that directory.
1881
+ * @param opts.allowParentDirPath If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
1883
1882
  */
1884
1883
  export = async (path, opts) => {
1885
1884
  if (this._export) {
@@ -1895,7 +1894,22 @@ export class File extends BaseClient {
1895
1894
  return response;
1896
1895
  };
1897
1896
  /**
1898
- * Gets the size of the file, in bytes.
1897
+ * Retrieves the name of the file.
1898
+ */
1899
+ name = async () => {
1900
+ if (this._name) {
1901
+ return this._name;
1902
+ }
1903
+ const response = await computeQuery([
1904
+ ...this._queryTree,
1905
+ {
1906
+ operation: "name",
1907
+ },
1908
+ ], await this._ctx.connection());
1909
+ return response;
1910
+ };
1911
+ /**
1912
+ * Retrieves the size of the file, in bytes.
1899
1913
  */
1900
1914
  size = async () => {
1901
1915
  if (this._size) {
@@ -1951,8 +1965,7 @@ export class File extends BaseClient {
1951
1965
  /**
1952
1966
  * Function represents a resolver provided by a Module.
1953
1967
  *
1954
- * A function always evaluates against a parent object and is given a set of
1955
- * named arguments.
1968
+ * A function always evaluates against a parent object and is given a set of named arguments.
1956
1969
  */
1957
1970
  export class Function_ extends BaseClient {
1958
1971
  _id = undefined;
@@ -1968,7 +1981,7 @@ export class Function_ extends BaseClient {
1968
1981
  this._name = _name;
1969
1982
  }
1970
1983
  /**
1971
- * The ID of the function
1984
+ * A unique identifier for this Function.
1972
1985
  */
1973
1986
  id = async () => {
1974
1987
  if (this._id) {
@@ -1982,9 +1995,6 @@ export class Function_ extends BaseClient {
1982
1995
  ], await this._ctx.connection());
1983
1996
  return response;
1984
1997
  };
1985
- /**
1986
- * Arguments accepted by this function, if any
1987
- */
1988
1998
  args = async () => {
1989
1999
  const response = await computeQuery([
1990
2000
  ...this._queryTree,
@@ -1996,13 +2006,15 @@ export class Function_ extends BaseClient {
1996
2006
  },
1997
2007
  ], await this._ctx.connection());
1998
2008
  return response.map((r) => new FunctionArg({
1999
- queryTree: this.queryTree,
2009
+ queryTree: [
2010
+ {
2011
+ operation: "loadFunctionArgFromID",
2012
+ args: { id: r.id },
2013
+ },
2014
+ ],
2000
2015
  ctx: this._ctx,
2001
2016
  }, r.id));
2002
2017
  };
2003
- /**
2004
- * A doc string for the function, if any
2005
- */
2006
2018
  description = async () => {
2007
2019
  if (this._description) {
2008
2020
  return this._description;
@@ -2015,9 +2027,6 @@ export class Function_ extends BaseClient {
2015
2027
  ], await this._ctx.connection());
2016
2028
  return response;
2017
2029
  };
2018
- /**
2019
- * The name of the function
2020
- */
2021
2030
  name = async () => {
2022
2031
  if (this._name) {
2023
2032
  return this._name;
@@ -2030,9 +2039,6 @@ export class Function_ extends BaseClient {
2030
2039
  ], await this._ctx.connection());
2031
2040
  return response;
2032
2041
  };
2033
- /**
2034
- * The type returned by this function
2035
- */
2036
2042
  returnType = () => {
2037
2043
  return new TypeDef({
2038
2044
  queryTree: [
@@ -2064,7 +2070,8 @@ export class Function_ extends BaseClient {
2064
2070
  });
2065
2071
  };
2066
2072
  /**
2067
- * Returns the function with the doc string
2073
+ * Returns the function with the given doc string.
2074
+ * @param description The doc string to set.
2068
2075
  */
2069
2076
  withDescription = (description) => {
2070
2077
  return new Function_({
@@ -2090,8 +2097,7 @@ export class Function_ extends BaseClient {
2090
2097
  /**
2091
2098
  * An argument accepted by a function.
2092
2099
  *
2093
- * This is a specification for an argument at function definition time, not an
2094
- * argument passed at function call time.
2100
+ * This is a specification for an argument at function definition time, not an argument passed at function call time.
2095
2101
  */
2096
2102
  export class FunctionArg extends BaseClient {
2097
2103
  _id = undefined;
@@ -2109,7 +2115,7 @@ export class FunctionArg extends BaseClient {
2109
2115
  this._name = _name;
2110
2116
  }
2111
2117
  /**
2112
- * The ID of the argument
2118
+ * A unique identifier for this FunctionArg.
2113
2119
  */
2114
2120
  id = async () => {
2115
2121
  if (this._id) {
@@ -2123,9 +2129,6 @@ export class FunctionArg extends BaseClient {
2123
2129
  ], await this._ctx.connection());
2124
2130
  return response;
2125
2131
  };
2126
- /**
2127
- * A default value to use for this argument when not explicitly set by the caller, if any
2128
- */
2129
2132
  defaultValue = async () => {
2130
2133
  if (this._defaultValue) {
2131
2134
  return this._defaultValue;
@@ -2138,9 +2141,6 @@ export class FunctionArg extends BaseClient {
2138
2141
  ], await this._ctx.connection());
2139
2142
  return response;
2140
2143
  };
2141
- /**
2142
- * A doc string for the argument, if any
2143
- */
2144
2144
  description = async () => {
2145
2145
  if (this._description) {
2146
2146
  return this._description;
@@ -2153,9 +2153,6 @@ export class FunctionArg extends BaseClient {
2153
2153
  ], await this._ctx.connection());
2154
2154
  return response;
2155
2155
  };
2156
- /**
2157
- * The name of the argument
2158
- */
2159
2156
  name = async () => {
2160
2157
  if (this._name) {
2161
2158
  return this._name;
@@ -2168,9 +2165,6 @@ export class FunctionArg extends BaseClient {
2168
2165
  ], await this._ctx.connection());
2169
2166
  return response;
2170
2167
  };
2171
- /**
2172
- * The type of the argument
2173
- */
2174
2168
  typeDef = () => {
2175
2169
  return new TypeDef({
2176
2170
  queryTree: [
@@ -2183,7 +2177,11 @@ export class FunctionArg extends BaseClient {
2183
2177
  });
2184
2178
  };
2185
2179
  }
2180
+ /**
2181
+ * An active function call.
2182
+ */
2186
2183
  export class FunctionCall extends BaseClient {
2184
+ _id = undefined;
2187
2185
  _name = undefined;
2188
2186
  _parent = undefined;
2189
2187
  _parentName = undefined;
@@ -2191,16 +2189,29 @@ export class FunctionCall extends BaseClient {
2191
2189
  /**
2192
2190
  * Constructor is used for internal usage only, do not create object from it.
2193
2191
  */
2194
- constructor(parent, _name, _parent, _parentName, _returnValue) {
2192
+ constructor(parent, _id, _name, _parent, _parentName, _returnValue) {
2195
2193
  super(parent);
2194
+ this._id = _id;
2196
2195
  this._name = _name;
2197
2196
  this._parent = _parent;
2198
2197
  this._parentName = _parentName;
2199
2198
  this._returnValue = _returnValue;
2200
2199
  }
2201
2200
  /**
2202
- * The argument values the function is being invoked with.
2201
+ * A unique identifier for this FunctionCall.
2203
2202
  */
2203
+ id = async () => {
2204
+ if (this._id) {
2205
+ return this._id;
2206
+ }
2207
+ const response = await computeQuery([
2208
+ ...this._queryTree,
2209
+ {
2210
+ operation: "id",
2211
+ },
2212
+ ], await this._ctx.connection());
2213
+ return response;
2214
+ };
2204
2215
  inputArgs = async () => {
2205
2216
  const response = await computeQuery([
2206
2217
  ...this._queryTree,
@@ -2208,17 +2219,19 @@ export class FunctionCall extends BaseClient {
2208
2219
  operation: "inputArgs",
2209
2220
  },
2210
2221
  {
2211
- operation: "name value",
2222
+ operation: "id",
2212
2223
  },
2213
2224
  ], await this._ctx.connection());
2214
2225
  return response.map((r) => new FunctionCallArgValue({
2215
- queryTree: this.queryTree,
2226
+ queryTree: [
2227
+ {
2228
+ operation: "loadFunctionCallArgValueFromID",
2229
+ args: { id: r.id },
2230
+ },
2231
+ ],
2216
2232
  ctx: this._ctx,
2217
- }, r.name, r.value));
2233
+ }, r.id));
2218
2234
  };
2219
- /**
2220
- * The name of the function being called.
2221
- */
2222
2235
  name = async () => {
2223
2236
  if (this._name) {
2224
2237
  return this._name;
@@ -2231,10 +2244,6 @@ export class FunctionCall extends BaseClient {
2231
2244
  ], await this._ctx.connection());
2232
2245
  return response;
2233
2246
  };
2234
- /**
2235
- * The value of the parent object of the function being called.
2236
- * If the function is "top-level" to the module, this is always an empty object.
2237
- */
2238
2247
  parent = async () => {
2239
2248
  if (this._parent) {
2240
2249
  return this._parent;
@@ -2247,10 +2256,6 @@ export class FunctionCall extends BaseClient {
2247
2256
  ], await this._ctx.connection());
2248
2257
  return response;
2249
2258
  };
2250
- /**
2251
- * The name of the parent object of the function being called.
2252
- * If the function is "top-level" to the module, this is the name of the module.
2253
- */
2254
2259
  parentName = async () => {
2255
2260
  if (this._parentName) {
2256
2261
  return this._parentName;
@@ -2265,7 +2270,7 @@ export class FunctionCall extends BaseClient {
2265
2270
  };
2266
2271
  /**
2267
2272
  * Set the return value of the function call to the provided value.
2268
- * The value should be a string of the JSON serialization of the return value.
2273
+ * @param value JSON serialization of the return value.
2269
2274
  */
2270
2275
  returnValue = async (value) => {
2271
2276
  if (this._returnValue) {
@@ -2281,20 +2286,37 @@ export class FunctionCall extends BaseClient {
2281
2286
  return response;
2282
2287
  };
2283
2288
  }
2289
+ /**
2290
+ * A value passed as a named argument to a function call.
2291
+ */
2284
2292
  export class FunctionCallArgValue extends BaseClient {
2293
+ _id = undefined;
2285
2294
  _name = undefined;
2286
2295
  _value = undefined;
2287
2296
  /**
2288
2297
  * Constructor is used for internal usage only, do not create object from it.
2289
2298
  */
2290
- constructor(parent, _name, _value) {
2299
+ constructor(parent, _id, _name, _value) {
2291
2300
  super(parent);
2301
+ this._id = _id;
2292
2302
  this._name = _name;
2293
2303
  this._value = _value;
2294
2304
  }
2295
2305
  /**
2296
- * The name of the argument.
2306
+ * A unique identifier for this FunctionCallArgValue.
2297
2307
  */
2308
+ id = async () => {
2309
+ if (this._id) {
2310
+ return this._id;
2311
+ }
2312
+ const response = await computeQuery([
2313
+ ...this._queryTree,
2314
+ {
2315
+ operation: "id",
2316
+ },
2317
+ ], await this._ctx.connection());
2318
+ return response;
2319
+ };
2298
2320
  name = async () => {
2299
2321
  if (this._name) {
2300
2322
  return this._name;
@@ -2307,9 +2329,6 @@ export class FunctionCallArgValue extends BaseClient {
2307
2329
  ], await this._ctx.connection());
2308
2330
  return response;
2309
2331
  };
2310
- /**
2311
- * The value of the argument represented as a string of the JSON serialization.
2312
- */
2313
2332
  value = async () => {
2314
2333
  if (this._value) {
2315
2334
  return this._value;
@@ -2323,6 +2342,9 @@ export class FunctionCallArgValue extends BaseClient {
2323
2342
  return response;
2324
2343
  };
2325
2344
  }
2345
+ /**
2346
+ * The result of running an SDK's codegen.
2347
+ */
2326
2348
  export class GeneratedCode extends BaseClient {
2327
2349
  _id = undefined;
2328
2350
  /**
@@ -2332,6 +2354,9 @@ export class GeneratedCode extends BaseClient {
2332
2354
  super(parent);
2333
2355
  this._id = _id;
2334
2356
  }
2357
+ /**
2358
+ * A unique identifier for this GeneratedCode.
2359
+ */
2335
2360
  id = async () => {
2336
2361
  if (this._id) {
2337
2362
  return this._id;
@@ -2344,9 +2369,6 @@ export class GeneratedCode extends BaseClient {
2344
2369
  ], await this._ctx.connection());
2345
2370
  return response;
2346
2371
  };
2347
- /**
2348
- * The directory containing the generated code
2349
- */
2350
2372
  code = () => {
2351
2373
  return new Directory({
2352
2374
  queryTree: [
@@ -2358,9 +2380,6 @@ export class GeneratedCode extends BaseClient {
2358
2380
  ctx: this._ctx,
2359
2381
  });
2360
2382
  };
2361
- /**
2362
- * List of paths to mark generated in version control (i.e. .gitattributes)
2363
- */
2364
2383
  vcsGeneratedPaths = async () => {
2365
2384
  const response = await computeQuery([
2366
2385
  ...this._queryTree,
@@ -2370,9 +2389,6 @@ export class GeneratedCode extends BaseClient {
2370
2389
  ], await this._ctx.connection());
2371
2390
  return response;
2372
2391
  };
2373
- /**
2374
- * List of paths to ignore in version control (i.e. .gitignore)
2375
- */
2376
2392
  vcsIgnoredPaths = async () => {
2377
2393
  const response = await computeQuery([
2378
2394
  ...this._queryTree,
@@ -2383,7 +2399,7 @@ export class GeneratedCode extends BaseClient {
2383
2399
  return response;
2384
2400
  };
2385
2401
  /**
2386
- * Set the list of paths to mark generated in version control
2402
+ * Set the list of paths to mark generated in version control.
2387
2403
  */
2388
2404
  withVCSGeneratedPaths = (paths) => {
2389
2405
  return new GeneratedCode({
@@ -2398,7 +2414,7 @@ export class GeneratedCode extends BaseClient {
2398
2414
  });
2399
2415
  };
2400
2416
  /**
2401
- * Set the list of paths to ignore in version control
2417
+ * Set the list of paths to ignore in version control.
2402
2418
  */
2403
2419
  withVCSIgnoredPaths = (paths) => {
2404
2420
  return new GeneratedCode({
@@ -2422,7 +2438,7 @@ export class GeneratedCode extends BaseClient {
2422
2438
  };
2423
2439
  }
2424
2440
  /**
2425
- * A git ref (tag, branch or commit).
2441
+ * A git ref (tag, branch, or commit).
2426
2442
  */
2427
2443
  export class GitRef extends BaseClient {
2428
2444
  _id = undefined;
@@ -2436,7 +2452,7 @@ export class GitRef extends BaseClient {
2436
2452
  this._commit = _commit;
2437
2453
  }
2438
2454
  /**
2439
- * Retrieves the content-addressed identifier of the git ref.
2455
+ * A unique identifier for this GitRef.
2440
2456
  */
2441
2457
  id = async () => {
2442
2458
  if (this._id) {
@@ -2467,6 +2483,8 @@ export class GitRef extends BaseClient {
2467
2483
  };
2468
2484
  /**
2469
2485
  * The filesystem tree at this ref.
2486
+ * @param opts.sshKnownHosts DEPRECATED: This option should be passed to `git` instead.
2487
+ * @param opts.sshAuthSocket DEPRECATED: This option should be passed to `git` instead.
2470
2488
  */
2471
2489
  tree = (opts) => {
2472
2490
  return new Directory({
@@ -2494,7 +2512,7 @@ export class GitRepository extends BaseClient {
2494
2512
  this._id = _id;
2495
2513
  }
2496
2514
  /**
2497
- * Retrieves the content-addressed identifier of the git repository.
2515
+ * A unique identifier for this GitRepository.
2498
2516
  */
2499
2517
  id = async () => {
2500
2518
  if (this._id) {
@@ -2509,7 +2527,7 @@ export class GitRepository extends BaseClient {
2509
2527
  return response;
2510
2528
  };
2511
2529
  /**
2512
- * Returns details on one branch.
2530
+ * Returns details of a branch.
2513
2531
  * @param name Branch's name (e.g., "main").
2514
2532
  */
2515
2533
  branch = (name) => {
@@ -2525,7 +2543,7 @@ export class GitRepository extends BaseClient {
2525
2543
  });
2526
2544
  };
2527
2545
  /**
2528
- * Returns details on one commit.
2546
+ * Returns details of a commit.
2529
2547
  * @param id Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
2530
2548
  */
2531
2549
  commit = (id) => {
@@ -2541,7 +2559,7 @@ export class GitRepository extends BaseClient {
2541
2559
  });
2542
2560
  };
2543
2561
  /**
2544
- * Returns details on one tag.
2562
+ * Returns details of a tag.
2545
2563
  * @param name Tag's name (e.g., "v0.3.9").
2546
2564
  */
2547
2565
  tag = (name) => {
@@ -2558,15 +2576,32 @@ export class GitRepository extends BaseClient {
2558
2576
  };
2559
2577
  }
2560
2578
  /**
2561
- * Information about the host execution environment.
2579
+ * Information about the host environment.
2562
2580
  */
2563
2581
  export class Host extends BaseClient {
2582
+ _id = undefined;
2564
2583
  /**
2565
2584
  * Constructor is used for internal usage only, do not create object from it.
2566
2585
  */
2567
- constructor(parent) {
2586
+ constructor(parent, _id) {
2568
2587
  super(parent);
2588
+ this._id = _id;
2569
2589
  }
2590
+ /**
2591
+ * A unique identifier for this Host.
2592
+ */
2593
+ id = async () => {
2594
+ if (this._id) {
2595
+ return this._id;
2596
+ }
2597
+ const response = await computeQuery([
2598
+ ...this._queryTree,
2599
+ {
2600
+ operation: "id",
2601
+ },
2602
+ ], await this._ctx.connection());
2603
+ return response;
2604
+ };
2570
2605
  /**
2571
2606
  * Accesses a directory on the host.
2572
2607
  * @param path Location of the directory to access (e.g., ".").
@@ -2603,21 +2638,20 @@ export class Host extends BaseClient {
2603
2638
  };
2604
2639
  /**
2605
2640
  * Creates a service that forwards traffic to a specified address via the host.
2606
- * @param ports Ports to expose via the service, forwarding through the host network.
2641
+ * @param opts.host Upstream host to forward traffic to.
2642
+ * @param opts.ports Ports to expose via the service, forwarding through the host network.
2607
2643
  *
2608
- * If a port's frontend is unspecified or 0, it defaults to the same as the
2609
- * backend port.
2644
+ * If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
2610
2645
  *
2611
2646
  * An empty set of ports is not valid; an error will be returned.
2612
- * @param opts.host Upstream host to forward traffic to.
2613
2647
  */
2614
- service = (ports, opts) => {
2648
+ service = (opts) => {
2615
2649
  return new Service({
2616
2650
  queryTree: [
2617
2651
  ...this._queryTree,
2618
2652
  {
2619
2653
  operation: "service",
2620
- args: { ports, ...opts },
2654
+ args: { ...opts },
2621
2655
  },
2622
2656
  ],
2623
2657
  ctx: this._ctx,
@@ -2625,6 +2659,7 @@ export class Host extends BaseClient {
2625
2659
  };
2626
2660
  /**
2627
2661
  * Sets a secret given a user-defined name and the file path on the host, and returns the secret.
2662
+ *
2628
2663
  * The file is limited to a size of 512000 bytes.
2629
2664
  * @param name The user defined name for this secret.
2630
2665
  * @param path Location of the file to set as a secret.
@@ -2644,20 +2679,16 @@ export class Host extends BaseClient {
2644
2679
  /**
2645
2680
  * Creates a tunnel that forwards traffic from the host to a service.
2646
2681
  * @param service Service to send traffic from the tunnel.
2647
- * @param opts.native Map each service port to the same port on the host, as if the service were
2648
- * running natively.
2649
- *
2650
- * Note: enabling may result in port conflicts.
2651
2682
  * @param opts.ports Configure explicit port forwarding rules for the tunnel.
2652
2683
  *
2653
- * If a port's frontend is unspecified or 0, a random port will be chosen by
2654
- * the host.
2684
+ * If a port's frontend is unspecified or 0, a random port will be chosen by the host.
2655
2685
  *
2656
- * If no ports are given, all of the service's ports are forwarded. If native
2657
- * is true, each port maps to the same port on the host. If native is false,
2658
- * each port maps to a random port chosen by the host.
2686
+ * If no ports are given, all of the service's ports are forwarded. If native is true, each port maps to the same port on the host. If native is false, each port maps to a random port chosen by the host.
2659
2687
  *
2660
2688
  * If ports are given and native is true, the ports are additive.
2689
+ * @param opts.native Map each service port to the same port on the host, as if the service were running natively.
2690
+ *
2691
+ * Note: enabling may result in port conflicts.
2661
2692
  */
2662
2693
  tunnel = (service, opts) => {
2663
2694
  return new Service({
@@ -2692,21 +2723,35 @@ export class Host extends BaseClient {
2692
2723
  * A definition of a custom interface defined in a Module.
2693
2724
  */
2694
2725
  export class InterfaceTypeDef extends BaseClient {
2726
+ _id = undefined;
2695
2727
  _description = undefined;
2696
2728
  _name = undefined;
2697
2729
  _sourceModuleName = undefined;
2698
2730
  /**
2699
2731
  * Constructor is used for internal usage only, do not create object from it.
2700
2732
  */
2701
- constructor(parent, _description, _name, _sourceModuleName) {
2733
+ constructor(parent, _id, _description, _name, _sourceModuleName) {
2702
2734
  super(parent);
2735
+ this._id = _id;
2703
2736
  this._description = _description;
2704
2737
  this._name = _name;
2705
2738
  this._sourceModuleName = _sourceModuleName;
2706
2739
  }
2707
2740
  /**
2708
- * The doc string for the interface, if any
2741
+ * A unique identifier for this InterfaceTypeDef.
2709
2742
  */
2743
+ id = async () => {
2744
+ if (this._id) {
2745
+ return this._id;
2746
+ }
2747
+ const response = await computeQuery([
2748
+ ...this._queryTree,
2749
+ {
2750
+ operation: "id",
2751
+ },
2752
+ ], await this._ctx.connection());
2753
+ return response;
2754
+ };
2710
2755
  description = async () => {
2711
2756
  if (this._description) {
2712
2757
  return this._description;
@@ -2719,9 +2764,6 @@ export class InterfaceTypeDef extends BaseClient {
2719
2764
  ], await this._ctx.connection());
2720
2765
  return response;
2721
2766
  };
2722
- /**
2723
- * Functions defined on this interface, if any
2724
- */
2725
2767
  functions = async () => {
2726
2768
  const response = await computeQuery([
2727
2769
  ...this._queryTree,
@@ -2733,13 +2775,15 @@ export class InterfaceTypeDef extends BaseClient {
2733
2775
  },
2734
2776
  ], await this._ctx.connection());
2735
2777
  return response.map((r) => new Function_({
2736
- queryTree: this.queryTree,
2778
+ queryTree: [
2779
+ {
2780
+ operation: "loadFunction_FromID",
2781
+ args: { id: r.id },
2782
+ },
2783
+ ],
2737
2784
  ctx: this._ctx,
2738
2785
  }, r.id));
2739
2786
  };
2740
- /**
2741
- * The name of the interface
2742
- */
2743
2787
  name = async () => {
2744
2788
  if (this._name) {
2745
2789
  return this._name;
@@ -2752,9 +2796,6 @@ export class InterfaceTypeDef extends BaseClient {
2752
2796
  ], await this._ctx.connection());
2753
2797
  return response;
2754
2798
  };
2755
- /**
2756
- * If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
2757
- */
2758
2799
  sourceModuleName = async () => {
2759
2800
  if (this._sourceModuleName) {
2760
2801
  return this._sourceModuleName;
@@ -2772,19 +2813,33 @@ export class InterfaceTypeDef extends BaseClient {
2772
2813
  * A simple key value object that represents a label.
2773
2814
  */
2774
2815
  export class Label extends BaseClient {
2816
+ _id = undefined;
2775
2817
  _name = undefined;
2776
2818
  _value = undefined;
2777
2819
  /**
2778
2820
  * Constructor is used for internal usage only, do not create object from it.
2779
2821
  */
2780
- constructor(parent, _name, _value) {
2822
+ constructor(parent, _id, _name, _value) {
2781
2823
  super(parent);
2824
+ this._id = _id;
2782
2825
  this._name = _name;
2783
2826
  this._value = _value;
2784
2827
  }
2785
2828
  /**
2786
- * The label name.
2829
+ * A unique identifier for this Label.
2787
2830
  */
2831
+ id = async () => {
2832
+ if (this._id) {
2833
+ return this._id;
2834
+ }
2835
+ const response = await computeQuery([
2836
+ ...this._queryTree,
2837
+ {
2838
+ operation: "id",
2839
+ },
2840
+ ], await this._ctx.connection());
2841
+ return response;
2842
+ };
2788
2843
  name = async () => {
2789
2844
  if (this._name) {
2790
2845
  return this._name;
@@ -2797,9 +2852,6 @@ export class Label extends BaseClient {
2797
2852
  ], await this._ctx.connection());
2798
2853
  return response;
2799
2854
  };
2800
- /**
2801
- * The label value.
2802
- */
2803
2855
  value = async () => {
2804
2856
  if (this._value) {
2805
2857
  return this._value;
@@ -2817,15 +2869,29 @@ export class Label extends BaseClient {
2817
2869
  * A definition of a list type in a Module.
2818
2870
  */
2819
2871
  export class ListTypeDef extends BaseClient {
2872
+ _id = undefined;
2820
2873
  /**
2821
2874
  * Constructor is used for internal usage only, do not create object from it.
2822
2875
  */
2823
- constructor(parent) {
2876
+ constructor(parent, _id) {
2824
2877
  super(parent);
2878
+ this._id = _id;
2825
2879
  }
2826
2880
  /**
2827
- * The type of the elements in the list
2881
+ * A unique identifier for this ListTypeDef.
2828
2882
  */
2883
+ id = async () => {
2884
+ if (this._id) {
2885
+ return this._id;
2886
+ }
2887
+ const response = await computeQuery([
2888
+ ...this._queryTree,
2889
+ {
2890
+ operation: "id",
2891
+ },
2892
+ ], await this._ctx.connection());
2893
+ return response;
2894
+ };
2829
2895
  elementTypeDef = () => {
2830
2896
  return new TypeDef({
2831
2897
  queryTree: [
@@ -2838,27 +2904,30 @@ export class ListTypeDef extends BaseClient {
2838
2904
  });
2839
2905
  };
2840
2906
  }
2907
+ /**
2908
+ * A Dagger module.
2909
+ */
2841
2910
  export class Module_ extends BaseClient {
2842
2911
  _id = undefined;
2843
2912
  _description = undefined;
2844
2913
  _name = undefined;
2845
2914
  _sdk = undefined;
2846
2915
  _serve = undefined;
2847
- _sourceDirectorySubPath = undefined;
2916
+ _sourceDirectorySubpath = undefined;
2848
2917
  /**
2849
2918
  * Constructor is used for internal usage only, do not create object from it.
2850
2919
  */
2851
- constructor(parent, _id, _description, _name, _sdk, _serve, _sourceDirectorySubPath) {
2920
+ constructor(parent, _id, _description, _name, _sdk, _serve, _sourceDirectorySubpath) {
2852
2921
  super(parent);
2853
2922
  this._id = _id;
2854
2923
  this._description = _description;
2855
2924
  this._name = _name;
2856
2925
  this._sdk = _sdk;
2857
2926
  this._serve = _serve;
2858
- this._sourceDirectorySubPath = _sourceDirectorySubPath;
2927
+ this._sourceDirectorySubpath = _sourceDirectorySubpath;
2859
2928
  }
2860
2929
  /**
2861
- * The ID of the module
2930
+ * A unique identifier for this Module.
2862
2931
  */
2863
2932
  id = async () => {
2864
2933
  if (this._id) {
@@ -2872,9 +2941,6 @@ export class Module_ extends BaseClient {
2872
2941
  ], await this._ctx.connection());
2873
2942
  return response;
2874
2943
  };
2875
- /**
2876
- * Modules used by this module
2877
- */
2878
2944
  dependencies = async () => {
2879
2945
  const response = await computeQuery([
2880
2946
  ...this._queryTree,
@@ -2886,13 +2952,15 @@ export class Module_ extends BaseClient {
2886
2952
  },
2887
2953
  ], await this._ctx.connection());
2888
2954
  return response.map((r) => new Module_({
2889
- queryTree: this.queryTree,
2955
+ queryTree: [
2956
+ {
2957
+ operation: "loadModule_FromID",
2958
+ args: { id: r.id },
2959
+ },
2960
+ ],
2890
2961
  ctx: this._ctx,
2891
2962
  }, r.id));
2892
2963
  };
2893
- /**
2894
- * The dependencies as configured by the module
2895
- */
2896
2964
  dependencyConfig = async () => {
2897
2965
  const response = await computeQuery([
2898
2966
  ...this._queryTree,
@@ -2902,9 +2970,6 @@ export class Module_ extends BaseClient {
2902
2970
  ], await this._ctx.connection());
2903
2971
  return response;
2904
2972
  };
2905
- /**
2906
- * The doc string of the module, if any
2907
- */
2908
2973
  description = async () => {
2909
2974
  if (this._description) {
2910
2975
  return this._description;
@@ -2917,9 +2982,6 @@ export class Module_ extends BaseClient {
2917
2982
  ], await this._ctx.connection());
2918
2983
  return response;
2919
2984
  };
2920
- /**
2921
- * The code generated by the SDK's runtime
2922
- */
2923
2985
  generatedCode = () => {
2924
2986
  return new GeneratedCode({
2925
2987
  queryTree: [
@@ -2932,8 +2994,19 @@ export class Module_ extends BaseClient {
2932
2994
  });
2933
2995
  };
2934
2996
  /**
2935
- * Interfaces served by this module
2997
+ * Retrieves the module with the objects loaded via its SDK.
2936
2998
  */
2999
+ initialize = () => {
3000
+ return new Module_({
3001
+ queryTree: [
3002
+ ...this._queryTree,
3003
+ {
3004
+ operation: "initialize",
3005
+ },
3006
+ ],
3007
+ ctx: this._ctx,
3008
+ });
3009
+ };
2937
3010
  interfaces = async () => {
2938
3011
  const response = await computeQuery([
2939
3012
  ...this._queryTree,
@@ -2945,13 +3018,15 @@ export class Module_ extends BaseClient {
2945
3018
  },
2946
3019
  ], await this._ctx.connection());
2947
3020
  return response.map((r) => new TypeDef({
2948
- queryTree: this.queryTree,
3021
+ queryTree: [
3022
+ {
3023
+ operation: "loadTypeDefFromID",
3024
+ args: { id: r.id },
3025
+ },
3026
+ ],
2949
3027
  ctx: this._ctx,
2950
3028
  }, r.id));
2951
3029
  };
2952
- /**
2953
- * The name of the module
2954
- */
2955
3030
  name = async () => {
2956
3031
  if (this._name) {
2957
3032
  return this._name;
@@ -2964,9 +3039,6 @@ export class Module_ extends BaseClient {
2964
3039
  ], await this._ctx.connection());
2965
3040
  return response;
2966
3041
  };
2967
- /**
2968
- * Objects served by this module
2969
- */
2970
3042
  objects = async () => {
2971
3043
  const response = await computeQuery([
2972
3044
  ...this._queryTree,
@@ -2978,13 +3050,15 @@ export class Module_ extends BaseClient {
2978
3050
  },
2979
3051
  ], await this._ctx.connection());
2980
3052
  return response.map((r) => new TypeDef({
2981
- queryTree: this.queryTree,
3053
+ queryTree: [
3054
+ {
3055
+ operation: "loadTypeDefFromID",
3056
+ args: { id: r.id },
3057
+ },
3058
+ ],
2982
3059
  ctx: this._ctx,
2983
3060
  }, r.id));
2984
3061
  };
2985
- /**
2986
- * The SDK used by this module. Either a name of a builtin SDK or a module ref pointing to the SDK's implementation.
2987
- */
2988
3062
  sdk = async () => {
2989
3063
  if (this._sdk) {
2990
3064
  return this._sdk;
@@ -2999,8 +3073,8 @@ export class Module_ extends BaseClient {
2999
3073
  };
3000
3074
  /**
3001
3075
  * Serve a module's API in the current session.
3002
- * Note: this can only be called once per session.
3003
- * In the future, it could return a stream or service to remove the side effect.
3076
+ *
3077
+ * Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
3004
3078
  */
3005
3079
  serve = async () => {
3006
3080
  if (this._serve) {
@@ -3014,9 +3088,6 @@ export class Module_ extends BaseClient {
3014
3088
  ], await this._ctx.connection());
3015
3089
  return response;
3016
3090
  };
3017
- /**
3018
- * The directory containing the module's source code
3019
- */
3020
3091
  sourceDirectory = () => {
3021
3092
  return new Directory({
3022
3093
  queryTree: [
@@ -3028,17 +3099,14 @@ export class Module_ extends BaseClient {
3028
3099
  ctx: this._ctx,
3029
3100
  });
3030
3101
  };
3031
- /**
3032
- * The module's subpath within the source directory
3033
- */
3034
- sourceDirectorySubPath = async () => {
3035
- if (this._sourceDirectorySubPath) {
3036
- return this._sourceDirectorySubPath;
3102
+ sourceDirectorySubpath = async () => {
3103
+ if (this._sourceDirectorySubpath) {
3104
+ return this._sourceDirectorySubpath;
3037
3105
  }
3038
3106
  const response = await computeQuery([
3039
3107
  ...this._queryTree,
3040
3108
  {
3041
- operation: "sourceDirectorySubPath",
3109
+ operation: "sourceDirectorySubpath",
3042
3110
  },
3043
3111
  ], await this._ctx.connection());
3044
3112
  return response;
@@ -3059,7 +3127,7 @@ export class Module_ extends BaseClient {
3059
3127
  });
3060
3128
  };
3061
3129
  /**
3062
- * This module plus the given Object type and associated functions
3130
+ * This module plus the given Object type and associated functions.
3063
3131
  */
3064
3132
  withObject = (object) => {
3065
3133
  return new Module_({
@@ -3073,6 +3141,27 @@ export class Module_ extends BaseClient {
3073
3141
  ctx: this._ctx,
3074
3142
  });
3075
3143
  };
3144
+ /**
3145
+ * Retrieves the module with basic configuration loaded, ready for initialization.
3146
+ * @param directory The directory containing the module's source code.
3147
+ * @param opts.subpath An optional subpath of the directory which contains the module's source code.
3148
+ *
3149
+ * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
3150
+ *
3151
+ * If not set, the module source code is loaded from the root of the directory.
3152
+ */
3153
+ withSource = (directory, opts) => {
3154
+ return new Module_({
3155
+ queryTree: [
3156
+ ...this._queryTree,
3157
+ {
3158
+ operation: "withSource",
3159
+ args: { directory, ...opts },
3160
+ },
3161
+ ],
3162
+ ctx: this._ctx,
3163
+ });
3164
+ };
3076
3165
  /**
3077
3166
  * Call the provided function with current Module.
3078
3167
  *
@@ -3086,21 +3175,35 @@ export class Module_ extends BaseClient {
3086
3175
  * Static configuration for a module (e.g. parsed contents of dagger.json)
3087
3176
  */
3088
3177
  export class ModuleConfig extends BaseClient {
3178
+ _id = undefined;
3089
3179
  _name = undefined;
3090
3180
  _root = undefined;
3091
3181
  _sdk = undefined;
3092
3182
  /**
3093
3183
  * Constructor is used for internal usage only, do not create object from it.
3094
3184
  */
3095
- constructor(parent, _name, _root, _sdk) {
3185
+ constructor(parent, _id, _name, _root, _sdk) {
3096
3186
  super(parent);
3187
+ this._id = _id;
3097
3188
  this._name = _name;
3098
3189
  this._root = _root;
3099
3190
  this._sdk = _sdk;
3100
3191
  }
3101
3192
  /**
3102
- * Modules that this module depends on.
3193
+ * A unique identifier for this ModuleConfig.
3103
3194
  */
3195
+ id = async () => {
3196
+ if (this._id) {
3197
+ return this._id;
3198
+ }
3199
+ const response = await computeQuery([
3200
+ ...this._queryTree,
3201
+ {
3202
+ operation: "id",
3203
+ },
3204
+ ], await this._ctx.connection());
3205
+ return response;
3206
+ };
3104
3207
  dependencies = async () => {
3105
3208
  const response = await computeQuery([
3106
3209
  ...this._queryTree,
@@ -3110,9 +3213,6 @@ export class ModuleConfig extends BaseClient {
3110
3213
  ], await this._ctx.connection());
3111
3214
  return response;
3112
3215
  };
3113
- /**
3114
- * Exclude these file globs when loading the module root.
3115
- */
3116
3216
  exclude = async () => {
3117
3217
  const response = await computeQuery([
3118
3218
  ...this._queryTree,
@@ -3122,9 +3222,6 @@ export class ModuleConfig extends BaseClient {
3122
3222
  ], await this._ctx.connection());
3123
3223
  return response;
3124
3224
  };
3125
- /**
3126
- * Include only these file globs when loading the module root.
3127
- */
3128
3225
  include = async () => {
3129
3226
  const response = await computeQuery([
3130
3227
  ...this._queryTree,
@@ -3134,9 +3231,6 @@ export class ModuleConfig extends BaseClient {
3134
3231
  ], await this._ctx.connection());
3135
3232
  return response;
3136
3233
  };
3137
- /**
3138
- * The name of the module.
3139
- */
3140
3234
  name = async () => {
3141
3235
  if (this._name) {
3142
3236
  return this._name;
@@ -3149,9 +3243,6 @@ export class ModuleConfig extends BaseClient {
3149
3243
  ], await this._ctx.connection());
3150
3244
  return response;
3151
3245
  };
3152
- /**
3153
- * The root directory of the module's project, which may be above the module source code.
3154
- */
3155
3246
  root = async () => {
3156
3247
  if (this._root) {
3157
3248
  return this._root;
@@ -3164,9 +3255,6 @@ export class ModuleConfig extends BaseClient {
3164
3255
  ], await this._ctx.connection());
3165
3256
  return response;
3166
3257
  };
3167
- /**
3168
- * Either the name of a built-in SDK ('go', 'python', etc.) OR a module reference pointing to the SDK's module implementation.
3169
- */
3170
3258
  sdk = async () => {
3171
3259
  if (this._sdk) {
3172
3260
  return this._sdk;
@@ -3184,21 +3272,35 @@ export class ModuleConfig extends BaseClient {
3184
3272
  * A definition of a custom object defined in a Module.
3185
3273
  */
3186
3274
  export class ObjectTypeDef extends BaseClient {
3275
+ _id = undefined;
3187
3276
  _description = undefined;
3188
3277
  _name = undefined;
3189
3278
  _sourceModuleName = undefined;
3190
3279
  /**
3191
3280
  * Constructor is used for internal usage only, do not create object from it.
3192
3281
  */
3193
- constructor(parent, _description, _name, _sourceModuleName) {
3282
+ constructor(parent, _id, _description, _name, _sourceModuleName) {
3194
3283
  super(parent);
3284
+ this._id = _id;
3195
3285
  this._description = _description;
3196
3286
  this._name = _name;
3197
3287
  this._sourceModuleName = _sourceModuleName;
3198
3288
  }
3199
3289
  /**
3200
- * The function used to construct new instances of this object, if any
3290
+ * A unique identifier for this ObjectTypeDef.
3201
3291
  */
3292
+ id = async () => {
3293
+ if (this._id) {
3294
+ return this._id;
3295
+ }
3296
+ const response = await computeQuery([
3297
+ ...this._queryTree,
3298
+ {
3299
+ operation: "id",
3300
+ },
3301
+ ], await this._ctx.connection());
3302
+ return response;
3303
+ };
3202
3304
  constructor_ = () => {
3203
3305
  return new Function_({
3204
3306
  queryTree: [
@@ -3210,9 +3312,6 @@ export class ObjectTypeDef extends BaseClient {
3210
3312
  ctx: this._ctx,
3211
3313
  });
3212
3314
  };
3213
- /**
3214
- * The doc string for the object, if any
3215
- */
3216
3315
  description = async () => {
3217
3316
  if (this._description) {
3218
3317
  return this._description;
@@ -3225,9 +3324,6 @@ export class ObjectTypeDef extends BaseClient {
3225
3324
  ], await this._ctx.connection());
3226
3325
  return response;
3227
3326
  };
3228
- /**
3229
- * Static fields defined on this object, if any
3230
- */
3231
3327
  fields = async () => {
3232
3328
  const response = await computeQuery([
3233
3329
  ...this._queryTree,
@@ -3235,17 +3331,19 @@ export class ObjectTypeDef extends BaseClient {
3235
3331
  operation: "fields",
3236
3332
  },
3237
3333
  {
3238
- operation: "description name",
3334
+ operation: "id",
3239
3335
  },
3240
3336
  ], await this._ctx.connection());
3241
3337
  return response.map((r) => new FieldTypeDef({
3242
- queryTree: this.queryTree,
3338
+ queryTree: [
3339
+ {
3340
+ operation: "loadFieldTypeDefFromID",
3341
+ args: { id: r.id },
3342
+ },
3343
+ ],
3243
3344
  ctx: this._ctx,
3244
- }, r.description, r.name));
3345
+ }, r.id));
3245
3346
  };
3246
- /**
3247
- * Functions defined on this object, if any
3248
- */
3249
3347
  functions = async () => {
3250
3348
  const response = await computeQuery([
3251
3349
  ...this._queryTree,
@@ -3257,13 +3355,15 @@ export class ObjectTypeDef extends BaseClient {
3257
3355
  },
3258
3356
  ], await this._ctx.connection());
3259
3357
  return response.map((r) => new Function_({
3260
- queryTree: this.queryTree,
3358
+ queryTree: [
3359
+ {
3360
+ operation: "loadFunction_FromID",
3361
+ args: { id: r.id },
3362
+ },
3363
+ ],
3261
3364
  ctx: this._ctx,
3262
3365
  }, r.id));
3263
3366
  };
3264
- /**
3265
- * The name of the object
3266
- */
3267
3367
  name = async () => {
3268
3368
  if (this._name) {
3269
3369
  return this._name;
@@ -3276,9 +3376,6 @@ export class ObjectTypeDef extends BaseClient {
3276
3376
  ], await this._ctx.connection());
3277
3377
  return response;
3278
3378
  };
3279
- /**
3280
- * If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
3281
- */
3282
3379
  sourceModuleName = async () => {
3283
3380
  if (this._sourceModuleName) {
3284
3381
  return this._sourceModuleName;
@@ -3296,21 +3393,35 @@ export class ObjectTypeDef extends BaseClient {
3296
3393
  * A port exposed by a container.
3297
3394
  */
3298
3395
  export class Port extends BaseClient {
3396
+ _id = undefined;
3299
3397
  _description = undefined;
3300
3398
  _port = undefined;
3301
3399
  _protocol = undefined;
3302
3400
  /**
3303
3401
  * Constructor is used for internal usage only, do not create object from it.
3304
3402
  */
3305
- constructor(parent, _description, _port, _protocol) {
3403
+ constructor(parent, _id, _description, _port, _protocol) {
3306
3404
  super(parent);
3405
+ this._id = _id;
3307
3406
  this._description = _description;
3308
3407
  this._port = _port;
3309
3408
  this._protocol = _protocol;
3310
3409
  }
3311
3410
  /**
3312
- * The port description.
3411
+ * A unique identifier for this Port.
3313
3412
  */
3413
+ id = async () => {
3414
+ if (this._id) {
3415
+ return this._id;
3416
+ }
3417
+ const response = await computeQuery([
3418
+ ...this._queryTree,
3419
+ {
3420
+ operation: "id",
3421
+ },
3422
+ ], await this._ctx.connection());
3423
+ return response;
3424
+ };
3314
3425
  description = async () => {
3315
3426
  if (this._description) {
3316
3427
  return this._description;
@@ -3323,9 +3434,6 @@ export class Port extends BaseClient {
3323
3434
  ], await this._ctx.connection());
3324
3435
  return response;
3325
3436
  };
3326
- /**
3327
- * The port number.
3328
- */
3329
3437
  port = async () => {
3330
3438
  if (this._port) {
3331
3439
  return this._port;
@@ -3338,9 +3446,6 @@ export class Port extends BaseClient {
3338
3446
  ], await this._ctx.connection());
3339
3447
  return response;
3340
3448
  };
3341
- /**
3342
- * The transport layer network protocol.
3343
- */
3344
3449
  protocol = async () => {
3345
3450
  if (this._protocol) {
3346
3451
  return this._protocol;
@@ -3354,6 +3459,9 @@ export class Port extends BaseClient {
3354
3459
  return response;
3355
3460
  };
3356
3461
  }
3462
+ /**
3463
+ * The root of the DAG.
3464
+ */
3357
3465
  export class Client extends BaseClient {
3358
3466
  _checkVersionCompatibility = undefined;
3359
3467
  _defaultPlatform = undefined;
@@ -3365,6 +3473,25 @@ export class Client extends BaseClient {
3365
3473
  this._checkVersionCompatibility = _checkVersionCompatibility;
3366
3474
  this._defaultPlatform = _defaultPlatform;
3367
3475
  }
3476
+ /**
3477
+ * Retrieves a content-addressed blob.
3478
+ * @param digest Digest of the blob
3479
+ * @param size Size of the blob
3480
+ * @param mediaType Media type of the blob
3481
+ * @param uncompressed Digest of the uncompressed blob
3482
+ */
3483
+ blob = (digest, size, mediaType, uncompressed) => {
3484
+ return new Directory({
3485
+ queryTree: [
3486
+ ...this._queryTree,
3487
+ {
3488
+ operation: "blob",
3489
+ args: { digest, size, mediaType, uncompressed },
3490
+ },
3491
+ ],
3492
+ ctx: this._ctx,
3493
+ });
3494
+ };
3368
3495
  /**
3369
3496
  * Constructs a cache volume for a given cache key.
3370
3497
  * @param key A string identifier to target this cache volume (e.g., "modules-cache").
@@ -3383,7 +3510,7 @@ export class Client extends BaseClient {
3383
3510
  };
3384
3511
  /**
3385
3512
  * Checks if the current Dagger Engine is compatible with an SDK's required version.
3386
- * @param version The SDK's required version.
3513
+ * @param version Version required by the SDK.
3387
3514
  */
3388
3515
  checkVersionCompatibility = async (version) => {
3389
3516
  const response = await computeQuery([
@@ -3396,10 +3523,11 @@ export class Client extends BaseClient {
3396
3523
  return response;
3397
3524
  };
3398
3525
  /**
3399
- * Creates a scratch container or loads one by ID.
3526
+ * Creates a scratch container.
3400
3527
  *
3401
- * Optional platform argument initializes new containers to execute and publish
3402
- * as that platform. Platform defaults to that of the builder's host.
3528
+ * Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
3529
+ * @param opts.id DEPRECATED: Use `loadContainerFromID` instead.
3530
+ * @param opts.platform Platform to initialize the container with.
3403
3531
  */
3404
3532
  container = (opts) => {
3405
3533
  return new Container({
@@ -3415,8 +3543,8 @@ export class Client extends BaseClient {
3415
3543
  };
3416
3544
  /**
3417
3545
  * The FunctionCall context that the SDK caller is currently executing in.
3418
- * If the caller is not currently executing in a function, this will return
3419
- * an error.
3546
+ *
3547
+ * If the caller is not currently executing in a function, this will return an error.
3420
3548
  */
3421
3549
  currentFunctionCall = () => {
3422
3550
  return new FunctionCall({
@@ -3457,12 +3585,17 @@ export class Client extends BaseClient {
3457
3585
  },
3458
3586
  ], await this._ctx.connection());
3459
3587
  return response.map((r) => new TypeDef({
3460
- queryTree: this.queryTree,
3588
+ queryTree: [
3589
+ {
3590
+ operation: "loadTypeDefFromID",
3591
+ args: { id: r.id },
3592
+ },
3593
+ ],
3461
3594
  ctx: this._ctx,
3462
3595
  }, r.id));
3463
3596
  };
3464
3597
  /**
3465
- * The default platform of the builder.
3598
+ * The default platform of the engine.
3466
3599
  */
3467
3600
  defaultPlatform = async () => {
3468
3601
  const response = await computeQuery([
@@ -3474,7 +3607,8 @@ export class Client extends BaseClient {
3474
3607
  return response;
3475
3608
  };
3476
3609
  /**
3477
- * Creates an empty directory or loads one by ID.
3610
+ * Creates an empty directory.
3611
+ * @param opts.id DEPRECATED: Use `loadDirectoryFromID` isntead.
3478
3612
  */
3479
3613
  directory = (opts) => {
3480
3614
  return new Directory({
@@ -3489,7 +3623,6 @@ export class Client extends BaseClient {
3489
3623
  });
3490
3624
  };
3491
3625
  /**
3492
- * Loads a file by ID.
3493
3626
  * @deprecated Use loadFileFromID instead.
3494
3627
  */
3495
3628
  file = (id) => {
@@ -3505,7 +3638,9 @@ export class Client extends BaseClient {
3505
3638
  });
3506
3639
  };
3507
3640
  /**
3508
- * Create a function.
3641
+ * Creates a function.
3642
+ * @param name Name of the function, in its original format from the implementation language.
3643
+ * @param returnType Return type of the function.
3509
3644
  */
3510
3645
  function_ = (name, returnType) => {
3511
3646
  return new Function_({
@@ -3520,8 +3655,7 @@ export class Client extends BaseClient {
3520
3655
  });
3521
3656
  };
3522
3657
  /**
3523
- * Create a code generation result, given a directory containing the generated
3524
- * code.
3658
+ * Create a code generation result, given a directory containing the generated code.
3525
3659
  */
3526
3660
  generatedCode = (code) => {
3527
3661
  return new GeneratedCode({
@@ -3536,14 +3670,16 @@ export class Client extends BaseClient {
3536
3670
  });
3537
3671
  };
3538
3672
  /**
3539
- * Queries a git repository.
3540
- * @param url Url of the git repository.
3541
- * Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`
3673
+ * Queries a Git repository.
3674
+ * @param url URL of the git repository.
3675
+ *
3676
+ * Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.
3677
+ *
3542
3678
  * Suffix ".git" is optional.
3543
3679
  * @param opts.keepGitDir Set to true to keep .git directory.
3680
+ * @param opts.experimentalServiceHost A service which must be started before the repo is fetched.
3544
3681
  * @param opts.sshKnownHosts Set SSH known hosts
3545
3682
  * @param opts.sshAuthSocket Set SSH auth socket
3546
- * @param opts.experimentalServiceHost A service which must be started before the repo is fetched.
3547
3683
  */
3548
3684
  git = (url, opts) => {
3549
3685
  return new GitRepository({
@@ -3604,7 +3740,7 @@ export class Client extends BaseClient {
3604
3740
  });
3605
3741
  };
3606
3742
  /**
3607
- * Loads a container from an ID.
3743
+ * Load a Container from its ID.
3608
3744
  */
3609
3745
  loadContainerFromID = (id) => {
3610
3746
  return new Container({
@@ -3633,6 +3769,36 @@ export class Client extends BaseClient {
3633
3769
  ctx: this._ctx,
3634
3770
  });
3635
3771
  };
3772
+ /**
3773
+ * Load a EnvVariable from its ID.
3774
+ */
3775
+ loadEnvVariableFromID = (id) => {
3776
+ return new EnvVariable({
3777
+ queryTree: [
3778
+ ...this._queryTree,
3779
+ {
3780
+ operation: "loadEnvVariableFromID",
3781
+ args: { id },
3782
+ },
3783
+ ],
3784
+ ctx: this._ctx,
3785
+ });
3786
+ };
3787
+ /**
3788
+ * Load a FieldTypeDef from its ID.
3789
+ */
3790
+ loadFieldTypeDefFromID = (id) => {
3791
+ return new FieldTypeDef({
3792
+ queryTree: [
3793
+ ...this._queryTree,
3794
+ {
3795
+ operation: "loadFieldTypeDefFromID",
3796
+ args: { id },
3797
+ },
3798
+ ],
3799
+ ctx: this._ctx,
3800
+ });
3801
+ };
3636
3802
  /**
3637
3803
  * Load a File from its ID.
3638
3804
  */
@@ -3649,7 +3815,7 @@ export class Client extends BaseClient {
3649
3815
  });
3650
3816
  };
3651
3817
  /**
3652
- * Load a function argument by ID.
3818
+ * Load a FunctionArg from its ID.
3653
3819
  */
3654
3820
  loadFunctionArgFromID = (id) => {
3655
3821
  return new FunctionArg({
@@ -3664,7 +3830,37 @@ export class Client extends BaseClient {
3664
3830
  });
3665
3831
  };
3666
3832
  /**
3667
- * Load a function by ID.
3833
+ * Load a FunctionCallArgValue from its ID.
3834
+ */
3835
+ loadFunctionCallArgValueFromID = (id) => {
3836
+ return new FunctionCallArgValue({
3837
+ queryTree: [
3838
+ ...this._queryTree,
3839
+ {
3840
+ operation: "loadFunctionCallArgValueFromID",
3841
+ args: { id },
3842
+ },
3843
+ ],
3844
+ ctx: this._ctx,
3845
+ });
3846
+ };
3847
+ /**
3848
+ * Load a FunctionCall from its ID.
3849
+ */
3850
+ loadFunctionCallFromID = (id) => {
3851
+ return new FunctionCall({
3852
+ queryTree: [
3853
+ ...this._queryTree,
3854
+ {
3855
+ operation: "loadFunctionCallFromID",
3856
+ args: { id },
3857
+ },
3858
+ ],
3859
+ ctx: this._ctx,
3860
+ });
3861
+ };
3862
+ /**
3863
+ * Load a Function from its ID.
3668
3864
  */
3669
3865
  loadFunctionFromID = (id) => {
3670
3866
  return new Function_({
@@ -3679,7 +3875,7 @@ export class Client extends BaseClient {
3679
3875
  });
3680
3876
  };
3681
3877
  /**
3682
- * Load a GeneratedCode by ID.
3878
+ * Load a GeneratedCode from its ID.
3683
3879
  */
3684
3880
  loadGeneratedCodeFromID = (id) => {
3685
3881
  return new GeneratedCode({
@@ -3694,7 +3890,7 @@ export class Client extends BaseClient {
3694
3890
  });
3695
3891
  };
3696
3892
  /**
3697
- * Load a git ref from its ID.
3893
+ * Load a GitRef from its ID.
3698
3894
  */
3699
3895
  loadGitRefFromID = (id) => {
3700
3896
  return new GitRef({
@@ -3709,7 +3905,7 @@ export class Client extends BaseClient {
3709
3905
  });
3710
3906
  };
3711
3907
  /**
3712
- * Load a git repository from its ID.
3908
+ * Load a GitRepository from its ID.
3713
3909
  */
3714
3910
  loadGitRepositoryFromID = (id) => {
3715
3911
  return new GitRepository({
@@ -3724,7 +3920,82 @@ export class Client extends BaseClient {
3724
3920
  });
3725
3921
  };
3726
3922
  /**
3727
- * Load a module by ID.
3923
+ * Load a Host from its ID.
3924
+ */
3925
+ loadHostFromID = (id) => {
3926
+ return new Host({
3927
+ queryTree: [
3928
+ ...this._queryTree,
3929
+ {
3930
+ operation: "loadHostFromID",
3931
+ args: { id },
3932
+ },
3933
+ ],
3934
+ ctx: this._ctx,
3935
+ });
3936
+ };
3937
+ /**
3938
+ * Load a InterfaceTypeDef from its ID.
3939
+ */
3940
+ loadInterfaceTypeDefFromID = (id) => {
3941
+ return new InterfaceTypeDef({
3942
+ queryTree: [
3943
+ ...this._queryTree,
3944
+ {
3945
+ operation: "loadInterfaceTypeDefFromID",
3946
+ args: { id },
3947
+ },
3948
+ ],
3949
+ ctx: this._ctx,
3950
+ });
3951
+ };
3952
+ /**
3953
+ * Load a Label from its ID.
3954
+ */
3955
+ loadLabelFromID = (id) => {
3956
+ return new Label({
3957
+ queryTree: [
3958
+ ...this._queryTree,
3959
+ {
3960
+ operation: "loadLabelFromID",
3961
+ args: { id },
3962
+ },
3963
+ ],
3964
+ ctx: this._ctx,
3965
+ });
3966
+ };
3967
+ /**
3968
+ * Load a ListTypeDef from its ID.
3969
+ */
3970
+ loadListTypeDefFromID = (id) => {
3971
+ return new ListTypeDef({
3972
+ queryTree: [
3973
+ ...this._queryTree,
3974
+ {
3975
+ operation: "loadListTypeDefFromID",
3976
+ args: { id },
3977
+ },
3978
+ ],
3979
+ ctx: this._ctx,
3980
+ });
3981
+ };
3982
+ /**
3983
+ * Load a ModuleConfig from its ID.
3984
+ */
3985
+ loadModuleConfigFromID = (id) => {
3986
+ return new ModuleConfig({
3987
+ queryTree: [
3988
+ ...this._queryTree,
3989
+ {
3990
+ operation: "loadModuleConfigFromID",
3991
+ args: { id },
3992
+ },
3993
+ ],
3994
+ ctx: this._ctx,
3995
+ });
3996
+ };
3997
+ /**
3998
+ * Load a Module from its ID.
3728
3999
  */
3729
4000
  loadModuleFromID = (id) => {
3730
4001
  return new Module_({
@@ -3738,6 +4009,36 @@ export class Client extends BaseClient {
3738
4009
  ctx: this._ctx,
3739
4010
  });
3740
4011
  };
4012
+ /**
4013
+ * Load a ObjectTypeDef from its ID.
4014
+ */
4015
+ loadObjectTypeDefFromID = (id) => {
4016
+ return new ObjectTypeDef({
4017
+ queryTree: [
4018
+ ...this._queryTree,
4019
+ {
4020
+ operation: "loadObjectTypeDefFromID",
4021
+ args: { id },
4022
+ },
4023
+ ],
4024
+ ctx: this._ctx,
4025
+ });
4026
+ };
4027
+ /**
4028
+ * Load a Port from its ID.
4029
+ */
4030
+ loadPortFromID = (id) => {
4031
+ return new Port({
4032
+ queryTree: [
4033
+ ...this._queryTree,
4034
+ {
4035
+ operation: "loadPortFromID",
4036
+ args: { id },
4037
+ },
4038
+ ],
4039
+ ctx: this._ctx,
4040
+ });
4041
+ };
3741
4042
  /**
3742
4043
  * Load a Secret from its ID.
3743
4044
  */
@@ -3754,7 +4055,7 @@ export class Client extends BaseClient {
3754
4055
  });
3755
4056
  };
3756
4057
  /**
3757
- * Loads a service from ID.
4058
+ * Load a Service from its ID.
3758
4059
  */
3759
4060
  loadServiceFromID = (id) => {
3760
4061
  return new Service({
@@ -3784,7 +4085,7 @@ export class Client extends BaseClient {
3784
4085
  });
3785
4086
  };
3786
4087
  /**
3787
- * Load a TypeDef by ID.
4088
+ * Load a TypeDef from its ID.
3788
4089
  */
3789
4090
  loadTypeDefFromID = (id) => {
3790
4091
  return new TypeDef({
@@ -3829,9 +4130,9 @@ export class Client extends BaseClient {
3829
4130
  };
3830
4131
  /**
3831
4132
  * Creates a named sub-pipeline.
3832
- * @param name Pipeline name.
3833
- * @param opts.description Pipeline description.
3834
- * @param opts.labels Pipeline labels.
4133
+ * @param name Name of the sub-pipeline.
4134
+ * @param opts.description Description of the sub-pipeline.
4135
+ * @param opts.labels Labels to apply to the sub-pipeline.
3835
4136
  */
3836
4137
  pipeline = (name, opts) => {
3837
4138
  return new Client({
@@ -3846,16 +4147,15 @@ export class Client extends BaseClient {
3846
4147
  });
3847
4148
  };
3848
4149
  /**
3849
- * Loads a secret from its ID.
3850
- * @deprecated Use loadSecretFromID instead
4150
+ * Reference a secret by name.
3851
4151
  */
3852
- secret = (id) => {
4152
+ secret = (name) => {
3853
4153
  return new Secret({
3854
4154
  queryTree: [
3855
4155
  ...this._queryTree,
3856
4156
  {
3857
4157
  operation: "secret",
3858
- args: { id },
4158
+ args: { name },
3859
4159
  },
3860
4160
  ],
3861
4161
  ctx: this._ctx,
@@ -3863,6 +4163,7 @@ export class Client extends BaseClient {
3863
4163
  };
3864
4164
  /**
3865
4165
  * Sets a secret given a user defined name to its plaintext and returns the secret.
4166
+ *
3866
4167
  * The plaintext value is limited to a size of 128000 bytes.
3867
4168
  * @param name The user defined name for this secret
3868
4169
  * @param plaintext The plaintext of the secret
@@ -3883,13 +4184,13 @@ export class Client extends BaseClient {
3883
4184
  * Loads a socket by its ID.
3884
4185
  * @deprecated Use loadSocketFromID instead.
3885
4186
  */
3886
- socket = (opts) => {
4187
+ socket = (id) => {
3887
4188
  return new Socket({
3888
4189
  queryTree: [
3889
4190
  ...this._queryTree,
3890
4191
  {
3891
4192
  operation: "socket",
3892
- args: { ...opts },
4193
+ args: { id },
3893
4194
  },
3894
4195
  ],
3895
4196
  ctx: this._ctx,
@@ -3933,7 +4234,7 @@ export class Secret extends BaseClient {
3933
4234
  this._plaintext = _plaintext;
3934
4235
  }
3935
4236
  /**
3936
- * The identifier for this secret.
4237
+ * A unique identifier for this Secret.
3937
4238
  */
3938
4239
  id = async () => {
3939
4240
  if (this._id) {
@@ -3963,6 +4264,9 @@ export class Secret extends BaseClient {
3963
4264
  return response;
3964
4265
  };
3965
4266
  }
4267
+ /**
4268
+ * A content-addressed service providing TCP connectivity.
4269
+ */
3966
4270
  export class Service extends BaseClient {
3967
4271
  _id = undefined;
3968
4272
  _endpoint = undefined;
@@ -3981,7 +4285,7 @@ export class Service extends BaseClient {
3981
4285
  this._stop = _stop;
3982
4286
  }
3983
4287
  /**
3984
- * A unique identifier for this service.
4288
+ * A unique identifier for this Service.
3985
4289
  */
3986
4290
  id = async () => {
3987
4291
  if (this._id) {
@@ -4042,13 +4346,18 @@ export class Service extends BaseClient {
4042
4346
  operation: "ports",
4043
4347
  },
4044
4348
  {
4045
- operation: "description port protocol",
4349
+ operation: "id",
4046
4350
  },
4047
4351
  ], await this._ctx.connection());
4048
4352
  return response.map((r) => new Port({
4049
- queryTree: this.queryTree,
4353
+ queryTree: [
4354
+ {
4355
+ operation: "loadPortFromID",
4356
+ args: { id: r.id },
4357
+ },
4358
+ ],
4050
4359
  ctx: this._ctx,
4051
- }, r.description, r.port, r.protocol));
4360
+ }, r.id));
4052
4361
  };
4053
4362
  /**
4054
4363
  * Start the service and wait for its health checks to succeed.
@@ -4077,6 +4386,9 @@ export class Service extends BaseClient {
4077
4386
  return this;
4078
4387
  };
4079
4388
  }
4389
+ /**
4390
+ * A Unix or TCP/IP socket that can be mounted into a container.
4391
+ */
4080
4392
  export class Socket extends BaseClient {
4081
4393
  _id = undefined;
4082
4394
  /**
@@ -4087,7 +4399,7 @@ export class Socket extends BaseClient {
4087
4399
  this._id = _id;
4088
4400
  }
4089
4401
  /**
4090
- * The content-addressed identifier of the socket.
4402
+ * A unique identifier for this Socket.
4091
4403
  */
4092
4404
  id = async () => {
4093
4405
  if (this._id) {
@@ -4118,6 +4430,9 @@ export class TypeDef extends BaseClient {
4118
4430
  this._kind = _kind;
4119
4431
  this._optional = _optional;
4120
4432
  }
4433
+ /**
4434
+ * A unique identifier for this TypeDef.
4435
+ */
4121
4436
  id = async () => {
4122
4437
  if (this._id) {
4123
4438
  return this._id;
@@ -4130,10 +4445,6 @@ export class TypeDef extends BaseClient {
4130
4445
  ], await this._ctx.connection());
4131
4446
  return response;
4132
4447
  };
4133
- /**
4134
- * If kind is INTERFACE, the interface-specific type definition.
4135
- * If kind is not INTERFACE, this will be null.
4136
- */
4137
4448
  asInterface = () => {
4138
4449
  return new InterfaceTypeDef({
4139
4450
  queryTree: [
@@ -4145,10 +4456,6 @@ export class TypeDef extends BaseClient {
4145
4456
  ctx: this._ctx,
4146
4457
  });
4147
4458
  };
4148
- /**
4149
- * If kind is LIST, the list-specific type definition.
4150
- * If kind is not LIST, this will be null.
4151
- */
4152
4459
  asList = () => {
4153
4460
  return new ListTypeDef({
4154
4461
  queryTree: [
@@ -4160,10 +4467,6 @@ export class TypeDef extends BaseClient {
4160
4467
  ctx: this._ctx,
4161
4468
  });
4162
4469
  };
4163
- /**
4164
- * If kind is OBJECT, the object-specific type definition.
4165
- * If kind is not OBJECT, this will be null.
4166
- */
4167
4470
  asObject = () => {
4168
4471
  return new ObjectTypeDef({
4169
4472
  queryTree: [
@@ -4175,9 +4478,6 @@ export class TypeDef extends BaseClient {
4175
4478
  ctx: this._ctx,
4176
4479
  });
4177
4480
  };
4178
- /**
4179
- * The kind of type this is (e.g. primitive, list, object)
4180
- */
4181
4481
  kind = async () => {
4182
4482
  if (this._kind) {
4183
4483
  return this._kind;
@@ -4190,9 +4490,6 @@ export class TypeDef extends BaseClient {
4190
4490
  ], await this._ctx.connection());
4191
4491
  return response;
4192
4492
  };
4193
- /**
4194
- * Whether this type can be set to null. Defaults to false.
4195
- */
4196
4493
  optional = async () => {
4197
4494
  if (this._optional) {
4198
4495
  return this._optional;
@@ -4308,9 +4605,7 @@ export class TypeDef extends BaseClient {
4308
4605
  /**
4309
4606
  * Returns a TypeDef of kind Object with the provided name.
4310
4607
  *
4311
- * Note that an object's fields and functions may be omitted if the intent is
4312
- * only to refer to an object. This is how functions are able to return their
4313
- * own object, or any other circular reference.
4608
+ * Note that an object's fields and functions may be omitted if the intent is only to refer to an object. This is how functions are able to return their own object, or any other circular reference.
4314
4609
  */
4315
4610
  withObject = (name, opts) => {
4316
4611
  return new TypeDef({