@dagger.io/dagger 0.9.8 → 0.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/api/client.gen.d.ts +348 -49
  2. package/dist/api/client.gen.d.ts.map +1 -1
  3. package/dist/api/client.gen.js +537 -100
  4. package/dist/entrypoint/entrypoint.js +2 -1
  5. package/dist/entrypoint/invoke.d.ts.map +1 -1
  6. package/dist/entrypoint/invoke.js +25 -5
  7. package/dist/entrypoint/load.d.ts +43 -1
  8. package/dist/entrypoint/load.d.ts.map +1 -1
  9. package/dist/entrypoint/load.js +109 -2
  10. package/dist/entrypoint/register.d.ts.map +1 -1
  11. package/dist/entrypoint/register.js +7 -3
  12. package/dist/introspector/decorators/decorators.d.ts +3 -3
  13. package/dist/introspector/decorators/decorators.d.ts.map +1 -1
  14. package/dist/introspector/registry/registry.d.ts +5 -3
  15. package/dist/introspector/registry/registry.d.ts.map +1 -1
  16. package/dist/introspector/registry/registry.js +20 -28
  17. package/dist/introspector/scanner/metadata.d.ts +1 -0
  18. package/dist/introspector/scanner/metadata.d.ts.map +1 -1
  19. package/dist/introspector/scanner/scan.d.ts +5 -1
  20. package/dist/introspector/scanner/scan.d.ts.map +1 -1
  21. package/dist/introspector/scanner/scan.js +38 -5
  22. package/dist/introspector/scanner/serialize.d.ts.map +1 -1
  23. package/dist/introspector/scanner/serialize.js +8 -2
  24. package/dist/introspector/scanner/typeDefs.d.ts +3 -0
  25. package/dist/introspector/scanner/typeDefs.d.ts.map +1 -1
  26. package/dist/introspector/scanner/utils.d.ts +18 -2
  27. package/dist/introspector/scanner/utils.d.ts.map +1 -1
  28. package/dist/introspector/scanner/utils.js +85 -12
  29. package/dist/provisioning/default.d.ts +1 -1
  30. package/dist/provisioning/default.d.ts.map +1 -1
  31. package/dist/provisioning/default.js +1 -1
  32. package/package.json +1 -1
@@ -648,22 +648,6 @@ export class Container extends BaseClient {
648
648
  ctx: this._ctx,
649
649
  });
650
650
  };
651
- /**
652
- * Return an interactive terminal for this container using its configured shell if not overridden by args (or sh as a fallback default).
653
- * @param opts.args If set, override the container's default shell and invoke these arguments instead.
654
- */
655
- shell = (opts) => {
656
- return new Terminal({
657
- queryTree: [
658
- ...this._queryTree,
659
- {
660
- operation: "shell",
661
- args: { ...opts },
662
- },
663
- ],
664
- ctx: this._ctx,
665
- });
666
- };
667
651
  /**
668
652
  * The error stream of the last executed command.
669
653
  *
@@ -712,6 +696,22 @@ export class Container extends BaseClient {
712
696
  ], await this._ctx.connection());
713
697
  return this;
714
698
  };
699
+ /**
700
+ * Return an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
701
+ * @param opts.cmd If set, override the container's default terminal command and invoke these command arguments instead.
702
+ */
703
+ terminal = (opts) => {
704
+ return new Terminal({
705
+ queryTree: [
706
+ ...this._queryTree,
707
+ {
708
+ operation: "terminal",
709
+ args: { ...opts },
710
+ },
711
+ ],
712
+ ctx: this._ctx,
713
+ });
714
+ };
715
715
  /**
716
716
  * Retrieves the user to be set for all commands.
717
717
  */
@@ -744,15 +744,15 @@ export class Container extends BaseClient {
744
744
  });
745
745
  };
746
746
  /**
747
- * Set the default command to invoke for the "shell" API.
748
- * @param args The args of the command to set the default shell to.
747
+ * Set the default command to invoke for the container's terminal API.
748
+ * @param args The args of the command.
749
749
  */
