@dagger.io/dagger 0.9.7 → 0.9.8
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 +383 -54
- package/dist/api/client.gen.d.ts.map +1 -1
- package/dist/api/client.gen.js +834 -98
- package/dist/common/utils.d.ts +3 -0
- package/dist/common/utils.d.ts.map +1 -1
- package/dist/entrypoint/load.d.ts.map +1 -1
- package/dist/entrypoint/load.js +7 -9
- package/dist/entrypoint/register.js +2 -2
- package/dist/introspector/registry/registry.d.ts.map +1 -1
- package/dist/introspector/registry/registry.js +4 -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;
|
|
@@ -639,21 +649,20 @@ export class Container extends BaseClient {
|
|
|
639
649
|
});
|
|
640
650
|
};
|
|
641
651
|
/**
|
|
642
|
-
* Return
|
|
643
|
-
*
|
|
644
|
-
* Primarily intended for internal use with the dagger CLI.
|
|
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.
|
|
645
654
|
*/
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
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
|
+
});
|
|
657
666
|
};
|
|
658
667
|
/**
|
|
659
668
|
* The error stream of the last executed command.
|
|
@@ -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 "shell" API.
|
|
748
|
+
* @param args The args of the command to set the default shell to.
|
|
749
|
+
*/
|
|
750
|
+
withDefaultShell = (args) => {
|
|
751
|
+
return new Container({
|
|
752
|
+
queryTree: [
|
|
753
|
+
...this._queryTree,
|
|
754
|
+
{
|
|
755
|
+
operation: "withDefaultShell",
|
|
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
|
*/
|
|
@@ -2437,6 +2556,110 @@ export class GeneratedCode extends BaseClient {
|
|
|
2437
2556
|
return arg(this);
|
|
2438
2557
|
};
|
|
2439
2558
|
}
|
|
2559
|
+
/**
|
|
2560
|
+
* Module source originating from a git repo.
|
|
2561
|
+
*/
|
|
2562
|
+
export class GitModuleSource extends BaseClient {
|
|
2563
|
+
_id = undefined;
|
|
2564
|
+
_cloneURL = undefined;
|
|
2565
|
+
_commit = undefined;
|
|
2566
|
+
_htmlURL = undefined;
|
|
2567
|
+
_sourceSubpath = undefined;
|
|
2568
|
+
_version = undefined;
|
|
2569
|
+
/**
|
|
2570
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2571
|
+
*/
|
|
2572
|
+
constructor(parent, _id, _cloneURL, _commit, _htmlURL, _sourceSubpath, _version) {
|
|
2573
|
+
super(parent);
|
|
2574
|
+
this._id = _id;
|
|
2575
|
+
this._cloneURL = _cloneURL;
|
|
2576
|
+
this._commit = _commit;
|
|
2577
|
+
this._htmlURL = _htmlURL;
|
|
2578
|
+
this._sourceSubpath = _sourceSubpath;
|
|
2579
|
+
this._version = _version;
|
|
2580
|
+
}
|
|
2581
|
+
/**
|
|
2582
|
+
* A unique identifier for this GitModuleSource.
|
|
2583
|
+
*/
|
|
2584
|
+
id = async () => {
|
|
2585
|
+
if (this._id) {
|
|
2586
|
+
return this._id;
|
|
2587
|
+
}
|
|
2588
|
+
const response = await computeQuery([
|
|
2589
|
+
...this._queryTree,
|
|
2590
|
+
{
|
|
2591
|
+
operation: "id",
|
|
2592
|
+
},
|
|
2593
|
+
], await this._ctx.connection());
|
|
2594
|
+
return response;
|
|
2595
|
+
};
|
|
2596
|
+
/**
|
|
2597
|
+
* The URL from which the source's git repo can be cloned.
|
|
2598
|
+
*/
|
|
2599
|
+
cloneURL = async () => {
|
|
2600
|
+
if (this._cloneURL) {
|
|
2601
|
+
return this._cloneURL;
|
|
2602
|
+
}
|
|
2603
|
+
const response = await computeQuery([
|
|
2604
|
+
...this._queryTree,
|
|
2605
|
+
{
|
|
2606
|
+
operation: "cloneURL",
|
|
2607
|
+
},
|
|
2608
|
+
], await this._ctx.connection());
|
|
2609
|
+
return response;
|
|
2610
|
+
};
|
|
2611
|
+
commit = async () => {
|
|
2612
|
+
if (this._commit) {
|
|
2613
|
+
return this._commit;
|
|
2614
|
+
}
|
|
2615
|
+
const response = await computeQuery([
|
|
2616
|
+
...this._queryTree,
|
|
2617
|
+
{
|
|
2618
|
+
operation: "commit",
|
|
2619
|
+
},
|
|
2620
|
+
], await this._ctx.connection());
|
|
2621
|
+
return response;
|
|
2622
|
+
};
|
|
2623
|
+
/**
|
|
2624
|
+
* The URL to the source's git repo in a web browser
|
|
2625
|
+
*/
|
|
2626
|
+
htmlURL = async () => {
|
|
2627
|
+
if (this._htmlURL) {
|
|
2628
|
+
return this._htmlURL;
|
|
2629
|
+
}
|
|
2630
|
+
const response = await computeQuery([
|
|
2631
|
+
...this._queryTree,
|
|
2632
|
+
{
|
|
2633
|
+
operation: "htmlURL",
|
|
2634
|
+
},
|
|
2635
|
+
], await this._ctx.connection());
|
|
2636
|
+
return response;
|
|
2637
|
+
};
|
|
2638
|
+
sourceSubpath = async () => {
|
|
2639
|
+
if (this._sourceSubpath) {
|
|
2640
|
+
return this._sourceSubpath;
|
|
2641
|
+
}
|
|
2642
|
+
const response = await computeQuery([
|
|
2643
|
+
...this._queryTree,
|
|
2644
|
+
{
|
|
2645
|
+
operation: "sourceSubpath",
|
|
2646
|
+
},
|
|
2647
|
+
], await this._ctx.connection());
|
|
2648
|
+
return response;
|
|
2649
|
+
};
|
|
2650
|
+
version = async () => {
|
|
2651
|
+
if (this._version) {
|
|
2652
|
+
return this._version;
|
|
2653
|
+
}
|
|
2654
|
+
const response = await computeQuery([
|
|
2655
|
+
...this._queryTree,
|
|
2656
|
+
{
|
|
2657
|
+
operation: "version",
|
|
2658
|
+
},
|
|
2659
|
+
], await this._ctx.connection());
|
|
2660
|
+
return response;
|
|
2661
|
+
};
|
|
2662
|
+
}
|
|
2440
2663
|
/**
|
|
2441
2664
|
* A git ref (tag, branch, or commit).
|
|
2442
2665
|
*/
|
|
@@ -2719,6 +2942,71 @@ export class Host extends BaseClient {
|
|
|
2719
2942
|
});
|
|
2720
2943
|
};
|
|
2721
2944
|
}
|
|
2945
|
+
/**
|
|
2946
|
+
* A graphql input type, which is essentially just a group of named args.
|
|
2947
|
+
* This is currently only used to represent pre-existing usage of graphql input types
|
|
2948
|
+
* in the core API. It is not used by user modules and shouldn't ever be as user
|
|
2949
|
+
* module accept input objects via their id rather than graphql input types.
|
|
2950
|
+
*/
|
|
2951
|
+
export class InputTypeDef extends BaseClient {
|
|
2952
|
+
_id = undefined;
|
|
2953
|
+
_name = undefined;
|
|
2954
|
+
/**
|
|
2955
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2956
|
+
*/
|
|
2957
|
+
constructor(parent, _id, _name) {
|
|
2958
|
+
super(parent);
|
|
2959
|
+
this._id = _id;
|
|
2960
|
+
this._name = _name;
|
|
2961
|
+
}
|
|
2962
|
+
/**
|
|
2963
|
+
* A unique identifier for this InputTypeDef.
|
|
2964
|
+
*/
|
|
2965
|
+
id = async () => {
|
|
2966
|
+
if (this._id) {
|
|
2967
|
+
return this._id;
|
|
2968
|
+
}
|
|
2969
|
+
const response = await computeQuery([
|
|
2970
|
+
...this._queryTree,
|
|
2971
|
+
{
|
|
2972
|
+
operation: "id",
|
|
2973
|
+
},
|
|
2974
|
+
], await this._ctx.connection());
|
|
2975
|
+
return response;
|
|
2976
|
+
};
|
|
2977
|
+
fields = async () => {
|
|
2978
|
+
const response = await computeQuery([
|
|
2979
|
+
...this._queryTree,
|
|
2980
|
+
{
|
|
2981
|
+
operation: "fields",
|
|
2982
|
+
},
|
|
2983
|
+
{
|
|
2984
|
+
operation: "id",
|
|
2985
|
+
},
|
|
2986
|
+
], await this._ctx.connection());
|
|
2987
|
+
return response.map((r) => new FieldTypeDef({
|
|
2988
|
+
queryTree: [
|
|
2989
|
+
{
|
|
2990
|
+
operation: "loadFieldTypeDefFromID",
|
|
2991
|
+
args: { id: r.id },
|
|
2992
|
+
},
|
|
2993
|
+
],
|
|
2994
|
+
ctx: this._ctx,
|
|
2995
|
+
}, r.id));
|
|
2996
|
+
};
|
|
2997
|
+
name = async () => {
|
|
2998
|
+
if (this._name) {
|
|
2999
|
+
return this._name;
|
|
3000
|
+
}
|
|
3001
|
+
const response = await computeQuery([
|
|
3002
|
+
...this._queryTree,
|
|
3003
|
+
{
|
|
3004
|
+
operation: "name",
|
|
3005
|
+
},
|
|
3006
|
+
], await this._ctx.connection());
|
|
3007
|
+
return response;
|
|
3008
|
+
};
|
|
3009
|
+
}
|
|
2722
3010
|
/**
|
|
2723
3011
|
* A definition of a custom interface defined in a Module.
|
|
2724
3012
|
*/
|
|
@@ -2905,29 +3193,21 @@ export class ListTypeDef extends BaseClient {
|
|
|
2905
3193
|
};
|
|
2906
3194
|
}
|
|
2907
3195
|
/**
|
|
2908
|
-
*
|
|
3196
|
+
* Module source that that originates from a path locally relative to an arbitrary directory.
|
|
2909
3197
|
*/
|
|
2910
|
-
export class
|
|
3198
|
+
export class LocalModuleSource extends BaseClient {
|
|
2911
3199
|
_id = undefined;
|
|
2912
|
-
|
|
2913
|
-
_name = undefined;
|
|
2914
|
-
_sdk = undefined;
|
|
2915
|
-
_serve = undefined;
|
|
2916
|
-
_sourceDirectorySubpath = undefined;
|
|
3200
|
+
_sourceSubpath = undefined;
|
|
2917
3201
|
/**
|
|
2918
3202
|
* Constructor is used for internal usage only, do not create object from it.
|
|
2919
3203
|
*/
|
|
2920
|
-
constructor(parent, _id,
|
|
3204
|
+
constructor(parent, _id, _sourceSubpath) {
|
|
2921
3205
|
super(parent);
|
|
2922
3206
|
this._id = _id;
|
|
2923
|
-
this.
|
|
2924
|
-
this._name = _name;
|
|
2925
|
-
this._sdk = _sdk;
|
|
2926
|
-
this._serve = _serve;
|
|
2927
|
-
this._sourceDirectorySubpath = _sourceDirectorySubpath;
|
|
3207
|
+
this._sourceSubpath = _sourceSubpath;
|
|
2928
3208
|
}
|
|
2929
3209
|
/**
|
|
2930
|
-
* A unique identifier for this
|
|
3210
|
+
* A unique identifier for this LocalModuleSource.
|
|
2931
3211
|
*/
|
|
2932
3212
|
id = async () => {
|
|
2933
3213
|
if (this._id) {
|
|
@@ -2941,7 +3221,55 @@ export class Module_ extends BaseClient {
|
|
|
2941
3221
|
], await this._ctx.connection());
|
|
2942
3222
|
return response;
|
|
2943
3223
|
};
|
|
2944
|
-
|
|
3224
|
+
sourceSubpath = async () => {
|
|
3225
|
+
if (this._sourceSubpath) {
|
|
3226
|
+
return this._sourceSubpath;
|
|
3227
|
+
}
|
|
3228
|
+
const response = await computeQuery([
|
|
3229
|
+
...this._queryTree,
|
|
3230
|
+
{
|
|
3231
|
+
operation: "sourceSubpath",
|
|
3232
|
+
},
|
|
3233
|
+
], await this._ctx.connection());
|
|
3234
|
+
return response;
|
|
3235
|
+
};
|
|
3236
|
+
}
|
|
3237
|
+
/**
|
|
3238
|
+
* A Dagger module.
|
|
3239
|
+
*/
|
|
3240
|
+
export class Module_ extends BaseClient {
|
|
3241
|
+
_id = undefined;
|
|
3242
|
+
_description = undefined;
|
|
3243
|
+
_name = undefined;
|
|
3244
|
+
_sdk = undefined;
|
|
3245
|
+
_serve = undefined;
|
|
3246
|
+
/**
|
|
3247
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
3248
|
+
*/
|
|
3249
|
+
constructor(parent, _id, _description, _name, _sdk, _serve) {
|
|
3250
|
+
super(parent);
|
|
3251
|
+
this._id = _id;
|
|
3252
|
+
this._description = _description;
|
|
3253
|
+
this._name = _name;
|
|
3254
|
+
this._sdk = _sdk;
|
|
3255
|
+
this._serve = _serve;
|
|
3256
|
+
}
|
|
3257
|
+
/**
|
|
3258
|
+
* A unique identifier for this Module.
|
|
3259
|
+
*/
|
|
3260
|
+
id = async () => {
|
|
3261
|
+
if (this._id) {
|
|
3262
|
+
return this._id;
|
|
3263
|
+
}
|
|
3264
|
+
const response = await computeQuery([
|
|
3265
|
+
...this._queryTree,
|
|
3266
|
+
{
|
|
3267
|
+
operation: "id",
|
|
3268
|
+
},
|
|
3269
|
+
], await this._ctx.connection());
|
|
3270
|
+
return response;
|
|
3271
|
+
};
|
|
3272
|
+
dependencies = async () => {
|
|
2945
3273
|
const response = await computeQuery([
|
|
2946
3274
|
...this._queryTree,
|
|
2947
3275
|
{
|
|
@@ -2967,8 +3295,19 @@ export class Module_ extends BaseClient {
|
|
|
2967
3295
|
{
|
|
2968
3296
|
operation: "dependencyConfig",
|
|
2969
3297
|
},
|
|
3298
|
+
{
|
|
3299
|
+
operation: "id",
|
|
3300
|
+
},
|
|
2970
3301
|
], await this._ctx.connection());
|
|
2971
|
-
return response
|
|
3302
|
+
return response.map((r) => new ModuleDependency({
|
|
3303
|
+
queryTree: [
|
|
3304
|
+
{
|
|
3305
|
+
operation: "loadModuleDependencyFromID",
|
|
3306
|
+
args: { id: r.id },
|
|
3307
|
+
},
|
|
3308
|
+
],
|
|
3309
|
+
ctx: this._ctx,
|
|
3310
|
+
}, r.id));
|
|
2972
3311
|
};
|
|
2973
3312
|
description = async () => {
|
|
2974
3313
|
if (this._description) {
|
|
@@ -2982,12 +3321,15 @@ export class Module_ extends BaseClient {
|
|
|
2982
3321
|
], await this._ctx.connection());
|
|
2983
3322
|
return response;
|
|
2984
3323
|
};
|
|
2985
|
-
|
|
2986
|
-
|
|
3324
|
+
/**
|
|
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.
|
|
3326
|
+
*/
|
|
3327
|
+
generatedSourceRootDirectory = () => {
|
|
3328
|
+
return new Directory({
|
|
2987
3329
|
queryTree: [
|
|
2988
3330
|
...this._queryTree,
|
|
2989
3331
|
{
|
|
2990
|
-
operation: "
|
|
3332
|
+
operation: "generatedSourceRootDirectory",
|
|
2991
3333
|
},
|
|
2992
3334
|
],
|
|
2993
3335
|
ctx: this._ctx,
|
|
@@ -3059,6 +3401,17 @@ export class Module_ extends BaseClient {
|
|
|
3059
3401
|
ctx: this._ctx,
|
|
3060
3402
|
}, r.id));
|
|
3061
3403
|
};
|
|
3404
|
+
runtime = () => {
|
|
3405
|
+
return new Container({
|
|
3406
|
+
queryTree: [
|
|
3407
|
+
...this._queryTree,
|
|
3408
|
+
{
|
|
3409
|
+
operation: "runtime",
|
|
3410
|
+
},
|
|
3411
|
+
],
|
|
3412
|
+
ctx: this._ctx,
|
|
3413
|
+
});
|
|
3414
|
+
};
|
|
3062
3415
|
sdk = async () => {
|
|
3063
3416
|
if (this._sdk) {
|
|
3064
3417
|
return this._sdk;
|
|
@@ -3088,28 +3441,48 @@ export class Module_ extends BaseClient {
|
|
|
3088
3441
|
], await this._ctx.connection());
|
|
3089
3442
|
return response;
|
|
3090
3443
|
};
|
|
3091
|
-
|
|
3092
|
-
return new
|
|
3444
|
+
source = () => {
|
|
3445
|
+
return new ModuleSource({
|
|
3093
3446
|
queryTree: [
|
|
3094
3447
|
...this._queryTree,
|
|
3095
3448
|
{
|
|
3096
|
-
operation: "
|
|
3449
|
+
operation: "source",
|
|
3097
3450
|
},
|
|
3098
3451
|
],
|
|
3099
3452
|
ctx: this._ctx,
|
|
3100
3453
|
});
|
|
3101
3454
|
};
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
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
|
+
/**
|
|
3472
|
+
* Retrieves the module with the given description
|
|
3473
|
+
* @param description The description to set
|
|
3474
|
+
*/
|
|
3475
|
+
withDescription = (description) => {
|
|
3476
|
+
return new Module_({
|
|
3477
|
+
queryTree: [
|
|
3478
|
+
...this._queryTree,
|
|
3479
|
+
{
|
|
3480
|
+
operation: "withDescription",
|
|
3481
|
+
args: { description },
|
|
3482
|
+
},
|
|
3483
|
+
],
|
|
3484
|
+
ctx: this._ctx,
|
|
3485
|
+
});
|
|
3113
3486
|
};
|
|
3114
3487
|
/**
|
|
3115
3488
|
* This module plus the given Interface type and associated functions
|
|
@@ -3126,6 +3499,22 @@ export class Module_ extends BaseClient {
|
|
|
3126
3499
|
ctx: this._ctx,
|
|
3127
3500
|
});
|
|
3128
3501
|
};
|
|
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
|
+
};
|
|
3129
3518
|
/**
|
|
3130
3519
|
* This module plus the given Object type and associated functions.
|
|
3131
3520
|
*/
|
|
@@ -3142,21 +3531,32 @@ export class Module_ extends BaseClient {
|
|
|
3142
3531
|
});
|
|
3143
3532
|
};
|
|
3144
3533
|
/**
|
|
3145
|
-
*
|
|
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.
|
|
3534
|
+
* Update the module configuration to use the given SDK.
|
|
3535
|
+
* @param sdk The SDK to use.
|
|
3152
3536
|
*/
|
|
3153
|
-
|
|
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
|
+
/**
|
|
3550
|
+
* Retrieves the module with basic configuration loaded if present.
|
|
3551
|
+
* @param source The module source to initialize from.
|
|
3552
|
+
*/
|
|
3553
|
+
withSource = (source) => {
|
|
3154
3554
|
return new Module_({
|
|
3155
3555
|
queryTree: [
|
|
3156
3556
|
...this._queryTree,
|
|
3157
3557
|
{
|
|
3158
3558
|
operation: "withSource",
|
|
3159
|
-
args: {
|
|
3559
|
+
args: { source },
|
|
3160
3560
|
},
|
|
3161
3561
|
],
|
|
3162
3562
|
ctx: this._ctx,
|
|
@@ -3172,25 +3572,21 @@ export class Module_ extends BaseClient {
|
|
|
3172
3572
|
};
|
|
3173
3573
|
}
|
|
3174
3574
|
/**
|
|
3175
|
-
*
|
|
3575
|
+
* The configuration of dependency of a module.
|
|
3176
3576
|
*/
|
|
3177
|
-
export class
|
|
3577
|
+
export class ModuleDependency extends BaseClient {
|
|
3178
3578
|
_id = undefined;
|
|
3179
3579
|
_name = undefined;
|
|
3180
|
-
_root = undefined;
|
|
3181
|
-
_sdk = undefined;
|
|
3182
3580
|
/**
|
|
3183
3581
|
* Constructor is used for internal usage only, do not create object from it.
|
|
3184
3582
|
*/
|
|
3185
|
-
constructor(parent, _id, _name
|
|
3583
|
+
constructor(parent, _id, _name) {
|
|
3186
3584
|
super(parent);
|
|
3187
3585
|
this._id = _id;
|
|
3188
3586
|
this._name = _name;
|
|
3189
|
-
this._root = _root;
|
|
3190
|
-
this._sdk = _sdk;
|
|
3191
3587
|
}
|
|
3192
3588
|
/**
|
|
3193
|
-
* A unique identifier for this
|
|
3589
|
+
* A unique identifier for this ModuleDependency.
|
|
3194
3590
|
*/
|
|
3195
3591
|
id = async () => {
|
|
3196
3592
|
if (this._id) {
|
|
@@ -3204,69 +3600,209 @@ export class ModuleConfig extends BaseClient {
|
|
|
3204
3600
|
], await this._ctx.connection());
|
|
3205
3601
|
return response;
|
|
3206
3602
|
};
|
|
3207
|
-
|
|
3603
|
+
name = async () => {
|
|
3604
|
+
if (this._name) {
|
|
3605
|
+
return this._name;
|
|
3606
|
+
}
|
|
3208
3607
|
const response = await computeQuery([
|
|
3209
3608
|
...this._queryTree,
|
|
3210
3609
|
{
|
|
3211
|
-
operation: "
|
|
3610
|
+
operation: "name",
|
|
3212
3611
|
},
|
|
3213
3612
|
], await this._ctx.connection());
|
|
3214
3613
|
return response;
|
|
3215
3614
|
};
|
|
3216
|
-
|
|
3615
|
+
source = () => {
|
|
3616
|
+
return new ModuleSource({
|
|
3617
|
+
queryTree: [
|
|
3618
|
+
...this._queryTree,
|
|
3619
|
+
{
|
|
3620
|
+
operation: "source",
|
|
3621
|
+
},
|
|
3622
|
+
],
|
|
3623
|
+
ctx: this._ctx,
|
|
3624
|
+
});
|
|
3625
|
+
};
|
|
3626
|
+
}
|
|
3627
|
+
/**
|
|
3628
|
+
* The source needed to load and run a module, along with any metadata about the source such as versions/urls/etc.
|
|
3629
|
+
*/
|
|
3630
|
+
export class ModuleSource extends BaseClient {
|
|
3631
|
+
_id = undefined;
|
|
3632
|
+
_asString = undefined;
|
|
3633
|
+
_kind = undefined;
|
|
3634
|
+
_moduleName = undefined;
|
|
3635
|
+
_subpath = undefined;
|
|
3636
|
+
/**
|
|
3637
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
3638
|
+
*/
|
|
3639
|
+
constructor(parent, _id, _asString, _kind, _moduleName, _subpath) {
|
|
3640
|
+
super(parent);
|
|
3641
|
+
this._id = _id;
|
|
3642
|
+
this._asString = _asString;
|
|
3643
|
+
this._kind = _kind;
|
|
3644
|
+
this._moduleName = _moduleName;
|
|
3645
|
+
this._subpath = _subpath;
|
|
3646
|
+
}
|
|
3647
|
+
/**
|
|
3648
|
+
* A unique identifier for this ModuleSource.
|
|
3649
|
+
*/
|
|
3650
|
+
id = async () => {
|
|
3651
|
+
if (this._id) {
|
|
3652
|
+
return this._id;
|
|
3653
|
+
}
|
|
3217
3654
|
const response = await computeQuery([
|
|
3218
3655
|
...this._queryTree,
|
|
3219
3656
|
{
|
|
3220
|
-
operation: "
|
|
3657
|
+
operation: "id",
|
|
3221
3658
|
},
|
|
3222
3659
|
], await this._ctx.connection());
|
|
3223
3660
|
return response;
|
|
3224
3661
|
};
|
|
3225
|
-
|
|
3662
|
+
asGitSource = () => {
|
|
3663
|
+
return new GitModuleSource({
|
|
3664
|
+
queryTree: [
|
|
3665
|
+
...this._queryTree,
|
|
3666
|
+
{
|
|
3667
|
+
operation: "asGitSource",
|
|
3668
|
+
},
|
|
3669
|
+
],
|
|
3670
|
+
ctx: this._ctx,
|
|
3671
|
+
});
|
|
3672
|
+
};
|
|
3673
|
+
asLocalSource = () => {
|
|
3674
|
+
return new LocalModuleSource({
|
|
3675
|
+
queryTree: [
|
|
3676
|
+
...this._queryTree,
|
|
3677
|
+
{
|
|
3678
|
+
operation: "asLocalSource",
|
|
3679
|
+
},
|
|
3680
|
+
],
|
|
3681
|
+
ctx: this._ctx,
|
|
3682
|
+
});
|
|
3683
|
+
};
|
|
3684
|
+
/**
|
|
3685
|
+
* Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
|
|
3686
|
+
*/
|
|
3687
|
+
asModule = () => {
|
|
3688
|
+
return new Module_({
|
|
3689
|
+
queryTree: [
|
|
3690
|
+
...this._queryTree,
|
|
3691
|
+
{
|
|
3692
|
+
operation: "asModule",
|
|
3693
|
+
},
|
|
3694
|
+
],
|
|
3695
|
+
ctx: this._ctx,
|
|
3696
|
+
});
|
|
3697
|
+
};
|
|
3698
|
+
/**
|
|
3699
|
+
* A human readable ref string representation of this module source.
|
|
3700
|
+
*/
|
|
3701
|
+
asString = async () => {
|
|
3702
|
+
if (this._asString) {
|
|
3703
|
+
return this._asString;
|
|
3704
|
+
}
|
|
3226
3705
|
const response = await computeQuery([
|
|
3227
3706
|
...this._queryTree,
|
|
3228
3707
|
{
|
|
3229
|
-
operation: "
|
|
3708
|
+
operation: "asString",
|
|
3230
3709
|
},
|
|
3231
3710
|
], await this._ctx.connection());
|
|
3232
3711
|
return response;
|
|
3233
3712
|
};
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3713
|
+
/**
|
|
3714
|
+
* The directory containing the actual module's source code, as determined from the root directory and subpath.
|
|
3715
|
+
* @param path The path from the source directory to select.
|
|
3716
|
+
*/
|
|
3717
|
+
directory = (path) => {
|
|
3718
|
+
return new Directory({
|
|
3719
|
+
queryTree: [
|
|
3720
|
+
...this._queryTree,
|
|
3721
|
+
{
|
|
3722
|
+
operation: "directory",
|
|
3723
|
+
args: { path },
|
|
3724
|
+
},
|
|
3725
|
+
],
|
|
3726
|
+
ctx: this._ctx,
|
|
3727
|
+
});
|
|
3728
|
+
};
|
|
3729
|
+
kind = async () => {
|
|
3730
|
+
if (this._kind) {
|
|
3731
|
+
return this._kind;
|
|
3237
3732
|
}
|
|
3238
3733
|
const response = await computeQuery([
|
|
3239
3734
|
...this._queryTree,
|
|
3240
3735
|
{
|
|
3241
|
-
operation: "
|
|
3736
|
+
operation: "kind",
|
|
3242
3737
|
},
|
|
3243
3738
|
], await this._ctx.connection());
|
|
3244
3739
|
return response;
|
|
3245
3740
|
};
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3741
|
+
/**
|
|
3742
|
+
* If set, the name of the module this source references
|
|
3743
|
+
*/
|
|
3744
|
+
moduleName = async () => {
|
|
3745
|
+
if (this._moduleName) {
|
|
3746
|
+
return this._moduleName;
|
|
3249
3747
|
}
|
|
3250
3748
|
const response = await computeQuery([
|
|
3251
3749
|
...this._queryTree,
|
|
3252
3750
|
{
|
|
3253
|
-
operation: "
|
|
3751
|
+
operation: "moduleName",
|
|
3254
3752
|
},
|
|
3255
3753
|
], await this._ctx.connection());
|
|
3256
3754
|
return response;
|
|
3257
3755
|
};
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3756
|
+
/**
|
|
3757
|
+
* Resolve the provided module source arg as a dependency relative to this module source.
|
|
3758
|
+
* @param dep The dependency module source to resolve.
|
|
3759
|
+
*/
|
|
3760
|
+
resolveDependency = (dep) => {
|
|
3761
|
+
return new ModuleSource({
|
|
3762
|
+
queryTree: [
|
|
3763
|
+
...this._queryTree,
|
|
3764
|
+
{
|
|
3765
|
+
operation: "resolveDependency",
|
|
3766
|
+
args: { dep },
|
|
3767
|
+
},
|
|
3768
|
+
],
|
|
3769
|
+
ctx: this._ctx,
|
|
3770
|
+
});
|
|
3771
|
+
};
|
|
3772
|
+
rootDirectory = () => {
|
|
3773
|
+
return new Directory({
|
|
3774
|
+
queryTree: [
|
|
3775
|
+
...this._queryTree,
|
|
3776
|
+
{
|
|
3777
|
+
operation: "rootDirectory",
|
|
3778
|
+
},
|
|
3779
|
+
],
|
|
3780
|
+
ctx: this._ctx,
|
|
3781
|
+
});
|
|
3782
|
+
};
|
|
3783
|
+
/**
|
|
3784
|
+
* The path to the module subdirectory containing the actual module's source code.
|
|
3785
|
+
*/
|
|
3786
|
+
subpath = async () => {
|
|
3787
|
+
if (this._subpath) {
|
|
3788
|
+
return this._subpath;
|
|
3261
3789
|
}
|
|
3262
3790
|
const response = await computeQuery([
|
|
3263
3791
|
...this._queryTree,
|
|
3264
3792
|
{
|
|
3265
|
-
operation: "
|
|
3793
|
+
operation: "subpath",
|
|
3266
3794
|
},
|
|
3267
3795
|
], await this._ctx.connection());
|
|
3268
3796
|
return response;
|
|
3269
3797
|
};
|
|
3798
|
+
/**
|
|
3799
|
+
* Call the provided function with current ModuleSource.
|
|
3800
|
+
*
|
|
3801
|
+
* This is useful for reusability and readability by not breaking the calling chain.
|
|
3802
|
+
*/
|
|
3803
|
+
with = (arg) => {
|
|
3804
|
+
return arg(this);
|
|
3805
|
+
};
|
|
3270
3806
|
}
|
|
3271
3807
|
/**
|
|
3272
3808
|
* A definition of a custom object defined in a Module.
|
|
@@ -3395,15 +3931,17 @@ export class ObjectTypeDef extends BaseClient {
|
|
|
3395
3931
|
export class Port extends BaseClient {
|
|
3396
3932
|
_id = undefined;
|
|
3397
3933
|
_description = undefined;
|
|
3934
|
+
_experimentalSkipHealthcheck = undefined;
|
|
3398
3935
|
_port = undefined;
|
|
3399
3936
|
_protocol = undefined;
|
|
3400
3937
|
/**
|
|
3401
3938
|
* Constructor is used for internal usage only, do not create object from it.
|
|
3402
3939
|
*/
|
|
3403
|
-
constructor(parent, _id, _description, _port, _protocol) {
|
|
3940
|
+
constructor(parent, _id, _description, _experimentalSkipHealthcheck, _port, _protocol) {
|
|
3404
3941
|
super(parent);
|
|
3405
3942
|
this._id = _id;
|
|
3406
3943
|
this._description = _description;
|
|
3944
|
+
this._experimentalSkipHealthcheck = _experimentalSkipHealthcheck;
|
|
3407
3945
|
this._port = _port;
|
|
3408
3946
|
this._protocol = _protocol;
|
|
3409
3947
|
}
|
|
@@ -3434,6 +3972,18 @@ export class Port extends BaseClient {
|
|
|
3434
3972
|
], await this._ctx.connection());
|
|
3435
3973
|
return response;
|
|
3436
3974
|
};
|
|
3975
|
+
experimentalSkipHealthcheck = async () => {
|
|
3976
|
+
if (this._experimentalSkipHealthcheck) {
|
|
3977
|
+
return this._experimentalSkipHealthcheck;
|
|
3978
|
+
}
|
|
3979
|
+
const response = await computeQuery([
|
|
3980
|
+
...this._queryTree,
|
|
3981
|
+
{
|
|
3982
|
+
operation: "experimentalSkipHealthcheck",
|
|
3983
|
+
},
|
|
3984
|
+
], await this._ctx.connection());
|
|
3985
|
+
return response;
|
|
3986
|
+
};
|
|
3437
3987
|
port = async () => {
|
|
3438
3988
|
if (this._port) {
|
|
3439
3989
|
return this._port;
|
|
@@ -3561,7 +4111,7 @@ export class Client extends BaseClient {
|
|
|
3561
4111
|
* The module currently being served in the session, if any.
|
|
3562
4112
|
*/
|
|
3563
4113
|
currentModule = () => {
|
|
3564
|
-
return new
|
|
4114
|
+
return new CurrentModule({
|
|
3565
4115
|
queryTree: [
|
|
3566
4116
|
...this._queryTree,
|
|
3567
4117
|
{
|
|
@@ -3754,6 +4304,21 @@ export class Client extends BaseClient {
|
|
|
3754
4304
|
ctx: this._ctx,
|
|
3755
4305
|
});
|
|
3756
4306
|
};
|
|
4307
|
+
/**
|
|
4308
|
+
* Load a CurrentModule from its ID.
|
|
4309
|
+
*/
|
|
4310
|
+
loadCurrentModuleFromID = (id) => {
|
|
4311
|
+
return new CurrentModule({
|
|
4312
|
+
queryTree: [
|
|
4313
|
+
...this._queryTree,
|
|
4314
|
+
{
|
|
4315
|
+
operation: "loadCurrentModuleFromID",
|
|
4316
|
+
args: { id },
|
|
4317
|
+
},
|
|
4318
|
+
],
|
|
4319
|
+
ctx: this._ctx,
|
|
4320
|
+
});
|
|
4321
|
+
};
|
|
3757
4322
|
/**
|
|
3758
4323
|
* Load a Directory from its ID.
|
|
3759
4324
|
*/
|
|
@@ -3889,6 +4454,21 @@ export class Client extends BaseClient {
|
|
|
3889
4454
|
ctx: this._ctx,
|
|
3890
4455
|
});
|
|
3891
4456
|
};
|
|
4457
|
+
/**
|
|
4458
|
+
* Load a GitModuleSource from its ID.
|
|
4459
|
+
*/
|
|
4460
|
+
loadGitModuleSourceFromID = (id) => {
|
|
4461
|
+
return new GitModuleSource({
|
|
4462
|
+
queryTree: [
|
|
4463
|
+
...this._queryTree,
|
|
4464
|
+
{
|
|
4465
|
+
operation: "loadGitModuleSourceFromID",
|
|
4466
|
+
args: { id },
|
|
4467
|
+
},
|
|
4468
|
+
],
|
|
4469
|
+
ctx: this._ctx,
|
|
4470
|
+
});
|
|
4471
|
+
};
|
|
3892
4472
|
/**
|
|
3893
4473
|
* Load a GitRef from its ID.
|
|
3894
4474
|
*/
|
|
@@ -3934,6 +4514,21 @@ export class Client extends BaseClient {
|
|
|
3934
4514
|
ctx: this._ctx,
|
|
3935
4515
|
});
|
|
3936
4516
|
};
|
|
4517
|
+
/**
|
|
4518
|
+
* Load a InputTypeDef from its ID.
|
|
4519
|
+
*/
|
|
4520
|
+
loadInputTypeDefFromID = (id) => {
|
|
4521
|
+
return new InputTypeDef({
|
|
4522
|
+
queryTree: [
|
|
4523
|
+
...this._queryTree,
|
|
4524
|
+
{
|
|
4525
|
+
operation: "loadInputTypeDefFromID",
|
|
4526
|
+
args: { id },
|
|
4527
|
+
},
|
|
4528
|
+
],
|
|
4529
|
+
ctx: this._ctx,
|
|
4530
|
+
});
|
|
4531
|
+
};
|
|
3937
4532
|
/**
|
|
3938
4533
|
* Load a InterfaceTypeDef from its ID.
|
|
3939
4534
|
*/
|
|
@@ -3980,14 +4575,29 @@ export class Client extends BaseClient {
|
|
|
3980
4575
|
});
|
|
3981
4576
|
};
|
|
3982
4577
|
/**
|
|
3983
|
-
* Load a
|
|
4578
|
+
* Load a LocalModuleSource from its ID.
|
|
3984
4579
|
*/
|
|
3985
|
-
|
|
3986
|
-
return new
|
|
4580
|
+
loadLocalModuleSourceFromID = (id) => {
|
|
4581
|
+
return new LocalModuleSource({
|
|
3987
4582
|
queryTree: [
|
|
3988
4583
|
...this._queryTree,
|
|
3989
4584
|
{
|
|
3990
|
-
operation: "
|
|
4585
|
+
operation: "loadLocalModuleSourceFromID",
|
|
4586
|
+
args: { id },
|
|
4587
|
+
},
|
|
4588
|
+
],
|
|
4589
|
+
ctx: this._ctx,
|
|
4590
|
+
});
|
|
4591
|
+
};
|
|
4592
|
+
/**
|
|
4593
|
+
* Load a ModuleDependency from its ID.
|
|
4594
|
+
*/
|
|
4595
|
+
loadModuleDependencyFromID = (id) => {
|
|
4596
|
+
return new ModuleDependency({
|
|
4597
|
+
queryTree: [
|
|
4598
|
+
...this._queryTree,
|
|
4599
|
+
{
|
|
4600
|
+
operation: "loadModuleDependencyFromID",
|
|
3991
4601
|
args: { id },
|
|
3992
4602
|
},
|
|
3993
4603
|
],
|
|
@@ -4009,6 +4619,21 @@ export class Client extends BaseClient {
|
|
|
4009
4619
|
ctx: this._ctx,
|
|
4010
4620
|
});
|
|
4011
4621
|
};
|
|
4622
|
+
/**
|
|
4623
|
+
* Load a ModuleSource from its ID.
|
|
4624
|
+
*/
|
|
4625
|
+
loadModuleSourceFromID = (id) => {
|
|
4626
|
+
return new ModuleSource({
|
|
4627
|
+
queryTree: [
|
|
4628
|
+
...this._queryTree,
|
|
4629
|
+
{
|
|
4630
|
+
operation: "loadModuleSourceFromID",
|
|
4631
|
+
args: { id },
|
|
4632
|
+
},
|
|
4633
|
+
],
|
|
4634
|
+
ctx: this._ctx,
|
|
4635
|
+
});
|
|
4636
|
+
};
|
|
4012
4637
|
/**
|
|
4013
4638
|
* Load a ObjectTypeDef from its ID.
|
|
4014
4639
|
*/
|
|
@@ -4084,6 +4709,21 @@ export class Client extends BaseClient {
|
|
|
4084
4709
|
ctx: this._ctx,
|
|
4085
4710
|
});
|
|
4086
4711
|
};
|
|
4712
|
+
/**
|
|
4713
|
+
* Load a Terminal from its ID.
|
|
4714
|
+
*/
|
|
4715
|
+
loadTerminalFromID = (id) => {
|
|
4716
|
+
return new Terminal({
|
|
4717
|
+
queryTree: [
|
|
4718
|
+
...this._queryTree,
|
|
4719
|
+
{
|
|
4720
|
+
operation: "loadTerminalFromID",
|
|
4721
|
+
args: { id },
|
|
4722
|
+
},
|
|
4723
|
+
],
|
|
4724
|
+
ctx: this._ctx,
|
|
4725
|
+
});
|
|
4726
|
+
};
|
|
4087
4727
|
/**
|
|
4088
4728
|
* Load a TypeDef from its ID.
|
|
4089
4729
|
*/
|
|
@@ -4114,15 +4754,35 @@ export class Client extends BaseClient {
|
|
|
4114
4754
|
});
|
|
4115
4755
|
};
|
|
4116
4756
|
/**
|
|
4117
|
-
*
|
|
4757
|
+
* Create a new module dependency configuration from a module source and name
|
|
4758
|
+
* @param source The source of the dependency
|
|
4759
|
+
* @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.
|
|
4760
|
+
*/
|
|
4761
|
+
moduleDependency = (source, opts) => {
|
|
4762
|
+
return new ModuleDependency({
|
|
4763
|
+
queryTree: [
|
|
4764
|
+
...this._queryTree,
|
|
4765
|
+
{
|
|
4766
|
+
operation: "moduleDependency",
|
|
4767
|
+
args: { source, ...opts },
|
|
4768
|
+
},
|
|
4769
|
+
],
|
|
4770
|
+
ctx: this._ctx,
|
|
4771
|
+
});
|
|
4772
|
+
};
|
|
4773
|
+
/**
|
|
4774
|
+
* Create a new module source instance from a source ref string.
|
|
4775
|
+
* @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
|
+
* @param opts.stable If true, enforce that the source is a stable version for source kinds that support versioning.
|
|
4118
4778
|
*/
|
|
4119
|
-
|
|
4120
|
-
return new
|
|
4779
|
+
moduleSource = (refString, opts) => {
|
|
4780
|
+
return new ModuleSource({
|
|
4121
4781
|
queryTree: [
|
|
4122
4782
|
...this._queryTree,
|
|
4123
4783
|
{
|
|
4124
|
-
operation: "
|
|
4125
|
-
args: {
|
|
4784
|
+
operation: "moduleSource",
|
|
4785
|
+
args: { refString, ...opts },
|
|
4126
4786
|
},
|
|
4127
4787
|
],
|
|
4128
4788
|
ctx: this._ctx,
|
|
@@ -4273,16 +4933,18 @@ export class Service extends BaseClient {
|
|
|
4273
4933
|
_hostname = undefined;
|
|
4274
4934
|
_start = undefined;
|
|
4275
4935
|
_stop = undefined;
|
|
4936
|
+
_up = undefined;
|
|
4276
4937
|
/**
|
|
4277
4938
|
* Constructor is used for internal usage only, do not create object from it.
|
|
4278
4939
|
*/
|
|
4279
|
-
constructor(parent, _id, _endpoint, _hostname, _start, _stop) {
|
|
4940
|
+
constructor(parent, _id, _endpoint, _hostname, _start, _stop, _up) {
|
|
4280
4941
|
super(parent);
|
|
4281
4942
|
this._id = _id;
|
|
4282
4943
|
this._endpoint = _endpoint;
|
|
4283
4944
|
this._hostname = _hostname;
|
|
4284
4945
|
this._start = _start;
|
|
4285
4946
|
this._stop = _stop;
|
|
4947
|
+
this._up = _up;
|
|
4286
4948
|
}
|
|
4287
4949
|
/**
|
|
4288
4950
|
* A unique identifier for this Service.
|
|
@@ -4375,16 +5037,34 @@ export class Service extends BaseClient {
|
|
|
4375
5037
|
};
|
|
4376
5038
|
/**
|
|
4377
5039
|
* Stop the service.
|
|
5040
|
+
* @param opts.kill Immediately kill the service without waiting for a graceful exit
|
|
4378
5041
|
*/
|
|
4379
|
-
stop = async () => {
|
|
5042
|
+
stop = async (opts) => {
|
|
4380
5043
|
await computeQuery([
|
|
4381
5044
|
...this._queryTree,
|
|
4382
5045
|
{
|
|
4383
5046
|
operation: "stop",
|
|
5047
|
+
args: { ...opts },
|
|
4384
5048
|
},
|
|
4385
5049
|
], await this._ctx.connection());
|
|
4386
5050
|
return this;
|
|
4387
5051
|
};
|
|
5052
|
+
/**
|
|
5053
|
+
* Creates a tunnel that forwards traffic from the caller's network to this service.
|
|
5054
|
+
*/
|
|
5055
|
+
up = async (opts) => {
|
|
5056
|
+
if (this._up) {
|
|
5057
|
+
return this._up;
|
|
5058
|
+
}
|
|
5059
|
+
const response = await computeQuery([
|
|
5060
|
+
...this._queryTree,
|
|
5061
|
+
{
|
|
5062
|
+
operation: "up",
|
|
5063
|
+
args: { ...opts },
|
|
5064
|
+
},
|
|
5065
|
+
], await this._ctx.connection());
|
|
5066
|
+
return response;
|
|
5067
|
+
};
|
|
4388
5068
|
}
|
|
4389
5069
|
/**
|
|
4390
5070
|
* A Unix or TCP/IP socket that can be mounted into a container.
|
|
@@ -4414,6 +5094,51 @@ export class Socket extends BaseClient {
|
|
|
4414
5094
|
return response;
|
|
4415
5095
|
};
|
|
4416
5096
|
}
|
|
5097
|
+
/**
|
|
5098
|
+
* An interactive terminal that clients can connect to.
|
|
5099
|
+
*/
|
|
5100
|
+
export class Terminal extends BaseClient {
|
|
5101
|
+
_id = undefined;
|
|
5102
|
+
_websocketEndpoint = undefined;
|
|
5103
|
+
/**
|
|
5104
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
5105
|
+
*/
|
|
5106
|
+
constructor(parent, _id, _websocketEndpoint) {
|
|
5107
|
+
super(parent);
|
|
5108
|
+
this._id = _id;
|
|
5109
|
+
this._websocketEndpoint = _websocketEndpoint;
|
|
5110
|
+
}
|
|
5111
|
+
/**
|
|
5112
|
+
* A unique identifier for this Terminal.
|
|
5113
|
+
*/
|
|
5114
|
+
id = async () => {
|
|
5115
|
+
if (this._id) {
|
|
5116
|
+
return this._id;
|
|
5117
|
+
}
|
|
5118
|
+
const response = await computeQuery([
|
|
5119
|
+
...this._queryTree,
|
|
5120
|
+
{
|
|
5121
|
+
operation: "id",
|
|
5122
|
+
},
|
|
5123
|
+
], await this._ctx.connection());
|
|
5124
|
+
return response;
|
|
5125
|
+
};
|
|
5126
|
+
/**
|
|
5127
|
+
* An http endpoint at which this terminal can be connected to over a websocket.
|
|
5128
|
+
*/
|
|
5129
|
+
websocketEndpoint = async () => {
|
|
5130
|
+
if (this._websocketEndpoint) {
|
|
5131
|
+
return this._websocketEndpoint;
|
|
5132
|
+
}
|
|
5133
|
+
const response = await computeQuery([
|
|
5134
|
+
...this._queryTree,
|
|
5135
|
+
{
|
|
5136
|
+
operation: "websocketEndpoint",
|
|
5137
|
+
},
|
|
5138
|
+
], await this._ctx.connection());
|
|
5139
|
+
return response;
|
|
5140
|
+
};
|
|
5141
|
+
}
|
|
4417
5142
|
/**
|
|
4418
5143
|
* A definition of a parameter or return type in a Module.
|
|
4419
5144
|
*/
|
|
@@ -4445,6 +5170,17 @@ export class TypeDef extends BaseClient {
|
|
|
4445
5170
|
], await this._ctx.connection());
|
|
4446
5171
|
return response;
|
|
4447
5172
|
};
|
|
5173
|
+
asInput = () => {
|
|
5174
|
+
return new InputTypeDef({
|
|
5175
|
+
queryTree: [
|
|
5176
|
+
...this._queryTree,
|
|
5177
|
+
{
|
|
5178
|
+
operation: "asInput",
|
|
5179
|
+
},
|
|
5180
|
+
],
|
|
5181
|
+
ctx: this._ctx,
|
|
5182
|
+
});
|
|
5183
|
+
};
|
|
4448
5184
|
asInterface = () => {
|
|
4449
5185
|
return new InterfaceTypeDef({
|
|
4450
5186
|
queryTree: [
|