@dagger.io/dagger 0.9.7 → 0.9.9
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.
- package/dist/api/client.gen.d.ts +648 -59
- package/dist/api/client.gen.d.ts.map +1 -1
- package/dist/api/client.gen.js +1231 -99
- package/dist/common/utils.d.ts +3 -0
- package/dist/common/utils.d.ts.map +1 -1
- package/dist/entrypoint/entrypoint.js +2 -1
- package/dist/entrypoint/invoke.d.ts.map +1 -1
- package/dist/entrypoint/invoke.js +25 -5
- package/dist/entrypoint/load.d.ts +43 -1
- package/dist/entrypoint/load.d.ts.map +1 -1
- package/dist/entrypoint/load.js +116 -11
- package/dist/entrypoint/register.d.ts.map +1 -1
- package/dist/entrypoint/register.js +9 -5
- package/dist/introspector/decorators/decorators.d.ts +3 -3
- package/dist/introspector/decorators/decorators.d.ts.map +1 -1
- package/dist/introspector/registry/registry.d.ts +5 -3
- package/dist/introspector/registry/registry.d.ts.map +1 -1
- package/dist/introspector/registry/registry.js +23 -39
- package/dist/introspector/scanner/metadata.d.ts +1 -0
- package/dist/introspector/scanner/metadata.d.ts.map +1 -1
- package/dist/introspector/scanner/scan.d.ts +5 -1
- package/dist/introspector/scanner/scan.d.ts.map +1 -1
- package/dist/introspector/scanner/scan.js +38 -5
- package/dist/introspector/scanner/serialize.d.ts.map +1 -1
- package/dist/introspector/scanner/serialize.js +8 -2
- package/dist/introspector/scanner/typeDefs.d.ts +3 -0
- package/dist/introspector/scanner/typeDefs.d.ts.map +1 -1
- package/dist/introspector/scanner/utils.d.ts +18 -2
- package/dist/introspector/scanner/utils.d.ts.map +1 -1
- package/dist/introspector/scanner/utils.js +85 -12
- package/dist/provisioning/default.d.ts +1 -1
- package/dist/provisioning/default.js +1 -1
- package/package.json +6 -6
package/dist/api/client.gen.js
CHANGED
|
@@ -57,6 +57,14 @@ export var ImageMediaTypes;
|
|
|
57
57
|
ImageMediaTypes["Dockermediatypes"] = "DockerMediaTypes";
|
|
58
58
|
ImageMediaTypes["Ocimediatypes"] = "OCIMediaTypes";
|
|
59
59
|
})(ImageMediaTypes || (ImageMediaTypes = {}));
|
|
60
|
+
/**
|
|
61
|
+
* The kind of module source.
|
|
62
|
+
*/
|
|
63
|
+
export var ModuleSourceKind;
|
|
64
|
+
(function (ModuleSourceKind) {
|
|
65
|
+
ModuleSourceKind["GitSource"] = "GIT_SOURCE";
|
|
66
|
+
ModuleSourceKind["LocalSource"] = "LOCAL_SOURCE";
|
|
67
|
+
})(ModuleSourceKind || (ModuleSourceKind = {}));
|
|
60
68
|
/**
|
|
61
69
|
* Transport layer network protocol associated to a port.
|
|
62
70
|
*/
|
|
@@ -74,6 +82,10 @@ export var TypeDefKind;
|
|
|
74
82
|
* A boolean value.
|
|
75
83
|
*/
|
|
76
84
|
TypeDefKind["BooleanKind"] = "BOOLEAN_KIND";
|
|
85
|
+
/**
|
|
86
|
+
* A graphql input type, used only when representing the core API via TypeDefs.
|
|
87
|
+
*/
|
|
88
|
+
TypeDefKind["InputKind"] = "INPUT_KIND";
|
|
77
89
|
/**
|
|
78
90
|
* An integer value.
|
|
79
91
|
*/
|
|
@@ -146,7 +158,6 @@ export class Container extends BaseClient {
|
|
|
146
158
|
_label = undefined;
|
|
147
159
|
_platform = undefined;
|
|
148
160
|
_publish = undefined;
|
|
149
|
-
_shellEndpoint = undefined;
|
|
150
161
|
_stderr = undefined;
|
|
151
162
|
_stdout = undefined;
|
|
152
163
|
_sync = undefined;
|
|
@@ -155,7 +166,7 @@ export class Container extends BaseClient {
|
|
|
155
166
|
/**
|
|
156
167
|
* Constructor is used for internal usage only, do not create object from it.
|
|
157
168
|
*/
|
|
158
|
-
constructor(parent, _id, _envVariable, _export, _imageRef, _label, _platform, _publish,
|
|
169
|
+
constructor(parent, _id, _envVariable, _export, _imageRef, _label, _platform, _publish, _stderr, _stdout, _sync, _user, _workdir) {
|
|
159
170
|
super(parent);
|
|
160
171
|
this._id = _id;
|
|
161
172
|
this._envVariable = _envVariable;
|
|
@@ -164,7 +175,6 @@ export class Container extends BaseClient {
|
|
|
164
175
|
this._label = _label;
|
|
165
176
|
this._platform = _platform;
|
|
166
177
|
this._publish = _publish;
|
|
167
|
-
this._shellEndpoint = _shellEndpoint;
|
|
168
178
|
this._stderr = _stderr;
|
|
169
179
|
this._stdout = _stdout;
|
|
170
180
|
this._sync = _sync;
|
|
@@ -638,23 +648,6 @@ export class Container extends BaseClient {
|
|
|
638
648
|
ctx: this._ctx,
|
|
639
649
|
});
|
|
640
650
|
};
|
|
641
|
-
/**
|
|
642
|
-
* Return a websocket endpoint that, if connected to, will start the container with a TTY streamed over the websocket.
|
|
643
|
-
*
|
|
644
|
-
* Primarily intended for internal use with the dagger CLI.
|
|
645
|
-
*/
|
|
646
|
-
shellEndpoint = async () => {
|
|
647
|
-
if (this._shellEndpoint) {
|
|
648
|
-
return this._shellEndpoint;
|
|
649
|
-
}
|
|
650
|
-
const response = await computeQuery([
|
|
651
|
-
...this._queryTree,
|
|
652
|
-
{
|
|
653
|
-
operation: "shellEndpoint",
|
|
654
|
-
},
|
|
655
|
-
], await this._ctx.connection());
|
|
656
|
-
return response;
|
|
657
|
-
};
|
|
658
651
|
/**
|
|
659
652
|
* The error stream of the last executed command.
|
|
660
653
|
*
|
|
@@ -703,6 +696,22 @@ export class Container extends BaseClient {
|
|
|
703
696
|
], await this._ctx.connection());
|
|
704
697
|
return this;
|
|
705
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
|
+
};
|
|
706
715
|
/**
|
|
707
716
|
* Retrieves the user to be set for all commands.
|
|
708
717
|
*/
|
|
@@ -734,6 +743,22 @@ export class Container extends BaseClient {
|
|
|
734
743
|
ctx: this._ctx,
|
|
735
744
|
});
|
|
736
745
|
};
|
|
746
|
+
/**
|
|
747
|
+
* Set the default command to invoke for the container's terminal API.
|
|
748
|
+
* @param args The args of the command.
|
|
749
|
+
*/
|
|
750
|
+
withDefaultTerminalCmd = (args) => {
|
|
751
|
+
return new Container({
|
|
752
|
+
queryTree: [
|
|
753
|
+
...this._queryTree,
|
|
754
|
+
{
|
|
755
|
+
operation: "withDefaultTerminalCmd",
|
|
756
|
+
args: { args },
|
|
757
|
+
},
|
|
758
|
+
],
|
|
759
|
+
ctx: this._ctx,
|
|
760
|
+
});
|
|
761
|
+
};
|
|
737
762
|
/**
|
|
738
763
|
* Retrieves this container plus a directory written at the given path.
|
|
739
764
|
* @param path Location of the written directory (e.g., "/tmp/directory").
|
|
@@ -830,6 +855,7 @@ export class Container extends BaseClient {
|
|
|
830
855
|
* @param port Port number to expose
|
|
831
856
|
* @param opts.protocol Transport layer network protocol
|
|
832
857
|
* @param opts.description Optional port description
|
|
858
|
+
* @param opts.experimentalSkipHealthcheck Skip the health check when run as a service.
|
|
833
859
|
*/
|
|
834
860
|
withExposedPort = (port, opts) => {
|
|
835
861
|
const metadata = {
|
|
@@ -1371,6 +1397,99 @@ export class Container extends BaseClient {
|
|
|
1371
1397
|
return arg(this);
|
|
1372
1398
|
};
|
|
1373
1399
|
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Reflective module API provided to functions at runtime.
|
|
1402
|
+
*/
|
|
1403
|
+
export class CurrentModule extends BaseClient {
|
|
1404
|
+
_id = undefined;
|
|
1405
|
+
_name = undefined;
|
|
1406
|
+
/**
|
|
1407
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1408
|
+
*/
|
|
1409
|
+
constructor(parent, _id, _name) {
|
|
1410
|
+
super(parent);
|
|
1411
|
+
this._id = _id;
|
|
1412
|
+
this._name = _name;
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* A unique identifier for this CurrentModule.
|
|
1416
|
+
*/
|
|
1417
|
+
id = async () => {
|
|
1418
|
+
if (this._id) {
|
|
1419
|
+
return this._id;
|
|
1420
|
+
}
|
|
1421
|
+
const response = await computeQuery([
|
|
1422
|
+
...this._queryTree,
|
|
1423
|
+
{
|
|
1424
|
+
operation: "id",
|
|
1425
|
+
},
|
|
1426
|
+
], await this._ctx.connection());
|
|
1427
|
+
return response;
|
|
1428
|
+
};
|
|
1429
|
+
/**
|
|
1430
|
+
* The name of the module being executed in
|
|
1431
|
+
*/
|
|
1432
|
+
name = async () => {
|
|
1433
|
+
if (this._name) {
|
|
1434
|
+
return this._name;
|
|
1435
|
+
}
|
|
1436
|
+
const response = await computeQuery([
|
|
1437
|
+
...this._queryTree,
|
|
1438
|
+
{
|
|
1439
|
+
operation: "name",
|
|
1440
|
+
},
|
|
1441
|
+
], await this._ctx.connection());
|
|
1442
|
+
return response;
|
|
1443
|
+
};
|
|
1444
|
+
/**
|
|
1445
|
+
* The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
|
|
1446
|
+
*/
|
|
1447
|
+
source = () => {
|
|
1448
|
+
return new Directory({
|
|
1449
|
+
queryTree: [
|
|
1450
|
+
...this._queryTree,
|
|
1451
|
+
{
|
|
1452
|
+
operation: "source",
|
|
1453
|
+
},
|
|
1454
|
+
],
|
|
1455
|
+
ctx: this._ctx,
|
|
1456
|
+
});
|
|
1457
|
+
};
|
|
1458
|
+
/**
|
|
1459
|
+
* Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
|
|
1460
|
+
* @param path Location of the directory to access (e.g., ".").
|
|
1461
|
+
* @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
|
|
1462
|
+
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
|
|
1463
|
+
*/
|
|
1464
|
+
workdir = (path, opts) => {
|
|
1465
|
+
return new Directory({
|
|
1466
|
+
queryTree: [
|
|
1467
|
+
...this._queryTree,
|
|
1468
|
+
{
|
|
1469
|
+
operation: "workdir",
|
|
1470
|
+
args: { path, ...opts },
|
|
1471
|
+
},
|
|
1472
|
+
],
|
|
1473
|
+
ctx: this._ctx,
|
|
1474
|
+
});
|
|
1475
|
+
};
|
|
1476
|
+
/**
|
|
1477
|
+
* Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.
|
|
1478
|
+
* @param path Location of the file to retrieve (e.g., "README.md").
|
|
1479
|
+
*/
|
|
1480
|
+
workdirFile = (path) => {
|
|
1481
|
+
return new File({
|
|
1482
|
+
queryTree: [
|
|
1483
|
+
...this._queryTree,
|
|
1484
|
+
{
|
|
1485
|
+
operation: "workdirFile",
|
|
1486
|
+
args: { path },
|
|
1487
|
+
},
|
|
1488
|
+
],
|
|
1489
|
+
ctx: this._ctx,
|
|
1490
|
+
});
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1374
1493
|
/**
|
|
1375
1494
|
* A directory.
|
|
1376
1495
|
*/
|
|
@@ -1404,7 +1523,7 @@ export class Directory extends BaseClient {
|
|
|
1404
1523
|
};
|
|
1405
1524
|
/**
|
|
1406
1525
|
* Load the directory as a Dagger module
|
|
1407
|
-
* @param opts.
|
|
1526
|
+
* @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file.
|
|
1408
1527
|
*
|
|
1409
1528
|
* 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.
|
|
1410
1529
|
*
|
|
@@ -1729,6 +1848,9 @@ export class EnvVariable extends BaseClient {
|
|
|
1729
1848
|
], await this._ctx.connection());
|
|
1730
1849
|
return response;
|
|
1731
1850
|
};
|
|
1851
|
+
/**
|
|
1852
|
+
* The environment variable name.
|
|
1853
|
+
*/
|
|
1732
1854
|
name = async () => {
|
|
1733
1855
|
if (this._name) {
|
|
1734
1856
|
return this._name;
|
|
@@ -1741,6 +1863,9 @@ export class EnvVariable extends BaseClient {
|
|
|
1741
1863
|
], await this._ctx.connection());
|
|
1742
1864
|
return response;
|
|
1743
1865
|
};
|
|
1866
|
+
/**
|
|
1867
|
+
* The environment variable value.
|
|
1868
|
+
*/
|
|
1744
1869
|
value = async () => {
|
|
1745
1870
|
if (this._value) {
|
|
1746
1871
|
return this._value;
|
|
@@ -1787,6 +1912,9 @@ export class FieldTypeDef extends BaseClient {
|
|
|
1787
1912
|
], await this._ctx.connection());
|
|
1788
1913
|
return response;
|
|
1789
1914
|
};
|
|
1915
|
+
/**
|
|
1916
|
+
* A doc string for the field, if any.
|
|
1917
|
+
*/
|
|
1790
1918
|
description = async () => {
|
|
1791
1919
|
if (this._description) {
|
|
1792
1920
|
return this._description;
|
|
@@ -1799,6 +1927,9 @@ export class FieldTypeDef extends BaseClient {
|
|
|
1799
1927
|
], await this._ctx.connection());
|
|
1800
1928
|
return response;
|
|
1801
1929
|
};
|
|
1930
|
+
/**
|
|
1931
|
+
* The name of the field in lowerCamelCase format.
|
|
1932
|
+
*/
|
|
1802
1933
|
name = async () => {
|
|
1803
1934
|
if (this._name) {
|
|
1804
1935
|
return this._name;
|
|
@@ -1811,6 +1942,9 @@ export class FieldTypeDef extends BaseClient {
|
|
|
1811
1942
|
], await this._ctx.connection());
|
|
1812
1943
|
return response;
|
|
1813
1944
|
};
|
|
1945
|
+
/**
|
|
1946
|
+
* The type of the field.
|
|
1947
|
+
*/
|
|
1814
1948
|
typeDef = () => {
|
|
1815
1949
|
return new TypeDef({
|
|
1816
1950
|
queryTree: [
|
|
@@ -1995,6 +2129,9 @@ export class Function_ extends BaseClient {
|
|
|
1995
2129
|
], await this._ctx.connection());
|
|
1996
2130
|
return response;
|
|
1997
2131
|
};
|
|
2132
|
+
/**
|
|
2133
|
+
* Arguments accepted by the function, if any.
|
|
2134
|
+
*/
|
|
1998
2135
|
args = async () => {
|
|
1999
2136
|
const response = await computeQuery([
|
|
2000
2137
|
...this._queryTree,
|
|
@@ -2015,6 +2152,9 @@ export class Function_ extends BaseClient {
|
|
|
2015
2152
|
ctx: this._ctx,
|
|
2016
2153
|
}, r.id));
|
|
2017
2154
|
};
|
|
2155
|
+
/**
|
|
2156
|
+
* A doc string for the function, if any.
|
|
2157
|
+
*/
|
|
2018
2158
|
description = async () => {
|
|
2019
2159
|
if (this._description) {
|
|
2020
2160
|
return this._description;
|
|
@@ -2027,6 +2167,9 @@ export class Function_ extends BaseClient {
|
|
|
2027
2167
|
], await this._ctx.connection());
|
|
2028
2168
|
return response;
|
|
2029
2169
|
};
|
|
2170
|
+
/**
|
|
2171
|
+
* The name of the function.
|
|
2172
|
+
*/
|
|
2030
2173
|
name = async () => {
|
|
2031
2174
|
if (this._name) {
|
|
2032
2175
|
return this._name;
|
|
@@ -2039,6 +2182,9 @@ export class Function_ extends BaseClient {
|
|
|
2039
2182
|
], await this._ctx.connection());
|
|
2040
2183
|
return response;
|
|
2041
2184
|
};
|
|
2185
|
+
/**
|
|
2186
|
+
* The type returned by the function.
|
|
2187
|
+
*/
|
|
2042
2188
|
returnType = () => {
|
|
2043
2189
|
return new TypeDef({
|
|
2044
2190
|
queryTree: [
|
|
@@ -2129,6 +2275,9 @@ export class FunctionArg extends BaseClient {
|
|
|
2129
2275
|
], await this._ctx.connection());
|
|
2130
2276
|
return response;
|
|
2131
2277
|
};
|
|
2278
|
+
/**
|
|
2279
|
+
* A default value to use for this argument when not explicitly set by the caller, if any.
|
|
2280
|
+
*/
|
|
2132
2281
|
defaultValue = async () => {
|
|
2133
2282
|
if (this._defaultValue) {
|
|
2134
2283
|
return this._defaultValue;
|
|
@@ -2141,6 +2290,9 @@ export class FunctionArg extends BaseClient {
|
|
|
2141
2290
|
], await this._ctx.connection());
|
|
2142
2291
|
return response;
|
|
2143
2292
|
};
|
|
2293
|
+
/**
|
|
2294
|
+
* A doc string for the argument, if any.
|
|
2295
|
+
*/
|
|
2144
2296
|
description = async () => {
|
|
2145
2297
|
if (this._description) {
|
|
2146
2298
|
return this._description;
|
|
@@ -2153,6 +2305,9 @@ export class FunctionArg extends BaseClient {
|
|
|
2153
2305
|
], await this._ctx.connection());
|
|
2154
2306
|
return response;
|
|
2155
2307
|
};
|
|
2308
|
+
/**
|
|
2309
|
+
* The name of the argument in lowerCamelCase format.
|
|
2310
|
+
*/
|
|
2156
2311
|
name = async () => {
|
|
2157
2312
|
if (this._name) {
|
|
2158
2313
|
return this._name;
|
|
@@ -2165,6 +2320,9 @@ export class FunctionArg extends BaseClient {
|
|
|
2165
2320
|
], await this._ctx.connection());
|
|
2166
2321
|
return response;
|
|
2167
2322
|
};
|
|
2323
|
+
/**
|
|
2324
|
+
* The type of the argument.
|
|
2325
|
+
*/
|
|
2168
2326
|
typeDef = () => {
|
|
2169
2327
|
return new TypeDef({
|
|
2170
2328
|
queryTree: [
|
|
@@ -2212,6 +2370,9 @@ export class FunctionCall extends BaseClient {
|
|
|
2212
2370
|
], await this._ctx.connection());
|
|
2213
2371
|
return response;
|
|
2214
2372
|
};
|
|
2373
|
+
/**
|
|
2374
|
+
* The argument values the function is being invoked with.
|
|
2375
|
+
*/
|
|
2215
2376
|
inputArgs = async () => {
|
|
2216
2377
|
const response = await computeQuery([
|
|
2217
2378
|
...this._queryTree,
|
|
@@ -2232,6 +2393,9 @@ export class FunctionCall extends BaseClient {
|
|
|
2232
2393
|
ctx: this._ctx,
|
|
2233
2394
|
}, r.id));
|
|
2234
2395
|
};
|
|
2396
|
+
/**
|
|
2397
|
+
* The name of the function being called.
|
|
2398
|
+
*/
|
|
2235
2399
|
name = async () => {
|
|
2236
2400
|
if (this._name) {
|
|
2237
2401
|
return this._name;
|
|
@@ -2244,6 +2408,9 @@ export class FunctionCall extends BaseClient {
|
|
|
2244
2408
|
], await this._ctx.connection());
|
|
2245
2409
|
return response;
|
|
2246
2410
|
};
|
|
2411
|
+
/**
|
|
2412
|
+
* 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.
|
|
2413
|
+
*/
|
|
2247
2414
|
parent = async () => {
|
|
2248
2415
|
if (this._parent) {
|
|
2249
2416
|
return this._parent;
|
|
@@ -2256,6 +2423,9 @@ export class FunctionCall extends BaseClient {
|
|
|
2256
2423
|
], await this._ctx.connection());
|
|
2257
2424
|
return response;
|
|
2258
2425
|
};
|
|
2426
|
+
/**
|
|
2427
|
+
* 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.
|
|
2428
|
+
*/
|
|
2259
2429
|
parentName = async () => {
|
|
2260
2430
|
if (this._parentName) {
|
|
2261
2431
|
return this._parentName;
|
|
@@ -2317,6 +2487,9 @@ export class FunctionCallArgValue extends BaseClient {
|
|
|
2317
2487
|
], await this._ctx.connection());
|
|
2318
2488
|
return response;
|
|
2319
2489
|
};
|
|
2490
|
+
/**
|
|
2491
|
+
* The name of the argument.
|
|
2492
|
+
*/
|
|
2320
2493
|
name = async () => {
|
|
2321
2494
|
if (this._name) {
|
|
2322
2495
|
return this._name;
|
|
@@ -2329,6 +2502,9 @@ export class FunctionCallArgValue extends BaseClient {
|
|
|
2329
2502
|
], await this._ctx.connection());
|
|
2330
2503
|
return response;
|
|
2331
2504
|
};
|
|
2505
|
+
/**
|
|
2506
|
+
* The value of the argument represented as a JSON serialized string.
|
|
2507
|
+
*/
|
|
2332
2508
|
value = async () => {
|
|
2333
2509
|
if (this._value) {
|
|
2334
2510
|
return this._value;
|
|
@@ -2369,6 +2545,9 @@ export class GeneratedCode extends BaseClient {
|
|
|
2369
2545
|
], await this._ctx.connection());
|
|
2370
2546
|
return response;
|
|
2371
2547
|
};
|
|
2548
|
+
/**
|
|
2549
|
+
* The directory containing the generated code.
|
|
2550
|
+
*/
|
|
2372
2551
|
code = () => {
|
|
2373
2552
|
return new Directory({
|
|
2374
2553
|
queryTree: [
|
|
@@ -2380,6 +2559,9 @@ export class GeneratedCode extends BaseClient {
|
|
|
2380
2559
|
ctx: this._ctx,
|
|
2381
2560
|
});
|
|
2382
2561
|
};
|
|
2562
|
+
/**
|
|
2563
|
+
* List of paths to mark generated in version control (i.e. .gitattributes).
|
|
2564
|
+
*/
|
|
2383
2565
|
vcsGeneratedPaths = async () => {
|
|
2384
2566
|
const response = await computeQuery([
|
|
2385
2567
|
...this._queryTree,
|
|
@@ -2389,6 +2571,9 @@ export class GeneratedCode extends BaseClient {
|
|
|
2389
2571
|
], await this._ctx.connection());
|
|
2390
2572
|
return response;
|
|
2391
2573
|
};
|
|
2574
|
+
/**
|
|
2575
|
+
* List of paths to ignore in version control (i.e. .gitignore).
|
|
2576
|
+
*/
|
|
2392
2577
|
vcsIgnoredPaths = async () => {
|
|
2393
2578
|
const response = await computeQuery([
|
|
2394
2579
|
...this._queryTree,
|
|
@@ -2437,6 +2622,133 @@ export class GeneratedCode extends BaseClient {
|
|
|
2437
2622
|
return arg(this);
|
|
2438
2623
|
};
|
|
2439
2624
|
}
|
|
2625
|
+
/**
|
|
2626
|
+
* Module source originating from a git repo.
|
|
2627
|
+
*/
|
|
2628
|
+
export class GitModuleSource extends BaseClient {
|
|
2629
|
+
_id = undefined;
|
|
2630
|
+
_cloneURL = undefined;
|
|
2631
|
+
_commit = undefined;
|
|
2632
|
+
_htmlURL = undefined;
|
|
2633
|
+
_rootSubpath = undefined;
|
|
2634
|
+
_version = undefined;
|
|
2635
|
+
/**
|
|
2636
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2637
|
+
*/
|
|
2638
|
+
constructor(parent, _id, _cloneURL, _commit, _htmlURL, _rootSubpath, _version) {
|
|
2639
|
+
super(parent);
|
|
2640
|
+
this._id = _id;
|
|
2641
|
+
this._cloneURL = _cloneURL;
|
|
2642
|
+
this._commit = _commit;
|
|
2643
|
+
this._htmlURL = _htmlURL;
|
|
2644
|
+
this._rootSubpath = _rootSubpath;
|
|
2645
|
+
this._version = _version;
|
|
2646
|
+
}
|
|
2647
|
+
/**
|
|
2648
|
+
* A unique identifier for this GitModuleSource.
|
|
2649
|
+
*/
|
|
2650
|
+
id = async () => {
|
|
2651
|
+
if (this._id) {
|
|
2652
|
+
return this._id;
|
|
2653
|
+
}
|
|
2654
|
+
const response = await computeQuery([
|
|
2655
|
+
...this._queryTree,
|
|
2656
|
+
{
|
|
2657
|
+
operation: "id",
|
|
2658
|
+
},
|
|
2659
|
+
], await this._ctx.connection());
|
|
2660
|
+
return response;
|
|
2661
|
+
};
|
|
2662
|
+
/**
|
|
2663
|
+
* The URL from which the source's git repo can be cloned.
|
|
2664
|
+
*/
|
|
2665
|
+
cloneURL = async () => {
|
|
2666
|
+
if (this._cloneURL) {
|
|
2667
|
+
return this._cloneURL;
|
|
2668
|
+
}
|
|
2669
|
+
const response = await computeQuery([
|
|
2670
|
+
...this._queryTree,
|
|
2671
|
+
{
|
|
2672
|
+
operation: "cloneURL",
|
|
2673
|
+
},
|
|
2674
|
+
], await this._ctx.connection());
|
|
2675
|
+
return response;
|
|
2676
|
+
};
|
|
2677
|
+
/**
|
|
2678
|
+
* The resolved commit of the git repo this source points to.
|
|
2679
|
+
*/
|
|
2680
|
+
commit = async () => {
|
|
2681
|
+
if (this._commit) {
|
|
2682
|
+
return this._commit;
|
|
2683
|
+
}
|
|
2684
|
+
const response = await computeQuery([
|
|
2685
|
+
...this._queryTree,
|
|
2686
|
+
{
|
|
2687
|
+
operation: "commit",
|
|
2688
|
+
},
|
|
2689
|
+
], await this._ctx.connection());
|
|
2690
|
+
return response;
|
|
2691
|
+
};
|
|
2692
|
+
/**
|
|
2693
|
+
* The directory containing everything needed to load load and use the module.
|
|
2694
|
+
*/
|
|
2695
|
+
contextDirectory = () => {
|
|
2696
|
+
return new Directory({
|
|
2697
|
+
queryTree: [
|
|
2698
|
+
...this._queryTree,
|
|
2699
|
+
{
|
|
2700
|
+
operation: "contextDirectory",
|
|
2701
|
+
},
|
|
2702
|
+
],
|
|
2703
|
+
ctx: this._ctx,
|
|
2704
|
+
});
|
|
2705
|
+
};
|
|
2706
|
+
/**
|
|
2707
|
+
* The URL to the source's git repo in a web browser
|
|
2708
|
+
*/
|
|
2709
|
+
htmlURL = async () => {
|
|
2710
|
+
if (this._htmlURL) {
|
|
2711
|
+
return this._htmlURL;
|
|
2712
|
+
}
|
|
2713
|
+
const response = await computeQuery([
|
|
2714
|
+
...this._queryTree,
|
|
2715
|
+
{
|
|
2716
|
+
operation: "htmlURL",
|
|
2717
|
+
},
|
|
2718
|
+
], await this._ctx.connection());
|
|
2719
|
+
return response;
|
|
2720
|
+
};
|
|
2721
|
+
/**
|
|
2722
|
+
* 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).
|
|
2723
|
+
*/
|
|
2724
|
+
rootSubpath = async () => {
|
|
2725
|
+
if (this._rootSubpath) {
|
|
2726
|
+
return this._rootSubpath;
|
|
2727
|
+
}
|
|
2728
|
+
const response = await computeQuery([
|
|
2729
|
+
...this._queryTree,
|
|
2730
|
+
{
|
|
2731
|
+
operation: "rootSubpath",
|
|
2732
|
+
},
|
|
2733
|
+
], await this._ctx.connection());
|
|
2734
|
+
return response;
|
|
2735
|
+
};
|
|
2736
|
+
/**
|
|
2737
|
+
* The specified version of the git repo this source points to.
|
|
2738
|
+
*/
|
|
2739
|
+
version = async () => {
|
|
2740
|
+
if (this._version) {
|
|
2741
|
+
return this._version;
|
|
2742
|
+
}
|
|
2743
|
+
const response = await computeQuery([
|
|
2744
|
+
...this._queryTree,
|
|
2745
|
+
{
|
|
2746
|
+
operation: "version",
|
|
2747
|
+
},
|
|
2748
|
+
], await this._ctx.connection());
|
|
2749
|
+
return response;
|
|
2750
|
+
};
|
|
2751
|
+
}
|
|
2440
2752
|
/**
|
|
2441
2753
|
* A git ref (tag, branch, or commit).
|
|
2442
2754
|
*/
|
|
@@ -2559,15 +2871,31 @@ export class GitRepository extends BaseClient {
|
|
|
2559
2871
|
});
|
|
2560
2872
|
};
|
|
2561
2873
|
/**
|
|
2562
|
-
* Returns details of a
|
|
2563
|
-
* @param name
|
|
2874
|
+
* Returns details of a ref.
|
|
2875
|
+
* @param name Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
|
|
2564
2876
|
*/
|
|
2565
|
-
|
|
2877
|
+
ref = (name) => {
|
|
2566
2878
|
return new GitRef({
|
|
2567
2879
|
queryTree: [
|
|
2568
2880
|
...this._queryTree,
|
|
2569
2881
|
{
|
|
2570
|
-
operation: "
|
|
2882
|
+
operation: "ref",
|
|
2883
|
+
args: { name },
|
|
2884
|
+
},
|
|
2885
|
+
],
|
|
2886
|
+
ctx: this._ctx,
|
|
2887
|
+
});
|
|
2888
|
+
};
|
|
2889
|
+
/**
|
|
2890
|
+
* Returns details of a tag.
|
|
2891
|
+
* @param name Tag's name (e.g., "v0.3.9").
|
|
2892
|
+
*/
|
|
2893
|
+
tag = (name) => {
|
|
2894
|
+
return new GitRef({
|
|
2895
|
+
queryTree: [
|
|
2896
|
+
...this._queryTree,
|
|
2897
|
+
{
|
|
2898
|
+
operation: "tag",
|
|
2571
2899
|
args: { name },
|
|
2572
2900
|
},
|
|
2573
2901
|
],
|
|
@@ -2719,6 +3047,77 @@ export class Host extends BaseClient {
|
|
|
2719
3047
|
});
|
|
2720
3048
|
};
|
|
2721
3049
|
}
|
|
3050
|
+
/**
|
|
3051
|
+
* A graphql input type, which is essentially just a group of named args.
|
|
3052
|
+
* This is currently only used to represent pre-existing usage of graphql input types
|
|
3053
|
+
* in the core API. It is not used by user modules and shouldn't ever be as user
|
|
3054
|
+
* module accept input objects via their id rather than graphql input types.
|
|
3055
|
+
*/
|
|
3056
|
+
export class InputTypeDef extends BaseClient {
|
|
3057
|
+
_id = undefined;
|
|
3058
|
+
_name = undefined;
|
|
3059
|
+
/**
|
|
3060
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
3061
|
+
*/
|
|
3062
|
+
constructor(parent, _id, _name) {
|
|
3063
|
+
super(parent);
|
|
3064
|
+
this._id = _id;
|
|
3065
|
+
this._name = _name;
|
|
3066
|
+
}
|
|
3067
|
+
/**
|
|
3068
|
+
* A unique identifier for this InputTypeDef.
|
|
3069
|
+
*/
|
|
3070
|
+
id = async () => {
|
|
3071
|
+
if (this._id) {
|
|
3072
|
+
return this._id;
|
|
3073
|
+
}
|
|
3074
|
+
const response = await computeQuery([
|
|
3075
|
+
...this._queryTree,
|
|
3076
|
+
{
|
|
3077
|
+
operation: "id",
|
|
3078
|
+
},
|
|
3079
|
+
], await this._ctx.connection());
|
|
3080
|
+
return response;
|
|
3081
|
+
};
|
|
3082
|
+
/**
|
|
3083
|
+
* Static fields defined on this input object, if any.
|
|
3084
|
+
*/
|
|
3085
|
+
fields = async () => {
|
|
3086
|
+
const response = await computeQuery([
|
|
3087
|
+
...this._queryTree,
|
|
3088
|
+
{
|
|
3089
|
+
operation: "fields",
|
|
3090
|
+
},
|
|
3091
|
+
{
|
|
3092
|
+
operation: "id",
|
|
3093
|
+
},
|
|
3094
|
+
], await this._ctx.connection());
|
|
3095
|
+
return response.map((r) => new FieldTypeDef({
|
|
3096
|
+
queryTree: [
|
|
3097
|
+
{
|
|
3098
|
+
operation: "loadFieldTypeDefFromID",
|
|
3099
|
+
args: { id: r.id },
|
|
3100
|
+
},
|
|
3101
|
+
],
|
|
3102
|
+
ctx: this._ctx,
|
|
3103
|
+
}, r.id));
|
|
3104
|
+
};
|
|
3105
|
+
/**
|
|
3106
|
+
* The name of the input object.
|
|
3107
|
+
*/
|
|
3108
|
+
name = async () => {
|
|
3109
|
+
if (this._name) {
|
|
3110
|
+
return this._name;
|
|
3111
|
+
}
|
|
3112
|
+
const response = await computeQuery([
|
|
3113
|
+
...this._queryTree,
|
|
3114
|
+
{
|
|
3115
|
+
operation: "name",
|
|
3116
|
+
},
|
|
3117
|
+
], await this._ctx.connection());
|
|
3118
|
+
return response;
|
|
3119
|
+
};
|
|
3120
|
+
}
|
|
2722
3121
|
/**
|
|
2723
3122
|
* A definition of a custom interface defined in a Module.
|
|
2724
3123
|
*/
|
|
@@ -2752,6 +3151,9 @@ export class InterfaceTypeDef extends BaseClient {
|
|
|
2752
3151
|
], await this._ctx.connection());
|
|
2753
3152
|
return response;
|
|
2754
3153
|
};
|
|
3154
|
+
/**
|
|
3155
|
+
* The doc string for the interface, if any.
|
|
3156
|
+
*/
|
|
2755
3157
|
description = async () => {
|
|
2756
3158
|
if (this._description) {
|
|
2757
3159
|
return this._description;
|
|
@@ -2764,6 +3166,9 @@ export class InterfaceTypeDef extends BaseClient {
|
|
|
2764
3166
|
], await this._ctx.connection());
|
|
2765
3167
|
return response;
|
|
2766
3168
|
};
|
|
3169
|
+
/**
|
|
3170
|
+
* Functions defined on this interface, if any.
|
|
3171
|
+
*/
|
|
2767
3172
|
functions = async () => {
|
|
2768
3173
|
const response = await computeQuery([
|
|
2769
3174
|
...this._queryTree,
|
|
@@ -2784,6 +3189,9 @@ export class InterfaceTypeDef extends BaseClient {
|
|
|
2784
3189
|
ctx: this._ctx,
|
|
2785
3190
|
}, r.id));
|
|
2786
3191
|
};
|
|
3192
|
+
/**
|
|
3193
|
+
* The name of the interface.
|
|
3194
|
+
*/
|
|
2787
3195
|
name = async () => {
|
|
2788
3196
|
if (this._name) {
|
|
2789
3197
|
return this._name;
|
|
@@ -2796,6 +3204,9 @@ export class InterfaceTypeDef extends BaseClient {
|
|
|
2796
3204
|
], await this._ctx.connection());
|
|
2797
3205
|
return response;
|
|
2798
3206
|
};
|
|
3207
|
+
/**
|
|
3208
|
+
* If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
|
|
3209
|
+
*/
|
|
2799
3210
|
sourceModuleName = async () => {
|
|
2800
3211
|
if (this._sourceModuleName) {
|
|
2801
3212
|
return this._sourceModuleName;
|
|
@@ -2840,6 +3251,9 @@ export class Label extends BaseClient {
|
|
|
2840
3251
|
], await this._ctx.connection());
|
|
2841
3252
|
return response;
|
|
2842
3253
|
};
|
|
3254
|
+
/**
|
|
3255
|
+
* The label name.
|
|
3256
|
+
*/
|
|
2843
3257
|
name = async () => {
|
|
2844
3258
|
if (this._name) {
|
|
2845
3259
|
return this._name;
|
|
@@ -2852,6 +3266,9 @@ export class Label extends BaseClient {
|
|
|
2852
3266
|
], await this._ctx.connection());
|
|
2853
3267
|
return response;
|
|
2854
3268
|
};
|
|
3269
|
+
/**
|
|
3270
|
+
* The label value.
|
|
3271
|
+
*/
|
|
2855
3272
|
value = async () => {
|
|
2856
3273
|
if (this._value) {
|
|
2857
3274
|
return this._value;
|
|
@@ -2892,6 +3309,9 @@ export class ListTypeDef extends BaseClient {
|
|
|
2892
3309
|
], await this._ctx.connection());
|
|
2893
3310
|
return response;
|
|
2894
3311
|
};
|
|
3312
|
+
/**
|
|
3313
|
+
* The type of the elements in the list.
|
|
3314
|
+
*/
|
|
2895
3315
|
elementTypeDef = () => {
|
|
2896
3316
|
return new TypeDef({
|
|
2897
3317
|
queryTree: [
|
|
@@ -2904,6 +3324,65 @@ export class ListTypeDef extends BaseClient {
|
|
|
2904
3324
|
});
|
|
2905
3325
|
};
|
|
2906
3326
|
}
|
|
3327
|
+
/**
|
|
3328
|
+
* Module source that that originates from a path locally relative to an arbitrary directory.
|
|
3329
|
+
*/
|
|
3330
|
+
export class LocalModuleSource extends BaseClient {
|
|
3331
|
+
_id = undefined;
|
|
3332
|
+
_rootSubpath = undefined;
|
|
3333
|
+
/**
|
|
3334
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
3335
|
+
*/
|
|
3336
|
+
constructor(parent, _id, _rootSubpath) {
|
|
3337
|
+
super(parent);
|
|
3338
|
+
this._id = _id;
|
|
3339
|
+
this._rootSubpath = _rootSubpath;
|
|
3340
|
+
}
|
|
3341
|
+
/**
|
|
3342
|
+
* A unique identifier for this LocalModuleSource.
|
|
3343
|
+
*/
|
|
3344
|
+
id = async () => {
|
|
3345
|
+
if (this._id) {
|
|
3346
|
+
return this._id;
|
|
3347
|
+
}
|
|
3348
|
+
const response = await computeQuery([
|
|
3349
|
+
...this._queryTree,
|
|
3350
|
+
{
|
|
3351
|
+
operation: "id",
|
|
3352
|
+
},
|
|
3353
|
+
], await this._ctx.connection());
|
|
3354
|
+
return response;
|
|
3355
|
+
};
|
|
3356
|
+
/**
|
|
3357
|
+
* The directory containing everything needed to load load and use the module.
|
|
3358
|
+
*/
|
|
3359
|
+
contextDirectory = () => {
|
|
3360
|
+
return new Directory({
|
|
3361
|
+
queryTree: [
|
|
3362
|
+
...this._queryTree,
|
|
3363
|
+
{
|
|
3364
|
+
operation: "contextDirectory",
|
|
3365
|
+
},
|
|
3366
|
+
],
|
|
3367
|
+
ctx: this._ctx,
|
|
3368
|
+
});
|
|
3369
|
+
};
|
|
3370
|
+
/**
|
|
3371
|
+
* 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).
|
|
3372
|
+
*/
|
|
3373
|
+
rootSubpath = async () => {
|
|
3374
|
+
if (this._rootSubpath) {
|
|
3375
|
+
return this._rootSubpath;
|
|
3376
|
+
}
|
|
3377
|
+
const response = await computeQuery([
|
|
3378
|
+
...this._queryTree,
|
|
3379
|
+
{
|
|
3380
|
+
operation: "rootSubpath",
|
|
3381
|
+
},
|
|
3382
|
+
], await this._ctx.connection());
|
|
3383
|
+
return response;
|
|
3384
|
+
};
|
|
3385
|
+
}
|
|
2907
3386
|
/**
|
|
2908
3387
|
* A Dagger module.
|
|
2909
3388
|
*/
|
|
@@ -2913,18 +3392,16 @@ export class Module_ extends BaseClient {
|
|
|
2913
3392
|
_name = undefined;
|
|
2914
3393
|
_sdk = undefined;
|
|
2915
3394
|
_serve = undefined;
|
|
2916
|
-
_sourceDirectorySubpath = undefined;
|
|
2917
3395
|
/**
|
|
2918
3396
|
* Constructor is used for internal usage only, do not create object from it.
|
|
2919
3397
|
*/
|
|
2920
|
-
constructor(parent, _id, _description, _name, _sdk, _serve
|
|
3398
|
+
constructor(parent, _id, _description, _name, _sdk, _serve) {
|
|
2921
3399
|
super(parent);
|
|
2922
3400
|
this._id = _id;
|
|
2923
3401
|
this._description = _description;
|
|
2924
3402
|
this._name = _name;
|
|
2925
3403
|
this._sdk = _sdk;
|
|
2926
3404
|
this._serve = _serve;
|
|
2927
|
-
this._sourceDirectorySubpath = _sourceDirectorySubpath;
|
|
2928
3405
|
}
|
|
2929
3406
|
/**
|
|
2930
3407
|
* A unique identifier for this Module.
|
|
@@ -2941,6 +3418,9 @@ export class Module_ extends BaseClient {
|
|
|
2941
3418
|
], await this._ctx.connection());
|
|
2942
3419
|
return response;
|
|
2943
3420
|
};
|
|
3421
|
+
/**
|
|
3422
|
+
* Modules used by this module.
|
|
3423
|
+
*/
|
|
2944
3424
|
dependencies = async () => {
|
|
2945
3425
|
const response = await computeQuery([
|
|
2946
3426
|
...this._queryTree,
|
|
@@ -2961,15 +3441,32 @@ export class Module_ extends BaseClient {
|
|
|
2961
3441
|
ctx: this._ctx,
|
|
2962
3442
|
}, r.id));
|
|
2963
3443
|
};
|
|
3444
|
+
/**
|
|
3445
|
+
* The dependencies as configured by the module.
|
|
3446
|
+
*/
|
|
2964
3447
|
dependencyConfig = async () => {
|
|
2965
3448
|
const response = await computeQuery([
|
|
2966
3449
|
...this._queryTree,
|
|
2967
3450
|
{
|
|
2968
3451
|
operation: "dependencyConfig",
|
|
2969
3452
|
},
|
|
3453
|
+
{
|
|
3454
|
+
operation: "id",
|
|
3455
|
+
},
|
|
2970
3456
|
], await this._ctx.connection());
|
|
2971
|
-
return response
|
|
3457
|
+
return response.map((r) => new ModuleDependency({
|
|
3458
|
+
queryTree: [
|
|
3459
|
+
{
|
|
3460
|
+
operation: "loadModuleDependencyFromID",
|
|
3461
|
+
args: { id: r.id },
|
|
3462
|
+
},
|
|
3463
|
+
],
|
|
3464
|
+
ctx: this._ctx,
|
|
3465
|
+
}, r.id));
|
|
2972
3466
|
};
|
|
3467
|
+
/**
|
|
3468
|
+
* The doc string of the module, if any
|
|
3469
|
+
*/
|
|
2973
3470
|
description = async () => {
|
|
2974
3471
|
if (this._description) {
|
|
2975
3472
|
return this._description;
|
|
@@ -2982,12 +3479,29 @@ export class Module_ extends BaseClient {
|
|
|
2982
3479
|
], await this._ctx.connection());
|
|
2983
3480
|
return response;
|
|
2984
3481
|
};
|
|
2985
|
-
|
|
2986
|
-
|
|
3482
|
+
/**
|
|
3483
|
+
* The generated files and directories made on top of the module source's context directory.
|
|
3484
|
+
*/
|
|
3485
|
+
generatedContextDiff = () => {
|
|
3486
|
+
return new Directory({
|
|
2987
3487
|
queryTree: [
|
|
2988
3488
|
...this._queryTree,
|
|
2989
3489
|
{
|
|
2990
|
-
operation: "
|
|
3490
|
+
operation: "generatedContextDiff",
|
|
3491
|
+
},
|
|
3492
|
+
],
|
|
3493
|
+
ctx: this._ctx,
|
|
3494
|
+
});
|
|
3495
|
+
};
|
|
3496
|
+
/**
|
|
3497
|
+
* The module source's context plus any configuration and source files created by codegen.
|
|
3498
|
+
*/
|
|
3499
|
+
generatedContextDirectory = () => {
|
|
3500
|
+
return new Directory({
|
|
3501
|
+
queryTree: [
|
|
3502
|
+
...this._queryTree,
|
|
3503
|
+
{
|
|
3504
|
+
operation: "generatedContextDirectory",
|
|
2991
3505
|
},
|
|
2992
3506
|
],
|
|
2993
3507
|
ctx: this._ctx,
|
|
@@ -3007,6 +3521,9 @@ export class Module_ extends BaseClient {
|
|
|
3007
3521
|
ctx: this._ctx,
|
|
3008
3522
|
});
|
|
3009
3523
|
};
|
|
3524
|
+
/**
|
|
3525
|
+
* Interfaces served by this module.
|
|
3526
|
+
*/
|
|
3010
3527
|
interfaces = async () => {
|
|
3011
3528
|
const response = await computeQuery([
|
|
3012
3529
|
...this._queryTree,
|
|
@@ -3027,6 +3544,9 @@ export class Module_ extends BaseClient {
|
|
|
3027
3544
|
ctx: this._ctx,
|
|
3028
3545
|
}, r.id));
|
|
3029
3546
|
};
|
|
3547
|
+
/**
|
|
3548
|
+
* The name of the module
|
|
3549
|
+
*/
|
|
3030
3550
|
name = async () => {
|
|
3031
3551
|
if (this._name) {
|
|
3032
3552
|
return this._name;
|
|
@@ -3039,6 +3559,9 @@ export class Module_ extends BaseClient {
|
|
|
3039
3559
|
], await this._ctx.connection());
|
|
3040
3560
|
return response;
|
|
3041
3561
|
};
|
|
3562
|
+
/**
|
|
3563
|
+
* Objects served by this module.
|
|
3564
|
+
*/
|
|
3042
3565
|
objects = async () => {
|
|
3043
3566
|
const response = await computeQuery([
|
|
3044
3567
|
...this._queryTree,
|
|
@@ -3059,6 +3582,23 @@ export class Module_ extends BaseClient {
|
|
|
3059
3582
|
ctx: this._ctx,
|
|
3060
3583
|
}, r.id));
|
|
3061
3584
|
};
|
|
3585
|
+
/**
|
|
3586
|
+
* The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
|
|
3587
|
+
*/
|
|
3588
|
+
runtime = () => {
|
|
3589
|
+
return new Container({
|
|
3590
|
+
queryTree: [
|
|
3591
|
+
...this._queryTree,
|
|
3592
|
+
{
|
|
3593
|
+
operation: "runtime",
|
|
3594
|
+
},
|
|
3595
|
+
],
|
|
3596
|
+
ctx: this._ctx,
|
|
3597
|
+
});
|
|
3598
|
+
};
|
|
3599
|
+
/**
|
|
3600
|
+
* 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.
|
|
3601
|
+
*/
|
|
3062
3602
|
sdk = async () => {
|
|
3063
3603
|
if (this._sdk) {
|
|
3064
3604
|
return this._sdk;
|
|
@@ -3088,28 +3628,35 @@ export class Module_ extends BaseClient {
|
|
|
3088
3628
|
], await this._ctx.connection());
|
|
3089
3629
|
return response;
|
|
3090
3630
|
};
|
|
3091
|
-
|
|
3092
|
-
|
|
3631
|
+
/**
|
|
3632
|
+
* The source for the module.
|
|
3633
|
+
*/
|
|
3634
|
+
source = () => {
|
|
3635
|
+
return new ModuleSource({
|
|
3093
3636
|
queryTree: [
|
|
3094
3637
|
...this._queryTree,
|
|
3095
3638
|
{
|
|
3096
|
-
operation: "
|
|
3639
|
+
operation: "source",
|
|
3097
3640
|
},
|
|
3098
3641
|
],
|
|
3099
3642
|
ctx: this._ctx,
|
|
3100
3643
|
});
|
|
3101
3644
|
};
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3645
|
+
/**
|
|
3646
|
+
* Retrieves the module with the given description
|
|
3647
|
+
* @param description The description to set
|
|
3648
|
+
*/
|
|
3649
|
+
withDescription = (description) => {
|
|
3650
|
+
return new Module_({
|
|
3651
|
+
queryTree: [
|
|
3652
|
+
...this._queryTree,
|
|
3653
|
+
{
|
|
3654
|
+
operation: "withDescription",
|
|
3655
|
+
args: { description },
|
|
3656
|
+
},
|
|
3657
|
+
],
|
|
3658
|
+
ctx: this._ctx,
|
|
3659
|
+
});
|
|
3113
3660
|
};
|
|
3114
3661
|
/**
|
|
3115
3662
|
* This module plus the given Interface type and associated functions
|
|
@@ -3142,21 +3689,16 @@ export class Module_ extends BaseClient {
|
|
|
3142
3689
|
});
|
|
3143
3690
|
};
|
|
3144
3691
|
/**
|
|
3145
|
-
* Retrieves the module with basic configuration loaded
|
|
3146
|
-
* @param
|
|
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.
|
|
3692
|
+
* Retrieves the module with basic configuration loaded if present.
|
|
3693
|
+
* @param source The module source to initialize from.
|
|
3152
3694
|
*/
|
|
3153
|
-
withSource = (
|
|
3695
|
+
withSource = (source) => {
|
|
3154
3696
|
return new Module_({
|
|
3155
3697
|
queryTree: [
|
|
3156
3698
|
...this._queryTree,
|
|
3157
3699
|
{
|
|
3158
3700
|
operation: "withSource",
|
|
3159
|
-
args: {
|
|
3701
|
+
args: { source },
|
|
3160
3702
|
},
|
|
3161
3703
|
],
|
|
3162
3704
|
ctx: this._ctx,
|
|
@@ -3172,25 +3714,94 @@ export class Module_ extends BaseClient {
|
|
|
3172
3714
|
};
|
|
3173
3715
|
}
|
|
3174
3716
|
/**
|
|
3175
|
-
*
|
|
3717
|
+
* The configuration of dependency of a module.
|
|
3176
3718
|
*/
|
|
3177
|
-
export class
|
|
3719
|
+
export class ModuleDependency extends BaseClient {
|
|
3178
3720
|
_id = undefined;
|
|
3179
3721
|
_name = undefined;
|
|
3180
|
-
_root = undefined;
|
|
3181
|
-
_sdk = undefined;
|
|
3182
3722
|
/**
|
|
3183
3723
|
* Constructor is used for internal usage only, do not create object from it.
|
|
3184
3724
|
*/
|
|
3185
|
-
constructor(parent, _id, _name
|
|
3725
|
+
constructor(parent, _id, _name) {
|
|
3186
3726
|
super(parent);
|
|
3187
3727
|
this._id = _id;
|
|
3188
3728
|
this._name = _name;
|
|
3189
|
-
this._root = _root;
|
|
3190
|
-
this._sdk = _sdk;
|
|
3191
3729
|
}
|
|
3192
3730
|
/**
|
|
3193
|
-
* A unique identifier for this
|
|
3731
|
+
* A unique identifier for this ModuleDependency.
|
|
3732
|
+
*/
|
|
3733
|
+
id = async () => {
|
|
3734
|
+
if (this._id) {
|
|
3735
|
+
return this._id;
|
|
3736
|
+
}
|
|
3737
|
+
const response = await computeQuery([
|
|
3738
|
+
...this._queryTree,
|
|
3739
|
+
{
|
|
3740
|
+
operation: "id",
|
|
3741
|
+
},
|
|
3742
|
+
], await this._ctx.connection());
|
|
3743
|
+
return response;
|
|
3744
|
+
};
|
|
3745
|
+
/**
|
|
3746
|
+
* The name of the dependency module.
|
|
3747
|
+
*/
|
|
3748
|
+
name = async () => {
|
|
3749
|
+
if (this._name) {
|
|
3750
|
+
return this._name;
|
|
3751
|
+
}
|
|
3752
|
+
const response = await computeQuery([
|
|
3753
|
+
...this._queryTree,
|
|
3754
|
+
{
|
|
3755
|
+
operation: "name",
|
|
3756
|
+
},
|
|
3757
|
+
], await this._ctx.connection());
|
|
3758
|
+
return response;
|
|
3759
|
+
};
|
|
3760
|
+
/**
|
|
3761
|
+
* The source for the dependency module.
|
|
3762
|
+
*/
|
|
3763
|
+
source = () => {
|
|
3764
|
+
return new ModuleSource({
|
|
3765
|
+
queryTree: [
|
|
3766
|
+
...this._queryTree,
|
|
3767
|
+
{
|
|
3768
|
+
operation: "source",
|
|
3769
|
+
},
|
|
3770
|
+
],
|
|
3771
|
+
ctx: this._ctx,
|
|
3772
|
+
});
|
|
3773
|
+
};
|
|
3774
|
+
}
|
|
3775
|
+
/**
|
|
3776
|
+
* The source needed to load and run a module, along with any metadata about the source such as versions/urls/etc.
|
|
3777
|
+
*/
|
|
3778
|
+
export class ModuleSource extends BaseClient {
|
|
3779
|
+
_id = undefined;
|
|
3780
|
+
_asString = undefined;
|
|
3781
|
+
_configExists = undefined;
|
|
3782
|
+
_kind = undefined;
|
|
3783
|
+
_moduleName = undefined;
|
|
3784
|
+
_moduleOriginalName = undefined;
|
|
3785
|
+
_resolveContextPathFromCaller = undefined;
|
|
3786
|
+
_sourceRootSubpath = undefined;
|
|
3787
|
+
_sourceSubpath = undefined;
|
|
3788
|
+
/**
|
|
3789
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
3790
|
+
*/
|
|
3791
|
+
constructor(parent, _id, _asString, _configExists, _kind, _moduleName, _moduleOriginalName, _resolveContextPathFromCaller, _sourceRootSubpath, _sourceSubpath) {
|
|
3792
|
+
super(parent);
|
|
3793
|
+
this._id = _id;
|
|
3794
|
+
this._asString = _asString;
|
|
3795
|
+
this._configExists = _configExists;
|
|
3796
|
+
this._kind = _kind;
|
|
3797
|
+
this._moduleName = _moduleName;
|
|
3798
|
+
this._moduleOriginalName = _moduleOriginalName;
|
|
3799
|
+
this._resolveContextPathFromCaller = _resolveContextPathFromCaller;
|
|
3800
|
+
this._sourceRootSubpath = _sourceRootSubpath;
|
|
3801
|
+
this._sourceSubpath = _sourceSubpath;
|
|
3802
|
+
}
|
|
3803
|
+
/**
|
|
3804
|
+
* A unique identifier for this ModuleSource.
|
|
3194
3805
|
*/
|
|
3195
3806
|
id = async () => {
|
|
3196
3807
|
if (this._id) {
|
|
@@ -3204,68 +3815,338 @@ export class ModuleConfig extends BaseClient {
|
|
|
3204
3815
|
], await this._ctx.connection());
|
|
3205
3816
|
return response;
|
|
3206
3817
|
};
|
|
3818
|
+
/**
|
|
3819
|
+
* If the source is a of kind git, the git source representation of it.
|
|
3820
|
+
*/
|
|
3821
|
+
asGitSource = () => {
|
|
3822
|
+
return new GitModuleSource({
|
|
3823
|
+
queryTree: [
|
|
3824
|
+
...this._queryTree,
|
|
3825
|
+
{
|
|
3826
|
+
operation: "asGitSource",
|
|
3827
|
+
},
|
|
3828
|
+
],
|
|
3829
|
+
ctx: this._ctx,
|
|
3830
|
+
});
|
|
3831
|
+
};
|
|
3832
|
+
/**
|
|
3833
|
+
* If the source is of kind local, the local source representation of it.
|
|
3834
|
+
*/
|
|
3835
|
+
asLocalSource = () => {
|
|
3836
|
+
return new LocalModuleSource({
|
|
3837
|
+
queryTree: [
|
|
3838
|
+
...this._queryTree,
|
|
3839
|
+
{
|
|
3840
|
+
operation: "asLocalSource",
|
|
3841
|
+
},
|
|
3842
|
+
],
|
|
3843
|
+
ctx: this._ctx,
|
|
3844
|
+
});
|
|
3845
|
+
};
|
|
3846
|
+
/**
|
|
3847
|
+
* Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
|
|
3848
|
+
*/
|
|
3849
|
+
asModule = () => {
|
|
3850
|
+
return new Module_({
|
|
3851
|
+
queryTree: [
|
|
3852
|
+
...this._queryTree,
|
|
3853
|
+
{
|
|
3854
|
+
operation: "asModule",
|
|
3855
|
+
},
|
|
3856
|
+
],
|
|
3857
|
+
ctx: this._ctx,
|
|
3858
|
+
});
|
|
3859
|
+
};
|
|
3860
|
+
/**
|
|
3861
|
+
* A human readable ref string representation of this module source.
|
|
3862
|
+
*/
|
|
3863
|
+
asString = async () => {
|
|
3864
|
+
if (this._asString) {
|
|
3865
|
+
return this._asString;
|
|
3866
|
+
}
|
|
3867
|
+
const response = await computeQuery([
|
|
3868
|
+
...this._queryTree,
|
|
3869
|
+
{
|
|
3870
|
+
operation: "asString",
|
|
3871
|
+
},
|
|
3872
|
+
], await this._ctx.connection());
|
|
3873
|
+
return response;
|
|
3874
|
+
};
|
|
3875
|
+
/**
|
|
3876
|
+
* Returns whether the module source has a configuration file.
|
|
3877
|
+
*/
|
|
3878
|
+
configExists = async () => {
|
|
3879
|
+
if (this._configExists) {
|
|
3880
|
+
return this._configExists;
|
|
3881
|
+
}
|
|
3882
|
+
const response = await computeQuery([
|
|
3883
|
+
...this._queryTree,
|
|
3884
|
+
{
|
|
3885
|
+
operation: "configExists",
|
|
3886
|
+
},
|
|
3887
|
+
], await this._ctx.connection());
|
|
3888
|
+
return response;
|
|
3889
|
+
};
|
|
3890
|
+
/**
|
|
3891
|
+
* The directory containing everything needed to load load and use the module.
|
|
3892
|
+
*/
|
|
3893
|
+
contextDirectory = () => {
|
|
3894
|
+
return new Directory({
|
|
3895
|
+
queryTree: [
|
|
3896
|
+
...this._queryTree,
|
|
3897
|
+
{
|
|
3898
|
+
operation: "contextDirectory",
|
|
3899
|
+
},
|
|
3900
|
+
],
|
|
3901
|
+
ctx: this._ctx,
|
|
3902
|
+
});
|
|
3903
|
+
};
|
|
3904
|
+
/**
|
|
3905
|
+
* The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.
|
|
3906
|
+
*/
|
|
3207
3907
|
dependencies = async () => {
|
|
3208
3908
|
const response = await computeQuery([
|
|
3209
3909
|
...this._queryTree,
|
|
3210
3910
|
{
|
|
3211
3911
|
operation: "dependencies",
|
|
3212
3912
|
},
|
|
3913
|
+
{
|
|
3914
|
+
operation: "id",
|
|
3915
|
+
},
|
|
3916
|
+
], await this._ctx.connection());
|
|
3917
|
+
return response.map((r) => new ModuleDependency({
|
|
3918
|
+
queryTree: [
|
|
3919
|
+
{
|
|
3920
|
+
operation: "loadModuleDependencyFromID",
|
|
3921
|
+
args: { id: r.id },
|
|
3922
|
+
},
|
|
3923
|
+
],
|
|
3924
|
+
ctx: this._ctx,
|
|
3925
|
+
}, r.id));
|
|
3926
|
+
};
|
|
3927
|
+
/**
|
|
3928
|
+
* The directory containing the module configuration and source code (source code may be in a subdir).
|
|
3929
|
+
* @param path The path from the source directory to select.
|
|
3930
|
+
*/
|
|
3931
|
+
directory = (path) => {
|
|
3932
|
+
return new Directory({
|
|
3933
|
+
queryTree: [
|
|
3934
|
+
...this._queryTree,
|
|
3935
|
+
{
|
|
3936
|
+
operation: "directory",
|
|
3937
|
+
args: { path },
|
|
3938
|
+
},
|
|
3939
|
+
],
|
|
3940
|
+
ctx: this._ctx,
|
|
3941
|
+
});
|
|
3942
|
+
};
|
|
3943
|
+
/**
|
|
3944
|
+
* The kind of source (e.g. local, git, etc.)
|
|
3945
|
+
*/
|
|
3946
|
+
kind = async () => {
|
|
3947
|
+
if (this._kind) {
|
|
3948
|
+
return this._kind;
|
|
3949
|
+
}
|
|
3950
|
+
const response = await computeQuery([
|
|
3951
|
+
...this._queryTree,
|
|
3952
|
+
{
|
|
3953
|
+
operation: "kind",
|
|
3954
|
+
},
|
|
3955
|
+
], await this._ctx.connection());
|
|
3956
|
+
return response;
|
|
3957
|
+
};
|
|
3958
|
+
/**
|
|
3959
|
+
* If set, the name of the module this source references, including any overrides at runtime by callers.
|
|
3960
|
+
*/
|
|
3961
|
+
moduleName = async () => {
|
|
3962
|
+
if (this._moduleName) {
|
|
3963
|
+
return this._moduleName;
|
|
3964
|
+
}
|
|
3965
|
+
const response = await computeQuery([
|
|
3966
|
+
...this._queryTree,
|
|
3967
|
+
{
|
|
3968
|
+
operation: "moduleName",
|
|
3969
|
+
},
|
|
3213
3970
|
], await this._ctx.connection());
|
|
3214
3971
|
return response;
|
|
3215
3972
|
};
|
|
3216
|
-
|
|
3973
|
+
/**
|
|
3974
|
+
* The original name of the module this source references, as defined in the module configuration.
|
|
3975
|
+
*/
|
|
3976
|
+
moduleOriginalName = async () => {
|
|
3977
|
+
if (this._moduleOriginalName) {
|
|
3978
|
+
return this._moduleOriginalName;
|
|
3979
|
+
}
|
|
3217
3980
|
const response = await computeQuery([
|
|
3218
3981
|
...this._queryTree,
|
|
3219
3982
|
{
|
|
3220
|
-
operation: "
|
|
3983
|
+
operation: "moduleOriginalName",
|
|
3221
3984
|
},
|
|
3222
3985
|
], await this._ctx.connection());
|
|
3223
3986
|
return response;
|
|
3224
3987
|
};
|
|
3225
|
-
|
|
3988
|
+
/**
|
|
3989
|
+
* The path to the module source's context directory on the caller's filesystem. Only valid for local sources.
|
|
3990
|
+
*/
|
|
3991
|
+
resolveContextPathFromCaller = async () => {
|
|
3992
|
+
if (this._resolveContextPathFromCaller) {
|
|
3993
|
+
return this._resolveContextPathFromCaller;
|
|
3994
|
+
}
|
|
3226
3995
|
const response = await computeQuery([
|
|
3227
3996
|
...this._queryTree,
|
|
3228
3997
|
{
|
|
3229
|
-
operation: "
|
|
3998
|
+
operation: "resolveContextPathFromCaller",
|
|
3230
3999
|
},
|
|
3231
4000
|
], await this._ctx.connection());
|
|
3232
4001
|
return response;
|
|
3233
4002
|
};
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
4003
|
+
/**
|
|
4004
|
+
* Resolve the provided module source arg as a dependency relative to this module source.
|
|
4005
|
+
* @param dep The dependency module source to resolve.
|
|
4006
|
+
*/
|
|
4007
|
+
resolveDependency = (dep) => {
|
|
4008
|
+
return new ModuleSource({
|
|
4009
|
+
queryTree: [
|
|
4010
|
+
...this._queryTree,
|
|
4011
|
+
{
|
|
4012
|
+
operation: "resolveDependency",
|
|
4013
|
+
args: { dep },
|
|
4014
|
+
},
|
|
4015
|
+
],
|
|
4016
|
+
ctx: this._ctx,
|
|
4017
|
+
});
|
|
4018
|
+
};
|
|
4019
|
+
/**
|
|
4020
|
+
* Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.
|
|
4021
|
+
*/
|
|
4022
|
+
resolveFromCaller = () => {
|
|
4023
|
+
return new ModuleSource({
|
|
4024
|
+
queryTree: [
|
|
4025
|
+
...this._queryTree,
|
|
4026
|
+
{
|
|
4027
|
+
operation: "resolveFromCaller",
|
|
4028
|
+
},
|
|
4029
|
+
],
|
|
4030
|
+
ctx: this._ctx,
|
|
4031
|
+
});
|
|
4032
|
+
};
|
|
4033
|
+
/**
|
|
4034
|
+
* 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.
|
|
4035
|
+
*/
|
|
4036
|
+
sourceRootSubpath = async () => {
|
|
4037
|
+
if (this._sourceRootSubpath) {
|
|
4038
|
+
return this._sourceRootSubpath;
|
|
3237
4039
|
}
|
|
3238
4040
|
const response = await computeQuery([
|
|
3239
4041
|
...this._queryTree,
|
|
3240
4042
|
{
|
|
3241
|
-
operation: "
|
|
4043
|
+
operation: "sourceRootSubpath",
|
|
3242
4044
|
},
|
|
3243
4045
|
], await this._ctx.connection());
|
|
3244
4046
|
return response;
|
|
3245
4047
|
};
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
4048
|
+
/**
|
|
4049
|
+
* The path relative to context of the module implementation source code.
|
|
4050
|
+
*/
|
|
4051
|
+
sourceSubpath = async () => {
|
|
4052
|
+
if (this._sourceSubpath) {
|
|
4053
|
+
return this._sourceSubpath;
|
|
3249
4054
|
}
|
|
3250
4055
|
const response = await computeQuery([
|
|
3251
4056
|
...this._queryTree,
|
|
3252
4057
|
{
|
|
3253
|
-
operation: "
|
|
4058
|
+
operation: "sourceSubpath",
|
|
3254
4059
|
},
|
|
3255
4060
|
], await this._ctx.connection());
|
|
3256
4061
|
return response;
|
|
3257
4062
|
};
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
4063
|
+
/**
|
|
4064
|
+
* Update the module source with a new context directory. Only valid for local sources.
|
|
4065
|
+
* @param dir The directory to set as the context directory.
|
|
4066
|
+
*/
|
|
4067
|
+
withContextDirectory = (dir) => {
|
|
4068
|
+
return new ModuleSource({
|
|
4069
|
+
queryTree: [
|
|
4070
|
+
...this._queryTree,
|
|
4071
|
+
{
|
|
4072
|
+
operation: "withContextDirectory",
|
|
4073
|
+
args: { dir },
|
|
4074
|
+
},
|
|
4075
|
+
],
|
|
4076
|
+
ctx: this._ctx,
|
|
4077
|
+
});
|
|
4078
|
+
};
|
|
4079
|
+
/**
|
|
4080
|
+
* Append the provided dependencies to the module source's dependency list.
|
|
4081
|
+
* @param dependencies The dependencies to append.
|
|
4082
|
+
*/
|
|
4083
|
+
withDependencies = (dependencies) => {
|
|
4084
|
+
return new ModuleSource({
|
|
4085
|
+
queryTree: [
|
|
4086
|
+
...this._queryTree,
|
|
4087
|
+
{
|
|
4088
|
+
operation: "withDependencies",
|
|
4089
|
+
args: { dependencies },
|
|
4090
|
+
},
|
|
4091
|
+
],
|
|
4092
|
+
ctx: this._ctx,
|
|
4093
|
+
});
|
|
4094
|
+
};
|
|
4095
|
+
/**
|
|
4096
|
+
* Update the module source with a new name.
|
|
4097
|
+
* @param name The name to set.
|
|
4098
|
+
*/
|
|
4099
|
+
withName = (name) => {
|
|
4100
|
+
return new ModuleSource({
|
|
4101
|
+
queryTree: [
|
|
4102
|
+
...this._queryTree,
|
|
4103
|
+
{
|
|
4104
|
+
operation: "withName",
|
|
4105
|
+
args: { name },
|
|
4106
|
+
},
|
|
4107
|
+
],
|
|
4108
|
+
ctx: this._ctx,
|
|
4109
|
+
});
|
|
4110
|
+
};
|
|
4111
|
+
/**
|
|
4112
|
+
* Update the module source with a new SDK.
|
|
4113
|
+
* @param sdk The SDK to set.
|
|
4114
|
+
*/
|
|
4115
|
+
withSDK = (sdk) => {
|
|
4116
|
+
return new ModuleSource({
|
|
4117
|
+
queryTree: [
|
|
4118
|
+
...this._queryTree,
|
|
4119
|
+
{
|
|
4120
|
+
operation: "withSDK",
|
|
4121
|
+
args: { sdk },
|
|
4122
|
+
},
|
|
4123
|
+
],
|
|
4124
|
+
ctx: this._ctx,
|
|
4125
|
+
});
|
|
4126
|
+
};
|
|
4127
|
+
/**
|
|
4128
|
+
* Update the module source with a new source subpath.
|
|
4129
|
+
* @param path The path to set as the source subpath.
|
|
4130
|
+
*/
|
|
4131
|
+
withSourceSubpath = (path) => {
|
|
4132
|
+
return new ModuleSource({
|
|
4133
|
+
queryTree: [
|
|
4134
|
+
...this._queryTree,
|
|
4135
|
+
{
|
|
4136
|
+
operation: "withSourceSubpath",
|
|
4137
|
+
args: { path },
|
|
4138
|
+
},
|
|
4139
|
+
],
|
|
4140
|
+
ctx: this._ctx,
|
|
4141
|
+
});
|
|
4142
|
+
};
|
|
4143
|
+
/**
|
|
4144
|
+
* Call the provided function with current ModuleSource.
|
|
4145
|
+
*
|
|
4146
|
+
* This is useful for reusability and readability by not breaking the calling chain.
|
|
4147
|
+
*/
|
|
4148
|
+
with = (arg) => {
|
|
4149
|
+
return arg(this);
|
|
3269
4150
|
};
|
|
3270
4151
|
}
|
|
3271
4152
|
/**
|
|
@@ -3301,6 +4182,9 @@ export class ObjectTypeDef extends BaseClient {
|
|
|
3301
4182
|
], await this._ctx.connection());
|
|
3302
4183
|
return response;
|
|
3303
4184
|
};
|
|
4185
|
+
/**
|
|
4186
|
+
* The function used to construct new instances of this object, if any
|
|
4187
|
+
*/
|
|
3304
4188
|
constructor_ = () => {
|
|
3305
4189
|
return new Function_({
|
|
3306
4190
|
queryTree: [
|
|
@@ -3312,6 +4196,9 @@ export class ObjectTypeDef extends BaseClient {
|
|
|
3312
4196
|
ctx: this._ctx,
|
|
3313
4197
|
});
|
|
3314
4198
|
};
|
|
4199
|
+
/**
|
|
4200
|
+
* The doc string for the object, if any.
|
|
4201
|
+
*/
|
|
3315
4202
|
description = async () => {
|
|
3316
4203
|
if (this._description) {
|
|
3317
4204
|
return this._description;
|
|
@@ -3324,6 +4211,9 @@ export class ObjectTypeDef extends BaseClient {
|
|
|
3324
4211
|
], await this._ctx.connection());
|
|
3325
4212
|
return response;
|
|
3326
4213
|
};
|
|
4214
|
+
/**
|
|
4215
|
+
* Static fields defined on this object, if any.
|
|
4216
|
+
*/
|
|
3327
4217
|
fields = async () => {
|
|
3328
4218
|
const response = await computeQuery([
|
|
3329
4219
|
...this._queryTree,
|
|
@@ -3344,6 +4234,9 @@ export class ObjectTypeDef extends BaseClient {
|
|
|
3344
4234
|
ctx: this._ctx,
|
|
3345
4235
|
}, r.id));
|
|
3346
4236
|
};
|
|
4237
|
+
/**
|
|
4238
|
+
* Functions defined on this object, if any.
|
|
4239
|
+
*/
|
|
3347
4240
|
functions = async () => {
|
|
3348
4241
|
const response = await computeQuery([
|
|
3349
4242
|
...this._queryTree,
|
|
@@ -3364,6 +4257,9 @@ export class ObjectTypeDef extends BaseClient {
|
|
|
3364
4257
|
ctx: this._ctx,
|
|
3365
4258
|
}, r.id));
|
|
3366
4259
|
};
|
|
4260
|
+
/**
|
|
4261
|
+
* The name of the object.
|
|
4262
|
+
*/
|
|
3367
4263
|
name = async () => {
|
|
3368
4264
|
if (this._name) {
|
|
3369
4265
|
return this._name;
|
|
@@ -3376,6 +4272,9 @@ export class ObjectTypeDef extends BaseClient {
|
|
|
3376
4272
|
], await this._ctx.connection());
|
|
3377
4273
|
return response;
|
|
3378
4274
|
};
|
|
4275
|
+
/**
|
|
4276
|
+
* If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
|
|
4277
|
+
*/
|
|
3379
4278
|
sourceModuleName = async () => {
|
|
3380
4279
|
if (this._sourceModuleName) {
|
|
3381
4280
|
return this._sourceModuleName;
|
|
@@ -3395,15 +4294,17 @@ export class ObjectTypeDef extends BaseClient {
|
|
|
3395
4294
|
export class Port extends BaseClient {
|
|
3396
4295
|
_id = undefined;
|
|
3397
4296
|
_description = undefined;
|
|
4297
|
+
_experimentalSkipHealthcheck = undefined;
|
|
3398
4298
|
_port = undefined;
|
|
3399
4299
|
_protocol = undefined;
|
|
3400
4300
|
/**
|
|
3401
4301
|
* Constructor is used for internal usage only, do not create object from it.
|
|
3402
4302
|
*/
|
|
3403
|
-
constructor(parent, _id, _description, _port, _protocol) {
|
|
4303
|
+
constructor(parent, _id, _description, _experimentalSkipHealthcheck, _port, _protocol) {
|
|
3404
4304
|
super(parent);
|
|
3405
4305
|
this._id = _id;
|
|
3406
4306
|
this._description = _description;
|
|
4307
|
+
this._experimentalSkipHealthcheck = _experimentalSkipHealthcheck;
|
|
3407
4308
|
this._port = _port;
|
|
3408
4309
|
this._protocol = _protocol;
|
|
3409
4310
|
}
|
|
@@ -3422,6 +4323,9 @@ export class Port extends BaseClient {
|
|
|
3422
4323
|
], await this._ctx.connection());
|
|
3423
4324
|
return response;
|
|
3424
4325
|
};
|
|
4326
|
+
/**
|
|
4327
|
+
* The port description.
|
|
4328
|
+
*/
|
|
3425
4329
|
description = async () => {
|
|
3426
4330
|
if (this._description) {
|
|
3427
4331
|
return this._description;
|
|
@@ -3434,6 +4338,24 @@ export class Port extends BaseClient {
|
|
|
3434
4338
|
], await this._ctx.connection());
|
|
3435
4339
|
return response;
|
|
3436
4340
|
};
|
|
4341
|
+
/**
|
|
4342
|
+
* Skip the health check when run as a service.
|
|
4343
|
+
*/
|
|
4344
|
+
experimentalSkipHealthcheck = async () => {
|
|
4345
|
+
if (this._experimentalSkipHealthcheck) {
|
|
4346
|
+
return this._experimentalSkipHealthcheck;
|
|
4347
|
+
}
|
|
4348
|
+
const response = await computeQuery([
|
|
4349
|
+
...this._queryTree,
|
|
4350
|
+
{
|
|
4351
|
+
operation: "experimentalSkipHealthcheck",
|
|
4352
|
+
},
|
|
4353
|
+
], await this._ctx.connection());
|
|
4354
|
+
return response;
|
|
4355
|
+
};
|
|
4356
|
+
/**
|
|
4357
|
+
* The port number.
|
|
4358
|
+
*/
|
|
3437
4359
|
port = async () => {
|
|
3438
4360
|
if (this._port) {
|
|
3439
4361
|
return this._port;
|
|
@@ -3446,6 +4368,9 @@ export class Port extends BaseClient {
|
|
|
3446
4368
|
], await this._ctx.connection());
|
|
3447
4369
|
return response;
|
|
3448
4370
|
};
|
|
4371
|
+
/**
|
|
4372
|
+
* The transport layer protocol.
|
|
4373
|
+
*/
|
|
3449
4374
|
protocol = async () => {
|
|
3450
4375
|
if (this._protocol) {
|
|
3451
4376
|
return this._protocol;
|
|
@@ -3561,7 +4486,7 @@ export class Client extends BaseClient {
|
|
|
3561
4486
|
* The module currently being served in the session, if any.
|
|
3562
4487
|
*/
|
|
3563
4488
|
currentModule = () => {
|
|
3564
|
-
return new
|
|
4489
|
+
return new CurrentModule({
|
|
3565
4490
|
queryTree: [
|
|
3566
4491
|
...this._queryTree,
|
|
3567
4492
|
{
|
|
@@ -3754,6 +4679,21 @@ export class Client extends BaseClient {
|
|
|
3754
4679
|
ctx: this._ctx,
|
|
3755
4680
|
});
|
|
3756
4681
|
};
|
|
4682
|
+
/**
|
|
4683
|
+
* Load a CurrentModule from its ID.
|
|
4684
|
+
*/
|
|
4685
|
+
loadCurrentModuleFromID = (id) => {
|
|
4686
|
+
return new CurrentModule({
|
|
4687
|
+
queryTree: [
|
|
4688
|
+
...this._queryTree,
|
|
4689
|
+
{
|
|
4690
|
+
operation: "loadCurrentModuleFromID",
|
|
4691
|
+
args: { id },
|
|
4692
|
+
},
|
|
4693
|
+
],
|
|
4694
|
+
ctx: this._ctx,
|
|
4695
|
+
});
|
|
4696
|
+
};
|
|
3757
4697
|
/**
|
|
3758
4698
|
* Load a Directory from its ID.
|
|
3759
4699
|
*/
|
|
@@ -3889,6 +4829,21 @@ export class Client extends BaseClient {
|
|
|
3889
4829
|
ctx: this._ctx,
|
|
3890
4830
|
});
|
|
3891
4831
|
};
|
|
4832
|
+
/**
|
|
4833
|
+
* Load a GitModuleSource from its ID.
|
|
4834
|
+
*/
|
|
4835
|
+
loadGitModuleSourceFromID = (id) => {
|
|
4836
|
+
return new GitModuleSource({
|
|
4837
|
+
queryTree: [
|
|
4838
|
+
...this._queryTree,
|
|
4839
|
+
{
|
|
4840
|
+
operation: "loadGitModuleSourceFromID",
|
|
4841
|
+
args: { id },
|
|
4842
|
+
},
|
|
4843
|
+
],
|
|
4844
|
+
ctx: this._ctx,
|
|
4845
|
+
});
|
|
4846
|
+
};
|
|
3892
4847
|
/**
|
|
3893
4848
|
* Load a GitRef from its ID.
|
|
3894
4849
|
*/
|
|
@@ -3934,6 +4889,21 @@ export class Client extends BaseClient {
|
|
|
3934
4889
|
ctx: this._ctx,
|
|
3935
4890
|
});
|
|
3936
4891
|
};
|
|
4892
|
+
/**
|
|
4893
|
+
* Load a InputTypeDef from its ID.
|
|
4894
|
+
*/
|
|
4895
|
+
loadInputTypeDefFromID = (id) => {
|
|
4896
|
+
return new InputTypeDef({
|
|
4897
|
+
queryTree: [
|
|
4898
|
+
...this._queryTree,
|
|
4899
|
+
{
|
|
4900
|
+
operation: "loadInputTypeDefFromID",
|
|
4901
|
+
args: { id },
|
|
4902
|
+
},
|
|
4903
|
+
],
|
|
4904
|
+
ctx: this._ctx,
|
|
4905
|
+
});
|
|
4906
|
+
};
|
|
3937
4907
|
/**
|
|
3938
4908
|
* Load a InterfaceTypeDef from its ID.
|
|
3939
4909
|
*/
|
|
@@ -3980,14 +4950,29 @@ export class Client extends BaseClient {
|
|
|
3980
4950
|
});
|
|
3981
4951
|
};
|
|
3982
4952
|
/**
|
|
3983
|
-
* Load a
|
|
4953
|
+
* Load a LocalModuleSource from its ID.
|
|
4954
|
+
*/
|
|
4955
|
+
loadLocalModuleSourceFromID = (id) => {
|
|
4956
|
+
return new LocalModuleSource({
|
|
4957
|
+
queryTree: [
|
|
4958
|
+
...this._queryTree,
|
|
4959
|
+
{
|
|
4960
|
+
operation: "loadLocalModuleSourceFromID",
|
|
4961
|
+
args: { id },
|
|
4962
|
+
},
|
|
4963
|
+
],
|
|
4964
|
+
ctx: this._ctx,
|
|
4965
|
+
});
|
|
4966
|
+
};
|
|
4967
|
+
/**
|
|
4968
|
+
* Load a ModuleDependency from its ID.
|
|
3984
4969
|
*/
|
|
3985
|
-
|
|
3986
|
-
return new
|
|
4970
|
+
loadModuleDependencyFromID = (id) => {
|
|
4971
|
+
return new ModuleDependency({
|
|
3987
4972
|
queryTree: [
|
|
3988
4973
|
...this._queryTree,
|
|
3989
4974
|
{
|
|
3990
|
-
operation: "
|
|
4975
|
+
operation: "loadModuleDependencyFromID",
|
|
3991
4976
|
args: { id },
|
|
3992
4977
|
},
|
|
3993
4978
|
],
|
|
@@ -4009,6 +4994,21 @@ export class Client extends BaseClient {
|
|
|
4009
4994
|
ctx: this._ctx,
|
|
4010
4995
|
});
|
|
4011
4996
|
};
|
|
4997
|
+
/**
|
|
4998
|
+
* Load a ModuleSource from its ID.
|
|
4999
|
+
*/
|
|
5000
|
+
loadModuleSourceFromID = (id) => {
|
|
5001
|
+
return new ModuleSource({
|
|
5002
|
+
queryTree: [
|
|
5003
|
+
...this._queryTree,
|
|
5004
|
+
{
|
|
5005
|
+
operation: "loadModuleSourceFromID",
|
|
5006
|
+
args: { id },
|
|
5007
|
+
},
|
|
5008
|
+
],
|
|
5009
|
+
ctx: this._ctx,
|
|
5010
|
+
});
|
|
5011
|
+
};
|
|
4012
5012
|
/**
|
|
4013
5013
|
* Load a ObjectTypeDef from its ID.
|
|
4014
5014
|
*/
|
|
@@ -4084,6 +5084,21 @@ export class Client extends BaseClient {
|
|
|
4084
5084
|
ctx: this._ctx,
|
|
4085
5085
|
});
|
|
4086
5086
|
};
|
|
5087
|
+
/**
|
|
5088
|
+
* Load a Terminal from its ID.
|
|
5089
|
+
*/
|
|
5090
|
+
loadTerminalFromID = (id) => {
|
|
5091
|
+
return new Terminal({
|
|
5092
|
+
queryTree: [
|
|
5093
|
+
...this._queryTree,
|
|
5094
|
+
{
|
|
5095
|
+
operation: "loadTerminalFromID",
|
|
5096
|
+
args: { id },
|
|
5097
|
+
},
|
|
5098
|
+
],
|
|
5099
|
+
ctx: this._ctx,
|
|
5100
|
+
});
|
|
5101
|
+
};
|
|
4087
5102
|
/**
|
|
4088
5103
|
* Load a TypeDef from its ID.
|
|
4089
5104
|
*/
|
|
@@ -4114,15 +5129,34 @@ export class Client extends BaseClient {
|
|
|
4114
5129
|
});
|
|
4115
5130
|
};
|
|
4116
5131
|
/**
|
|
4117
|
-
*
|
|
5132
|
+
* Create a new module dependency configuration from a module source and name
|
|
5133
|
+
* @param source The source of the dependency
|
|
5134
|
+
* @param opts.name If set, the name to use for the dependency. Otherwise, once installed to a parent module, the name of the dependency module will be used by default.
|
|
5135
|
+
*/
|
|
5136
|
+
moduleDependency = (source, opts) => {
|
|
5137
|
+
return new ModuleDependency({
|
|
5138
|
+
queryTree: [
|
|
5139
|
+
...this._queryTree,
|
|
5140
|
+
{
|
|
5141
|
+
operation: "moduleDependency",
|
|
5142
|
+
args: { source, ...opts },
|
|
5143
|
+
},
|
|
5144
|
+
],
|
|
5145
|
+
ctx: this._ctx,
|
|
5146
|
+
});
|
|
5147
|
+
};
|
|
5148
|
+
/**
|
|
5149
|
+
* Create a new module source instance from a source ref string.
|
|
5150
|
+
* @param refString The string ref representation of the module source
|
|
5151
|
+
* @param opts.stable If true, enforce that the source is a stable version for source kinds that support versioning.
|
|
4118
5152
|
*/
|
|
4119
|
-
|
|
4120
|
-
return new
|
|
5153
|
+
moduleSource = (refString, opts) => {
|
|
5154
|
+
return new ModuleSource({
|
|
4121
5155
|
queryTree: [
|
|
4122
5156
|
...this._queryTree,
|
|
4123
5157
|
{
|
|
4124
|
-
operation: "
|
|
4125
|
-
args: {
|
|
5158
|
+
operation: "moduleSource",
|
|
5159
|
+
args: { refString, ...opts },
|
|
4126
5160
|
},
|
|
4127
5161
|
],
|
|
4128
5162
|
ctx: this._ctx,
|
|
@@ -4273,16 +5307,18 @@ export class Service extends BaseClient {
|
|
|
4273
5307
|
_hostname = undefined;
|
|
4274
5308
|
_start = undefined;
|
|
4275
5309
|
_stop = undefined;
|
|
5310
|
+
_up = undefined;
|
|
4276
5311
|
/**
|
|
4277
5312
|
* Constructor is used for internal usage only, do not create object from it.
|
|
4278
5313
|
*/
|
|
4279
|
-
constructor(parent, _id, _endpoint, _hostname, _start, _stop) {
|
|
5314
|
+
constructor(parent, _id, _endpoint, _hostname, _start, _stop, _up) {
|
|
4280
5315
|
super(parent);
|
|
4281
5316
|
this._id = _id;
|
|
4282
5317
|
this._endpoint = _endpoint;
|
|
4283
5318
|
this._hostname = _hostname;
|
|
4284
5319
|
this._start = _start;
|
|
4285
5320
|
this._stop = _stop;
|
|
5321
|
+
this._up = _up;
|
|
4286
5322
|
}
|
|
4287
5323
|
/**
|
|
4288
5324
|
* A unique identifier for this Service.
|
|
@@ -4375,16 +5411,38 @@ export class Service extends BaseClient {
|
|
|
4375
5411
|
};
|
|
4376
5412
|
/**
|
|
4377
5413
|
* Stop the service.
|
|
5414
|
+
* @param opts.kill Immediately kill the service without waiting for a graceful exit
|
|
4378
5415
|
*/
|
|
4379
|
-
stop = async () => {
|
|
5416
|
+
stop = async (opts) => {
|
|
4380
5417
|
await computeQuery([
|
|
4381
5418
|
...this._queryTree,
|
|
4382
5419
|
{
|
|
4383
5420
|
operation: "stop",
|
|
5421
|
+
args: { ...opts },
|
|
4384
5422
|
},
|
|
4385
5423
|
], await this._ctx.connection());
|
|
4386
5424
|
return this;
|
|
4387
5425
|
};
|
|
5426
|
+
/**
|
|
5427
|
+
* Creates a tunnel that forwards traffic from the caller's network to this service.
|
|
5428
|
+
* @param opts.ports List of frontend/backend port mappings to forward.
|
|
5429
|
+
*
|
|
5430
|
+
* Frontend is the port accepting traffic on the host, backend is the service port.
|
|
5431
|
+
* @param opts.random Bind each tunnel port to a random port on the host.
|
|
5432
|
+
*/
|
|
5433
|
+
up = async (opts) => {
|
|
5434
|
+
if (this._up) {
|
|
5435
|
+
return this._up;
|
|
5436
|
+
}
|
|
5437
|
+
const response = await computeQuery([
|
|
5438
|
+
...this._queryTree,
|
|
5439
|
+
{
|
|
5440
|
+
operation: "up",
|
|
5441
|
+
args: { ...opts },
|
|
5442
|
+
},
|
|
5443
|
+
], await this._ctx.connection());
|
|
5444
|
+
return response;
|
|
5445
|
+
};
|
|
4388
5446
|
}
|
|
4389
5447
|
/**
|
|
4390
5448
|
* A Unix or TCP/IP socket that can be mounted into a container.
|
|
@@ -4414,6 +5472,51 @@ export class Socket extends BaseClient {
|
|
|
4414
5472
|
return response;
|
|
4415
5473
|
};
|
|
4416
5474
|
}
|
|
5475
|
+
/**
|
|
5476
|
+
* An interactive terminal that clients can connect to.
|
|
5477
|
+
*/
|
|
5478
|
+
export class Terminal extends BaseClient {
|
|
5479
|
+
_id = undefined;
|
|
5480
|
+
_websocketEndpoint = undefined;
|
|
5481
|
+
/**
|
|
5482
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
5483
|
+
*/
|
|
5484
|
+
constructor(parent, _id, _websocketEndpoint) {
|
|
5485
|
+
super(parent);
|
|
5486
|
+
this._id = _id;
|
|
5487
|
+
this._websocketEndpoint = _websocketEndpoint;
|
|
5488
|
+
}
|
|
5489
|
+
/**
|
|
5490
|
+
* A unique identifier for this Terminal.
|
|
5491
|
+
*/
|
|
5492
|
+
id = async () => {
|
|
5493
|
+
if (this._id) {
|
|
5494
|
+
return this._id;
|
|
5495
|
+
}
|
|
5496
|
+
const response = await computeQuery([
|
|
5497
|
+
...this._queryTree,
|
|
5498
|
+
{
|
|
5499
|
+
operation: "id",
|
|
5500
|
+
},
|
|
5501
|
+
], await this._ctx.connection());
|
|
5502
|
+
return response;
|
|
5503
|
+
};
|
|
5504
|
+
/**
|
|
5505
|
+
* An http endpoint at which this terminal can be connected to over a websocket.
|
|
5506
|
+
*/
|
|
5507
|
+
websocketEndpoint = async () => {
|
|
5508
|
+
if (this._websocketEndpoint) {
|
|
5509
|
+
return this._websocketEndpoint;
|
|
5510
|
+
}
|
|
5511
|
+
const response = await computeQuery([
|
|
5512
|
+
...this._queryTree,
|
|
5513
|
+
{
|
|
5514
|
+
operation: "websocketEndpoint",
|
|
5515
|
+
},
|
|
5516
|
+
], await this._ctx.connection());
|
|
5517
|
+
return response;
|
|
5518
|
+
};
|
|
5519
|
+
}
|
|
4417
5520
|
/**
|
|
4418
5521
|
* A definition of a parameter or return type in a Module.
|
|
4419
5522
|
*/
|
|
@@ -4445,6 +5548,23 @@ export class TypeDef extends BaseClient {
|
|
|
4445
5548
|
], await this._ctx.connection());
|
|
4446
5549
|
return response;
|
|
4447
5550
|
};
|
|
5551
|
+
/**
|
|
5552
|
+
* If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
|
|
5553
|
+
*/
|
|
5554
|
+
asInput = () => {
|
|
5555
|
+
return new InputTypeDef({
|
|
5556
|
+
queryTree: [
|
|
5557
|
+
...this._queryTree,
|
|
5558
|
+
{
|
|
5559
|
+
operation: "asInput",
|
|
5560
|
+
},
|
|
5561
|
+
],
|
|
5562
|
+
ctx: this._ctx,
|
|
5563
|
+
});
|
|
5564
|
+
};
|
|
5565
|
+
/**
|
|
5566
|
+
* If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
|
|
5567
|
+
*/
|
|
4448
5568
|
asInterface = () => {
|
|
4449
5569
|
return new InterfaceTypeDef({
|
|
4450
5570
|
queryTree: [
|
|
@@ -4456,6 +5576,9 @@ export class TypeDef extends BaseClient {
|
|
|
4456
5576
|
ctx: this._ctx,
|
|
4457
5577
|
});
|
|
4458
5578
|
};
|
|
5579
|
+
/**
|
|
5580
|
+
* If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
|
|
5581
|
+
*/
|
|
4459
5582
|
asList = () => {
|
|
4460
5583
|
return new ListTypeDef({
|
|
4461
5584
|
queryTree: [
|
|
@@ -4467,6 +5590,9 @@ export class TypeDef extends BaseClient {
|
|
|
4467
5590
|
ctx: this._ctx,
|
|
4468
5591
|
});
|
|
4469
5592
|
};
|
|
5593
|
+
/**
|
|
5594
|
+
* If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
|
|
5595
|
+
*/
|
|
4470
5596
|
asObject = () => {
|
|
4471
5597
|
return new ObjectTypeDef({
|
|
4472
5598
|
queryTree: [
|
|
@@ -4478,6 +5604,9 @@ export class TypeDef extends BaseClient {
|
|
|
4478
5604
|
ctx: this._ctx,
|
|
4479
5605
|
});
|
|
4480
5606
|
};
|
|
5607
|
+
/**
|
|
5608
|
+
* The kind of type this is (e.g. primitive, list, object).
|
|
5609
|
+
*/
|
|
4481
5610
|
kind = async () => {
|
|
4482
5611
|
if (this._kind) {
|
|
4483
5612
|
return this._kind;
|
|
@@ -4490,6 +5619,9 @@ export class TypeDef extends BaseClient {
|
|
|
4490
5619
|
], await this._ctx.connection());
|
|
4491
5620
|
return response;
|
|
4492
5621
|
};
|
|
5622
|
+
/**
|
|
5623
|
+
* Whether this type can be set to null. Defaults to false.
|
|
5624
|
+
*/
|
|
4493
5625
|
optional = async () => {
|
|
4494
5626
|
if (this._optional) {
|
|
4495
5627
|
return this._optional;
|