750
- withDefaultShell = (args) => {
750
+ withDefaultTerminalCmd = (args) => {
751
751
  return new Container({
752
752
  queryTree: [
753
753
  ...this._queryTree,
754
754
  {
755
- operation: "withDefaultShell",
755
+ operation: "withDefaultTerminalCmd",
756
756
  args: { args },
757
757
  },
758
758
  ],
@@ -895,6 +895,29 @@ export class Container extends BaseClient {
895
895
  ctx: this._ctx,
896
896
  });
897
897
  };
898
+ /**
899
+ * Retrieves this container plus the contents of the given files copied to the given path.
900
+ * @param path Location where copied files should be placed (e.g., "/src").
901
+ * @param sources Identifiers of the files to copy.
902
+ * @param opts.permissions Permission given to the copied files (e.g., 0600).
903
+ * @param opts.owner A user:group to set for the files.
904
+ *
905
+ * The user and group can either be an ID (1000:1000) or a name (foo:bar).
906
+ *
907
+ * If the group is omitted, it defaults to the same as the user.
908
+ */
909
+ withFiles = (path, sources, opts) => {
910
+ return new Container({
911
+ queryTree: [
912
+ ...this._queryTree,
913
+ {
914
+ operation: "withFiles",
915
+ args: { path, sources, ...opts },
916
+ },
917
+ ],
918
+ ctx: this._ctx,
919
+ });
920
+ };
898
921
  /**
899
922
  * Indicate that subsequent operations should be featured more prominently in the UI.
900
923
  */
@@ -1523,7 +1546,7 @@ export class Directory extends BaseClient {
1523
1546
  };
1524
1547
  /**
1525
1548
  * Load the directory as a Dagger module
1526
- * @param opts.sourceSubpath An optional subpath of the directory which contains the module's source code.
1549
+ * @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file.
1527
1550
  *
1528
1551
  * 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.
1529
1552
  *
@@ -1723,6 +1746,24 @@ export class Directory extends BaseClient {
1723
1746
  ctx: this._ctx,
1724
1747
  });
1725
1748
  };
1749
+ /**
1750
+ * Retrieves this directory plus the contents of the given files copied to the given path.
1751
+ * @param path Location where copied files should be placed (e.g., "/src").
1752
+ * @param sources Identifiers of the files to copy.
1753
+ * @param opts.permissions Permission given to the copied files (e.g., 0600).
1754
+ */
1755
+ withFiles = (path, sources, opts) => {
1756
+ return new Directory({
1757
+ queryTree: [
1758
+ ...this._queryTree,
1759
+ {
1760
+ operation: "withFiles",
1761
+ args: { path, sources, ...opts },
1762
+ },
1763
+ ],
1764
+ ctx: this._ctx,
1765
+ });
1766
+ };
1726
1767
  /**
1727
1768
  * Retrieves this directory plus a new directory created at the given path.
1728
1769
  * @param path Location of the directory created (e.g., "/logs").
@@ -1848,6 +1889,9 @@ export class EnvVariable extends BaseClient {
1848
1889
  ], await this._ctx.connection());
1849
1890
  return response;
1850
1891
  };
1892
+ /**
1893
+ * The environment variable name.
1894
+ */
1851
1895
  name = async () => {
1852
1896
  if (this._name) {
1853
1897
  return this._name;
@@ -1860,6 +1904,9 @@ export class EnvVariable extends BaseClient {
1860
1904
  ], await this._ctx.connection());
1861
1905
  return response;
1862
1906
  };
1907
+ /**
1908
+ * The environment variable value.
1909
+ */
1863
1910
  value = async () => {
1864
1911
  if (this._value) {
1865
1912
  return this._value;
@@ -1906,6 +1953,9 @@ export class FieldTypeDef extends BaseClient {
1906
1953
  ], await this._ctx.connection());
1907
1954
  return response;
1908
1955
  };
1956
+ /**
1957
+ * A doc string for the field, if any.
1958
+ */
1909
1959
  description = async () => {
1910
1960
  if (this._description) {
1911
1961
  return this._description;
@@ -1918,6 +1968,9 @@ export class FieldTypeDef extends BaseClient {
1918
1968
  ], await this._ctx.connection());
1919
1969
  return response;
1920
1970
  };
1971
+ /**
1972
+ * The name of the field in lowerCamelCase format.
1973
+ */
1921
1974
  name = async () => {
1922
1975
  if (this._name) {
1923
1976
  return this._name;
@@ -1930,6 +1983,9 @@ export class FieldTypeDef extends BaseClient {
1930
1983
  ], await this._ctx.connection());
1931
1984
  return response;
1932
1985
  };
1986
+ /**
1987
+ * The type of the field.
1988
+ */
1933
1989
  typeDef = () => {
1934
1990
  return new TypeDef({
1935
1991
  queryTree: [
@@ -2114,6 +2170,9 @@ export class Function_ extends BaseClient {
2114
2170
  ], await this._ctx.connection());
2115
2171
  return response;
2116
2172
  };
2173
+ /**
2174
+ * Arguments accepted by the function, if any.
2175
+ */
2117
2176
  args = async () => {
2118
2177
  const response = await computeQuery([
2119
2178
  ...this._queryTree,
@@ -2134,6 +2193,9 @@ export class Function_ extends BaseClient {
2134
2193
  ctx: this._ctx,
2135
2194
  }, r.id));
2136
2195
  };
2196
+ /**
2197
+ * A doc string for the function, if any.
2198
+ */
2137
2199
  description = async () => {
2138
2200
  if (this._description) {
2139
2201
  return this._description;
@@ -2146,6 +2208,9 @@ export class Function_ extends BaseClient {
2146
2208
  ], await this._ctx.connection());
2147
2209
  return response;
2148
2210
  };
2211
+ /**
2212
+ * The name of the function.
2213
+ */
2149
2214
  name = async () => {
2150
2215
  if (this._name) {
2151
2216
  return this._name;
@@ -2158,6 +2223,9 @@ export class Function_ extends BaseClient {
2158
2223
  ], await this._ctx.connection());
2159
2224
  return response;
2160
2225
  };
2226
+ /**
2227
+ * The type returned by the function.
2228
+ */
2161
2229
  returnType = () => {
2162
2230
  return new TypeDef({
2163
2231
  queryTree: [
@@ -2248,6 +2316,9 @@ export class FunctionArg extends BaseClient {
2248
2316
  ], await this._ctx.connection());
2249
2317
  return response;
2250
2318
  };
2319
+ /**
2320
+ * A default value to use for this argument when not explicitly set by the caller, if any.
2321
+ */
2251
2322
  defaultValue = async () => {
2252
2323
  if (this._defaultValue) {
2253
2324
  return this._defaultValue;
@@ -2260,6 +2331,9 @@ export class FunctionArg extends BaseClient {
2260
2331
  ], await this._ctx.connection());
2261
2332
  return response;
2262
2333
  };
2334
+ /**
2335
+ * A doc string for the argument, if any.
2336
+ */
2263
2337
  description = async () => {
2264
2338
  if (this._description) {
2265
2339
  return this._description;
@@ -2272,6 +2346,9 @@ export class FunctionArg extends BaseClient {
2272
2346
  ], await this._ctx.connection());
2273
2347
  return response;
2274
2348
  };
2349
+ /**
2350
+ * The name of the argument in lowerCamelCase format.
2351
+ */
2275
2352
  name = async () => {
2276
2353
  if (this._name) {
2277
2354
  return this._name;
@@ -2284,6 +2361,9 @@ export class FunctionArg extends BaseClient {
2284
2361
  ], await this._ctx.connection());
2285
2362
  return response;
2286
2363
  };
2364
+ /**
2365
+ * The type of the argument.
2366
+ */
2287
2367
  typeDef = () => {
2288
2368
  return new TypeDef({
2289
2369
  queryTree: [
@@ -2331,6 +2411,9 @@ export class FunctionCall extends BaseClient {
2331
2411
  ], await this._ctx.connection());
2332
2412
  return response;
2333
2413
  };
2414
+ /**
2415
+ * The argument values the function is being invoked with.
2416
+ */
2334
2417
  inputArgs = async () => {
2335
2418
  const response = await computeQuery([
2336
2419
  ...this._queryTree,
@@ -2351,6 +2434,9 @@ export class FunctionCall extends BaseClient {
2351
2434
  ctx: this._ctx,
2352
2435
  }, r.id));
2353
2436
  };
2437
+ /**
2438
+ * The name of the function being called.
2439
+ */
2354
2440
  name = async () => {
2355
2441
  if (this._name) {
2356
2442
  return this._name;
@@ -2363,6 +2449,9 @@ export class FunctionCall extends BaseClient {
2363
2449
  ], await this._ctx.connection());
2364
2450
  return response;
2365
2451
  };
2452
+ /**
2453
+ * The value of the parent object of the function being called. If the function is top-level to the module, this is always an empty object.
2454
+ */
2366
2455
  parent = async () => {
2367
2456
  if (this._parent) {
2368
2457
  return this._parent;
@@ -2375,6 +2464,9 @@ export class FunctionCall extends BaseClient {
2375
2464
  ], await this._ctx.connection());
2376
2465
  return response;
2377
2466
  };
2467
+ /**
2468
+ * The name of the parent object of the function being called. If the function is top-level to the module, this is the name of the module.
2469
+ */
2378
2470
  parentName = async () => {
2379
2471
  if (this._parentName) {
2380
2472
  return this._parentName;
@@ -2436,6 +2528,9 @@ export class FunctionCallArgValue extends BaseClient {
2436
2528
  ], await this._ctx.connection());
2437
2529
  return response;
2438
2530
  };
2531
+ /**
2532
+ * The name of the argument.
2533
+ */
2439
2534
  name = async () => {
2440
2535
  if (this._name) {
2441
2536
  return this._name;
@@ -2448,6 +2543,9 @@ export class FunctionCallArgValue extends BaseClient {
2448
2543
  ], await this._ctx.connection());
2449
2544
  return response;
2450
2545
  };
2546
+ /**
2547
+ * The value of the argument represented as a JSON serialized string.
2548
+ */
2451
2549
  value = async () => {
2452
2550
  if (this._value) {
2453
2551
  return this._value;
@@ -2488,6 +2586,9 @@ export class GeneratedCode extends BaseClient {
2488
2586
  ], await this._ctx.connection());
2489
2587
  return response;
2490
2588
  };
2589
+ /**
2590
+ * The directory containing the generated code.
2591
+ */
2491
2592
  code = () => {
2492
2593
  return new Directory({
2493
2594
  queryTree: [
@@ -2499,6 +2600,9 @@ export class GeneratedCode extends BaseClient {
2499
2600
  ctx: this._ctx,
2500
2601
  });
2501
2602
  };
2603
+ /**
2604
+ * List of paths to mark generated in version control (i.e. .gitattributes).
2605
+ */
2502
2606
  vcsGeneratedPaths = async () => {
2503
2607
  const response = await computeQuery([
2504
2608
  ...this._queryTree,
@@ -2508,6 +2612,9 @@ export class GeneratedCode extends BaseClient {
2508
2612
  ], await this._ctx.connection());
2509
2613
  return response;
2510
2614
  };
2615
+ /**
2616
+ * List of paths to ignore in version control (i.e. .gitignore).
2617
+ */
2511
2618
  vcsIgnoredPaths = async () => {
2512
2619
  const response = await computeQuery([
2513
2620
  ...this._queryTree,
@@ -2564,18 +2671,18 @@ export class GitModuleSource extends BaseClient {
2564
2671
  _cloneURL = undefined;
2565
2672
  _commit = undefined;
2566
2673
  _htmlURL = undefined;
2567
- _sourceSubpath = undefined;
2674
+ _rootSubpath = undefined;
2568
2675
  _version = undefined;
2569
2676
  /**
2570
2677
  * Constructor is used for internal usage only, do not create object from it.
2571
2678
  */
2572
- constructor(parent, _id, _cloneURL, _commit, _htmlURL, _sourceSubpath, _version) {
2679
+ constructor(parent, _id, _cloneURL, _commit, _htmlURL, _rootSubpath, _version) {
2573
2680
  super(parent);
2574
2681
  this._id = _id;
2575
2682
  this._cloneURL = _cloneURL;
2576
2683
  this._commit = _commit;
2577
2684
  this._htmlURL = _htmlURL;
2578
- this._sourceSubpath = _sourceSubpath;
2685
+ this._rootSubpath = _rootSubpath;
2579
2686
  this._version = _version;
2580
2687
  }
2581
2688
  /**
@@ -2608,6 +2715,9 @@ export class GitModuleSource extends BaseClient {
2608
2715
  ], await this._ctx.connection());
2609
2716
  return response;
2610
2717
  };
2718
+ /**
2719
+ * The resolved commit of the git repo this source points to.
2720
+ */
2611
2721
  commit = async () => {
2612
2722
  if (this._commit) {
2613
2723
  return this._commit;
@@ -2620,6 +2730,20 @@ export class GitModuleSource extends BaseClient {
2620
2730
  ], await this._ctx.connection());
2621
2731
  return response;
2622
2732
  };
2733
+ /**
2734
+ * The directory containing everything needed to load load and use the module.
2735
+ */
2736
+ contextDirectory = () => {
2737
+ return new Directory({
2738
+ queryTree: [
2739
+ ...this._queryTree,
2740
+ {
2741
+ operation: "contextDirectory",
2742
+ },
2743
+ ],
2744
+ ctx: this._ctx,
2745
+ });
2746
+ };
2623
2747
  /**
2624
2748
  * The URL to the source's git repo in a web browser
2625
2749
  */
@@ -2635,18 +2759,24 @@ export class GitModuleSource extends BaseClient {
2635
2759
  ], await this._ctx.connection());
2636
2760
  return response;
2637
2761
  };
2638
- sourceSubpath = async () => {
2639
- if (this._sourceSubpath) {
2640
- return this._sourceSubpath;
2762
+ /**
2763
+ * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory).
2764
+ */
2765
+ rootSubpath = async () => {
2766
+ if (this._rootSubpath) {
2767
+ return this._rootSubpath;
2641
2768
  }
2642
2769
  const response = await computeQuery([
2643
2770
  ...this._queryTree,
2644
2771
  {
2645
- operation: "sourceSubpath",
2772
+ operation: "rootSubpath",
2646
2773
  },
2647
2774
  ], await this._ctx.connection());
2648
2775
  return response;
2649
2776
  };
2777
+ /**
2778
+ * The specified version of the git repo this source points to.
2779
+ */
2650
2780
  version = async () => {
2651
2781
  if (this._version) {
2652
2782
  return this._version;
@@ -2781,6 +2911,22 @@ export class GitRepository extends BaseClient {
2781
2911
  ctx: this._ctx,
2782
2912
  });
2783
2913
  };
2914
+ /**
2915
+ * Returns details of a ref.
2916
+ * @param name Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
2917
+ */
2918
+ ref = (name) => {
2919
+ return new GitRef({
2920
+ queryTree: [
2921
+ ...this._queryTree,
2922
+ {
2923
+ operation: "ref",
2924
+ args: { name },
2925
+ },
2926
+ ],
2927
+ ctx: this._ctx,
2928
+ });
2929
+ };
2784
2930
  /**
2785
2931
  * Returns details of a tag.
2786
2932
  * @param name Tag's name (e.g., "v0.3.9").
@@ -2974,6 +3120,9 @@ export class InputTypeDef extends BaseClient {
2974
3120
  ], await this._ctx.connection());
2975
3121
  return response;
2976
3122
  };
3123
+ /**
3124
+ * Static fields defined on this input object, if any.
3125
+ */
2977
3126
  fields = async () => {
2978
3127
  const response = await computeQuery([
2979
3128
  ...this._queryTree,
@@ -2994,6 +3143,9 @@ export class InputTypeDef extends BaseClient {
2994
3143
  ctx: this._ctx,
2995
3144
  }, r.id));
2996
3145
  };
3146
+ /**
3147
+ * The name of the input object.
3148
+ */
2997
3149
  name = async () => {
2998
3150
  if (this._name) {
2999
3151
  return this._name;
@@ -3040,6 +3192,9 @@ export class InterfaceTypeDef extends BaseClient {
3040
3192
  ], await this._ctx.connection());
3041
3193
  return response;
3042
3194
  };
3195
+ /**
3196
+ * The doc string for the interface, if any.
3197
+ */
3043
3198
  description = async () => {
3044
3199
  if (this._description) {
3045
3200
  return this._description;
@@ -3052,6 +3207,9 @@ export class InterfaceTypeDef extends BaseClient {
3052
3207
  ], await this._ctx.connection());
3053
3208
  return response;
3054
3209
  };
3210
+ /**
3211
+ * Functions defined on this interface, if any.
3212
+ */
3055
3213
  functions = async () => {
3056
3214
  const response = await computeQuery([
3057
3215
  ...this._queryTree,
@@ -3072,6 +3230,9 @@ export class InterfaceTypeDef extends BaseClient {
3072
3230
  ctx: this._ctx,
3073
3231
  }, r.id));
3074
3232
  };
3233
+ /**
3234
+ * The name of the interface.
3235
+ */
3075
3236
  name = async () => {
3076
3237
  if (this._name) {
3077
3238
  return this._name;
@@ -3084,6 +3245,9 @@ export class InterfaceTypeDef extends BaseClient {
3084
3245
  ], await this._ctx.connection());
3085
3246
  return response;
3086
3247
  };
3248
+ /**
3249
+ * If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
3250
+ */
3087
3251
  sourceModuleName = async () => {
3088
3252
  if (this._sourceModuleName) {
3089
3253
  return this._sourceModuleName;
@@ -3128,6 +3292,9 @@ export class Label extends BaseClient {
3128
3292
  ], await this._ctx.connection());
3129
3293
  return response;
3130
3294
  };
3295
+ /**
3296
+ * The label name.
3297
+ */
3131
3298
  name = async () => {
3132
3299
  if (this._name) {
3133
3300
  return this._name;
@@ -3140,6 +3307,9 @@ export class Label extends BaseClient {
3140
3307
  ], await this._ctx.connection());
3141
3308
  return response;
3142
3309
  };
3310
+ /**
3311
+ * The label value.
3312
+ */
3143
3313
  value = async () => {
3144
3314
  if (this._value) {
3145
3315
  return this._value;
@@ -3180,6 +3350,9 @@ export class ListTypeDef extends BaseClient {
3180
3350
  ], await this._ctx.connection());
3181
3351
  return response;
3182
3352
  };
3353
+ /**
3354
+ * The type of the elements in the list.
3355
+ */
3183
3356
  elementTypeDef = () => {
3184
3357
  return new TypeDef({
3185
3358
  queryTree: [
@@ -3197,14 +3370,14 @@ export class ListTypeDef extends BaseClient {
3197
3370
  */
3198
3371
  export class LocalModuleSource extends BaseClient {
3199
3372
  _id = undefined;
3200
- _sourceSubpath = undefined;
3373
+ _rootSubpath = undefined;
3201
3374
  /**
3202
3375
  * Constructor is used for internal usage only, do not create object from it.
3203
3376
  */
3204
- constructor(parent, _id, _sourceSubpath) {
3377
+ constructor(parent, _id, _rootSubpath) {
3205
3378
  super(parent);
3206
3379
  this._id = _id;
3207
- this._sourceSubpath = _sourceSubpath;
3380
+ this._rootSubpath = _rootSubpath;
3208
3381
  }
3209
3382
  /**
3210
3383
  * A unique identifier for this LocalModuleSource.
@@ -3221,14 +3394,31 @@ export class LocalModuleSource extends BaseClient {
3221
3394
  ], await this._ctx.connection());
3222
3395
  return response;
3223
3396
  };
3224
- sourceSubpath = async () => {
3225
- if (this._sourceSubpath) {
3226
- return this._sourceSubpath;
3397
+ /**
3398
+ * The directory containing everything needed to load load and use the module.
3399
+ */
3400
+ contextDirectory = () => {
3401
+ return new Directory({
3402
+ queryTree: [
3403
+ ...this._queryTree,
3404
+ {
3405
+ operation: "contextDirectory",
3406
+ },
3407
+ ],
3408
+ ctx: this._ctx,
3409
+ });
3410
+ };
3411
+ /**
3412
+ * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory).
3413
+ */
3414
+ rootSubpath = async () => {
3415
+ if (this._rootSubpath) {
3416
+ return this._rootSubpath;
3227
3417
  }
3228
3418
  const response = await computeQuery([
3229
3419
  ...this._queryTree,
3230
3420
  {
3231
- operation: "sourceSubpath",
3421
+ operation: "rootSubpath",
3232
3422
  },
3233
3423
  ], await this._ctx.connection());
3234
3424
  return response;
@@ -3269,6 +3459,9 @@ export class Module_ extends BaseClient {
3269
3459
  ], await this._ctx.connection());
3270
3460
  return response;
3271
3461
  };
3462
+ /**
3463
+ * Modules used by this module.
3464
+ */
3272
3465
  dependencies = async () => {
3273
3466
  const response = await computeQuery([
3274
3467
  ...this._queryTree,
@@ -3289,6 +3482,9 @@ export class Module_ extends BaseClient {
3289
3482
  ctx: this._ctx,
3290
3483
  }, r.id));
3291
3484
  };
3485
+ /**
3486
+ * The dependencies as configured by the module.
3487
+ */
3292
3488
  dependencyConfig = async () => {
3293
3489
  const response = await computeQuery([
3294
3490
  ...this._queryTree,
@@ -3309,6 +3505,9 @@ export class Module_ extends BaseClient {
3309
3505
  ctx: this._ctx,
3310
3506
  }, r.id));
3311
3507
  };
3508
+ /**
3509
+ * The doc string of the module, if any
3510
+ */
3312
3511
  description = async () => {
3313
3512
  if (this._description) {
3314
3513
  return this._description;
@@ -3322,14 +3521,28 @@ export class Module_ extends BaseClient {
3322
3521
  return response;
3323
3522
  };
3324
3523
  /**
3325
- * The module's root directory containing the config file for it and its source (possibly as a subdir). It includes any generated code or updated config files created after initial load, but not any files/directories that were unchanged after sdk codegen was run.
3524
+ * The generated files and directories made on top of the module source's context directory.
3326
3525
  */
3327
- generatedSourceRootDirectory = () => {
3526
+ generatedContextDiff = () => {
3328
3527
  return new Directory({
3329
3528
  queryTree: [
3330
3529
  ...this._queryTree,
3331
3530
  {
3332
- operation: "generatedSourceRootDirectory",
3531
+ operation: "generatedContextDiff",
3532
+ },
3533
+ ],
3534
+ ctx: this._ctx,
3535
+ });
3536
+ };
3537
+ /**
3538
+ * The module source's context plus any configuration and source files created by codegen.
3539
+ */
3540
+ generatedContextDirectory = () => {
3541
+ return new Directory({
3542
+ queryTree: [
3543
+ ...this._queryTree,
3544
+ {
3545
+ operation: "generatedContextDirectory",
3333
3546
  },
3334
3547
  ],
3335
3548
  ctx: this._ctx,
@@ -3349,6 +3562,9 @@ export class Module_ extends BaseClient {
3349
3562
  ctx: this._ctx,
3350
3563
  });
3351
3564
  };
3565
+ /**
3566
+ * Interfaces served by this module.
3567
+ */
3352
3568
  interfaces = async () => {
3353
3569
  const response = await computeQuery([
3354
3570
  ...this._queryTree,
@@ -3369,6 +3585,9 @@ export class Module_ extends BaseClient {
3369
3585
  ctx: this._ctx,
3370
3586
  }, r.id));
3371
3587
  };
3588
+ /**
3589
+ * The name of the module
3590
+ */
3372
3591
  name = async () => {
3373
3592
  if (this._name) {
3374
3593
  return this._name;
@@ -3381,6 +3600,9 @@ export class Module_ extends BaseClient {
3381
3600
  ], await this._ctx.connection());
3382
3601
  return response;
3383
3602
  };
3603
+ /**
3604
+ * Objects served by this module.
3605
+ */
3384
3606
  objects = async () => {
3385
3607
  const response = await computeQuery([
3386
3608
  ...this._queryTree,
@@ -3401,6 +3623,9 @@ export class Module_ extends BaseClient {
3401
3623
  ctx: this._ctx,
3402
3624
  }, r.id));
3403
3625
  };
3626
+ /**
3627
+ * The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
3628
+ */
3404
3629
  runtime = () => {
3405
3630
  return new Container({
3406
3631
  queryTree: [
@@ -3412,6 +3637,9 @@ export class Module_ extends BaseClient {
3412
3637
  ctx: this._ctx,
3413
3638
  });
3414
3639
  };
3640
+ /**
3641
+ * The SDK used by this module. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
3642
+ */
3415
3643
  sdk = async () => {
3416
3644
  if (this._sdk) {
3417
3645
  return this._sdk;
@@ -3441,6 +3669,9 @@ export class Module_ extends BaseClient {
3441
3669
  ], await this._ctx.connection());
3442
3670
  return response;
3443
3671
  };
3672
+ /**
3673
+ * The source for the module.
3674
+ */
3444
3675
  source = () => {
3445
3676
  return new ModuleSource({
3446
3677
  queryTree: [
@@ -3452,22 +3683,6 @@ export class Module_ extends BaseClient {
3452
3683
  ctx: this._ctx,
3453
3684
  });
3454
3685
  };
3455
- /**
3456
- * Update the module configuration to use the given dependencies.
3457
- * @param dependencies The dependency modules to install.
3458
- */
3459
- withDependencies = (dependencies) => {
3460
- return new Module_({
3461
- queryTree: [
3462
- ...this._queryTree,
3463
- {
3464
- operation: "withDependencies",
3465
- args: { dependencies },
3466
- },
3467
- ],
3468
- ctx: this._ctx,
3469
- });
3470
- };
3471
3686
  /**
3472
3687
  * Retrieves the module with the given description
3473
3688
  * @param description The description to set
@@ -3499,22 +3714,6 @@ export class Module_ extends BaseClient {
3499
3714
  ctx: this._ctx,
3500
3715
  });
3501
3716
  };
3502
- /**
3503
- * Update the module configuration to use the given name.
3504
- * @param name The name to use.
3505
- */
3506
- withName = (name) => {
3507
- return new Module_({
3508
- queryTree: [
3509
- ...this._queryTree,
3510
- {
3511
- operation: "withName",
3512
- args: { name },
3513
- },
3514
- ],
3515
- ctx: this._ctx,
3516
- });
3517
- };
3518
3717
  /**
3519
3718
  * This module plus the given Object type and associated functions.
3520
3719
  */
@@ -3530,22 +3729,6 @@ export class Module_ extends BaseClient {
3530
3729
  ctx: this._ctx,
3531
3730
  });
3532
3731
  };
3533
- /**
3534
- * Update the module configuration to use the given SDK.
3535
- * @param sdk The SDK to use.
3536
- */
3537
- withSDK = (sdk) => {
3538
- return new Module_({
3539
- queryTree: [
3540
- ...this._queryTree,
3541
- {
3542
- operation: "withSDK",
3543
- args: { sdk },
3544
- },
3545
- ],
3546
- ctx: this._ctx,
3547
- });
3548
- };
3549
3732
  /**
3550
3733
  * Retrieves the module with basic configuration loaded if present.
3551
3734
  * @param source The module source to initialize from.
@@ -3600,6 +3783,9 @@ export class ModuleDependency extends BaseClient {
3600
3783
  ], await this._ctx.connection());
3601
3784
  return response;
3602
3785
  };
3786
+ /**
3787
+ * The name of the dependency module.
3788
+ */
3603
3789
  name = async () => {
3604
3790
  if (this._name) {
3605
3791
  return this._name;
@@ -3612,6 +3798,9 @@ export class ModuleDependency extends BaseClient {
3612
3798
  ], await this._ctx.connection());
3613
3799
  return response;
3614
3800
  };
3801
+ /**
3802
+ * The source for the dependency module.
3803
+ */
3615
3804
  source = () => {
3616
3805
  return new ModuleSource({
3617
3806
  queryTree: [
@@ -3630,19 +3819,27 @@ export class ModuleDependency extends BaseClient {
3630
3819
  export class ModuleSource extends BaseClient {
3631
3820
  _id = undefined;
3632
3821
  _asString = undefined;
3822
+ _configExists = undefined;
3633
3823
  _kind = undefined;
3634
3824
  _moduleName = undefined;
3635
- _subpath = undefined;
3825
+ _moduleOriginalName = undefined;
3826
+ _resolveContextPathFromCaller = undefined;
3827
+ _sourceRootSubpath = undefined;
3828
+ _sourceSubpath = undefined;
3636
3829
  /**
3637
3830
  * Constructor is used for internal usage only, do not create object from it.
3638
3831
  */
3639
- constructor(parent, _id, _asString, _kind, _moduleName, _subpath) {
3832
+ constructor(parent, _id, _asString, _configExists, _kind, _moduleName, _moduleOriginalName, _resolveContextPathFromCaller, _sourceRootSubpath, _sourceSubpath) {
3640
3833
  super(parent);
3641
3834
  this._id = _id;
3642
3835
  this._asString = _asString;
3836
+ this._configExists = _configExists;
3643
3837
  this._kind = _kind;
3644
3838
  this._moduleName = _moduleName;
3645
- this._subpath = _subpath;
3839
+ this._moduleOriginalName = _moduleOriginalName;
3840
+ this._resolveContextPathFromCaller = _resolveContextPathFromCaller;
3841
+ this._sourceRootSubpath = _sourceRootSubpath;
3842
+ this._sourceSubpath = _sourceSubpath;
3646
3843
  }
3647
3844
  /**
3648
3845
  * A unique identifier for this ModuleSource.
@@ -3659,6 +3856,9 @@ export class ModuleSource extends BaseClient {
3659
3856
  ], await this._ctx.connection());
3660
3857
  return response;
3661
3858
  };
3859
+ /**
3860
+ * If the source is a of kind git, the git source representation of it.
3861
+ */
3662
3862
  asGitSource = () => {
3663
3863
  return new GitModuleSource({
3664
3864
  queryTree: [
@@ -3670,6 +3870,9 @@ export class ModuleSource extends BaseClient {
3670
3870
  ctx: this._ctx,
3671
3871
  });
3672
3872
  };
3873
+ /**
3874
+ * If the source is of kind local, the local source representation of it.
3875
+ */
3673
3876
  asLocalSource = () => {
3674
3877
  return new LocalModuleSource({
3675
3878
  queryTree: [
@@ -3711,7 +3914,59 @@ export class ModuleSource extends BaseClient {
3711
3914
  return response;
3712
3915
  };
3713
3916
  /**
3714
- * The directory containing the actual module's source code, as determined from the root directory and subpath.
3917
+ * Returns whether the module source has a configuration file.
3918
+ */
3919
+ configExists = async () => {
3920
+ if (this._configExists) {
3921
+ return this._configExists;
3922
+ }
3923
+ const response = await computeQuery([
3924
+ ...this._queryTree,
3925
+ {
3926
+ operation: "configExists",
3927
+ },
3928
+ ], await this._ctx.connection());
3929
+ return response;
3930
+ };
3931
+ /**
3932
+ * The directory containing everything needed to load load and use the module.
3933
+ */
3934
+ contextDirectory = () => {
3935
+ return new Directory({
3936
+ queryTree: [
3937
+ ...this._queryTree,
3938
+ {
3939
+ operation: "contextDirectory",
3940
+ },
3941
+ ],
3942
+ ctx: this._ctx,
3943
+ });
3944
+ };
3945
+ /**
3946
+ * The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.
3947
+ */
3948
+ dependencies = async () => {
3949
+ const response = await computeQuery([
3950
+ ...this._queryTree,
3951
+ {
3952
+ operation: "dependencies",
3953
+ },
3954
+ {
3955
+ operation: "id",
3956
+ },
3957
+ ], await this._ctx.connection());
3958
+ return response.map((r) => new ModuleDependency({
3959
+ queryTree: [
3960
+ {
3961
+ operation: "loadModuleDependencyFromID",
3962
+ args: { id: r.id },
3963
+ },
3964
+ ],
3965
+ ctx: this._ctx,
3966
+ }, r.id));
3967
+ };
3968
+ /**
3969
+ * The directory containing the module configuration and source code (source code may be in a subdir).
3715
3970
  * @param path The path from the source directory to select.
3716
3971
  */
3717
3972
  directory = (path) => {
@@ -3726,6 +3981,9 @@ export class ModuleSource extends BaseClient {
3726
3981
  ctx: this._ctx,
3727
3982
  });
3728
3983
  };
3984
+ /**
3985
+ * The kind of source (e.g. local, git, etc.)
3986
+ */
3729
3987
  kind = async () => {
3730
3988
  if (this._kind) {
3731
3989
  return this._kind;
@@ -3739,7 +3997,7 @@ export class ModuleSource extends BaseClient {
3739
3997
  return response;
3740
3998
  };
3741
3999
  /**
3742
- * If set, the name of the module this source references
4000
+ * If set, the name of the module this source references, including any overrides at runtime by callers.
3743
4001
  */
3744
4002
  moduleName = async () => {
3745
4003
  if (this._moduleName) {
@@ -3753,6 +4011,36 @@ export class ModuleSource extends BaseClient {
3753
4011
  ], await this._ctx.connection());
3754
4012
  return response;
3755
4013
  };
4014
+ /**
4015
+ * The original name of the module this source references, as defined in the module configuration.
4016
+ */
4017
+ moduleOriginalName = async () => {
4018
+ if (this._moduleOriginalName) {
4019
+ return this._moduleOriginalName;
4020
+ }
4021
+ const response = await computeQuery([
4022
+ ...this._queryTree,
4023
+ {
4024
+ operation: "moduleOriginalName",
4025
+ },
4026
+ ], await this._ctx.connection());
4027
+ return response;
4028
+ };
4029
+ /**
4030
+ * The path to the module source's context directory on the caller's filesystem. Only valid for local sources.
4031
+ */
4032
+ resolveContextPathFromCaller = async () => {
4033
+ if (this._resolveContextPathFromCaller) {
4034
+ return this._resolveContextPathFromCaller;
4035
+ }
4036
+ const response = await computeQuery([
4037
+ ...this._queryTree,
4038
+ {
4039
+ operation: "resolveContextPathFromCaller",
4040
+ },
4041
+ ], await this._ctx.connection());
4042
+ return response;
4043
+ };
3756
4044
  /**
3757
4045
  * Resolve the provided module source arg as a dependency relative to this module source.
3758
4046
  * @param dep The dependency module source to resolve.
@@ -3769,32 +4057,130 @@ export class ModuleSource extends BaseClient {
3769
4057
  ctx: this._ctx,
3770
4058
  });
3771
4059
  };
3772
- rootDirectory = () => {
3773
- return new Directory({
4060
+ /**
4061
+ * Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.
4062
+ */
4063
+ resolveFromCaller = () => {
4064
+ return new ModuleSource({
3774
4065
  queryTree: [
3775
4066
  ...this._queryTree,
3776
4067
  {
3777
- operation: "rootDirectory",
4068
+ operation: "resolveFromCaller",
3778
4069
  },
3779
4070
  ],
3780
4071
  ctx: this._ctx,
3781
4072
  });
3782
4073
  };
3783
4074
  /**
3784
- * The path to the module subdirectory containing the actual module's source code.
4075
+ * The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root.
4076
+ */
4077
+ sourceRootSubpath = async () => {
4078
+ if (this._sourceRootSubpath) {
4079
+ return this._sourceRootSubpath;
4080
+ }
4081
+ const response = await computeQuery([
4082
+ ...this._queryTree,
4083
+ {
4084
+ operation: "sourceRootSubpath",
4085
+ },
4086
+ ], await this._ctx.connection());
4087
+ return response;
4088
+ };
4089
+ /**
4090
+ * The path relative to context of the module implementation source code.
3785
4091
  */
3786
- subpath = async () => {
3787
- if (this._subpath) {
3788
- return this._subpath;
4092
+ sourceSubpath = async () => {
4093
+ if (this._sourceSubpath) {
4094
+ return this._sourceSubpath;
3789
4095
  }
3790
4096
  const response = await computeQuery([
3791
4097
  ...this._queryTree,
3792
4098
  {
3793
- operation: "subpath",
4099
+ operation: "sourceSubpath",
3794
4100
  },
3795
4101
  ], await this._ctx.connection());
3796
4102
  return response;
3797
4103
  };
4104
+ /**
4105
+ * Update the module source with a new context directory. Only valid for local sources.
4106
+ * @param dir The directory to set as the context directory.
4107
+ */
4108
+ withContextDirectory = (dir) => {
4109
+ return new ModuleSource({
4110
+ queryTree: [
4111
+ ...this._queryTree,
4112
+ {
4113
+ operation: "withContextDirectory",
4114
+ args: { dir },
4115
+ },
4116
+ ],
4117
+ ctx: this._ctx,
4118
+ });
4119
+ };
4120
+ /**
4121
+ * Append the provided dependencies to the module source's dependency list.
4122
+ * @param dependencies The dependencies to append.
4123
+ */
4124
+ withDependencies = (dependencies) => {
4125
+ return new ModuleSource({
4126
+ queryTree: [
4127
+ ...this._queryTree,
4128
+ {
4129
+ operation: "withDependencies",
4130
+ args: { dependencies },
4131
+ },
4132
+ ],
4133
+ ctx: this._ctx,
4134
+ });
4135
+ };
4136
+ /**
4137
+ * Update the module source with a new name.
4138
+ * @param name The name to set.
4139
+ */
4140
+ withName = (name) => {
4141
+ return new ModuleSource({
4142
+ queryTree: [
4143
+ ...this._queryTree,
4144
+ {
4145
+ operation: "withName",
4146
+ args: { name },
4147
+ },
4148
+ ],
4149
+ ctx: this._ctx,
4150
+ });
4151
+ };
4152
+ /**
4153
+ * Update the module source with a new SDK.
4154
+ * @param sdk The SDK to set.
4155
+ */
4156
+ withSDK = (sdk) => {
4157
+ return new ModuleSource({
4158
+ queryTree: [
4159
+ ...this._queryTree,
4160
+ {
4161
+ operation: "withSDK",
4162
+ args: { sdk },
4163
+ },
4164
+ ],
4165
+ ctx: this._ctx,
4166
+ });
4167
+ };
4168
+ /**
4169
+ * Update the module source with a new source subpath.
4170
+ * @param path The path to set as the source subpath.
4171
+ */
4172
+ withSourceSubpath = (path) => {
4173
+ return new ModuleSource({
4174
+ queryTree: [
4175
+ ...this._queryTree,
4176
+ {
4177
+ operation: "withSourceSubpath",
4178
+ args: { path },
4179
+ },
4180
+ ],
4181
+ ctx: this._ctx,
4182
+ });
4183
+ };
3798
4184
  /**
3799
4185
  * Call the provided function with current ModuleSource.
3800
4186
  *
@@ -3837,6 +4223,9 @@ export class ObjectTypeDef extends BaseClient {
3837
4223
  ], await this._ctx.connection());
3838
4224
  return response;
3839
4225
  };
4226
+ /**
4227
+ * The function used to construct new instances of this object, if any
4228
+ */
3840
4229
  constructor_ = () => {
3841
4230
  return new Function_({
3842
4231
  queryTree: [
@@ -3848,6 +4237,9 @@ export class ObjectTypeDef extends BaseClient {
3848
4237
  ctx: this._ctx,
3849
4238
  });
3850
4239
  };
4240
+ /**
4241
+ * The doc string for the object, if any.
4242
+ */
3851
4243
  description = async () => {
3852
4244
  if (this._description) {
3853
4245
  return this._description;
@@ -3860,6 +4252,9 @@ export class ObjectTypeDef extends BaseClient {
3860
4252
  ], await this._ctx.connection());
3861
4253
  return response;
3862
4254
  };
4255
+ /**
4256
+ * Static fields defined on this object, if any.
4257
+ */
3863
4258
  fields = async () => {
3864
4259
  const response = await computeQuery([
3865
4260
  ...this._queryTree,
@@ -3880,6 +4275,9 @@ export class ObjectTypeDef extends BaseClient {
3880
4275
  ctx: this._ctx,
3881
4276
  }, r.id));
3882
4277
  };
4278
+ /**
4279
+ * Functions defined on this object, if any.
4280
+ */
3883
4281
  functions = async () => {
3884
4282
  const response = await computeQuery([
3885
4283
  ...this._queryTree,
@@ -3900,6 +4298,9 @@ export class ObjectTypeDef extends BaseClient {
3900
4298
  ctx: this._ctx,
3901
4299
  }, r.id));
3902
4300
  };
4301
+ /**
4302
+ * The name of the object.
4303
+ */
3903
4304
  name = async () => {
3904
4305
  if (this._name) {
3905
4306
  return this._name;
@@ -3912,6 +4313,9 @@ export class ObjectTypeDef extends BaseClient {
3912
4313
  ], await this._ctx.connection());
3913
4314
  return response;
3914
4315
  };
4316
+ /**
4317
+ * If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
4318
+ */
3915
4319
  sourceModuleName = async () => {
3916
4320
  if (this._sourceModuleName) {
3917
4321
  return this._sourceModuleName;
@@ -3960,6 +4364,9 @@ export class Port extends BaseClient {
3960
4364
  ], await this._ctx.connection());
3961
4365
  return response;
3962
4366
  };
4367
+ /**
4368
+ * The port description.
4369
+ */
3963
4370
  description = async () => {
3964
4371
  if (this._description) {
3965
4372
  return this._description;
@@ -3972,6 +4379,9 @@ export class Port extends BaseClient {
3972
4379
  ], await this._ctx.connection());
3973
4380
  return response;
3974
4381
  };
4382
+ /**
4383
+ * Skip the health check when run as a service.
4384
+ */
3975
4385
  experimentalSkipHealthcheck = async () => {
3976
4386
  if (this._experimentalSkipHealthcheck) {
3977
4387
  return this._experimentalSkipHealthcheck;
@@ -3984,6 +4394,9 @@ export class Port extends BaseClient {
3984
4394
  ], await this._ctx.connection());
3985
4395
  return response;
3986
4396
  };
4397
+ /**
4398
+ * The port number.
4399
+ */
3987
4400
  port = async () => {
3988
4401
  if (this._port) {
3989
4402
  return this._port;
@@ -3996,6 +4409,9 @@ export class Port extends BaseClient {
3996
4409
  ], await this._ctx.connection());
3997
4410
  return response;
3998
4411
  };
4412
+ /**
4413
+ * The transport layer protocol.
4414
+ */
3999
4415
  protocol = async () => {
4000
4416
  if (this._protocol) {
4001
4417
  return this._protocol;
@@ -4773,7 +5189,6 @@ export class Client extends BaseClient {
4773
5189
  /**
4774
5190
  * Create a new module source instance from a source ref string.
4775
5191
  * @param refString The string ref representation of the module source
4776
- * @param opts.rootDirectory An explicitly set root directory for the module source. This is required to load local sources as modules; other source types implicitly encode the root directory and do not require this.
4777
5192
  * @param opts.stable If true, enforce that the source is a stable version for source kinds that support versioning.
4778
5193
  */
4779
5194
  moduleSource = (refString, opts) => {
@@ -5051,6 +5466,10 @@ export class Service extends BaseClient {
5051
5466
  };
5052
5467
  /**
5053
5468
  * Creates a tunnel that forwards traffic from the caller's network to this service.
5469
+ * @param opts.ports List of frontend/backend port mappings to forward.
5470
+ *
5471
+ * Frontend is the port accepting traffic on the host, backend is the service port.
5472
+ * @param opts.random Bind each tunnel port to a random port on the host.
5054
5473
  */
5055
5474
  up = async (opts) => {
5056
5475
  if (this._up) {
@@ -5170,6 +5589,9 @@ export class TypeDef extends BaseClient {
5170
5589
  ], await this._ctx.connection());
5171
5590
  return response;
5172
5591
  };
5592
+ /**
5593
+ * If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
5594
+ */
5173
5595
  asInput = () => {
5174
5596
  return new InputTypeDef({
5175
5597
  queryTree: [
@@ -5181,6 +5603,9 @@ export class TypeDef extends BaseClient {
5181
5603
  ctx: this._ctx,
5182
5604
  });
5183
5605
  };
5606
+ /**
5607
+ * If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
5608
+ */
5184
5609
  asInterface = () => {
5185
5610
  return new InterfaceTypeDef({
5186
5611
  queryTree: [
@@ -5192,6 +5617,9 @@ export class TypeDef extends BaseClient {
5192
5617
  ctx: this._ctx,
5193
5618
  });
5194
5619
  };
5620
+ /**
5621
+ * If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
5622
+ */
5195
5623
  asList = () => {
5196
5624
  return new ListTypeDef({
5197
5625
  queryTree: [
@@ -5203,6 +5631,9 @@ export class TypeDef extends BaseClient {
5203
5631
  ctx: this._ctx,
5204
5632
  });
5205
5633
  };
5634
+ /**
5635
+ * If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
5636
+ */
5206
5637
  asObject = () => {
5207
5638
  return new ObjectTypeDef({
5208
5639
  queryTree: [
@@ -5214,6 +5645,9 @@ export class TypeDef extends BaseClient {
5214
5645
  ctx: this._ctx,
5215
5646
  });
5216
5647
  };
5648
+ /**
5649
+ * The kind of type this is (e.g. primitive, list, object).
5650
+ */
5217
5651
  kind = async () => {
5218
5652
  if (this._kind) {
5219
5653
  return this._kind;
@@ -5226,6 +5660,9 @@ export class TypeDef extends BaseClient {
5226
5660
  ], await this._ctx.connection());
5227
5661
  return response;
5228
5662
  };
5663
+ /**
5664
+ * Whether this type can be set to null. Defaults to false.
5665
+ */
5229
5666
  optional = async () => {
5230
5667
  if (this._optional) {
5231
5668
  return this._optional;